:root {
  --bg: #07070c;
  --bg2: #0c0c14;
  --panel: #12121c;
  --panel2: #191926;
  --panel3: #222233;
  --line: rgba(255, 255, 255, 0.08);
  --line2: rgba(255, 255, 255, 0.14);
  --text: #f5f5fa;
  --muted: #9b9bb4;
  --dim: #6b6b85;
  --accent: #ff3d6e;
  --accent2: #ffb020;
  --good: #3ddc97;
  --grad: linear-gradient(135deg, #ff3d6e 0%, #ff7a3d 55%, #ffc53d 100%);
  --radius: 16px;
  --item: 84px;
  --display: 'Bricolage Grotesque', 'Inter', system-ui, sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}
@media (max-width: 640px) { :root { --item: 66px; } }

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 85% -10%, rgba(255, 61, 110, 0.12), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(255, 176, 32, 0.07), transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.5 var(--body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.02em; line-height: 1.05; margin: 0 0 0.4em; }
h1 { font-size: clamp(34px, 6vw, 68px); font-weight: 800; }
h2 { font-size: clamp(24px, 3.4vw, 36px); font-weight: 800; }
h3 { font-size: 19px; font-weight: 700; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hidden { display: none !important; }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1; }
.kbd { font: 12px/1 var(--body); padding: 3px 6px; border: 1px solid var(--line2); border-radius: 6px; color: var(--muted); }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 20px;
  padding: 12px clamp(14px, 3vw, 32px);
  background: rgba(7, 7, 12, 0.72);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--grad); color: #160a10; font: 800 14px/1 var(--display); letter-spacing: -0.04em;
  box-shadow: 0 6px 20px rgba(255, 61, 110, 0.35);
}
.brand-name { font: 700 19px/1 var(--display); letter-spacing: -0.02em; }
.brand-name b { font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a { text-decoration: none; color: var(--muted); padding: 8px 12px; border-radius: 10px; font-weight: 600; font-size: 14px; transition: 0.15s; }
.nav a:hover { color: var(--text); background: var(--panel); }
.nav a.active { color: var(--text); background: var(--panel2); }
.top-actions { margin-left: auto; display: flex; gap: 6px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line); background: var(--panel);
  cursor: pointer; font-size: 16px; display: grid; place-items: center; transition: 0.15s;
}
.icon-btn:hover { background: var(--panel2); border-color: var(--line2); }
.menu-btn { display: none; }
@media (max-width: 860px) {
  .nav { display: none; position: absolute; top: 62px; left: 10px; right: 10px; flex-direction: column; background: var(--panel); border: 1px solid var(--line2); border-radius: 16px; padding: 8px; box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; font-size: 16px; }
  .menu-btn { display: grid; }
}

main { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: clamp(16px, 3vw, 36px) clamp(12px, 3vw, 32px) 80px; }
main.wide { max-width: none; }
.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 22px clamp(14px, 3vw, 32px); color: var(--dim); font-size: 13px; border-top: 1px solid var(--line); }
.footer a { color: var(--muted); }

/* ---------- Buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 12px; border: 1px solid var(--line2);
  background: var(--panel2); font-weight: 650; font-size: 14.5px; cursor: pointer; text-decoration: none;
  transition: transform 0.12s, background 0.15s, border-color 0.15s, box-shadow 0.2s; white-space: nowrap; user-select: none;
}
.btn:hover { background: var(--panel3); border-color: rgba(255, 255, 255, 0.22); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; pointer-events: none; }
.btn.primary { background: var(--grad); color: #1a0710; border-color: transparent; box-shadow: 0 8px 26px rgba(255, 61, 110, 0.32); }
.btn.primary:hover { box-shadow: 0 10px 34px rgba(255, 61, 110, 0.5); filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn.lg { padding: 15px 26px; font-size: 16.5px; border-radius: 14px; }
.btn.xl { padding: 18px 34px; font-size: 19px; border-radius: 16px; }
.btn.danger:hover { background: rgba(255, 61, 110, 0.15); border-color: rgba(255, 61, 110, 0.5); }
.input, .textarea, select.input {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line2); background: var(--bg2);
  outline: none; transition: border-color 0.15s, box-shadow 0.15s; font-size: 15px;
}
.input:focus, .textarea:focus { border-color: rgba(255, 61, 110, 0.7); box-shadow: 0 0 0 4px rgba(255, 61, 110, 0.14); }
.textarea { min-height: 140px; resize: vertical; line-height: 1.45; }
.label { font-size: 12.5px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; display: block; }
.title-input { background: transparent; border: 0; border-bottom: 2px solid transparent; outline: none; width: 100%; font: 800 clamp(26px, 4vw, 42px)/1.1 var(--display); letter-spacing: -0.02em; padding: 4px 0; }
.title-input:focus { border-bottom-color: var(--accent); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line); font-size: 13px; font-weight: 600; cursor: pointer; transition: 0.15s; }
.chip:hover { border-color: var(--line2); background: var(--panel3); }
.chip.on { background: rgba(255, 61, 110, 0.16); border-color: rgba(255, 61, 110, 0.6); }
.chip .x { opacity: 0.55; }
.badge { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--panel3); color: var(--muted); letter-spacing: 0.03em; }
.badge.live { background: rgba(255, 61, 110, 0.18); color: #ff8fab; }
.tabs { display: inline-flex; padding: 4px; gap: 4px; background: var(--bg2); border: 1px solid var(--line); border-radius: 13px; flex-wrap: wrap; }
.tabs button { border: 0; background: transparent; padding: 8px 14px; border-radius: 10px; cursor: pointer; font-weight: 650; color: var(--muted); font-size: 14px; }
.tabs button.on { background: var(--panel3); color: var(--text); box-shadow: 0 2px 10px rgba(0,0,0,.3); }

.card { background: linear-gradient(180deg, var(--panel), rgba(18, 18, 28, 0.85)); border: 1px solid var(--line); border-radius: 20px; padding: clamp(16px, 2.4vw, 24px); }
.card.pad-lg { padding: clamp(20px, 3.5vw, 36px); }
.section { margin-top: 56px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }

/* ---------- Toasts / modals ---------- */
#toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 400; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--panel3); border: 1px solid var(--line2); padding: 11px 18px; border-radius: 12px; box-shadow: var(--shadow); font-weight: 600; animation: toastIn 0.25s ease-out; }
.toast.err { border-color: rgba(255, 61, 110, 0.6); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }
.modal-back { position: fixed; inset: 0; z-index: 300; background: rgba(3, 3, 8, 0.72); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; animation: fade 0.18s; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--panel); border: 1px solid var(--line2); border-radius: 22px; padding: 24px; box-shadow: var(--shadow); animation: pop 0.22s cubic-bezier(.2,1.4,.4,1); }
.modal.wide { width: min(820px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-head h3 { margin: 0; font-size: 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(0.94) translateY(8px); } }

/* ---------- Items ---------- */
.item {
  position: relative; width: var(--item); height: var(--item); border-radius: 12px; overflow: hidden; flex: none;
  background: var(--c, #333); cursor: grab; user-select: none; -webkit-user-select: none; touch-action: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}
@media (hover: hover) { .item:not(.static):hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.18); } }
.item img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.item .emoji { position: absolute; inset: 0 0 18px; display: grid; place-items: center; font-size: calc(var(--item) * 0.42); line-height: 1; pointer-events: none; }
.item .name {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 4px 4px; font-size: 10.5px; font-weight: 700; line-height: 1.15;
  text-align: center; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.7); pointer-events: none;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word;
}
.item.has-img .name { background: linear-gradient(transparent, rgba(0, 0, 0, 0.85)); padding-top: 12px; }
.item.text-only .name { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12.5px; padding: 6px; -webkit-line-clamp: 4; display: -webkit-box; padding-top: calc(var(--item) / 2 - 16px); }
.item.selected { outline: 3px solid #fff; outline-offset: 2px; transform: scale(1.05); z-index: 2; }
.item.placeholder { opacity: 0.25; transform: scale(0.96); }
.item.ghost { position: fixed; z-index: 500; pointer-events: none; transform: rotate(-4deg) scale(1.1); box-shadow: 0 24px 50px rgba(0, 0, 0, 0.6); transition: none; cursor: grabbing; }
.item.static { cursor: default; touch-action: auto; }
.item.static:hover { transform: none; }
.item .del { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 7px; border: 0; background: rgba(0,0,0,.65); color: #fff; font-size: 12px; cursor: pointer; display: none; place-items: center; z-index: 2; }
@media (hover: hover) { .item:hover .del { display: grid; } }
.item.selected .del { display: grid; }
body.dragging, body.dragging * { cursor: grabbing !important; user-select: none; }

/* ---------- Board ---------- */
.board { display: flex; flex-direction: column; gap: 6px; background: var(--bg2); border: 1px solid var(--line); border-radius: 18px; padding: 6px; }
.tier-row { display: flex; min-height: calc(var(--item) + 12px); background: var(--panel); border-radius: 13px; overflow: hidden; }
.tier-label {
  flex: none; width: clamp(64px, 9vw, 104px); display: flex; align-items: center; justify-content: center; text-align: center;
  background: var(--tc); color: #14070c; font: 800 clamp(22px, 3.4vw, 34px)/1 var(--display); padding: 6px; word-break: break-word; cursor: pointer;
  position: relative; text-shadow: 0 1px 0 rgba(255,255,255,.25);
}
.tier-label.small-text { font-size: clamp(13px, 1.6vw, 17px); }
.tier-zone { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; align-content: flex-start; min-width: 0; transition: background 0.15s; }
.tier-zone.over, .pool.over { background: rgba(255, 255, 255, 0.05); }
.tier-row.pick-target .tier-zone { background: rgba(255,255,255,.035); cursor: pointer; }
.tier-tools { flex: none; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 4px; background: rgba(0,0,0,.18); }
.tier-tools button { border: 0; background: transparent; color: var(--dim); cursor: pointer; width: 28px; height: 26px; border-radius: 7px; font-size: 13px; }
.tier-tools button:hover { background: var(--panel3); color: var(--text); }
@media (max-width: 640px) { .tier-tools { display: none; } }
.pool-wrap { margin-top: 14px; }
.pool { min-height: calc(var(--item) + 26px); display: flex; flex-wrap: wrap; gap: 6px; padding: 12px; border: 2px dashed var(--line2); border-radius: 18px; background: rgba(255, 255, 255, 0.015); transition: background 0.15s; align-content: flex-start; }
.pool:empty::before { content: attr(data-empty); color: var(--dim); margin: auto; font-weight: 600; font-size: 14px; text-align: center; }

.maker-top { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 16px; }
.actionbar {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 120; width: min(720px, calc(100% - 20px));
  background: rgba(25, 25, 38, 0.96); backdrop-filter: blur(12px); border: 1px solid var(--line2); border-radius: 18px; box-shadow: var(--shadow);
  padding: 10px 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; animation: toastIn 0.2s;
}
.actionbar .tb { min-width: 40px; height: 40px; border-radius: 11px; border: 0; font: 800 16px/1 var(--display); cursor: pointer; color: #14070c; padding: 0 8px; }
.actionbar .who { font-weight: 700; margin-right: auto; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropzone-hint { position: fixed; inset: 0; z-index: 250; display: grid; place-items: center; background: rgba(255, 61, 110, 0.12); border: 4px dashed var(--accent); font: 800 32px var(--display); pointer-events: none; }

/* ---------- Home ---------- */
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: center; padding: clamp(10px, 3vw, 40px) 0 10px; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; } }
.hero p.lead { font-size: clamp(16px, 1.8vw, 19px); color: var(--muted); max-width: 540px; }
.eyebrow { display: inline-flex; gap: 8px; align-items: center; padding: 6px 12px; border-radius: 999px; background: rgba(255,61,110,.1); border: 1px solid rgba(255,61,110,.3); color: #ff9db5; font-weight: 700; font-size: 13px; margin-bottom: 18px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 26px 0 8px; }
.demo-board { transform: perspective(1400px) rotateY(-8deg) rotateX(4deg); box-shadow: var(--shadow); --item: 58px; }
@media (max-width: 900px) { .demo-board { transform: none; } }
.demo-board .item { cursor: default; }
.ai-box { display: flex; gap: 10px; flex-wrap: wrap; }
.ai-box .input { flex: 1; min-width: 220px; font-size: 16px; padding: 14px 16px; }
.idea-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.modes { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.mode {
  position: relative; display: block; text-decoration: none; padding: 22px; border-radius: 20px; background: var(--panel); border: 1px solid var(--line);
  overflow: hidden; transition: transform 0.18s, border-color 0.18s; min-height: 170px;
}
.mode:hover { transform: translateY(-4px); border-color: var(--line2); }
.mode .ic { font-size: 30px; margin-bottom: 12px; display: block; }
.mode h3 { margin-bottom: 6px; }
.mode p { color: var(--muted); font-size: 14px; margin: 0; }
.mode::after { content: ''; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; background: var(--mc, #ff3d6e); opacity: 0.12; filter: blur(10px); }
.topic-preview { margin-top: 16px; }
.topic-items { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 14px; --item: 58px; }

/* ---------- Lists grid ---------- */
.lists-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.list-card { display: block; text-decoration: none; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; transition: transform 0.18s, border-color 0.18s; }
.list-card:hover { transform: translateY(-3px); border-color: var(--line2); }
.list-card .mini { display: flex; flex-direction: column; gap: 3px; padding: 10px; background: var(--bg2); height: 128px; overflow: hidden; }
.mini-row { display: flex; gap: 3px; height: 22px; }
.mini-row .ml { width: 24px; border-radius: 5px; font: 800 11px/22px var(--display); text-align: center; color: #14070c; flex: none; }
.mini-row .mb { flex: 1; border-radius: 5px; background: var(--panel); display: flex; gap: 2px; padding: 2px; overflow: hidden; }
.mini-row .mb i { width: 18px; flex: none; border-radius: 3px; background: var(--panel3); }
.list-card .meta { padding: 12px 14px 14px; }
.list-card .meta b { display: block; font: 700 16px/1.25 var(--display); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-card .meta span { color: var(--dim); font-size: 12.5px; }
.empty { padding: 40px; text-align: center; color: var(--muted); border: 1px dashed var(--line2); border-radius: 18px; }
.skeleton { background: linear-gradient(90deg, var(--panel) 0%, var(--panel2) 50%, var(--panel) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 18px; height: 200px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Source picker ---------- */
.source { display: flex; flex-direction: column; gap: 14px; }
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.topic-btn { text-align: left; padding: 12px 14px; border-radius: 13px; border: 1px solid var(--line); background: var(--panel2); cursor: pointer; font-weight: 650; transition: 0.15s; }
.topic-btn:hover { border-color: rgba(255,61,110,.5); background: var(--panel3); }
.topic-btn small { display: block; color: var(--dim); font-weight: 500; margin-top: 2px; }
.preview-items { display: flex; flex-wrap: wrap; gap: 6px; --item: 60px; }
.preview-items .item { cursor: default; }

/* ---------- Game screens (blind / battle / room) ---------- */
.stage { max-width: 980px; margin: 0 auto; }
.stage-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.progress { height: 6px; background: var(--panel2); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--grad); border-radius: 99px; transition: width 0.4s; }
.big-item { --item: clamp(150px, 30vw, 230px); margin: 0 auto; display: flex; justify-content: center; }
.big-item .item { width: var(--item); height: var(--item); border-radius: 26px; cursor: default; box-shadow: 0 30px 70px rgba(0,0,0,.55), inset 0 0 0 1px rgba(255,255,255,.12); }
.big-item .item .name { font-size: clamp(14px, 2.2vw, 19px); padding: 10px 10px 12px; }
.big-item .item.text-only .name { font-size: clamp(18px, 3vw, 26px); }
.item-title { font: 800 clamp(24px, 4vw, 40px)/1.1 var(--display); text-align: center; margin: 18px 0 4px; letter-spacing: -0.02em; }
.flip-in { animation: flipIn 0.55s cubic-bezier(.2,1.3,.4,1); }
@keyframes flipIn { from { opacity: 0; transform: rotateY(90deg) scale(0.8); } }
.slam { animation: slam 0.5s cubic-bezier(.2,1.6,.4,1); }
@keyframes slam { 0% { transform: scale(2.4); opacity: 0; } 60% { transform: scale(0.92); opacity: 1; } }
.pop-in { animation: popIn 0.5s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes popIn { 0% { transform: scale(0) rotate(-12deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
.shake { animation: shake 0.4s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.slots { display: grid; gap: 7px; }
.slot { display: flex; align-items: center; gap: 12px; padding: 7px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); min-height: 58px; transition: 0.15s; --item: 44px; }
.slot .n { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; font: 800 20px var(--display); background: var(--panel3); flex: none; }
.slot.open { cursor: pointer; border-style: dashed; border-color: var(--line2); }
.slot.open:hover { border-color: var(--accent); background: rgba(255,61,110,.08); }
.slot.open:hover .n { background: var(--grad); color: #14070c; }
.slot .nm { font-weight: 700; font-size: 16px; }
.slot .item { cursor: default; border-radius: 9px; }
.slot .item .name { display: none; }
.slot .item .emoji { inset: 0; font-size: 22px; }
.blind-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
@media (max-width: 760px) { .blind-layout { grid-template-columns: 1fr; gap: 18px; } .blind-layout .big-item { --item: 150px; } }
.blind-tiers .tier-row { cursor: pointer; }
.blind-tiers .tier-row:hover .tier-zone { background: rgba(255,255,255,.05); }

.vs-wrap { display: grid; grid-template-columns: 1fr auto 1fr; gap: clamp(10px, 3vw, 40px); align-items: center; }
.vs-card { cursor: pointer; border: 0; background: transparent; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; transition: transform 0.2s, opacity 0.3s; }
.vs-card .item { --item: clamp(130px, 28vw, 260px); width: var(--item); height: var(--item); border-radius: 26px; cursor: pointer; }
.vs-card:hover .item { transform: translateY(-6px) scale(1.02); box-shadow: 0 30px 70px rgba(255,61,110,.25), inset 0 0 0 2px rgba(255,255,255,.3); }
.vs-card .item .name { display: none; }
.vs-card .item .emoji { inset: 0; }
.vs-card .vn { font: 800 clamp(17px, 2.6vw, 26px)/1.15 var(--display); text-align: center; max-width: 260px; }
.vs-card.win .item { box-shadow: 0 0 0 4px var(--good), 0 30px 70px rgba(61,220,151,.3); }
.vs-card.lose { opacity: 0.2; transform: scale(0.9); }
.vs { font: 800 clamp(30px, 6vw, 64px)/1 var(--display); background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { transform: scale(1.12); } }
.champion { text-align: center; }
.champion .crown { font-size: 64px; animation: popIn 0.6s 0.2s both; display: block; }
.podium { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; margin-top: 24px; --item: 76px; }
.podium > div { text-align: center; font-weight: 700; font-size: 13px; }

.vote-grid { display: grid; grid-template-columns: repeat(var(--n, 6), 1fr); gap: 8px; max-width: 680px; margin: 22px auto 0; }
.vote-btn { aspect-ratio: 1; border-radius: 18px; border: 0; background: var(--tc); color: #14070c; font: 800 clamp(22px, 5vw, 40px)/1 var(--display); cursor: pointer; transition: transform 0.12s, box-shadow 0.2s, opacity 0.2s; box-shadow: inset 0 -5px 0 rgba(0,0,0,.18); padding: 4px; word-break: break-word; }
.vote-btn.small-text { font-size: clamp(13px, 2.4vw, 18px); }
.vote-btn:hover { transform: translateY(-3px); }
.vote-btn.mine { box-shadow: 0 0 0 4px #fff, 0 10px 30px rgba(255,255,255,.2); transform: scale(1.06); }
.vote-grid.has-vote .vote-btn:not(.mine) { opacity: 0.4; }
@media (max-width: 520px) { .vote-grid { grid-template-columns: repeat(min(var(--n, 6), 3), 1fr); } .vote-btn { aspect-ratio: 1.5; } }

.room-code { font: 800 clamp(44px, 9vw, 96px)/1 var(--display); letter-spacing: 0.08em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.players { display: flex; flex-wrap: wrap; gap: 8px; }
.player { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line); font-weight: 650; font-size: 14px; transition: 0.2s; }
.player .av { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--pc); color: #14070c; font: 800 13px var(--display); }
.player.off { opacity: 0.4; }
.player.voted { border-color: var(--good); box-shadow: 0 0 0 1px var(--good) inset; }
.player.voted .av::after { content: '✓'; }
.player.voted .av span { display: none; }
.player .kick { border: 0; background: transparent; color: var(--dim); cursor: pointer; padding: 0 0 0 4px; }
.room-grid { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
@media (max-width: 900px) { .room-grid { grid-template-columns: 1fr; } }
.dist { display: flex; flex-direction: column; gap: 6px; max-width: 620px; margin: 20px auto 0; }
.dist-row { display: grid; grid-template-columns: 48px 1fr 40px; gap: 10px; align-items: center; }
.dist-row .dl { height: 38px; border-radius: 10px; display: grid; place-items: center; font: 800 18px var(--display); color: #14070c; background: var(--tc); }
.dist-row .bar { height: 38px; border-radius: 10px; background: var(--panel2); overflow: hidden; position: relative; }
.dist-row .bar i { position: absolute; inset: 0 auto 0 0; background: var(--tc); opacity: 0.85; border-radius: 10px; width: 0; transition: width 0.7s cubic-bezier(.2,1,.3,1); }
.dist-row .bar .who { position: absolute; inset: 0; display: flex; align-items: center; gap: 3px; padding: 0 6px; }
.dist-row .bar .who b { width: 26px; height: 26px; border-radius: 50%; background: var(--pc); color: #14070c; font: 800 11px/26px var(--display); text-align: center; box-shadow: 0 0 0 2px rgba(0,0,0,.35); }
.verdict { display: inline-block; padding: 10px 22px; border-radius: 16px; background: var(--tc); color: #14070c; font: 800 clamp(26px, 5vw, 46px)/1 var(--display); margin-top: 16px; box-shadow: 0 16px 40px rgba(0,0,0,.4); }
.timer { font: 800 22px var(--display); font-variant-numeric: tabular-nums; min-width: 60px; text-align: center; padding: 6px 12px; border-radius: 12px; background: var(--panel2); }
.timer.low { background: rgba(255,61,110,.25); color: #ff9db5; animation: pulse 0.6s infinite; }
.awards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 18px; }
.award { padding: 16px; border-radius: 16px; background: var(--panel2); border: 1px solid var(--line); }
.award .ai { font-size: 26px; }
.award b { display: block; font: 800 18px/1.2 var(--display); margin: 4px 0 2px; }
.award small { color: var(--dim); }
.react-bar { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }
.react-bar button { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); font-size: 21px; cursor: pointer; transition: transform 0.1s; }
.react-bar button:active { transform: scale(0.85); }
.float-emoji { position: fixed; bottom: 60px; z-index: 450; pointer-events: none; font-size: 38px; animation: floatUp 2.6s ease-out forwards; text-align: center; }
.float-emoji small { display: block; font: 700 11px var(--body); color: #fff; text-shadow: 0 1px 3px #000; }
@keyframes floatUp { 0% { transform: translateY(0) scale(0.6); opacity: 0; } 10% { opacity: 1; transform: translateY(-20px) scale(1.1); } 100% { transform: translateY(-60vh) scale(1); opacity: 0; } }

/* ---------- Presenter / reveal ---------- */
.present { position: fixed; inset: 0; z-index: 280; background: var(--bg); padding: clamp(14px, 3vw, 40px); display: flex; flex-direction: column; gap: 14px; overflow: auto; }
.present-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.present-head h2 { margin: 0; }
.present .board { --item: clamp(58px, 8vh, 96px); flex: none; }
.present-hint { text-align: center; color: var(--dim); font-weight: 600; }
.spotlight { position: fixed; inset: 0; z-index: 290; display: grid; place-items: center; background: rgba(5,5,10,.82); backdrop-filter: blur(6px); pointer-events: none; animation: fade 0.2s; }
.spotlight .inner { text-align: center; }
.spotlight .big-item .item { animation: flipIn 0.55s cubic-bezier(.2,1.3,.4,1); }
.spotlight .verdict { animation: slam 0.5s 0.55s cubic-bezier(.2,1.6,.4,1) both; }
.reveal-in { animation: revealIn 0.6s cubic-bezier(.2,1.5,.35,1) both; }
@keyframes revealIn { 0% { transform: translateY(-40px) scale(1.6); opacity: 0; filter: brightness(2); } 100% { transform: none; opacity: 1; filter: none; } }
.tier-row.flash { animation: rowFlash 0.7s; }
@keyframes rowFlash { 0% { box-shadow: 0 0 0 0 var(--tc); } 30% { box-shadow: 0 0 0 3px var(--tc), 0 0 40px var(--tc); } 100% { box-shadow: 0 0 0 0 transparent; } }
.drumroll { font: 800 clamp(26px, 5vw, 52px)/1.1 var(--display); text-align: center; animation: pulse 0.5s infinite; }

canvas.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 600; width: 100%; height: 100%; }

/* ---------- Creator / OBS mode ---------- */
.creator-bar { display: none; position: fixed; top: 10px; right: 10px; z-index: 700; gap: 8px; align-items: center; padding: 6px 8px 6px 12px; border-radius: 14px; background: rgba(18,18,28,.9); border: 1px solid var(--line2); font-weight: 700; font-size: 13px; opacity: 0.15; transition: opacity 0.2s; }
.creator-bar:hover { opacity: 1; }
.creator-bar select { background: var(--panel2); border: 1px solid var(--line2); border-radius: 8px; padding: 5px; }
body.creator .creator-bar { display: flex; }
body.creator .topbar, body.creator .footer, body.creator .no-creator { display: none !important; }
body.creator main { max-width: none; padding: clamp(16px, 2.5vw, 40px); }
body.creator { --item: clamp(70px, 7vw, 110px); }
body.creator .stage { max-width: 1280px; }
body.bg-green { background: #00b140 !important; }
body.bg-transparent { background: transparent !important; }
body.bg-green .card, body.bg-transparent .card { background: rgba(10,10,16,.92); }
body.obs .creator-bar { display: none !important; }
body.bg-green .spotlight, body.bg-transparent .spotlight { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
body.bg-green.spot main, body.bg-transparent.spot main, body.bg-green.spot .present .board, body.bg-transparent.spot .present .board { opacity: 0; transition: opacity 0.2s; }
body.bg-green .present { background: #00b140; }
body.bg-transparent .present { background: transparent; }

.prose { max-width: 760px; }
.prose h2 { margin-top: 1.4em; }
.prose code { background: var(--panel2); padding: 2px 6px; border-radius: 6px; font-size: 0.92em; }
.prose li { margin-bottom: 6px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.stat { padding: 16px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.stat b { display: block; font: 800 26px var(--display); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table td, .admin-table th { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.admin-table th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatches button { width: 32px; height: 32px; border-radius: 9px; border: 2px solid transparent; cursor: pointer; }
.swatches button.on { border-color: #fff; }
.share-link { display: flex; gap: 8px; }
.share-link .input { font-family: ui-monospace, monospace; font-size: 13.5px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }
