.keirin-hit-history {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-height: 46px;
  margin: 0 0 20px;
  overflow: hidden;
  border: 1px solid #292929;
  border-radius: 8px;
  background: #050505;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .2);
  color: #fff;
  font-size: 13px;
  line-height: 1.2;
  box-sizing: border-box;
}

.keirin-hit-history--shortcode {
  margin-top: 16px;
  margin-bottom: 16px;
}

.keirin-hit-history--overlay {
  position: fixed;
  z-index: 9997;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  left: 18px;
  width: auto;
  max-width: 1180px;
  margin: 0 auto;
  border-color: #444;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .42);
}

.keirin-hit-history__badge {
  position: relative;
  z-index: 2;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  background: linear-gradient(135deg, #a30000, #d20d0d);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .05em;
  white-space: nowrap;
  box-shadow: 5px 0 12px rgba(0, 0, 0, .35);
}

.keirin-hit-history__badge span {
  color: #ffd45a;
  font-size: 9px;
  animation: keirin-hit-pulse 1.4s ease-in-out infinite;
}

.keirin-hit-history__viewport {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.keirin-hit-history__track {
  display: flex;
  width: max-content;
  min-width: 100%;
  height: 100%;
  animation: keirin-hit-scroll var(--keirin-hit-duration, 100s) linear infinite;
  will-change: transform;
}

.keirin-hit-history__track.is-static {
  width: 100%;
  animation: none;
}

.keirin-hit-history__group {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
}

.keirin-hit-history__item {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 16px;
  border-right: 1px solid #303030;
  color: #f4f4f4 !important;
  text-decoration: none !important;
  white-space: nowrap;
  box-sizing: border-box;
}

.keirin-hit-history__item.is-high-payout {
  overflow: hidden;
  border-top: 1px solid rgba(255, 212, 90, .65);
  border-bottom: 1px solid rgba(255, 212, 90, .65);
  background: linear-gradient(90deg, rgba(104, 69, 0, .3), rgba(31, 22, 0, .72), rgba(104, 69, 0, .3));
  box-shadow: inset 0 0 14px rgba(255, 193, 7, .18);
}

.keirin-hit-history__item.is-high-payout::after {
  position: absolute;
  top: -40%;
  bottom: -40%;
  left: -35%;
  width: 24%;
  background: linear-gradient(90deg, transparent, rgba(255, 244, 188, .62), transparent);
  content: '';
  pointer-events: none;
  transform: skewX(-18deg);
  animation: keirin-high-payout-shine 2.8s ease-in-out infinite;
}

.keirin-hit-history__item.is-high-payout .keirin-hit-history__hit {
  background: linear-gradient(135deg, #b76e00, #f0aa00);
  box-shadow: 0 0 8px rgba(255, 193, 7, .5);
}

.keirin-hit-history__item.is-high-payout .keirin-hit-history__payout {
  color: #ffe070;
  font-size: 14px;
  text-shadow: 0 0 9px rgba(255, 193, 7, .7);
  animation: keirin-high-payout-pulse 1.5s ease-in-out infinite;
}

.keirin-hit-history__item:hover,
.keirin-hit-history__item:focus-visible {
  background: #1c1c1c;
  color: #fff !important;
}

.keirin-hit-history__date,
.keirin-hit-history__race {
  color: #a9a9a9;
  font-size: 11px;
}

.keirin-hit-history__venue {
  color: #fff;
  font-size: 12px;
}

.keirin-hit-history__hit {
  padding: 3px 6px;
  border-radius: 4px;
  background: #b00000;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.keirin-hit-history__combination {
  color: #ffd45a;
  font-size: 14px;
  letter-spacing: .05em;
}

.keirin-hit-history__payout {
  color: #6ee7a8;
  font-size: 12px;
  font-weight: 800;
}

.keirin-hit-history__arrow {
  color: #777;
  font-size: 18px;
}

.keirin-hit-history__loading,
.keirin-hit-history__empty {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  color: #bdbdbd;
  font-size: 12px;
}

.keirin-hit-history__close {
  display: inline-flex;
  flex: 0 0 44px;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-left: 1px solid #303030;
  background: #111;
  color: #ddd;
  font: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.keirin-hit-history__close:hover,
.keirin-hit-history__close:focus-visible {
  background: #292929;
  color: #fff;
}

.keirin-hit-history__close:focus-visible {
  outline: 2px solid #ffd45a;
  outline-offset: -4px;
}

.keirin-hit-history:hover .keirin-hit-history__track,
.keirin-hit-history:focus-within .keirin-hit-history__track {
  animation-play-state: paused;
}

@keyframes keirin-hit-scroll {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}

@keyframes keirin-hit-pulse {
  0%, 100% { opacity: .45; }
  50% { opacity: 1; }
}

@keyframes keirin-high-payout-shine {
  0%, 35% { left: -35%; opacity: 0; }
  50% { opacity: 1; }
  70%, 100% { left: 115%; opacity: 0; }
}

@keyframes keirin-high-payout-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

@media (max-width: 600px) {
  .keirin-hit-history {
    min-height: 42px;
    margin-bottom: 14px;
    border-radius: 6px;
  }

  .keirin-hit-history__badge {
    padding: 0 9px;
    font-size: 10px;
  }

  .keirin-hit-history--overlay {
    right: 7px;
    bottom: calc(7px + env(safe-area-inset-bottom));
    left: 7px;
    width: auto;
    max-width: none;
    margin: 0;
    border-radius: 7px;
    box-shadow: 0 6px 22px rgba(0, 0, 0, .5);
  }

  .keirin-hit-history__item {
    min-height: 40px;
    gap: 5px;
    padding: 0 11px;
  }

  .keirin-hit-history__loading,
  .keirin-hit-history__empty {
    min-height: 40px;
  }

  .keirin-hit-history__close {
    flex-basis: 40px;
    width: 40px;
    min-height: 40px;
    font-size: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .keirin-hit-history__viewport {
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .keirin-hit-history__track {
    animation: none;
    transform: none;
  }

  .keirin-hit-history__group[aria-hidden="true"] {
    display: none;
  }

  .keirin-hit-history__badge span {
    animation: none;
  }

  .keirin-hit-history__item.is-high-payout::after,
  .keirin-hit-history__item.is-high-payout .keirin-hit-history__payout {
    animation: none;
  }
}
