:root { color-scheme:dark; font:16px/1.4 "Trebuchet MS",system-ui,sans-serif; color:#eee7d1; background:#17201f; }
* { box-sizing:border-box; } body { margin:0; min-height:100svh; background:radial-gradient(ellipse at 25% 0%,#37443d,transparent 65%); }
main { width:min(1120px,96%); margin:auto; padding:clamp(.65rem,2vh,1.5rem) 0 2rem; }
header,.actions,.settings,nav { display:flex; align-items:center; gap:1rem; flex-wrap:wrap; }
header { justify-content:space-between; margin-bottom:.65rem; }
h1 { margin:0; font:900 clamp(1.7rem,4.8vw,3.3rem)/1 Georgia,serif; letter-spacing:-.055em; }
header span,#mode { text-transform:uppercase; letter-spacing:.13em; font-size:.76rem; font-weight:800; }
header span { color:#d4b982; }
.playfield { position:relative; background:#192b30; border-radius:1rem; overflow:hidden; box-shadow:0 .65rem 2rem #0d171940; }
canvas { display:block; width:100%; height:clamp(220px,66svh,670px); touch-action:none; }
#mode { position:absolute; left:.8rem; top:.8rem; padding:.4rem .75rem; border-radius:2rem; background:#172524e8; color:#e9f1cc; pointer-events:none; }
.actions { justify-content:space-between; padding:.85rem .3rem .35rem; }
.actions strong { font-size:clamp(1rem,2.5vw,1.35rem); }
.actions p { color:#bec8bb; font-size:.9rem; margin:.15rem 0; }
button,select,summary { min-height:44px; font:inherit; }
button,select { background:#33403c; color:inherit; border:1px solid #67756a; border-radius:.65rem; padding:.52rem .82rem; }
button,summary { cursor:pointer; } #use { font-weight:800; background:#e5bf76; color:#302c21; min-width:12rem; }
#use:disabled { opacity:.65; cursor:default; background:#677568; color:#fff; }
kbd { font:inherit; padding:.13rem .43rem; border:1px solid currentColor; border-radius:.3rem; margin-right:.6rem; }
nav { gap:.4rem; padding:.2rem 0; } nav button { min-width:50px; touch-action:none; user-select:none; }
details { color:#c6cec0; margin-top:.45rem; } summary { width:fit-content; padding:.65rem 0; }
label { display:flex; align-items:center; gap:.4rem; min-height:44px; } a { color:#d4dfb3; }
[hidden] { display:none !important; } :focus-visible { outline:3px solid #ffd17c; outline-offset:2px; }
@media (max-width:650px) { canvas { height:48svh; } .actions { gap:.45rem; } #use { min-width:0; } header span { font-size:.63rem; } }

.settings label { flex-wrap:wrap; max-width:100%; }
.settings select { max-width:100%; }

@media (pointer:coarse) { #use kbd { display:none; } }

.playfield::after {
  content:""; position:absolute; inset:0; pointer-events:none;
  background:radial-gradient(ellipse at 50% 42%,transparent 36%,#1009125c 100%),
    var(--lab-grain,none) repeat;
}
.touch-hint { display:none; }
@media (pointer:coarse) { .keys-hint { display:none; } .touch-hint { display:block; } }
