/* Fake It Club 3D — neon nightclub UI over a WebGL club. */
:root {
  --bg: #07030d; --card: rgba(16, 10, 30, 0.92); --card2: #1d1436; --line: #3a2a63;
  --text: #f2ecff; --dim: #b7a8dd; --gold: #ffc94d; --gold2: #e8a91c;
  --violet: #8b46c7; --red: #e33e5a; --green: #43b968; --cyan: #37e0c8;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text);
  font-family: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif; touch-action: none; }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }
h1, h2, h3 { margin: .25em 0; }
.muted { color: var(--dim); }
.small { font-size: .85rem; }
button { font-family: inherit; }

/* ── overlays + cards ── */
.overlay { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center;
  padding: 14px; background: rgba(4, 2, 10, 0.45); backdrop-filter: blur(3px); overflow-y: auto; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 22px;
  max-width: 560px; width: 100%; max-height: 92dvh; overflow-y: auto; box-shadow: 0 18px 60px rgba(0,0,0,.6); }
.door-card { text-align: center; }
.logo { font-size: 3rem; line-height: 1; filter: drop-shadow(0 0 18px rgba(255,45,149,.65)); }
.door-card h1 { font-size: 2.3rem; letter-spacing: .06em; margin: 6px 0 2px; }
.gold { color: var(--gold); text-shadow: 0 0 22px rgba(255,201,77,.6); }
.threed { color: var(--cyan); font-size: 1.1rem; vertical-align: super; text-shadow: 0 0 14px rgba(55,224,200,.8); }
.tag { color: var(--dim); line-height: 1.5; margin: 6px 0 14px; }
.door-grid { text-align: left; display: grid; gap: 12px; margin-bottom: 16px; }
.field > span { display: block; font-size: .8rem; text-transform: uppercase; letter-spacing: .09em; color: var(--dim); margin-bottom: 6px; }
.field input[type="text"], .pass-add input { width: 100%; background: var(--card2); border: 1px solid var(--line); color: var(--text);
  border-radius: 12px; padding: 11px 13px; font-size: 1rem; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.swatch.sel { border-color: #fff; box-shadow: 0 0 12px rgba(255,255,255,.5); transform: scale(1.12); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: var(--card2); border: 1px solid var(--line); color: var(--text); border-radius: 999px;
  padding: 8px 14px; font-size: .92rem; cursor: pointer; min-height: 40px; }
.chip.sel { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 10px rgba(255,201,77,.35); }
.chip.done { border-color: var(--green); color: var(--green); }
.chip.wrong, .pad.wrong { border-color: var(--red) !important; color: var(--red) !important; }
.seg { display: grid; gap: 8px; }
.seg-btn { background: var(--card2); border: 1px solid var(--line); color: var(--text); border-radius: 12px; padding: 11px; font-size: .95rem; cursor: pointer; text-align: left; }
.seg-btn.sel { border-color: var(--cyan); color: var(--cyan); }
.btn { appearance: none; border: 1px solid var(--line); background: var(--card2); color: var(--text);
  border-radius: 14px; padding: 12px 18px; font-size: 1rem; font-weight: 600; cursor: pointer; min-height: 48px; }
.btn:active { transform: scale(.97); }
.btn-hero { display: block; width: 100%; background: linear-gradient(180deg, var(--gold), var(--gold2)); color: #241300; border: none;
  font-size: 1.12rem; padding: 14px 26px; box-shadow: 0 4px 24px rgba(232,169,28,.35); margin: 8px 0; }
.btn-primary { background: linear-gradient(180deg, #9a5ce0, var(--violet)); border: none; color: #fff; }
.btn-ghost { background: transparent; width: 100%; }
.btn-danger { border-color: var(--red); color: #ff9db0; }
.btn-small { min-height: 38px; padding: 6px 12px; border-radius: 10px; }
.btn[disabled] { opacity: .45; cursor: default; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.panel-head h2 { margin-top: 0; }
.pass-list { margin: 8px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pass-add { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 10px 0; }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; vertical-align: baseline; margin-right: 2px; }

/* ── HUD ── */
#hud { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
.hud-pill { position: absolute; top: calc(10px + env(safe-area-inset-top)); background: rgba(10,6,22,.78); border: 1px solid var(--line);
  border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: .92rem; }
#hud-tasks { left: 12px; color: var(--gold); }
#hud-alive { left: 50%; transform: translateX(-50%); }
#hud-driver { right: 12px; color: var(--cyan); top: calc(52px + env(safe-area-inset-top)); }
#hud-crisis { left: 50%; transform: translateX(-50%); top: calc(52px + env(safe-area-inset-top)); background: rgba(90,10,26,.85); border-color: var(--red); color: #ffb3c0; animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: translateX(-50%) scale(1.05); } }
.hud-btn { position: absolute; right: 12px; top: calc(10px + env(safe-area-inset-top)); pointer-events: auto;
  background: rgba(10,6,22,.78); border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 8px 14px; font-weight: 700; cursor: pointer; }
#ticker { position: absolute; top: calc(96px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  max-width: min(92vw, 640px); text-align: center; font-size: 1.02rem; font-weight: 600; line-height: 1.45;
  text-shadow: 0 2px 12px #000, 0 0 30px rgba(0,0,0,.9); }
#notes { position: absolute; left: 12px; bottom: calc(86px + env(safe-area-inset-bottom)); list-style: none; margin: 0; padding: 0; max-width: min(78vw, 400px); }
#notes li { background: rgba(10,6,22,.72); border-left: 3px solid var(--violet); border-radius: 8px; padding: 6px 10px; margin-top: 6px; font-size: .86rem; transition: opacity 1.2s; }
#notes li.old { opacity: .45; }
#crosshair { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%;
  background: rgba(255,255,255,.85); box-shadow: 0 0 8px rgba(0,0,0,.8); }
#interact { position: absolute; left: 50%; bottom: calc(120px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  text-align: center; pointer-events: auto; }
#interact-label { background: rgba(10,6,22,.85); border: 1px solid var(--gold); color: var(--gold); border-radius: 12px;
  padding: 10px 16px; font-weight: 700; box-shadow: 0 0 18px rgba(255,201,77,.25); }
#interact-btns { display: flex; gap: 8px; justify-content: center; margin-top: 8px; flex-wrap: wrap; }
#resume-hint { position: absolute; left: 50%; bottom: calc(64px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: rgba(10,6,22,.85); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; font-size: .9rem; }
#controls-hint { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(10px + env(safe-area-inset-bottom)); font-size: .78rem; color: var(--dim); text-shadow: 0 1px 6px #000; white-space: nowrap; }
body.touch #controls-hint { display: none; }
body.touch #notes { bottom: calc(168px + env(safe-area-inset-bottom)); }

/* ── touch controls ── */
#touch-ui { position: fixed; inset: 0; z-index: 25; pointer-events: none; }
#joy { position: absolute; left: 18px; bottom: calc(24px + env(safe-area-inset-bottom)); width: 124px; height: 124px; border-radius: 50%;
  background: rgba(20,12,40,.4); border: 1.5px solid rgba(183,168,221,.5); pointer-events: auto; }
#joy-knob { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px; border-radius: 50%;
  background: rgba(183,168,221,.45); border: 1.5px solid rgba(255,255,255,.6); }
#btn-touch-interact { position: absolute; right: 20px; bottom: calc(44px + env(safe-area-inset-bottom)); width: 84px; height: 84px; border-radius: 50%;
  background: rgba(232,169,28,.85); border: 2px solid var(--gold); color: #241300; font-weight: 800; font-size: 1rem; pointer-events: auto; }

/* ── phone / tasks / meeting ── */
.phone-card h3, .meeting-card h3 { color: var(--gold); margin-top: 16px; }
.plain-list { list-style: none; margin: 6px 0; padding: 0; line-height: 1.9; }
.plain-list li.done { color: var(--dim); text-decoration: line-through; }
.bar { height: 16px; border-radius: 8px; background: #171029; border: 1px solid var(--line); overflow: hidden; margin: 12px 0; }
.bar > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--violet), #ff2d95); transition: width .15s; }
.chips .chip { min-height: 44px; }
.pads { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.pad { font-size: 2rem; padding: 16px; border-radius: 14px; background: var(--card2); border: 1px solid var(--line); cursor: pointer; }
.pad.lit { background: var(--gold); box-shadow: 0 0 22px rgba(255,201,77,.7); }
.timing-track { position: relative; height: 26px; border-radius: 8px; background: #171029; border: 1px solid var(--line); margin: 14px 0; overflow: hidden; }
.timing-zone { position: absolute; top: 0; bottom: 0; background: rgba(67,185,104,.35); }
.timing-marker { position: absolute; top: 2px; bottom: 2px; width: 5px; border-radius: 3px; background: var(--gold); box-shadow: 0 0 10px var(--gold); }
.tap-area { position: relative; height: 210px; border-radius: 12px; background: radial-gradient(circle at 50% 40%, #241545, #120b26); border: 1px solid var(--line); margin: 10px 0; }
.tap-target { position: absolute; width: 64px; height: 64px; border-radius: 50%; border: 2px solid var(--gold); background: radial-gradient(circle, #4a2f7a, #241545); font-size: 1.7rem; cursor: pointer; box-shadow: 0 0 22px rgba(255,201,77,.55); transition: left .12s, top .12s; }
.task-slider { width: 100%; accent-color: var(--gold); height: 34px; }
.casefile { text-align: left; background: rgba(255,201,77,.06); border: 1px solid rgba(255,201,77,.25); border-radius: 12px; padding: 10px 12px; margin: 10px 0; font-size: .88rem; line-height: 1.5; color: var(--dim); }
.casefile b { color: var(--gold); }
.casefile div { margin-top: 4px; }
.meeting-log { display: grid; gap: 8px; margin: 12px 0; text-align: left; }
.meeting-log .say { background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; line-height: 1.45; }
.vote-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 10px; }
.vote-btn { background: var(--card2); border: 1px solid var(--line); color: var(--text); border-radius: 12px; padding: 13px; font-size: 1rem; font-weight: 600; cursor: pointer; min-height: 50px; }
.vote-btn.skip { grid-column: 1 / -1; color: var(--dim); }
.gate-card, .end-card { text-align: center; }
.end-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0; }
.end-stats div { background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 4px; }
.end-stats b { display: block; font-size: 1.3rem; color: var(--gold); }
.end-stats span { font-size: .75rem; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }
@media (max-width: 520px) {
  .door-card h1 { font-size: 1.8rem; }
  .card { padding: 16px; }
  #hud-alive { display: none; }
  #ticker { font-size: .94rem; }
}
