/* One-screen arcade cabinet, same look as Curva del Faro: header strip, full-bleed 3D stage, menu cards over it. */
:root {
  --ink: #fff4e2; --ink-dim: #e9d6b8; --cabinet: #191a22; --panel: rgba(22, 20, 28, 0.88);
  --amber: #ffb23e; --signal: #e2382c; --ok: #4cc47a; --line: rgba(255, 244, 226, 0.18);
  --f-display: "Racing Sans One", "Arial Black", Impact, sans-serif;
  --f-ui: "Saira Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--cabinet); color: var(--ink); font-family: var(--f-ui); font-size: 17px; overflow: hidden;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
}
[hidden] { display: none !important; }
button, input { font-family: var(--f-ui); font-size: 17px; }
.app { height: 100%; display: flex; flex-direction: column; gap: 8px; padding-block: 8px 10px;
  padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); }
.app.playing { padding: 0; gap: 0; } .app.playing header { display: none; } .app.playing .stage { border-radius: 0; }
header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
h1 { margin: 0; font-family: var(--f-display); font-weight: 400; font-size: clamp(22px, 4vw, 30px); color: var(--amber); line-height: 1; }
.who { font-size: 15px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.who b, .coin { color: var(--amber); }
.stage { position: relative; flex: 1; min-height: 0; border-radius: 14px; overflow: hidden; background: #24212c; touch-action: none; }
canvas { display: block; width: 100%; height: 100%; }
.loading { position: absolute; inset: 0; display: grid; place-items: center; font-size: 20px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-dim); }

/* menu card */
.panel { position: absolute; inset: 10px auto 10px 10px; width: min(430px, calc(100% - 20px)); background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px; overflow-y: auto; touch-action: pan-y; -webkit-overflow-scrolling: touch; backdrop-filter: blur(6px); }
@media (max-aspect-ratio: 1/1) { .panel { inset: auto 8px 8px 8px; width: auto; max-height: 76%; } }
.panel h2 { margin: 0 0 10px; font-family: var(--f-display); font-weight: 400; font-size: 24px; color: var(--amber); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.panel h3 { margin: 14px 0 6px; font-size: 14px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-dim); }
.panel p { margin: 6px 0; color: var(--ink-dim); line-height: 1.3; }
.btn { appearance: none; border: 0; border-radius: 10px; padding: 11px 14px; background: var(--amber); color: #1b1408; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; cursor: pointer; min-height: 44px; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.small { padding: 6px 10px; min-height: 36px; font-size: 15px; }
.btn.danger { background: var(--signal); color: #fff; }
.btn:disabled { opacity: 0.4; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1; min-width: 0; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile { appearance: none; text-align: left; border: 1px solid var(--line); background: rgba(255, 244, 226, 0.05); color: var(--ink); border-radius: 12px; padding: 12px; cursor: pointer; min-height: 64px; }
.tile b { display: block; font-family: var(--f-display); font-weight: 400; font-size: 20px; color: var(--amber); }
.tile small { color: var(--ink-dim); font-size: 14px; }
.tile.wide { grid-column: 1 / -1; }
.field { display: block; margin: 8px 0; }
.field span { display: block; font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-dim); margin-bottom: 3px; }
.field input { width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.35); color: var(--ink); -webkit-user-select: text; user-select: text; }
.err { color: #ff8c84; min-height: 1.2em; }
.card { border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin: 8px 0; background: rgba(255, 244, 226, 0.04); }
.card.on { border-color: var(--amber); }
.card .name { font-weight: 700; font-size: 19px; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.tag { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; background: var(--amber); color: #1b1408; font-weight: 700; }
.tag.dim { background: rgba(255, 244, 226, 0.14); color: var(--ink); }
.stat { display: grid; grid-template-columns: 84px 1fr 56px; gap: 8px; align-items: center; font-size: 15px; margin: 3px 0; }
.stat i { display: block; height: 8px; border-radius: 4px; background: rgba(255, 244, 226, 0.12); overflow: hidden; }
.stat i u { display: block; height: 100%; background: var(--amber); }
.stat em { font-style: normal; text-align: right; font-variant-numeric: tabular-nums; }
.stat em s { text-decoration: none; color: var(--ok); }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
td, th { padding: 5px 4px; text-align: right; border-bottom: 1px solid var(--line); font-size: 16px; }
td:nth-child(2), th:nth-child(2) { text-align: left; } tr.me td { color: var(--amber); font-weight: 700; }
.chips { display: inline-flex; gap: 3px; } .chip { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-weight: 700; font-size: 14px; color: #14131a; }
.chip.T { background: #ff6b5e; } .chip.P { background: #63b3ff; } .chip.N { background: var(--amber); }
.trick { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.big { font-family: var(--f-display); font-size: 44px; line-height: 1; margin: 6px 0; }
.code { font-family: var(--f-display); font-size: 52px; letter-spacing: 0.2em; color: var(--amber); text-align: center; }

/* match HUD */
.score { position: absolute; top: max(8px, env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; background: var(--panel); border-radius: 12px; padding: 6px 12px; white-space: nowrap; pointer-events: none; max-width: calc(100% - 120px); }
.score .team { font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; max-width: 26vw; overflow: hidden; text-overflow: ellipsis; }
.score b { font-family: var(--f-display); font-weight: 400; font-size: 26px; font-variant-numeric: tabular-nums; }
.score em { font-style: normal; font-variant-numeric: tabular-nums; color: var(--amber); font-weight: 700; margin-left: 4px; }
.score em.gold { color: var(--signal); }
.quit { position: absolute; top: max(8px, env(safe-area-inset-top, 0px)); right: 8px; appearance: none; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 10px; padding: 8px 12px; min-height: 40px; }
.banner { position: absolute; top: 22%; left: 0; right: 0; text-align: center; font-family: var(--f-display); font-size: clamp(26px, 6vw, 52px); color: var(--amber); text-shadow: 0 3px 0 #000, 0 0 18px rgba(0, 0, 0, 0.7); pointer-events: none; opacity: 0; transition: opacity 0.25s; }
.banner.show { opacity: 1; } .banner small { display: block; font-family: var(--f-ui); font-size: 0.45em; color: var(--ink); letter-spacing: 0.1em; text-transform: uppercase; }
.banner.bad { color: #ff8c84; }
.seq { position: absolute; bottom: 190px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; pointer-events: none; min-height: 34px; }
.seq .chip { width: 34px; height: 34px; font-size: 18px; } .seq .slot { width: 34px; height: 34px; border-radius: 50%; border: 2px dashed var(--ink-dim); }
.stick { position: absolute; left: max(14px, env(safe-area-inset-left, 0px)); bottom: max(18px, env(safe-area-inset-bottom, 0px)); width: 150px; height: 150px; border-radius: 50%; background: rgba(22, 20, 28, 0.55); border: 2px solid var(--line); touch-action: none; }
.stick::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 22.5deg, transparent 0 45deg, rgba(255, 244, 226, 0.07) 45deg 90deg, transparent 90deg 135deg, rgba(255, 244, 226, 0.07) 135deg 180deg, transparent 180deg 225deg, rgba(255, 244, 226, 0.07) 225deg 270deg, transparent 270deg 315deg, rgba(255, 244, 226, 0.07) 315deg 360deg); }
.knob { position: absolute; left: 50%; top: 50%; width: 62px; height: 62px; border-radius: 50%; background: var(--amber); transform: translate(-50%, -50%); box-shadow: 0 3px 0 #8a5a10; pointer-events: none; }
.btns { position: absolute; right: max(12px, env(safe-area-inset-right, 0px)); bottom: max(16px, env(safe-area-inset-bottom, 0px)); width: 210px; height: 170px; pointer-events: none; }
.pad { position: absolute; width: 82px; height: 82px; border-radius: 50%; border: 0; color: #14131a; display: grid; place-content: center; text-align: center; line-height: 1; pointer-events: auto; touch-action: none; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.45); }
.pad b { font-family: var(--f-display); font-weight: 400; font-size: 26px; } .pad small { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.pad.a { background: #ff6b5e; right: 0; bottom: 40px; } .pad.b { background: #63b3ff; right: 90px; bottom: 0; } .pad.c { background: var(--amber); right: 74px; bottom: 90px; width: 70px; height: 70px; }
.pad.on { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.45); filter: brightness(1.15); }
.pad.c.armed { outline: 4px solid #fff; }
.toast { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%) translateY(20px); background: #000c; color: var(--ink); padding: 9px 14px; border-radius: 10px; opacity: 0; transition: all 0.25s; pointer-events: none; max-width: 90%; text-align: center; z-index: 5; }
.toast.show { opacity: 1; transform: translateX(-50%); }
