/* SharpLab HQ — Horse Race page.
   Builds on hqstyle.css (shared vars/header/nav/.btn/.card). Only horse-race-
   specific styling here. Uses ONLY hqstyle.css CSS vars. */

/* ── Page intro ── */
.hr-head { margin: 4px 0 20px; }
.hr-head h1 { font-size: 26px; margin: 0 0 4px; }
.hr-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;
}

/* ── Table card ── */
.hrtablecard {
  display: flex; flex-direction: column; gap: 16px;
  padding: 20px;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(46,160,67,.14), transparent 60%),
    var(--panel);
  border: 1px solid var(--line);
}

/* ── Roster (selectable horse list) ── */
.hrroster {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}
.hrhorse {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; cursor: pointer;
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: var(--r-sm);
  transition: border-color var(--t), background var(--t), transform var(--t);
}
.hrhorse:hover { border-color: var(--accent); transform: translateY(-1px); }
.hrhorse:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--ring); }
.hrhorse.picked {
  border-color: var(--accent); background: var(--accent-soft, var(--panel2));
  box-shadow: inset 0 0 0 1px var(--accent);
}
.hremoji { font-size: 20px; flex: 0 0 auto; }
.hrname { font-weight: 700; font-size: 14px; color: var(--fg); flex: 1 1 auto; }
.hrmult {
  font-weight: 800; font-size: 13px; color: var(--gold);
  font-variant-numeric: tabular-nums;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-pill); padding: 2px 9px; flex: 0 0 auto;
}

/* ── Result banner (between roster and track) ── */
.hrbanner {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  min-height: 0; height: 0; overflow: hidden;
  font-weight: 900; text-transform: uppercase; letter-spacing: 1px;
  transition: height .2s ease;
}
.hrbanner.show {
  height: auto; min-height: 40px; padding: 4px 0;
  animation: hr-banner-in .3s ease both;
}
@keyframes hr-banner-in {
  from { opacity: 0; transform: scale(.96); }
  to   { opacity: 1; transform: none; }
}
.hrbannerlabel { font-size: 22px; }
.hrbanner.win  .hrbannerlabel { color: var(--green); }
.hrbanner.lose .hrbannerlabel { color: var(--red); }
.hrbannerwin {
  font-size: 14px; font-weight: 800; letter-spacing: normal; text-transform: none;
  color: var(--fg);
}
.hrbannerpay {
  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;
}

/* ── The track ── */
.hrtrackwrap {
  position: relative;
  display: flex; flex-direction: column; gap: 6px;
  padding: 12px 14px;
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.hrlane {
  display: grid; grid-template-columns: 96px 1fr auto; align-items: center; gap: 10px;
  padding: 4px 0;
  border-radius: var(--r-sm);
  transition: background var(--t);
}
.hrlanename { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hrlanemult { font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.hrtrack {
  position: relative; height: 26px;
  border-bottom: 2px dashed var(--line-strong);
}
.hrrunner {
  position: absolute; left: 0; bottom: 0; font-size: 22px; line-height: 26px;
  will-change: left;
}
.hrrunner.running { animation: hr-bob .35s ease-in-out infinite; }
@keyframes hr-bob {
  0%, 100% { margin-bottom: 0; }
  50% { margin-bottom: 3px; }
}
/* Finish line down the right edge of the track lanes */
.hrfinish {
  position: absolute; top: 8px; bottom: 8px; right: 46px; width: 8px;
  background:
    repeating-linear-gradient(45deg, var(--fg) 0 4px, transparent 4px 8px),
    repeating-linear-gradient(45deg, transparent 0 4px, var(--fg) 4px 8px);
  opacity: .5; border-radius: 2px; pointer-events: none;
}

/* Winner / your-pick lane highlights after the race */
.hrlane.winner { background: var(--green-soft, rgba(46,160,67,.14)); }
.hrlane.winner .hrlanename { color: var(--green); }
.hrlane.mypick .hrlanename { color: var(--accent); }
.hrlane.mypick.winner .hrlanename { color: var(--green); }

/* ── Controls card ── */
.hrcontrols {
  display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap;
  margin-top: 16px;
}
.hractions { display: flex; gap: 8px; flex-wrap: wrap; }
.hractions .btn.big { padding: 10px 26px; font-size: 15px; }

/* Bet input component (copied from casino.css) */
.betrow { display: flex; flex-direction: column; gap: 6px; }
.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); }
.chipbtn:disabled, .betinput:disabled { opacity: .5; cursor: not-allowed; }

@media (prefers-reduced-motion: reduce) {
  .hrbanner.show, .hrbanner, .hrrunner, .hrhorse { transition: none; animation: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Copied verbatim from casino.css so the coins hub + toasts are styled on this
   page too (casino.css is only loaded on the Casino page).
   ═══════════════════════════════════════════════════════════════════════════ */
.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); }

/* Coins hub modal */
.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);
}
