/* Angana: the courtyard games. Two grounds for the screens around the games: a lime-washed wall by day and a child's
 * slate by night, with one accent, red oxide, the colour of the floor the games are played on. The games themselves are
 * always on that floor (js/game/). A deliberate departure from the Dixith Labs design standard, as Ghatika's: his
 * request of 18 October 2026, "It should look raw." Baloo Tamma 2 for Kannada and Latin, Baloo 2 for Devanagari.
 * Contrast measured: light ink 15:1, light accent on the ground 7.2:1; dark ink 14:1, dark accent 6.6:1. */

@font-face { font-family: 'Angana'; src: url('fonts/baloo-tamma-2-kannada-500-normal.woff2') format('woff2'); font-weight: 400 500; font-display: swap; unicode-range: U+0C80-0CFF, U+200C-200D, U+25CC; }
@font-face { font-family: 'Angana'; src: url('fonts/baloo-tamma-2-kannada-700-normal.woff2') format('woff2'); font-weight: 600 800; font-display: swap; unicode-range: U+0C80-0CFF, U+200C-200D, U+25CC; }
@font-face { font-family: 'Angana'; src: url('fonts/baloo-2-devanagari-500-normal.woff2') format('woff2'); font-weight: 400 500; font-display: swap; unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FF; }
@font-face { font-family: 'Angana'; src: url('fonts/baloo-2-devanagari-700-normal.woff2') format('woff2'); font-weight: 600 800; font-display: swap; unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FF; }
@font-face { font-family: 'Angana'; src: url('fonts/baloo-tamma-2-latin-500-normal.woff2') format('woff2'); font-weight: 400 500; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Angana'; src: url('fonts/baloo-tamma-2-latin-700-normal.woff2') format('woff2'); font-weight: 600 800; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #F4EFE7; --bg-2: #ECE5DA; --card: #FBF8F3; --surface: #FBF8F3; --chip: #E7DFD3;
  --ink: #241F1C; --ink-2: #5A524C; --ink-3: #8A817A; --muted: #5A524C;
  --line: #E0D7CB; --line-2: #D0C5B7; --hover: rgba(36, 31, 28, .05); --press: rgba(36, 31, 28, .08);
  --accent: #9C2B24; --accent-2: #9C2B24; --accent-ink: #8A241E; --on-accent: #FFFFFF;
  --accent-soft: rgba(156, 43, 36, .09); --accent-line: rgba(156, 43, 36, .30);
  --late: #A33B2B;
  --floor: #8E181C; --chalk: #F2ECE5;
  --shadow-1: 0 1px 2px rgba(36, 31, 28, .05);
  --font: 'Angana', 'Noto Sans Kannada', 'Noto Sans Devanagari', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Angana', 'Noto Sans Kannada', 'Noto Sans Devanagari', system-ui, sans-serif;
  --ts: 1;
  --tabs-h: 64px;
  color-scheme: light;
}
:root[data-theme="dark"], :root.auto-dark {
  --bg: #1F1C1A; --bg-2: #262220; --card: #2A2623; --surface: #2A2623; --chip: #332E2A;
  --ink: #F2ECE5; --ink-2: #C2B8AD; --ink-3: #8E857C; --muted: #C2B8AD;
  --line: #3A3430; --line-2: #4A433E; --hover: rgba(242, 236, 229, .05); --press: rgba(242, 236, 229, .08);
  --accent: #E07A6C; --accent-2: #E07A6C; --accent-ink: #EE9A8D; --on-accent: #1F1C1A;
  --accent-soft: rgba(224, 122, 108, .14); --accent-line: rgba(224, 122, 108, .38);
  --late: #E07A68;
  --shadow-1: none;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink);
  font: 400 calc(16px * var(--ts)) / 1.5 var(--font); -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom));
  -webkit-tap-highlight-color: transparent;
}
body.no-tabs { padding-bottom: env(safe-area-inset-bottom); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-ink); }
svg { flex: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .875em; }
.center { text-align: center; }

main#view { max-width: 520px; margin: 0 auto; padding: max(14px, env(safe-area-inset-top)) 20px 24px; }
main#view.enter { animation: enter .28s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { main#view.enter { animation: none; } * { transition-duration: 0s !important; } }

/* ---------------------------------------------------------------- the tabs */
#tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: var(--bg); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
#tabs .inner { max-width: 520px; margin: 0 auto; display: flex; height: var(--tabs-h); }
#tabs a {
  flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 500; letter-spacing: .01em;
}
#tabs a svg { width: 22px; height: 22px; stroke-width: 1.6; }
#tabs a.on { color: var(--accent); font-weight: 600; }
body.no-tabs #tabs { display: none; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 22px; border: 1px solid transparent;
  font-size: 15px; font-weight: 500; cursor: pointer; text-decoration: none; transition: background .15s, opacity .15s, transform .1s;
}
.btn:active { transform: scale(.985); }
.btn.primary { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn.secondary { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn.quiet { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.danger { background: var(--late); color: #fff; }
.btn.danger-text { color: var(--late); border-color: transparent; }
.btn.big { min-height: 54px; border-radius: 27px; font-size: 17px; width: 100%; }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 14px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn-row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
.btn-row .btn { flex: 1 1 auto; }
.stack { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.icon-btn {
  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; color: var(--muted); border-radius: 22px; cursor: pointer; padding: 0;
}
.icon-btn:hover { background: var(--hover); }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent-ink); text-decoration: underline; cursor: pointer; }
.chip { border: 1px solid var(--line-2); background: transparent; color: var(--muted); border-radius: 16px; padding: 4px 10px; font-size: 13px; cursor: pointer; }
.chip.on { border-color: var(--accent-line); color: var(--accent-ink); background: var(--accent-soft); }

/* ---------------------------------------------------------------- pages */
.page { display: flex; flex-direction: column; gap: 14px; }
.page-head { display: flex; align-items: center; gap: 4px; min-height: 48px; margin-left: -10px; }
.page-head.top { margin-left: 0; }
.page-head h1 { margin: 0; font: 600 28px/1.1 var(--display); letter-spacing: .01em; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.card-title { margin: 0 0 10px; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sub-title { margin: 14px 0 6px; font-size: 14px; font-weight: 600; color: var(--muted); }
.section-title { margin: 10px 4px -4px; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.empty { margin: 30px 10px; }
.list { background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 10px 14px 10px 16px;
  border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; text-decoration: none; cursor: pointer;
}
.list > .row:first-child, .list > :first-child .row { border-top: 0; }
.row:hover { background: var(--hover); }
.row-icon { color: var(--muted); display: inline-flex; }
.row-icon svg { width: 22px; height: 22px; }
.row-text { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.row-text b { font-weight: 500; }
.row-text small { color: var(--muted); font-size: 13.5px; line-height: 1.35; }
.row > svg:last-child { color: var(--ink-3); }
.row .right { color: var(--muted); font-size: 14px; white-space: nowrap; }
.switch-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch { position: relative; width: 46px; height: 28px; border-radius: 14px; background: var(--line-2); flex: none; transition: background .2s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 11px; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch-row input:checked + .switch { background: var(--accent); }
.switch-row input:checked + .switch::after { transform: translateX(18px); }
.switch-row input:focus-visible + .switch { outline: 2px solid var(--accent); outline-offset: 2px; }
.row.sub-row { min-height: 52px; }
.range-row { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.range-row label { display: flex; justify-content: space-between; color: var(--ink); }
.range-row label span { color: var(--muted); }
input[type="range"] { width: 100%; accent-color: var(--accent); height: 28px; }
.seg { display: flex; gap: 4px; padding: 4px; background: var(--chip); border-radius: 22px; }
.seg button { flex: 1 1 0; height: 36px; border: 0; border-radius: 18px; background: transparent; color: var(--muted); font-weight: 500; cursor: pointer; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.label { display: block; margin: 16px 2px 6px; font-size: 14px; font-weight: 600; color: var(--muted); }
input:not([type]), input[type="text"], input[type="email"], input[type="number"], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); color: var(--ink);
}
textarea { resize: vertical; min-height: 64px; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.check-row { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; cursor: pointer; }
.check-row input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.kv { display: flex; justify-content: space-between; gap: 12px; margin: 6px 0; }
.kv span { color: var(--muted); }
.kv b { font-weight: 600; font-variant-numeric: tabular-nums; }
.kv b small { color: var(--muted); font-weight: 400; }



/* the owner's numbers */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.tile b { font: 600 30px/1.1 var(--display); font-variant-numeric: lining-nums; }
.tile b .plus { font-size: 18px; color: var(--muted); margin-left: 4px; }
.tile small { color: var(--muted); font-size: 13px; line-height: 1.3; }
svg.bars { width: 100%; height: auto; display: block; }
.bar { fill: var(--accent); opacity: .55; }
.bar.now { opacity: 1; }
.axis { fill: var(--muted); font-size: 10px; text-anchor: middle; font-family: var(--font); }
.baseline { stroke: var(--line-2); stroke-width: 1; }

/* reading pages inside the app: About, Help */
.prose { font-size: 17px; line-height: 1.7; }
.prose h2 { font: 600 24px/1.25 var(--display); margin: 28px 0 8px; }
.prose p { margin: 0 0 14px; }
.prose .lede { font: 500 21px/1.45 var(--display); color: var(--ink); }
.prose .rest { color: var(--muted); }
.prose.help h2 { font-size: 21px; }
.prose ul { padding-left: 20px; }
.prose li { margin: 6px 0; }
.foot-links { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin: 24px 0 8px; color: var(--muted); font-size: 14px; }

/* the version block at the foot of Settings, the same in every Dixith app: icon, name, version line, "a dixith.com project" */
.app-version { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 18px 0 8px; text-align: center; }
.app-version .app-icon { width: 56px; height: 56px; border-radius: 14px; }
.app-version .app-name { font: 600 22px/1.2 var(--display); }
.app-version button, .app-version .dx-version { color: var(--muted); font-size: 13px; background: none; border: 0; cursor: pointer; padding: 4px 8px; min-height: 32px; }
.app-version .app-by { color: var(--accent-ink); font-weight: 600; font-size: 13px; min-height: 44px; display: inline-flex; align-items: center; padding: 0 8px; text-decoration: none; }
.row.quiet-row .row-text b { color: var(--muted); font-weight: 400; }
.gta-slot { margin-top: 4px; }

/* ---------------------------------------------------------------- the sheet and the toast */
.scrim { position: fixed; inset: 0; z-index: 200; background: rgba(0, 0, 0, .32); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s ease-out; }
.scrim.leaving { animation: fadeout .25s ease-in forwards; }
@keyframes fade { from { opacity: 0; } }
@keyframes fadeout { to { opacity: 0; } }
.sheet {
  width: 100%; max-width: 520px; max-height: 88dvh; overflow: auto; background: var(--card); border-radius: 22px 22px 0 0;
  padding: 10px 20px calc(20px + env(safe-area-inset-bottom)); animation: up .26s ease-out; outline: 0;
}
.scrim.leaving .sheet { animation: down .25s ease-in forwards; }
@keyframes up { from { transform: translateY(30px); opacity: .6; } }
@keyframes down { to { transform: translateY(30px); } }
.grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 0 auto 12px; }
.sheet h2 { margin: 4px 0 8px; font: 600 24px/1.25 var(--display); }
.sheet p { margin: 6px 0; }
.choices { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.choice { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: transparent; cursor: pointer; }
.choice span { display: flex; flex-direction: column; min-width: 0; }
.choice b { font-weight: 500; }
.choice small { color: var(--muted); font-size: 13px; }
.choice.on { border-color: var(--accent-line); background: var(--accent-soft); }
.choice svg { color: var(--accent); }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabs-h) + 16px + env(safe-area-inset-bottom)); z-index: 300;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
  max-width: min(480px, calc(100vw - 32px)); width: max-content; display: flex; gap: 14px; align-items: center;
  background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 14px; font-size: 14.5px; box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
body.no-tabs .toast { bottom: calc(16px + env(safe-area-inset-bottom)); }
.toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { border: 0; background: transparent; color: var(--bg); font-weight: 600; text-decoration: underline; cursor: pointer; padding: 4px; white-space: nowrap; }

/* the family's account screens, in Angana's own look */
.dx-page { padding-top: 10px; }
.dx-mount .dxa-card { box-shadow: none; }

/* the admin screen */
.adm-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.adm-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.adm-table th, .adm-table td { text-align: left; padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: top; }
.adm-table th { color: var(--muted); font-weight: 500; font-size: 12.5px; }
.adm-table td.n { text-align: right; font-variant-numeric: tabular-nums; }
.adm-user { display: block; color: var(--ink); text-decoration: none; }
.adm-user small { color: var(--muted); display: block; }

/* ---------------------------------------------------------------- the games page */
.brand { display: flex; flex-direction: column; gap: 0; margin: 6px 0 0; }
.brand-name { margin: 0; font: 700 calc(40px * var(--ts)) / 1.15 var(--display); color: var(--accent-ink); letter-spacing: .01em; }
.brand-tag { margin: 0; color: var(--ink-2); font-weight: 500; }
.home-lede { margin: 0; }
.game-card { display: flex; gap: 16px; align-items: flex-start; padding: 14px; background: var(--card); border-radius: 18px;
  box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line); }
.game-art { flex: none; display: block; width: 104px; height: 104px; border-radius: 10px; overflow: hidden;
  box-shadow: 0 2px 6px rgba(60, 10, 10, .25); background: var(--floor); }
.game-art img { width: 100%; height: 100%; display: block; }
.game-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.game-text h2 { margin: 0; font: 700 calc(22px * var(--ts)) / 1.3 var(--display); }
.game-text h2 .chip { font: 600 12px/1.4 var(--font); vertical-align: middle; margin-left: 6px; white-space: nowrap; display: inline-block; }
.game-text p { margin: 0; }
.game-text .btn-row { margin-top: 8px; }
.game-on { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; font-size: .9em; color: var(--ink-2); }
.game-on img { width: 22px; height: 22px; }
.game-on span { margin-left: 4px; }
.game-card.soon { opacity: .82; }
.game-art.pits { display: grid; grid-template-columns: repeat(7, 1fr); grid-template-rows: 1fr 1fr; gap: 5px; padding: 12px 8px;
  background: linear-gradient(160deg, #8a5a33, #6b4224); }
.game-art.pits i { border-radius: 50%; background: radial-gradient(circle at 40% 35%, #4a2a14, #2c170a 70%); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .5), 0 1px 0 rgba(255, 220, 180, .18); }
.games-list .row.static { cursor: default; }
.games-list .row.static:hover { background: none; }
.row-icon.kinds { display: flex; flex-wrap: wrap; width: 40px; gap: 1px; align-content: center; justify-content: center; background: var(--floor); border-radius: 10px; padding: 3px; }
.row-icon.kinds img { width: 17px; height: 17px; }
.home-nudge { text-align: center; }
.choices-list .choice { width: 100%; }
.prose.rules ol { padding-left: 22px; }
.prose.rules li { margin-bottom: 8px; line-height: 1.6; }

/* ---------------------------------------------------------------- in a game: the floor fills the screen */
body.in-game { background: var(--floor); overflow: hidden; }
body.in-game main#view { max-width: none; padding: 0; animation: none; }
:root.boot-game body { background: var(--floor); }
:root[data-script="kannada"] .prose p, :root[data-script="deva"] .prose p { line-height: 1.75; }
