/* SingKo KTV — Blue theme with light/dark toggle */

:root,
[data-theme="light"] {
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-text: #1a202c;
  --color-text-muted: #64748b;
  --color-primary: #0ea5e9;
  --color-primary-dark: #0284c7;
  --color-primary-light: #e0f2fe;
  --color-accent: #2563eb;
  --color-accent-dark: #1d4ed8;
  --color-accent-light: #dbeafe;
  --color-ko: #f59e0b;
  --color-navy: #1e293b;
  --text-3d-1: #0f172a;
  --text-3d-2: #1e3a5f;
  --text-3d-3: #334155;
  --text-3d-accent-1: #1d4ed8;
  --text-3d-accent-2: #1e40af;
  --text-3d-accent-3: #1e3a8a;
  --text-3d-glow: rgba(37, 99, 235, 0.55);
  --text-3d-sub-1: #cbd5e1;
  --text-3d-sub-2: #94a3b8;
  --gloss-highlight: rgba(255, 255, 255, 0.9);
  --gloss-title: linear-gradient(180deg, #7dd3fc 0%, #38bdf8 14%, #2563eb 48%, #1e40af 78%, #1e3a8a 100%);
  --gloss-accent: linear-gradient(180deg, #bfdbfe 0%, #60a5fa 22%, #2563eb 55%, #1d4ed8 82%, #1e3a8a 100%);
  --gloss-sub: linear-gradient(180deg, #bae6fd 0%, #0ea5e9 35%, #2563eb 70%, #1d4ed8 100%);
  --color-border: #e2e8f0;
  --color-shadow: rgba(15, 23, 42, 0.08);
  --color-shadow-lg: rgba(15, 23, 42, 0.12);
  --blob-blue: rgba(14, 165, 233, 0.12);
  --blob-accent: rgba(37, 99, 235, 0.1);
  --note-color: rgba(14, 165, 233, 0.08);
  --toggle-bg: #e2e8f0;
  --phone-bg: #f1f5f9;
  --tv-bg: #0f172a;
}

[data-theme="dark"] {
  --color-bg: #0f172a;
  --color-surface: #1e293b;
  --color-text: #f1f5f9;
  --color-text-muted: #94a3b8;
  --color-primary: #38bdf8;
  --color-primary-dark: #0ea5e9;
  --color-primary-light: #0c4a6e;
  --color-accent: #60a5fa;
  --color-accent-dark: #3b82f6;
  --color-accent-light: #1e3a5f;
  --color-ko: #fbbf24;
  --color-navy: #f1f5f9;
  --text-3d-1: #020617;
  --text-3d-2: #0f172a;
  --text-3d-3: #1e293b;
  --text-3d-accent-1: #1e40af;
  --text-3d-accent-2: #1e3a8a;
  --text-3d-accent-3: #172554;
  --text-3d-glow: rgba(96, 165, 250, 0.65);
  --text-3d-sub-1: #334155;
  --text-3d-sub-2: #1e293b;
  --gloss-highlight: rgba(255, 255, 255, 0.7);
  --gloss-title: linear-gradient(180deg, #e0f2fe 0%, #38bdf8 16%, #3b82f6 50%, #2563eb 80%, #1d4ed8 100%);
  --gloss-accent: linear-gradient(180deg, #eff6ff 0%, #93c5fd 20%, #60a5fa 50%, #3b82f6 80%, #2563eb 100%);
  --gloss-sub: linear-gradient(180deg, #e0f2fe 0%, #38bdf8 38%, #60a5fa 72%, #3b82f6 100%);
  --color-border: #334155;
  --color-shadow: rgba(0, 0, 0, 0.25);
  --color-shadow-lg: rgba(0, 0, 0, 0.4);
  --blob-blue: rgba(56, 189, 248, 0.08);
  --blob-accent: rgba(96, 165, 250, 0.08);
  --note-color: rgba(56, 189, 248, 0.06);
  --toggle-bg: #334155;
  --phone-bg: #1e293b;
  --tv-bg: #020617;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

/* Background decoration */
.bg-decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
}

.blob-blue {
  width: 500px;
  height: 500px;
  background: var(--blob-blue);
  top: -120px;
  left: -100px;
}

.blob-accent {
  width: 450px;
  height: 450px;
  background: var(--blob-accent);
  bottom: -80px;
  right: -80px;
}

.note {
  position: absolute;
  font-size: 2.5rem;
  color: var(--note-color);
  user-select: none;
}

.note-1 { top: 15%; left: 8%; transform: rotate(-15deg); }
.note-2 { top: 60%; left: 3%; transform: rotate(10deg); font-size: 2rem; }
.note-3 { top: 25%; right: 12%; transform: rotate(20deg); font-size: 1.8rem; }
.note-4 { bottom: 20%; right: 25%; transform: rotate(-8deg); }
.note-5 { top: 45%; left: 45%; transform: rotate(5deg); font-size: 1.5rem; }

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 200;
  width: 100%;
  background: color-mix(in srgb, var(--color-bg) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
  overflow: visible;
}

.header.is-scrolled {
  border-bottom-color: var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 2.5rem;
  box-sizing: border-box;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  min-width: 0;
  flex-shrink: 1;
}

.brand-text {
  min-width: 0;
}

.brand-logo {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}

.brand-name {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--color-navy);
  line-height: 1.2;
}

.brand-ko {
  color: var(--color-ko);
}

.brand-tagline {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--color-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-left: auto;
  flex-shrink: 0;
}

.nav--desktop {
  display: flex;
  align-items: center;
}

.nav--mobile {
  display: none;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list li {
  margin: 0;
}

.nav-link {
  display: block;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-primary);
  transition: opacity 0.2s, background 0.2s, color 0.2s;
  white-space: nowrap;
}

.nav-link:hover {
  opacity: 0.75;
}

.nav-list li:nth-child(1) .nav-link,
.nav-list li:nth-child(2) .nav-link,
.nav-list li:nth-child(4) .nav-link { color: var(--color-primary); }
.nav-list li:nth-child(3) .nav-link { color: var(--color-accent); }

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: var(--toggle-bg);
  color: var(--color-text);
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background 0.2s;
}

.nav-toggle:hover {
  background: var(--color-border);
}

.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle.is-active .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.is-active .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle.is-active .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.nav-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

body.nav-open {
  overflow: hidden;
}

/* Theme toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--toggle-bg);
  color: var(--color-text);
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.theme-toggle:hover {
  transform: scale(1.08);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

.icon-moon { display: none; }

[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

/* Main layout */
.main {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 2.5rem 4rem;
}

.hero {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 2rem;
  align-items: start;
}

/* Hero content */
.hero-content {
  padding-top: 2rem;
}

.hero-title {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 900;
  line-height: 1.15;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
  letter-spacing: 0.03em;
}

.hero-title-line {
  display: block;
  color: var(--color-navy);
}

.hero-title-accent {
  display: block;
  color: var(--color-accent);
  text-shadow:
    0 -1px 0 rgba(255, 255, 255, 0.45),
    1px 1px 0 var(--text-3d-accent-1),
    2px 2px 0 var(--text-3d-accent-1),
    3px 3px 0 var(--text-3d-accent-2),
    4px 4px 0 var(--text-3d-accent-2),
    5px 5px 0 var(--text-3d-accent-3),
    6px 6px 16px var(--text-3d-glow);
}

.hero-subtitle {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text-muted);
  max-width: 460px;
  margin-bottom: 2rem;
  font-weight: 500;
}

.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.feature-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text);
}

.feature-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-primary);
  flex-shrink: 0;
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

/* Hero visual */
.hero-visual {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.demo-flow {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 1rem;
  padding: 1rem 0;
}

.demo-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.step-badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  background: var(--color-primary-light);
  padding: 0.35rem 1rem;
  border-radius: 999px;
  white-space: nowrap;
}

.loader-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  padding-top: 4rem;
  min-width: 40px;
}

.loader {
  display: flex;
  align-items: center;
  gap: 10px;
}

.loader-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-accent);
  opacity: 0.3;
  animation: dot-glow 1.2s steps(1) infinite;
}

.loader-dot:nth-child(1) { animation-delay: 0s; }
.loader-dot:nth-child(2) { animation-delay: 0.4s; }
.loader-dot:nth-child(3) { animation-delay: 0.8s; }

@keyframes dot-glow {
  0%, 33% {
    opacity: 1;
    box-shadow:
      0 0 3px var(--color-accent),
      0 0 7px var(--color-primary),
      0 0 12px color-mix(in srgb, var(--color-accent) 50%, transparent);
  }
  34%, 100% {
    opacity: 0.3;
    box-shadow: none;
  }
}

/* Phone mockup */
.phone-mockup {
  width: 160px;
  background: #1a1a2e;
  border-radius: 24px;
  padding: 8px;
  box-shadow: 0 20px 50px var(--color-shadow-lg);
  position: relative;
}

.phone-notch {
  width: 50px;
  height: 6px;
  background: #333;
  border-radius: 3px;
  margin: 4px auto 6px;
}

.phone-screen {
  background: #1e293b;
  border-radius: 18px;
  padding: 10px;
  min-height: 260px;
}

.gheader {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 0 5px;
  border-bottom: 1px solid #334155;
  margin-bottom: 5px;
}
.gheader-logo { width: 16px; height: 16px; }
.gheader-title { font-size: 0.48rem; font-weight: 700; color: #f1f5f9; flex: 1; }
.gheader-code { font-size: 0.4rem; padding: 1px 5px; border-radius: 999px; background: #0ea5e9; color: #fff; font-weight: 700; letter-spacing: 0.05em; }

.greactions { margin-bottom: 4px; }
.greactions-title { font-size: 0.38rem; font-weight: 600; color: #94a3b8; display: block; margin-bottom: 2px; }
.greactions-bar { display: flex; gap: 3px; }
.greact-btn { width: 22px; height: 22px; border-radius: 50%; background: #334155; display: flex; align-items: center; justify-content: center; font-size: 0.55rem; }

.gnowplaying { display: flex; align-items: center; gap: 4px; background: #1e293b; border: 1px solid #334155; border-radius: 6px; padding: 5px 7px; margin-bottom: 5px; }
.gnp-icon { font-size: 0.55rem; }
.gnp-text { font-size: 0.45rem; color: #64748b; }

.gtabs { display: flex; background: #1e293b; border-radius: 6px; padding: 3px; margin-bottom: 5px; }
.gtab { flex: 1; text-align: center; font-size: 0.5rem; padding: 3px 0; border-radius: 999px; color: #94a3b8; cursor: default; }
.gtab-active { background: #0ea5e9; color: #fff; }

.gsongbook { display: flex; flex-direction: column; gap: 3px; }
.gsearch-row { display: flex; gap: 3px; }
.gsearch-input { flex: 1; height: 18px; border-radius: 4px; background: #0f172a; border: 1px solid #334155; }
.gsearch-btn { font-size: 0.4rem; padding: 2px 6px; border-radius: 4px; background: #0ea5e9; color: #fff; font-weight: 600; line-height: 18px; }

.gresult { display: flex; align-items: center; gap: 4px; padding: 3px 0; }
.gresult-thumb { width: 20px; height: 15px; border-radius: 3px; background: linear-gradient(135deg, var(--color-primary), var(--color-accent)); flex-shrink: 0; }
.gresult-thumb--2 { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.gresult-info { flex: 1; min-width: 0; }
.gresult-title { display: block; font-size: 0.4rem; font-weight: 600; color: #f1f5f9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gresult-artist { display: block; font-size: 0.36rem; color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gresult-add { font-size: 0.4rem; padding: 1px 5px; border-radius: 4px; background: rgba(14,165,233,0.15); color: #0ea5e9; font-weight: 700; }
  flex-shrink: 0;
  line-height: 1;
}

/* TV mockup */
.tv-mockup {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tv-screen {
  width: 240px;
  background: #111;
  border-radius: 8px;
  padding: 6px;
  box-shadow: 0 20px 50px var(--color-shadow-lg);
}

.tv-player-welcome {
  background: var(--tv-bg);
  border-radius: 4px;
  padding: 1.25rem 1rem;
  text-align: center;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
}

.tv-welcome-logo {
  width: clamp(24px, 8vw, 50px);
  margin-bottom: 0.15rem;
  opacity: 0.8;
}

.tv-welcome-title {
  font-size: clamp(0.7rem, 2.2vw, 1.1rem);
  font-weight: 800;
  color: #f1f5f9;
}

.tv-welcome-sub {
  font-size: clamp(0.55rem, 1.6vw, 0.78rem);
  color: #94a3b8;
  margin-top: 0.1rem;
}

.tv-welcome-cta {
  font-size: clamp(0.5rem, 1.4vw, 0.68rem);
  color: #fbbf24;
  font-weight: 700;
}

.tv-stand {
  width: 60px;
  height: 12px;
  background: #333;
  border-radius: 0 0 4px 4px;
  margin: 2px auto 0;
}

/* Action cards */
.action-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  background: var(--color-surface);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 8px 40px var(--color-shadow);
  border: 1px solid var(--color-border);
  transition: background 0.3s, border-color 0.3s;
}

.action-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.25rem;
  border-radius: 14px;
}

.action-card .btn,
.action-card .join-form {
  margin-top: auto;
}

.card-icon {
  width: 36px;
  height: 36px;
  margin-bottom: 0.75rem;
  color: var(--color-primary);
}

.action-card--join .card-icon {
  color: var(--color-accent);
}

.card-icon svg {
  width: 100%;
  height: 100%;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.card-title--accent {
  color: var(--color-accent);
}

.card-desc {
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  padding: 0.75rem 1.5rem;
  width: 100%;
  white-space: nowrap;
  text-decoration: none;
  color: #fff;
}

.btn--primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
}

.btn--primary:hover {
  background: var(--color-primary-dark);
  transform: translateY(-1px);
}

/* Join form */
.join-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.join-input {
  flex: 1;
  padding: 0.65rem 1rem;
  border: 1.5px solid var(--color-border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.85rem;
  background: var(--color-bg);
  color: var(--color-text);
  outline: none;
  transition: border-color 0.2s;
}

.join-input:focus {
  border-color: var(--color-accent);
}

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

.join-search {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: var(--color-accent);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.join-search:hover {
  background: var(--color-accent-dark);
}

.join-qr {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: var(--color-accent-light);
  color: var(--color-accent);
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.join-qr:hover {
  background: var(--color-accent-light);
}

/* Responsive */
@media (max-width: 1024px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .hero-content {
    text-align: left;
    padding-top: 0;
    width: 100%;
    max-width: 100%;
  }

  .hero-title {
    font-size: clamp(2.5rem, 7vw, 3.5rem);
  }

  .hero-subtitle {
    font-size: 1.1rem;
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
    padding: 0 0.35rem;
  }

  .feature-list {
    align-items: center;
    max-width: 100%;
  }
}

@media (max-width: 1024px) {
  .header-inner {
    padding: 1rem 1.5rem;
  }

  .nav-list {
    gap: 1.25rem;
  }

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

@media (max-width: 900px) {
  .header-inner {
    max-width: 100%;
    padding: 0.75rem max(1rem, env(safe-area-inset-right)) 0.75rem max(1rem, env(safe-area-inset-left));
  }

  .nav--mobile {
    display: none;
    width: 100%;
    box-sizing: border-box;
    padding: 0.5rem max(1rem, env(safe-area-inset-right)) 1rem max(1rem, env(safe-area-inset-left));
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 10px 24px var(--color-shadow);
  }

  .nav--desktop {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-overlay {
    display: block;
  }

  .nav--mobile.is-open {
    display: block;
    animation: navDropIn 0.22s ease;
  }

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

  .nav--mobile .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    width: 100%;
  }

  .nav--mobile .nav-link {
    font-size: 1rem;
    font-weight: 600;
    padding: 0.9rem 1rem;
    border-radius: 10px;
    color: var(--color-text);
    white-space: normal;
  }

  .nav--mobile .nav-list li:nth-child(1) .nav-link,
  .nav--mobile .nav-list li:nth-child(2) .nav-link,
  .nav--mobile .nav-list li:nth-child(3) .nav-link,
  .nav--mobile .nav-list li:nth-child(4) .nav-link {
    color: var(--color-text);
  }

  .nav--mobile .nav-link:hover,
  .nav--mobile .nav-link:active {
    opacity: 1;
    background: var(--color-primary-light);
    color: var(--color-primary);
  }

  .header-actions {
    gap: 0.5rem;
  }
}

@media (max-width: 768px) {
  .header-inner {
    padding: 0.75rem max(1rem, env(safe-area-inset-right)) 0.75rem max(1rem, env(safe-area-inset-left));
  }

  .main {
    width: 100%;
    max-width: 100%;
    padding: 0.75rem max(0.85rem, env(safe-area-inset-right)) 2.5rem max(0.85rem, env(safe-area-inset-left));
    box-sizing: border-box;
  }

  .hero {
    gap: 1.5rem;
  }

  .hero-content,
  .hero-visual {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .hero-title {
    font-size: clamp(2.5rem, 10vw, 3.4rem);
    letter-spacing: 0.02em;
    line-height: 1.2;
    margin-bottom: 0.85rem;
    padding: 0 0.15rem;
  }

  .hero-title-accent {
    text-shadow:
      1px 1px 0 var(--text-3d-accent-1),
      2px 2px 0 var(--text-3d-accent-2),
      3px 3px 10px var(--text-3d-glow);
  }

  .hero-subtitle {
    font-size: 1rem;
    line-height: 1.65;
    max-width: 100%;
    padding: 0 0.15rem;
    margin-bottom: 1.25rem;
  }

  .demo-flow {
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 0;
    width: 100%;
  }

  .loader-wrap {
    padding-top: 2.75rem;
    min-width: 22px;
    align-self: center;
  }

  .loader {
    gap: 5px;
  }

  .loader-dot {
    width: 4px;
    height: 4px;
  }

  .demo-step {
    gap: 0.4rem;
    flex: 0 1 auto;
    min-width: 0;
  }

  .step-badge {
    font-size: 0.52rem;
    padding: 0.28rem 0.55rem;
    letter-spacing: 0.04em;
  }

  .phone-mockup {
    width: 135px;
    border-radius: 14px;
    padding: 5px;
    box-shadow: 0 10px 28px var(--color-shadow-lg);
  }

  .phone-notch {
    width: 32px;
    height: 4px;
    margin: 2px auto 4px;
  }

  .phone-screen {
    border-radius: 11px;
    padding: 5px;
    min-height: 148px;
  }

  .gheader { gap: 3px; padding-bottom: 3px; margin-bottom: 3px; }
  .gheader-logo { width: 13px; height: 13px; }
  .gheader-title { font-size: 0.4rem; }
  .gheader-code { font-size: 0.34rem; padding: 1px 4px; }
  .greactions-title { font-size: 0.34rem; }
  .greact-btn { width: 18px; height: 18px; font-size: 0.45rem; }
  .gnowplaying { padding: 3px 5px; margin-bottom: 3px; }
  .gnp-icon { font-size: 0.45rem; }
  .gnp-text { font-size: 0.38rem; }
  .gtabs { padding: 2px; margin-bottom: 3px; }
  .gtab { font-size: 0.4rem; padding: 2px 0; }
  .gsearch-input { height: 15px; }
  .gsearch-btn { font-size: 0.34rem; line-height: 15px; padding: 1px 4px; }
  .gresult { gap: 3px; padding: 2px 0; }
  .gresult-thumb { width: 16px; height: 12px; }
  .gresult-title { font-size: 0.34rem; }
  .gresult-artist { font-size: 0.3rem; }
  .gresult-add { font-size: 0.34rem; padding: 1px 4px; }

  .tv-screen {
    width: 170px;
    padding: 4px;
    box-shadow: 0 10px 28px var(--color-shadow-lg);
  }

  .tv-player-welcome {
    padding: 0.55rem 0.4rem;
    min-height: 96px;
    gap: 0.15rem;
  }

  .tv-welcome-logo { width: 28px; }
  .tv-welcome-title { font-size: 0.7rem; }
  .tv-welcome-sub { font-size: 0.52rem; }
  .tv-welcome-cta { font-size: 0.48rem; }

  .tv-stand {
    width: 38px;
    height: 7px;
  }

  .feature-list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.45rem 0.75rem;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    overflow: visible;
    padding: 0;
  }

  .feature-list li {
    flex-shrink: 1;
    font-size: 0.72rem;
    gap: 0.35rem;
    white-space: nowrap;
    text-align: left;
    justify-content: flex-start;
  }

  .feature-dot {
    width: 7px;
    height: 7px;
    box-shadow: 0 0 0 2px var(--color-primary-light);
  }

  .action-cards {
    grid-template-columns: 1fr 1fr;
    width: 100%;
    padding: 1rem;
    border-radius: 16px;
    gap: 0.85rem;
    box-sizing: border-box;
  }

  .action-card {
    padding: 1rem;
  }

  .card-title {
    font-size: 0.88rem;
  }

  .card-desc {
    font-size: 0.78rem;
    line-height: 1.55;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .btn {
    font-size: 0.75rem;
    padding: 0.7rem 1rem;
  }

  .join-form {
    flex-wrap: nowrap;
    width: 100%;
  }

  .join-input {
    min-width: 0;
    max-width: 90px;
    font-size: 0.72rem;
    padding: 0.5rem 0.6rem;
  }

  .join-search,
  .join-qr {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
  }

  .join-qr svg,
  .join-search svg {
    width: 16px;
    height: 16px;
  }

  .brand-name {
    font-size: 1.1rem;
  }

  .brand-logo {
    width: 44px;
    height: 44px;
  }

  .brand-tagline {
    font-size: 0.58rem;
  }
}

@media (max-width: 480px) {
  .header-inner {
    padding: 0.65rem max(0.85rem, env(safe-area-inset-right)) 0.65rem max(0.85rem, env(safe-area-inset-left));
  }

  .main {
    padding: 0.5rem max(0.75rem, env(safe-area-inset-right)) 2rem max(0.75rem, env(safe-area-inset-left));
  }

  .hero-title {
    font-size: clamp(2.2rem, 9.5vw, 2.9rem);
    margin-bottom: 0.75rem;
  }

  .hero-subtitle {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
  }

  .feature-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.35rem 0.55rem;
  }

  .feature-list li {
    font-size: 0.65rem;
  }

  .action-cards {
    padding: 0.85rem;
    border-radius: 14px;
    gap: 0.85rem;
  }

  .action-card {
    padding: 0.85rem;
  }

  .card-icon {
    width: 30px;
    height: 30px;
    margin-bottom: 0.5rem;
  }

  .card-title {
    font-size: 0.82rem;
  }

  .card-desc {
    font-size: 0.74rem;
    margin-bottom: 0.85rem;
  }

  @media (max-width: 380px) {
    .action-cards { grid-template-columns: 1fr; }
    .action-card { padding: 0.75rem; }
    .card-title { font-size: 0.78rem; }
    .card-desc { font-size: 0.72rem; margin-bottom: 0.65rem; }
    .btn { font-size: 0.7rem; padding: 0.55rem 0.7rem; }
  }

  .btn {
    font-size: 0.72rem;
    padding: 0.65rem 0.85rem;
  }

  .join-search,
  .join-qr {
    width: 30px;
    height: 30px;
  }

  .join-input {
    font-size: 0.75rem;
    padding: 0.5rem 0.6rem;
  }

  .nav--mobile {
    padding: 0.5rem 0.85rem 0.85rem;
  }

  .nav--mobile .nav-link {
    font-size: 0.95rem;
    padding: 0.85rem 0.9rem;
  }

  .demo-flow {
    gap: 0.25rem;
  }

  .loader-wrap {
    padding-top: 2.5rem;
    min-width: 18px;
  }

  .loader {
    gap: 4px;
  }

  .step-badge {
    font-size: 0.48rem;
    padding: 0.22rem 0.45rem;
  }

  .phone-mockup {
    width: 115px;
    padding: 4px;
    border-radius: 12px;
  }

  .phone-screen {
    min-height: 128px;
    padding: 4px;
  }

  .tv-screen {
    width: 145px;
  }

  .tv-player-welcome {
    min-height: 82px;
    padding: 0.45rem 0.3rem;
  }
}

/* Leaderboards */
.leaderboards {
  padding: 3rem 1.5rem;
}

.leaderboards-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.leaderboards-title {
  font-size: 1.6rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-navy);
  margin-bottom: 0.4rem;
}

.leaderboards-subtitle {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.leaderboard-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.leaderboard-points {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--color-accent);
  flex-shrink: 0;
}

.leaderboard-points--gold svg {
  color: #f59e0b;
}

.leaderboard-points--silver svg {
  color: #94a3b8;
}

.leaderboard-points--bronze svg {
  color: #cd7f32;
}

.leaderboard-points--ribbon svg {
  color: #8b5cf6;
}

.leaderboard-card:hover {
  border-color: var(--color-primary);
  transform: translateX(4px);
}

.leaderboard-rank {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--color-text-muted);
  min-width: 28px;
  text-align: center;
}

.leaderboard-card:nth-child(1) .leaderboard-rank {
  color: #f59e0b;
}

.leaderboard-card:nth-child(2) .leaderboard-rank {
  color: #94a3b8;
}

.leaderboard-card:nth-child(3) .leaderboard-rank {
  color: #cd7f32;
}

.leaderboard-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.leaderboard-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.leaderboard-host {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text);
}

.leaderboard-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  width: fit-content;
  text-transform: uppercase;
  margin-bottom: 0.1rem;
}

.leaderboard-badge--gold {
  color: #78350f;
  background: linear-gradient(135deg, #fcd34d, #f59e0b, #d97706);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.5);
}

.leaderboard-badge--light {
  color: #92400e;
  background: linear-gradient(135deg, #fde68a, #fbbf24, #f59e0b);
  box-shadow: 0 1px 4px rgba(245, 158, 11, 0.25);
}

.leaderboard-badge--silver {
  color: #334155;
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1, #94a3b8);
  box-shadow: 0 1px 4px rgba(148, 163, 184, 0.3);
}

.leaderboard-badge--bronze {
  color: #431407;
  background: linear-gradient(135deg, #d97706, #b45309, #92400e);
  box-shadow: 0 1px 4px rgba(180, 83, 9, 0.3);
}

.leaderboard-meta {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

@media (max-width: 768px) {
  .leaderboards {
    padding: 2rem 0.85rem;
  }

  .leaderboards-title {
    font-size: 1.25rem;
  }

  .leaderboards-subtitle {
    font-size: 0.8rem;
    margin-bottom: 1rem;
  }

  .leaderboard-card {
    padding: 0.7rem 0.85rem;
    gap: 0.75rem;
  }

  .leaderboard-avatar {
    width: 36px;
    height: 36px;
    font-size: 0.75rem;
  }

  .leaderboard-host {
    font-size: 0.85rem;
  }

  .leaderboard-meta {
    font-size: 0.72rem;
  }

  .leaderboard-badge {
    font-size: 0.55rem;
    padding: 0.08rem 0.35rem;
  }

  .leaderboard-points {
    font-size: 0.82rem;
  }
}

@media (max-width: 480px) {
  .leaderboard-card { padding: 0.65rem 0.75rem; gap: 0.5rem; }
  .leaderboard-avatar { width: 32px; height: 32px; font-size: 0.7rem; }
  .leaderboard-host { font-size: 0.78rem; flex-wrap: wrap; gap: 0.2rem; }
  .leaderboard-badge { font-size: 0.48rem; padding: 0.06rem 0.3rem; white-space: nowrap; }
  .leaderboard-meta { font-size: 0.65rem; }
  .leaderboard-points { font-size: 0.75rem; gap: 0.2rem; }
  .leaderboard-points svg { width: 12px; height: 12px; }
  .leaderboard-rank { font-size: 0.7rem; min-width: 18px; }
}

@media (max-width: 380px) {
  .leaderboard-card { flex-wrap: wrap; padding: 0.55rem 0.65rem; }
  .leaderboard-badge { font-size: 0.44rem; padding: 0.04rem 0.25rem; }
  .leaderboard-host { font-size: 0.72rem; }
}

/* Footer */
.footer {
  padding: 2.5rem 1.5rem 1.5rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  transition: background 0.3s, border-color 0.3s;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  align-self: flex-start;
}

.footer-logo {
  width: 36px;
  height: 36px;
}

.footer-brand-name {
  font-size: 1rem;
  font-weight: 800;
  color: #f1f5f9;
}

.footer-links {
  text-align: center;
}

.footer-heading {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--color-text);
  margin-bottom: 0.6rem;
  text-transform: uppercase;
}

.footer-nav {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1rem;
}

.footer-link {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-link:hover {
  color: var(--color-primary);
}

.footer-social {
  display: flex;
  gap: 1rem;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-primary-light);
  color: var(--color-primary);
  transition: background 0.2s, color 0.2s, transform 0.2s;
}

.social-link:hover {
  background: var(--color-primary);
  color: #fff;
  transform: translateY(-2px);
}

.footer-copy {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.footer-dev {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.footer-dev strong {
  color: var(--color-accent);
}

[data-theme="light"] .footer-brand-name {
  color: #1a202c;
}

@media (max-width: 768px) {
  .footer {
    padding: 1.5rem 1rem 1rem;
  }

  .social-link {
    width: 36px;
    height: 36px;
  }

  .footer-nav {
    gap: 0.3rem 0.75rem;
  }

  .footer-link {
    font-size: 0.75rem;
  }
}

/* Feedback section */
.feedback {
  padding: 3rem 1.5rem;
}

.feedback-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.feedback-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 2rem;
}

.feedback-title {
  font-size: 1.6rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-navy);
  margin-bottom: 0.4rem;
}

.feedback-subtitle {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.feedback-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.feedback-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 1.25rem;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
}

.feedback-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

.feedback-card--empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  padding: 2rem;
}

.feedback-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.feedback-card-type {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}

.feedback-type-bug { background: rgba(239,68,68,0.12); color: #ef4444; }
.feedback-type-feature { background: rgba(139,92,246,0.12); color: #8b5cf6; }
.feedback-type-improvement { background: rgba(14,165,233,0.12); color: #0ea5e9; }
.feedback-type-compliment { background: rgba(34,197,94,0.12); color: #22c55e; }
.feedback-type-other { background: rgba(100,116,139,0.12); color: #64748b; }

.feedback-card-stars {
  display: flex;
  gap: 0.15rem;
  flex-shrink: 0;
}

.feedback-card-stars svg {
  width: 16px;
  height: 16px;
}

.feedback-star-filled { color: #fbbf24; }
.feedback-star-empty { color: #475569; }

.feedback-card-text {
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--color-text);
  margin-bottom: 0.6rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.feedback-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
  padding-top: 0.6rem;
}

.feedback-card-author {
  font-weight: 600;
}

.feedback-card-date {
  font-size: 0.65rem;
}

.feedback-cta {
  display: flex;
  justify-content: center;
}

@media (max-width: 768px) {
  .feedback {
    padding: 2rem 0.85rem;
  }

  .feedback-title {
    font-size: 1.25rem;
  }

  .feedback-subtitle {
    font-size: 0.8rem;
  }

  .feedback-list {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .feedback-card {
    padding: 1rem;
  }
}

/* Download */
.download {
  padding: 3rem 1.5rem;
}

.download-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.download-title {
  font-size: 1.6rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-navy);
  margin-bottom: 0.4rem;
}

.download-subtitle {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}

.download-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.download-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.download-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

.download-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.download-card-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--color-text);
}

.download-card-desc {
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--color-text-muted);
  margin-bottom: auto;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: #fff;
  background: var(--color-accent);
  transition: background 0.2s, transform 0.2s;
}

.download-btn:hover {
  background: var(--color-accent-dark);
  transform: translateY(-1px);
}

.download-btn--soon {
  background: var(--color-text-muted);
  cursor: default;
  pointer-events: none;
  opacity: 0.85;
}

@media (max-width: 768px) {
  .download {
    padding: 2rem 0.85rem;
  }

  .download-title {
    font-size: 1.25rem;
  }

  .download-subtitle {
    font-size: 0.8rem;
    margin-bottom: 1rem;
  }

  .download-cards {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .download-card {
    padding: 1.15rem;
  }

  .download-card-title {
    font-size: 0.95rem;
  }

  .download-card-desc {
    font-size: 0.78rem;
  }

  .download-btn {
    font-size: 0.75rem;
    padding: 0.55rem 1rem;
  }
}

/* Floating chat */

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.modal-overlay.modal--open {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: var(--color-surface);
  border-radius: 24px;
  padding: 2.5rem 2rem 2rem;
  width: 100%;
  max-width: 380px;
  margin: 1rem;
  text-align: center;
  position: relative;
  box-shadow: 0 20px 60px var(--color-shadow);
  border: 1px solid var(--color-border);
  transform: translateY(20px) scale(0.96);
  transition: transform 0.3s;
}

.modal--open .modal-box {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--color-text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.modal-close:hover {
  color: var(--color-text);
}

.modal-logo {
  width: 56px;
  height: 56px;
  margin-bottom: 0.75rem;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--color-navy);
  margin-bottom: 0.3rem;
}

.modal-sub {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
}

.modal-input {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1.5px solid var(--color-border);
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.9rem;
  background: var(--color-bg);
  color: var(--color-text);
  outline: none;
  margin-bottom: 0.65rem;
  text-align: center;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.modal-input:focus {
  border-color: var(--color-primary);
}

.modal-input--code {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.35em;
  text-transform: uppercase;
}

.modal-input--code:focus {
  border-color: var(--color-accent);
}

.join-code-wrap {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.65rem;
}

.join-code-wrap .modal-input--code {
  margin-bottom: 0;
  flex: 1;
}

.qr-scan-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1.5px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-bg);
  color: var(--color-accent);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.2s, background 0.2s;
}

.qr-scan-btn svg { width: 18px; height: 18px; }

.qr-scan-btn:hover {
  border-color: var(--color-accent);
  background: var(--color-accent-light);
}

/* Scan Modal */
.modal-box--scan {
  max-width: 420px;
}

.scan-camera-wrap {
  width: 260px;
  height: 260px;
  margin: 0 auto;
  background: #111;
  border-radius: 12px;
}

#scanReader {
  width: 100%;
  height: 100%;
}

.scan-status {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-top: 1rem;
  min-height: 1.5rem;
}

.scan-result {
  display: none;
  margin-top: 1rem;
  padding: 1rem;
  background: var(--color-accent-light);
  border-radius: 12px;
}

.scan-result-code {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  color: var(--color-accent);
  margin-bottom: 0.75rem;
}

.scan-fallback {
  font-size: 0.82rem;
  margin-top: 1rem;
  text-align: center;
}

.scan-fallback a {
  color: var(--color-accent);
  text-decoration: underline;
  cursor: pointer;
}

@media (max-width: 480px) {
  .scan-camera-wrap {
    width: 200px;
    height: 200px;
  }
  .qr-scan-btn { width: 34px; height: 34px; border-radius: 8px; }
  .qr-scan-btn svg { width: 16px; height: 16px; }
}

.modal-error {
  font-size: 0.75rem;
  color: #ef4444;
  min-height: 1.1rem;
  margin-bottom: 0.5rem;
}

.modal-btn {
  width: 100%;
  padding: 0.75rem;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

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

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

.modal-btn--primary {
  background: var(--color-primary);
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
}

.modal-btn--primary:hover:not(:disabled) {
  background: var(--color-primary-dark);
}

.modal-btn--accent {
  background: var(--color-accent);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.modal-btn--accent:hover:not(:disabled) {
  background: var(--color-accent-dark);
}

#scanReader {
  border: none !important;
  background: transparent;
  aspect-ratio: 1 / 1;
  max-width: 280px;
  margin: 0 auto;
}

#scanReader video {
  border-radius: 12px;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Feedback modal */
.modal-box--feedback {
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
}

.feedback-field {
  margin-bottom: 0.85rem;
  text-align: left;
}

.feedback-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 0.3rem;
}

.feedback-label-opt {
  font-weight: 400;
  opacity: 0.7;
}

.feedback-row {
  display: flex;
  gap: 0.75rem;
}

.feedback-field--half {
  flex: 1;
  min-width: 0;
}

.star-rating {
  display: flex;
  gap: 0.25rem;
  justify-content: center;
  padding: 0.25rem 0;
}

.star-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.15rem;
  color: #64748b;
  transition: color 0.15s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.star-btn svg {
  width: 32px;
  height: 32px;
  display: block;
}

.star-btn:hover {
  transform: scale(1.15);
}

.star-btn:active {
  transform: scale(0.9);
}

.modal-input--roomcode {
  text-transform: uppercase;
  font-size: 1rem;
  letter-spacing: 0.15em;
}

.feedback-file {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  background: var(--color-bg);
  border: 1.5px dashed var(--color-border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.feedback-file:hover {
  border-color: var(--color-primary);
}

.feedback-file input {
  display: none;
}

.feedback-file-placeholder {
  flex: 1;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feedback-file-btn {
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  background: var(--color-primary);
  padding: 0.35rem 0.85rem;
  border-radius: 8px;
  white-space: nowrap;
  transition: background 0.2s;
}

.feedback-file-btn:hover {
  background: var(--color-primary-dark);
}

@media (max-width: 768px) {
  .modal-box {
    padding: 2rem 1.5rem 1.5rem;
    max-width: 340px;
  }

  .modal-box--feedback {
    max-width: 340px;
    max-height: 85vh;
  }

  .feedback-row {
    flex-direction: column;
    gap: 0;
  }

  .star-btn svg {
    width: 28px;
    height: 28px;
  }

  .feedback-file {
    padding: 0.5rem 0.65rem;
  }
}

@media (max-width: 480px) {
  .modal-box--feedback {
    max-width: 92vw;
    padding: 1.5rem 1.25rem 1.25rem;
  }

  .star-rating {
    gap: 0.15rem;
  }

  .star-btn svg {
    width: 24px;
    height: 24px;
  }
}

/* Loading overlay */
.loading-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(15,23,42,0.85); backdrop-filter: blur(6px);
  display: none; flex-direction: column;
  align-items: center; justify-content: center;
}
.loading-overlay.active { display: flex; }
.loading-spinner {
  width: 180px; height: 180px;
  display: flex; align-items: center; justify-content: center;
  animation: coinDrop 0.6s ease-out forwards, coinFlip 0.8s ease-in-out 0.6s infinite;
  border-radius: 50%;
}
.loading-spinner img { width: 130px; height: 130px; display: block; }
@keyframes coinDrop {
  0% { transform: translateY(-120px) scale(0.5); opacity: 0; }
  60% { transform: translateY(8px) scale(1.1); opacity: 1; }
  80% { transform: translateY(-4px) scale(0.95); }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes coinFlip {
  0% { transform: perspective(200px) rotateY(0deg); }
  50% { transform: perspective(200px) rotateY(180deg); }
  100% { transform: perspective(200px) rotateY(360deg); }
}
.loading-text {
  margin-top: 1rem; font-size: 0.9rem;
  color: #94a3b8; font-weight: 500;
}

/* Toast notification */
.toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 10000;
  display: flex; flex-direction: column; gap: 0.5rem;
  pointer-events: none;
}
.toast {
  background: var(--color-surface);
  color: var(--color-text);
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  font-size: 0.8rem;
  max-width: 320px;
  animation: toastIn 0.3s ease-out forwards;
  border-left: 3px solid var(--color-primary);
  pointer-events: auto;
}
.toast.toast-out { animation: toastOut 0.3s ease-in forwards; }
@keyframes toastIn {
  0% { transform: translateX(100%); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}
@keyframes toastOut {
  0% { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(100%); opacity: 0; }
}
@media (max-width: 480px) {
  .toast-container { right: 0.75rem; bottom: 0.75rem; }
  .toast { max-width: 260px; font-size: 0.75rem; }
}
