@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --ui-bg: #edf3fa;
  --ui-bg-alt: #f7fbff;
  --ui-surface: #ffffff;
  --ui-surface-soft: #f2f7fd;
  --ui-line: #d8e4f2;
  --ui-text: #0f2744;
  --ui-muted: #617693;
  --ui-brand: #0f6cbd;
  --ui-brand-2: #0ea5a8;
  --ui-success: #059669;
  --ui-warning: #d97706;
  --ui-danger: #dc2626;
}

body.ui-modern {
  background:
    radial-gradient(circle at 10% -10%, rgba(56, 189, 248, 0.22), transparent 44%),
    radial-gradient(circle at 90% 108%, rgba(15, 118, 110, 0.2), transparent 38%),
    linear-gradient(170deg, var(--ui-bg), var(--ui-bg-alt));
  color: var(--ui-text);
  font-family: "Manrope", "Inter", "Segoe UI", sans-serif;
}

body.ui-modern * {
  box-sizing: border-box;
}

body.ui-modern .glass-card,
body.ui-modern .card,
body.ui-modern .panel,
body.ui-modern .wrap,
body.ui-modern .side {
  background: var(--ui-surface);
  border: 1px solid var(--ui-line);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
  color: var(--ui-text);
}

body.ui-modern .badge,
body.ui-modern .pill,
body.ui-modern .status,
body.ui-modern .meta {
  color: var(--ui-muted);
}

.pulse-highlight {
  animation: pulseGlow 0.9s ease;
  box-shadow: 0 0 0 0 rgba(14, 165, 168, 0.4);
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 0 0 rgba(14, 165, 168, 0.6); }
  70% { box-shadow: 0 0 0 12px rgba(14, 165, 168, 0); }
  100% { box-shadow: 0 0 0 0 rgba(14, 165, 168, 0); }
}

body.ui-modern input,
body.ui-modern select,
body.ui-modern textarea,
body.ui-modern .form-control,
body.ui-modern .form-select {
  border: 1px solid var(--ui-line);
  border-radius: 12px;
  background: #fff;
  color: var(--ui-text);
  box-shadow: none;
}

body.ui-modern input:focus,
body.ui-modern select:focus,
body.ui-modern textarea:focus,
body.ui-modern .form-control:focus,
body.ui-modern .form-select:focus {
  border-color: rgba(15, 108, 189, 0.55);
  box-shadow: 0 0 0 3px rgba(15, 108, 189, 0.14);
  outline: none;
}

body.ui-modern button,
body.ui-modern .btn {
  border-radius: 12px;
  border: 1px solid rgba(15, 108, 189, 0.22);
  background: linear-gradient(135deg, var(--ui-brand), #1d8ad9);
  color: #fff;
  font-weight: 700;
  transition: transform 140ms ease, box-shadow 180ms ease, background 180ms ease;
}

body.ui-modern button:hover,
body.ui-modern .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15, 108, 189, 0.18);
}

body.ui-modern button.primary,
body.ui-modern .btn-success,
body.ui-modern .btn-primary {
  background: linear-gradient(135deg, var(--ui-brand), #1d8ad9);
  border-color: rgba(15, 108, 189, 0.3);
  color: #fff;
}

body.ui-modern button.secondary,
body.ui-modern .btn-secondary,
body.ui-modern .btn-outline-secondary,
body.ui-modern .btn-outline-light {
  background: #fff;
  color: var(--ui-text);
  border-color: var(--ui-line);
}

body.ui-modern button.danger,
body.ui-modern button.warn,
body.ui-modern .btn-danger,
body.ui-modern .btn-warning {
  background: linear-gradient(135deg, #fca5a5, #ef4444);
  border-color: rgba(220, 38, 38, 0.34);
  color: #fff;
}

body.ui-modern code {
  background: rgba(15, 108, 189, 0.08);
  color: #0f4f83;
  border: 1px solid rgba(15, 108, 189, 0.2);
  border-radius: 8px;
  padding: 2px 6px;
}

/* OBS Remote */
body.module-obs-remote {
  padding: 18px;
}

body.module-obs-remote .top {
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--ui-line);
  margin-bottom: 14px;
}

body.module-obs-remote .title {
  color: var(--ui-text);
  font-size: 20px;
}

body.module-obs-remote .status {
  color: var(--ui-muted);
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid var(--ui-line);
  background: #f3f8ff;
  padding: 6px 10px;
}

body.module-obs-remote .status-sub {
  font-size: 12px;
  color: var(--ui-muted);
  margin-top: 2px;
}

body.module-obs-remote #grid {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

body.module-obs-remote .slot {
  border-radius: 18px;
  border: 1px solid var(--ui-line);
  background: linear-gradient(165deg, #fff, #f3f8ff);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
}

body.module-obs-remote .slot.on {
  background: linear-gradient(165deg, #d9f6ec, #ecfbf4);
  border-color: rgba(5, 150, 105, 0.42);
}

body.module-obs-remote .name {
  color: var(--ui-text);
}

body.module-obs-remote .meta {
  color: var(--ui-muted);
}

body.module-obs-remote .pill {
  background: rgba(15, 23, 42, 0.05);
  color: var(--ui-muted);
  border-color: rgba(100, 116, 139, 0.24);
}

/* Avatar Voice Lab */
body.module-voice-lab {
  background:
    radial-gradient(circle at 14% 10%, rgba(56, 189, 248, 0.2), transparent 45%),
    radial-gradient(circle at 85% 84%, rgba(14, 165, 168, 0.16), transparent 42%),
    linear-gradient(160deg, var(--ui-bg), var(--ui-bg-alt));
  color: var(--ui-text);
}

body.module-voice-lab .glass {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--ui-line);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
}

body.module-voice-lab .small-note,
body.module-voice-lab .voice-meta {
  color: var(--ui-muted);
}

body.module-voice-lab .table {
  --bs-table-color: var(--ui-text);
  --bs-table-border-color: var(--ui-line);
}

body.module-voice-lab .table thead th {
  background: #f0f6fd;
  color: #456181;
}

body.module-voice-lab .badge-pill {
  background: #f3f8ff;
  border-color: var(--ui-line);
  color: #305071;
}

/* Hangman Control */
body.module-hangman-control {
  padding: 22px;
}

body.module-hangman-control .game-container {
  max-width: 760px;
  padding: 0;
}

body.module-hangman-control .glass-card {
  border-radius: 18px;
  margin-bottom: 16px;
}

body.module-hangman-control #status {
  font-weight: 700;
  color: #0f4f83;
}

/* Flag Race Control */
body.module-flag-control {
  margin: 0;
  padding: 22px;
  display: block;
}

body.module-flag-control h1 {
  font-size: 26px;
  margin: 0 0 8px;
  color: var(--ui-text);
}

body.module-flag-control .row {
  gap: 10px;
}

body.module-flag-control .panel {
  border-radius: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.92);
}

/* Hangman Overlay */
body.module-hangman {
  background:
    radial-gradient(circle at 15% 6%, rgba(56, 189, 248, 0.22), transparent 42%),
    linear-gradient(160deg, #0f172a, #10233f);
  color: #e2ecff;
}

body.module-hangman .game-container {
  max-width: none;
  width: min(1080px, 100vw);
  height: min(920px, 100vh);
  padding: 20px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(8px);
}

body.module-hangman .word-display {
  font-size: clamp(2rem, 5vw, 3.3rem);
  letter-spacing: 0.35rem;
}

body.module-hangman .category-badge {
  background: rgba(14, 165, 168, 0.22);
  border: 1px solid rgba(45, 212, 191, 0.45);
  color: #d1fae5;
}

body.module-hangman .letter-btn {
  border-radius: 12px;
  width: 48px;
  height: 48px;
}

/* Flag Race Overlay */
body.module-flag-race {
  --bg: #edf3fa;
  --panel: #ffffff;
  --accent: #0f6cbd;
  --text: #0f2744;
  --muted: #667c99;
  --danger: #dc2626;
  background: linear-gradient(160deg, #edf3fa, #f7fbff);
}

body.module-flag-race .side,
body.module-flag-race .list,
body.module-flag-race .lane-wrap,
body.module-flag-race .hud,
body.module-flag-race .help-box {
  background: #ffffff;
  border-color: #d8e4f2;
  color: var(--ui-text);
}

body.module-flag-race .badge {
  background: #edf4fb;
  border: 1px solid #d8e4f2;
  color: #5f7390;
}

body.module-flag-race .lane-bg {
  background: repeating-linear-gradient(90deg, #f5f9ff 0, #f5f9ff 8px, #ebf2fa 8px, #ebf2fa 16px);
}

/* Spotify Queue */
body.module-spotify-queue .wrap {
  border-radius: 18px;
  border-color: rgba(148, 163, 184, 0.35);
  background:
    radial-gradient(130% 130% at 100% 0%, rgba(56, 189, 248, 0.16), transparent 60%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.94), rgba(241, 247, 255, 0.9));
}

body.module-spotify-queue.ui-modern {
  background: transparent;
  padding: 0;
}

body.module-spotify-queue .head {
  background: rgba(255, 255, 255, 0.72);
}

body.module-spotify-queue .title {
  color: #0f6cbd;
}

body.module-spotify-queue .item {
  border-color: #d8e4f2;
  background: #ffffff;
}

body.module-spotify-queue .name {
  color: var(--ui-text);
}

body.module-spotify-queue .artist,
body.module-spotify-queue .meta {
  color: var(--ui-muted);
}

/* Avatar Audio Bridge */
body.module-audio-bridge {
  background:
    radial-gradient(1000px 700px at 10% -10%, rgba(56, 189, 248, 0.2), transparent),
    radial-gradient(900px 600px at 90% 110%, rgba(14, 165, 168, 0.15), transparent),
    linear-gradient(170deg, var(--ui-bg), var(--ui-bg-alt));
  color: var(--ui-text);
}

body.module-audio-bridge .card {
  border-radius: 18px;
  padding: 20px;
}

body.module-audio-bridge .sub,
body.module-audio-bridge .hint,
body.module-audio-bridge .field label {
  color: var(--ui-muted);
}

body.module-audio-bridge .logs {
  border-color: var(--ui-line);
  background: #f7fbff;
  color: #18426b;
}

/* Test Overlay */
body.module-test-overlay .container {
  background: rgba(255, 255, 255, 0.92);
  color: var(--ui-text);
  border: 1px solid #d8e4f2;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.16);
}

body.module-test-overlay .title {
  color: #56718e;
}

body.module-test-overlay .message {
  color: var(--ui-text);
  text-shadow: none;
}

body.module-test-overlay .type-gift {
  border-color: rgba(14, 165, 168, 0.7);
  box-shadow: 0 14px 30px rgba(14, 165, 168, 0.28);
}

body.module-test-overlay .type-chat {
  border-color: rgba(15, 108, 189, 0.5);
  box-shadow: 0 14px 30px rgba(15, 108, 189, 0.2);
}

body.module-test-overlay .type-like {
  border-color: rgba(220, 38, 38, 0.5);
  box-shadow: 0 14px 30px rgba(220, 38, 38, 0.2);
}

/* Video Overlay + Avatar View helpers */
body.module-video-overlay #debugConsole {
  background: rgba(255, 255, 255, 0.92);
  color: #0f2744;
  border: 1px solid #d8e4f2;
}

body.module-video-overlay .debug-label {
  color: #5f7390;
}

body.module-video-overlay #unlockButton,
body.module-avatar-view #unlockButton {
  border: 1px solid rgba(15, 108, 189, 0.3);
  background: linear-gradient(135deg, #0f6cbd, #1d8ad9);
  color: #fff;
  box-shadow: 0 16px 28px rgba(15, 108, 189, 0.3);
}

/* Live Home */
body.module-live-home {
  --bg: #081423;
  --bg2: #10223a;
  --line: rgba(148, 163, 184, 0.3);
  --text: #f2f7ff;
  --muted: #afc1da;
  --accent: #7ac6ff;
  --accent2: #ffd19b;
  --ok: #7de1b7;
  --card: #0f2035;
  font-family: "Manrope", "Inter", "Segoe UI", sans-serif;
}

body.module-live-home .nav,
body.module-live-home .hero,
body.module-live-home .section,
body.module-live-home .card {
  border-color: var(--line);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.25);
}

body.module-live-home .nav a {
  border-radius: 999px;
  font-weight: 700;
}

body.module-live-home .btn {
  border-radius: 14px;
  font-weight: 800;
}

@media (max-width: 860px) {
  body.ui-modern:not(.module-hangman):not(.module-flag-race):not(.module-memory-match) {
    padding: 14px;
  }

  body.module-obs-remote #grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  body.module-flag-control,
  body.module-hangman-control {
    padding: 14px;
  }
}
