/* ═══════════════════════════════════════════════════════════
   quiz.css — Host / Editor specific styles
   Shared design tokens, reset, buttons, inputs, modals,
   sidebar base, chat, music → shared.css (loaded first)
   This file: quiz-only overrides + layouts
   ═══════════════════════════════════════════════════════════ */

/* ── BASE ─────────────────────────────────────────────────── */
html, body { height: 100%; }
body {
  font-family: 'Inter', sans-serif;
  background:
    radial-gradient(ellipse 80% 60% at 20% 40%, rgba(87,242,135,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 70%, rgba(88,101,242,0.08) 0%, transparent 55%),
    #020817;
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── PAGE HEADER ──────────────────────────────────────────── */
#page-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-height);
  background: var(--topbar-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(0,0,0,.4);
}
#page-header a.back-link {
  color: var(--text2); text-decoration: none;
  font-size: 14px; font-weight: 500;
  display: flex; align-items: center; gap: 6px; transition: color .2s;
}
#page-header a.back-link:hover { color: var(--white); }

/* ── MAIN CONTENT ─────────────────────────────────────────── */
#main-content {
  padding-top: var(--topbar-height);
  min-height: 100vh;
}

/* ── VIEWS (list + editor use block layout with padding) ──── */
.view { display: none; padding: 32px 24px; }
.view.active { display: block; }

/* HOST view overrides to flex (no padding) */
#view-host        { display: none; padding: 0; }
#view-host.active {
  display: flex;
  flex-direction: column;
  height: 100dvh;          /* full height — page-header hidden below */
}

/* Hide the global page-header when host or editor view is active */
body:has(#view-host.active)   #page-header  { display: none; }
body:has(#view-host.active)   #main-content { padding-top: 0; }
body:has(#view-editor.active) #page-header  { display: none; }
body:has(#view-editor.active) #main-content { padding-top: 0; }

/* Editor view overrides */
#view-editor        { display: none; padding: 0; }
#view-editor.active {
  display: flex;
  flex-direction: column;
  height: 100dvh;  /* full height — page-header hidden */
}

/* ══════════════════════════════════════════════════════════
   VIEW: LIST
   ══════════════════════════════════════════════════════════ */
.quiz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.quiz-card {
  background: var(--glass);
  border: 2px solid var(--glass-border);
  border-radius: 12px;
  padding: 20px;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.quiz-card:hover {
  border-color: rgba(88,101,242,.4);
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 8px 28px rgba(0,0,0,.5);
}
.quiz-card-title  { font-size: 16px; font-weight: 800; margin-bottom: 6px; color: var(--white); }
.quiz-card-meta   { font-size: 12px; color: var(--text2); margin-bottom: 16px; }
.quiz-card-actions{ display: flex; gap: 8px; flex-wrap: wrap; }
.empty-state      { text-align: center; padding: 80px 20px; color: var(--text2); }
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state p    { font-size: 15px; }

/* ── join box (character-cell style on list view) ─────────── */
.join-game-row {
  display: flex; gap: 10px; align-items: center;
}
.join-game-row input[type="text"] {
  flex: 1; max-width: 240px;
  background: rgba(255,255,255,.06);
  border: 2px solid rgba(87,242,135,.3);
  border-radius: 10px;
  color: var(--white);
  font-size: 20px; font-weight: 800;
  padding: 12px 16px; letter-spacing: 4px;
  outline: none; transition: border-color .2s, box-shadow .2s;
  text-transform: uppercase; font-family: 'Inter', sans-serif; width: auto;
}
.join-game-row input[type="text"]::placeholder { color: rgba(255,255,255,.25); letter-spacing: 2px; font-size: 14px; }
.join-game-row input[type="text"]:focus { border-color: var(--jep-gold); box-shadow: 0 0 0 3px rgba(87,242,135,.15); }

/* ══════════════════════════════════════════════════════════
   VIEW: EDITOR
   ══════════════════════════════════════════════════════════ */
.editor-header {
  display: flex; align-items: center; gap: 8px;
  padding: 0 16px; flex-shrink: 0;
  height: var(--topbar-height);
  background: var(--topbar-bg);
  border-bottom: 1px solid rgba(87,242,135,0.12);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  z-index: 10;
  box-shadow: 0 2px 20px rgba(0,0,0,0.4), 0 1px 0 rgba(87,242,135,0.06);
}
.editor-header::-webkit-scrollbar { display: none; }
.editable-title {
  font-size: 16px; font-weight: 900; color: #57F287;
  cursor: pointer; padding: 4px 10px; border-radius: 8px;
  border: 1.5px dashed rgba(87,242,135,0.25); transition: border-color .2s;
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.editable-title:hover { border-color: rgba(87,242,135,0.55); }
.editable-title input {
  background: transparent; border: none; border-bottom: 2px solid #57F287;
  border-radius: 0; color: #57F287; font-size: 16px; font-weight: 900;
  width: 200px; outline: none; font-family: inherit;
}

/* Editor Jeopardy Board — fills all available vertical space */
.jeopardy-board-wrapper {
  overflow-x: auto;
  overflow-y: hidden;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.jeopardy-board {
  display: flex;
  gap: 10px;
  padding: 10px;
  flex: 1;
  min-height: 0;
  align-items: stretch;
  width: 100%;
}
.jeopardy-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-width: 140px;
  min-height: 0;
}
.jeopardy-category-header {
  flex-shrink: 0;
  background: rgba(8,18,55,0.80);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.11);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.55);
  padding: 12px 8px; text-align: center;
  font-size: 13px; font-weight: 800; color: var(--white);
  text-transform: uppercase; letter-spacing: .05em;
  text-shadow: none;
  cursor: pointer; min-height: 60px;
  display: flex; align-items: center; justify-content: center;
  position: relative; transition: background .18s;
}
.jeopardy-category-header:hover {
  background: rgba(20,40,100,0.82);
  border-color: rgba(87,242,135,0.25);
}
.cat-delete-btn {
  position: absolute; top: 4px; right: 4px;
  background: none; border: none; color: rgba(255,255,255,.4);
  cursor: pointer; font-size: 12px; line-height: 1; padding: 2px;
}
.cat-delete-btn:hover { color: var(--red); }
.cat-dup-btn {
  position: absolute; top: 4px; right: 20px;
  background: none; border: none; color: rgba(255,255,255,.35);
  cursor: pointer; font-size: 12px; line-height: 1; padding: 2px;
}
.cat-dup-btn:hover { color: var(--gold); }
.cat-name-input {
  background: transparent; border: none;
  border-bottom: 1px dashed rgba(255,255,255,.2); border-radius: 0;
  color: var(--white); font-size: 12px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .05em;
  text-align: center; width: 100%; padding: 2px 4px;
  outline: none; cursor: text; min-width: 0;
  text-overflow: ellipsis; overflow: hidden; white-space: nowrap;
}
.cat-name-input:focus { border-bottom-color: var(--gold); }
.jeopardy-tile {
  /* Windows Aero frosted glass — same as host/player tiles */
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.09);
  /* Fill available column height instead of fixed px */
  flex: 1;
  min-height: 50px;
  max-height: 160px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .18s, transform .15s, border-color .18s, box-shadow .18s;
  font-size: clamp(18px, 2vw, 28px); font-weight: 800; color: #57F287;
  font-family: 'Inter', sans-serif;
  text-shadow: 0 0 16px rgba(87,242,135,0.45);
  position: relative;
}
.jeopardy-tile:hover {
  background: rgba(87,242,135,0.08);
  border-color: rgba(87,242,135,0.35);
  box-shadow: 0 6px 24px rgba(0,0,0,0.5), 0 0 16px rgba(87,242,135,0.12);
  z-index: 1;
}
.jeopardy-tile.has-question { border-color: rgba(87,242,135,0.35); }
.jeopardy-tile.empty-tile {
  border-style: dashed; color: var(--text2);
  font-size: 13px; font-weight: 500; font-family: 'Inter', sans-serif;
}
.jeopardy-tile.empty-tile:hover {
  border-color: rgba(87,242,135,0.5);
  color: var(--white);
}
.add-category-col {
  display: none !important;
}
.add-category-col:hover {
  border-color: rgba(87,242,135,0.55);
  color: var(--gold);
  background: rgba(20,40,100,0.55);
}

/* ══════════════════════════════════════════════════════════
   VIEW: HOST — left board area
   ══════════════════════════════════════════════════════════ */
.host-board-area {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  background: transparent; overflow: hidden; position: relative;
}
.host-board-topbar {
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px; height: var(--topbar-height);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--glass-border); flex-shrink: 0;
  backdrop-filter: blur(12px);
}
#host-game-title {
  font-size: 14px; font-weight: 600; color: var(--text2);
  flex: 1; text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.host-board-scroll {
  flex: 1; overflow: auto; padding: 12px;
  display: flex; flex-direction: column; min-height: 0;
}
.host-jeopardy-board {
  flex: 1;
  border-radius: 12px;
  overflow: visible;
  border: none;
  box-shadow: none;
  display: flex;
  flex-direction: column;
}
.host-jeopardy-table {
  width: 100%; height: 100%;
  border-collapse: separate;
  border-spacing: 10px;
  table-layout: fixed; flex: 1;
}
.host-jeopardy-table th {
  background: rgba(8,18,55,0.80);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: clamp(11px, 1.4vw, 18px);
  padding: 14px 8px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.11);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.55);
  text-shadow: none;
}
.host-jeopardy-table td {
  background: transparent;
  text-align: center;
  padding: 0;
  border: none;
  height: 1%;
  border-radius: 10px;
}
.host-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%; height: 100%;
  min-height: clamp(70px, 10vh, 120px);
  font-family: 'Inter', sans-serif;
  font-size: clamp(2rem, 3.5vw, 3.6rem);
  font-weight: 800;
  color: #57F287;
  text-shadow: 0 0 20px rgba(87,242,135,0.5), 0 2px 8px rgba(0,0,0,0.8);
  /* Windows Aero frosted glass */
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 10px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.10);
  cursor: pointer;
  transition: background .18s ease, transform .15s ease, border-color .18s ease, box-shadow .18s ease;
  position: relative;
  overflow: hidden;
}
.host-tile:hover {
  background: rgba(87,242,135,0.08);
  border-color: rgba(87,242,135,0.35);
  transform: scale(1.035);
  box-shadow: 0 8px 32px rgba(0,0,0,0.45), 0 0 18px rgba(87,242,135,0.15), inset 0 1px 0 rgba(255,255,255,0.12);
  z-index: 2;
}
.host-tile.tile-flip-in {
  animation: tileFlipRevealHost .5s cubic-bezier(.16,1,.3,1);
}
@keyframes tileFlipRevealHost {
  0%   { transform: perspective(800px) rotateY(90deg) scale(0.9); opacity: 0; }
  60%  { transform: perspective(800px) rotateY(-8deg) scale(1.02); opacity: 1; }
  100% { transform: perspective(800px) rotateY(0) scale(1); opacity: 1; }
}
.host-tile.revealed {
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(8px) saturate(60%);
  -webkit-backdrop-filter: blur(8px) saturate(60%);
  border-color: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.25);
  text-shadow: none;
  cursor: pointer;
  transform: none;
  filter: grayscale(0.6);
}
.host-tile.revealed:hover {
  background: rgba(87,242,135,0.08);
  border-color: rgba(87,242,135,0.25);
  filter: grayscale(0.2);
  transform: scale(1.02);
}
.host-tile.revealed::after {
  content: '';
}

/* ══════════════════════════════════════════════════════════
   HOST SIDEBAR — extends shared .host-side-panel base
   ══════════════════════════════════════════════════════════ */
.host-side-panel {
  border-left-color: rgba(87,242,135,.2);
  overflow-y: auto;
  overflow-x: hidden;
}

/* Bottom action bar (Start Game / End Game) */
.side-controls {
  padding: 12px 14px;
  border-top: 1px solid rgba(87,242,135,.15);
  display: flex; flex-direction: column; gap: 8px; flex-shrink: 0;
}

/* ── TEAMS (host-specific: adj buttons) ───────────────────── */
.team-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; margin: 3px 8px;
  background: rgba(26,26,110,.4);
  border: 1px solid var(--jep-border); border-radius: 10px;
  transition: border-color .2s, box-shadow .2s;
}
.team-row.buzzed-team {
  border-color: rgba(87,242,135,0.5);
  background: rgba(87,242,135,0.06);
  box-shadow: 0 0 16px rgba(87,242,135,0.2);
}
.team-name-input {
  flex: 1; background: transparent; border: none;
  border-bottom: 1px dashed rgba(255,255,255,.2); border-radius: 0;
  color: var(--white); font-size: 13px; font-weight: 700;
  padding: 2px 4px; outline: none; min-width: 0;
}
.team-name-input:focus { border-bottom-color: var(--gold); }
.team-name-input[readonly] { cursor: default; border-bottom-color: transparent; opacity: 0.7; }
.team-score-display {
  font-size: 16px; font-weight: 900; color: var(--jep-gold);
  font-family: 'Georgia', serif; min-width: 40px; text-align: right;
  text-shadow: 0 0 10px rgba(87,242,135,.3); transition: text-shadow .3s;
}
.team-score-display.score-bump { animation: scorePop 0.4s cubic-bezier(.16,1,.3,1); }
.team-adj-btns { display: flex; gap: 3px; }
.team-adj-btn {
  width: 26px; height: 26px; border-radius: 6px;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,.07); color: var(--white);
  font-size: 14px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s; line-height: 1;
}
.team-adj-btn:hover          { background: rgba(255,255,255,.15); }
.team-adj-btn.plus:hover     { background: rgba(87,242,135,.2);  border-color: var(--green); }
.team-adj-btn.minus:hover    { background: rgba(237,66,69,.2);   border-color: var(--red); }

/* ── BUZZER PANEL (host) ──────────────────────────────────── */
.buzzer-panel {
  margin: 4px 10px 8px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--glass-border);
  border-radius: 12px; padding: 12px 12px 10px;
  display: flex; flex-direction: column; gap: 10px;
}
.buzzer-idle-hint {
  font-size: 12px; font-weight: 600; color: var(--text2);
  text-align: center; padding: 6px 0; letter-spacing: .5px;
}
.buzzer-active-card {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255, 200, 50, 0.10);
  border: 1px solid rgba(255, 200, 50, 0.30);
  border-radius: 10px; padding: 8px 12px;
  animation: buzzCardPop .25s ease;
}
@keyframes buzzCardPop {
  from { transform: scale(.95); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.buzzer-active-icon { font-size: 22px; flex-shrink: 0; }
.buzzer-active-info { flex: 1; min-width: 0; }
.buzzer-active-name {
  font-size: 15px; font-weight: 900; color: var(--gold);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.buzzer-active-team {
  font-size: 11px; color: var(--text2); font-weight: 600; margin-top: 1px;
}
.buzzer-actions-row {
  display: flex; gap: 6px; align-items: center;
}
.buzzer-action-btn {
  flex: 1; font-size: 12px !important; padding: 7px 6px !important;
}
#host-buzz-btn {
  flex: 1; padding: 7px 10px; border-radius: 8px;
  font-size: 12px; font-weight: 800; letter-spacing: .5px;
}
.btn-green {
  background: rgba(87,242,135,0.15);
  border: 1px solid rgba(87,242,135,0.4);
  color: var(--green);
}
.btn-green:hover {
  background: rgba(87,242,135,0.25);
  box-shadow: 0 0 14px rgba(87,242,135,.2);
}

/* ── BUZZ QUEUE (host) ────────────────────────────────────── */
.buzz-queue-panel {
  margin: 0 10px 8px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--glass-border);
  border-radius: 10px; padding: 10px 12px;
}
.buzz-queue-list {
  display: flex; flex-direction: column; gap: 5px; min-height: 10px;
}
.buzz-queue-item {
  font-size: 12px; color: var(--text);
  padding: 4px 8px;
  background: rgba(87,242,135,0.05);
  border: 1px solid rgba(87,242,135,0.15); border-radius: 7px;
}
.buzz-queue-item .bq-rank {
  font-weight: 800; color: var(--gold); margin-right: 5px;
}

/* ══════════════════════════════════════════════════════════
   QUESTION OVERLAY (covers board area, sidebar stays visible)
   ══════════════════════════════════════════════════════════ */
#question-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,10,.96); backdrop-filter: blur(8px);
  z-index: 300; display: none;
  flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 32px 180px; text-align: center;
  overflow-y: auto; transition: opacity 0.25s ease;
}
#question-overlay.open { display: flex; }
#question-overlay.visible { animation: fadeSlideUp 0.35s cubic-bezier(.22,.68,0,1.2) both; }

.qoverlay-cat {
  font-size: 13px; font-weight: 800; letter-spacing: 4px;
  color: var(--text2); text-transform: uppercase; margin-bottom: 8px;
}
.qoverlay-points {
  font-size: 64px; font-weight: 900; color: var(--jep-gold);
  font-family: 'Georgia', serif;
  text-shadow: 0 0 40px rgba(87,242,135,.7); margin-bottom: 32px;
}
.qoverlay-question {
  font-size: clamp(20px, 3vw, 32px); font-weight: 700; color: var(--white);
  line-height: 1.5; max-width: 800px; margin-bottom: 24px;
  text-shadow: 0 2px 8px rgba(0,0,0,.5);
}
.qoverlay-question-img {
  max-width: min(90%, 600px); max-height: 360px; border-radius: 12px;
  margin-bottom: 24px; display: none; box-shadow: 0 8px 32px rgba(0,0,0,.6);
}
.qoverlay-answer-label {
  font-size: 12px; font-weight: 800; letter-spacing: 3px; color: var(--green);
  text-transform: uppercase; margin-bottom: 12px; margin-top: 24px; display: none;
}
.qoverlay-answer {
  font-size: clamp(18px, 2.5vw, 26px); font-weight: 800; color: var(--jep-gold);
  font-family: 'Georgia', serif;
  text-shadow: 0 0 20px rgba(87,242,135,1), 0 0 40px rgba(87,242,135,.4);
  max-width: 700px; line-height: 1.4; margin-bottom: 16px; display: none;
}
.qoverlay-answer-img {
  max-width: min(90%, 600px); max-height: 300px; border-radius: 12px;
  margin-bottom: 24px; display: none; box-shadow: 0 8px 32px rgba(0,0,0,.6);
}
.qoverlay-actions {
  display: flex; gap: 14px; flex-wrap: wrap;
  justify-content: center; margin-top: 8px;
}
.qoverlay-hint { font-size: 13px; color: var(--text2); margin-top: 12px; }

#qoverlay-timer-row {
  display: flex; align-items: center; gap: 10px;
  justify-content: center; margin-bottom: 6px;
}
#qoverlay-timer-bar-wrap {
  width: 100%; max-width: 600px; height: 8px;
  background: rgba(255,255,255,.1); border-radius: 4px; overflow: hidden;
}
#qoverlay-timer-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--green), #b0ffe8);
  border-radius: 4px; transition: width .9s linear;
}

/* ── Score flash animations (same as player) ─────────── */
@keyframes scoreFlashGreen {
  0%   { background: rgba(87,242,135,.35); color: var(--green); }
  70%  { background: rgba(87,242,135,.1);  color: var(--green); }
  100% { background: transparent;          color: var(--text); }
}
@keyframes scoreFlashRed {
  0%   { background: rgba(237,66,69,.35); color: var(--red); }
  70%  { background: rgba(237,66,69,.1);  color: var(--red); }
  100% { background: transparent;         color: var(--text); }
}
.team-score-display.flash-up   { animation: scoreFlashGreen .6s ease forwards; }
.team-score-display.flash-down { animation: scoreFlashRed   .6s ease forwards; }

/* ══════════════════════════════════════════════════════════
   MODAL SPECIFICS (question / image search / image editor)
   ══════════════════════════════════════════════════════════ */
.question-section      { margin-bottom: 20px; }
.question-section-title {
  font-size: 11px; font-weight: 800; letter-spacing: 2px;
  color: var(--gold); text-transform: uppercase; margin-bottom: 10px;
}
.image-preview-wrap {
  display: flex; align-items: center; gap: 10px; margin-top: 10px;
}
.image-preview-wrap img {
  width: 80px; height: 56px; object-fit: cover;
  border-radius: 6px; border: 1px solid var(--glass-border);
}
.image-search-header { display: flex; gap: 10px; margin-bottom: 20px; }
.image-results-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px; max-height: 360px; overflow-y: auto;
}
.image-result-item {
  border-radius: 8px; overflow: hidden; cursor: pointer;
  border: 2px solid transparent; transition: border-color .2s;
}
.image-result-item:hover { border-color: var(--gold); }
.image-result-item img { width: 100%; height: 100px; object-fit: cover; display: block; }

.image-editor-layout { display: flex; gap: 24px; align-items: flex-start; }
.image-editor-canvas-wrap { flex: 1; min-width: 0; position: relative; }
#editor-canvas {
  display: block; width: 100%; max-width: 400px;
  border-radius: 8px; border: 1px solid var(--glass-border); cursor: crosshair;
}
#crop-overlay {
  position: absolute; border: 2px dashed #ff4444;
  pointer-events: none; display: none;
}
.image-editor-controls {
  width: 220px; flex-shrink: 0;
  display: flex; flex-direction: column; gap: 14px;
}
.control-row { display: flex; flex-direction: column; gap: 6px; }
.control-row label { margin-bottom: 0; }
.slider-row { display: flex; align-items: center; gap: 8px; }
.slider-row input[type=range] { flex: 1; accent-color: var(--gold); }
.slider-val { font-size: 12px; color: var(--text2); min-width: 32px; text-align: right; }
.filter-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-btn {
  padding: 5px 10px; font-size: 12px; font-weight: 600; border-radius: 6px;
  background: rgba(255,255,255,.07); border: 1px solid var(--glass-border);
  color: var(--text); cursor: pointer; transition: all .15s;
}
.filter-btn:hover, .filter-btn.active { background: var(--gold); border-color: var(--gold); color: #000; }

/* ══════════════════════════════════════════════════════════
   FEATURES
   ══════════════════════════════════════════════════════════ */

/* Animated score pop */
@keyframes scorePop {
  0%   { transform: scale(1.4); }
  100% { transform: scale(1); }
}
.score-pop { animation: scorePop 0.4s cubic-bezier(.16,1,.3,1); display: inline-block; }

/* Setup modal */
.team-count-row {
  display: flex; align-items: center; justify-content: center; gap: 20px; margin: 16px 0;
}
.count-btn {
  width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid var(--gold); background: transparent;
  color: var(--gold); font-size: 24px; font-weight: 900; cursor: pointer; transition: all .15s;
}
.count-btn:hover { background: rgba(87,242,135,.15); }
.count-display {
  font-size: 40px; font-weight: 900; color: var(--gold);
  min-width: 56px; text-align: center; font-family: 'Georgia', serif;
}
.setup-team-inputs  { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.setup-team-row     { display: flex; align-items: center; gap: 10px; }
.setup-team-row label { min-width: 60px; margin-bottom: 0; font-size: 12px; }

/* Preview tooltip */
.preview-tooltip {
  position: fixed; z-index: 500;
  background: rgba(10,10,40,0.97);
  border: 1px solid rgba(87,242,135,0.35); border-radius: 10px;
  padding: 10px 14px; max-width: 260px;
  pointer-events: none; backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0,0,0,.6);
  font-size: 13px; line-height: 1.5; display: none;
}
.preview-tooltip .pt-q     { color: var(--white); font-weight: 600; margin-bottom: 6px; }
.preview-tooltip .pt-a     { color: var(--jep-gold); font-weight: 700; font-size: 12px; }
.preview-tooltip .pt-label {
  font-size: 10px; font-weight: 800; letter-spacing: 2px;
  text-transform: uppercase; color: var(--text2); margin-bottom: 2px;
}

/* Final scores overlay */
#final-scores-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,10,.97); backdrop-filter: blur(16px);
  z-index: 9000; display: none;
  flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 40px 24px; overflow-y: auto;
}
#final-scores-overlay.open { display: flex; }
.final-gameover {
  font-family: 'Bebas Neue', cursive;
  font-size: clamp(56px, 12vw, 100px); color: var(--jep-gold);
  letter-spacing: 6px;
  text-shadow: 0 0 60px rgba(87,242,135,.8), 0 0 120px rgba(87,242,135,.4);
  animation: goldGlow 2s ease-in-out infinite; margin-bottom: 8px;
}
.final-leaderboard {
  display: flex; flex-direction: column; gap: 12px;
  margin: 28px 0; width: 100%; max-width: 520px;
}
.final-lb-row {
  display: flex; align-items: center; gap: 14px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(87,242,135,.2);
  border-radius: 14px; padding: 14px 20px;
  font-size: 18px; font-weight: 800;
}
.final-lb-row.rank-1 { border-color: #57F287; background: rgba(87,242,135,.08); }
.final-lb-row.rank-2 { border-color: #c0c0c0; background: rgba(192,192,192,.05); }
.final-lb-row.rank-3 { border-color: #cd7f32; background: rgba(205,127,50,.05); }
.final-lb-medal  { font-size: 28px; min-width: 36px; }
.final-lb-name   { flex: 1; text-align: left; color: var(--white); }
.final-lb-score  { font-size: 22px; color: var(--jep-gold); font-family: 'Georgia', serif; }
#final-confetti-canvas {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%; pointer-events: none;
}

/* QR code modal */
#qr-img {
  width: 200px; height: 200px; border-radius: 8px;
  border: 2px solid var(--jep-gold); margin: 16px auto 0; display: block;
}

/* Scrollbar (gold accent for host/editor) */
::-webkit-scrollbar       { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(87,242,135,.2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(87,242,135,.35); }

/* Range input (gold thumb) */
input[type=range] {
  -webkit-appearance: none; appearance: none; height: 4px;
  background: rgba(255,255,255,.15); border-radius: 2px;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 14px; height: 14px;
  border-radius: 50%; background: var(--gold); cursor: pointer;
}
