:root { --ink:#1d1d2b; --yellow:#ffcf1f; font-family:"Trebuchet MS","Arial Rounded MT Bold",system-ui,sans-serif; }
* { box-sizing:border-box; }
html, body { margin:0; height:100%; overflow:hidden; background:#87ceeb; }
#view { position:fixed; inset:0; width:100%; height:100%; display:block; cursor:crosshair; image-rendering:pixelated; }

#crosshair { position:fixed; left:50%; top:50%; width:22px; height:22px; margin:-11px 0 0 -11px; pointer-events:none; mix-blend-mode:difference; }
#crosshair::before, #crosshair::after { content:""; position:absolute; background:#fff; }
#crosshair::before { left:10px; top:0; width:2px; height:22px; }
#crosshair::after { top:10px; left:0; height:2px; width:22px; }

#progress { position:fixed; left:50%; top:calc(50% + 28px); width:120px; height:12px; margin-left:-60px; border:2px solid var(--ink); border-radius:8px; background:rgba(255,255,255,.6); overflow:hidden; }
#progress div { height:100%; width:0; background:var(--yellow); }
#progress[hidden] { display:none; }

#hotbar { position:fixed; bottom:14px; left:50%; transform:translateX(-50%); display:flex; gap:4px; padding:6px; border:4px solid var(--ink); border-radius:12px; background:rgba(29,29,43,.72); }
.slot { position:relative; width:54px; height:54px; border:3px solid #555; border-radius:6px; background:rgba(255,255,255,.12); }
.slot.selected { border-color:var(--yellow); background:rgba(255,207,31,.25); transform:translateY(-4px); }
.slot .icon { position:absolute; inset:5px; image-rendering:pixelated; background-repeat:no-repeat; }
.slot .num { position:absolute; left:3px; top:0; font-size:12px; font-weight:bold; color:#fff; text-shadow:0 1px 0 #000; }
.slot .count { position:absolute; right:3px; bottom:0; font-size:16px; font-weight:bold; color:#fff; text-shadow:0 2px 0 #000; }

#toasts { position:fixed; top:16px; left:50%; transform:translateX(-50%); display:flex; flex-direction:column; align-items:center; gap:8px; pointer-events:none; }
.toast { padding:10px 18px; border:4px solid var(--ink); border-radius:14px; background:var(--yellow); color:var(--ink); font-size:22px; font-weight:bold; animation:pop .3s ease-out; }
#hint { position:fixed; top:10px; left:12px; margin:0; padding:4px 10px; border-radius:8px; background:rgba(29,29,43,.6); color:#fff; font-size:14px; }
#hint[hidden] { display:none; }

#menu { position:fixed; inset:0; display:flex; align-items:center; justify-content:center; background:rgba(20,35,74,.62); }
#menu[hidden] { display:none; }
.card { max-width:520px; margin:16px; padding:26px; border:6px solid var(--ink); border-radius:24px; background:#fffdf5; color:var(--ink); text-align:center; box-shadow:0 10px 0 var(--ink); }
.card h1 { margin:0 0 4px; font-size:42px; }
.lead { margin:0 0 14px; font-size:20px; }
.play { font:inherit; font-size:30px; font-weight:bold; padding:14px 30px; border:5px solid var(--ink); border-radius:18px; background:#2fb344; color:#fff; cursor:pointer; box-shadow:0 6px 0 var(--ink); }
.play:active { transform:translateY(4px); box-shadow:0 2px 0 var(--ink); }
.play[hidden] { display:none; }
#problem { color:#c0392b; font-weight:bold; }
.keys { text-align:left; margin:18px auto 8px; padding-left:22px; font-size:18px; line-height:1.6; }
.tip { margin:10px 0; padding:10px; border-radius:12px; background:#fff1b8; font-size:18px; }
.small { margin:6px 0; font-size:15px; color:#555; }
.links { margin:10px 0 0; font-size:18px; }
.links a, .link { color:var(--ink); font:inherit; font-weight:bold; background:none; border:0; padding:0; cursor:pointer; text-decoration:underline; }
:focus-visible { outline:5px solid var(--yellow); outline-offset:3px; }
@keyframes pop { 0% { transform:scale(.5); opacity:0; } 100% { transform:scale(1); opacity:1; } }
@media (prefers-reduced-motion:reduce) { * { animation:none !important; } }
