/* Shared shell for the arcade: hub page and all seven games. */
:root{
  --ground:#12141F; --surface:#1B1E2C; --surface-2:#222637;
  --ink:#ECEEF5; --ink-soft:#C3C7D6; --muted:#9097AE; --line:#30354A;
  --accent:#ECEEF5; --on-accent:#12141F;
  --good:#4CC98A; --bad:#FF8A7D; --warn:#F5A15B;
  --glow:#2352C9;
  --display:"Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --body:ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono:ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}
*{box-sizing:border-box}
html,body{margin:0}
body{
  background:var(--ground);color:var(--ink);
  font:16px/1.55 var(--body);-webkit-font-smoothing:antialiased;
  min-height:100vh;
}
button,input{font:inherit;color:inherit}
button{cursor:pointer}
a{color:inherit}
:focus-visible{outline:3px solid var(--glow);outline-offset:2px}
h1,h2,h3{font-family:var(--display);line-height:1.05;margin:0;letter-spacing:-.02em}
[hidden]{display:none!important}

.wrap{max-width:1000px;margin:0 auto;padding:40px 20px 64px}

/* ---------- Hub ---------- */
.hero h1{font-size:clamp(2.6rem,7vw,4.6rem);font-weight:800;max-width:14ch}
.hero p{color:var(--ink-soft);font-size:1.1rem;margin:14px 0 34px;max-width:54ch}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:14px}
.tile{
  display:flex;flex-direction:column;justify-content:space-between;gap:14px;
  min-height:168px;padding:20px;border:0;border-radius:18px;
  background:var(--c);color:#fff;text-align:left;text-decoration:none;
  transition:transform .15s ease, box-shadow .15s ease;
  position:relative;overflow:hidden;
}
.tile:hover{transform:translateY(-4px);box-shadow:0 12px 30px rgba(0,0,0,.35)}
.tile:active{transform:translateY(-1px)}
.tile .art{font-size:2rem;line-height:1}
.tile strong{font-family:var(--display);font-size:1.5rem;font-weight:700;line-height:1.05}
.tile span{font-size:.88rem;opacity:.9;line-height:1.35}
.tile .tag{
  position:absolute;top:14px;right:14px;font-size:.7rem;font-weight:700;
  letter-spacing:.06em;text-transform:uppercase;
  background:rgba(0,0,0,.28);padding:4px 9px;border-radius:999px;
}
.foot{margin-top:34px;color:var(--muted);font-size:.9rem}

/* ---------- Game shell ---------- */
.bar{
  display:flex;align-items:center;justify-content:space-between;gap:14px;
  flex-wrap:wrap;margin-bottom:16px;
}
.back{
  display:inline-flex;align-items:center;gap:7px;text-decoration:none;
  color:var(--ink-soft);font-weight:600;font-size:.95rem;
  padding:8px 14px;border:1.5px solid var(--line);border-radius:999px;
  background:var(--surface);
}
.back:hover{border-color:var(--ink-soft);color:var(--ink)}
.title{font-family:var(--display);font-weight:800;font-size:1.3rem}
.tag-inline{font-family:var(--body);font-weight:600;font-size:.82rem;color:var(--muted)}
.stats{display:flex;gap:18px;font-family:var(--display);font-weight:700;font-variant-numeric:tabular-nums}
.stat small{display:block;font-family:var(--body);font-weight:600;font-size:.7rem;
  letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.stat b{font-size:1.4rem;font-weight:800}

.stage{position:relative;border-radius:18px;overflow:hidden;background:var(--surface);
  border:1px solid var(--line);touch-action:none}
canvas{display:block;width:100%;height:auto}

.overlay{
  position:absolute;inset:0;display:grid;place-items:center;text-align:center;
  background:rgba(10,12,20,.82);backdrop-filter:blur(3px);padding:24px;
}
.overlay .panel{max-width:460px}
.overlay h2{font-size:clamp(1.6rem,4vw,2.4rem);font-weight:800;margin-bottom:10px}
.overlay p{color:var(--ink-soft);margin:0 0 20px}
.btn{
  padding:12px 24px;border-radius:999px;border:1.5px solid var(--line);
  background:var(--surface);font-weight:700;
}
.btn:hover{border-color:var(--ink-soft)}
.btn.go{background:var(--glow);border-color:var(--glow);color:#fff}
.btn.go:hover{filter:brightness(1.12)}
.btn+.btn{margin-left:8px}
.keys{margin-top:18px;color:var(--muted);font-size:.85rem;line-height:1.7}
kbd{
  display:inline-block;padding:2px 7px;border-radius:6px;background:var(--surface-2);
  border:1px solid var(--line);border-bottom-width:2px;font:600 .8rem var(--mono);color:var(--ink);
}
.hint{color:var(--muted);font-size:.88rem;margin-top:14px;text-align:center}

/* touch controls, shown only on coarse pointers */
.touch{display:none;gap:10px;margin-top:14px;justify-content:center;flex-wrap:wrap}
.touch button{
  width:62px;height:62px;border-radius:16px;border:1.5px solid var(--line);
  background:var(--surface);font-size:1.3rem;font-weight:800;
}
.touch button.wide{width:auto;padding:0 26px;font-size:1rem}
@media (pointer:coarse){ .touch{display:flex} }

@media (max-width:620px){
  .wrap{padding:22px 14px 44px}
  .stat b{font-size:1.15rem}
  .title{font-size:1.1rem}
}
@media (prefers-reduced-motion:reduce){ *{transition:none!important} }
