/* Khel ON wave 2 — shared look (navy desk, brand gradient, sheets, chips, badges). */
:root {
  --desk: #141721; --panel: #20253a; --panel-2: #2a3049; --line: #363d5c; --ink: #f5f3ff; --muted: #a9abc6;
  --orange: #ff9a3c; --pink: #f04fa8; --violet: #8b5cf6; --teal: #2fd4c8; --gold: #ffc23d; --acc: #f04fa8;
  --grad: linear-gradient(100deg, var(--orange), var(--pink) 50%, var(--violet));
  --display: "Outfit", "Trebuchet MS", system-ui, sans-serif; --body: "Nunito", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}
[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { background: radial-gradient(90% 50% at 50% 0%, color-mix(in srgb, var(--acc) 12%, transparent), transparent 70%), var(--desk); color: var(--ink); font-family: var(--body); font-size: 16px; -webkit-tap-highlight-color: transparent; min-height: 100vh; -webkit-user-select: none; user-select: none; overflow-x: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
button:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 10px; }
h1, h2, h3 { font-family: var(--display); margin: 0; text-wrap: balance; }
p { margin: 0; }
svg { display: block; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 20px; border-radius: 999px; font-family: var(--display); font-weight: 800; font-size: 17px; color: var(--ink); white-space: nowrap; }
.btn.primary { background: var(--grad); color: #fff; box-shadow: 0 6px 18px rgba(240, 79, 168, .28); }
.btn.teal { background: var(--teal); color: #08221f; }
.btn.ghost { border: 2px solid var(--line); }
.btn.big { min-height: 60px; font-size: 20px; }
.btn:disabled { opacity: .45; cursor: default; }
.play { max-width: 760px; margin: 0 auto; padding: 8px 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bar-t { display: flex; flex-direction: column; min-width: 0; }
.bar-t b { font-family: var(--display); font-size: 22px; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.bar-t span { color: var(--muted); font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 7px 13px; font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.msg { text-align: center; color: #d2d1e8; font-weight: 800; min-height: 24px; }
.scrim { position: fixed; inset: 0; z-index: 2147483000; background: rgba(8,10,18,.72); display: grid; place-items: center; padding: 14px; }
.box { width: min(480px, 100%); max-height: calc(100vh - 28px); max-height: calc(100dvh - 28px); overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 20px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.box > * { flex-shrink: 0; }
.box h2 { font-size: 25px; font-weight: 800; }
.box p { color: #d2d1e8; line-height: 1.5; }
.small { font-size: 13px; color: var(--muted); }
.kick { color: var(--acc); font-weight: 800; font-size: 14px; }
.btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; margin-top: 4px; }
.btns.col { flex-direction: column; align-items: stretch; }
.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; line-height: 1.45; color: #d2d1e8; }
.lab { font-weight: 800; font-size: 14px; color: var(--muted); margin-top: 4px; }
.chips { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 8px; }
.chip { min-height: 52px; border-radius: 14px; border: 2px solid var(--line); background: var(--panel-2); font-weight: 800; font-size: 15px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; padding: 4px; text-align: center; }
.chip small { font-size: 11.5px; color: var(--muted); font-weight: 800; }
.chip small.st { color: var(--gold); letter-spacing: 1px; }
.chip[aria-pressed="true"] { border-color: var(--acc); background: color-mix(in srgb, var(--acc) 18%, var(--panel-2)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 25%, transparent); }
.win-stars { display: flex; justify-content: center; gap: 8px; font-size: 54px; line-height: 1; }
.win-stars span { color: #3a3f5e; }
.win-stars span.on { color: var(--gold); animation: star .5s cubic-bezier(.3, 1.6, .5, 1) both; text-shadow: 0 0 18px rgba(255, 194, 61, .6); }
@keyframes star { from { transform: scale(.2) rotate(-40deg); opacity: 0; } }
.final { display: flex; flex-direction: column; gap: 6px; }
.final div { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 12px; background: var(--panel-2); font-weight: 800; }
.final div b { margin-left: auto; font-family: var(--display); font-size: 22px; }
.final div.top { box-shadow: 0 0 0 2px var(--gold) inset; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.badge { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 10px 8px; border-radius: 16px; background: var(--panel-2); border: 2px solid var(--line); }
.badge svg { width: 46px; height: 46px; }
.badge b { font-size: 14px; line-height: 1.2; }
.badge small { font-size: 12px; color: var(--muted); font-weight: 700; line-height: 1.3; }
.badge.off { opacity: .45; filter: grayscale(1); }
.badge.new { border-color: var(--gold); animation: star .5s both; }
.starrow { display: grid; grid-template-columns: repeat(var(--cols, 3), 1fr); gap: 8px; }
.starrow div { background: var(--panel-2); border-radius: 14px; padding: 8px; text-align: center; font-weight: 800; font-size: 14px; }
.starrow div span { display: block; color: var(--gold); letter-spacing: 2px; font-size: 18px; }
.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 2147483100; background: #f5f3ff; color: #141721; font-weight: 800; padding: 10px 18px; border-radius: 999px; box-shadow: 0 10px 30px rgba(0,0,0,.4); max-width: calc(100vw - 32px); text-align: center; pointer-events: none; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 2147482000; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: fall 2.2s ease-in forwards; }
@keyframes fall { to { top: 105%; transform: translateX(40px) rotate(540deg); } }
.av { flex: none; }
.scores { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: 8px; }
.sc { display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 8px; border-radius: 16px; background: var(--panel); border: 2px solid var(--line); min-width: 0; transition: border-color .2s, box-shadow .2s, transform .2s; }
.sc .nm { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.sc .nm b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc .nm small { font-size: 11.5px; color: var(--muted); font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc .pts { margin-left: auto; font-family: var(--display); font-weight: 800; font-size: 24px; font-variant-numeric: tabular-nums; }
.sc.turn { border-color: var(--pc, var(--acc)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pc, var(--acc)) 35%, transparent); transform: translateY(-1px); }
.scores.many .sc { flex-direction: column; align-items: center; padding: 6px 4px; gap: 2px; text-align: center; }
.scores.many .sc .pts { margin: 0; font-size: 20px; }
.scores.many .sc .nm { align-items: center; width: 100%; }
@media (max-width: 380px) { .play { padding: 6px 8px 12px; gap: 8px; } .chip { font-size: 14px; } .box { padding: 16px; } }
@media (min-width: 900px) { .play { padding-top: 16px; } .bar-t b { font-size: 26px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

/* ---------- Sudoku Junior: a slate of teal and violet ---------- */
:root { --acc: #2fd4c8; }
.pills { display: flex; gap: 6px; }
.arena { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.grid-wrap { width: 100%; display: flex; justify-content: center; }
.grid { --n: 9; display: grid; grid-template-columns: repeat(var(--n), 1fr); width: min(100%, 560px, calc(100svh - 330px)); min-width: min(100%, 280px); aspect-ratio: 1; background: #0e111b; border: 3px solid #5d6595; border-radius: 14px; overflow: hidden; touch-action: manipulation; }
.cell { position: relative; display: grid; place-items: center; border-right: 1px solid #343a58; border-bottom: 1px solid #343a58; background: #1b2034; font-family: var(--display); font-weight: 700; color: #8ff3ea; font-size: calc(min(100vw - 24px, 560px) / var(--n) * .52); transition: background .12s; aspect-ratio: 1; min-width: 0; }
.grid.n9 .cell { font-size: clamp(16px, 5.4vw, 30px); }
.grid.n6 .cell { font-size: clamp(22px, 8vw, 40px); }
.grid.n4 .cell { font-size: clamp(28px, 12vw, 56px); }
.cell.lc { border-right: 0; } .cell.lr { border-bottom: 0; }
.cell.br { border-right: 3px solid #5d6595; }
.cell.bb { border-bottom: 3px solid #5d6595; }
.cell.given { color: #f5f3ff; background: #232944; }
.cell.peer { background: #242c4a; }
.cell.given.peer { background: #2a3254; }
.cell.same { background: color-mix(in srgb, var(--violet) 32%, #1b2034); }
.cell.sel { background: color-mix(in srgb, var(--teal) 30%, #1b2034); box-shadow: inset 0 0 0 3px var(--teal); z-index: 1; }
.cell.bad .v { color: #ff6b81; text-decoration: underline wavy rgba(255, 107, 129, .6); text-underline-offset: 4px; }
.cell .v { line-height: 1; }
.grid.fruit .cell .v { font-size: .9em; }
.cell.pop .v { animation: cpop .35s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes cpop { from { transform: scale(.3); } }
.cell .nt { position: absolute; inset: 2px; display: grid; grid-template-columns: repeat(var(--k), 1fr); font-size: clamp(8px, 2.1vw, 12px); color: #b8bbdc; font-family: var(--body); font-weight: 800; }
.grid.n6 .cell .nt { font-size: clamp(10px, 3vw, 15px); } .grid.n4 .cell .nt { font-size: clamp(12px, 4vw, 18px); }
.cell .nt i { font-style: normal; display: grid; place-items: center; line-height: 1; }
.side { width: min(100%, 560px); display: flex; flex-direction: column; gap: 10px; }
.tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tool { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; border-radius: 14px; background: var(--panel); border: 2px solid var(--line); font-weight: 800; position: relative; }
.tool svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tool[aria-pressed="true"] { border-color: var(--teal); background: color-mix(in srgb, var(--teal) 22%, var(--panel)); color: #b6fff8; }
.tool em { position: absolute; top: -8px; right: 6px; font-style: normal; font-size: 11px; background: var(--gold); color: #2a1d00; border-radius: 999px; padding: 1px 7px; }
.tool em:empty { display: none; }
.pad { --n: 9; display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 6px; }
.grid.n9 ~ .pad, .pad { }
.num { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 54px; border-radius: 14px; background: var(--panel-2); border: 2px solid var(--line); font-family: var(--display); font-weight: 800; font-size: 24px; line-height: 1; }
.num small { font-family: var(--body); font-size: 11px; color: var(--muted); margin-top: 2px; }
.num:active { transform: scale(.94); background: color-mix(in srgb, var(--teal) 25%, var(--panel-2)); }
.num.full { opacity: .45; }
@media (max-width: 380px) { .num { min-height: 48px; font-size: 21px; border-radius: 12px; } .pad { gap: 4px; } }
@media (min-width: 900px) {
  .play { max-width: 1060px; }
  .arena { flex-direction: row; align-items: flex-start; justify-content: center; gap: 28px; }
  .grid { width: min(620px, calc(100vh - 170px)); }
  .grid-wrap { width: auto; }
  .side { width: 300px; position: sticky; top: 12px; }
  .pad { grid-template-columns: repeat(3, 1fr); }
  .num { min-height: 72px; font-size: 30px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .arena { flex-direction: row; align-items: flex-start; justify-content: center; }
  .grid { width: calc(100svh - 120px); min-width: 200px; }
  .grid-wrap { width: auto; }
  .side { width: min(300px, 45vw); }
  .pad { grid-template-columns: repeat(5, 1fr); } .num { min-height: 40px; font-size: 18px; }
  .bar-t span { display: none; }
}
