:root { --paper: #f7f7f7; --ink: #535353; --text: #202124; --muted: #5f6368; --line: #dadce0; --card: #ffffff; --accent: #1a73e8; --btn: #f1f3f4; --btn-on: #d2e3fc; --shadow: 0 1px 3px rgba(60,64,67,.3), 0 4px 8px 3px rgba(60,64,67,.15); --font: Roboto, "Segoe UI", Helvetica, Arial, sans-serif; }
html.night { --paper: #080808; --ink: #acacac; --text: #e8eaed; --muted: #9aa0a6; --line: #3c4043; --card: #202124; --accent: #8ab4f8; --btn: #303134; --btn-on: #394457; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--paper); }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--text); background: var(--paper); min-height: 100vh; transition: background .3s, color .3s; }
.page { max-width: 660px; margin: 0 auto; padding: 24px 14px 48px; }
.page-head { text-align: center; margin-bottom: 14px; }
.page-head .eyebrow { margin: 0; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.page-head h1 { margin: 2px 0 6px; font-size: 36px; font-weight: 500; letter-spacing: .01em; }
.page-head .lede { margin: 0 auto; max-width: 540px; color: var(--muted); }
/* the offline-page look: a plain card, the game where the icon would be, a caption under it */
.card { background: var(--paper); padding: 8px 0 4px; }
.stage { width: 100%; max-width: 600px; margin: 0 auto; overflow: visible; min-height: 150px; position: relative; }
.runner { position: relative; height: 150px; transform-origin: top center; margin: 0 auto; }
#game { display: block; image-rendering: pixelated; image-rendering: crisp-edges; touch-action: none; outline: none; cursor: default; background: var(--paper); }
#game:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.caption { margin: 18px 0 4px; font-size: 22px; font-weight: 500; }
.sub { margin: 0 0 6px; color: var(--muted); }
.code { margin: 0 0 14px; font: 12px/1.4 ui-monospace, Menlo, Consolas, monospace; color: var(--muted); letter-spacing: .04em; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 8px; }
.toolbar button, .dlg-buttons button, .duck, .arcade-exit { font: 14px var(--font); padding: 7px 14px; border-radius: 6px; border: 1px solid var(--line); background: var(--btn); color: var(--text); cursor: pointer; }
.toolbar button:hover, .dlg-buttons button:hover { border-color: var(--accent); }
.toolbar button.on { background: var(--btn-on); border-color: var(--accent); }
.toolbar button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.status { display: flex; flex-wrap: wrap; gap: 6px 18px; font: 13px ui-monospace, Menlo, Consolas, monospace; color: var(--muted); margin: 6px 0 4px; min-height: 20px; }
.status .grow { flex: 1 1 100%; font-family: var(--font); color: var(--text); }
.duck { width: 100%; padding: 16px; font-size: 16px; margin-top: 8px; user-select: none; -webkit-user-select: none; touch-action: none; }
.duck:active, .duck.held { background: var(--btn-on); }
.noscript { text-align: center; }
/* arcade mode: everything but the game hides, the runner scales to the window (integer scale) */
body.arcade { overflow: hidden; }
body.arcade .page-head, body.arcade .caption, body.arcade .sub, body.arcade .code, body.arcade .toolbar, body.arcade .status, body.arcade .panel, body.arcade .foot, body.arcade .duck { display: none !important; }
body.arcade .page { max-width: none; padding: 0; }
body.arcade .stage { max-width: none; width: 100vw; height: 100vh; margin: 0; }
.arcade-exit { position: fixed; right: 12px; bottom: 12px; z-index: 30; opacity: .85; }
/* content panels */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px 18px; margin: 18px auto 0; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.panel h2 { font-size: 18px; font-weight: 500; margin: 6px 0 8px; }
.panel h3 { font-size: 15px; font-weight: 500; margin: 14px 0 2px; }
.panel p { margin: 4px 0 8px; }
.steps { padding-left: 22px; margin: 0 0 10px; }
.steps li { margin: 0 0 8px; }
.cols { columns: 2 260px; column-gap: 22px; padding-left: 20px; margin: 0 0 10px; }
.cols li { margin-bottom: 5px; break-inside: avoid; }
.keys { border-collapse: collapse; width: 100%; font-size: 14px; }
.keys th { text-align: left; white-space: nowrap; padding: 3px 10px 3px 0; font-weight: 500; }
.keys td { padding: 3px 18px 3px 0; }
.note { font-size: 13px; color: var(--muted); }
.foot { color: var(--muted); text-align: center; font-size: 13px; margin-top: 22px; }
.foot a, .panel a, .about-body a { color: var(--accent); }
/* dialogs */
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.32); display: flex; align-items: center; justify-content: center; padding: 12px; }
.dialog { background: var(--card); color: var(--text); border-radius: 8px; box-shadow: var(--shadow); padding: 0; min-width: 280px; max-width: min(92vw, 440px); font-size: 14px; }
.dialog.wide { max-width: min(92vw, 560px); }
.dlg-title { font-size: 18px; font-weight: 500; padding: 18px 22px 4px; }
.dlg-body { padding: 8px 22px 6px; }
.dlg-body label { display: block; margin-bottom: 6px; }
.dlg-note { color: var(--muted); margin: 6px 0 0; }
.dlg-body.msg { display: flex; gap: 14px; align-items: flex-start; }
.dlg-body.msg p { margin: 0; white-space: pre-line; }
.msg-icon { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; font: 700 20px/32px Georgia, serif; text-align: center; }
.dlg-buttons { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 18px 16px; }
.dlg-buttons button.default { background: var(--accent); color: #fff; border-color: var(--accent); }
.dlg-buttons button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.stats { border-collapse: collapse; }
.stats th { text-align: left; padding: 3px 14px 3px 0; font-weight: 500; }
.stats td { padding: 3px 12px 3px 0; text-align: right; }
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.help-tab { font: 14px var(--font); padding: 6px 12px; background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer; color: var(--muted); }
.help-tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.help-panel { min-height: 140px; }
.help-panel p { margin: 4px 0 8px; }
#toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 20px); background: #323232; color: #fff; padding: 9px 14px; font-size: 14px; border-radius: 4px; opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; z-index: 200; max-width: 90vw; box-shadow: var(--shadow); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 520px) { .page { padding: 14px 8px 30px; } .page-head h1 { font-size: 30px; } .panel { padding: 12px 12px; } .caption { font-size: 19px; } }
@media (prefers-reduced-motion: reduce) { #toast, body { transition: none; } }
