:root {
  --bg: #05070b;
  --panel: #0e1218;
  --rail: #07090e;
  --line: #1c2430;
  --text: #eef3f8;
  --muted: #7f93a8;
  --cyan: #6ec8ef;
  --gold: #e8b24a;
  --bronze: #6a4522;
  --yellow: #f6e300;
  --green: #3ecf6a;
  --accent: #c48a3a;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; min-height: 100%;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--bg);
}
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input { font: inherit; }
.hide { display: none !important; }

#app { min-height: 100vh; display: block; }

/* —— Sport icons: horizontal strip under VIRTUAL GAMING —— */
.nav-rail {
  background: var(--rail);
  border-bottom: 1px solid #141a24;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-evenly;
  gap: 6px;
  padding: 10px 12px 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}
.nav-item {
  width: 58px;
  flex: 1 1 0;
  min-width: 52px;
  max-width: 72px;
  padding: 0;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: transparent;
  border: 0;
  color: var(--cyan);
}
.nav-item .nav-ico {
  width: 49px; height: 49px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #121820;
  border: 2px solid #2a3442;
  overflow: hidden;
}
.nav-item img {
  width: 31px; height: 31px;
  object-fit: contain;
  display: block;
}
.nav-item .tm-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 12px;
}
.nav-item .tm {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--cyan);
  line-height: 1;
}
.nav-item .nav-phase {
  display: block;
  max-width: 72px;
  font-size: 8px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.02em;
  text-align: center;
  text-transform: uppercase;
  white-space: normal;
  word-break: break-word;
  color: #7a8a9c;
  margin-top: 1px;
  min-height: 18px;
}
.nav-item .nav-phase--live {
  color: var(--yellow);
}
.nav-item .nav-phase--bets {
  color: var(--cyan);
}
.nav-item .nav-phase--closed {
  color: #667788;
}
.nav-item.is-bets-open .tm {
  color: var(--cyan);
}
.nav-item.is-live .nav-phase--live {
  animation: vsp-blink 1s ease-in-out infinite;
}
/* Small flag next to timer when a bet is placed on this sport */
.nav-item .nav-bet-flag {
  width: 8px;
  height: 9px;
  flex: 0 0 auto;
  background: #e8b24a;
  clip-path: polygon(0 0, 100% 0, 100% 62%, 50% 48%, 0 62%);
  box-shadow: 0 0 4px rgba(232, 178, 74, .55);
  position: relative;
}
.nav-item .nav-bet-flag::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1.5px;
  background: #f5e6c8;
}
.nav-item.has-bet .tm { color: #f0d48a; }
.nav-item.active .nav-ico {
  background: var(--bronze);
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(232,178,74,.35), 0 0 12px rgba(232,178,74,.2);
}
.nav-item.active .tm { color: #f5e6c8; }
.nav-item:not(.active):hover .nav-ico { border-color: #4a5a6e; }
/* MMA fist SVG is black — invert so it reads on dark #121820 disc like other icons */
.nav-item--mma img {
  filter: invert(1) brightness(1.15);
}
.nav-item--mma.active img {
  filter: invert(1) brightness(1.05);
}
.nav-item--softquo .nav-ico {
  background: #0c121a;
}
.nav-item--softquo img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  opacity: 1;
  visibility: visible;
}
.nav-item.is-live .tm {
  color: var(--yellow);
  animation: vsp-blink 1s ease-in-out infinite;
}
@keyframes vsp-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: .3; }
}

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 14px; border-bottom: 1px solid var(--line);
  background: rgba(0,0,0,.45);
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  display: flex; flex-direction: column; line-height: 1.05;
  font-weight: 800; font-size: 11px; letter-spacing: .08em;
}
.brand-mark .brand-line { color: #cfd8e3; }
.brand-mark .brand-line.accent { color: var(--gold); }
.brand strong { font-size: 18px; letter-spacing: .03em; }
.top-meta { display: flex; align-items: center; gap: 12px; }
.balance { color: var(--yellow); font-weight: 700; }
.exit-btn { background: #243545; color: #fff; padding: 7px 12px; border-radius: 6px; }
.help-btn {
  width: 34px; height: 34px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
}
.help-btn img {
  width: 26px; height: 26px; display: block;
  filter: brightness(0) saturate(100%) invert(72%) sepia(72%) saturate(1200%) hue-rotate(146deg) brightness(104%) contrast(101%);
}
.help-btn:hover { opacity: .85; }

.lang-switch { position: relative; z-index: 40; }
.lang-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 8px; border-radius: 6px; background: #18222e;
}
.lang-btn img { width: 22px; height: 16px; object-fit: cover; border-radius: 2px; }
.lang-btn #lang-code { font-size: 12px; font-weight: 700; }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 6px);
  max-height: 280px; overflow: auto; min-width: 180px;
  background: #1a222c; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 12px 28px rgba(0,0,0,.45);
}
.lang-item {
  width: 100%; display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; text-align: left;
}
.lang-item:hover, .lang-item.on { background: #243040; }
.lang-item img { width: 22px; height: 16px; object-fit: cover; }

.workspace {
  flex: 1;
  display: grid;
  /* Video column takes former left-rail width + original stage share */
  grid-template-columns: minmax(480px, 1.55fr) minmax(260px, 0.85fr) 250px;
  gap: 10px;
  padding: 10px 12px 16px;
  min-height: 0;
}

.left-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

.schedule {
  display: flex; gap: 6px; overflow-x: auto;
  padding: 6px; background: #0a0e14; border: 1px solid var(--line); border-radius: 8px;
}
.sched-card {
  min-width: 92px; padding: 8px 10px;
  background: #121820; border-radius: 6px;
  border: 1px solid transparent;
  text-align: center; flex-shrink: 0;
}
.sched-card .sc-num { font-size: 12px; font-weight: 800; color: #fff; }
.sched-card .sc-fighters {
  margin-top: 4px; font-size: 10px; font-weight: 600; color: #c5d0dc;
  display: flex; flex-direction: column; align-items: center; gap: 2px; line-height: 1.2;
}
.sched-card .sc-fighters .sc-f { display: block; }
.sched-card .sc-fighters .sc-f small {
  display: block; font-size: 9px; font-weight: 700; letter-spacing: .04em;
  color: #8a9aab; text-transform: lowercase;
}
.sched-card .sc-fighters .sc-vs { font-size: 9px; color: var(--gold); }
.sched-card .sc-meta { margin-top: 4px; font-size: 11px; font-weight: 700; color: var(--muted); }
.sched-card.finished .sc-meta { color: #667788; }
.sched-card.active {
  background: #1a2430;
  border-color: #3a4a5c;
}
.sched-card.active .sc-meta { color: var(--cyan); }
.sched-card.upcoming .sc-meta { color: #9ab0c4; }

.stage {
  position: relative;
  width: 100%;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.stage-media {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  background: #000;
  flex: 0 0 auto;
}
.stage video, .stage .poster, .stage .live-frame {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  border: 0;
}

/* Collision Road–style live race progress + standings (motorbike / speedway / kart / stock) */
.race-progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 4;
  height: 14px;
  pointer-events: none;
}
.race-progress.hide { display: none; }
.race-progress-track {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.18);
}
.race-progress-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, #1a6dff, #3d9bff);
  transition: width 0.12s linear;
}
.race-progress-marker {
  position: absolute;
  top: -1px;
  left: 0%;
  width: 0;
  height: 0;
  margin-left: -6px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid #f5d000;
  filter: drop-shadow(0 0 1px #111);
  transition: left 0.12s linear;
}
.race-standings {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 8px 10px 10px;
  min-height: 72px;
  background: #050608;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  scrollbar-width: thin;
}
.race-standings.hide { display: none; }
.race-pos {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 52px;
  padding: 3px 3px 4px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.22);
  transition: transform 0.35s ease, background 0.25s ease, border-color 0.25s ease;
}
.race-pos--top {
  width: 64px;
  background: #fff;
  border: 2px solid #fff;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}
.race-pos--bet {
  outline: 2px solid #f5d000;
  outline-offset: 1px;
}
.race-pos-rank {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  padding: 2px 0 3px;
  border-radius: 5px 5px 0 0;
  letter-spacing: 0.02em;
}
.race-pos--top .race-pos-rank { font-size: 12px; }
.race-pos[data-place="1"] .race-pos-rank { background: #f0c040; color: #142033; }
.race-pos[data-place="2"] .race-pos-rank { background: #d8dde6; color: #142033; }
.race-pos:not(.race-pos--top) .race-pos-rank {
  background: #2a3340;
  color: #eef2f7;
}
.race-pos-bib {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 34px;
  margin-top: 2px;
  border-radius: 0 0 4px 4px;
  font-weight: 900;
  font-style: italic;
  font-size: 22px;
  line-height: 1;
  font-family: "Arial Black", "Helvetica Neue", Arial, sans-serif;
  transform: skewX(-8deg);
  color: #fff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}
.race-pos--top .race-pos-bib {
  min-height: 42px;
  font-size: 28px;
}
.race-pos-bib > span { transform: skewX(8deg); display: inline-block; }

@media (max-width: 720px) {
  .race-pos { width: 44px; }
  .race-pos--top { width: 54px; }
  .race-pos-bib { font-size: 18px; min-height: 30px; }
  .race-pos--top .race-pos-bib { font-size: 24px; min-height: 36px; }
  .race-standings { min-height: 64px; gap: 6px; padding: 6px 8px 8px; }
}
.market-status {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  margin-bottom: 8px; min-height: 28px;
}
.badge-bets {
  background: rgba(0,0,0,.72); color: var(--yellow);
  font-weight: 800; font-size: 12px; padding: 5px 8px; border-radius: 4px;
}
.badge-active {
  background: #1f8f45; color: #fff;
  font-weight: 800; font-size: 11px; padding: 5px 8px; border-radius: 4px;
}
.mute-btn {
  position: absolute; right: 10px; bottom: 18px; z-index: 5;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(0,0,0,.55);
}

/* SoftQuo-style “about to start” countdown (last 5s of open phase) */
.start-countdown {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 14, 22, 0.42);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  pointer-events: none;
}
.start-countdown.hide { display: none; }
.start-countdown-card {
  min-width: 200px;
  max-width: min(78%, 280px);
  padding: 22px 28px 26px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  text-align: center;
  animation: start-cd-pop 0.28s ease-out;
}
@keyframes start-cd-pop {
  from { transform: scale(0.88); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.start-countdown-label {
  color: #1a2430;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.01em;
  margin-bottom: 14px;
  line-height: 1.25;
}
.start-countdown-ring {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 0 auto;
}
.start-countdown-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  display: block;
}
.start-countdown-track {
  fill: none;
  stroke: #e8edf3;
  stroke-width: 3.2;
}
.start-countdown-progress {
  fill: none;
  stroke: #f0c040;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-dasharray: 100 0;
  transition: stroke-dasharray 0.9s linear;
}
.start-countdown-core {
  position: absolute;
  inset: 14%;
  border-radius: 50%;
  background: #2f6fed;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.12);
}
.start-countdown-num {
  color: #fff;
  font-weight: 800;
  font-size: 38px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stage-score { display: none !important; }
.match-teams {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 10px 12px; margin-bottom: 8px;
  background: linear-gradient(180deg, #1a2430, #121820);
  border: 1px solid var(--line); border-radius: 8px;
  font-weight: 800; font-size: 13px; color: #fff;
  text-align: center;
}
.match-teams .mt-vs {
  color: var(--gold); font-size: 11px; letter-spacing: .08em;
  flex: 0 0 auto;
}
.match-teams .mt-home, .match-teams .mt-away {
  flex: 1 1 0; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.match-teams .mt-home { text-align: right; }
.match-teams .mt-away { text-align: left; }
.match-teams--mma .mt-home,
.match-teams--mma .mt-away {
  display: flex; flex-direction: column; gap: 2px;
  white-space: normal;
}
.match-teams--mma .mt-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.match-teams--mma .mt-corner {
  font-size: 10px; font-weight: 700; letter-spacing: .06em;
  text-transform: lowercase; line-height: 1.2;
}
.match-teams--mma .mt-corner--black { color: #9eb0c2; }
.match-teams--mma .mt-corner--white { color: #e8eef5; }
.odd-btn--match .odd-corner {
  display: block; font-size: 10px; font-weight: 700; letter-spacing: .06em;
  text-transform: lowercase; line-height: 1.2; margin-top: 1px;
}
.odd-btn--match .odd-corner--black { color: #9eb0c2; }
.odd-btn--match .odd-corner--white { color: #dfe7f0; }
.odd-btn--match.on .odd-corner { color: #d6c27a; }
/* GOOOOL / fake scoreboard overlays removed — not synced with video */
.goal-flash,
#goal-flash,
.stage-score,
#stage-score { display: none !important; visibility: hidden !important; pointer-events: none !important; }

.markets-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex; flex-direction: column;
  min-height: 0; overflow: hidden;
}
.market-tabs {
  display: flex; gap: 0; border-bottom: 1px solid var(--line);
  background: #0a0e14;
}
.market-tab {
  padding: 12px 16px;
  font-weight: 800; font-size: 13px;
  color: #aab8c6;
  border-bottom: 2px solid transparent;
}
.market-tab.active {
  color: var(--yellow);
  border-bottom-color: var(--yellow);
}
.markets {
  flex: 1; overflow: auto; padding: 10px;
}

/* Forecast matrix */
.fc-grid {
  display: grid;
  gap: 3px;
  width: 100%;
}
.fc-cell, .fc-head {
  min-height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: #15202c;
  border-radius: 4px;
  font-weight: 700; font-size: 12px;
}
.fc-head { background: transparent; color: var(--muted); }
.fc-cell.blank { background: #0a1018; }
.fc-cell.btn {
  cursor: pointer; color: #fff;
  flex-direction: column; gap: 2px; min-height: 44px; padding: 4px 2px;
}
.fc-cell.btn .odd-price { font-size: 12px; font-weight: 800; line-height: 1.1; }
.fc-cell.btn .odd-lab {
  font-size: 9px; font-weight: 600; color: #9eb0c2; line-height: 1.1;
}
.fc-cell.btn:hover { background: #1e2e40; }
.fc-cell.btn.on {
  background: #2a4060;
  outline: 1px solid var(--gold);
  color: var(--yellow);
}
.fc-cell.btn.on .odd-lab { color: #d6c27a; }

.wp-list { display: flex; flex-direction: column; gap: 6px; }
.wp-row {
  display: grid; grid-template-columns: 36px 1fr 88px 88px;
  gap: 6px; align-items: center;
  background: #121820; border-radius: 6px; padding: 6px 8px;
}
.wp-num {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; background: #243545;
}
.wp-name { font-size: 13px; font-weight: 600; }
.odd-btn {
  background: #1a2836; border-radius: 4px; padding: 8px 4px;
  font-weight: 800; font-size: 13px; text-align: center;
}
.odd-btn:hover { background: #243648; }
.odd-btn.on { background: #2a4060; color: var(--yellow); outline: 1px solid var(--gold); }
.odd-btn small { display: block; font-size: 10px; color: var(--muted); font-weight: 600; }
.odd-btn--match {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; min-height: 58px; padding: 8px 6px;
}
.odd-btn--match .odd-price {
  font-size: 16px; font-weight: 800; line-height: 1.1; color: #fff;
}
.odd-btn--match.on .odd-price { color: var(--yellow); }
.odd-btn--match .odd-lab {
  display: block; font-size: 11px; font-weight: 600; line-height: 1.25;
  color: #b8c5d3; white-space: normal; word-break: break-word;
}

.match-markets { display: flex; flex-direction: column; gap: 12px; }
.mm-group h4 {
  margin: 0 0 6px; font-size: 12px; font-weight: 700;
  color: #9eb0c2; letter-spacing: .03em; text-transform: none;
}
.mm-odds {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 6px;
}
/* SoftQuo races — same 2-col odd buttons as Match winner / Handicap (screenshot 2) */
.softquo-markets .softquo-wp-grid {
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.softquo-markets .odd-btn--match {
  background: #1a1d26;
  border-radius: 6px;
  min-height: 64px;
}
.softquo-markets .odd-btn--match .odd-price { font-size: 18px; }
.softquo-markets .odd-btn--match .odd-lab { color: #9eb0c2; font-size: 12px; }
.match-teams--softquo .mt-vs { color: var(--yellow); padding: 0 6px; }
.md-scoreline { display: none !important; }

.ticket {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex; flex-direction: column;
  padding: 0;
  min-height: 0;
  align-self: start;
  overflow: hidden;
  transition: box-shadow .35s ease, border-color .35s ease;
}
.ticket.has-bets {
  border-color: #2a3a4c;
  box-shadow: 0 0 0 1px rgba(232,178,74,.12);
}
.ticket-toggle {
  width: 100%;
  display: flex; align-items: center; gap: 8px;
  padding: 12px;
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: inherit;
}
.ticket-toggle:hover { background: rgba(255,255,255,.03); }
.ticket-head h2,
.ticket-toggle h2 { margin: 0; font-size: 14px; letter-spacing: .04em; flex: 1; }
.ticket-count {
  min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 11px;
  background: var(--gold); color: #111;
  font-size: 12px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}
.ticket-count.hide { display: none; }
.ticket-chevron {
  width: 10px; height: 10px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform .35s ease;
  margin-top: -4px;
  flex-shrink: 0;
}
.ticket:not(.is-collapsed) .ticket-chevron {
  transform: rotate(225deg);
  margin-top: 4px;
}
.ticket-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .45s cubic-bezier(.22,.61,.36,1);
}
.ticket:not(.is-collapsed) .ticket-panel {
  grid-template-rows: 1fr;
}
.ticket-panel-inner {
  overflow: hidden;
  min-height: 0;
  padding: 0 10px;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .3s ease, transform .35s ease, padding .35s ease;
}
.ticket:not(.is-collapsed) .ticket-panel-inner {
  padding: 0 10px 10px;
  opacity: 1;
  transform: translateY(0);
}
.ticket-tools {
  display: flex; justify-content: flex-end;
  margin-bottom: 6px;
}
.linkish { color: var(--cyan); font-size: 12px; }
.stake-row {
  display: flex; align-items: center; gap: 6px; margin-bottom: 8px;
  font-size: 12px; font-weight: 700; color: var(--muted);
}
.stake-row input {
  width: 72px; text-align: center;
  background: #0a1018; border: 1px solid var(--line);
  color: #fff; border-radius: 4px; padding: 6px;
}
.stake-row button {
  width: 28px; height: 28px; background: #243545; border-radius: 4px;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chips button {
  min-width: 48px; padding: 6px 8px;
  background: #1a2836; border-radius: 999px; font-weight: 700; font-size: 12px;
}
.chips button.on { background: var(--bronze); border: 1px solid var(--gold); color: #fff; }
.slip-body {
  flex: 1; overflow: auto;
  min-height: 0;
  max-height: 0;
  transition: none;
}
.ticket:not(.is-collapsed) .slip-body {
  max-height: 160px;
  min-height: 48px;
}
.ticket.ticket--grow:not(.is-collapsed) .slip-body { max-height: 240px; }
.ticket.ticket--grow2:not(.is-collapsed) .slip-body { max-height: 320px; }
.slip-empty { color: var(--muted); font-size: 13px; padding: 12px 4px; }
.slip-item {
  background: #121820; border-radius: 6px; padding: 8px; margin-bottom: 6px;
  font-size: 12px;
}
.slip-item .sub { color: var(--muted); margin-top: 2px; }
.ticket-totals {
  border-top: 1px solid var(--line); padding-top: 8px; margin-top: 6px;
  display: flex; flex-direction: column; gap: 4px; font-size: 12px;
}
.ticket-totals strong { float: right; color: var(--yellow); }
.submit-btn {
  margin-top: 10px; width: 100%;
  background: linear-gradient(180deg, #d4a017, #a67c0a);
  color: #111; font-weight: 800; padding: 12px; border-radius: 6px;
  transition: opacity .25s ease, filter .25s ease;
}
.submit-btn:disabled { opacity: .4; cursor: not-allowed; filter: grayscale(.25); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: #1a2836; border: 1px solid var(--line);
  padding: 10px 16px; border-radius: 8px; z-index: 60;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.toast.show { opacity: 1; }

.result-modal, .help-modal {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.7); padding: 16px;
}
.result-modal-card, .help-modal-card {
  width: min(520px, 100%);
  background: #2f343b; border-radius: 10px;
  box-shadow: 0 20px 50px rgba(0,0,0,.55);
  overflow: hidden;
}
.help-modal-card { width: min(720px, 100%); max-height: min(86vh, 760px); display: flex; flex-direction: column; }
.help-modal-head {
  display: flex; align-items: center; justify-content: center;
  position: relative; padding: 14px; border-bottom: 1px solid #444;
}
.help-modal-head h2 { margin: 0; font-size: 16px; }
.help-close {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-size: 22px; width: 32px; height: 32px;
}
.help-modal-body { padding: 14px 16px; overflow: auto; flex: 1; font-size: 14px; line-height: 1.45; }
.stats-footer { padding: 10px 16px; border-top: 1px solid #444; }
.stats-clear {
  background: #243545; padding: 8px 12px; border-radius: 6px; font-weight: 700;
}
.result-modal-card { padding: 18px; text-align: center; }
.result-modal-game { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 8px; }
.result-modal-game img { width: 28px; height: 28px; }
.result-modal-ok {
  margin-top: 14px; background: var(--gold); color: #111;
  font-weight: 800; padding: 10px 24px; border-radius: 6px;
}

@media (max-width: 1100px) {
  .workspace { grid-template-columns: 1fr 1fr; }
  .ticket { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .nav-rail { padding: 8px 10px; gap: 6px; justify-content: flex-start; }
  .nav-item { width: 52px; flex: 0 0 auto; max-width: none; }
  .nav-item .nav-ico { width: 45px; height: 45px; }
  .nav-item img { width: 28px; height: 28px; }
  .workspace { grid-template-columns: 1fr; }
}
