/* Snaked: menus, HUD and overlays (the pipe itself is drawn in WebGL by snaked.js). */
:root { --ink:#eaf3f2; --dim:#8aa3a6; --panel:rgba(8,16,18,.82); --line:rgba(160,210,210,.18); --accent:#ffd23f; --bad:#ff5a4d; --good:#5fe0a0; }
* { box-sizing:border-box; }
html,body { margin:0; height:100%; background:#04070a; color:var(--ink); overflow:hidden;
  font-family: ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, sans-serif; -webkit-user-select:none; user-select:none; }
#stage { position:fixed; inset:0; }
canvas { position:absolute; inset:0; width:100%; height:100%; display:block; touch-action:none; }
.hud { position:fixed; left:0; right:0; top:0; padding:12px 14px; display:flex; gap:10px; align-items:flex-start;
  justify-content:space-between; pointer-events:none; font-variant-numeric:tabular-nums; }
.hud .box { background:var(--panel); border:1px solid var(--line); border-radius:12px; padding:8px 12px; min-width:104px; }
.lbl { font-size:10px; letter-spacing:.12em; text-transform:uppercase; color:var(--dim); }
.val { font-size:24px; font-weight:800; line-height:1.1; white-space:nowrap; }
.val small { font-size:14px; color:var(--accent); margin-left:6px; }
.meters { flex:1; max-width:340px; display:grid; gap:6px; }
.meter { background:var(--panel); border:1px solid var(--line); border-radius:10px; padding:6px 10px; }
.bar { height:8px; border-radius:6px; background:rgba(255,255,255,.09); overflow:hidden; margin-top:4px; }
.bar i { display:block; height:100%; width:0; border-radius:6px; background:var(--good); transition:background .15s; }
.btns { display:flex; gap:6px; }
.btns button { pointer-events:auto; cursor:pointer; background:var(--panel); border:1px solid var(--line); color:var(--ink);
  border-radius:10px; padding:8px 10px; font:inherit; font-size:12px; min-width:40px; }
.overlay { position:fixed; inset:0; display:flex; align-items:center; justify-content:center; padding:18px; overflow:auto;
  background:radial-gradient(ellipse at center, rgba(4,8,10,.5), rgba(4,8,10,.9)); }
.card { width:min(540px,100%); background:var(--panel); border:1px solid var(--line); border-radius:20px;
  padding:24px 24px 20px; text-align:center; box-shadow:0 20px 60px rgba(0,0,0,.6); margin:auto; }
h1 { margin:0; font-size:clamp(38px,9vw,60px); font-weight:900; letter-spacing:-.02em; line-height:.95; text-wrap:balance; }
h1 span { color:var(--accent); }
.ver { display:inline-block; margin-top:10px; font-size:10px; letter-spacing:.16em; text-transform:uppercase; color:#1a1400;
  background:var(--accent); border-radius:999px; padding:3px 9px; font-weight:800; }
.tag { color:var(--dim); margin:8px 0 16px; font-size:14px; }
ul.how { list-style:none; margin:0 0 16px; padding:0; text-align:left; display:grid; gap:8px; font-size:14px; line-height:1.35; }
ul.how li { display:grid; grid-template-columns:26px 1fr; gap:10px; align-items:start; }
ul.how b { color:var(--accent); }
.dot { width:22px; height:22px; border-radius:50%; margin-top:1px; }
button.go { pointer-events:auto; cursor:pointer; border:0; border-radius:14px; padding:14px 26px; font:inherit; font-size:18px;
  font-weight:800; color:#1a1400; background:var(--accent); box-shadow:0 5px 0 #a8820c; }
button.go:active { transform:translateY(3px); box-shadow:0 2px 0 #a8820c; }
.keys { margin-top:12px; font-size:12px; color:var(--dim); }
.stats { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin:14px 0 16px; }
.stats > div { background:rgba(255,255,255,.05); border-radius:12px; padding:9px 6px; }
.stats .val { font-size:19px; }
.big { font-size:54px; font-weight:900; color:var(--accent); line-height:1; margin-top:6px; }
.rank { font-size:18px; font-weight:800; margin-top:8px; }
.row { display:flex; gap:10px; justify-content:center; flex-wrap:wrap; }
button.go.alt { background:#2b3a40; color:var(--ink); box-shadow:0 5px 0 #141d21; }
button.go.alt:active { box-shadow:0 2px 0 #141d21; }
.opts { display:flex; gap:6px; justify-content:center; flex-wrap:wrap; margin-top:14px; }
.opts button { pointer-events:auto; cursor:pointer; background:rgba(255,255,255,.06); border:1px solid var(--line); color:var(--ink); border-radius:999px; padding:6px 11px; font:inherit; font-size:12px; }
.opts button.off { color:var(--dim); text-decoration:line-through; }
.hint { position:fixed; left:50%; bottom:max(18px, env(safe-area-inset-bottom)); transform:translateX(-50%); width:min(520px, calc(100% - 28px)); pointer-events:none;
  background:var(--panel); border:1px solid var(--accent); border-radius:14px; padding:11px 15px; font-size:14.5px; line-height:1.35; text-align:center; font-weight:600; }
#runLine { margin-top:-8px; }
#boardBox { margin:0 0 14px; }
.bnote { margin:0 0 8px; font-size:13px; color:var(--dim); }
.bnote.good { color:var(--good); font-weight:800; font-size:15px; }
.claim { display:flex; gap:8px; justify-content:center; margin:0 0 6px; }
.claim input { flex:1; min-width:0; max-width:260px; background:rgba(255,255,255,.08); border:1px solid var(--line); border-radius:12px; color:var(--ink); font:inherit; font-size:16px; padding:10px 12px; }
.claim .go { padding:10px 16px; font-size:15px; box-shadow:0 4px 0 #a8820c; }
ol.board { list-style:none; margin:0; padding:0; display:grid; gap:3px; text-align:left; font-size:13.5px; max-height:150px; overflow:auto; }
ol.board li { display:grid; grid-template-columns:26px 1fr auto; gap:8px; padding:4px 9px; border-radius:8px; background:rgba(255,255,255,.04); }
ol.board li.me { background:rgba(255,210,63,.16); }
ol.board span { color:var(--dim); } ol.board b { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; } ol.board em { font-style:normal; font-weight:800; color:var(--accent); }
.hidden { display:none !important; }
@media (max-width:520px) { .meter .lbl span { display:none; } .hud { gap:6px; padding:8px; } .hud .box { min-width:92px; padding:7px 9px; } .val { font-size:20px; } }
.exit { position:fixed; left:12px; top:10px; z-index:5; font-size:12.5px; font-weight:700; color:var(--dim); text-decoration:none; background:var(--panel); border:1px solid var(--line); border-radius:999px; padding:6px 11px; }
.exit:hover { color:var(--ink); }
body.playing .exit, body.embedded .exit { display:none; }
body:not(.embedded) .overlay { padding-top:52px; }
/* short screens (phones on their side, small embeds): keep the buttons on screen */
@media (max-height:560px) {
  .card { padding:14px 18px 14px; }
  h1 { font-size:clamp(28px,9vh,44px); }
  .ver { margin:6px 0 10px; }
  .tag { margin:6px 0 10px; font-size:13px; }
  ul.how, .keys { display:none; }
  button.go { padding:10px 20px; font-size:16px; }
  .opts { margin-top:10px; }
  .big { font-size:36px; }
  .rank { font-size:15px; margin-top:4px; }
  .stats { grid-template-columns:repeat(6,1fr); gap:5px; margin:8px 0 10px; }
  .stats > div { padding:5px 3px; }
  .stats .val { font-size:15px; }
  .stats .lbl { font-size:8px; letter-spacing:.04em; }
  ol.board { max-height:84px; }
}
@media (max-height:360px) { .tag, .opts { display:none; } .overlay { padding:8px; } body:not(.embedded) .overlay { padding-top:8px; } .exit { display:none; } }
