:root {
  --ink: #f4efe4; --muted: #a9b3c7; --panel: rgba(13, 20, 38, .86); --line: rgba(255,255,255,.12);
  --gold: #ffc53d; --gold-ink: #2a1d00; --blue: #3d6bff; --led: #ff4d3a; --bg: #0b1324;
  --font: 'Inter', system-ui, sans-serif; --display: 'Archivo Black', 'Inter', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font-family: var(--font); }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--gold); }

#led { position: fixed; top: 14px; left: 14px; padding: 6px 12px 8px; background: #120806; border: 1px solid #3a1510;
  border-radius: 10px; font-family: 'VT323', monospace; color: var(--led); line-height: .9; text-shadow: 0 0 8px rgba(255,77,58,.7); }
#led small { display: block; font-size: 13px; letter-spacing: 2px; opacity: .8; }
#led b { display: block; font-size: 40px; font-weight: 400; }

#rail { position: fixed; right: 14px; top: 50%; transform: translateY(-50%); height: min(70vh, 520px); width: 34px;
  display: flex; flex-direction: column; align-items: center; gap: 8px; }
.railbtn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); }
#railTrack { position: relative; flex: 1; width: 4px; background: rgba(255,255,255,.18); border-radius: 2px; cursor: pointer; }
#railThumb { position: absolute; left: 50%; width: 22px; height: 10px; margin-left: -11px; margin-top: -5px; background: var(--led);
  border-radius: 3px; box-shadow: 0 0 10px var(--led); pointer-events: none; }
#railMarks .mark { text-shadow: 0 0 4px #0b1324, 0 0 2px #0b1324; position: absolute; right: 12px; transform: translateY(-50%); white-space: nowrap; font-size: 10px; font-weight: 800;
  letter-spacing: .5px; color: var(--muted); text-transform: uppercase; cursor: pointer; }
#railMarks .mark::after { content: ''; display: inline-block; width: 8px; height: 1px; margin-left: 4px; vertical-align: middle; background: var(--muted); }
#railMarks .mark.passed { color: var(--gold); }

#panel { position: fixed; left: 14px; bottom: 14px; width: min(380px, calc(100vw - 28px)); background: var(--panel);
  border: 1px solid var(--line); border-radius: 18px; padding: 12px; backdrop-filter: blur(10px); }
#panel.collapsed .body { display: none; }
.row { display: flex; gap: 8px; align-items: center; }
.row.top { flex-wrap: wrap; margin-bottom: 10px; }
.chip { border: 1px solid var(--line); background: rgba(255,255,255,.06); border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 600; text-decoration: none; color: var(--ink); }
.chip.link { color: var(--gold); }
#btnHide { margin-left: auto; }
.search { display: block; position: relative; background: rgba(255,255,255,.06); border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px; }
.search span { font-size: 10px; letter-spacing: 1.5px; color: var(--muted); font-weight: 800; }
.search input { width: 100%; border: 0; outline: 0; background: none; color: var(--ink); font-size: 16px; padding: 4px 0; }
#suggest { list-style: none; margin: 0; padding: 0; position: absolute; left: 0; right: 0; bottom: 100%; margin-bottom: 6px;
  background: #121b31; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
#suggest:empty { display: none; }
#suggest li { padding: 9px 12px; cursor: pointer; font-size: 14px; }
#suggest li:hover, #suggest li.on { background: rgba(255,255,255,.08); }
#suggest li small { color: var(--muted); float: right; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 12px 2px 6px; }
.stats b { display: block; font-family: var(--display); font-size: 18px; font-weight: 400; }
.stats span { font-size: 11px; color: var(--muted); }
.progress { height: 4px; background: rgba(255,255,255,.1); border-radius: 2px; margin: 4px 2px 12px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .6s; }
.btn { flex: 1; display: inline-block; text-align: center; text-decoration: none; border: 1px solid var(--line); background: rgba(255,255,255,.08);
  border-radius: 12px; padding: 10px 8px; font-weight: 800; font-size: 13px; color: var(--ink); }
.btn:hover { background: rgba(255,255,255,.14); }
[hidden] { display: none !important; }
.btn.gold { background: var(--gold); color: var(--gold-ink); border-color: transparent; }
.btn.big { display: block; width: 100%; margin-top: 8px; padding: 14px; font-family: var(--display); font-weight: 400; font-size: 16px;
  letter-spacing: .5px; background: var(--blue); border-color: transparent; color: #fff; }
.btn.big.gold { background: var(--gold); color: var(--gold-ink); }

.modal { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(4,8,18,.55); padding: 16px; z-index: 10; }
.modal[hidden] { display: none; }
.card { position: relative; width: min(420px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: #f6f1e6; color: #1b1f2a;
  border-radius: 18px; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.card h2 { font-family: var(--display); font-weight: 400; margin: 0 0 8px; font-size: 24px; }
.card p { line-height: 1.45; font-size: 14px; }
.card a { color: #2348d8; }
.card .btn { color: #1b1f2a; background: #e7e0d1; }
.card .btn.big { color: #fff; background: var(--blue); }
.card .btn.big.gold { color: var(--gold-ink); background: var(--gold); }
.card input:not([type]) , .card input[type=text] { width: 100%; font-size: 17px; padding: 12px; border-radius: 10px; border: 1px solid #cfc6b4; background: #fff; }
.x { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 10px; border: 1px solid #cfc6b4; background: #fff; color: #1b1f2a; }
.check { display: flex; gap: 8px; align-items: center; margin: 12px 0 4px; font-size: 14px; }
.fine { font-size: 12px !important; color: #5e6472; }
.report-link { margin: 10px 0 0; }
.kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 8px 0 10px; }
.kinds label { cursor: pointer; } .kinds input { display: none; }
.kinds span { display: block; text-align: center; padding: 10px 6px; border-radius: 12px; background: #fff; border: 2px solid #e4dccb; font-weight: 800; font-size: 14px; }
.kinds input:checked + span { border-color: var(--blue); background: #eef2ff; }
.card textarea { width: 100%; font: inherit; font-size: 16px; padding: 12px; border-radius: 10px; border: 1px solid #cfc6b4; background: #fff; resize: vertical; margin-bottom: 8px; }
.err { color: #c62828; font-weight: 600; min-height: 1em; }
.apt-head { display: flex; gap: 14px; align-items: center; margin-right: 30px; }
.apt-head h2 { font-size: 20px; word-break: break-all; }
.apt-head p { margin: 2px 0; }
.room { flex: 0 0 120px; height: 96px; border-radius: 10px; overflow: hidden; }
.room svg { width: 100%; height: 100%; display: block; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; background: #dff3e1; color: #1d6b2c; font-size: 12px !important; font-weight: 800; }
.pill.pending { background: #fff1cc; color: #7a5200; }
.pill.out { background: #eee; color: #666; }
#inside { position: fixed; left: 50%; top: calc(12px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 9; display: flex; flex-direction: column; align-items: center; gap: 8px; width: min(420px, calc(100vw - 24px)); pointer-events: none; }
#inside[hidden] { display: none; }
#inside .who { pointer-events: auto; background: rgba(11,19,36,.88); border: 1px solid var(--line); border-radius: 14px; padding: 8px 14px; font-weight: 800; font-size: 14px; text-align: center; }
#inside .who small { display: block; font-weight: 600; color: var(--muted); font-size: 12px; }
#inside .btn { pointer-events: auto; flex: 0 0 auto; padding: 10px 18px; background: var(--gold); color: var(--gold-ink); border: 0; }
#inside .hint { margin: 0; font-size: 12px; color: #dfe6f5; text-shadow: 0 1px 3px #000; }
body.inside #panel, body.inside #rail, body.inside #led { display: none; }
/* welcome card */
.card.dark { background: linear-gradient(180deg, #13204a, #0b1324); color: var(--ink); border: 1px solid rgba(255,197,61,.35); }
.card.dark .x { background: rgba(255,255,255,.08); color: var(--ink); border-color: var(--line); }
.welcome .kicker { margin: 0; font-size: 12px !important; letter-spacing: 3px; font-weight: 800; color: var(--gold); }
.welcome .count { display: flex; align-items: baseline; gap: 10px; margin: 8px 0 2px; }
.welcome .count b { font-family: 'VT323', monospace; font-weight: 400; font-size: 64px; line-height: .8; color: var(--led); text-shadow: 0 0 14px rgba(255,77,58,.7); }
.welcome .count span { color: var(--muted); font-weight: 600; }
.welcome h2 { font-size: 26px; margin: 6px 0 6px; } .welcome h2 em { font-style: normal; color: var(--gold); }
.welcome .lead { color: #cfd7ea; margin: 0 0 12px; }
.wsteps { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 8px; }
.wsteps li { display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.06); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.wsteps li > b { flex: 0 0 30px; height: 30px; border-radius: 50%; background: var(--gold); color: var(--gold-ink); display: grid; place-items: center; font-family: var(--display); font-weight: 400; }
.wsteps li > div { flex: 1; } .wsteps strong { display: block; font-size: 15px; } .wsteps small { color: var(--muted); font-size: 12px; }
.wsteps .h { color: var(--gold); }
.wsteps .btn { flex: 0 0 auto; padding: 9px 14px; min-height: 0; color: #fff; background: var(--blue); border: 0; }
.wsteps .btn.gold { background: var(--gold); color: var(--gold-ink); }
.btn.ghost { display: block; width: 100%; background: transparent; color: var(--muted); border: 0; font-weight: 600; }
.pill.evict { background: #ffe1d6; color: #a33b12; }
.cdw { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 6px; margin-right: 4px; vertical-align: middle;
  background: #120806; border: 1px solid #3a1510; border-radius: 8px; box-shadow: 0 0 8px rgba(255,77,58,.35); }
.cdw i { font-style: normal; font-size: 12px; } .cdw b { font-family: 'VT323', monospace; font-weight: 400; font-size: 22px; line-height: .9; color: #ff4d3a; text-shadow: 0 0 6px rgba(255,77,58,.8); }
.cdw small { font-family: 'VT323', monospace; font-size: 13px; color: #ff8a7a; letter-spacing: 1px; }
.items { list-style: none; padding: 0; margin: 14px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.items li { background: #fff; border-radius: 10px; padding: 8px 10px; font-size: 13px; }
.items li small { display: block; color: #7a7f8c; font-size: 11px; }
.upsell { margin-bottom: 0; font-size: 13px !important; }
.tiers { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tiers li { background: #fff; border-radius: 12px; padding: 10px; }
.tiers b { display: block; }
.tiers span { font-size: 12px; color: #7a7f8c; }
.suplist { padding-left: 22px; }
.suplist li { padding: 6px 0; border-bottom: 1px solid #e4dccb; }
.suplist small { color: #7a7f8c; }

#toast { position: fixed; top: 16px; left: 50%; transform: translateX(-50%) translateY(-80px); background: var(--gold); color: var(--gold-ink);
  padding: 10px 16px; border-radius: 12px; font-weight: 800; transition: transform .3s; z-index: 20; max-width: calc(100vw - 32px); }
#toast.show { transform: translateX(-50%) translateY(0); }

#wash { position: fixed; inset: 0; z-index: 15; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 24px 16px; background: rgba(8,14,30,.94); }
#wash[hidden] { display: none; }
.wash-top { display: flex; gap: 22px; text-align: center; font-family: 'VT323', monospace; color: var(--gold); }
.wash-top small { display: block; font-size: 13px; letter-spacing: 1px; color: var(--muted); }
.wash-top b { font-size: clamp(28px, 7vw, 48px); font-weight: 400; }
#washPad { position: relative; width: min(320px, 80vw); aspect-ratio: 3/4; border: 10px solid #39465f; border-radius: 6px; background: #1b2a48; overflow: hidden; user-select: none; }
#washWin { position: absolute; inset: 0; background: radial-gradient(circle at 30% 30%, rgba(180,150,90,.75), rgba(90,70,40,.85)); transition: opacity .15s; }
#washPad em { position: absolute; left: 0; right: 0; bottom: 14px; font-style: normal; font-family: var(--display); color: #fff; letter-spacing: 1px; }
#washPad .bubble { position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.8); pointer-events: none; animation: pop .6s forwards; }
@keyframes pop { to { transform: translateY(-40px) scale(1.8); opacity: 0; } }
#washExit { flex: 0 0 auto; width: min(320px, 80vw); }
.wash-event { text-align: center; }
.wash-event b { display: block; font-family: var(--display); font-weight: 400; font-size: 22px; letter-spacing: 1px; }
.wash-event span { font-family: 'VT323', monospace; font-size: 22px; color: var(--led); }
.wash-side { width: min(320px, 80vw); }
.wash-side input { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.08); color: var(--ink); font-size: 15px; }
.wash-prize { margin: 6px 0; font-size: 12px; color: var(--muted); text-align: center; }
#washTop { margin: 0; padding-left: 22px; font-size: 13px; max-height: 22vh; overflow: auto; }
#washTop li { padding: 2px 0; } #washTop li.me { color: var(--gold); font-weight: 800; }
#washTop li small { float: right; color: var(--muted); font-family: 'VT323', monospace; font-size: 16px; }
.pill.rare { background: #efe3ff; color: #5b2ca0; } .pill.legendary { background: #ffe9a8; color: #7a4f00; }
.items li.wish { background: #fff6d6; }
body.rec #panel, body.rec #rail, body.rec #toast { display: none; }
body.rec #led { transform: scale(1.4); transform-origin: top left; }

/* ---------- phones: most visitors come from Instagram on a phone ---------- */
html, body { overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
button, .chip, .btn { touch-action: manipulation; }
@media (max-width: 560px) {
  #wash { padding: 14px 12px calc(14px + env(safe-area-inset-bottom)); gap: 8px; }
  #washPad { width: min(240px, 64vw); }
  .wash-side input { font-size: 16px; }
  /* altitude rail: slim, no landmark text (it crowds the tower), big ▲▼ thumbs */
  #rail { right: 8px; top: calc(12px + env(safe-area-inset-top)); height: 38vh; transform: none; width: 40px; }
  .railbtn { width: 40px; height: 40px; font-size: 15px; }
  #railMarks .mark { font-size: 0; right: 8px; } #railMarks .mark::after { width: 10px; }
  #railMarks .mark.passed::after { background: var(--gold); }
  #led { top: calc(10px + env(safe-area-inset-top)); left: 10px; padding: 4px 9px 6px; }
  #led b { font-size: 26px; } #led small { font-size: 11px; }
  /* bottom sheet panel */
  #panel { left: 8px; right: 8px; width: auto; bottom: calc(8px + env(safe-area-inset-bottom)); padding: 10px; border-radius: 20px; }
  .row.top { flex-wrap: nowrap; overflow-x: auto; margin-bottom: 8px; scrollbar-width: none; }
  .row.top::-webkit-scrollbar { display: none; }
  .chip { flex: 0 0 auto; padding: 9px 12px; font-size: 13px; }
  .search { padding: 4px 12px; } .search span { display: none; }
  .search input { font-size: 16px; padding: 8px 0; }
  .stats { display: flex; gap: 12px; margin: 8px 2px 4px; align-items: baseline; flex-wrap: wrap; }
  .stats > div { display: flex; gap: 4px; align-items: baseline; }
  .stats b { font-size: 15px; } .stats span { font-size: 11px; }
  .progress { margin: 4px 2px 8px; }
  .btn { padding: 12px 8px; font-size: 14px; border-radius: 14px; min-height: 44px; }
  .btn.big { padding: 15px; font-size: 16px; margin-top: 8px; }
  #panel.collapsed .body { display: none; }
  /* cards slide up from the bottom; the tower stays visible above */
  .modal { place-items: end center; padding: 0; background: rgba(4,8,18,.25); }
  .card { width: 100%; max-height: 72vh; border-radius: 22px 22px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); animation: sheet .22s ease-out; }
  .card::before { content: ''; display: block; width: 44px; height: 5px; border-radius: 3px; background: #cfc6b4; margin: -6px auto 12px; }
  .x { top: 14px; right: 12px; width: 40px; height: 40px; }
  .apt-head { gap: 12px; } .room { flex-basis: 96px; height: 78px; } .apt-head h2 { font-size: 18px; }
  .items { gap: 6px; margin: 12px 0; } .items li { padding: 7px 9px; font-size: 13px; }
  #toast { top: calc(10px + env(safe-area-inset-top)); }
}
@keyframes sheet { from { transform: translateY(40px); opacity: .4; } }
