:root {
  --bg: #1b191b;
  --panel: #252226;
  --line: #3a363b;
  --ink: #f2eddf;
  --muted: #a9a3a8;
  --accent: #cfd96a;
  --accent-ink: #1b191b;
  --danger: #ff6b6b;
  --ok: #7fdc9a;
  --radius: 12px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

a { color: var(--accent); }
h1, h2, h3 { line-height: 1.15; margin: 0; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; margin-bottom: 12px; }

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--bg); z-index: 5;
}
.brand { color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.brand span { color: var(--accent); }
.top nav { display: flex; gap: 16px; font-size: 15px; }

main { max-width: 1180px; margin: 0 auto; padding: 0 16px 32px; }

.stage, .floor { padding-top: 24px; }
.stage-box {
  margin-top: 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: #111; aspect-ratio: 16 / 9; overflow: hidden; display: grid; place-items: center;
}
.stage-box iframe { width: 100%; height: 100%; border: 0; }
.stage-main { min-width: 0; }
html[data-room="3d"] .stage-box { aspect-ratio: auto; display: block; background: #0e0c10; }
.room3d { width: 100%; }
.room3d canvas { display: block; width: 100%; border-radius: 12px; touch-action: none; }
html[data-room="3d"] .menu { max-width: 1180px; margin: 0 auto; padding: 16px; }
.menu-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.menu-card { display: flex; flex-direction: column; gap: 8px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.menu-card h3 { margin: 0; font-size: 1.05rem; }
.menu-card .price { font-size: 1.6rem; font-weight: 800; color: var(--accent); }
.menu-card p { margin: 0; color: var(--muted); font-size: 15px; }
.menu-card .btn { margin-top: auto; }
.menu-card.picked { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.menu-card.off { opacity: 0.55; }
.room { display: none; }
html[data-room="2d"] .stage-box { display: none; }
.stream-box { margin: 8px 0; aspect-ratio: 16 / 9; }
.stream-box iframe { width: 100%; height: 100%; border: 0; border-radius: 12px; }
.offline { text-align: center; padding: 16px; max-width: 460px; color: var(--muted); }
.offline-title { color: var(--ink); font-size: 1.2rem; font-weight: 700; margin: 0 0 6px; }
.offline p { margin: 0 0 6px; }

.stage-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; margin-top: 12px; }
.stage-grid .stage-box { margin-top: 0; position: relative; }

.bursts { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.burst {
  position: absolute; bottom: 8%; padding: 4px 10px; border-radius: 999px; font-weight: 700; font-size: 15px;
  background: rgba(27, 25, 27, 0.78); color: var(--ink); border: 1px solid var(--accent); white-space: nowrap;
}
@media (prefers-reduced-motion: no-preference) {
  .burst { animation: rise 2.4s ease-out forwards; }
}
@keyframes rise {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(-160px); opacity: 0; }
}

.chat {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
  padding: 14px; display: flex; flex-direction: column; gap: 10px; min-height: 0;
}
.chat h2 { font-size: 1.1rem; }
.chat-log {
  list-style: none; margin: 0; padding: 0; height: 240px; overflow-y: auto; font-size: 15px;
  border: 1px solid var(--line); border-radius: 10px; background: #151316; padding: 8px 10px;
}
.chat-log li { margin: 0 0 6px; overflow-wrap: anywhere; }
.chat-log .nick { font-weight: 700; margin-right: 6px; color: var(--accent); }
.chat-log .me .nick { color: var(--ink); }
.chat-log .host { border-left: 3px solid var(--accent); padding-left: 8px; }
.chat-log .host .nick { color: var(--accent); }
.chat-log .sys { color: var(--muted); font-style: italic; }

.idle-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px; border: 1px solid var(--accent); border-radius: 10px; font-size: 15px;
}
.idle-bar[hidden], .join[hidden], .send[hidden], .emotes[hidden] { display: none; }
.idle-bar button, .emotes button {
  min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line);
  background: #151316; color: var(--ink); font: 600 15px system-ui, sans-serif; cursor: pointer;
}
.idle-bar button { border-color: var(--accent); }
.send { display: flex; gap: 8px; }
.send input { flex: 1; min-width: 0; }
.send .btn { width: auto; padding: 0 20px; }
.emotes { display: flex; flex-wrap: wrap; gap: 8px; }

.floor-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; list-style: none; padding: 0; margin: 12px 0; font-size: 15px; }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }

.floor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }

.map-wrap {
  border: 1px solid var(--line); border-radius: var(--radius); background: #121012;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
#map { display: block; width: 100%; min-width: 620px; height: auto; }

#map .zone { fill: #2a262b; stroke: #4a444b; stroke-width: 2; }
#map .zone-label { fill: var(--ink); font: 700 26px system-ui, sans-serif; text-anchor: middle; dominant-baseline: middle; }
#map .dj { fill: #3b363c; stroke: #5a545b; stroke-width: 2; }

#map .tbl { cursor: pointer; }
#map .tbl rect { stroke: transparent; stroke-width: 4; transition: stroke 0.12s; }
#map .tbl text { font: 700 28px system-ui, sans-serif; fill: #14110f; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
#map .tbl:hover rect, #map .tbl:focus rect { stroke: var(--ink); }
#map .tbl:focus { outline: none; }
#map .tbl.selected rect { stroke: var(--accent); stroke-width: 6; }
#map .tbl.claimed { cursor: not-allowed; }
#map .tbl.claimed rect { fill: #3a363b !important; }
#map .tbl.claimed text { fill: #7d777d; }
#map .tbl.claimed .nick { fill: var(--muted); font: 600 22px system-ui, sans-serif; }

.panel {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
  padding: 16px; position: sticky; top: 72px;
}
.field { display: block; margin-bottom: 12px; }
.field span { display: block; font-size: 14px; color: var(--muted); margin-bottom: 4px; }
input[type="text"], input[type="password"], input:not([type]), select {
  width: 100%; min-height: 50px; font-size: 16px; padding: 10px 12px;
  background: #151316; color: var(--ink); border: 1px solid var(--line); border-radius: 10px;
}
input:focus, select:focus, .btn:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.check { display: flex; align-items: center; gap: 10px; margin: 4px 0 14px; min-height: 44px; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.btn {
  width: 100%; min-height: 50px; font: 700 16px system-ui, sans-serif; border: 0; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); cursor: pointer;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.picked { margin: 0 0 12px; font-weight: 700; }
.msg { min-height: 1.4em; margin: 10px 0 0; font-size: 15px; }
.msg.err { color: var(--danger); }
.msg.ok { color: var(--ok); }

.foot { max-width: 1180px; margin: 0 auto; padding: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }

.host-box { max-width: 760px; margin: 24px auto; padding: 0 16px; }
.host-box h2 { margin: 24px 0 8px; font-size: 1.15rem; }
.host-row > div:last-child { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.host-row button:disabled { opacity: 0.5; cursor: not-allowed; }
.host-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.host-row button { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; }

.affiliate[hidden], .stream-box[hidden] { display: none; }
.affiliate { display: block; margin: 8px 0; padding: 12px 16px; border: 1px dashed var(--line); border-radius: 10px; color: var(--accent); text-align: center; }
.room { max-width: 1180px; margin: 0 auto; padding: 16px; }
.room-canvas { display: block; width: 100%; max-width: 520px; height: auto; margin: 0 auto; background: #141214; border: 1px solid var(--line); border-radius: 12px; }
.avatar-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 12px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; }
.avatar-pick legend { padding: 0 6px; color: var(--muted); font-size: 14px; }
.avatar-pick select { min-height: 44px; }
.host-row .num { width: 90px; min-height: 44px; }
.host-row select { min-height: 44px; max-width: 60%; }

@media (max-width: 860px) {
  .floor-grid, .stage-grid { grid-template-columns: minmax(0, 1fr); }
  .panel { position: static; }
}
.avatar-pick select[hidden] { display: none; }
.menu-extra { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14px; }
.menu-card details { font-size: 14px; }
.drinks-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.drinks-tabs .chip { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: inherit; cursor: pointer; font: inherit; font-size: 14px; }
.drinks-tabs .chip[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.drinks-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.drinks-items li { display: flex; justify-content: space-between; gap: 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.drinks-items li > div:first-child { display: flex; flex-direction: column; gap: 2px; }
.drinks-price { display: flex; flex-direction: column; align-items: flex-end; font-weight: 700; white-space: nowrap; color: var(--accent); }
html[data-room="3d"] .drinks { max-width: 1180px; margin: 0 auto; padding: 16px; }
.view-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.view-chips .chip { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: inherit; cursor: pointer; font: inherit; font-size: 14px; }
.view-chips .chip[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.collapse-btn { width: auto; align-self: flex-start;  padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: inherit; cursor: pointer; font: inherit; font-size: 13px; }
.collapsed > :not(.floor-head):not(h2):not(.collapse-btn) { display: none !important; }
.collapsed .floor-head > p { display: none; }
#chat-log .seats { border-left: 3px solid var(--accent); padding-left: 8px; }
.send #chat-scope { width: 100%; margin-bottom: 6px; }

/* ---- full-screen app shell (index.html, body.app): the room fills the screen, HUD floats over it, no page scroll ---- */
body.app { height: 100dvh; overflow: hidden; background: #0b0810; position: relative; }
body.app .stage-box { position: fixed; inset: 0; margin: 0; aspect-ratio: auto; border: 0; border-radius: 0; background: #0b0810; }
body.app .room3d, body.app .room3d canvas { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 0; }
body.app .room-canvas { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; border: 0; border-radius: 0; object-fit: contain; }
body.app .bursts { position: absolute; inset: 0; pointer-events: none; }
html[data-room="2d"] body.app .stage-box { display: block; }
body.app .hud { position: fixed; z-index: 5; pointer-events: none; }
body.app .hud > *, body.app .hud.card, body.app .hud .row { pointer-events: auto; }
body.app .card { background: rgba(20, 16, 28, 0.78); backdrop-filter: blur(8px); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 14px; padding: 12px 14px; }
body.app h1 { font-size: 1.05rem; }
body.app h2 { font-size: 0.95rem; }
body.app .row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
body.app .btn { border: 0; border-radius: 10px; padding: 8px 14px; font: inherit; font-size: 14px; cursor: pointer; text-decoration: none; color: var(--ink); background: rgba(255, 255, 255, 0.12); }
body.app .btn.pink { background: #ff4fc3; color: #fff; font-weight: 700; }
body.app .btn:disabled { opacity: 0.5; cursor: default; }
.saver { display: block; margin-top: 8px; }

.hud-tl { top: 12px; left: 12px; width: 280px; display: flex; flex-direction: column; gap: 10px; }
.hud-tl .affiliate { display: block; }
.hud-tl .stream-box { width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; }
.hud-tr { top: 12px; right: 12px; width: 230px; max-height: 32vh; overflow: auto; }
.roster-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.roster-list li { display: flex; align-items: center; gap: 8px; }
.roster-list .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; }
.roster-list .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.hud-bl { left: 12px; bottom: 12px; width: 320px; display: flex; flex-direction: column; gap: 6px; }
.hud-bl .chat-log { height: 150px; max-height: 24vh; overflow-y: auto; margin: 0; padding: 0; list-style: none; font-size: 13px; }
.hud-bl .send { display: flex; gap: 6px; flex-wrap: wrap; }
.hud-bl .send select { flex: 1 1 100%; }
.hud-bl .send input { flex: 1; min-width: 0; }
.hud-bl.collapsed .chat-log, .hud-bl.collapsed form, .hud-bl.collapsed #join-open, .hud-bl.collapsed .idle-bar { display: none !important; }
body:has(#join-form[hidden]) #join-open { display: none !important; }

.hud-bc { left: 50%; transform: translateX(-50%); bottom: 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.dock .emotes { display: flex; gap: 4px; padding: 6px 8px; background: rgba(20, 16, 28, 0.82); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 14px; pointer-events: auto; }
.dock .emotes button { display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: 0; color: var(--ink); font: inherit; font-size: 11px; cursor: pointer; padding: 4px 8px; }
.dock .emotes button span { font-size: 22px; }
.dock .view-chips { pointer-events: auto; background: rgba(20, 16, 28, 0.7); border-radius: 999px; padding: 4px; margin: 0; flex-wrap: nowrap; }
.dock .view-chips .chip { padding: 4px 10px; font-size: 12px; white-space: nowrap; }

.hud-br { right: 12px; bottom: 12px; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.pill.fb { pointer-events: auto; background: #1877f2; color: #fff; padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; text-decoration: none; }
.actions { display: flex; gap: 8px; pointer-events: auto; background: rgba(20, 16, 28, 0.78); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 14px; padding: 8px; }
.act { background: rgba(255, 255, 255, 0.08); border: 0; color: var(--ink); font: inherit; font-size: 14px; padding: 10px 14px; border-radius: 10px; cursor: pointer; white-space: nowrap; }
.act[aria-pressed="true"] { background: #ff4fc3; color: #fff; }

.sheet { position: fixed; z-index: 8; right: 12px; bottom: 112px; width: min(640px, calc(100vw - 24px)); max-height: calc(100dvh - 140px); overflow: auto; background: rgba(20, 16, 28, 0.94); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 16px; padding: 14px; }
.sheet[hidden] { display: none; }
.sheet > header { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.sheet > header h2 { font-size: 1.05rem; }
.sheet > header p { flex: 1; margin: 0; }
.sheet .x { background: none; border: 0; color: var(--ink); font-size: 18px; cursor: pointer; }
.sheet .floor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 14px; }
.sheet .map-wrap { min-width: 0; }
.order-cta { margin: 12px 0 0; }

.modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: rgba(5, 3, 10, 0.55); padding: 16px; }
.modal.closed, .modal:has(#join-form[hidden]) { display: none; }
.modal .join { width: min(380px, 100%); display: grid; gap: 10px; background: rgba(20, 16, 28, 0.96); }
.modal .join h2 { font-size: 1.2rem; }

@media (max-width: 800px) {
  .hud-tl { width: 190px; top: 8px; left: 8px; }
  .hud-tl .venue .row, .hud-tl .saver { display: none; }
  .hud-tr { width: 150px; top: 8px; right: 8px; max-height: 20vh; }
  .hud-bl { left: 8px; bottom: 96px; width: calc(100vw - 16px); max-width: 360px; }
  .hud-bl .chat-log { height: 90px; }
  .hud-bc { bottom: 52px; }
  .hud-br { right: 8px; bottom: 8px; left: 8px; align-items: stretch; }
  .hud-br .pill { display: none; }
  .actions { justify-content: space-between; }
  .act { flex: 1; padding: 10px 6px; font-size: 13px; }
  .sheet { right: 8px; left: 8px; width: auto; bottom: 64px; max-height: calc(100dvh - 80px); }
  .sheet .floor-grid { grid-template-columns: 1fr; }
}
body.app [hidden] { display: none !important; }
body.app .btn { width: auto; }
body.app .modal .join .btn { width: 100%; }
body.app .modal .join .row { display: grid; grid-template-columns: 1fr; }
.room-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.room-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid rgba(255,255,255,0.12); border-radius: 12px; }
.room-list li > div { display: flex; flex-direction: column; min-width: 0; }
.room-forms { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.room-forms .card { display: grid; gap: 8px; align-content: start; }
@media (max-width: 800px) { .room-forms { grid-template-columns: 1fr; } }

/* ---- lobby (first screen) ---- */
body.app { overscroll-behavior: none; }
.lobby { position: fixed; inset: 0; z-index: 4; overflow-y: auto; padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); background: radial-gradient(1200px 600px at 20% -10%, #2a1140 0%, #0b0810 60%); }
.lobby > * { max-width: 960px; margin-left: auto; margin-right: auto; }
.lobby-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.lobby .brand { font-size: 1.4rem; font-weight: 800; color: #ff4fc3; }
.lobby .brand b { color: #3fe0ff; }
.lobby-grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; align-items: start; }
.lobby-side { display: grid; gap: 16px; }
.lobby .card { background: rgba(20, 16, 28, 0.85); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 16px; padding: 16px; display: grid; gap: 10px; align-content: start; }
.lobby .card h2 { font-size: 1.05rem; margin: 0; }
.lobby .field { display: grid; gap: 4px; }
.lobby input, .lobby select { background: #120e1b; color: var(--ink); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 10px; padding: 10px 12px; font: inherit; }
.lobby .check { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.lobby .btn { border: 0; border-radius: 10px; padding: 10px 16px; font: inherit; cursor: pointer; color: #fff; background: rgba(255, 255, 255, 0.12); }
.lobby .btn.pink { background: #ff4fc3; font-weight: 700; }
.lobby .btn:disabled { opacity: 0.5; cursor: default; }
.join-row { display: flex; gap: 8px; }
.join-row input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: 0.15em; }
.lobby-rooms { max-height: calc(100dvh - 220px); min-height: 200px; }
.lobby-rooms .room-list { overflow-y: auto; margin: 0; padding-right: 4px; }
.lobby-foot { text-align: center; margin-top: 16px; display: flex; gap: 16px; justify-content: center; align-items: center; flex-wrap: wrap; }
.lobby .affiliate { display: block; margin-top: 16px; }
body.app.in-lobby #stage-box, body.app.in-lobby .hud, body.app.in-lobby .sheet { display: none !important; }
body.app:not(.in-lobby) .lobby { display: none; }
@media (max-width: 800px) { .lobby-grid { grid-template-columns: 1fr; } .lobby-rooms { max-height: none; } }
.room-list li.here { border-color: #ff4fc3; }
.jb-card { width: 230px; margin-top: 8px; }
.jb-video { position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #000; pointer-events: none; }
.jb-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; }
.jb-title { margin: 6px 0 0; font-size: 13px; font-weight: 600; line-height: 1.25; max-height: 2.5em; overflow: hidden; }
.jb-card .btn { padding: 6px 10px; font-size: 12px; }
.jb-form { display: flex; gap: 8px; }
.jb-form input { flex: 1; min-width: 0; background: #120e1b; color: var(--ink); border: 1px solid rgba(255,255,255,.14); border-radius: 10px; padding: 10px 12px; font: inherit; }
.jb-queue, .jb-hits { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.jb-queue li { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 14px; }
.jb-hits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.jb-hits .hit, .mini { width: 100%; text-align: left; background: rgba(255,255,255,.08); color: var(--ink); border: 0; border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 13px; cursor: pointer; }
.mini { width: auto; padding: 4px 8px; }
@media (max-width: 800px) { .jb-hits { grid-template-columns: 1fr; } .jb-card { width: 160px; } }

/* ===== v2: same palette and type as the main website (charcoal, ivory, citron; Barlow Condensed + DM Sans) ===== */
:root { --acid: #dfed91; --accent: #dfed91; --accent-ink: #1b191b; --bone: #d3c9b9; --display: 'Barlow Condensed', 'Arial Narrow', sans-serif; --line: #454044; }
body { font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif; }
h1, h2, h3, .lobby .brand { font-family: var(--display); letter-spacing: 0.01em; }
body.app h1 { font-size: 1.35rem; }
body.app h2 { font-size: 1.15rem; }
body.app .btn.pink, .lobby .btn.pink { background: var(--acid); color: #1b191b; font-weight: 700; }
body.app .btn.ghost { background: rgba(242, 237, 223, 0.1); }
.act[aria-pressed="true"] { background: var(--acid); color: #1b191b; }
.lobby { background: radial-gradient(1100px 600px at 15% -10%, #2d2b25 0%, #1b191b 62%); }
.lobby .brand { color: #f2eddf; font-size: 1.9rem; text-transform: uppercase; }
.lobby .brand b { color: var(--acid); }
.room-list li.here { border-color: var(--acid); }
body.app .card, .lobby .card { background: rgba(27, 25, 27, 0.84); border-color: rgba(242, 237, 223, 0.14); }
.fb-link { display: inline-block; margin-top: 8px; font-size: 13px; color: var(--bone); text-decoration: underline; text-underline-offset: 3px; }
.linkbtn { background: none; border: 0; color: var(--bone); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }
.lobby .pill.fb { background: rgba(242, 237, 223, 0.1); color: #f2eddf; border: 1px solid rgba(242, 237, 223, 0.25); }
.jb-card .btn { background: rgba(242, 237, 223, 0.12); }

/* panels open as a native dialog that always fits the screen: fixed header, the body scrolls inside */
body.app .sheet { top: 16px; left: 50%; right: auto; bottom: auto; transform: translateX(-50%); width: min(1000px, calc(100vw - 32px)); height: calc(100dvh - 116px); max-height: 780px;
  display: flex; flex-direction: column; overflow: hidden; padding: 0; border-radius: 18px; background: rgba(27, 25, 27, 0.97); border: 1px solid var(--line); box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6); }
body.app .sheet[hidden] { display: none; }
body.app .sheet > header { flex: none; margin: 0; padding: 16px 20px 12px; border-bottom: 1px solid var(--line); }
body.app .sheet > :not(header) { margin-left: 20px; margin-right: 20px; }
body.app .sheet > .msg, body.app .sheet > .legend { flex: none; }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 0 18px; }
.sheet > .menu-list, .sheet > .drinks-list { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 0 18px; }
.sheet > .drinks-tabs { flex: none; overflow-x: auto; flex-wrap: nowrap; padding: 12px 0 4px; }
.sheet > .drinks-tabs .chip { white-space: nowrap; }
.sheet > .order-cta { flex: none; margin-top: 0; margin-bottom: 14px; text-align: center; }
.sheet > .order-cta .btn { display: inline-block; background: var(--acid); color: #1b191b; font-weight: 700; padding: 10px 18px; border-radius: 10px; text-decoration: none; }

/* table picking: the map fits the panel, the form sits beside it (stacked on phones) */
body.app .sheet[data-sheet="floor"] .floor-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 16px; align-items: stretch; margin-bottom: 16px; }
body.app .sheet[data-sheet="floor"] .map-wrap { min-height: 0; overflow: hidden; display: grid; place-items: center; }
body.app .sheet[data-sheet="floor"] #map { min-width: 0; width: 100%; height: 100%; max-height: 100%; }
body.app .sheet[data-sheet="floor"] .panel { position: static; min-height: 0; overflow-y: auto; }
.sheet .legend { margin: 10px 20px 8px; font-size: 13px; gap: 6px 14px; }

/* offers: ticket cards; drinks: small line art */
.menu-list { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.menu-card { background: linear-gradient(160deg, #2a2729, #201e21); border-style: dashed; border-color: rgba(223, 237, 145, 0.35); }
.menu-card .ticket-top { display: flex; align-items: center; gap: 10px; }
.menu-card .ticket-top h3 { font-size: 1.35rem; line-height: 1; }
.menu-card .price { font-family: var(--display); font-size: 2.2rem; line-height: 1; }
.art { display: inline-grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 12px; background: rgba(223, 237, 145, 0.1); color: var(--acid); }
.drinks-items li { align-items: center; gap: 12px; }
.drinks-items li > div:nth-child(2) { flex: 1; }
.drinks-tabs .chip[aria-pressed="true"] { background: rgba(223, 237, 145, 0.12); }

/* jukebox panel */
.jb-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.jb-hits { grid-template-columns: 1fr; }

/* rules dialog */
.modal .rules { width: min(560px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; padding: 0; background: rgba(27, 25, 27, 0.98); overflow: hidden; }
.rules > header { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.rules > header h2 { margin: 0; }
.rules .x { background: none; border: 0; color: var(--ink); font-size: 18px; cursor: pointer; }
.rules-body { overflow-y: auto; padding: 8px 18px 18px; }
.rules-body h3 { margin: 14px 0 4px; font-size: 1.1rem; color: var(--acid); }
.rules-body p { margin: 0; color: var(--ink); }
.rules-body a { color: var(--acid); }

@media (max-width: 800px) {
  body.app .sheet { top: 8px; left: 8px; right: 8px; bottom: 64px; transform: none; width: auto; height: auto; max-height: none; border-radius: 16px; }
  body.app .sheet[data-sheet="floor"] .floor-grid { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) minmax(0, 46%); }
  .jb-grid { grid-template-columns: 1fr; }
}

/* ordering section: one entry in the action bar, three tabs inside */
.order-tabs { flex: none; display: flex; gap: 8px; padding: 10px 20px 0; margin: 0 !important; }
.order-tabs button { border: 1px solid var(--line); background: rgba(242, 237, 223, 0.06); color: var(--ink); font: 700 14px 'DM Sans', sans-serif; padding: 8px 16px; border-radius: 999px; cursor: pointer; }
.order-tabs button[aria-pressed="true"] { background: var(--acid); border-color: var(--acid); color: #1b191b; }
.act.order { background: var(--acid); color: #1b191b; font-weight: 700; }

/* logo in the lobby header */
.lobby .brand { display: inline-flex; align-items: center; gap: 10px; }
.lobby .brand .logo { width: 36px; height: 36px; border-radius: 9px; }

/* character picker: live preview, character tiles, colour swatches, accessory tiles */
.avatar-pick { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; align-items: start; padding: 0; border: 0; margin: 0 0 8px; }
.av-preview { width: 150px; height: 190px; border-radius: 14px; background: radial-gradient(circle at 50% 35%, #3a3636, #1b191b 75%); border: 1px solid var(--line); }
.av-controls { display: grid; gap: 10px; min-width: 0; }
.av-group > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.08em; }
.av-tiles { display: flex; flex-wrap: wrap; gap: 6px; }
.av-tiles .tile { display: grid; justify-items: center; gap: 1px; min-width: 56px; padding: 6px 6px 4px; border-radius: 10px; border: 1px solid var(--line); background: rgba(242, 237, 223, 0.06); color: var(--ink); font: 500 11px 'DM Sans', sans-serif; cursor: pointer; }
.av-tiles .tile i { font-style: normal; font-size: 20px; line-height: 1.1; }
.av-tiles .tile[aria-checked="true"], .av-swatches .swatch[aria-checked="true"] { border-color: var(--acid); box-shadow: 0 0 0 2px var(--acid); }
.av-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.av-swatches .swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; padding: 0; }
.modal .join { width: min(520px, 100%); max-height: calc(100dvh - 24px); overflow-y: auto; }
@media (max-width: 520px) { .avatar-pick { grid-template-columns: 1fr; } .av-preview { width: 100%; height: 170px; } }

/* Facebook link: Facebook blue with the icon */
.pill.fb, .lobby .pill.fb { display: inline-flex; align-items: center; gap: 8px; background: #1877f2; color: #fff; border: 0; padding: 8px 14px; border-radius: 999px; font: 700 13px 'DM Sans', sans-serif; text-decoration: none; }
.pill.fb:hover { background: #2f88ff; }
.pill.fb .fb-ico { flex: none; }
.hud-tl .pill.fb { margin-top: 8px; }

/* song lists with YouTube thumbnails */
.jb-hits h4 { margin: 14px 0 6px; font: 700 1rem var(--display); color: var(--acid); letter-spacing: 0.02em; }
.jb-hits h4:first-child { margin-top: 0; }
.hit-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.jb-hits .hit { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 10px 6px 6px; text-align: left; background: rgba(242, 237, 223, 0.07); border: 0; border-radius: 10px; color: var(--ink); font: 500 13px 'DM Sans', sans-serif; cursor: pointer; }
.jb-hits .hit:hover { background: rgba(223, 237, 145, 0.14); }
.jb-hits .hit span { flex: 1; min-width: 0; }
.jb-hits .hit i { font-style: normal; font-size: 20px; color: var(--acid); }
.thumb { flex: none; width: 96px; height: 54px; object-fit: cover; border-radius: 6px; background: #000; }
.jb-queue .q-row { display: flex; align-items: center; gap: 10px; }
.jb-queue .q-info { flex: 1; min-width: 0; font-size: 14px; }
.jb-hits.jb-hits { display: block; }
.jb-grid > div:nth-child(2) { min-height: 0; }

/* the video plays on the club's big screen; the card keeps the title and controls */
html[data-room="3d"] .jb-video { display: none; }
html:not([data-room="3d"]) #jb-thumb { display: none; }
.thumb.big { width: 100%; height: auto; aspect-ratio: 16 / 9; }
body.app .room3d { overflow: hidden; }

/* v3 HUD: slim cards on the left, chat as a translucent panel at the bottom like a karaoke room, Facebook above the action bar */
.hud-tl { width: 250px; gap: 8px; }
.hud-tl .venue { padding: 10px 12px; }
.hud-tl .venue h1 { font-size: 1.05rem; margin: 0; }
.hud-tl .venue .row { margin-top: 6px; }
.hud-tl .jb-card { display: grid; grid-template-columns: 64px 1fr; column-gap: 10px; align-items: center; padding: 8px 10px; }
.hud-tl .jb-card #jb-thumb { grid-row: 1 / 4; width: 64px; height: 36px; border-radius: 6px; object-fit: cover; display: block !important; }
.hud-tl .jb-card .jb-title { margin: 0; font-size: 13px; line-height: 1.25; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hud-tl .jb-card .row { grid-column: 1 / -1; margin-top: 6px; }
.hud-tl .jb-card .btn { padding: 5px 10px; font-size: 12px; }
.hud-bl { width: 340px; background: rgba(14, 12, 16, 0.55); backdrop-filter: blur(8px); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 14px; padding: 8px 10px 10px; gap: 6px; }
.hud-bl .chat-head { display: flex; align-items: baseline; gap: 8px; }
.hud-bl .chat-head h2 { font-size: 13px; font-weight: 700; margin: 0; letter-spacing: 0.02em; }
.hud-bl .chat-head .muted { flex: 1; font-size: 11px; }
.hud-bl .chat-log { height: 190px; max-height: 30vh; border: 0; background: transparent; padding: 0 2px 0 0; font-size: 13.5px; line-height: 1.35; scroll-behavior: smooth; mask-image: linear-gradient(to bottom, transparent 0, #000 14px); display: flex; flex-direction: column; }
.hud-bl .chat-log li { margin: 0 0 4px; padding: 3px 8px; border-radius: 10px; background: rgba(255, 255, 255, 0.07); align-self: flex-start; max-width: 92%; }
.hud-bl .chat-log li.me { align-self: flex-end; background: rgba(223, 237, 145, 0.18); }
.hud-bl .chat-log li.host { background: rgba(223, 237, 145, 0.12); border-left: 0; outline: 1px solid rgba(223, 237, 145, 0.35); }
.hud-bl .chat-log li.sys { background: none; align-self: center; font-size: 12px; padding: 1px 4px; }
.hud-bl .chat-log li.seats { border-left: 0; outline: 1px dashed rgba(255, 255, 255, 0.3); }
.hud-bl .send { flex-wrap: nowrap; align-items: stretch; }
.hud-bl .send select { flex: 0 0 auto; width: auto; max-width: 96px; font-size: 12px; padding: 0 6px; border-radius: 10px; }
.hud-bl .send input { border-radius: 10px; padding: 9px 12px; font-size: 14px; background: rgba(0, 0, 0, 0.45); border: 1px solid rgba(255, 255, 255, 0.14); color: inherit; }
.hud-bl .send input:focus { outline: 2px solid #dfed91; outline-offset: 0; }
.hud-bl .send .send-btn { padding: 0 14px; border-radius: 10px; background: #dfed91; color: #1b191b; }
.hud-br .pill.fb { align-self: flex-end; }
@media (max-width: 800px) {
  .hud-tl { width: 190px; }
  .hud-tl .jb-card { grid-template-columns: 48px 1fr; }
  .hud-tl .jb-card #jb-thumb { width: 48px; height: 27px; }
  .hud-bl { width: calc(100vw - 16px); max-width: 360px; }
  .hud-bl .chat-log { height: 96px; }
}

/* collapsed chat: a small "Trò chuyện" pill at the bottom left; one click opens it again */
.hud-bl.collapsed { width: auto; padding: 0; gap: 0; background: rgba(20, 16, 28, 0.88); border-radius: 12px; }
body .hud-bl.collapsed > .chat-head.chat-head.chat-head { display: flex !important; position: relative; padding: 10px 14px; }
.hud-bl.collapsed .chat-head h2::before { content: "💬 "; }
.hud-bl.collapsed #chat-status { display: none; }
.hud-bl.collapsed .collapse-btn { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }

/* song picker: a compact popup on the right, above the action bar, like a karaoke room's song list */
@media (min-width: 801px) {
  body.app .sheet[data-sheet="jukebox"] { top: auto; left: auto; right: 12px; bottom: 76px; transform: none; width: 380px; height: auto; max-height: min(560px, calc(100dvh - 180px)); border-radius: 14px; }
  body.app .sheet[data-sheet="jukebox"] .jb-grid { grid-template-columns: 1fr; gap: 12px; }
  body.app .sheet[data-sheet="jukebox"] > header { padding: 12px 14px 8px; }
  body.app .sheet[data-sheet="jukebox"] .sheet-body { padding: 10px 14px 14px; overflow-y: auto; }
  body.app .sheet[data-sheet="jukebox"] .thumb { width: 72px; height: 40px; }
  body.app .sheet[data-sheet="jukebox"] .jb-hits .hit { font-size: 12.5px; padding: 4px 8px 4px 4px; }
}

/* menu rows: name and what is included stack instead of running together */
.drinks-items li > div:nth-child(2) { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.drinks-items li > div:nth-child(2) strong { font-size: 14px; line-height: 1.25; }
.drinks-items li > div:nth-child(2) .muted { font-size: 12px; line-height: 1.35; }
.drinks-items .art.scene { flex: none; display: grid; place-items: center; width: 64px; }
.drinks-items .mini { align-self: center; background: #dfed91; color: #1b191b; font-weight: 700; padding: 6px 12px; }
.drinks-items .drinks-price { align-self: center; }

/* ordering and table windows: small popups on the right like the song picker */
@media (min-width: 801px) {
  body.app .sheet[data-sheet="floor"], body.app .sheet[data-sheet="offers"], body.app .sheet[data-sheet="drinks"] { top: auto; left: auto; right: 12px; bottom: 76px; transform: none; width: 440px; height: auto; max-height: min(620px, calc(100dvh - 180px)); border-radius: 14px; }
  body.app .sheet[data-sheet="floor"] .floor-grid { grid-template-columns: 1fr; gap: 10px; }
  body.app .sheet[data-sheet="floor"] .map-wrap { max-height: 230px; }
  body.app .sheet[data-sheet="floor"] .panel { overflow: visible; }
  body.app .sheet > header { padding: 12px 14px 8px; flex-wrap: wrap; }
  body.app .sheet > header p { font-size: 12px; flex-basis: 100%; order: 3; margin: 2px 0 0; }
  body.app .sheet .order-tabs { padding: 8px 14px 0; }
  body.app .sheet .drinks-tabs { padding: 8px 14px; overflow-x: auto; flex-wrap: nowrap; }
  body.app .sheet > .menu-list, body.app .sheet > .drinks-list { padding: 8px 14px 14px; }
  body.app .sheet > .order-cta { padding: 0 14px 12px; }
  body.app .sheet[data-sheet="floor"] .floor-grid { padding: 8px 14px 0; margin-bottom: 8px; overflow-y: auto; }
}

/* chat: header on one line with a small collapse button, input and send button the same height */
.hud-bl .chat-head { display: flex; align-items: center; gap: 8px; }
.hud-bl .chat-head .collapse-btn { order: 3; margin-left: auto; align-self: center; padding: 2px 8px; font-size: 11px; border-radius: 999px; }
.hud-bl .chat-head .muted { order: 2; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud-bl .send { align-items: stretch; }
.hud-bl .send input, .hud-bl .send .send-btn, .hud-bl .send select { height: 40px; box-sizing: border-box; }
.hud-bl .send .send-btn { display: grid; place-items: center; padding: 0 16px; }
.hud-bl .chat-log li { word-break: break-word; }

/* song picker: denser rows, one-line titles, small thumbnails */
.jb-hits .hit { padding: 4px 8px 4px 4px; gap: 8px; font-size: 12.5px; }
.jb-hits .hit span { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; line-height: 1.3; }
.jb-hits .hit .thumb { width: 64px; height: 36px; flex: none; border-radius: 6px; object-fit: cover; }
.hit-list { gap: 3px; }
.jb-hits h4 { margin: 10px 0 4px; font-size: .9rem; }
.jb-queue .q-info { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jb-queue .thumb { width: 64px; height: 36px; flex: none; border-radius: 6px; object-fit: cover; }
.jb-queue { gap: 4px; }
