:root {
  --bg: #0b0d10;
  --panel: #12161b;
  --panel2: #171c22;
  --line: #232a32;
  --text: #e8edf2;
  --muted: #8d99a6;
  --green: #0ac18e;
  --green2: #08a77b;
  --warn: #f5a524;
  --bad: #ef5350;
  --radius: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--green); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }

/* BLAZE banner */
.blaze { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; justify-content: center; padding: 8px 14px; background: linear-gradient(90deg, #1d0e0a, #2a120b 50%, #1d0e0a); border-bottom: 1px solid #3a1a10; font-size: 13px; }
.blaze b { color: #ff7a45; letter-spacing: .02em; }
.blaze a { color: #ffd2bf; text-decoration: none; border-bottom: 1px dotted #ffb08f; }
.blaze code { background: #2b1610; padding: 2px 6px; border-radius: 6px; color: #ffd2bf; font-size: 12px; word-break: break-all; }
.blaze .copy { background: none; border: 1px solid #5a2a1a; border-radius: 6px; padding: 1px 8px; color: #ffd2bf; font-size: 12px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 10px; padding: 10px 16px; background: var(--green); color: #04140e; font-weight: 650; text-decoration: none; }
.btn:hover { background: var(--green2); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: #3a4652; background: var(--panel2); }
.btn:disabled { opacity: .55; cursor: default; }

/* ---------- landing ---------- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.nav { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; }
.logo { font-weight: 800; font-size: 20px; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.logo i { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--green); color: #04140e; font-style: normal; font-size: 17px; }
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; padding: 40px 0 30px; }
.hero h1 { font-size: 48px; line-height: 1.05; margin: 0 0 16px; letter-spacing: -.02em; }
.hero h1 em { color: var(--green); font-style: normal; }
.hero p.lead { color: var(--muted); font-size: 18px; margin: 0 0 24px; }
.cta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.joinCode { display: flex; gap: 6px; }
.joinCode input { width: 130px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; text-transform: uppercase; }
.mock { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 14px; box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.mock .screen { aspect-ratio: 16/9; border-radius: 10px; background: radial-gradient(circle at 30% 30%, #1f3b31, #0b1512 70%); display: grid; place-items: center; font-size: 46px; position: relative; overflow: hidden; }
.mock .bubble { position: absolute; right: 10px; bottom: 10px; background: rgba(10,193,142,.15); border: 1px solid rgba(10,193,142,.5); color: #b8f5df; padding: 6px 10px; border-radius: 10px; font-size: 13px; }
.mock .row { display: flex; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.mock .row span { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 26px 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card h3 { margin: 4px 0 6px; font-size: 16px; }
.card p { margin: 0; color: var(--muted); font-size: 14px; }
.card .n { color: var(--green); font-weight: 800; font-size: 13px; }
.section { padding: 20px 0 10px; }
.section h2 { font-size: 24px; margin: 0 0 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.foot { color: var(--muted); font-size: 13px; padding: 30px 0 40px; border-top: 1px solid var(--line); margin-top: 30px; }

/* ---------- room ---------- */
.room { display: grid; grid-template-columns: minmax(0, 1fr) 360px; height: calc(100vh - 38px); }
/* Desktop: banner + top bar + room fill exactly one screen, so the chat box
   stays visible whatever the banner height and when the video picker opens. */
@media (min-width: 901px) {
  body:has(> .room) { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
  body:has(> .room) > .blaze, body:has(> .room) > .topbar { flex: none; }
  body:has(> .room) > .room { flex: 1; min-height: 0; height: auto; }
  .room > .main, .room > .side { min-height: 0; overflow: hidden; }
  .room #tipCard { flex: none; overflow-y: auto; max-height: 55%; }
  #picker { flex: none; }
  .under { flex: none; }
}
.topbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }
.topbar .logo { font-size: 16px; }
.topbar .logo i { width: 24px; height: 24px; font-size: 14px; border-radius: 7px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.pill b { color: var(--text); letter-spacing: .08em; }
#conn[data-s="on"]::before, #chainStatus[data-s="connected"]::before { background: var(--green); }
#conn::before, #chainStatus::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); display: inline-block; }
.spacer { flex: 1; }
#walletBtn[data-s="on"] { border-color: rgba(10,193,142,.6); color: #b8f5df; }
.main { display: flex; flex-direction: column; min-width: 0; }
#stage { position: relative; background: #000; flex: 1; min-height: 0; display: grid; place-items: center; overflow: hidden; }
#video { width: 100%; height: 100%; max-height: 100%; background: #000; }
#video[hidden], #yt[hidden] { display: none; }
#yt { position: absolute; inset: 0; }
#yt iframe, #yt .embed-fill, #yt video { width: 100%; height: 100%; border: 0; display: block; background: #000; }
.float { position: absolute; bottom: 70px; font-size: 34px; animation: up 2.6s ease-out forwards; pointer-events: none; }
@keyframes up { from { transform: translateY(0) scale(.8); opacity: 1; } to { transform: translateY(-260px) scale(1.4); opacity: 0; } }
#blocked { position: absolute; inset: 0; display: none; place-items: center; background: rgba(0,0,0,.6); border: 0; color: #fff; font-size: 18px; }
#blocked.show { display: grid; }
.under { display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }
.under .title { font-weight: 650; margin-right: auto; }
.react { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 4px 8px; font-size: 18px; }
#picker { display: none; padding: 12px 14px; border-top: 1px solid var(--line); background: var(--panel2); }
#picker.open { display: block; }
#samples { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 10px; }
#samples button { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
#urlForm { display: flex; gap: 8px; }
#urlForm input, #payoutForm input, #customTip, #chatInput { flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; }
.credit { color: var(--muted); font-size: 12px; margin-top: 8px; }

.side { border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: var(--panel); }
#tipCard { margin: 12px; padding: 14px; border-radius: var(--radius); background: linear-gradient(160deg, rgba(10,193,142,.14), rgba(10,193,142,.03)); border: 1px solid rgba(10,193,142,.35); }
#tipCard h3 { margin: 0 0 2px; font-size: 15px; }
#tipCard .sub { color: var(--muted); font-size: 12.5px; }
#tipCard .total { font-size: 13px; color: var(--muted); margin: 8px 0; }
#tipCard .total b { color: var(--text); font-size: 15px; }
#presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 8px 0; }
#presets button { background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 7px 4px; font-size: 12.5px; line-height: 1.25; }
#presets button.on { border-color: var(--green); color: #b8f5df; }
.usd { color: var(--muted); font-size: 12px; }
#tipCard .row { display: flex; gap: 6px; }
#tipBtn { width: 100%; margin-top: 8px; }
#tipCard.off #tipBtn, #tipCard.off #presets, #tipCard.off .row.amount { display: none; }
#tipCard .offnote { display: none; color: var(--muted); font-size: 13px; margin-top: 6px; }
#tipCard.off .offnote { display: block; }
.hostOnly { display: none; margin-top: 10px; padding-top: 10px; border-top: 1px dashed rgba(10,193,142,.35); }
body.is-owner .hostOnly { display: block; }
#payoutForm { display: flex; gap: 6px; margin-top: 6px; }
.small { font-size: 12.5px; color: var(--muted); }
.linkbtn { background: none; border: 0; color: var(--green); padding: 0; text-decoration: underline; font-size: 12.5px; }

.chat { display: flex; flex-direction: column; flex: 1; min-height: 0; border-top: 1px solid var(--line); }
.chat h4 { margin: 10px 14px 4px; font-size: 13px; color: var(--muted); font-weight: 600; display: flex; justify-content: space-between; }
#members { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 14px 6px; }
.who { font-size: 12px; background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; color: var(--muted); }
.who.host { color: #b8f5df; border-color: rgba(10,193,142,.45); }
#chatList { flex: 1; overflow-y: auto; padding: 6px 12px; display: flex; flex-direction: column; gap: 8px; }
.msg { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 7px 10px; }
.msg.mine { border-color: #2c3a46; background: #18222b; }
.msg .meta { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: baseline; }
.msg .meta b { color: var(--text); }
.msg .text { white-space: pre-wrap; word-break: break-word; }
.del { margin-left: auto; background: none; border: 0; color: var(--muted); font-size: 11px; }
.msg.tip { background: rgba(10,193,142,.1); border-color: rgba(10,193,142,.45); }
.tipmeta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.verify[data-s="ok"] { color: var(--green); }
.verify[data-s="bad"] { color: var(--warn); }
#chatForm { display: flex; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--line); }

/* modals */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.62); display: none; place-items: center; z-index: 50; padding: 16px; }
.modal.open { display: grid; }
.sheet { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 20px; position: relative; max-height: 92vh; overflow: auto; }
.sheet h3 { margin: 0 0 4px; }
.sheet .x { position: absolute; top: 10px; right: 12px; background: none; border: 0; font-size: 22px; color: var(--muted); }
.qr { background: #fff; border-radius: 12px; padding: 10px; margin: 12px auto; width: 250px; }
.qr svg { display: block; width: 100%; height: auto; }
.status { margin-top: 10px; font-size: 14px; padding: 8px 10px; border-radius: 10px; background: var(--panel2); }
.status[data-s="ok"] { color: #b8f5df; border: 1px solid rgba(10,193,142,.5); }
.status[data-s="bad"] { color: #ffd59e; border: 1px solid rgba(245,165,36,.5); }
.addr { font: 12px ui-monospace, Menlo, Consolas, monospace; word-break: break-all; color: var(--muted); }
.or { text-align: center; color: var(--muted); font-size: 12px; margin: 10px 0; }
.wide { width: 100%; }
#wcUri { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 7px; font: 11px ui-monospace, monospace; color: var(--muted); }

#join .sheet { text-align: center; }
#joinForm { display: flex; gap: 8px; margin-top: 14px; }
#nameInput { flex: 1; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }

#toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(20px); background: #1d252d; border: 1px solid var(--line); padding: 9px 14px; border-radius: 10px; opacity: 0; transition: .25s; pointer-events: none; z-index: 60; max-width: 90vw; }
#toast.show { opacity: 1; transform: translateX(-50%); }

/* deck */
.deck { max-width: 980px; margin: 0 auto; padding: 24px 20px 60px; display: grid; gap: 22px; }
.slide { aspect-ratio: 16/9; background: radial-gradient(circle at 80% 10%, rgba(10,193,142,.18), transparent 50%), var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 44px 54px; display: flex; flex-direction: column; justify-content: center; position: relative; }
.slide .num { position: absolute; top: 16px; right: 22px; color: var(--muted); font-size: 13px; }
.slide h1 { font-size: 54px; margin: 0; letter-spacing: -.02em; }
.slide h2 { font-size: 34px; margin: 0 0 18px; }
.slide p, .slide li { font-size: 20px; color: #c9d3dc; }
.slide ul { margin: 0; padding-left: 22px; display: grid; gap: 6px; }
.slide .tag { color: var(--green); font-weight: 700; font-size: 16px; letter-spacing: .05em; text-transform: uppercase; margin-bottom: 8px; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero h1 { font-size: 36px; }
  .steps, .grid2 { grid-template-columns: 1fr; }
  .room { grid-template-columns: 1fr; height: auto; }
  #stage { aspect-ratio: 16/9; flex: none; }
  .side { border-left: 0; border-top: 1px solid var(--line); }
  #chatList { max-height: 50vh; min-height: 220px; }
  .slide { padding: 24px; }
  .slide h1 { font-size: 32px; }
  .slide h2 { font-size: 24px; }
  .slide p, .slide li { font-size: 15px; }
}
