/* SharpLab HQ — Sports Sim page.
   Builds on hqstyle.css (shared vars/header/nav/.btn/.card). Only sim-specific
   styling here. Uses ONLY hqstyle.css CSS vars. Coins hub + toast are copied
   from threecardpoker.css so this page is self-contained. */

/* ── Page intro ── */
.sim-head { margin: 4px 0 20px; }
.sim-head h1 { font-size: 26px; margin: 0 0 4px; }
.sim-head p { color: var(--muted); margin: 0; font-size: 14px; }

.balancechip {
  display: inline-flex; align-items: center; gap: 6px; margin-left: 10px;
  font-size: 13px; font-weight: 700; color: var(--gold);
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: var(--r-pill); padding: 3px 11px; vertical-align: middle;
}

/* ── Sport picker ── */
.pickertip { font-size: 13px; margin-bottom: 14px; }
.sportgrid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}
.sporttile {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 22px 10px; cursor: pointer;
  font-family: inherit; color: var(--fg);
  background: var(--panel2); border: 1px solid var(--line); border-radius: 14px;
  transition: border-color var(--t), transform var(--t), background var(--t);
}
.sporttile:hover { border-color: var(--accent); transform: translateY(-2px); }
.st-icon { font-size: 34px; line-height: 1; }
.st-label { font-size: 14px; font-weight: 700; letter-spacing: .3px; }

/* ── Matchup / bet card ── */
.simbet-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
}
.simsport {
  font-weight: 800; font-size: 14px; color: var(--muted);
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: var(--r-pill); padding: 4px 12px;
}

.matchup {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 12px; margin-bottom: 20px;
}
.teampick {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 16px 12px; cursor: pointer; text-align: center;
  font-family: inherit; color: var(--fg);
  background: var(--panel2); border: 2px solid var(--line); border-radius: 14px;
  transition: border-color var(--t), transform var(--t);
}
.teampick:hover { border-color: var(--accent); }
.teampick.sel { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(122,162,247,.18); }
.tp-tag { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); font-weight: 700; }
.tp-abbr { font-size: 26px; font-weight: 900; letter-spacing: .5px; }
.tp-name { font-size: 12.5px; color: var(--muted); }
.tp-odds {
  margin-top: 4px; font-size: 15px; font-weight: 800; color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.vs { color: var(--muted); font-weight: 800; font-size: 15px; }

/* ── Stake input (copied from threecardpoker.css bet input) ── */
.betrow { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.betrow .betlbl { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.betline { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.betinput {
  font-family: inherit; font-size: 15px; font-weight: 700; color: var(--fg);
  background: var(--panel2); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 8px 10px; width: 120px; font-variant-numeric: tabular-nums;
}
.betinput:focus { outline: none; border-color: var(--accent); }
.chipbtns { display: inline-flex; gap: 5px; flex-wrap: wrap; }
.chipbtn {
  font-family: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
  color: var(--muted); background: var(--panel2); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 7px 10px; transition: border-color var(--t), color var(--t);
}
.chipbtn:hover { border-color: var(--accent); color: var(--fg); }

.simactions { display: flex; gap: 8px; flex-wrap: wrap; }
.simactions .btn.big { padding: 10px 26px; font-size: 15px; }
.simactions .btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Scoreboard ── */
.simboard {
  position: relative; display: flex; flex-direction: column; align-items: center;
  gap: 14px; padding: 24px 20px;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(122,162,247,.14), transparent 60%),
    var(--panel);
}
.board-clock {
  font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--muted); font-weight: 700;
}
.scoreline {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 18px; width: 100%; max-width: 460px;
}
.teamscore {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 8px; border-radius: 12px; border: 2px solid transparent;
  transition: border-color .25s, background .25s;
}
.teamscore.picked { border-color: rgba(122,162,247,.5); background: rgba(122,162,247,.08); }
.teamscore.won { border-color: var(--green); background: rgba(46,160,67,.12); }
.teamscore.lost { opacity: .6; }
.ts-abbr { font-size: 15px; font-weight: 800; letter-spacing: .5px; color: var(--muted); }
.ts-num {
  font-size: 52px; font-weight: 900; line-height: 1;
  font-variant-numeric: tabular-nums; color: var(--fg);
}
.ts-dash { font-size: 30px; color: var(--muted); font-weight: 300; }
.ts-pick {
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .8px;
  color: var(--accent); min-height: 14px;
}
.ts-pick.empty { color: transparent; }
.teamscore.won .ts-abbr { color: var(--green); }

/* Score flash on a scoring event */
.ts-num.flash { animation: sim-flash .55s ease both; }
@keyframes sim-flash {
  0%   { transform: scale(1); color: var(--fg); }
  35%  { transform: scale(1.28); color: var(--gold); }
  100% { transform: scale(1); color: var(--fg); }
}

/* ── Result banner ── */
.simbanner {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  height: 0; overflow: hidden; margin-top: 16px;
  font-weight: 900; text-transform: uppercase; letter-spacing: 1px;
}
.simbanner.show {
  height: auto; min-height: 44px; padding: 8px 0;
  animation: sim-banner-in .3s ease both;
}
@keyframes sim-banner-in {
  from { opacity: 0; transform: scale(.96); }
  to   { opacity: 1; transform: none; }
}
.sb-label { font-size: 24px; }
.sb-pay {
  font-size: 15px; font-weight: 800; letter-spacing: normal; text-transform: none;
  font-variant-numeric: tabular-nums; color: var(--fg);
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: var(--r-pill); padding: 3px 12px;
}
.simbanner.win .sb-label { color: var(--green); }
.simbanner.lose .sb-label { color: var(--red); }

.simnote {
  text-align: center; color: var(--muted); font-size: 13px; line-height: 1.5;
  margin-top: 8px;
}
.simnote:empty { display: none; }
.simnote b { color: var(--fg); }

#simEnd { justify-content: center; margin: 16px 0 4px; }

/* ── Play-by-play feed ── */
.simfeed { margin-top: 16px; }
.feedlist { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow-y: auto; }
.feedlist:empty::after {
  content: "The play-by-play will appear here…";
  color: var(--muted); font-size: 13px;
}
.feeditem {
  display: grid; grid-template-columns: 68px 46px 1fr; gap: 10px; align-items: baseline;
  padding: 7px 8px; border-bottom: 1px solid var(--line); font-size: 13px;
  animation: sim-feed-in .25s ease both;
}
@keyframes sim-feed-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}
.fi-clock { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; }
.fi-abbr { font-weight: 800; letter-spacing: .3px; }
.feeditem.home .fi-abbr { color: var(--accent); }
.feeditem.away .fi-abbr { color: var(--gold); }
.fi-desc { color: var(--fg); }

@media (max-width: 520px) {
  .ts-num { font-size: 40px; }
  .tp-abbr { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .ts-num.flash, .simbanner.show, .feeditem, .sporttile { animation: none; transition: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Copied verbatim from threecardpoker.css so the coins hub + toasts are styled
   on this page too.
   ═══════════════════════════════════════════════════════════════════════════ */
.coinschip { font-weight: 700; color: var(--gold); background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; font-size: 13px; white-space: nowrap; cursor: pointer; transition: border-color .15s, transform .15s; }
.coinschip:hover { border-color: var(--gold); transform: translateY(-1px); }

.hubov { position: fixed; inset: 0; z-index: 250; display: grid; place-items: center; padding: 20px; background: rgba(5,7,11,.6); backdrop-filter: blur(3px); animation: cd-scrim-in .18s ease both; }
@keyframes cd-scrim-in { from { opacity: 0; } to { opacity: 1; } }
.hubcard { width: min(460px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px 20px; box-shadow: 0 24px 60px -20px #000; }
.hubhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.hubhead h3 { margin: 0; font-size: 17px; }
.hubx { background: none; border: 0; color: var(--muted); font-size: 18px; cursor: pointer; line-height: 1; padding: 4px 8px; border-radius: 8px; }
.hubx:hover { color: var(--fg); background: var(--panel2); }
.hubrow { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.hubrow:first-of-type { border-top: 0; }
.hubicon { font-size: 20px; width: 30px; text-align: center; flex: 0 0 auto; }
.hubt { font-weight: 700; font-size: 14px; }
.hubd { color: var(--muted); font-size: 12.5px; line-height: 1.45; margin-top: 2px; }
.hubfoot { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; text-align: right; }
.hubfoot b { color: var(--gold); }

.cardtoast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 300;
  background: var(--panel2); color: var(--fg); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 18px; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
