/* SharpLab HQ — Mastermind page.
   Builds on hqstyle.css (shared vars/header/nav/.btn/.card). Only page-specific styling here. */

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

/* ── Layout ── */
.mm-wrap { max-width: 460px; margin: 0 auto; }
.mcard { display: flex; flex-direction: column; gap: var(--s-4); align-items: center; }

.mstatus {
  font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--accent2);
  background: var(--panel2); border: 1px solid var(--line); border-radius: var(--r-pill);
  padding: 3px 12px; font-weight: 700;
}

/* ── Color peg (shared swatch look) ── */
.peg {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: inset 0 2px 4px rgba(255,255,255,.25), inset 0 -3px 5px rgba(0,0,0,.35);
  flex: 0 0 auto; box-sizing: border-box;
}
.peg.red    { background: #e5484d; }
.peg.orange { background: #f2851d; }
.peg.yellow { background: #f3d23b; }
.peg.green  { background: #46a758; }
.peg.blue   { background: #4d90d5; }
.peg.purple { background: #a86ad4; }
.peg.empty  {
  background: var(--panel2); border: 1px dashed var(--line);
  box-shadow: none;
}

/* ── Guess history board ── */
.mboard { display: flex; flex-direction: column; gap: 7px; width: 100%; }
.mrow {
  display: flex; align-items: center; gap: 10px;
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: var(--r); padding: 7px 10px;
}
.mrow.pending { opacity: .35; border-style: dashed; }
.mrownum { font-size: 12px; color: var(--muted); width: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.mrowpegs { display: flex; gap: 7px; }
.mrowfb {
  margin-left: auto; display: grid; grid-template-columns: repeat(2, auto);
  gap: 3px; align-items: center;
}
.fbdot { width: 11px; height: 11px; border-radius: 50%; }
.fbdot.black { background: var(--fg); border: 1px solid rgba(255,255,255,.3); }
.fbdot.white { background: transparent; border: 1px solid var(--muted); }
.fbdot.miss  { background: var(--panel); border: 1px solid var(--line); opacity: .4; }
.fbtext { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; margin-left: 4px; }

/* ── Current guess slots ── */
.mcurrent { display: flex; flex-direction: column; gap: 10px; align-items: center; width: 100%; }
.mslots { display: flex; gap: 12px; justify-content: center; }
.mslot {
  width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; background: none; border: 0; padding: 0;
  transition: transform .12s;
}
.mslot:hover { transform: translateY(-2px); }
.mslot .peg { width: 38px; height: 38px; }
.mslot.sel .peg { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Palette ── */
.mpalette { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.mswatch {
  cursor: pointer; background: none; border: 0; padding: 3px; border-radius: 50%;
  transition: transform .12s;
}
.mswatch:hover { transform: translateY(-2px); }
.mswatch.sel { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 50%; }
.mswatch .peg { width: 34px; height: 34px; }

/* ── Buttons ── */
.mbtns { display: flex; gap: 8px; width: 100%; justify-content: center; flex-wrap: wrap; }
.mbtns .btn { flex: 1; min-width: 120px; text-align: center; }
.btn.big { font-size: 16px; padding: 12px 18px; }

.mmsg { font-size: 13px; min-height: 18px; font-weight: 600; text-align: center; }
.mmsg.win { color: var(--gold); }
.mmsg.lose { color: var(--red); }
.mmsg.idle { color: var(--muted); font-weight: 400; }

.mreward { font-size: 18px; font-weight: 800; color: var(--gold); font-variant-numeric: tabular-nums; }
.mcounter { font-size: 12px; color: var(--muted); }
.mcounter b { color: var(--fg); font-variant-numeric: tabular-nums; }

/* ── Solve celebration ── */
.mrow.solvedrow { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
@keyframes mm-pop { 0% { transform: scale(.85); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
.mreward.pop { animation: mm-pop .5s ease; }

@media (prefers-reduced-motion: reduce) {
  .mslot, .mswatch, .mmode { transition: none; }
  .mreward.pop { animation: none; }
}

/* ── Mode toggle pills (⏱ Timed / 🧘 Zen) ── */
.mmodes { display: flex; gap: 8px; justify-content: center; margin: 0 auto 18px; }
.mmode {
  cursor: pointer; font-size: 14px; font-weight: 700; padding: 7px 16px;
  border-radius: var(--r-pill); border: 1px solid var(--line);
  background: var(--panel2); color: var(--muted); transition: transform .12s, border-color .15s, color .15s;
}
.mmode:hover { border-color: var(--accent); color: var(--fg); transform: translateY(-1px); }
.mmode.sel { background: var(--accent); color: #0b0d12; border-color: var(--accent); }

/* ── Status + timer bar ── */
.mtopbar { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.mtimer {
  font-size: 12px; font-weight: 800; color: var(--gold);
  background: var(--panel2); border: 1px solid var(--line); border-radius: var(--r-pill);
  padding: 3px 12px; font-variant-numeric: tabular-nums;
}

/* ── Timed run result panel ── */
.mrunresult { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.mruntime { font-size: 18px; font-weight: 800; color: var(--fg); }
.mrank { font-size: 13px; color: var(--accent2); font-weight: 700; }
.mbest { font-size: 15px; font-weight: 800; color: var(--gold); }

/* ── Leaderboard (fastest 5-code runs) ── */
.mleaderboard { max-width: 460px; margin: 22px auto 0; }
.mlbhead {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
  color: var(--accent2); text-align: center; margin-bottom: 12px;
}
.mlbempty { text-align: center; color: var(--muted); font-size: 13px; }
.mlblist { display: flex; flex-direction: column; gap: 6px; }
.mlbrow {
  display: flex; align-items: center; gap: 10px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: var(--r);
  padding: 8px 12px; font-size: 14px;
}
.mlbrow.me { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.mlbrank { font-size: 12px; color: var(--muted); width: 32px; font-variant-numeric: tabular-nums; }
.mlbname { font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mlbruns { font-size: 12px; color: var(--muted); }
.mlbtime { font-weight: 800; color: var(--gold); font-variant-numeric: tabular-nums; }

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