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

/* ---------- Hath Cricket: a gully pitch at dusk ---------- */
:root { --acc: #ff9a3c; }
.sc .pts i { font-style: normal; font-size: .6em; color: var(--muted); }
.log { display: flex; gap: 5px; justify-content: center; min-height: 28px; flex-wrap: wrap; }
.log i { font-style: normal; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; background: var(--panel-2); font-weight: 800; font-size: 13px; }
.log i.b { background: #ffc23d; color: #2a1d00; } .log i.w { background: #ff6b81; color: #2a0010; }
.pitch { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 14px 10px; border-radius: 22px; min-height: 190px;
  background: linear-gradient(180deg, rgba(255,255,255,.03), transparent), radial-gradient(60% 90% at 50% 100%, #3f6b3a, #2b4a2a 55%, #1e2f22); border: 2px solid #3e5a3a; position: relative; overflow: hidden; }
.pitch::before { content: ""; position: absolute; left: 50%; top: 10%; bottom: 10%; width: 30%; transform: translateX(-50%); background: linear-gradient(#c9a66b, #b28f57); opacity: .22; border-radius: 10px; }
.side-h { display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; z-index: 1; text-align: center; }
.side-h small { font-weight: 800; color: var(--pc); font-size: 13px; line-height: 1.2; }
.side-h em { font-style: normal; font-size: 12px; font-weight: 800; color: var(--muted); }
.side-h em.ok { color: var(--teal); }
.hand { width: min(28vw, 120px); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 40% 30%, #fff6e6, #f3d9b0); box-shadow: 0 10px 24px -10px #000, inset 0 -6px 0 rgba(0,0,0,.12); display: grid; place-items: center; position: relative; }
.hand .em { font-size: min(13vw, 56px); line-height: 1; }
.hand b { position: absolute; right: -4px; bottom: -4px; min-width: 36px; height: 36px; border-radius: 999px; background: var(--pc, var(--acc)); color: #fff; display: grid; place-items: center; font-family: var(--display); font-size: 21px; box-shadow: 0 4px 10px rgba(0,0,0,.4); }
.hand b:empty { display: none; }
.hand:not(.show) .em { animation: shake 1.2s ease-in-out infinite; }
.hand.r:not(.show) .em { animation-delay: .3s; }
@keyframes shake { 0%, 60%, 100% { transform: translateY(0); } 70% { transform: translateY(-8px) rotate(-8deg); } 80% { transform: translateY(0); } }
.hand.show { animation: reveal .35s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes reveal { from { transform: scale(.6) rotate(-12deg); } }
.mid { position: relative; z-index: 1; min-width: 70px; display: grid; place-items: center; }
.vs { font-family: var(--display); font-weight: 800; color: var(--muted); font-size: 20px; }
.big { font-family: var(--display); font-weight: 800; font-size: 30px; text-align: center; animation: bang .45s cubic-bezier(.3, 1.6, .5, 1); line-height: 1; white-space: nowrap; }
.big.out { color: #ff6b81; text-shadow: 0 0 18px rgba(255,107,129,.6); }
.big.boundary { color: #ffc23d; text-shadow: 0 0 18px rgba(255,194,61,.6); font-size: 34px; }
.big.run { color: #fff; }
@keyframes bang { from { transform: scale(.3); opacity: 0; } }
.msg { font-size: 17px; }
.ctl { min-height: 140px; }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pk { min-height: 64px; border-radius: 18px; background: var(--panel); border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; gap: 10px; font-family: var(--display); font-weight: 800; font-size: 28px; }
.pk span { font-size: 26px; }
.pk:active { transform: scale(.95); border-color: var(--acc); background: color-mix(in srgb, var(--acc) 22%, var(--panel)); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cover { position: fixed; inset: 0; z-index: 2147482500; background: radial-gradient(circle at 50% 30%, #2a3256, #121524); display: grid; place-items: center; padding: 24px; text-align: center; }
.cover > div { display: flex; flex-direction: column; gap: 14px; align-items: center; max-width: 420px; }
.cover h2 { font-size: 30px; }
.cover p { color: #d2d1e8; }
.cup { font-size: 64px; text-align: center; animation: star .6s both; }
.final div small { color: var(--muted); font-weight: 700; margin-left: 6px; }
@media (max-width: 380px) { .pitch { min-height: 160px; padding: 10px 6px; } .pk { min-height: 56px; font-size: 24px; } .big { font-size: 24px; } .big.boundary { font-size: 27px; } }
@media (min-width: 900px) { .play { max-width: 820px; } }
@media (max-height: 520px) and (orientation: landscape) {
  .play { display: grid; grid-template-columns: 1fr 1fr; grid-template-areas: "bar bar" "scores pitch" "log pitch" "msg ctl" "x ctl"; gap: 6px 14px; max-width: 920px; }
  .bar { grid-area: bar; } .scores { grid-area: scores; } .log { grid-area: log; } .pitch { grid-area: pitch; min-height: 0; padding: 6px; } .msg { grid-area: msg; } .ctl { grid-area: ctl; min-height: 0; }
  .hand { width: 80px; } .hand .em { font-size: 40px; } .pk { min-height: 46px; font-size: 22px; } .pk span { font-size: 20px; }
}
