/* OneAppleFall Arcade: in-game look shared by every game */
:root { --bg: #0d1226; --panel: #171d3a; --line: #2a3160; --ink: #f4f5ff; --mu: #a4a9d6; --a: #7c3aed; --b: #ec4899; --c: #06b6d4; --ok: #34d399; --no: #f87171; --gold: #fbbf24; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 16px/1.4 system-ui, 'Segoe UI', sans-serif; overflow: hidden; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
[hidden] { display: none !important; }
body { display: flex; flex-direction: column; }
#hud { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 7px 10px; background: var(--panel); border-bottom: 1px solid var(--line); font-weight: 700; font-size: 14px; min-height: 42px; }
#title { color: var(--mu); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 34vw; }
#score { font-size: 18px; color: #fff; font-variant-numeric: tabular-nums; } #score:empty, #extra:empty, #best:empty { display: none; }
#extra { color: var(--gold); font-variant-numeric: tabular-nums; } #best { color: var(--mu); font-weight: 600; font-size: 12.5px; }
.sp { flex: 1; }
#hud button { width: 34px; height: 30px; border-radius: 9px; border: 1px solid var(--line); background: #1f2650; color: #fff; font-size: 15px; cursor: pointer; padding: 0; }
#stage { flex: 1 1 auto; min-height: 0; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px; overflow: auto; }
.cv { max-width: 100%; max-height: 100%; height: auto; width: auto; border-radius: 12px; background: #0d1226; touch-action: none; display: block; box-shadow: 0 0 0 1px var(--line); }
#overlay { position: fixed; inset: 42px 0 0 0; display: grid; place-items: center; background: rgba(8, 10, 26, .82); backdrop-filter: blur(3px); padding: 16px; z-index: 5; }
.card { width: min(430px, 100%); text-align: center; background: linear-gradient(160deg, #1b2148, #141936); border: 1px solid var(--line); border-radius: 22px; padding: 26px 22px; box-shadow: 0 30px 60px -30px #000; }
.card h2 { margin: 0 0 8px; font-size: 26px; } .card .cat { margin: 0 0 6px; font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--c); }
.card .how { color: var(--mu); margin: 0 0 18px; font-size: 15.5px; line-height: 1.5; } .card .big { font-size: 46px; font-weight: 800; margin: 4px 0; } .card .big small { font-size: 18px; color: var(--mu); }
.card .new { color: var(--gold); font-weight: 800; margin: 0 0 14px; } .card .sub { color: var(--mu); margin: 0 0 14px; }
.btn { display: block; width: 100%; border: 0; border-radius: 999px; padding: 13px 18px; font: inherit; font-weight: 800; font-size: 16px; color: #fff; cursor: pointer; background: linear-gradient(135deg, #4f46e5, #7c3aed 60%, #a855f7); margin-top: 8px; }
.btn.ghost { background: transparent; border: 1.5px solid var(--line); color: var(--mu); } .btn:focus-visible { outline: 3px solid var(--c); }
.err { color: var(--no); padding: 20px; text-align: center; }
/* shared pieces for non-canvas games */
.wrap { width: min(560px, 100%); display: flex; flex-direction: column; gap: 12px; align-items: center; text-align: center; }
.q { font-size: clamp(20px, 5vw, 30px); font-weight: 800; margin: 0; } .hint { color: var(--mu); font-size: 14.5px; margin: 0; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; } .opts.one { grid-template-columns: 1fr; }
.opt { border: 1.5px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 16px; padding: 16px 12px; font: inherit; font-weight: 700; font-size: 17px; cursor: pointer; transition: transform .08s, background .15s; }
.opt:active { transform: scale(.97); } .opt.ok { background: #065f46; border-color: var(--ok); } .opt.no { background: #7f1d1d; border-color: var(--no); } .opt:disabled { cursor: default; }
.grid { display: grid; gap: 6px; touch-action: manipulation; } .cell { border-radius: 10px; background: var(--panel); border: 1px solid var(--line); display: grid; place-items: center; font-weight: 800; cursor: pointer; aspect-ratio: 1; font-size: clamp(14px, 4vw, 24px); color: var(--ink); padding: 0; font-family: inherit; }
.row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; align-items: center; }
.pill { border: 1.5px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 999px; padding: 9px 16px; font: inherit; font-weight: 700; cursor: pointer; } .pill.on { background: var(--a); border-color: var(--a); }
input.in, select.in, textarea.in { font: inherit; font-size: 20px; font-weight: 700; text-align: center; padding: 12px; border-radius: 14px; border: 1.5px solid var(--line); background: #0f1430; color: #fff; width: 100%; user-select: text; -webkit-user-select: text; }
input[type=range] { width: 100%; accent-color: var(--a); }
.bigno { font-size: clamp(34px, 9vw, 60px); font-weight: 800; font-variant-numeric: tabular-nums; margin: 0; }
.ok-t { color: var(--ok); } .no-t { color: var(--no); } .gold-t { color: var(--gold); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px; width: 100%; }
.tools { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; align-items: center; padding: 6px 0; font-size: 13.5px; color: var(--mu); }
.tools label { display: flex; gap: 6px; align-items: center; } .tools input[type=range] { width: 110px; } .tools input[type=color] { width: 34px; height: 30px; border: 0; background: none; padding: 0; }
@media (max-height: 520px) { .card { padding: 14px; } .card h2 { font-size: 20px; } }
