:root { --navy: #0b1e3a; --blue: #1f5fbf; --red: #e31b23; --green: #1a9b4b; --amber: #e8a400; --grey: #7b8798;
  --bg: #f2f5fa; --card: #fff; --ink: #0b1e3a; --mut: #55657e; --line: #dde3ec; --key: #e2e8f1; color-scheme: light; }
@media (prefers-color-scheme: dark) { :root { --bg: #0a1424; --card: #13213a; --ink: #e8eef8; --mut: #a2b0c6; --line: #24365a; --key: #2a3b5c; color-scheme: dark; } }
* { box-sizing: border-box; min-width: 0; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; padding-bottom: calc(72px + env(safe-area-inset-bottom)); -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
.top { background: var(--navy); color: #fff; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand b { font-size: 17px; }
.logo { background: #fff; color: var(--navy); font-weight: 800; font-size: 11px; padding: 4px 7px; border-radius: 6px; letter-spacing: .02em; }
.who { font: inherit; font-size: 14px; background: none; border: 0; color: inherit; cursor: pointer; padding: 0; text-align: right; opacity: .95; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
main { max-width: 560px; margin: 0 auto; padding: 14px 16px; }
.view { display: flex; flex-direction: column; gap: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.card h1 { font-size: 22px; line-height: 1.2; margin: 0 0 8px; }
.card h2, .view h2 { font-size: 20px; margin: 0; }
.card p { margin: 0 0 10px; }
.hero-card { text-align: center; }
.big-emoji { font-size: 44px; }
.center { text-align: center; padding: 60px 0; color: var(--mut); }
.spin { width: 34px; height: 34px; border: 4px solid var(--line); border-top-color: var(--blue); border-radius: 50%; margin: 0 auto 14px; animation: sp 0.9s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
.btn { font: inherit; font-weight: 700; border: 0; border-radius: 12px; background: var(--red); color: #fff; padding: 12px 18px; min-height: 46px; cursor: pointer; }
.btn.blue { background: var(--blue); } .btn.ghost { background: transparent; color: var(--blue); border: 1px solid var(--line); }
.btn:active { transform: scale(.98); }
input, select { font: inherit; font-size: 16px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); width: 100%; }
.row-form { display: flex; gap: 8px; margin-top: 10px; } .col-form { display: flex; flex-direction: column; gap: 10px; }
.row-form input { text-transform: uppercase; letter-spacing: .1em; }
details summary { cursor: pointer; font-weight: 600; }
.muted { color: var(--mut); } .small { font-size: 13px; }
.pill { background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue); border-radius: 99px; padding: 3px 10px; font-size: 13px; font-weight: 700; white-space: nowrap; }
@media (prefers-color-scheme: dark) { .pill { color: #9cc0ff; } }
.hello { font-size: 15px; color: var(--mut); }
.hello b { color: var(--ink); font-size: 18px; }
.gcard { display: grid; grid-template-columns: 46px 1fr auto; gap: 12px; align-items: center; cursor: pointer; text-align: left; font: inherit; color: inherit; width: 100%; }
.gcard .ic { font-size: 30px; text-align: center; }
.gcard b { display: block; font-size: 17px; }
.gcard .sub { color: var(--mut); font-size: 14px; }
.gcard .go { color: var(--blue); font-weight: 800; font-size: 22px; }
.live-card { border-color: var(--red); box-shadow: 0 0 0 2px color-mix(in srgb, var(--red) 25%, transparent); }
.badge { font-size: 15px; }
/* Fjala */
.word-head { display: flex; justify-content: space-between; align-items: center; }
.grid { display: grid; grid-template-rows: repeat(6, 1fr); gap: 6px; width: min(100%, 330px); margin: 4px auto 0; }
.grow { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.t { aspect-ratio: 1; border: 2px solid var(--line); border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: clamp(20px, 7vw, 28px); text-transform: uppercase; background: var(--card); }
.t.f { border-color: var(--mut); }
.t.g { background: var(--green); border-color: var(--green); color: #fff; } .t.y { background: var(--amber); border-color: var(--amber); color: #fff; } .t.x { background: var(--grey); border-color: var(--grey); color: #fff; }
.t.mini { display: inline-grid; width: 24px; font-size: 13px; border-radius: 5px; vertical-align: middle; }
.flip { animation: fl .35s ease both; } @keyframes fl { 0% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }
.shake { animation: sh .4s; } @keyframes sh { 25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-4px); } }
.wmsg { min-height: 24px; text-align: center; font-weight: 600; }
.kb { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; user-select: none; }
.kr { display: flex; gap: 4px; justify-content: center; }
.k { flex: 1; max-width: 44px; height: 52px; border: 0; border-radius: 7px; background: var(--key); color: var(--ink); font: 700 16px system-ui, sans-serif; text-transform: uppercase; cursor: pointer; padding: 0; }
.k.wide { max-width: 66px; flex: 1.5; font-size: 13px; }
.k.g { background: var(--green); color: #fff; } .k.y { background: var(--amber); color: #fff; } .k.x { background: var(--grey); color: #fff; opacity: .75; }
.done-card { text-align: center; }
.done-card .ans { font-size: 26px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.wa { background: #1fa855; }
/* Kuizi */
.qstate { text-align: center; }
.qstate h1 { font-size: 24px; margin: 4px 0; }
.countdown { font-size: 44px; font-weight: 800; color: var(--red); font-variant-numeric: tabular-nums; }
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ab { border: 0; border-radius: 16px; color: #fff; font: 800 18px system-ui, sans-serif; min-height: 120px; padding: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; }
.ab span { font-size: 30px; line-height: 1; } .ab em { font-style: normal; font-size: 15px; font-weight: 700; }
.ab:disabled { opacity: .35; } .ab.picked { opacity: 1; outline: 4px solid var(--ink); outline-offset: 2px; }
.a0 { background: var(--red); } .a1 { background: var(--blue); } .a2 { background: var(--amber); } .a3 { background: var(--green); }
.tbar { height: 8px; background: var(--line); border-radius: 9px; overflow: hidden; } .tbar i { display: block; height: 100%; background: var(--amber); border-radius: 9px; }
.res { font-size: 22px; font-weight: 800; } .res.ok { color: var(--green); } .res.no { color: var(--red); }
/* Renditja */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--key); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { font: inherit; font-size: 14px; font-weight: 700; border: 0; border-radius: 9px; padding: 9px 4px; background: transparent; color: var(--ink); cursor: pointer; }
.seg button.on { background: var(--card); box-shadow: 0 1px 2px #0002; }
.vrow { margin-bottom: 10px; }
.vrow .l { display: flex; justify-content: space-between; gap: 8px; font-size: 15px; margin-bottom: 3px; }
.vrow .l span { white-space: nowrap; color: var(--mut); font-variant-numeric: tabular-nums; }
.vbar { height: 22px; background: color-mix(in srgb, var(--blue) 12%, transparent); border-radius: 6px; overflow: hidden; }
.vbar i { display: block; height: 100%; background: var(--blue); border-radius: 6px; } .vrow.me .vbar i { background: var(--red); }
.vrow.wait { opacity: .55; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: grid; grid-template-columns: 30px 1fr auto; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); align-items: center; }
.list li:last-child { border-bottom: 0; }
.list .n { font-weight: 800; color: var(--mut); } .list .p { font-weight: 800; font-variant-numeric: tabular-nums; }
.list small { display: block; color: var(--mut); }
.list li.me { background: color-mix(in srgb, var(--red) 8%, transparent); border-radius: 8px; }
.prose h3 { margin: 16px 0 4px; font-size: 16px; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 4px max(4px, env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left)); z-index: 5; }
.tabs button { font: inherit; font-size: 11px; font-weight: 600; border: 0; background: none; color: var(--mut); display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 0; position: relative; cursor: pointer; }
.tabs button:focus { outline: none; } .tabs button:focus-visible { outline: 2px solid var(--blue); border-radius: 8px; }
.tabs button span { font-size: 21px; } .tabs button.on { color: var(--blue); }
.tabs i { position: absolute; top: 4px; right: calc(50% - 18px); width: 10px; height: 10px; border-radius: 50%; background: var(--red); animation: pl 1.2s infinite; }
@keyframes pl { 50% { opacity: .3; } }
.toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 600; z-index: 9; max-width: 90vw; text-align: center; }
@media (prefers-reduced-motion: reduce) { .flip, .shake, .spin, .tabs i { animation: none; } }
.ac { position: relative; }
.ac-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px #0003; z-index: 6; overflow: hidden; }
.ac-list button { display: block; width: 100%; text-align: left; font: inherit; font-size: 17px; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); cursor: pointer; }
.ac-list button:last-child { border-bottom: 0; } .ac-list button:active { background: var(--key); }
.ac-none { padding: 12px 14px; color: var(--mut); font-size: 14px; }
