@font-face { font-family: "Bricolage"; src: url("../fonts/bricolage.woff2") format("woff2"); font-weight: 500 800; font-display: swap; }
:root {
  color-scheme: dark;
  --ink-0: #0c0812; --ink-1: #140e1e; --ink-2: #1c1429; --ink-3: #281d39; --ink-4: #34274a;
  --line: rgba(205, 180, 255, 0.11);
  --text: #f4effc; --text-2: #c0b5d6; --text-3: #9a8fb2;
  --grad: linear-gradient(135deg, #8b5cf6 0%, #d946ef 55%, #ec4899 100%);
  --focus: #c9a6ff; --live: #34d399; --warn: #fbbf24; --danger: #f43f5e;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --display: "Bricolage", ui-sans-serif, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 400 15px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--ink-0); color: var(--text); -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(139, 92, 246, 0.55); color: #fff; }
a { color: #dcc8ff; text-underline-offset: 3px; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; -webkit-tap-highlight-color: transparent; }
button:disabled { opacity: 0.45; cursor: default; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.hidden { display: none !important; }
input {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 12px;
  background: var(--ink-2); border: 1px solid var(--line); outline: none;
  font-size: 16px; /* no iOS zoom */
}
input::placeholder { color: var(--text-3); }
input:focus { border-color: rgba(201, 166, 255, 0.55); }
label { display: block; font-size: 13px; font-weight: 600; color: var(--text-3); margin-bottom: 8px; }
.mark { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--grad); flex: none; box-shadow: 0 8px 18px -8px rgba(217, 70, 239, 0.8); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 22px; border-radius: 13px; background: var(--grad); color: #fff; font: 700 16px/1 var(--display); transition: filter 0.15s, transform 0.15s var(--ease); }
.btn:hover:not(:disabled) { filter: brightness(1.08); }
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn.ghost { background: var(--ink-3); }
.btn.small { height: 44px; padding: 0 16px; font-size: 15px; }
.err { margin: 10px 0 0; color: #fda4b4; font-size: 14px; }
.fine { color: var(--text-3); font-size: 13px; }
.row { display: flex; gap: 8px; }
.faces { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; margin-top: 12px; }
.faces button { aspect-ratio: 1; padding: 0; border-radius: 50%; border: 2px solid transparent; transition: transform 0.15s var(--ease); }
.faces button:hover { transform: scale(1.08); }
.faces button.on { border-color: var(--focus); }
.wp-face { display: block; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; }
.wp-face svg { width: 100%; height: 100%; display: block; }

/* ---------- landing ---------- */
.landing {
  min-height: 100%;
  background: radial-gradient(900px 600px at 85% -10%, rgba(139, 92, 246, 0.25), transparent 60%), radial-gradient(700px 500px at -10% 40%, rgba(236, 72, 153, 0.12), transparent 60%), var(--ink-0);
}
.top { width: min(560px, 100% - 32px); margin: 0 auto; padding: 20px 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 700 18px/1 var(--display); color: var(--text); text-decoration: none; }
.tag { padding: 3px 7px; border-radius: 6px; background: var(--ink-3); font-size: 12px; color: #f9a8d4; }
.hero { width: min(560px, 100% - 32px); margin: 0 auto; padding: 24px 0 48px; }
.hero h1 { font: 800 clamp(36px, 8vw, 54px)/1 var(--display); letter-spacing: -0.035em; margin: 0 0 14px; text-wrap: balance; }
.hero h1 em { font-style: normal; color: #f9a8d4; }
.lead { color: var(--text-2); font-size: 17px; margin: 0 0 26px; }
.card { padding: 18px; border-radius: 18px; background: var(--ink-1); border: 1px solid var(--line); margin-bottom: 12px; }
.card .btn { width: 100%; margin-top: 14px; }
.card.join .btn { width: auto; margin: 0; }

/* ---------- room ---------- */
.room { position: fixed; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr) 360px; }
.stage { position: relative; background: #000; display: grid; place-items: center; min-height: 0; }
.player-box { position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: 100%; }
#player-yt, #player-yt iframe, #player-video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.player-msg { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--text-2); background: radial-gradient(circle at 50% 40%, #241634, #000); }
.player-msg b { color: var(--text); }
.tap-sync { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 10px; padding: 14px 22px; border-radius: 999px; background: var(--grad); color: #fff; font: 700 16px/1 var(--display); box-shadow: 0 16px 40px -12px rgba(217, 70, 239, 0.9); z-index: 3; }
.fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 4; }

.panel { display: flex; flex-direction: column; min-height: 0; background: var(--ink-1); border-left: 1px solid var(--line); }
.head { display: flex; align-items: center; gap: 8px; padding: 12px 10px 12px 14px; border-bottom: 1px solid var(--line); }
.brand-col { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.title { font-weight: 650; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conn { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-3); }
.conn i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.conn[data-state="live"] { color: #a7e9cf; }
.conn[data-state="live"] i { background: var(--live); box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18); }
.conn[data-state="connecting"] i, .conn[data-state="reconnecting"] i { background: var(--warn); animation: blink 1.1s ease-in-out infinite; }
.code { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 9px 0 11px; border-radius: 9px; background: var(--ink-3); font-weight: 700; font-size: 13px; letter-spacing: 0.06em; font-variant-numeric: tabular-nums; color: var(--text); }
.code.copied { background: rgba(52, 211, 153, 0.2); }
.icon-btn { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: var(--text-2); }
.icon-btn:hover, .icon-btn[aria-expanded="true"] { background: var(--ink-3); color: var(--text); }
.banner { margin: 10px 12px 0; padding: 8px 12px; border-radius: 10px; font-size: 13px; background: rgba(251, 191, 36, 0.12); color: #fde3a7; }
.banner[data-kind="ok"] { background: rgba(52, 211, 153, 0.13); color: #b5f0d9; }

.more { padding: 4px 14px 14px; border-bottom: 1px solid var(--line); background: var(--ink-0); max-height: 60%; overflow-y: auto; }
.sec { padding-top: 12px; }
.sec-title { font-size: 12px; font-weight: 650; color: var(--text-3); margin-bottom: 8px; }
.queen-ask { margin-top: 12px; width: 100%; height: 40px; border-radius: 11px; color: #fde7b0; border: 1px solid rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.08); font-weight: 600; }
.queen { margin-top: 12px; padding: 16px 14px 12px; border-radius: 14px; text-align: center; background: linear-gradient(160deg, rgba(251, 191, 36, 0.16), rgba(236, 72, 153, 0.16)); border: 1px solid rgba(251, 191, 36, 0.38); }
.queen-crown { font-size: 34px; line-height: 1; animation: bob 2.4s ease-in-out infinite; }
.queen-title { margin-top: 6px; font-weight: 700; color: #fde7b0; }
.queen p { margin: 4px 0 12px; font-size: 13px; color: var(--text-2); }
.queen button { display: block; width: 100%; padding: 10px; border-radius: 10px; font-weight: 650; }
#queen-yes { background: linear-gradient(135deg, #fbbf24, #f472b6); color: #2a1030; margin-bottom: 4px; }
#queen-no { color: var(--text-3); }
.leave { width: 100%; margin-top: 14px; padding: 10px; border-radius: 11px; color: #fda4b4; border: 1px solid rgba(244, 63, 94, 0.3); font-weight: 600; }
.leave:hover { background: rgba(244, 63, 94, 0.12); }
.more .fine { margin: 12px 0 0; text-align: center; }

.people { display: flex; gap: 6px; padding: 10px 14px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); flex: none; }
.people::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 30px; padding: 0 11px 0 3px; border-radius: 999px; background: var(--ink-2); font-size: 13px; color: var(--text-2); white-space: nowrap; }
.chip .wp-face { width: 24px; height: 24px; }
.chip.me { background: var(--ink-3); color: var(--text); }
.chip.me::after { content: "you"; font-size: 11px; color: var(--text-3); }
.crown { font-size: 12px; line-height: 1; }

.chat { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--ink-4) transparent; }
.msg { display: flex; gap: 8px; align-items: flex-end; max-width: 100%; }
.msg > .wp-face { width: 28px; height: 28px; flex: none; }
.msg > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.meta { display: flex; align-items: baseline; gap: 6px; padding: 0 4px; font-size: 11.5px; color: var(--text-3); }
.meta b { font-weight: 650; color: var(--text-2); }
.meta time { font-size: 11px; font-variant-numeric: tabular-nums; }
.bubble { padding: 7px 11px; border-radius: 14px 14px 14px 5px; background: var(--ink-3); overflow-wrap: anywhere; white-space: pre-wrap; }
.msg.mine { flex-direction: row-reverse; }
.msg.mine > div { align-items: flex-end; }
.msg.mine .meta { flex-direction: row-reverse; }
.msg.mine > .wp-face { display: none; }
.msg.mine .bubble { border-radius: 14px 14px 5px 14px; background: linear-gradient(135deg, #6d3fe0, #b8329a); color: #fff; }
.msg.royal:not(.mine) .bubble:not(.jumbo) { box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.4); }
.msg.royal.mine .bubble:not(.jumbo) { background: linear-gradient(135deg, #7c3aed, #db2777 70%, #f59e0b); }
.em { font-size: 1.35em; line-height: 1; vertical-align: -0.12em; }
.bubble.jumbo { background: none !important; padding: 0 2px; font-size: 34px; line-height: 1.15; letter-spacing: 2px; }
.bubble.jumbo1 { font-size: 48px; animation: pop 0.42s var(--ease); }
.sys { align-self: center; max-width: 92%; text-align: center; font-size: 12px; color: var(--text-3); padding: 2px 6px; }
.clip { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 14px; background: var(--ink-3); min-width: 170px; }
.msg.mine .clip { background: linear-gradient(135deg, #6d3fe0, #b8329a); }
.clip button { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.92); color: #2a1b40; flex: none; }
.clip .bar { flex: 1; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.3); overflow: hidden; }
.clip .bar i { display: block; height: 100%; width: 0; background: #fff; }
.clip time { font-size: 11px; font-variant-numeric: tabular-nums; color: rgba(255, 255, 255, 0.85); }

.compose { padding: 8px 12px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); flex: none; }
.love { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 38px; margin-bottom: 6px; border-radius: 12px; background: linear-gradient(135deg, rgba(236, 72, 153, 0.22), rgba(244, 114, 182, 0.14)); border: 1px solid rgba(244, 114, 182, 0.4); color: #ffd1e6; font-weight: 650; }
.love:active { transform: scale(0.97); }
.love-heart { font-size: 17px; display: inline-block; }
.love.sent .love-heart { animation: beat 0.5s ease-in-out 2; }
.reacts { display: flex; align-items: center; justify-content: space-between; padding: 2px 0 6px; }
.reacts .quick-edit-btn { width: 20px; height: 32px; margin-left: 2px; border-radius: 7px; color: var(--text-3); font-size: 0; transition: color 0.15s, background 0.15s; }
.reacts .quick-edit-btn:hover { transform: none; color: var(--text); background: var(--ink-3); }
.reacts .quick-edit-btn.on { color: var(--focus); background: var(--ink-3); }
.reacts.editing button:not(.quick-edit-btn) { opacity: 0.55; }
.reacts.editing button:not(.quick-edit-btn):hover { opacity: 0.9; transform: none; }
.reacts.editing button.picking { opacity: 1; background: var(--ink-3); box-shadow: 0 0 0 1.5px var(--focus), 0 0 14px rgba(201, 166, 255, 0.35); }
.reacts button.swapped { animation: swap 0.36s var(--ease); }
@keyframes swap { 0% { transform: scale(0.6); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
.quick-edit { margin-bottom: 6px; padding: 8px; border-radius: 12px; background: var(--ink-0); border: 1px solid var(--line); animation: qe-in 0.22s var(--ease); }
@keyframes qe-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.qe-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.qe-title { flex: 1; min-width: 0; font-size: 12px; line-height: 1.35; color: var(--text-2); }
.qe-reset, .qe-done { height: 28px; padding: 0 11px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--text-2); background: var(--ink-2); border: 1px solid var(--line); }
.qe-reset:hover { color: var(--text); background: var(--ink-3); }
.qe-done { color: #fff; background: var(--grad); border-color: transparent; }
.qe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(32px, 1fr)); gap: 2px; max-height: 176px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.qe-grid button { height: 32px; border-radius: 9px; font-size: 19px; line-height: 1; display: grid; place-items: center; }
.qe-grid button:hover { background: var(--ink-3); }
.qe-grid button.in-use { background: rgba(139, 92, 246, 0.16); }
.qe-label { grid-column: 1 / -1; padding: 6px 2px 2px; font-size: 10.5px; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-3); }
.qe-own { display: block; width: 100%; height: 36px; margin-top: 6px; padding: 0 10px; border-radius: 10px; font-size: 16px; }
@media (prefers-reduced-motion: reduce) { .reacts button.swapped, .quick-edit { animation: none; } }
.reacts button, .picker button { width: 32px; height: 32px; border-radius: 9px; font-size: 19px; line-height: 1; display: grid; place-items: center; transition: transform 0.18s var(--ease); }
.reacts button:hover, .picker button:hover { background: var(--ink-3); transform: translateY(-2px) scale(1.12); }
.picker { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; padding: 6px; margin-bottom: 6px; border-radius: 12px; background: var(--ink-0); border: 1px solid var(--line); }
.input { display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 14px; background: var(--ink-2); border: 1px solid var(--line); }
.input:focus-within { border-color: rgba(201, 166, 255, 0.5); }
.input input { flex: 1; min-width: 0; height: 38px; padding: 0 6px; background: none; border: 0; border-radius: 0; }
.tool { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--text-3); }
.tool:hover { background: var(--ink-3); color: var(--text); }
.tool.rec { background: var(--danger); color: #fff; animation: blink 1.1s ease-in-out infinite; }
.send { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--grad); color: #fff; }

/* effects */
.burst { position: absolute; bottom: 30px; display: flex; flex-direction: column; align-items: center; gap: 2px; animation: up 2.2s cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }
.burst > span:first-child { font-size: 42px; line-height: 1; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.45)); }
.burst .who { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: rgba(12, 8, 18, 0.75); }
.burst.heart { bottom: -40px; animation: rise 3.4s cubic-bezier(0.2, 0.6, 0.3, 1) both; }
.love-note { position: absolute; left: 50%; bottom: 30%; transform: translateX(-50%); padding: 12px 22px; border-radius: 999px; background: linear-gradient(135deg, #db2777, #f472b6); color: #fff; font-weight: 700; font-size: 17px; white-space: nowrap; box-shadow: 0 14px 36px -10px rgba(219, 39, 119, 0.8); animation: note 3.6s var(--ease) both; }

/* name gate */
.gate { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 16px; background: rgba(12, 8, 18, 0.8); backdrop-filter: blur(10px); }
.gate-card { width: min(420px, 100%); }
.gate-card h2 { font: 750 26px/1.1 var(--display); letter-spacing: -0.02em; margin: 0 0 16px; }

@keyframes blink { 50% { opacity: 0.35; } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-4px) rotate(4deg); } }
@keyframes pop { from { transform: scale(0.4); opacity: 0; } 60% { transform: scale(1.15); opacity: 1; } to { transform: scale(1); } }
@keyframes beat { 0%, 100% { transform: scale(1); } 30% { transform: scale(1.3); } 60% { transform: scale(0.95); } }
@keyframes up { 0% { opacity: 0; transform: translateY(24px) scale(0.6); } 12% { opacity: 1; transform: translateY(0) scale(1.08); } 70% { opacity: 1; } 100% { opacity: 0; transform: translateY(-46vh) scale(0.95) rotate(-6deg); } }
@keyframes rise { 0% { opacity: 0; transform: translateY(0) scale(0.5); } 10% { opacity: 1; transform: translateY(-6vh) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-58vh) translateX(18px) rotate(10deg); } }
@keyframes note { 0% { opacity: 0; transform: translateX(-50%) translateY(16px) scale(0.85); } 12% { opacity: 1; transform: translateX(-50%) scale(1.04); } 20% { transform: translateX(-50%) scale(1); } 85% { opacity: 1; } 100% { opacity: 0; transform: translateX(-50%) translateY(-12px); } }

/* phones: video on top, party below */
@media (max-width: 860px) {
  .room { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); height: 100dvh; }
  .stage { display: block; }
  .player-box { max-height: 42vh; }
  .panel { border-left: 0; }
  .burst.heart { bottom: -30px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

.conn-row { display: inline-flex; align-items: center; gap: 8px; }
.lock { font-size: 11.5px; color: #c9b8ff; white-space: nowrap; }
