:root {
  color-scheme: dark;
  --bg: #07090d;
  --panel: #0e1518;
  --panel-2: #15101a;
  --ink: #f6f3e7;
  --muted: #9aa7a3;
  --green: #39ff9a;
  --cyan: #65d9ff;
  --amber: #ffc857;
  --red: #ff4f6a;
  --violet: #a982ff;
  --line: rgba(246, 243, 231, 0.18);
  --strong-line: rgba(57, 255, 154, 0.45);
  --shadow: rgba(57, 255, 154, 0.18);
}

* {
  box-sizing: border-box;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Courier New", Consolas, monospace;
  font-size: 16px;
  overflow-x: hidden;
  background:
    linear-gradient(90deg, rgba(7, 9, 13, 0.94), rgba(7, 9, 13, 0.5) 22%, rgba(7, 9, 13, 0.5) 78%, rgba(7, 9, 13, 0.94)),
    linear-gradient(180deg, rgba(7, 9, 13, 0.3), rgba(7, 9, 13, 0.86)),
    url("assets/cyclops-racing-backdrop.svg") center top / cover fixed no-repeat,
    linear-gradient(rgba(57, 255, 154, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(101, 217, 255, 0.045) 1px, transparent 1px),
    linear-gradient(135deg, rgba(57, 255, 154, 0.16), transparent 32%),
    linear-gradient(315deg, rgba(169, 130, 255, 0.14), transparent 30%),
    linear-gradient(135deg, #050608 0%, #0f1518 56%, #150b13 100%);
  background-size: 34px 34px, 34px 34px, auto, auto, auto;
  letter-spacing: 0;
}

.confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}

.confetti-canvas.is-active {
  display: block;
}

.boot-loader {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 38%, rgba(57, 255, 154, 0.18), transparent 28%),
    rgba(7, 9, 13, 0.96);
  transition: opacity 220ms ease, visibility 220ms ease;
}

.boot-loader.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.boot-loader > div {
  display: grid;
  justify-items: center;
  gap: 10px;
  border: 1px solid rgba(57, 255, 154, 0.42);
  border-radius: 8px;
  padding: 24px;
  background: rgba(14, 21, 24, 0.94);
  box-shadow: 0 0 34px rgba(57, 255, 154, 0.18);
}

.boot-loader img {
  width: 72px;
  height: 72px;
  border-radius: 8px;
}

.boot-loader strong {
  color: var(--green);
  font-size: 1.25rem;
  text-transform: uppercase;
}

.boot-loader span {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.celebration-toast {
  position: fixed;
  z-index: 210;
  right: 18px;
  bottom: 18px;
  max-width: min(380px, calc(100vw - 36px));
  border: 1px solid rgba(255, 200, 87, 0.64);
  border-radius: 8px;
  padding: 13px 15px;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(255, 200, 87, 0.16), rgba(57, 255, 154, 0.1)),
    rgba(7, 9, 13, 0.95);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.46), 0 0 22px rgba(255, 200, 87, 0.22);
  font-weight: 900;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.celebration-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.live-race-alert {
  position: fixed;
  z-index: 220;
  top: 18px;
  right: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 16px;
  align-items: center;
  width: min(720px, calc(100vw - 36px));
  border: 1px solid rgba(57, 255, 154, 0.62);
  border-radius: 10px;
  padding: 18px;
  background:
    linear-gradient(90deg, rgba(57, 255, 154, 0.14), rgba(101, 217, 255, 0.1)),
    rgba(7, 9, 13, 0.96);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.46), 0 0 24px rgba(57, 255, 154, 0.24);
}

.live-race-alert[hidden] {
  display: none;
}

.live-race-alert span,
.live-race-alert strong,
.live-race-alert small {
  display: block;
}

.live-race-alert span {
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.live-race-alert strong {
  color: var(--ink);
  font-size: 1.42rem;
}

.live-race-alert small {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.live-race-alert .button {
  min-width: 132px;
  min-height: 48px;
}

.alert-close {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(246, 243, 231, 0.2);
  border-radius: 6px;
  color: var(--ink);
  background: rgba(7, 9, 13, 0.72);
  cursor: pointer;
}

.alert-close:hover,
.alert-close:focus-visible {
  border-color: rgba(255, 200, 87, 0.66);
  color: var(--amber);
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

input,
select {
  color: var(--ink);
  border: 1px solid rgba(246, 243, 231, 0.18);
  border-radius: 6px;
  background: rgba(7, 9, 13, 0.72);
}

.app-shell {
  display: flex;
  flex-direction: column;
  width: min(1640px, calc(100% - 16px));
  min-height: calc(100vh - 16px);
  margin: 8px auto;
  border: 1px solid var(--strong-line);
  border-radius: 8px;
  background: rgba(7, 9, 13, 0.94);
  box-shadow: 0 0 0 1px rgba(57, 255, 154, 0.14), 0 28px 70px rgba(0, 0, 0, 0.46);
  overflow: visible;
}

.view-tabs {
  position: sticky;
  top: 0;
  z-index: 20;
}

.hero {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 116px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 18% 8%, rgba(57, 255, 154, 0.22), transparent 35%),
    radial-gradient(circle at 90% 14%, rgba(255, 200, 87, 0.12), transparent 28%),
    linear-gradient(90deg, rgba(57, 255, 154, 0.12), rgba(101, 217, 255, 0.04)),
    rgba(14, 21, 24, 0.9);
}

.hero-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.brand-mark {
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  border: 1px solid var(--strong-line);
  border-radius: 8px;
  object-fit: cover;
  background: #060806;
  box-shadow: 0 0 26px rgba(57, 255, 154, 0.22);
}

.social-dock {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: end;
}

.social-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 2px solid rgba(246, 243, 231, 0.84);
  border-radius: 2px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 200, 87, 0.1), rgba(7, 9, 13, 0.3)),
    rgba(7, 9, 13, 0.72);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.72);
  text-decoration: none;
  transition: border-color 150ms ease, color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.social-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.35;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.social-icon:hover,
.social-icon:focus-visible {
  border-color: var(--green);
  color: var(--green);
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.76), 0 0 16px rgba(57, 255, 154, 0.2);
}

.social-icon:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin: 0;
  max-width: 100%;
  font-size: clamp(2.05rem, 4.6vw, 4.4rem);
  line-height: 0.94;
  text-transform: uppercase;
  text-shadow: 0 0 18px rgba(57, 255, 154, 0.24);
}

h1 span {
  display: block;
}

h2 {
  margin: 0;
  font-size: clamp(1.75rem, 3vw, 2.7rem);
  line-height: 0.96;
  text-transform: uppercase;
}

h3 {
  margin: 0;
  text-transform: uppercase;
}

.brand-title {
  min-width: 0;
}

.hero-subtitle {
  max-width: 760px;
  margin: 0;
  color: rgba(246, 243, 231, 0.82);
  font-size: clamp(0.92rem, 1.2vw, 1.08rem);
  font-weight: 800;
  line-height: 1.38;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-actions .button {
  min-height: 46px;
}

.event-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 18px;
  align-items: center;
  min-height: 218px;
  padding: 20px 28px;
  border-left: 1px solid var(--line);
  background:
    radial-gradient(circle at 86% 18%, rgba(57, 255, 154, 0.18), transparent 32%),
    linear-gradient(135deg, rgba(255, 200, 87, 0.1), rgba(169, 130, 255, 0.1)),
    rgba(21, 16, 26, 0.84);
}

.event-card img {
  width: 78px;
  height: 78px;
  justify-self: center;
  border: 1px solid rgba(246, 243, 231, 0.18);
  border-radius: 8px;
  object-fit: cover;
  filter: drop-shadow(0 0 18px rgba(57, 255, 154, 0.22));
}

.event-card strong,
.event-card em {
  display: block;
  font-style: normal;
  text-align: right;
}

.event-card strong {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: clamp(1.45rem, 2.8vw, 2.65rem);
  line-height: 0.98;
}

.event-card em {
  color: var(--green);
  font-size: clamp(1rem, 1.45vw, 1.28rem);
  font-weight: 800;
  line-height: 1.22;
}

.product-strip {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border-bottom: 1px solid var(--line);
  background: rgba(246, 243, 231, 0.12);
}

.product-strip article {
  display: grid;
  gap: 5px;
  min-height: 70px;
  padding: 13px 18px;
  background:
    linear-gradient(90deg, rgba(57, 255, 154, 0.06), transparent),
    rgba(8, 11, 15, 0.9);
}

.product-strip span {
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.product-strip strong {
  color: rgba(246, 243, 231, 0.86);
  font-size: 0.9rem;
  line-height: 1.25;
}

.view-tabs {
  flex: 0 0 auto;
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 62px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 11, 15, 0.84);
  overflow-x: auto;
}

.button,
.tab,
.filter,
.refresh-button {
  min-height: 42px;
  border: 1px solid rgba(246, 243, 231, 0.18);
  border-radius: 6px;
  color: var(--ink);
  background: rgba(246, 243, 231, 0.06);
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.button:disabled,
.tab:disabled,
.filter:disabled,
.refresh-button:disabled {
  cursor: wait;
  opacity: 0.56;
}

.button,
.tab,
.filter,
.refresh-button {
  padding: 9px 15px;
}

.button.primary,
.tab.active,
.filter.active {
  border-color: var(--green);
  color: #06100b;
  background: var(--green);
  box-shadow: 0 0 18px rgba(57, 255, 154, 0.18);
}

.tab.results-tab {
  border-color: rgba(255, 200, 87, 0.72);
  color: var(--amber);
  background: rgba(255, 200, 87, 0.1);
  box-shadow: 0 0 18px rgba(255, 200, 87, 0.16);
}

.tab.results-tab.active {
  border-color: var(--amber);
  color: #120d02;
  background: var(--amber);
  box-shadow: 0 0 24px rgba(255, 200, 87, 0.28);
}

.button.secondary {
  border-color: rgba(101, 217, 255, 0.46);
  background: rgba(101, 217, 255, 0.1);
}

.button.ghost {
  border-color: rgba(255, 200, 87, 0.34);
  color: var(--amber);
  background: rgba(255, 200, 87, 0.08);
}

.button.ghost[aria-pressed="true"] {
  border-color: rgba(57, 255, 154, 0.58);
  color: var(--green);
  background: rgba(57, 255, 154, 0.1);
}

.test-toggle {
  border-color: rgba(255, 200, 87, 0.36);
  color: var(--amber);
  background: rgba(255, 200, 87, 0.08);
}

.test-toggle[aria-pressed="true"] {
  border-color: rgba(255, 200, 87, 0.72);
  color: #06100b;
  background: var(--amber);
  box-shadow: 0 0 18px rgba(255, 200, 87, 0.22);
}

.button.is-copied {
  border-color: rgba(255, 200, 87, 0.72);
  color: #06100b;
  background: var(--amber);
}

.button:hover,
.tab:hover,
.filter:hover,
.refresh-button:hover {
  border-color: var(--green);
  box-shadow: 0 0 16px rgba(57, 255, 154, 0.18);
}

.button:focus-visible,
.tab:focus-visible,
.filter:focus-visible,
.refresh-button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.view {
  position: relative;
  display: none;
  flex: 1 1 auto;
  min-height: 0;
  padding: 18px;
  background: rgba(7, 9, 13, 0.72);
  overflow: visible;
}

.view.active {
  display: flex;
  flex-direction: column;
}

.race-heading {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.page-actions {
  display: flex;
  justify-content: flex-end;
}

.section-heading {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(310px, 0.58fr) auto;
  gap: 16px;
  align-items: end;
  margin-bottom: 14px;
}

.replay-heading {
  grid-template-columns: minmax(220px, 0.42fr) auto minmax(0, 1fr);
  align-items: center;
}

.replay-heading > div:first-child {
  position: static;
  width: auto;
  height: auto;
  min-width: 0;
  overflow: visible;
}

.visor-inline-note {
  margin: 0;
  color: rgba(246, 243, 231, 0.68);
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.35;
}

.mini-label {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

#source-status {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.event-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid rgba(255, 200, 87, 0.5);
  border-radius: 6px;
  padding: 9px 16px;
  color: var(--amber);
  background: rgba(255, 200, 87, 0.08);
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
}

.filters {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.lobby-filters {
  justify-content: flex-start;
  margin-top: 14px;
}

.race-search {
  display: grid;
  grid-template-columns: minmax(110px, 150px) auto;
  gap: 8px;
  align-items: center;
}

.race-search input {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border-color: rgba(255, 200, 87, 0.42);
  color: var(--amber);
  background: rgba(255, 200, 87, 0.08);
  font-weight: 900;
}

.race-search input::placeholder {
  color: rgba(255, 200, 87, 0.74);
}

.current-lobby,
.race-board,
.leaderboard-panel,
.watch-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(57, 255, 154, 0.065), transparent),
    rgba(14, 21, 24, 0.9);
}

.current-lobby {
  order: 1;
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) minmax(360px, 0.9fr) auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
  padding: 16px;
}

.current-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.current-copy h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.current-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.35;
}

.lobby-status-pill {
  display: inline-flex;
  width: fit-content;
  min-height: 30px;
  align-items: center;
  border: 1px solid rgba(101, 217, 255, 0.42);
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--cyan);
  background: rgba(101, 217, 255, 0.08);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.lobby-status-pill.status-open {
  border-color: rgba(57, 255, 154, 0.55);
  color: var(--green);
  background: rgba(57, 255, 154, 0.1);
}

.lobby-status-pill.status-resolving {
  border-color: rgba(255, 200, 87, 0.55);
  color: var(--amber);
  background: rgba(255, 200, 87, 0.1);
}

.lobby-status-pill.status-resolved,
.lobby-status-pill.status-completed {
  border-color: rgba(169, 130, 255, 0.55);
  color: var(--violet);
  background: rgba(169, 130, 255, 0.1);
}

.lobby-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.lobby-stats > div {
  display: grid;
  gap: 5px;
  min-height: 64px;
  border: 1px solid rgba(246, 243, 231, 0.12);
  border-radius: 6px;
  padding: 9px 10px;
  background: rgba(7, 9, 13, 0.5);
}

.lobby-stats span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.lobby-stats strong {
  overflow: hidden;
  color: var(--green);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lobby-actions {
  display: grid;
  gap: 10px;
  min-width: 142px;
}

.event-guide {
  order: 1;
  display: grid;
  grid-template-columns: minmax(320px, 0.72fr) minmax(520px, 1.28fr);
  gap: 14px;
  align-items: start;
  margin-bottom: 14px;
  border: 1px solid rgba(57, 255, 154, 0.34);
  border-radius: 8px;
  padding: 14px;
  background:
    radial-gradient(circle at 16% 0%, rgba(57, 255, 154, 0.16), transparent 34%),
    linear-gradient(90deg, rgba(101, 217, 255, 0.065), rgba(255, 200, 87, 0.045)),
    rgba(14, 21, 24, 0.92);
}

.race-board {
  order: 2;
}

.market-panel {
  order: 3;
}

.guide-hero {
  display: grid;
  align-content: center;
  gap: 8px;
  min-height: 0;
  border: 1px solid rgba(246, 243, 231, 0.12);
  border-radius: 8px;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(57, 255, 154, 0.09), transparent),
    rgba(7, 9, 13, 0.46);
}

.guide-hero h3 {
  font-size: clamp(1.45rem, 2.2vw, 2.3rem);
  line-height: 0.98;
}

.guide-hero p,
.guide-steps p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.35;
}

.guide-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.guide-steps article {
  display: grid;
  grid-template-columns: 29px minmax(0, 1fr);
  align-content: start;
  column-gap: 10px;
  row-gap: 4px;
  min-height: 78px;
  border: 1px solid rgba(246, 243, 231, 0.12);
  border-radius: 8px;
  padding: 10px;
  background: rgba(7, 9, 13, 0.48);
}

.guide-steps span {
  display: inline-grid;
  grid-row: 1 / span 2;
  place-items: center;
  width: 29px;
  height: 29px;
  border: 1px solid rgba(255, 200, 87, 0.54);
  border-radius: 50%;
  color: var(--amber);
  background: rgba(255, 200, 87, 0.1);
  font-weight: 900;
}

.guide-steps strong {
  color: var(--ink);
  font-size: 0.96rem;
  line-height: 1.08;
}

.guide-steps p {
  grid-column: 2;
  font-size: 0.84rem;
}

.button.is-disabled {
  opacity: 0.48;
  pointer-events: none;
}

.main-grid {
  order: 4;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  min-height: 0;
}

.race-board,
.leaderboard-panel,
.watch-panel {
  padding: 14px;
}

.panel-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-heading h3 {
  font-size: 1.22rem;
}

.panel-heading.compact {
  margin-bottom: 10px;
}

.race-list {
  display: grid;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
  max-height: 680px;
  padding-right: 8px;
  overflow: auto;
}

.race-card {
  display: grid;
  grid-template-columns: minmax(176px, 0.42fr) minmax(620px, 1.8fr) 72px 150px;
  gap: 16px;
  align-items: center;
  min-height: 166px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background:
    linear-gradient(90deg, rgba(57, 255, 154, 0.055), transparent),
    rgba(14, 21, 24, 0.9);
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.race-card:hover,
.race-card:focus-visible,
.race-card.is-selected {
  border-color: rgba(57, 255, 154, 0.58);
  box-shadow: 0 0 22px rgba(57, 255, 154, 0.12);
}

.race-card:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.race-card.is-selected {
  background:
    linear-gradient(90deg, rgba(57, 255, 154, 0.12), rgba(101, 217, 255, 0.04)),
    rgba(14, 21, 24, 0.94);
}

.race-main {
  display: flex;
  gap: 16px;
  align-items: center;
  min-width: 0;
}

.status-dot {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 12px rgba(255, 79, 106, 0.55);
}

.status-resolving .status-dot {
  background: var(--amber);
  box-shadow: 0 0 12px rgba(255, 200, 87, 0.55);
}

.status-resolved .status-dot,
.status-completed .status-dot {
  background: var(--green);
  box-shadow: 0 0 12px rgba(57, 255, 154, 0.55);
}

.race-main h3 {
  margin: 0 0 5px;
  font-size: clamp(1.25rem, 1.8vw, 1.7rem);
  line-height: 1.02;
}

.race-id {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 800;
}

.race-meta {
  margin: 5px 0 0;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.25;
}

.race-stats {
  display: grid;
  grid-template-columns: 152px minmax(0, 1fr);
  column-gap: 18px;
  row-gap: 4px;
  align-items: start;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.2;
}

.race-stats > span,
.race-stats > strong {
  grid-column: 1;
}

.race-stats strong {
  color: var(--green);
}

.pet-preview-row {
  display: grid;
  grid-column: 1 / -1;
  grid-row: 1 / span 4;
  grid-column: 2;
  grid-template-columns: repeat(auto-fit, minmax(218px, 1fr));
  gap: 10px;
  margin-top: 0;
}

.pet-chip {
  position: relative;
  display: inline-grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  max-width: none;
  min-height: 72px;
  border: 1px solid rgba(101, 217, 255, 0.22);
  border-radius: 6px;
  padding: 6px 10px 6px 6px;
  background: rgba(7, 9, 13, 0.5);
}

.pet-chip.profile-chip {
  cursor: pointer;
}

.lane-label-pet.profile-chip,
.visor-highlight.profile-chip {
  cursor: pointer;
}

.pet-chip.profile-chip:hover,
.pet-chip.profile-chip:focus-visible,
.lane-label-pet.profile-chip:hover,
.lane-label-pet.profile-chip:focus-visible,
.visor-highlight.profile-chip:hover,
.visor-highlight.profile-chip:focus-visible {
  border-color: rgba(57, 255, 154, 0.74);
  box-shadow: 0 0 0 1px rgba(57, 255, 154, 0.2), 0 0 24px rgba(57, 255, 154, 0.14);
}

.pet-chip.ticket-chip {
  border-color: rgba(255, 200, 87, 0.82);
  background:
    linear-gradient(90deg, rgba(255, 200, 87, 0.16), rgba(57, 255, 154, 0.06)),
    rgba(7, 9, 13, 0.64);
  box-shadow: 0 0 18px rgba(255, 200, 87, 0.24), inset 0 0 18px rgba(255, 200, 87, 0.08);
}

.pet-chip.ticket-chip::after {
  content: "+1 TIX";
  position: absolute;
  right: 8px;
  bottom: 6px;
  border: 1px solid rgba(255, 200, 87, 0.74);
  border-radius: 999px;
  padding: 2px 6px;
  color: var(--amber);
  background: rgba(255, 200, 87, 0.1);
  font-size: 0.64rem;
  font-weight: 900;
  line-height: 1;
}

.pet-chip img,
.pet-chip-fallback,
.lane-pet-avatar,
.racer-pet-image {
  image-rendering: pixelated;
}

.pet-chip img,
.pet-chip-fallback {
  width: 58px;
  height: 58px;
  border-radius: 5px;
}

.pet-chip img {
  object-fit: cover;
  background: rgba(246, 243, 231, 0.08);
}

.pet-chip-fallback {
  display: grid;
  place-items: center;
  color: #06100b;
  background: var(--cyan);
  font-size: 0.72rem;
  font-weight: 900;
}

.pet-chip span {
  min-width: 0;
}

.pet-chip strong,
.pet-chip small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pet-chip strong {
  color: var(--ink);
  font-size: 0.94rem;
}

.pet-chip small {
  color: var(--muted);
  font-size: 0.78rem;
}

.owner-profile-overlay {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(2, 5, 8, 0.72);
  backdrop-filter: blur(7px);
}

.owner-profile-overlay[hidden] {
  display: none;
}

.owner-profile-panel {
  position: relative;
  width: min(980px, calc(100vw - 28px));
  max-height: min(780px, calc(100vh - 28px));
  overflow: auto;
  border: 1px solid rgba(57, 255, 154, 0.52);
  border-radius: 8px;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(57, 255, 154, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(13, 37, 29, 0.98), rgba(6, 9, 13, 0.98));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.64), 0 0 48px rgba(57, 255, 154, 0.12);
}

.profile-close {
  top: 14px;
  right: 14px;
  border-color: rgba(101, 217, 255, 0.46);
}

.owner-profile-content {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.owner-profile-head {
  display: grid;
  gap: 7px;
  padding-right: 48px;
}

.owner-profile-head h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1;
}

.owner-profile-head code {
  width: fit-content;
  max-width: 100%;
  overflow-wrap: anywhere;
  border: 1px solid rgba(101, 217, 255, 0.26);
  border-radius: 6px;
  padding: 7px 9px;
  color: var(--cyan);
  background: rgba(7, 9, 13, 0.5);
  font-family: inherit;
  font-size: 0.84rem;
}

.owner-profile-head p,
.owner-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
}

.owner-profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.owner-profile-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.owner-profile-metrics div,
.owner-profile-section {
  border: 1px solid rgba(246, 243, 231, 0.14);
  border-radius: 8px;
  background: rgba(7, 9, 13, 0.42);
}

.owner-profile-metrics div {
  display: grid;
  gap: 6px;
  min-height: 76px;
  padding: 12px;
}

.owner-profile-metrics span,
.owner-profile-section-head span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.owner-profile-metrics strong {
  color: var(--green);
  font-size: 1.2rem;
}

.owner-profile-section {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.owner-profile-section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.owner-profile-section-head h3 {
  margin: 0;
  font-size: 1.25rem;
}

.owner-stable-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;
}

.owner-pet-card {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(101, 217, 255, 0.22);
  border-radius: 7px;
  padding: 8px;
  background: rgba(3, 8, 11, 0.45);
}

.owner-pet-card img,
.owner-pet-card .pet-chip-fallback {
  width: 60px;
  height: 60px;
  border-radius: 5px;
  image-rendering: pixelated;
}

.owner-pet-card img {
  object-fit: cover;
}

.owner-pet-card strong,
.owner-pet-card small,
.owner-pet-card span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.owner-pet-card small,
.owner-pet-card span {
  color: var(--muted);
  font-size: 0.78rem;
}

.owner-pet-card em {
  color: var(--amber);
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 900;
  text-align: right;
}

.owner-item-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.owner-item-summary span {
  border: 1px solid rgba(255, 200, 87, 0.45);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--amber);
  background: rgba(255, 200, 87, 0.08);
  font-size: 0.78rem;
  font-weight: 900;
}

.owner-item-list {
  display: grid;
  gap: 8px;
}

.owner-item-list article {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(246, 243, 231, 0.1);
  border-radius: 6px;
  padding: 9px 10px;
  background: rgba(7, 9, 13, 0.5);
}

.owner-item-list span {
  color: var(--muted);
  font-size: 0.78rem;
}

.profile-page-panel,
.profile-full-card {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(57, 255, 154, 0.24);
  border-radius: 8px;
  padding: 16px;
  background: rgba(11, 31, 25, 0.48);
}

.profile-page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.55fr);
  gap: 18px;
  align-items: end;
}

.profile-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.profile-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.profile-search input {
  min-width: 0;
  border: 1px solid rgba(255, 200, 87, 0.48);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--amber);
  background: rgba(255, 200, 87, 0.08);
  font: inherit;
}

.profile-page-content {
  display: grid;
  gap: 14px;
}

.profile-empty-state {
  border: 1px solid rgba(246, 243, 231, 0.14);
  border-radius: 8px;
  padding: 18px;
  background: rgba(7, 9, 13, 0.56);
}

.profile-empty-state h4,
.profile-empty-state p {
  margin: 0;
}

.profile-empty-state p {
  margin-top: 6px;
  color: var(--muted);
}

.profile-wallet-grid {
  display: grid;
  gap: 10px;
}

.profile-wallet-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(246, 243, 231, 0.12);
  border-radius: 7px;
  padding: 12px;
  background: rgba(7, 9, 13, 0.52);
}

.profile-wallet-row strong,
.profile-wallet-row code {
  display: block;
}

.profile-wallet-row code {
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.78rem;
}

.profile-wallet-row span {
  color: var(--green);
  font-weight: 900;
}

.profile-wallet-row small {
  color: var(--muted);
}

.profile-full-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.profile-full-head h3 {
  margin: 0 0 8px;
  font-size: clamp(1.7rem, 3vw, 2.65rem);
  line-height: 1;
}

.profile-full-head code {
  display: inline-block;
  max-width: 100%;
  margin-bottom: 8px;
  overflow-wrap: anywhere;
  border: 1px solid rgba(101, 217, 255, 0.26);
  border-radius: 6px;
  padding: 7px 9px;
  color: var(--cyan);
  background: rgba(7, 9, 13, 0.5);
  font-family: inherit;
  font-size: 0.84rem;
}

.profile-stable-full-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 12px;
}

.profile-pet-full-card {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(101, 217, 255, 0.22);
  border-radius: 8px;
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(101, 217, 255, 0.06), transparent),
    rgba(3, 8, 11, 0.48);
}

.profile-pet-full-head {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.profile-pet-full-head img,
.profile-pet-full-head .pet-chip-fallback {
  width: 76px;
  height: 76px;
  border-radius: 6px;
  image-rendering: pixelated;
}

.profile-pet-full-head img {
  object-fit: cover;
}

.profile-pet-full-head h4,
.profile-pet-full-head p {
  margin: 0;
}

.profile-pet-full-head h4 {
  font-size: 1.16rem;
}

.profile-pet-full-head p,
.profile-pet-full-card footer {
  color: var(--muted);
  font-size: 0.84rem;
}

.profile-pet-full-head em {
  color: var(--amber);
  font-style: normal;
  font-weight: 900;
}

.profile-pet-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.profile-pet-metrics span {
  border: 1px solid rgba(101, 217, 255, 0.18);
  border-radius: 6px;
  padding: 8px;
  color: var(--cyan);
  background: rgba(7, 9, 13, 0.52);
  font-size: 0.8rem;
  font-weight: 900;
  text-align: center;
}

.owner-full-stat-grid {
  display: grid;
  gap: 8px;
}

.owner-stat-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 64px;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 0.84rem;
}

.owner-stat-meter {
  height: 8px;
  overflow: hidden;
  border: 1px solid rgba(246, 243, 231, 0.14);
  border-radius: 999px;
  background: rgba(246, 243, 231, 0.06);
}

.owner-stat-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--green), var(--amber));
}

.owner-stat-row strong {
  color: var(--ink);
  text-align: right;
}

.profile-traits {
  padding-top: 2px;
}

.profile-pet-full-card footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid rgba(246, 243, 231, 0.1);
  padding-top: 10px;
}

.stat-hover {
  position: relative;
}

.stat-hover:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.pet-stat-card {
  position: absolute;
  z-index: 60;
  top: 50%;
  left: calc(100% + 12px);
  display: none;
  gap: 10px;
  width: min(340px, calc(100vw - 28px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  border: 1px solid rgba(101, 217, 255, 0.55);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(101, 217, 255, 0.09), transparent),
    rgba(10, 17, 22, 0.98);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.48), 0 0 0 1px rgba(57, 255, 154, 0.12);
  pointer-events: none;
}

.results-panel .pet-stat-card,
.replay-results .pet-stat-card {
  right: auto;
  left: calc(100% + 12px);
}

.stat-hover.is-open > .pet-stat-card,
.stat-hover.is-open .pet-stat-card {
  display: grid;
  transform: none;
  visibility: visible;
}

.pet-stat-card.is-open {
  display: grid !important;
  position: fixed;
  transform: none !important;
  visibility: visible !important;
}

.pet-stat-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.pet-stat-card-head strong {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.1;
}

.pet-stat-card-head span,
.pet-stat-card small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.25;
}

.pet-stat-card-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.pet-stat-card-meta span {
  border: 1px solid rgba(246, 243, 231, 0.14);
  border-radius: 6px;
  padding: 6px 7px;
  color: var(--cyan);
  background: rgba(7, 9, 13, 0.5);
  font-size: 0.78rem;
  font-weight: 900;
  text-align: center;
}

.stat-card-grid {
  display: grid;
  gap: 7px;
}

.stat-card-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 58px;
  gap: 8px;
  align-items: center;
}

.stat-card-row span,
.stat-card-row strong {
  font-size: 0.8rem;
  font-weight: 900;
}

.stat-card-row span {
  color: var(--muted);
}

.stat-card-row strong {
  color: var(--ink);
  text-align: right;
}

.stat-card-meter {
  height: 8px;
  border: 1px solid rgba(246, 243, 231, 0.12);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(246, 243, 231, 0.06);
}

.stat-card-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--green), var(--amber));
}

.trait-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.trait-chip {
  border: 1px solid rgba(101, 217, 255, 0.22);
  border-radius: 6px;
  padding: 5px 7px;
  color: var(--ink);
  background: rgba(101, 217, 255, 0.08);
  font-size: 0.76rem;
  font-weight: 900;
}

.trait-chip b {
  color: var(--amber);
  font-weight: 900;
}

.trait-chip.is-empty {
  color: var(--muted);
}

.fill {
  display: grid;
  gap: 3px;
  color: var(--cyan);
  font-weight: 900;
  text-align: center;
}

.fill strong {
  font-size: 1.5rem;
}

.fill span {
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
}

.race-actions {
  display: grid;
  gap: 9px;
}

.race-actions .button {
  width: 100%;
}

.visor-panel {
  display: grid;
  grid-template-columns: minmax(280px, 0.46fr) minmax(0, 1fr);
  gap: 14px;
  margin: 0 0 14px;
  border: 1px solid rgba(101, 217, 255, 0.28);
  border-radius: 8px;
  padding: 14px;
  background:
    linear-gradient(90deg, rgba(101, 217, 255, 0.09), rgba(57, 255, 154, 0.04)),
    rgba(9, 17, 22, 0.9);
}

.visor-copy {
  display: grid;
  align-content: center;
  gap: 8px;
  min-width: 0;
}

.visor-copy h3 {
  color: var(--ink);
  font-size: clamp(1.35rem, 2vw, 2rem);
  line-height: 1;
}

.visor-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.35;
}

.visor-formula {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 4px;
}

.visor-formula span {
  border: 1px solid rgba(255, 200, 87, 0.32);
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--amber);
  background: rgba(255, 200, 87, 0.08);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.visor-highlights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.visor-highlight {
  position: relative;
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 112px;
  border: 1px solid rgba(246, 243, 231, 0.12);
  border-radius: 8px;
  padding: 12px 78px 12px 12px;
  background:
    radial-gradient(circle at 0 0, rgba(57, 255, 154, 0.14), transparent 35%),
    rgba(7, 9, 13, 0.54);
}

.visor-highlight:hover,
.visor-highlight:focus-visible {
  border-color: rgba(101, 217, 255, 0.52);
  box-shadow: 0 0 18px rgba(101, 217, 255, 0.13);
}

.visor-rank {
  position: absolute;
  top: 8px;
  right: 10px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.visor-highlight img,
.visor-highlight > .visor-fallback {
  width: 68px;
  height: 68px;
  border: 1px solid rgba(101, 217, 255, 0.34);
  border-radius: 8px;
  object-fit: cover;
  image-rendering: pixelated;
  background: rgba(7, 9, 13, 0.74);
}

.visor-highlight img {
  transform: scaleX(-1);
}

.visor-highlight-main {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.visor-highlight-main strong,
.visor-highlight-main small,
.visor-highlight-main p {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.visor-highlight-main strong {
  color: var(--ink);
  font-size: 1.04rem;
}

.visor-highlight-main small,
.visor-highlight-main p {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.2;
}

.visor-meter.big {
  height: 9px;
}

.visor-score {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: grid;
  justify-items: end;
  gap: 2px;
}

.visor-score strong {
  color: var(--amber);
  font-size: 1.35rem;
}

.visor-score span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.replay-layout {
  display: grid;
  grid-template-columns: minmax(860px, 1fr) minmax(340px, 0.32fr);
  gap: 14px;
  flex: 1 1 auto;
  min-height: clamp(520px, 56vh, 760px);
  overflow: visible;
}

.watch-panel {
  order: 2;
  margin: 0 0 14px;
}

.track-panel,
.results-panel {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(57, 255, 154, 0.06), transparent),
    rgba(14, 21, 24, 0.92);
}

.track-panel {
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.track-lanes {
  display: grid;
  gap: 12px;
  min-height: 0;
  padding: 12px;
  overflow: visible;
}

.track-lane {
  display: grid;
  grid-template-columns: 184px minmax(640px, 1fr);
  gap: 12px;
  align-items: center;
}

.lane-label {
  position: relative;
  display: grid;
  gap: 5px;
  min-width: 0;
}

.lane-label-pet {
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
}

.lane-pet-avatar {
  width: 58px;
  height: 58px;
  border: 1px solid rgba(101, 217, 255, 0.3);
  border-radius: 6px;
  object-fit: cover;
  background: rgba(7, 9, 13, 0.72);
  transform: scaleX(-1);
}

.cyclops-portrait {
  border-color: rgba(255, 200, 87, 0.62);
  background: #16f736;
  box-shadow: 0 0 16px rgba(255, 200, 87, 0.18);
  transform: none;
}

.lane-label-cyclops strong {
  color: var(--ink);
}

.lane-label-cyclops b {
  border-color: rgba(255, 200, 87, 0.58);
  color: var(--amber);
  background: rgba(255, 200, 87, 0.12);
}

.lane-pet-fallback {
  display: grid;
  place-items: center;
  color: #06100b;
  background: var(--cyan);
  font-size: 0.78rem;
  font-weight: 900;
}

.lane-label strong {
  overflow: hidden;
  font-size: 0.98rem;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lane-label span {
  color: var(--muted);
  font-size: 0.86rem;
}

.lane-label b {
  display: inline-flex;
  width: fit-content;
  border: 1px solid rgba(255, 200, 87, 0.32);
  border-radius: 999px;
  padding: 2px 6px;
  color: var(--amber);
  background: rgba(255, 200, 87, 0.08);
  font-size: 0.72rem;
  line-height: 1.1;
  text-transform: uppercase;
}

.lane-label small {
  display: block;
  margin-top: 3px;
  color: rgba(246, 243, 231, 0.58);
  font-size: 0.76rem;
  line-height: 1.18;
}

.lane-track {
  position: relative;
  min-height: 86px;
  border: 1px solid rgba(246, 243, 231, 0.14);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 79, 106, 0.18), transparent 12%, transparent 88%, rgba(255, 200, 87, 0.18)),
    repeating-linear-gradient(90deg, rgba(246, 243, 231, 0.1) 0 2px, transparent 2px 56px),
    linear-gradient(180deg, rgba(57, 255, 154, 0.16), rgba(101, 217, 255, 0.08) 48%, rgba(169, 130, 255, 0.1));
}

.cyclops-lane .lane-track {
  min-height: 122px;
  border-color: rgba(57, 255, 154, 0.42);
  background:
    repeating-linear-gradient(90deg, rgba(57, 255, 154, 0.14) 0 2px, transparent 2px 48px),
    linear-gradient(180deg, rgba(57, 255, 154, 0.16), rgba(169, 130, 255, 0.09));
}

.ticket-earned-lane .lane-track {
  border-color: rgba(255, 200, 87, 0.72);
  box-shadow: inset 0 0 28px rgba(255, 200, 87, 0.12), 0 0 18px rgba(255, 200, 87, 0.16);
}

.ticket-earned-lane .racer.gigling {
  box-shadow: 0 0 24px rgba(255, 200, 87, 0.62), 0 0 0 2px rgba(255, 200, 87, 0.2);
}

.item-effect-buff .lane-track {
  animation: lane-buff-flash 520ms ease-in-out infinite;
}

.item-effect-debuff .lane-track {
  animation: lane-debuff-flash 520ms ease-in-out infinite;
}

.item-effect-buff .lane-label {
  border-color: rgba(57, 255, 154, 0.42);
}

.item-effect-debuff .lane-label {
  border-color: rgba(255, 79, 106, 0.42);
}

.start-line,
.finish-line {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 1;
  width: 3px;
  background: rgba(246, 243, 231, 0.5);
}

.start-line {
  left: 36px;
}

.finish-line {
  right: 36px;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(246, 243, 231, 0.85) 0 8px,
      rgba(7, 9, 13, 0.85) 8px 16px
    );
}

.racer {
  position: absolute;
  z-index: 2;
  left: 0;
  top: 50%;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 2px solid var(--lane-color);
  border-radius: 50%;
  color: #06100b;
  background: var(--lane-color);
  font-size: 0.9rem;
  font-weight: 900;
  transform: translate3d(var(--racer-x, 8px), -50%, 0);
  will-change: transform;
  contain: layout paint;
  box-shadow: 0 0 16px color-mix(in srgb, var(--lane-color), transparent 56%);
}

.racer.running {
  animation: race-run var(--duration) linear var(--delay) forwards;
}

.racer.cyclops {
  width: 112px;
  height: 122px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.item-marker {
  position: absolute;
  top: 8px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 7px;
  color: #06100b;
  background: rgba(7, 9, 13, 0.28);
  font-size: 0.72rem;
  font-weight: 900;
  box-shadow: 0 0 14px rgba(255, 200, 87, 0.36);
  transition: transform 160ms ease, opacity 160ms ease;
}

.item-marker.item-kind-dung {
  filter: drop-shadow(0 0 8px rgba(201, 139, 70, 0.58));
}

.item-marker.item-kind-butterfly {
  filter: drop-shadow(0 0 8px rgba(255, 143, 212, 0.58));
}

.item-marker.item-status-refunded {
  opacity: 0.48;
}

.item-marker.is-active {
  transform: translateY(-5px) scale(1.18);
  box-shadow: 0 0 24px rgba(255, 200, 87, 0.86);
}

.racer.gigling.with-image {
  width: 86px;
  height: 86px;
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  background: rgba(7, 9, 13, 0.76);
}

.racer-pet-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.cyclops-sprite {
  display: block;
  width: 112px;
  height: 122px;
  background-image: url("assets/cyclops-run-cropped-sheet.png");
  background-repeat: no-repeat;
  background-size: 896px 122px;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 10px rgba(57, 255, 154, 0.55));
  animation: cyclops-stride 0.58s steps(8) infinite;
  backface-visibility: hidden;
  transform: translateZ(0);
  will-change: background-position;
}

@keyframes race-run {
  to {
    left: calc(100% - var(--finish-offset, 76px));
  }
}

@keyframes cyclops-stride {
  to {
    background-position-x: -896px;
  }
}

@keyframes lane-buff-flash {
  0%, 100% {
    box-shadow: inset 0 0 0 rgba(57, 255, 154, 0), 0 0 0 rgba(57, 255, 154, 0);
  }
  50% {
    border-color: rgba(57, 255, 154, 0.9);
    box-shadow: inset 0 0 32px rgba(57, 255, 154, 0.35), 0 0 18px rgba(57, 255, 154, 0.28);
  }
}

@keyframes lane-debuff-flash {
  0%, 100% {
    box-shadow: inset 0 0 0 rgba(255, 79, 106, 0), 0 0 0 rgba(255, 79, 106, 0);
  }
  50% {
    border-color: rgba(255, 79, 106, 0.9);
    box-shadow: inset 0 0 32px rgba(255, 79, 106, 0.32), 0 0 18px rgba(255, 79, 106, 0.24);
  }
}

.results-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  overflow: visible;
}

.results-panel h3 {
  color: var(--green);
  font-size: 1.12rem;
  margin-bottom: 0;
}

.results-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.replay-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(101, 217, 255, 0.22);
  border-radius: 6px;
  background: rgba(101, 217, 255, 0.06);
}

.replay-controls .filter {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 0.78rem;
}

.replay-controls.is-live {
  opacity: 0.62;
}

.replay-controls.is-live::before {
  content: "Live";
  padding: 0 4px 0 2px;
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.replay-controls button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.track-timer {
  min-width: 86px;
  border: 1px solid rgba(255, 200, 87, 0.48);
  border-radius: 6px;
  padding: 6px 10px;
  color: var(--amber);
  background: rgba(255, 200, 87, 0.08);
  font-size: 0.92rem;
  font-weight: 900;
  text-align: center;
}

.visor-scan,
.item-feed {
  display: grid;
  gap: 7px;
}

.visor-heading,
.item-feed-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(101, 217, 255, 0.24);
  border-radius: 6px;
  padding: 7px 8px;
  background: rgba(101, 217, 255, 0.08);
}

.visor-heading span,
.item-feed-heading span {
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.visor-heading strong,
.item-feed-heading strong {
  color: var(--ink);
  font-size: 0.86rem;
  text-align: right;
}

.visor-card {
  position: relative;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  border: 1px solid rgba(246, 243, 231, 0.12);
  border-radius: 6px;
  padding: 8px;
  background:
    linear-gradient(90deg, rgba(57, 255, 154, 0.08), transparent),
    rgba(7, 9, 13, 0.52);
}

.visor-card img,
.visor-fallback {
  width: 50px;
  height: 50px;
  border: 1px solid rgba(101, 217, 255, 0.3);
  border-radius: 6px;
  object-fit: cover;
  image-rendering: pixelated;
}

.visor-fallback {
  display: grid;
  place-items: center;
  color: #06100b;
  background: var(--cyan);
  font-weight: 900;
}

.visor-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.visor-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.visor-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.visor-title span {
  color: var(--amber);
  font-weight: 900;
}

.visor-meter {
  height: 7px;
  border: 1px solid rgba(246, 243, 231, 0.12);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(246, 243, 231, 0.06);
}

.visor-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--cyan), var(--amber));
}

.visor-card small,
.visor-card em,
.item-feed-row small,
.item-feed-empty {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.22;
}

.visor-card em {
  font-style: normal;
}

.item-feed-row {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(246, 243, 231, 0.12);
  border-radius: 6px;
  padding: 10px;
  background: rgba(7, 9, 13, 0.46);
  transition: border-color 160ms ease, background 160ms ease;
}

.item-feed-row.is-active {
  border-color: rgba(255, 200, 87, 0.62);
  background: rgba(255, 200, 87, 0.12);
  box-shadow: 0 0 18px rgba(255, 200, 87, 0.16);
}

.item-feed-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.item-feed-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.item-feed-row.is-passed {
  opacity: 0.72;
}

.item-feed-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(246, 243, 231, 0.2);
  border-radius: 7px;
  color: #06100b;
  background:
    radial-gradient(circle at 50% 30%, rgba(246, 243, 231, 0.16), transparent 58%),
    rgba(7, 9, 13, 0.54);
  font-size: 0.9rem;
  font-weight: 900;
}

.item-kind-dung .item-feed-icon {
  border-color: rgba(201, 139, 70, 0.5);
}

.item-kind-butterfly .item-feed-icon {
  border-color: rgba(255, 143, 212, 0.5);
}

.item-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

.item-status-pill {
  border: 1px solid rgba(246, 243, 231, 0.16);
  border-radius: 999px;
  padding: 2px 6px;
  color: var(--muted);
  background: rgba(246, 243, 231, 0.05);
  font-size: 0.64rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.item-feed-row strong,
.item-feed-row small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-feed-row strong {
  font-size: 0.96rem;
}

.item-status-applied {
  border-color: rgba(57, 255, 154, 0.38);
}

.item-status-applied .item-status-pill {
  border-color: rgba(57, 255, 154, 0.42);
  color: var(--green);
  background: rgba(57, 255, 154, 0.08);
}

.item-feed-row.is-active .item-status-pill {
  border-color: rgba(57, 255, 154, 0.58);
  color: var(--green);
  background: rgba(57, 255, 154, 0.1);
}

.item-feed-row.is-active .item-status-pill::before {
  content: "LIVE ";
}

.item-status-queued {
  border-color: rgba(255, 200, 87, 0.38);
}

.item-status-queued .item-status-pill {
  border-color: rgba(255, 200, 87, 0.42);
  color: var(--amber);
  background: rgba(255, 200, 87, 0.08);
}

.item-status-refunded {
  border-color: rgba(246, 243, 231, 0.16);
}

.item-status-refunded .item-status-pill {
  color: rgba(246, 243, 231, 0.55);
}

.item-feed-empty,
.compact-empty {
  margin: 0;
  border-radius: 6px;
  padding: 8px;
  background: rgba(7, 9, 13, 0.44);
}

.replay-results {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.replay-results li {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 64px;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(246, 243, 231, 0.12);
  border-radius: 6px;
  padding: 6px 8px;
  background: rgba(7, 9, 13, 0.44);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.replay-results li.is-finished {
  border-color: rgba(57, 255, 154, 0.36);
  background: rgba(57, 255, 154, 0.08);
}

.replay-results li.boss-result {
  border-color: rgba(101, 217, 255, 0.48);
  background:
    linear-gradient(90deg, rgba(101, 217, 255, 0.12), rgba(169, 130, 255, 0.08)),
    rgba(7, 9, 13, 0.56);
}

.replay-results li.boss-result strong {
  color: var(--cyan);
}

.replay-results li.boss-result small {
  color: rgba(101, 217, 255, 0.82);
}

.replay-results li.ticket-winner {
  border-color: rgba(255, 200, 87, 0.72);
  background:
    linear-gradient(90deg, rgba(255, 200, 87, 0.16), rgba(57, 255, 154, 0.08)),
    rgba(7, 9, 13, 0.56);
  box-shadow: 0 0 18px rgba(255, 200, 87, 0.24), inset 0 0 22px rgba(255, 200, 87, 0.07);
}

.replay-results li.pending-result {
  grid-template-columns: 42px minmax(0, 1fr) 82px;
}

.replay-results span {
  color: var(--amber);
  font-weight: 900;
}

.replay-results strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.replay-results em {
  color: var(--cyan);
  font-style: normal;
  font-weight: 900;
  text-align: right;
}

.replay-results small {
  grid-column: 2 / -1;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.2;
}

.replay-results li.is-finished small {
  color: rgba(57, 255, 154, 0.82);
}

.replay-results li.ticket-winner small,
.replay-results li.ticket-winner span {
  color: var(--amber);
}

.bonus-card {
  display: grid;
  gap: 4px;
  margin-top: 0;
  border: 1px solid rgba(57, 255, 154, 0.35);
  border-radius: 8px;
  padding: 8px;
  background: rgba(57, 255, 154, 0.08);
}

.bonus-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.bonus-card strong {
  color: var(--green);
}

.bonus-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.25;
}

.market-panel {
  order: 5;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(270px, 0.32fr) 196px;
  gap: 14px;
  align-items: center;
  margin-top: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 24px 12px 14px;
  background: rgba(21, 16, 26, 0.86);
}

.market-panel .button {
  justify-self: center;
  width: 100%;
}

.market-panel h3 {
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 1.05rem;
}

.market-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.floor-preview {
  display: grid;
  gap: 3px;
  min-height: 58px;
  border: 1px solid rgba(246, 243, 231, 0.18);
  border-radius: 6px;
  padding: 8px 12px;
  background: rgba(7, 9, 13, 0.64);
}

.floor-preview span {
  color: var(--muted);
  font-size: 0.82rem;
}

.floor-preview strong {
  overflow: hidden;
  color: var(--green);
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-stamp {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 230;
  display: grid;
  place-items: center;
  width: min(300px, calc(100vw - 42px));
  aspect-ratio: 2.25 / 1;
  border: 4px solid rgba(255, 200, 87, 0.92);
  border-radius: 10px;
  color: #07100b;
  background:
    repeating-linear-gradient(90deg, rgba(7, 16, 11, 0.12) 0 8px, transparent 8px 18px),
    linear-gradient(135deg, #ffe08a, #ffc857 48%, #f08a2f);
  box-shadow: 0 0 42px rgba(255, 200, 87, 0.52), 0 18px 80px rgba(0, 0, 0, 0.72);
  font-size: clamp(1.35rem, 4vw, 2.2rem);
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
  transform: translate(-50%, -50%) scale(0.34) rotate(-8deg);
  opacity: 0;
  pointer-events: none;
}

.ticket-stamp.is-active {
  animation: ticket-stamp-pop 1.18s cubic-bezier(.2, 1.3, .24, 1) forwards;
}

.screen-shake {
  animation: screen-shake 360ms steps(2, end);
}

.counter-increment {
  position: relative;
  animation: counter-pulse 1.1s ease both;
}

.counter-increment::after {
  content: attr(data-increment);
  position: absolute;
  right: 0;
  top: -1.6em;
  z-index: 4;
  color: var(--amber);
  font-size: 0.82rem;
  text-shadow: 0 0 12px rgba(255, 200, 87, 0.72);
  white-space: nowrap;
  pointer-events: none;
  animation: counter-float 1.1s ease both;
}

@keyframes ticket-stamp-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.34) rotate(-8deg);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.08) rotate(-2deg);
  }
  42% {
    transform: translate(-50%, -50%) scale(0.96) rotate(1deg);
  }
  72% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + 30vw), calc(-50% - 24vh)) scale(0.18) rotate(18deg);
  }
}

@keyframes screen-shake {
  0%, 100% {
    transform: translate(0, 0);
  }
  20% {
    transform: translate(3px, -2px);
  }
  40% {
    transform: translate(-3px, 2px);
  }
  60% {
    transform: translate(2px, 2px);
  }
  80% {
    transform: translate(-2px, -1px);
  }
}

@keyframes counter-pulse {
  0%, 100% {
    transform: translateY(0) scale(1);
    filter: brightness(1);
  }
  38% {
    transform: translateY(-1px) scale(1.12);
    filter: brightness(1.45);
  }
}

@keyframes counter-float {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.82);
  }
  22% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-18px) scale(0.9);
  }
}

.host-console {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(230px, 0.9fr) minmax(0, 1.4fr) 160px;
  gap: 14px;
  align-items: center;
  margin: 0 0 14px;
  border: 1px solid rgba(101, 217, 255, 0.32);
  border-radius: 8px;
  padding: 12px 14px;
  background:
    linear-gradient(90deg, rgba(101, 217, 255, 0.08), transparent),
    rgba(14, 21, 24, 0.9);
}

.host-console h3 {
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 1.08rem;
}

.host-console p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.3;
}

.host-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.host-metrics > div {
  display: grid;
  gap: 5px;
  min-height: 58px;
  border: 1px solid rgba(246, 243, 231, 0.12);
  border-radius: 6px;
  padding: 8px 10px;
  background: rgba(7, 9, 13, 0.5);
}

.host-metrics span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.host-metrics strong {
  color: var(--cyan);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#host-loop-state.state-ready {
  color: var(--green);
}

#host-loop-state.state-waiting {
  color: var(--amber);
}

#host-loop-state.state-live {
  color: var(--violet);
}

#host-loop-state.state-setup {
  color: var(--muted);
}

.reward-strip,
.summary-strip {
  order: 3;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.summary-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.reward-strip > div,
.summary-strip > div,
.leader-row,
.help-grid article,
.config-panel,
.prize-panel,
.prize-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(14, 21, 24, 0.9);
}

.reward-strip > div,
.summary-strip > div {
  display: grid;
  gap: 8px;
  padding: 13px;
}

.reward-strip span,
.summary-strip span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.reward-strip strong,
.summary-strip strong {
  color: var(--green);
}

.leaderboard-list {
  display: grid;
  gap: 12px;
  max-height: 520px;
  overflow: auto;
  padding: 0 8px 8px 0;
}

.leaderboard-panel .reward-strip {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.leaderboard-panel .reward-strip > div {
  min-height: 66px;
  padding: 10px;
}

.leaderboard-panel .leader-row {
  grid-template-columns: 42px minmax(0, 1fr) minmax(170px, auto);
  gap: 10px;
  padding: 11px;
}

.leaderboard-panel .amount {
  grid-column: auto;
  justify-self: end;
}

.leader-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 140px minmax(180px, 0.9fr);
  gap: 14px;
  align-items: center;
  padding: 13px 16px;
}

.rank {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 200, 87, 0.55);
  border-radius: 50%;
  color: var(--amber);
  background: rgba(255, 200, 87, 0.1);
}

.wallet {
  min-width: 0;
  overflow-wrap: anywhere;
}

.wallet-block {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.wallet-block small {
  color: var(--muted);
  font-size: 0.78rem;
}

.amount {
  color: var(--green);
  font-weight: 900;
}

.reason {
  color: var(--muted);
  font-size: 0.88rem;
}

.prize-page {
  display: grid;
  gap: 14px;
}

.prize-copy {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.35;
}

.empty-state {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  color: var(--muted);
  background: rgba(14, 21, 24, 0.9);
}

.prize-layout {
  display: grid;
  grid-template-columns: minmax(270px, 0.34fr) minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
  overflow: hidden;
}

.config-panel,
.prize-panel {
  min-height: 0;
  padding: 14px;
  overflow: auto;
}

.config-panel {
  display: grid;
  gap: 12px;
  align-content: start;
}

.config-panel h3,
.prize-panel h3 {
  color: var(--green);
  font-size: 1rem;
}

.config-panel label {
  display: grid;
  gap: 6px;
}

.config-panel label span,
.seed-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.config-panel input,
.config-panel select {
  min-height: 42px;
  width: 100%;
  padding: 8px 10px;
}

.seed-card {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(255, 200, 87, 0.32);
  border-radius: 6px;
  padding: 10px;
  background: rgba(255, 200, 87, 0.06);
}

.seed-card strong {
  color: var(--amber);
  overflow-wrap: anywhere;
}

.seed-card small {
  color: var(--muted);
  line-height: 1.3;
}

.prize-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.prize-summary > div {
  display: grid;
  gap: 5px;
  min-height: 70px;
  border: 1px solid rgba(246, 243, 231, 0.12);
  border-radius: 6px;
  padding: 10px;
  background: rgba(7, 9, 13, 0.5);
}

.prize-summary span,
.prize-row em {
  color: var(--muted);
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
}

.prize-summary strong {
  color: var(--green);
  overflow-wrap: anywhere;
}

.prize-list {
  display: grid;
  gap: 10px;
}

.prize-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) minmax(110px, 0.42fr) 92px;
  gap: 12px;
  align-items: center;
  padding: 12px;
}

.prize-row h3 {
  margin-bottom: 4px;
  color: var(--ink);
}

.prize-row p {
  margin: 0;
  color: var(--green);
  font-weight: 900;
}

.prize-row > strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.final-winner-row {
  border-color: rgba(255, 200, 87, 0.34);
  background:
    linear-gradient(90deg, rgba(255, 200, 87, 0.08), transparent),
    rgba(14, 21, 24, 0.88);
}

.final-winner-row .wallet,
.final-winner-row p {
  overflow-wrap: anywhere;
}

.final-wallet-link {
  color: var(--green);
  font-weight: 900;
  text-decoration: none;
}

.final-wallet-link:hover,
.final-wallet-link:focus-visible {
  color: var(--amber);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.jackpot-hit {
  border-color: rgba(255, 200, 87, 0.45);
  background:
    linear-gradient(90deg, rgba(255, 200, 87, 0.1), transparent),
    rgba(14, 21, 24, 0.9);
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.help-grid article {
  min-height: 228px;
  padding: 15px;
}

.help-grid span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 16px;
  border: 1px solid rgba(255, 200, 87, 0.55);
  border-radius: 50%;
  color: var(--amber);
  background: rgba(255, 200, 87, 0.1);
  font-weight: 900;
}

.help-grid h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.help-grid p {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.35;
}

.help-card-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
}

@media (max-width: 980px) {
  .app-shell {
    height: auto;
    min-height: calc(100vh - 20px);
    overflow: visible;
  }

  .hero {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .event-card {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .event-card strong,
  .event-card em {
    text-align: left;
  }

  .product-strip {
    grid-template-columns: 1fr;
  }

  .section-heading {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .filters {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .race-card {
    grid-template-columns: 1fr;
  }

  .race-stats {
    grid-template-columns: 1fr;
  }

  .race-stats > span,
  .race-stats > strong,
  .pet-preview-row {
    grid-column: 1;
  }

  .pet-preview-row {
    grid-row: auto;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  }

  .replay-layout {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .race-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .market-panel,
  .current-lobby,
  .main-grid,
  .host-console,
  .reward-strip,
  .summary-strip,
  .event-guide,
  .guide-steps,
  .visor-panel,
  .visor-highlights,
  .help-grid,
  .prize-layout {
    grid-template-columns: 1fr;
  }

  .lobby-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .host-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .prize-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .live-race-alert {
    top: 12px;
    right: 12px;
    left: 12px;
    grid-template-columns: 1fr;
    width: auto;
    padding-right: 64px;
  }

  .live-race-alert .button {
    width: 100%;
  }

  .alert-close {
    position: absolute;
    top: 10px;
    right: 10px;
  }

  .app-shell {
    width: min(1188px, calc(100% - 12px));
    margin: 6px auto;
    overflow-x: hidden;
  }

  .hero-copy {
    display: grid;
    gap: 5px;
    padding: 0;
    overflow: visible;
  }

  .hero {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 12px;
    min-height: 0;
    padding: 14px;
  }

  .social-dock {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .social-icon {
    width: 40px;
    height: 40px;
  }

  .brand-mark {
    width: 58px;
    height: 58px;
  }

  h1 {
    max-width: 100%;
    font-size: clamp(1.6rem, 7.8vw, 2.08rem);
    line-height: 1.02;
    overflow-wrap: normal;
  }

  .hero-subtitle {
    width: 100%;
    margin: 0;
    font-size: 0.86rem;
    line-height: 1.28;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 12px;
  }

  .hero-actions .button {
    min-height: 40px;
  }

  .event-card {
    grid-template-columns: 1fr 62px;
    min-height: 104px;
    padding: 12px 14px;
  }

  .event-card img {
    width: 54px;
    height: 54px;
  }

  .event-card strong {
    font-size: 1.22rem;
  }

  .event-card em {
    font-size: 0.88rem;
  }

  .product-strip article {
    min-width: 0;
    min-height: 58px;
    padding: 10px 12px;
  }

  .product-strip {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 100%;
    overflow-x: visible;
  }

  .event-guide {
    gap: 10px;
    padding: 10px;
  }

  .guide-hero {
    padding: 11px;
  }

  .guide-hero h3 {
    font-size: clamp(1.35rem, 7vw, 1.9rem);
  }

  .guide-hero p,
  .guide-steps p {
    font-size: 0.8rem;
    line-height: 1.25;
  }

  .guide-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .guide-steps article {
    grid-template-columns: 1fr;
    min-height: 116px;
    padding: 9px;
  }

  .guide-steps span,
  .guide-steps p {
    grid-column: 1;
  }

  .guide-steps span {
    grid-row: auto;
  }

  .view-tabs,
  .view {
    padding-left: 14px;
    padding-right: 14px;
  }

  .view-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
    gap: 8px;
    overflow-x: hidden;
  }

  .tab {
    min-width: 0;
    padding: 8px 7px;
    font-size: 0.84rem;
  }

  .filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .race-search {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) 88px;
  }

  .replay-controls {
    grid-column: 1 / -1;
    justify-content: center;
    flex-wrap: wrap;
  }

  .lobby-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter,
  .refresh-button {
    width: 100%;
  }

  .race-actions {
    grid-template-columns: 1fr;
  }

  .owner-profile-overlay {
    padding: 10px;
  }

  .owner-profile-content {
    padding: 16px;
  }

  .owner-profile-metrics,
  .owner-stable-grid,
  .profile-page-head,
  .profile-search,
  .profile-wallet-row,
  .profile-stable-full-grid,
  .profile-pet-metrics {
    grid-template-columns: 1fr;
  }

  .profile-full-head {
    display: grid;
  }

  .profile-pet-full-head {
    grid-template-columns: 66px minmax(0, 1fr);
  }

  .profile-pet-full-head em {
    grid-column: 1 / -1;
  }

  .owner-stat-row {
    grid-template-columns: 64px minmax(0, 1fr) 54px;
  }

  .owner-pet-card {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .owner-pet-card em {
    grid-column: 1 / -1;
    text-align: left;
  }

  .owner-item-list article {
    display: grid;
  }

  .track-lane {
    grid-template-columns: 1fr;
  }

  .pet-stat-card,
  .results-panel .pet-stat-card,
  .replay-results .pet-stat-card {
    right: auto;
    left: 0;
    top: calc(100% + 10px);
    transform: none;
    width: min(320px, calc(100vw - 36px));
  }

  .lane-track {
    min-height: 72px;
  }

  .cyclops-lane .lane-track {
    min-height: 124px;
  }

  .leader-row {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .visor-highlight {
    grid-template-columns: 1fr;
  }

  .visor-highlight {
    justify-items: start;
    padding: 12px;
  }

  .visor-score {
    position: static;
    justify-items: start;
  }

  .reason,
  .amount {
    grid-column: 1 / -1;
  }

  .prize-summary,
  .host-metrics,
  .prize-row {
    grid-template-columns: 1fr;
  }

  .prize-row .rank {
    width: 34px;
    height: 34px;
  }
}
