/* ============================================================
   KB Practice — Apple-Luxe Interface
   ============================================================ */

:root {
  --bg: #050505;
  --bg-raised: #0c0c0c;
  --bg-subtle: #141414;
  --glass: rgba(10, 10, 10, 0.72);
  --border: rgba(255, 255, 255, 0.06);
  --shadow-ambient: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 24px 48px -12px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.02);
  --text: #f2f2f2;
  --text-2: #86868B;
  --text-3: #555558;
  --blue-from: #3B82F6;
  --blue-to: #2563EB;
  --red-from: #EF4444;
  --red-to: #DC2626;
  --green-from: #22C55E;
  --green-to: #16A34A;
  --amber: #FFB300;
  --amber-hover: #FFA000;
  --bubble-theirs: #1c1c1e;
  --bubble-mine: #3478F6;
  --font: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --r: 14px;
  --r-sm: 10px;
  --shell-mx: 6vw;
}

[data-theme="light"] {
  --bg: #FFFFFF;
  --bg-raised: #FFFFFF;
  --bg-subtle: #F5F5F7;
  --glass: rgba(255, 255, 255, 0.88);
  --border: rgba(0, 0, 0, 0.06);
  --shadow-ambient: 0 4px 6px -1px rgba(0, 0, 0, 0.04), 0 24px 48px -12px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.03);
  --text: #1D1D1F;
  --text-2: #86868B;
  --text-3: #AEAEB2;
  --bubble-theirs: #E9E9EB;
  --bubble-mine: #3478F6;
}

/* ── Reset ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
  transition: background 0.4s ease, color 0.4s ease;
}

/* Ambient glow */
body::before {
  content: '';
  position: fixed;
  top: -45%;
  left: 50%;
  transform: translateX(-50%);
  width: 130%;
  height: 65%;
  background: radial-gradient(ellipse at center, rgba(59, 130, 246, 0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

[data-theme="light"] body::before {
  background: radial-gradient(ellipse at center, rgba(59, 130, 246, 0.02) 0%, transparent 70%);
}

/* ============================================================
   TOP BAR
   ============================================================ */
.top-bar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem var(--shell-mx);
  flex-shrink: 0;
}

.logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.logo span {
  font-weight: 600;
  color: var(--text);
}

.cat-sep {
  color: var(--text);
  font-weight: 600;
}

.cat-label {
  font-weight: 600;
}

.top-bar-actions {
  display: flex;
  gap: 0.45rem;
}

.icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s var(--ease);
}

.icon-btn:hover {
  color: var(--text);
  background: var(--bg-subtle);
}

.icon-players:hover {
  color: var(--green-from);
}

.icon-queue:hover {
  color: var(--amber);
}

.icon-rooms:hover {
  color: var(--blue-from);
}

.icon-theme:hover {
  color: var(--amber);
}

.icon-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--blue-from);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  line-height: 17px;
  text-align: center;
  border-radius: 9px;
  padding: 0 4px;
}

/* ============================================================
   APP SHELL
   ============================================================ */
.app-shell {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0 var(--shell-mx);
}

/* ── Question ── */
.question-area {
  flex-shrink: 0;
  padding: 1.5rem 0 1rem;
  position: relative;
}

.q-tag {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-3);
  margin-bottom: 0.55rem;
}

.q-text {
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.55;
  letter-spacing: -0.02em;
  color: var(--text);
  max-width: 52rem;
}

.q-text kbd {
  display: inline-block;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.1em 0.45em;
  font-size: 0.8em;
  font-family: var(--font);
}

.timer-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.1rem;
}

.timer-num {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-3);
  min-width: 1.2em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.timer-track {
  flex: 1;
  height: 4px;
  background: var(--bg-subtle);
  border-radius: 2px;
  overflow: hidden;
}

.timer-fill {
  height: 100%;
  width: 100%;
  background: var(--blue-from);
  border-radius: 2px;
  transition: width 1s linear;
}

.room-tag {
  position: absolute;
  top: 1.5rem;
  right: 0;
  font-size: 0.65rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

/* Divider */
.q-divider {
  height: 1px;
  flex-shrink: 0;
  background: linear-gradient(90deg, var(--border), transparent 80%);
  margin: 0 0 0.25rem;
}

/* ── Feed ── */
.feed-area {
  flex: 1;
  min-height: 0;
  position: relative;
}

.feed {
  height: 100%;
  overflow-y: auto;
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  scroll-behavior: smooth;
}

.feed::-webkit-scrollbar {
  width: 4px;
}

.feed::-webkit-scrollbar-thumb {
  background: rgba(128, 128, 128, 0.2);
  border-radius: 2px;
}

/* ─ Chat bubbles (iMessage + 3D depth) ─ */
.bubble-chat {
  max-width: 72%;
  padding: 0.7rem 1.15rem;
  border-radius: 20px;
  font-size: 1rem;
  line-height: 1.5;
  animation: bubbleIn 0.3s var(--ease) both;
  word-wrap: break-word;
}

.bubble-chat.theirs {
  align-self: flex-start;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, var(--bubble-theirs) 100%);
  color: var(--text);
  border-bottom-left-radius: 4px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 1px 3px rgba(0, 0, 0, 0.08),
    0 4px 12px rgba(0, 0, 0, 0.06);
}

.bubble-chat.mine {
  align-self: flex-end;
  background: linear-gradient(180deg, #4B92FF 0%, #2563EB 100%);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.25),
    0 2px 4px rgba(37, 99, 235, 0.15),
    0 6px 16px rgba(37, 99, 235, 0.18);
}

[data-theme="light"] .bubble-chat.theirs {
  background: linear-gradient(180deg, #F2F2F4 0%, var(--bubble-theirs) 100%);
  color: var(--text);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 4px 12px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .bubble-chat.mine {
  color: #fff;
}

.chat-sender {
  display: block;
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--text-3);
  margin-bottom: 0.15rem;
}

@keyframes bubbleIn {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ─ Event items ─ */
.bubble {
  font-size: 0.92rem;
  line-height: 1.55;
  padding: 0.4rem 0;
  color: var(--text-2);
  animation: bubbleIn 0.3s var(--ease) both;
}

.bubble-success {
  color: var(--green-from);
}

.bubble-error {
  color: var(--red-from);
}

.bubble-answer {
  color: var(--blue-from);
  font-weight: 500;
}

/* Alert-style card for question-over */
.bubble-alert {
  padding: 0;
}

.feed-alert {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(99, 102, 241, 0.05) 100%);
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: 14px;
  padding: 0.85rem 1.15rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(59, 130, 246, 0.06);
}

.feed-alert-icon {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--blue-from);
  flex-shrink: 0;
}

[data-theme="light"] .feed-alert {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.06) 0%, rgba(99, 102, 241, 0.03) 100%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03), 0 4px 12px rgba(59, 130, 246, 0.04);
}

.ev-zap,
.ev-ok,
.ev-no,
.ev-clock,
.ev-arrow,
.ev-warn {
  font-weight: 700;
  margin-right: 0.25em;
}

.ev-ok {
  color: var(--green-from);
}

.ev-no {
  color: var(--red-from);
}

.ev-zap {
  color: var(--amber);
}

.ev-arrow {
  color: var(--blue-from);
}

.ev-warn {
  color: var(--red-from);
}

/* Scroll FAB */
.scroll-fab {
  position: absolute;
  bottom: 0.75rem;
  right: 0.5rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--glass);
  backdrop-filter: blur(12px);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s var(--ease);
  box-shadow: var(--shadow-ambient);
  z-index: 5;
}

.scroll-fab:hover {
  transform: translateY(-2px);
}

.scroll-fab.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}

/* ============================================================
   CHATBAR — "Command Center"
   ============================================================ */
.chatbar {
  position: relative;
  z-index: 10;
  margin: 0 var(--shell-mx) 1rem;
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 32px;
  padding: 1.1rem 1.3rem 1rem;
  box-shadow: var(--shadow-ambient);
  transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.chatbar-answering {
  background: rgba(34, 197, 94, 0.05);
  border-color: rgba(34, 197, 94, 0.2);
}

.chatbar-urgent {
  background: rgba(255, 179, 0, 0.06) !important;
  border-color: rgba(255, 179, 0, 0.25) !important;
}

.mode-tag {
  text-align: center;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-3);
  margin-bottom: 0.6rem;
  transition: color 0.25s;
}

.mode-tag.mode-answer {
  color: var(--green-from);
}

.chatbar-input-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.7rem;
}

/* Username — directly editable, Apple-style */
.username-input {
  width: 6.5rem;
  flex-shrink: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-2);
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.3rem 0.5rem;
  border-radius: 8px;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  cursor: text;
}

.username-input:hover {
  background: var(--bg-subtle);
}

.username-input:focus {
  background: var(--bg-subtle);
  color: var(--text);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.username-input::placeholder {
  color: var(--text-3);
}

/* Main input with focus ring */
.main-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  min-width: 0;
  padding: 0.3rem 0.5rem;
  border-radius: 8px;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.main-input:focus {
  background: var(--bg-subtle);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.main-input::placeholder {
  color: var(--text-3);
}

/* Context-aware focus: green when answering, yellow when urgent */
.chatbar-answering .username-input:focus,
.chatbar-answering .main-input:focus {
  background: rgba(34, 197, 94, 0.06);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25);
}

.chatbar-urgent .username-input:focus,
.chatbar-urgent .main-input:focus {
  background: rgba(255, 179, 0, 0.06) !important;
  box-shadow: 0 0 0 2px rgba(255, 179, 0, 0.25) !important;
}

.chatbar-btn-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-group-left,
.btn-group-right {
  display: flex;
  gap: 0.5rem;
}

/* ============================================================
   LUXE BUTTONS — 3D Gradient Pills
   ============================================================ */
.pill-btn {
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  border: none;
  border-radius: 24px;
  padding: 0.65rem 1.5rem;
  cursor: pointer;
  white-space: nowrap;
  color: #fff;
  transition: all 0.2s var(--ease);
  position: relative;
}

/* ── Active (depress) state for ALL buttons ── */
.pill-btn:active {
  transform: scale(0.96);
}

/* ── Blue (Next) ── */
.pill-btn.pill-blue {
  background: linear-gradient(180deg, #4B92FF 0%, #2563EB 100%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.4),
    0 2px 4px rgba(37, 99, 235, 0.15),
    0 8px 16px rgba(37, 99, 235, 0.2);
}

.pill-btn.pill-blue:hover {
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.4),
    0 2px 4px rgba(37, 99, 235, 0.2),
    0 12px 24px rgba(37, 99, 235, 0.28);
  transform: translateY(-1px);
}

.pill-btn.pill-blue:active {
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.15),
    0 1px 2px rgba(37, 99, 235, 0.15);
  transform: scale(0.96);
}

/* ── Red (Buzz) ── */
.pill-btn.pill-red {
  background: linear-gradient(180deg, #F87171 0%, #DC2626 100%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.35),
    0 2px 4px rgba(220, 38, 38, 0.15),
    0 8px 16px rgba(220, 38, 38, 0.2);
}

.pill-btn.pill-red:hover {
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.35),
    0 2px 4px rgba(220, 38, 38, 0.2),
    0 12px 24px rgba(220, 38, 38, 0.28);
  transform: translateY(-1px);
}

.pill-btn.pill-red:active {
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.15),
    0 1px 2px rgba(220, 38, 38, 0.15);
  transform: scale(0.96);
}

/* ── Green (Answer) ── */
.pill-btn.pill-green {
  background: linear-gradient(180deg, #4ADE80 0%, #16A34A 100%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.35),
    0 2px 4px rgba(22, 163, 74, 0.15),
    0 8px 16px rgba(22, 163, 74, 0.2);
}

.pill-btn.pill-green:hover {
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.35),
    0 2px 4px rgba(22, 163, 74, 0.2),
    0 12px 24px rgba(22, 163, 74, 0.28);
  transform: translateY(-1px);
}

.pill-btn.pill-green:active {
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.15),
    0 1px 2px rgba(22, 163, 74, 0.15);
  transform: scale(0.96);
}

/* ── Yellow/Amber (Send) ── */
.pill-btn.pill-yellow {
  background: linear-gradient(180deg, #FFD54F 0%, #FFB300 100%);
  color: #1D1D1F;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.5),
    0 2px 4px rgba(255, 179, 0, 0.15),
    0 8px 16px rgba(255, 179, 0, 0.2);
}

.pill-btn.pill-yellow:hover {
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.5),
    0 2px 4px rgba(255, 179, 0, 0.2),
    0 12px 24px rgba(255, 179, 0, 0.28);
  transform: translateY(-1px);
}

.pill-btn.pill-yellow:active {
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.1),
    0 1px 2px rgba(255, 179, 0, 0.15);
  transform: scale(0.96);
}

/* ── Secondary ── */
.pill-btn.pill-secondary {
  background: var(--bg-subtle);
  color: var(--text-2);
  box-shadow: none;
}

.pill-btn.pill-secondary:hover {
  background: var(--bg-raised);
  color: var(--text);
}

.pill-btn.pill-secondary:active {
  transform: scale(0.96);
}

/* ============================================================
   DRAWERS
   ============================================================ */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 90;
  transition: opacity 0.3s var(--ease);
}

.drawer-overlay.hidden {
  display: none;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 300px;
  max-width: 85vw;
  height: 100%;
  background: var(--bg-raised);
  border-left: 1px solid var(--border);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s var(--ease);
  box-shadow: none;
  visibility: hidden;
}

.drawer.open {
  transform: translateX(0);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.25);
  visibility: visible;
}

.drawer-wide {
  width: 360px;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.drawer-header h3 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.drawer-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-3);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.drawer-close:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

.drawer-list {
  flex: 1;
  overflow-y: auto;
  list-style: none;
}

.drawer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1.25rem;
  transition: background 0.15s;
}

.drawer-item:hover {
  background: var(--bg-subtle);
}

.drawer-item.inactive {
  opacity: 0.4;
}

.player-name {
  font-weight: 500;
  font-size: 0.9rem;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pts-badge {
  background: var(--blue-from);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.12rem 0.5rem;
  border-radius: 10px;
}

.report-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  opacity: 0.35;
  transition: opacity 0.2s;
}

.report-btn:hover {
  opacity: 1;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.15rem 1.25rem;
}

.room-join-group {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.room-join-group .drawer-input {
  flex: 1;
}

.drawer-input {
  width: 100%;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0.6rem 0.85rem;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.drawer-input:focus {
  border-color: var(--blue-from);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.room-quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
}

.room-chip {
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  background: var(--bg-subtle);
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.2s var(--ease);
  position: relative;
}

.room-chip:hover {
  color: #fff;
  transform: translateY(-1px);
}
.room-chip:active {
  transform: scale(0.96);
}

/* Category-colored 3D hover */
.room-chip[data-cat="geography"]:hover {
  background: linear-gradient(180deg, #60A5FA, #3B82F6);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.35), 0 2px 4px rgba(59,130,246,0.15), 0 8px 16px rgba(59,130,246,0.2);
}
.room-chip[data-cat="history"]:hover {
  background: linear-gradient(180deg, #C084FC, #A855F7);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.35), 0 2px 4px rgba(168,85,247,0.15), 0 8px 16px rgba(168,85,247,0.2);
}
.room-chip[data-cat="math"]:hover {
  background: linear-gradient(180deg, #F87171, #EF4444);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.35), 0 2px 4px rgba(239,68,68,0.15), 0 8px 16px rgba(239,68,68,0.2);
}
.room-chip[data-cat="science"]:hover {
  background: linear-gradient(180deg, #22D3EE, #06B6D4);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.35), 0 2px 4px rgba(6,182,212,0.15), 0 8px 16px rgba(6,182,212,0.2);
}
.room-chip[data-cat="literature"]:hover {
  background: linear-gradient(180deg, #34D399, #10B981);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.35), 0 2px 4px rgba(16,185,129,0.15), 0 8px 16px rgba(16,185,129,0.2);
}
.room-chip[data-cat="music"]:hover {
  background: linear-gradient(180deg, #F472B6, #EC4899);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.35), 0 2px 4px rgba(236,72,153,0.15), 0 8px 16px rgba(236,72,153,0.2);
}
.room-chip[data-cat="art"]:hover {
  background: linear-gradient(180deg, #FBBF24, #F59E0B);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.5), 0 2px 4px rgba(245,158,11,0.15), 0 8px 16px rgba(245,158,11,0.2);
  color: #1D1D1F;
}

.drawer-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.6rem;
}

.category-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem 0.6rem;
}

.category-grid label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text-2);
}

.category-grid label:hover {
  color: var(--text);
}

.drawer-hint {
  font-size: 0.68rem;
  color: var(--text-3);
  margin-top: 0.4rem;
}

/* ── Community promo section ── */
.drawer-divider {
  height: 1px;
  background: var(--border);
  margin: 1.25rem 0;
}

.promo-discord {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1rem;
  border-radius: 14px;
  background: linear-gradient(180deg, #7C8AF6 0%, #5865F2 100%);
  color: #fff;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.65rem;
  transition: all 0.2s var(--ease);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.3),
    0 2px 4px rgba(88, 101, 242, 0.15),
    0 8px 16px rgba(88, 101, 242, 0.2);
}

.promo-discord:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.3),
    0 2px 4px rgba(88, 101, 242, 0.2),
    0 12px 24px rgba(88, 101, 242, 0.28);
}

.promo-discord:active {
  transform: scale(0.96);
}

.promo-book {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s var(--ease);
}

.promo-book:hover {
  background: var(--bg-raised);
  border-color: rgba(59, 130, 246, 0.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

.promo-book:active {
  transform: scale(0.98);
}

.promo-book-inner {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.promo-book-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.promo-book-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.promo-book-text strong {
  font-size: 0.85rem;
  font-weight: 600;
}

.promo-book-text span {
  font-size: 0.72rem;
  color: var(--text-2);
}

.promo-book-arrow {
  font-size: 1rem;
  color: var(--text-3);
  transition: transform 0.2s;
}

.promo-book:hover .promo-book-arrow {
  transform: translateX(3px);
  color: var(--blue-from);
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal-overlay.hidden {
  display: none;
}

.modal-box {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.2rem;
  max-width: 380px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow-ambient);
}

.modal-box h3 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.6rem;
}

.modal-box p {
  color: var(--text-2);
  margin-bottom: 1.5rem;
  line-height: 1.55;
}

.modal-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (min-width: 1400px) {
  :root {
    --shell-mx: 12vw;
  }
}

@media (min-width: 1800px) {
  :root {
    --shell-mx: 18vw;
  }
}

@media (max-width: 768px) {
  :root {
    --shell-mx: 1rem;
  }

  .q-text {
    font-size: 1.3rem;
  }

  .bubble-chat {
    max-width: 85%;
  }

  .chatbar {
    border-radius: 24px;
    padding: 0.9rem 1rem 0.8rem;
  }

  .pill-btn {
    padding: 0.55rem 1.2rem;
    font-size: 0.82rem;
  }
}

@media (max-width: 480px) {
  :root {
    --shell-mx: 0.75rem;
  }

  .top-bar {
    padding: 0.7rem 0.75rem;
  }

  .logo {
    font-size: 1.1rem;
  }

  .icon-btn {
    width: 34px;
    height: 34px;
  }

  .q-text {
    font-size: 1.15rem;
  }

  .chatbar {
    margin: 0 0.75rem 0.6rem;
    padding: 0.8rem 0.85rem 0.65rem;
    border-radius: 20px;
  }

  .pill-btn {
    padding: 0.5rem 1rem;
    font-size: 0.78rem;
    border-radius: 18px;
  }

  .username-input {
    width: 4.5rem;
    font-size: 0.8rem;
  }
}