/* ═══════════════════════════════════════════════════════════════
   QVIZIO — Notebook / Paper Theme
   ═══════════════════════════════════════════════════════════════ */

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  /* Paper / Notebook Colors */
  --bg-primary: #f9f7f1;
  --bg-secondary: #f3f0e7;
  --bg-tertiary: #ede9dd;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.75);
  --bg-hover: rgba(99, 102, 241, 0.08);

  --text-primary: #2d2d2d;
  --text-secondary: #5f5f5f;
  --text-muted: #9e9e9e;

  --accent-primary: #4f46e5;
  --accent-secondary: #0891b2;
  --accent-warm: #d97706;
  --accent-danger: #dc2626;
  --accent-success: #16a34a;

  --gradient-main: linear-gradient(135deg, #4f46e5 0%, #0891b2 100%);
  --gradient-warm: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  --gradient-danger: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  --gradient-success: linear-gradient(135deg, #16a34a 0%, #0891b2 100%);

  --border-color: rgba(0, 0, 0, 0.1);
  --border-glow: rgba(99, 102, 241, 0.3);

  --shadow-sm: 2px 3px 6px rgba(0, 0, 0, 0.08);
  --shadow-md: 2px 4px 10px rgba(0, 0, 0, 0.1);
  --shadow-lg: 3px 6px 20px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.1);

  /* Notebook-specific */
  --line-blue: rgba(164, 191, 227, 0.45);
  --paper-bg: #f9f7f1;
  --sidebar-bg: #ffffff;
  --yellow-note: #fef9c3;
  --yellow-note-dark: #fef08a;
  --tape-color: rgba(254, 249, 195, 0.65);

  /* Typography */
  --font-display: "Patrick Hand", cursive;
  --font-main: "Roboto Slab", serif;
  --font-mono: "JetBrains Mono", monospace;

  /* Spacing */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-secondary);
  text-decoration: none;
}

input,
select,
textarea,
button {
  font-family: var(--font-main);
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ── Selection ─────────────────────────────────────────────── */
::selection {
  background: #fef08a;
  color: #1f2937;
}

/* ── Particles Canvas (subtle in notebook theme) ───────────── */
#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.08;
}

/* ── View System ───────────────────────────────────────────── */
.view {
  display: none;
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.view.active {
  display: flex;
}

/* ── Glass Card → Paper Card ───────────────────────────────── */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

/* ── Glow Card → Clean Notebook Card ───────────────────────── */
.glow-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: var(--transition);
  position: relative;
  overflow: visible;
  box-shadow: var(--shadow-md);
}

.glow-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.5rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
  font-family: var(--font-display);
  letter-spacing: 0.5px;
  transition: var(--transition);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0);
  transition: var(--transition);
}

.btn:hover::after {
  background: rgba(255, 255, 255, 0.1);
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: #3b82f6;
  color: white;
  box-shadow: 2px 3px 8px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
  background: #2563eb;
  box-shadow: 2px 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-accent {
  background: #06b6d4;
  color: white;
  box-shadow: 2px 3px 8px rgba(6, 182, 212, 0.3);
}

.btn-accent:hover {
  background: #0891b2;
}

.btn-warm {
  background: #f59e0b;
  color: #1a1a2e;
  box-shadow: 2px 3px 8px rgba(245, 158, 11, 0.3);
}

.btn-warm:hover {
  background: #d97706;
}

.btn-danger {
  background: #ef4444;
  color: white;
  box-shadow: 2px 3px 8px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-ghost {
  background: white;
  color: var(--text-secondary);
  border: 2px solid var(--border-color);
  box-shadow: none;
}

.btn-ghost:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.04);
}

.btn-sm {
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
}

.btn-full {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ── Inputs ────────────────────────────────────────────────── */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: 100%;
}

.input-group label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: var(--font-display);
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="url"],
input[type="number"],
select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: white;
  border: 2px solid #d1d5db;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1.05rem;
  transition: var(--transition);
  outline: none;
  font-family: var(--font-display);
}

input:focus,
select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

input::placeholder {
  color: var(--text-muted);
}

.input-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
}

.input-row-3col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.75rem;
}

/* ── Toggle Switch ─────────────────────────────────────────── */
.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-family: var(--font-display);
}

.toggle-label input {
  display: none;
}

.toggle-switch {
  width: 44px;
  height: 24px;
  background: #d1d5db;
  border-radius: 12px;
  position: relative;
  transition: var(--transition);
  border: 2px solid #b0b5bd;
}

.toggle-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
  box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.15);
}

.toggle-label input:checked+.toggle-switch {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.toggle-label input:checked+.toggle-switch::after {
  transform: translateX(20px);
  background: white;
}

/* ═══════════════════════════════════════════════════════════════
   AUTH VIEW
   ═══════════════════════════════════════════════════════════════ */
#view-auth {
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background-color: var(--paper-bg);
  background-image:
    linear-gradient(var(--line-blue) 1px, transparent 1px),
    url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  background-size:
    100% 2rem,
    auto;
}

#view-profile-setup {
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background-color: var(--paper-bg);
  background-image:
    linear-gradient(var(--line-blue) 1px, transparent 1px),
    url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  background-size:
    100% 2rem,
    auto;
}

.auth-container {
  width: 100%;
  max-width: 440px;
}

.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.logo-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1rem;
  animation: float 5s ease-in-out infinite;
}

.logo-icon svg rect {
  fill: #4f46e5;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0) rotate(-3deg);
  }

  50% {
    transform: translateY(-8px) rotate(2deg);
  }
}

.logo-text {
  font-size: 3.5rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: #312e81;
  letter-spacing: 6px;
}

.logo-tagline {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-top: 0.25rem;
  font-family: var(--font-display);
}

.auth-card {
  padding: 2rem;
  background: white;
  border: 2px solid #d1d5db;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  position: relative;
}

.auth-card::before {
  display: none;
}

.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
  background: #f3f4f6;
  border-radius: 999px;
  padding: 4px;
  border: 2px solid #e5e7eb;
}

.auth-tab {
  flex: 1;
  padding: 0.6rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-weight: 700;
  cursor: pointer;
  border-radius: 999px;
  transition: var(--transition);
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.auth-tab.active {
  background: var(--accent-primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-form.hidden {
  display: none;
}

.auth-error {
  background: rgba(239, 68, 68, 0.1);
  border: 2px solid rgba(239, 68, 68, 0.25);
  color: #dc2626;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-top: 0.75rem;
  font-family: var(--font-display);
}

.auth-error.hidden {
  display: none;
}

/* ── QVIZIO Auth Components ────────────────────────────────── */
.qv-google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0.85rem 1rem;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-display);
}

.qv-google-btn:hover {
  background: #f9fafb;
  border-color: #d1d5db;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.qv-divider {
  display: flex;
  align-items: center;
  margin: 1.25rem 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.qv-divider::before,
.qv-divider::after {
  content: "";
  flex: 1;
  height: 2px;
  background: #e5e7eb;
  border-radius: 1px;
}

.qv-divider span {
  padding: 0 14px;
}

.input-group {
  position: relative;
}

.qv-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  z-index: 1;
  display: flex;
  align-items: center;
}

.qv-input {
  padding-left: 42px !important;
}

.qv-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 0.25rem;
  padding: 0.85rem 1rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.qv-forgot {
  text-align: right;
  margin-top: 4px;
  margin-bottom: 0;
}

.qv-forgot a {
  color: var(--accent-primary);
  font-size: 0.8rem;
  text-decoration: none;
  font-family: var(--font-display);
  transition: color 0.2s;
}

.qv-forgot a:hover {
  color: var(--accent-secondary);
  text-decoration: underline;
}

/* ── Avatar Upload ─────────────────────────────────────────── */
.qv-avatar-upload {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 4px;
  border-radius: 50%;
  cursor: pointer;
  overflow: hidden;
  border: 3px solid var(--accent-primary);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.25);
  transition: all 0.3s ease;
}

.qv-avatar-upload:hover {
  border-color: var(--accent-secondary);
  box-shadow: 0 4px 24px rgba(99, 102, 241, 0.4);
  transform: scale(1.03);
}

.qv-avatar-upload.drag-over {
  border-color: #00ceff;
  box-shadow:
    0 0 0 4px rgba(0, 206, 255, 0.2),
    0 4px 24px rgba(0, 206, 255, 0.3);
  transform: scale(1.06);
}

.qv-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.qv-avatar-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.25s ease;
  font-size: 0.7rem;
  color: white;
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.qv-avatar-upload:hover .qv-avatar-overlay,
.qv-avatar-upload.drag-over .qv-avatar-overlay {
  opacity: 1;
}

.qv-avatar-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-family: var(--font-display);
  margin-bottom: 0;
}

/* ═══════════════════════════════════════════════════════════════
   DASHBOARD LAYOUT
   ═══════════════════════════════════════════════════════════════ */
#view-dashboard {
  flex-direction: column;
}

/* ── Top Nav ───────────────────────────────────────────────── */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  height: 64px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 2px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-brand svg rect {
  fill: #4f46e5;
}

.brand-text {
  font-size: 1.6rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: #312e81;
  letter-spacing: 3px;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient-main);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.nav-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.nav-avatar-letter {
  font-weight: 800;
  font-size: 1rem;
  color: white;
  font-family: var(--font-display);
}

.nav-user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.nav-username {
  font-weight: 700;
  font-size: 1.1rem;
  font-family: var(--font-display);
  color: var(--text-primary);
}

.nav-elo {
  font-size: 0.8rem;
  color: var(--accent-warm);
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-elo svg {
  flex-shrink: 0;
}

/* ── Dashboard Grid ────────────────────────────────────────── */
.dashboard-layout {
  display: grid;
  grid-template-columns: 240px 1fr 280px;
  height: calc(100vh - 64px);
}

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  background: white;
  border-right: 3px solid #e5e7eb;
  padding: 1.5rem 0.75rem;
  position: relative;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.04);
}

/* Notebook holes decoration — removed for cleaner look */

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-left: 20px;
}

.sidebar-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--text-secondary);
  font-size: 1.05rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  width: 100%;
  text-align: left;
  font-family: var(--font-display);
  transform: translateX(0);
}

.sidebar-btn:hover {
  background: rgba(99, 102, 241, 0.06);
  color: var(--text-primary);
  transform: translateX(4px);
}

.sidebar-btn.active {
  background: rgba(79, 70, 229, 0.10);
  color: var(--accent-primary);
  border-left: 4px solid var(--accent-primary);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.06);
}

.sidebar-btn.active svg {
  stroke: var(--accent-primary);
}

.sidebar-badge {
  margin-left: auto;
  background: #ef4444;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  min-width: 20px;
  text-align: center;
  font-family: var(--font-mono);
}

.sidebar-badge.hidden {
  display: none;
}

/* ── Main Content ──────────────────────────────────────────── */
.main-content {
  overflow-y: auto;
  padding: 2rem 2.5rem;
  background-color: var(--paper-bg);
  background-image:
    linear-gradient(var(--line-blue) 1px, transparent 1px),
    url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  background-size:
    100% 2rem,
    auto;
  background-attachment: local;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
  animation: panelFadeIn 0.2s ease;
}

@keyframes panelFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  font-family: var(--font-display);
  color: var(--text-primary);
}

.section-subtitle {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.subsection-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin: 1.5rem 0 0.75rem;
  font-family: var(--font-display);
}

/* ── Text Helpers ──────────────────────────────────────────── */
.text-gradient {
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-muted {
  color: var(--text-muted);
}

.hidden {
  display: none !important;
}

/* ═══════════════════════════════════════════════════════════════
   HOME PANEL — Action Cards
   ═══════════════════════════════════════════════════════════════ */
.home-hero {
  margin-bottom: 0.75rem;
}

.home-hero .section-title {
  font-size: 1.6rem;
}

.home-hero .section-subtitle {
  margin-bottom: 0.75rem;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.action-card {
  text-align: center;
  padding-top: 1rem;
  padding-bottom: 1.25rem;
}

.action-card-icon {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
  background: rgba(99, 102, 241, 0.08);
  color: var(--accent, var(--accent-primary));
  transition: var(--transition);
}

.action-card:hover .action-card-icon {
  background: rgba(99, 102, 241, 0.15);
  transform: scale(1.08) rotate(-2deg);
}

.action-card h3 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  font-family: var(--font-display);
}

.action-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.action-card .btn {
  font-family: var(--font-display);
  font-size: 1.15rem;
  padding: 0.6rem 2rem;
  transition: var(--transition);
}

/* Different tinted backgrounds per card */
#card-quick-game {
  background: #eff6ff;
  border-color: #bfdbfe;
}

#card-quick-game .action-card-icon {
  background: rgba(59, 130, 246, 0.1);
}

#card-custom-game {
  background: #ecfeff;
  border-color: #a5f3fc;
}

#card-custom-game .action-card-icon {
  background: rgba(6, 182, 212, 0.1);
}

#card-preset-game {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

#card-preset-game .action-card-icon {
  background: rgba(22, 163, 74, 0.1);
}

#card-solo-mode {
  background: #fefce8;
  border-color: #fef08a;
}

#card-solo-mode .action-card-icon {
  background: rgba(202, 138, 4, 0.1);
}

#card-tournament-mode {
  background: #faf5ff;
  border-color: #e9d5ff;
}

#card-tournament-mode .action-card-icon {
  background: rgba(147, 51, 234, 0.1);
}

#card-wrong-answers {
  background: #fff1f2;
  border-color: #fecdd3;
}

#card-wrong-answers .action-card-icon {
  background: rgba(225, 29, 72, 0.08);
}

/* Alternate tape rotation */
#card-custom-game::before,
#card-tournament-mode::before {
  transform: translateX(-50%) rotate(-2deg);
}

/* Pin decorations removed for cleaner look */

/* ═══════════════════════════════════════════════════════════════
   LOBBY BROWSER
   ═══════════════════════════════════════════════════════════════ */
.lobby-controls {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.lobby-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.lobby-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: var(--radius-md);
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.lobby-item:hover {
  border-color: var(--border-glow);
  background: #f8faff;
  transform: translateY(-1px);
}

.lobby-item-info h4 {
  font-size: 1.05rem;
  font-weight: 700;
  font-family: var(--font-display);
}

.lobby-item-info span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.lobby-item-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.lobby-item-players {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-secondary);
}

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 1.1rem;
  background: rgba(255, 255, 255, 0.6);
  border: 2px dashed #d1d5db;
  border-radius: var(--radius-lg);
}

.empty-state svg {
  margin-bottom: 1rem;
  opacity: 0.25;
}

.empty-state p {
  max-width: 320px;
  margin: 0 auto;
  line-height: 1.5;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ═══════════════════════════════════════════════════════════════
   LEADERBOARD
   ═══════════════════════════════════════════════════════════════ */
.leaderboard-table {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.lb-row {
  display: grid;
  grid-template-columns: 50px 1fr 120px 100px;
  align-items: center;
  padding: 0.75rem 1rem;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.04);
}

.lb-row:hover {
  border-color: var(--border-glow);
  background: #f8faff;
}

.lb-row.lb-header {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: var(--font-display);
  box-shadow: none;
}

.lb-rank {
  font-weight: 800;
  font-size: 1.2rem;
  font-family: var(--font-display);
}

.lb-rank.gold {
  color: #d97706;
}

.lb-rank.silver {
  color: #6b7280;
}

.lb-rank.bronze {
  color: #92400e;
}

.lb-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lb-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: white;
  font-family: var(--font-display);
  overflow: hidden;
}

.lb-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.lb-username {
  font-weight: 700;
  font-family: var(--font-display);
}

.lb-elo {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-warm);
}

.lb-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  text-align: center;
  font-family: var(--font-display);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1.5px solid transparent;
}

/* Rank badge color variants */
.lb-badge[style*="cd7f32"] { background: #fef3c7; border-color: #f59e0b; color: #92400e; }
.lb-badge[style*="c0c0c0"] { background: #f1f5f9; border-color: #94a3b8; color: #475569; }
.lb-badge[style*="ffd700"] { background: #fef9c3; border-color: #eab308; color: #854d0e; }
.lb-badge[style*="e5e4e2"] { background: #f0f9ff; border-color: #7dd3fc; color: #0369a1; }
.lb-badge[style*="b9f2ff"] { background: #ecfeff; border-color: #22d3ee; color: #0e7490; }
.lb-badge[style*="9b59b6"] { background: #faf5ff; border-color: #a855f7; color: #7e22ce; }
.lb-badge[style*="e74c3c"] { background: #fff1f2; border-color: #f43f5e; color: #be123c; }

/* Top 3 leaderboard rows */
.lb-row:nth-child(2) {
  background: linear-gradient(90deg, rgba(234, 179, 8, 0.08) 0%, white 100%);
  border-color: #fde68a;
}
.lb-row:nth-child(3) {
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.08) 0%, white 100%);
  border-color: #cbd5e1;
}
.lb-row:nth-child(4) {
  background: linear-gradient(90deg, rgba(180, 83, 9, 0.06) 0%, white 100%);
  border-color: #fed7aa;
}

/* ═══════════════════════════════════════════════════════════════
   PROFILE
   ═══════════════════════════════════════════════════════════════ */
.profile-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--gradient-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 800;
  color: white;
  position: relative;
  font-family: var(--font-display);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.profile-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  position: relative;
  z-index: 1;
}

.profile-avatar::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 3px solid transparent;
  background: linear-gradient(white, white) padding-box, var(--gradient-main) border-box;
  opacity: 0.5;
}

.profile-name {
  font-size: 2rem;
  font-weight: 700;
  font-family: var(--font-display);
}

.profile-rank-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
  font-family: var(--font-display);
}

.rank-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-elo-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.elo-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  font-family: var(--font-display);
}

.elo-value {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-warm);
  font-size: 1.1rem;
}

.profile-bio {
  margin-bottom: 1.5rem;
}

.bio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.bio-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-secondary);
  font-family: var(--font-display);
}

.bio-text {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-primary);
  font-style: italic;
  font-family: var(--font-display);
  padding: 0.75rem 1rem;
  background: rgba(79, 70, 229, 0.04);
  border-left: 3px solid var(--accent-primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  text-align: center;
  padding: 1.25rem 1rem;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Color-code individual stat cards */
.stat-card:nth-child(1) { border-bottom: 3px solid #22c55e; }
.stat-card:nth-child(2) { border-bottom: 3px solid #ef4444; }
.stat-card:nth-child(3) { border-bottom: 3px solid #3b82f6; }
.stat-card:nth-child(4) { border-bottom: 3px solid var(--accent-primary); }

.stat-value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--accent-primary);
}

.stat-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 0.25rem;
  letter-spacing: 0.5px;
  font-family: var(--font-display);
}

.profile-categories {
  margin-bottom: 1.5rem;
}

.profile-categories h3 {
  margin-bottom: 1rem;
  font-family: var(--font-display);
}

.category-stats-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cat-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--border-color);
}

.cat-stat-name {
  font-weight: 700;
  font-family: var(--font-display);
}

.cat-stat-bar {
  flex: 1;
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  margin: 0 1rem;
  overflow: hidden;
}

.cat-stat-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--gradient-main);
  transition: width 0.5s ease;
}

.cat-stat-value {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-secondary);
  min-width: 50px;
  text-align: right;
}

/* ═══════════════════════════════════════════════════════════════
   FRIENDS
   ═══════════════════════════════════════════════════════════════ */
.friends-add {
  margin-bottom: 1rem;
}

.friends-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.friend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.friend-item-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.friend-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  font-size: 0.9rem;
  font-family: var(--font-display);
}

.friend-name {
  font-weight: 700;
  font-family: var(--font-display);
}

.friend-status {
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot.online {
  background: #16a34a;
  box-shadow: 0 0 6px rgba(22, 163, 74, 0.5);
}

.status-dot.offline {
  background: var(--text-muted);
}

.friend-item-actions {
  display: flex;
  gap: 0.5rem;
}

/* ── DM Panel ──────────────────────────────────────────────── */
.dm-panel {
  margin-top: 1.5rem;
  max-height: 400px;
  display: flex;
  flex-direction: column;
}

.dm-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px dashed var(--border-color);
  margin-bottom: 0.75rem;
}

.dm-username {
  font-weight: 700;
  font-family: var(--font-display);
}

.dm-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem 0;
  min-height: 200px;
  max-height: 250px;
}

.dm-msg {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  max-width: 80%;
  font-size: 0.9rem;
  line-height: 1.4;
  font-family: var(--font-display);
}

.dm-msg.sent {
  background: rgba(59, 130, 246, 0.12);
  margin-left: auto;
  border-bottom-right-radius: 4px;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.dm-msg.received {
  background: #f3f4f6;
  margin-right: auto;
  border-bottom-left-radius: 4px;
  border: 1px solid #e5e7eb;
}

.dm-msg .dm-msg-author {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-primary);
  margin-bottom: 0.15rem;
}

.dm-input-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.dm-input-row input {
  flex: 1;
  padding: 0.5rem 0.75rem;
}

/* ═══════════════════════════════════════════════════════════════
   TOURNAMENT
   ═══════════════════════════════════════════════════════════════ */
.tournament-create {
  margin-bottom: 1.5rem;
}

.tournament-create h3 {
  margin-bottom: 1rem;
  font-family: var(--font-display);
}

.tournament-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tourney-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: var(--radius-md);
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.tourney-item:hover {
  border-color: var(--border-glow);
  background: #f8faff;
}

.tourney-item-info h4 {
  font-weight: 700;
  font-family: var(--font-display);
}

.tourney-item-info span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.tourney-item-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.tourney-players {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-secondary);
}

/* ═══════════════════════════════════════════════════════════════
   CHAT SIDEBAR — Yellow notepad style
   ═══════════════════════════════════════════════════════════════ */
.chat-sidebar {
  background: #fefdf8;
  border-left: 2px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 64px);
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.04);
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 2px solid #e5e7eb;
  background: rgba(255, 255, 255, 0.6);
}

.chat-header h3 {
  font-size: 1.3rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--text-primary);
}

.chat-online {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.online-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #16a34a;
  border: 2px solid #15803d;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: #fafaf8;
}

.chat-msg {
  font-size: 0.9rem;
  line-height: 1.4;
  word-break: break-word;
  font-family: var(--font-display);
}

.chat-msg-author {
  font-weight: 700;
  color: var(--accent-primary);
  margin-right: 0.35rem;
  font-size: 0.85rem;
}

.chat-msg-text {
  color: var(--text-secondary);
}

.chat-msg-time {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-left: 0.35rem;
}

.chat-input-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 2px solid #e5e7eb;
  background: white;
}

.chat-input-row input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  font-family: var(--font-display);
  border: 2px solid #d1d5db;
  border-radius: var(--radius-md);
}

/* ═══════════════════════════════════════════════════════════════
   OVERLAYS & MODALS
   ═══════════════════════════════════════════════════════════════ */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(249, 247, 241, 0.9);
  backdrop-filter: blur(8px);
}

.overlay.hidden {
  display: none;
}

.overlay-content {
  text-align: center;
  max-width: 400px;
  padding: 3rem;
}

.overlay-content h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
}

.overlay-content p {
  font-family: var(--font-display);
}

.queue-spinner {
  width: 64px;
  height: 64px;
  border: 4px solid #e5e7eb;
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  margin: 0 auto 1.5rem;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  z-index: 1;
  width: 90%;
  max-width: 480px;
  padding: 2rem;
  animation: modal-in 0.3s ease;
  background: white;
  border: 2px solid #d1d5db;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

/* Tape decoration removed for cleaner modals */

@keyframes modal-in {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }

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

.modal-content h2 {
  margin-bottom: 1.25rem;
  font-size: 1.6rem;
  font-family: var(--font-display);
}

.modal-content .input-group {
  margin-bottom: 1rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* ── Preset Cards ──────────────────────────────────────────── */
.preset-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.preset-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  width: 100%;
  color: var(--text-primary);
  font-family: var(--font-main);
  box-shadow: var(--shadow-sm);
}

.preset-card:hover {
  border-color: #86efac;
  background: #f0fdf4;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.preset-card:active {
  transform: scale(0.98);
}

.preset-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.preset-card-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.preset-card-info h4 {
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-display);
}

.preset-card-info span {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-display);
}

/* ═══════════════════════════════════════════════════════════════
   LOBBY WAITING VIEW
   ═══════════════════════════════════════════════════════════════ */
#view-lobby {
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background-color: var(--paper-bg);
  background-image: linear-gradient(var(--line-blue) 1px, transparent 1px);
  background-size: 100% 2rem;
}

.lobby-view-container {
  width: 100%;
  max-width: 600px;
}

.lobby-info-card {
  text-align: center;
  background: white;
  border: 2px solid #d1d5db;
  box-shadow: var(--shadow-md);
}

.lobby-info-card h2 {
  font-size: 1.6rem;
  margin-bottom: 0.75rem;
  font-family: var(--font-display);
}

.lobby-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-family: var(--font-display);
}

.lobby-code {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-secondary);
  font-size: 1.1rem;
  letter-spacing: 3px;
  background: rgba(6, 182, 212, 0.1);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(6, 182, 212, 0.2);
}

.lobby-players-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.lobby-player-card {
  text-align: center;
  padding: 1rem;
  background: #f9fafb;
  border-radius: var(--radius-md);
  min-width: 120px;
  border: 2px solid #e5e7eb;
}

.lobby-player-card.ready {
  border-color: #16a34a;
  background: #f0fdf4;
}

.lobby-player-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gradient-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  margin: 0 auto 0.5rem;
  font-size: 1.2rem;
  font-family: var(--font-display);
}

.lobby-player-name {
  font-weight: 700;
  font-size: 0.95rem;
  font-family: var(--font-display);
}

.lobby-player-status {
  font-size: 0.75rem;
  margin-top: 0.25rem;
  font-family: var(--font-display);
}

.lobby-player-status.ready-yes {
  color: #16a34a;
}

.lobby-player-status.ready-no {
  color: var(--text-muted);
}

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

/* ═══════════════════════════════════════════════════════════════
   GAME VIEW
   ═══════════════════════════════════════════════════════════════ */
#view-game {
  align-items: stretch;
  justify-content: center;
  padding: 0;
  background-color: var(--paper-bg);
  background-image: linear-gradient(var(--line-blue) 1px, transparent 1px);
  background-size: 100% 2rem;
}

.game-layout {
  display: flex;
  width: 100%;
  min-height: 100vh;
  align-items: flex-start;
}

.game-players-sidebar {
  width: 176px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: rgba(255,255,255,0.75);
  border-right: 1px solid rgba(0,0,0,0.08);
  backdrop-filter: blur(8px);
  padding: 1rem 0.75rem;
  z-index: 10;
}

.game-players-sidebar.hidden { display: none !important; }

.sidebar-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  display: block;
}

.game-players-sidebar-inner {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.sidebar-player-card {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.35rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  border: 1px solid transparent;
}

.sidebar-player-card:hover {
  background: rgba(108,92,231,0.08);
  border-color: rgba(108,92,231,0.2);
}

.sidebar-player-card.is-me {
  border-color: rgba(108,92,231,0.35);
  background: rgba(108,92,231,0.06);
}

.sidebar-player-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-player-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-player-details {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}

.sidebar-player-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-player-elo {
  font-size: 0.67rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.sidebar-more-btn {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  width: 100%;
}

.game-leave-row {
  display: flex;
  justify-content: flex-end;
  padding-top: 0.75rem;
  margin-top: auto;
}

/* In-game player profile popup */
.ingame-profile-popup {
  max-width: 320px;
  width: 90vw;
}

.ingame-profile-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.ingame-profile-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.3rem;
  color: #fff;
  flex-shrink: 0;
}

.ingame-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ingame-profile-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.ingame-profile-rank {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.ingame-profile-elo {
  font-size: 0.82rem;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent-primary);
  margin-top: 0.1rem;
}

.ingame-profile-stats {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.igp-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(0,0,0,0.04);
  border-radius: 8px;
  padding: 0.5rem 0.2rem;
  gap: 0.1rem;
}

.igp-stat span:first-child {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.igp-stat span:last-child {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.game-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
  min-height: 100vh;
}

.game-header {
  margin-bottom: 1.5rem;
}

.game-scoreboard {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.game-player {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.game-player-left {
  align-items: flex-start;
}

.game-player-right {
  align-items: flex-end;
}

.game-player-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-secondary);
  font-family: var(--font-display);
}

.game-player-score {
  font-size: 2.5rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--accent-primary);
}

.game-vs {
  text-align: center;
}

.game-question-counter {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  font-family: var(--font-display);
}

.game-timer-bar {
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid #d1d5db;
}

.game-timer-fill {
  height: 100%;
  background: #3b82f6;
  border-radius: 3px;
  transition: width 0.1s linear;
  width: 100%;
}

.game-timer-fill.warning {
  background: #f59e0b;
}

.game-timer-fill.danger {
  background: #ef4444;
}

.game-question-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.game-topic-label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent-secondary);
  margin-bottom: 0.75rem;
  font-family: var(--font-display);
}

.game-room-title {
  text-align: center;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  padding: 0.4rem 1rem;
  background: var(--bg-secondary);
  border-radius: 999px;
  margin: 0 auto 0.5rem;
  width: fit-content;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.generating-sub {
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.game-question-text {
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.4;
  margin-bottom: 2rem;
  max-width: 700px;
  font-family: var(--font-display);
  color: var(--text-primary);
}

.game-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  width: 100%;
  max-width: 700px;
}

.game-option {
  padding: 1.1rem 1.25rem;
  background: white;
  border: 2px solid #d1d5db;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1.05rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  box-shadow: var(--shadow-sm);
}

.game-option:hover:not(.disabled) {
  border-color: var(--accent-primary);
  background: #eef2ff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.game-option .option-letter {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #eef2ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--accent-primary);
  flex-shrink: 0;
  border: 2px solid #c7d2fe;
}

.game-option.correct {
  border-color: #16a34a !important;
  background: #f0fdf4 !important;
}

.game-option.correct .option-letter {
  background: #16a34a;
  color: white;
  border-color: #16a34a;
}

.game-option.wrong {
  border-color: #dc2626 !important;
  background: #fef2f2 !important;
}

.game-option.wrong .option-letter {
  background: #dc2626;
  color: white;
  border-color: #dc2626;
}

.game-option.disabled {
  cursor: default;
  opacity: 0.6;
}

.game-feedback {
  margin-top: 1.5rem;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 1.2rem;
  text-align: center;
  animation: pop-in 0.3s ease;
  font-family: var(--font-display);
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }

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

.game-feedback.correct {
  background: #f0fdf4;
  border: 2px solid #86efac;
  color: #16a34a;
}

.game-feedback.wrong {
  background: #fef2f2;
  border: 2px solid #fecaca;
  color: #dc2626;
}

.game-feedback.timeout {
  background: #fffbeb;
  border: 2px solid #fde68a;
  color: #d97706;
}

.game-waiting-opponent {
  text-align: center;
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  animation: pulse-opacity 1.5s ease-in-out infinite;
}

@keyframes pulse-opacity {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* ── Game Chat ─────────────────────────────────────────────── */
.game-chat-toggle {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #3b82f6;
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  z-index: 200;
  transition: var(--transition);
}

.game-chat-toggle:hover {
  transform: scale(1.1);
  background: #2563eb;
}

.game-chat-panel {
  position: fixed;
  bottom: 5rem;
  right: 1.5rem;
  width: 320px;
  max-height: 400px;
  background: white;
  border: 2px solid #d1d5db;
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  z-index: 200;
  animation: slide-up 0.3s ease;
  box-shadow: var(--shadow-lg);
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

.game-chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 200px;
  max-height: 300px;
  padding: 0.5rem 0;
}

.game-chat-input-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.game-chat-input-row input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
}

/* ═══════════════════════════════════════════════════════════════
   GAME OVER VIEW
   ═══════════════════════════════════════════════════════════════ */
#view-game-over {
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background-color: var(--paper-bg);
  background-image: linear-gradient(var(--line-blue) 1px, transparent 1px);
  background-size: 100% 2rem;
}

.game-over-container {
  width: 100%;
  max-width: 700px;
}

.game-over-card {
  padding: 2rem;
  text-align: center;
  background: white;
  border: 2px solid #d1d5db;
  box-shadow: var(--shadow-lg);
}

.game-over-banner {
  margin-bottom: 2rem;
}

.game-over-banner h1 {
  font-size: 3rem;
  font-weight: 700;
  font-family: var(--font-display);
}

.game-over-banner.victory h1 {
  color: #16a34a;
}

.game-over-banner.defeat h1 {
  color: #dc2626;
}

.game-over-banner.draw h1 {
  color: #d97706;
}

.game-over-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-top: 0.5rem;
  font-family: var(--font-display);
}

.game-over-scores {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.go-score-card {
  text-align: center;
  padding: 1rem 1.5rem;
  background: #f9fafb;
  border-radius: var(--radius-md);
  min-width: 140px;
  border: 2px solid #e5e7eb;
}

.go-score-card.winner {
  border-color: #16a34a;
  background: #f0fdf4;
}

.go-score-name {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.25rem;
  font-family: var(--font-display);
}

.go-score-value {
  font-size: 2.5rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--accent-primary);
}

.game-over-elo {
  margin-bottom: 1.5rem;
}

.elo-change {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
}

.elo-change.positive {
  color: #16a34a;
}

.elo-change.negative {
  color: #dc2626;
}

.game-over-review {
  text-align: left;
  margin-bottom: 1.5rem;
}

.game-over-review h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-family: var(--font-display);
}

.review-questions-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 350px;
  overflow-y: auto;
}

.review-item {
  padding: 1rem;
  background: #f9fafb;
  border-radius: var(--radius-sm);
  border: 2px solid #e5e7eb;
  border-left-width: 4px;
}

.review-item.review-correct {
  border-left-color: #16a34a;
}

.review-item.review-wrong {
  border-left-color: #dc2626;
}

.review-item.review-timeout {
  border-left-color: #d97706;
}

.review-question {
  font-weight: 700;
  margin-bottom: 0.5rem;
  font-family: var(--font-display);
}

.review-answer {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.review-your-answer {
  color: #dc2626;
}

.review-correct-answer {
  color: #16a34a;
}

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

/* ═══════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════ */
#toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  animation: toast-in 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 360px;
  font-family: var(--font-display);
  box-shadow: var(--shadow-md);
  border: 2px solid;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast.info {
  background: #eef2ff;
  color: #4f46e5;
  border-color: #c7d2fe;
}

.toast.success {
  background: #f0fdf4;
  color: #16a34a;
  border-color: #86efac;
}

.toast.error {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

.toast.warning {
  background: #fffbeb;
  color: #d97706;
  border-color: #fde68a;
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE NAVIGATION
   ═══════════════════════════════════════════════════════════════ */
.mobile-nav {
  display: none;
}

.mobile-more-menu {
  display: none;
}

.mobile-chat-overlay {
  display: none;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
    height: calc(100vh - 64px - 64px);
  }

  .sidebar,
  .chat-sidebar {
    display: none;
  }

  .main-content {
    padding: 1rem;
    padding-bottom: 80px;
  }

  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 500;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 2px solid #e5e7eb;
    padding: 0.35rem 0.25rem;
    padding-bottom: max(0.35rem, env(safe-area-inset-bottom));
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
  }

  .mobile-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0.35rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    min-width: 56px;
    -webkit-tap-highlight-color: transparent;
    font-family: var(--font-display);
  }

  .mobile-nav-btn:active {
    transform: scale(0.92);
  }

  .mobile-nav-btn.active {
    color: var(--accent-primary);
  }

  .mobile-more-menu {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 600;
    align-items: flex-end;
    justify-content: center;
  }

  .mobile-more-menu.hidden {
    display: none !important;
  }

  .mobile-more-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(4px);
  }

  .mobile-more-content {
    position: relative;
    z-index: 1;
    background: white;
    border: 2px solid #e5e7eb;
    border-bottom: none;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 1.5rem 1rem;
    padding-bottom: max(1.5rem, calc(env(safe-area-inset-bottom) + 72px));
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    animation: slide-up 0.25s ease;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  }

  .mobile-more-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    text-align: left;
    width: 100%;
    -webkit-tap-highlight-color: transparent;
    font-family: var(--font-display);
  }

  .mobile-more-item:hover,
  .mobile-more-item:active {
    background: var(--bg-hover);
    color: var(--text-primary);
  }

  .mobile-more-badge {
    margin-left: auto;
    background: #ef4444;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    min-width: 20px;
    text-align: center;
  }

  .mobile-more-badge.hidden {
    display: none;
  }

  .mobile-chat-overlay {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0;
    z-index: 700;
    background: var(--paper-bg);
  }

  .mobile-chat-overlay.hidden {
    display: none !important;
  }

  .mobile-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 2px solid #e5e7eb;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
  }

  .mobile-chat-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
    font-family: var(--font-display);
  }

  .mobile-chat-overlay .chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .mobile-chat-overlay .chat-input-row {
    border-top: 2px solid #e5e7eb;
    padding: 0.75rem;
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
    background: white;
  }

  .top-nav {
    padding: 0.6rem 1rem;
    height: 60px;
  }

  .nav-brand svg {
    width: 28px;
    height: 28px;
  }

  .brand-text {
    font-size: 1.2rem;
  }

  .nav-username {
    font-size: 0.85rem;
  }

  .nav-elo {
    font-size: 0.7rem;
  }

  .lobby-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .lobby-item-meta {
    width: 100%;
    justify-content: space-between;
  }

  .lb-row {
    grid-template-columns: 40px 1fr 70px 60px;
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
  }

  .lb-avatar {
    width: 26px;
    height: 26px;
    font-size: 0.75rem;
  }

  .lb-badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.35rem;
  }

  .modal-content {
    width: 95%;
    max-width: 440px;
    padding: 1.5rem;
    max-height: 90vh;
    overflow-y: auto;
  }

  .input-row-3col {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .input-row-3col .input-group:last-child {
    grid-column: 1 / -1;
  }

  .game-container {
    padding: 1rem;
  }

  .game-players-sidebar {
    width: 130px;
    padding: 0.75rem 0.5rem;
  }

  .sidebar-player-name { font-size: 0.7rem; }
  .sidebar-player-elo { font-size: 0.62rem; }

  .game-player-score {
    font-size: 1.8rem;
  }

  .tourney-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .tourney-item-meta {
    width: 100%;
    justify-content: space-between;
  }

  .game-over-container {
    max-width: 100%;
  }

  .game-over-card {
    padding: 1.5rem 1rem;
  }

  .game-over-banner h1 {
    font-size: 2rem;
  }

  .game-over-scores {
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
  }

  .go-score-card {
    width: 100%;
    max-width: 280px;
  }

  .overlay-content {
    max-width: 90%;
    padding: 2rem 1.5rem;
  }

  #toast-container {
    top: auto;
    bottom: 80px;
    right: 0.75rem;
    left: 0.75rem;
  }

  .toast {
    max-width: 100%;
  }

  .friend-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .friend-item-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .dm-panel {
    max-height: 350px;
  }

  .dm-messages {
    min-height: 150px;
    max-height: 200px;
  }

  .wrong-q-header {
    flex-direction: column;
    gap: 0.35rem;
  }

  .wrong-q-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .btn-explain {
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .action-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .game-options {
    grid-template-columns: 1fr;
  }

  .profile-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
  }

  .game-question-text {
    font-size: 1.2rem;
    margin-bottom: 1.25rem;
  }

  .section-title {
    font-size: 1.6rem;
  }

  .section-subtitle {
    font-size: 1rem;
  }

  .home-hero {
    margin-bottom: 0.75rem;
  }

  .action-card {
    padding: 1.25rem;
  }

  .action-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    margin-bottom: 0.75rem;
  }

  .action-card-icon svg {
    width: 32px;
    height: 32px;
  }

  .action-card h3 {
    font-size: 1.3rem;
  }

  .action-card p {
    font-size: 0.88rem;
    margin-bottom: 1rem;
  }

  .profile-header {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .profile-info {
    align-items: center;
    display: flex;
    flex-direction: column;
  }

  .profile-avatar {
    width: 80px;
    height: 80px;
    font-size: 2rem;
  }

  .profile-name {
    font-size: 1.6rem;
  }

  .stat-card {
    padding: 0.85rem 0.5rem;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .game-option {
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
  }

  .game-option .option-letter {
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
  }

  .game-scoreboard {
    margin-bottom: 0.5rem;
  }

  .game-player-name {
    font-size: 0.85rem;
  }

  .game-player-score {
    font-size: 1.5rem;
  }

  .game-question-counter {
    font-size: 0.8rem;
  }

  .game-feedback {
    font-size: 1rem;
    padding: 0.75rem 1rem;
  }

  .auth-container {
    max-width: 100%;
  }

  .auth-card {
    padding: 1.5rem;
  }

  .logo-icon {
    width: 60px;
    height: 60px;
  }

  .logo-text {
    font-size: 2.5rem;
  }

  .logo-tagline {
    font-size: 0.9rem;
  }

  .game-chat-panel {
    right: 0.75rem;
    bottom: 4rem;
    width: calc(100vw - 1.5rem);
    max-width: 320px;
    max-height: 320px;
  }

  .game-chat-toggle {
    bottom: 1rem;
    right: 1rem;
    width: 42px;
    height: 42px;
  }

  .lobby-view-container {
    max-width: 100%;
  }

  .lobby-info-card {
    padding: 1.25rem;
  }

  .lobby-meta {
    flex-direction: column;
    gap: 0.5rem;
  }

  .lobby-player-card {
    min-width: 100px;
    padding: 0.75rem;
  }

  .lobby-player-avatar {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .round-results-card {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .main-content {
    padding: 0.75rem;
    padding-bottom: 80px;
  }

  .modal-content {
    width: 100%;
    max-width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    margin-top: auto;
  }

  .modal {
    align-items: flex-end;
  }

  .action-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }

  .action-card-icon svg {
    width: 28px;
    height: 28px;
  }

  .profile-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .stat-value {
    font-size: 1.3rem;
  }

  .stat-label {
    font-size: 0.7rem;
  }

  .game-container {
    padding: 0.75rem;
  }

  .game-players-sidebar {
    width: 110px;
    padding: 0.6rem 0.4rem;
  }

  .sidebar-player-avatar {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
  }

  .game-over-card {
    padding: 1.25rem 0.75rem;
  }

  .game-over-banner h1 {
    font-size: 1.8rem;
  }

  .review-item {
    padding: 0.75rem;
  }

  .review-question {
    font-size: 0.95rem;
  }

  .input-row {
    flex-direction: column;
    gap: 0.75rem;
  }

  .lobby-actions {
    flex-direction: column;
    width: 100%;
  }

  .lobby-actions .btn {
    width: 100%;
  }

  .game-over-actions {
    flex-direction: column;
    width: 100%;
  }

  .game-over-actions .btn {
    width: 100%;
  }
}

/* ── Round Results Overlay ─────────────────────────────────── */
.round-results-overlay {
  position: absolute;
  inset: 0;
  background: rgba(249, 247, 241, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.round-results-overlay.hidden {
  display: none;
}

.round-results-card {
  max-width: 500px;
  width: 90%;
  padding: 2rem;
  text-align: center;
  background: white;
  border: 2px solid #d1d5db;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.round-results-card h3 {
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  font-family: var(--font-display);
}

.round-results-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.round-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  background: #f9fafb;
  border: 2px solid #e5e7eb;
  border-left-width: 4px;
  border-left-color: var(--text-muted);
}

.round-result-row.first {
  border-left-color: #d97706;
}

.round-result-row.second {
  border-left-color: #6b7280;
}

.round-result-row.third {
  border-left-color: #92400e;
}

.round-result-rank {
  font-weight: 700;
  width: 2rem;
  color: var(--text-muted);
  font-family: var(--font-display);
}

.round-result-name {
  flex: 1;
  text-align: left;
  margin-left: 0.5rem;
  font-family: var(--font-display);
}

.round-result-score {
  font-weight: 700;
  color: var(--accent-primary);
  font-family: var(--font-display);
}

.round-result-change {
  font-size: 0.8rem;
  margin-left: 0.5rem;
}

.round-result-change.positive {
  color: #16a34a;
}

.round-result-change.negative {
  color: #dc2626;
}

/* ── Wrong Answers Panel ──────────────────────────────────── */
.wrong-count-badge {
  display: inline-block;
  background: #ef4444;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  margin-left: 0.5rem;
  vertical-align: middle;
  font-family: var(--font-display);
}

.wrong-questions-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.wrong-q-card {
  background: white;
  border: 2px solid #e5e7eb;
  border-left: 4px solid #ef4444;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.wrong-q-card:hover {
  border-color: #fecaca;
  box-shadow: var(--shadow-md);
}

.wrong-q-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
  gap: 1rem;
}

.wrong-q-topic {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: var(--font-display);
}

.wrong-q-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.wrong-q-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  line-height: 1.4;
  font-family: var(--font-display);
}

.wrong-q-answers {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.wrong-q-answer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: var(--font-display);
}

.wrong-q-answer.your-wrong {
  background: #fef2f2;
  border: 2px solid #fecaca;
  color: #dc2626;
}

.wrong-q-answer.correct-ans {
  background: #f0fdf4;
  border: 2px solid #86efac;
  color: #16a34a;
}

.wrong-q-answer-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.wrong-q-answer-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  opacity: 0.7;
  margin-left: auto;
  font-family: var(--font-display);
}

.wrong-q-footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.wrong-q-diff {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  letter-spacing: 0.5px;
  font-family: var(--font-display);
}

.wrong-q-diff.easy {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #86efac;
}

.wrong-q-diff.medium {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}

.wrong-q-diff.hard {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.btn-explain {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border: 2px solid #c7d2fe;
  background: #eef2ff;
  color: var(--accent-primary);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  margin-left: auto;
  font-family: var(--font-display);
}

.btn-explain:hover {
  background: #e0e7ff;
  border-color: var(--accent-primary);
}

.btn-explain:disabled {
  opacity: 0.5;
  cursor: wait;
}

.btn-explain .spinner {
  width: 14px;
  height: 14px;
  border: 2px solid transparent;
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.wrong-q-explanation {
  margin-top: 0.75rem;
  padding: 0.85rem;
  background: #eef2ff;
  border: 2px solid #c7d2fe;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  color: var(--text-primary);
  line-height: 1.5;
  animation: fadeIn 0.3s ease;
  font-family: var(--font-display);
}

.wrong-q-explanation .explain-icon {
  color: var(--accent-warm);
  margin-right: 0.3rem;
}

/* ═══════════════════════════════════════════════════════════════
   SETTINGS PANEL
   ═══════════════════════════════════════════════════════════════ */
.settings-section {
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  border: 2px solid #e5e7eb;
  background: white;
}

.settings-heading {
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-display);
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.settings-avatar-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.settings-avatar-preview {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 3px dashed #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
}

.settings-avatar-preview:hover {
  border-color: var(--accent-primary);
  border-style: solid;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.settings-avatar-preview.drag-over {
  border-color: var(--accent-primary);
  border-style: solid;
  background: rgba(79, 70, 229, 0.06);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
}

.settings-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* Show upload icon when no image is set */
.settings-avatar-preview img[src=""],
.settings-avatar-preview img:not([src]) {
  display: none;
}

.settings-avatar-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(79, 70, 229, 0.06);
  color: var(--accent-primary);
  border-radius: 50%;
  opacity: 1;
  transition: opacity 0.2s, background 0.2s;
  font-size: 0.7rem;
  font-weight: 700;
  gap: 0.25rem;
  text-align: center;
  padding: 0.5rem;
  font-family: var(--font-display);
}

.settings-avatar-preview:hover .settings-avatar-overlay {
  background: rgba(79, 70, 229, 0.12);
}

/* When an actual avatar is loaded, hide the overlay unless hovering */
.settings-avatar-preview.has-avatar .settings-avatar-overlay {
  opacity: 0;
  background: rgba(0, 0, 0, 0.5);
  color: white;
}

.settings-avatar-preview.has-avatar:hover .settings-avatar-overlay {
  opacity: 1;
}

.settings-input-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.settings-input-row .qv-input {
  flex: 1;
  max-width: 320px;
}

.settings-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.settings-status {
  font-size: 0.9rem;
  color: #22c55e;
  font-weight: 600;
  font-family: var(--font-display);
  animation: fadeIn 0.3s ease;
}

/* ═══════════════════════════════════════════════════════════════
   NOTIFICATION PANEL
   ═══════════════════════════════════════════════════════════════ */
.notif-wrapper {
  position: relative;
}

.notif-bell {
  position: relative;
  padding: 0.4rem;
}

.notif-badge {
  position: absolute;
  top: -2px;
  right: -4px;
  background: #ef4444;
  color: white;
  font-size: 0.6rem;
  font-weight: 800;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  font-family: var(--font-mono);
  line-height: 1;
  animation: notifPop 0.3s ease;
}

@keyframes notifPop {
  0% {
    transform: scale(0);
  }

  50% {
    transform: scale(1.3);
  }

  100% {
    transform: scale(1);
  }
}

.notif-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-height: 420px;
  background: white;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  overflow: hidden;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

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

.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.notif-header h4 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.btn-xs {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
}

.notif-list {
  overflow-y: auto;
  max-height: 340px;
}

.notif-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: #999;
  font-size: 0.85rem;
  font-family: var(--font-display);
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  transition: background 0.15s;
  position: relative;
}

.notif-item:hover {
  background: rgba(79, 70, 229, 0.03);
}

.notif-item.unread {
  background: rgba(79, 70, 229, 0.06);
  border-left: 3px solid var(--accent-primary);
}

.notif-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.notif-content {
  flex: 1;
  min-width: 0;
}

.notif-title {
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text-primary);
  font-family: var(--font-display);
}

.notif-message {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.3;
}

.notif-time {
  font-size: 0.65rem;
  color: #aaa;
  margin-top: 4px;
  font-family: var(--font-mono);
}

.notif-dismiss {
  position: absolute;
  top: 6px;
  right: 8px;
  background: none;
  border: none;
  color: #ccc;
  cursor: pointer;
  font-size: 1rem;
  padding: 2px 4px;
  line-height: 1;
  opacity: 0;
  transition:
    opacity 0.15s,
    color 0.15s;
}

.notif-item:hover .notif-dismiss {
  opacity: 1;
}

.notif-dismiss:hover {
  color: #ef4444;
}

/* ═══════════════════════════════════════════════════════════════
   ELO HISTORY CHART
   ═══════════════════════════════════════════════════════════════ */
.profile-section {
  margin-top: 1.5rem;
  padding: 1.25rem;
}

.profile-section .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.profile-section .section-header h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.elo-chart-container {
  width: 100%;
  position: relative;
}

.elo-chart-container canvas {
  width: 100%;
  border-radius: var(--radius-md);
}

.elo-chart-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: #999;
  font-size: 0.85rem;
  font-family: var(--font-display);
}

/* ═══════════════════════════════════════════════════════════════
   MATCH HISTORY
   ═══════════════════════════════════════════════════════════════ */
.match-history-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.match-history-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: #999;
  font-size: 0.85rem;
  font-family: var(--font-display);
}

.match-history-empty svg {
  margin-bottom: 0.5rem;
}

.mh-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  transition: background 0.15s;
}

.mh-row:hover {
  background: rgba(79, 70, 229, 0.03);
}

.mh-row:last-child {
  border-bottom: none;
}

/* Result color hints */
.mh-row.mh-win {
  border-left: 3px solid #22c55e;
}

.mh-row.mh-loss {
  border-left: 3px solid #ef4444;
}

.mh-row.mh-draw {
  border-left: 3px solid #f59e0b;
}

.mh-result-badge {
  font-size: 1.3rem;
  flex-shrink: 0;
  width: 32px;
  text-align: center;
}

.mh-details {
  flex: 1;
  min-width: 0;
}

.mh-opponent {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-primary);
  font-family: var(--font-display);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mh-meta {
  display: flex;
  gap: 0.5rem;
  margin-top: 2px;
  align-items: center;
}

.mh-topic {
  font-size: 0.72rem;
  color: var(--text-secondary);
  background: rgba(79, 70, 229, 0.08);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--font-display);
}

.mh-type {
  font-size: 0.65rem;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: var(--font-mono);
}

.mh-scores {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.95rem;
}

.mh-my-score {
  color: var(--accent-primary);
}

.mh-separator {
  color: #ccc;
  font-weight: 400;
}

.mh-opp-score {
  color: var(--text-secondary);
}

.mh-right {
  text-align: right;
  flex-shrink: 0;
  min-width: 70px;
}

.mh-result-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: var(--font-display);
}

.mh-result-label.win {
  color: #22c55e;
}

.mh-result-label.loss {
  color: #ef4444;
}

.mh-result-label.draw {
  color: #f59e0b;
}

.mh-elo {
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.mh-elo.positive {
  color: #22c55e;
}

.mh-elo.negative {
  color: #ef4444;
}

.mh-date {
  font-size: 0.62rem;
  color: #aaa;
  font-family: var(--font-mono);
  margin-top: 2px;
}

/* ═══════════════════════════════════════════════════════════════
   CHALLENGE MODAL STYLES
   ═══════════════════════════════════════════════════════════════ */
.challenge-modal {
  text-align: center;
}

.challenge-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.challenge-swords-icon {
  font-size: 3rem;
  animation: challenge-pulse 1.5s ease-in-out infinite;
  filter: drop-shadow(0 4px 12px rgba(220, 38, 38, 0.3));
}

@keyframes challenge-pulse {

  0%,
  100% {
    transform: scale(1) rotate(0deg);
  }

  25% {
    transform: scale(1.15) rotate(-5deg);
  }

  50% {
    transform: scale(1.1) rotate(5deg);
  }

  75% {
    transform: scale(1.15) rotate(-3deg);
  }
}

.challenge-header h2 {
  font-size: 1.6rem;
  margin: 0;
  background: linear-gradient(135deg, #dc2626, #e17055);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.challenge-body {
  margin-bottom: 1rem;
}

.challenge-topic {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-weight: 600;
  font-family: var(--font-display);
  padding: 0.5rem 1rem;
  background: rgba(108, 92, 231, 0.08);
  border-radius: var(--radius-sm);
  display: inline-block;
}

.challenge-from-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 0.5rem;
}

.challenge-from-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #dc2626, #e17055);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.4rem;
  font-weight: 800;
  font-family: var(--font-display);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

.challenge-from-info strong {
  font-size: 1.15rem;
  font-family: var(--font-display);
  display: block;
}

.challenge-from-elo {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ── Challenge Pending Indicator ─────────────────────────────── */
.challenge-pending-icon {
  display: inline-block;
  font-size: 0.9rem;
  animation: challenge-pending-bounce 1s ease-in-out infinite;
  margin-left: 4px;
}

@keyframes challenge-pending-bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-3px);
  }
}

.challenge-pending-label {
  display: inline-block;
  font-size: 0.72rem;
  color: #dc2626;
  font-weight: 700;
  margin-left: 0.5rem;
  animation: fade-pulse 2s ease-in-out infinite;
}

@keyframes fade-pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

/* ── Tournament Settings Display ──────────────────────────────── */
.tourney-settings {
  display: block;
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

.tournament-create .input-row-3col {
  margin-bottom: 0.75rem;
}

/* ══════════════════════════════════════════════════════════════════
   PDF / IMAGE MODE
   ══════════════════════════════════════════════════════════════════ */

.pdf-mode-actions {
  margin-bottom: 1rem;
}

/* Dropzone */
.pdf-dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.3);
  margin-bottom: 1rem;
}

.pdf-dropzone:hover,
.pdf-dropzone.dragover {
  border-color: var(--accent-primary);
  background: rgba(79, 70, 229, 0.05);
}

.pdf-dropzone p {
  margin: 0.5rem 0 0;
}

/* File info strip */
.pdf-file-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(0, 184, 148, 0.08);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.pdf-file-name,
#pdf-reuse-filename {
  font-weight: 600;
  word-break: break-all;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* Page notice */
.pdf-page-notice {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.pdf-page-notice.warning {
  background: rgba(253, 203, 110, 0.15);
  border: 1px solid rgba(253, 203, 110, 0.4);
  color: #b57d10;
}

.pdf-page-notice.info {
  background: rgba(0, 206, 201, 0.1);
  border: 1px solid rgba(0, 206, 201, 0.3);
  color: #00928e;
}

/* Game type toggle */
.pdf-game-type {
  margin: 1rem 0;
}

.pdf-game-type-btns {
  display: flex;
  gap: 0.75rem;
}

.pdf-game-radio {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
  text-align: center;
}

.pdf-game-radio input {
  display: none;
}

.pdf-game-radio.active {
  border-color: #00b894;
  background: rgba(0, 184, 148, 0.08);
  color: #00b894;
}

.pdf-game-radio:hover {
  border-color: #00b894;
}

/* Saved PDFs list */
.saved-pdfs-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.saved-pdf-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
}

.saved-pdf-icon {
  flex-shrink: 0;
  color: #00b894;
}

.saved-pdf-info {
  flex: 1;
  min-width: 0;
}

.saved-pdf-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.saved-pdf-meta {
  font-size: 0.8rem;
  margin-top: 0.2rem;
}

.saved-pdf-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn-danger-text {
  color: var(--danger) !important;
}

.btn-danger-text:hover {
  background: rgba(214, 48, 49, 0.08) !important;
}

@media (max-width: 600px) {
  .saved-pdf-card {
    flex-wrap: wrap;
  }

  .saved-pdf-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .pdf-game-type-btns {
    flex-direction: column;
  }
}