/* 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; } }

/* ---------- Phool Khoj: a courtyard garden ---------- */
:root { --acc: #7bd389; }
.pills { display: flex; gap: 6px; }
.field-wrap { display: flex; justify-content: center; }
.field { --c: 8; --r: 8; display: grid; grid-template-columns: repeat(var(--c), 1fr); gap: 3px; padding: 8px; border-radius: 18px; background: linear-gradient(160deg, #3b2a1d, #2a1d14); border: 3px solid #5a3f2a; box-shadow: inset 0 0 0 2px rgba(0,0,0,.25), 0 14px 40px -18px #000;
  max-width: 100%; touch-action: manipulation; }
.pt { aspect-ratio: 1; border-radius: 8px; position: relative; display: grid; place-items: center; min-width: 0;
  background: radial-gradient(circle at 35% 30%, #8fe08a, #3f9a46 60%, #2d7a36); box-shadow: inset 0 -3px 0 rgba(0,0,0,.25), inset 0 2px 0 rgba(255,255,255,.18); font-family: var(--display); font-weight: 800; font-size: calc(var(--cs, 32px) * .5); }
.pt::after { content: ""; position: absolute; width: 34%; height: 14%; left: 22%; top: 24%; border-radius: 50%; background: rgba(255,255,255,.22); transform: rotate(-30deg); }
.pt:active:not(.open) { transform: scale(.92); }
.field.fencing .pt:not(.open) { box-shadow: inset 0 -3px 0 rgba(0,0,0,.25), inset 0 0 0 2px rgba(255,194,61,.55); }
.pt.open { background: #6b4a33; box-shadow: inset 0 2px 4px rgba(0,0,0,.35); }
.pt.open::after, .pt.fence::after, .pt.oops::after, .pt.found::after { display: none; }
.pt.open b { text-shadow: 0 2px 0 rgba(0,0,0,.45); }
.pt.fresh { animation: dug .3s ease-out both; }
@keyframes dug { from { transform: scale(.6); background: #8fe08a; } }
.pt.fence { background: radial-gradient(circle at 35% 30%, #8fe08a, #3f9a46 60%, #2d7a36); box-shadow: inset 0 0 0 3px #ffc23d, inset 0 -3px 0 rgba(0,0,0,.25); }
.pt span { font-size: .95em; line-height: 1; filter: drop-shadow(0 2px 1px rgba(0,0,0,.35)); }
.pt.oops { background: #5a3530; }
.pt.found { background: #4e6b3b; }
.pt.wob { animation: wob .5s ease-in-out; }
@keyframes wob { 20%, 60% { transform: rotate(-9deg); } 40%, 80% { transform: rotate(9deg); } }
.ctl { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: min(100%, 620px); margin: 0 auto; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; flex: 1; max-width: 340px; }
.md { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; border-radius: 16px; background: var(--panel); border: 2px solid var(--line); font-family: var(--display); font-weight: 800; font-size: 18px; }
.md svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.md[aria-pressed="true"] { border-color: var(--acc); background: color-mix(in srgb, var(--acc) 22%, var(--panel)); }
#bFence[aria-pressed="true"] { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 20%, var(--panel)); }
.lives { display: flex; gap: 2px; font-size: 22px; }
.lives i { font-style: normal; filter: grayscale(1) opacity(.35); }
.lives i.on { filter: none; }
.lives small { color: var(--muted); font-weight: 800; }
.sad { font-size: 60px; text-align: center; }
@media (min-width: 900px) { .play { max-width: 900px; } }
@media (max-height: 520px) and (orientation: landscape) {
  .play { flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: flex-start; }
  .bar { width: 100%; }
  .ctl { flex-direction: column; width: 180px; margin: 0; }
  .modes { grid-template-columns: 1fr; width: 100%; }
}
