@font-face { font-family: 'Baloo Bhaijaan 2'; font-weight: 600; font-display: swap; src: url(/fonts/baloo-bhaijaan-2-arabic-600-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'Baloo Bhaijaan 2'; font-weight: 800; font-display: swap; src: url(/fonts/baloo-bhaijaan-2-arabic-800-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'Baloo Bhaijaan 2'; font-weight: 600; font-display: swap; src: url(/fonts/baloo-bhaijaan-2-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'Baloo Bhaijaan 2'; font-weight: 800; font-display: swap; src: url(/fonts/baloo-bhaijaan-2-latin-800-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F; }

:root {
  --ink: #22264b; --paper: #fff; --sky: #9ad8ff; --line: #d5d9e6; --panel: #eef1f8;
  --orange: #ff9f43; --orange-press: #e07f1f; --green: #2ecc71; --green-press: #1fa558;
  --blue: #3aa0ff; --blue-press: #1f7fd9; --yellow: #ffc93c; --yellow-press: #e0a81c;
  --radius-card: 26px; --radius-panel: 34px; --space-4: 14px; --tap: 58px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--sky); color: var(--ink);
  font-family: 'Baloo Bhaijaan 2', system-ui, sans-serif; font-weight: 600;
  padding: max(var(--space-4), env(safe-area-inset-top)) max(var(--space-4), env(safe-area-inset-right)) max(var(--space-4), env(safe-area-inset-bottom)) max(var(--space-4), env(safe-area-inset-left));
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
main { max-width: 960px; margin: 0 auto; }

.title { color: var(--paper); font-weight: 800; font-size: clamp(46px, 12vw, 96px); line-height: .95; text-align: center; margin: 24px 0 26px; text-shadow: 0 6px 0 var(--ink); }
.subtitle { color: var(--paper); font-weight: 800; font-size: clamp(30px, 7vw, 40px); line-height: 1.1; margin: 0; text-shadow: 0 4px 0 var(--ink); }

.panel { background: var(--paper); border-radius: var(--radius-panel); box-shadow: 0 10px 0 var(--line); padding: 26px; max-width: 460px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.panel label { font-size: 21px; font-weight: 800; }
.panel input { font: inherit; font-size: 22px; font-weight: 800; color: var(--ink); background: var(--panel); border: 3px solid transparent; border-radius: 18px; padding: 12px 16px; min-height: var(--tap); width: 100%; }
.panel input:focus { outline: none; border-color: var(--blue); }
.panel input.code { letter-spacing: 10px; text-align: center; direction: ltr; }
.hint { font-size: 16px; margin: 0; }
.error { font-size: 18px; font-weight: 800; color: #c0392b; margin: 0; min-height: 1em; }

button, .btn { font: inherit; border: 0; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: var(--tap); transition: transform .08s ease, box-shadow .08s ease; }
.pill { border-radius: 999px; padding: 10px 26px; font-size: 22px; font-weight: 800; color: var(--paper); }
.pill.orange { background: var(--orange); box-shadow: 0 6px 0 var(--orange-press); }
.pill.green { background: var(--green); box-shadow: 0 6px 0 var(--green-press); }
.pill.blue { background: var(--blue); box-shadow: 0 6px 0 var(--blue-press); }
.pill.ghost { background: var(--paper); color: var(--ink); box-shadow: 0 6px 0 var(--line); }
.pill.panel-btn { background: var(--panel); color: var(--ink); box-shadow: 0 6px 0 var(--line); font-size: 18px; }
.pill:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--line); }
.pill.orange:active { box-shadow: 0 2px 0 var(--orange-press); }
.pill.green:active { box-shadow: 0 2px 0 var(--green-press); }
button:disabled { opacity: .6; cursor: default; }
.round { width: var(--tap); height: var(--tap); border-radius: 50%; background: var(--paper); box-shadow: 0 5px 0 var(--line); color: var(--ink); }
.round svg { width: 30px; height: 30px; }
.round:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--line); }

.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 26px; }
.bar .actions { display: flex; gap: 12px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 26px 18px; }
.game { background: var(--paper); border-radius: var(--radius-card); box-shadow: 0 7px 0 var(--line); padding: 12px 12px 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; transition: transform .08s ease, box-shadow .08s ease; }
.game:active { transform: translateY(5px); box-shadow: 0 2px 0 var(--line); }
.game .art { width: 100%; aspect-ratio: 4 / 3; border-radius: 18px; display: grid; place-items: center; }
.game .art svg { width: 44%; height: 44%; color: var(--paper); }
.game .name { font-size: 21px; font-weight: 800; line-height: 1.3; text-align: center; }
.game .meta { font-size: 16px; display: flex; gap: 8px; align-items: center; }
.game .tag { background: var(--panel); border-radius: 999px; padding: 0 10px; }
.game.locked { opacity: .55; pointer-events: none; }
.stars { display: inline-flex; gap: 4px; direction: ltr; }
.stars svg { width: 20px; height: 20px; fill: var(--line); }
.stars svg.on { fill: var(--yellow); }

.empty { text-align: center; }
.empty p { font-size: 21px; font-weight: 800; margin: 0; }

.offline { background: var(--ink); color: var(--paper); border-radius: 999px; padding: 4px 16px; font-size: 16px; text-align: center; margin: 0 auto 18px; width: fit-content; }

.report-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 12px 0; border-bottom: 3px solid var(--panel); }
.report-row:last-child { border-bottom: 0; }
.report-row .name { font-size: 21px; font-weight: 800; }
.report-row .detail { font-size: 16px; grid-column: 1 / -1; }
.totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; text-align: center; }
.totals div { background: var(--panel); border-radius: 18px; padding: 10px 4px; }
.totals b { display: block; font-size: 32px; line-height: 1.1; }
.totals span { font-size: 16px; }

.device { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--panel); border-radius: 18px; padding: 8px 8px 8px 16px; }
.device .who { font-size: 18px; font-weight: 800; }
.device .when { font-size: 16px; }
.wide { max-width: 640px; }
