/* Class duel — student phone (class-v11). Own small stylesheet (the page
   is not part of the wasm app). Both themes (data-theme from the app's
   saved choice, else the OS), WCAG AA contrast, big touch targets, no
   horizontal overflow at 320 px, no motion with prefers-reduced-motion. */
/* Same cross-document view-transition opt-in as the app (styles.css):
   without it Chromium aborts the app → /duel/ transition ("ViewTransition
   opt-in disabled") and reports it as a page error. */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
:root[data-theme="light"] {
  --bg: #f6f7fb; --card: #ffffff; --soft: #eef0f6; --text: #0f172a; --muted: #475069;
  --line: #cdd2dc; --accent: #3347c4; --accent-ink: #ffffff; --ok: #147a46; --bad: #c42b2b; --warn: #975a00;
  color-scheme: only light; /* "only": no forced darkening on Android (shell-v13) */
}
:root, :root[data-theme="dark"] {
  --bg: #0a0c12; --card: #12161f; --soft: #1a2030; --text: #e9ecf3; --muted: #a6aec0;
  --line: #333b4d; --accent: #9db1ff; --accent-ink: #0a0c12; --ok: #4ade80; --bad: #f87171; --warn: #fbbf24;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; overflow-x: hidden; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.dl-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.dl-brand { font-weight: 700; text-decoration: none; color: var(--text); }
.dl-tag { color: var(--muted); font-size: 14px; }
.dl-main { max-width: 34rem; margin: 0 auto; padding: 16px; display: grid; gap: 12px; }
.dl-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: grid; gap: 14px; min-width: 0; }
.dl-h1 { margin: 0; font-size: 1.5rem; }
.dl-h2 { margin: 0; font-size: 1.2rem; overflow-wrap: anywhere; }
.dl-muted { color: var(--muted); margin: 0; }
.dl-banner { margin: 0; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--warn); background: var(--card); color: var(--text); }
.dl-form { display: grid; gap: 12px; }
.dl-form label { display: grid; gap: 6px; font-weight: 600; }
.dl-form input { font: inherit; font-size: 1.15rem; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--soft); color: var(--text); min-width: 0; width: 100%; }
#code { font-family: ui-monospace, Menlo, monospace; letter-spacing: .2em; text-transform: uppercase; }
.dl-btn { font: inherit; font-weight: 700; font-size: 1.05rem; min-height: 48px; padding: 10px 18px; border-radius: 12px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); cursor: pointer; }
.dl-btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.dl-btn:disabled { opacity: .55; cursor: default; }
.dl-err { color: var(--bad); margin: 0; min-height: 1.5em; }
.dl-status { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; color: var(--muted); font-size: .95rem; font-variant-numeric: tabular-nums; }
.dl-clock { font: 800 2.4rem/1 ui-monospace, Menlo, monospace; font-variant-numeric: tabular-nums; }
.dl-clock-low { color: var(--warn); }
.dl-bar { height: 8px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.dl-bar > i { display: block; height: 100%; width: calc(var(--p, 0) * 1%); background: var(--accent); }
.dl-stem { margin: 0; font-size: 1.1rem; overflow-wrap: anywhere; }
.dl-opts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.dl-opt { width: 100%; display: grid; grid-template-columns: 2.2rem 1fr; gap: 10px; align-items: center; text-align: left; font: inherit; color: var(--text); background: var(--soft); border: 2px solid var(--line); border-radius: 14px; padding: 12px; min-height: 56px; cursor: pointer; overflow-wrap: anywhere; }
.dl-opt b { display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 10px; background: var(--card); border: 1px solid var(--line); }
.dl-opt[aria-pressed="true"] { border-color: var(--accent); }
.dl-opt[aria-pressed="true"] b { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.dl-opt-ok { border-color: var(--ok) !important; }
.dl-opt-ok b { background: var(--ok) !important; color: var(--bg) !important; border-color: var(--ok) !important; }
.dl-opt-bad { border-color: var(--bad) !important; }
.dl-opt:disabled { cursor: default; }
.dl-result { font-size: 1.3rem; font-weight: 800; margin: 0; }
.dl-ok { color: var(--ok); }
.dl-bad { color: var(--bad); }
.dl-top5 { margin: 0; padding-left: 1.4rem; display: grid; gap: 4px; }
.dl-top5 li { overflow-wrap: anywhere; }
.dl-me { font-weight: 800; }
.dl-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
/* shell-v13: theme toggle in the top bar (static/pwa/shell.js flips it). */
.dl-top-r { display: flex; align-items: center; gap: 10px; }
.dl-theme { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; font-size: 20px; line-height: 1; cursor: pointer; }
.dl-theme span { grid-area: 1 / 1; }
:root[data-theme="light"] .dl-sun, :root:not([data-theme="light"]) .dl-moon { visibility: hidden; }
