/* Grumpy's Movies — 1980s CRT / VHS living-room theme (logo-matched) */
@import url("https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@400;600;700&family=Limelight&family=Share+Tech+Mono&display=swap");

:root {
  --bg: #100c0a;
  --bg-2: #1a1210;
  --panel: #221814;
  --panel-2: #2c1c16;
  --text: #f0e6d4;
  --muted: #a89880;
  --accent: #c4783a;
  --accent-2: #e8b86d;
  --accent-deep: #8a4520;
  --ring: rgba(196, 120, 58, 0.45);
  --border: rgba(240, 230, 212, 0.12);
  --phosphor: #e8b86d;
  --crt-glow: rgba(232, 184, 109, 0.14);
  --radius: 4px;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  --font-display: "Limelight", "Courier New", serif;
  --font-ui: "Chakra Petch", "Segoe UI", sans-serif;
  --font-mono: "Share Tech Mono", "Consolas", monospace;
}

html {
  color-scheme: dark;
}

body.theme-crt,
html.theme-crt body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

/* Warm room light + CRT vignette */
body.theme-crt::before,
.theme-crt-root::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 520px at 18% 0%, rgba(196, 120, 58, 0.20), transparent 58%),
    radial-gradient(700px 480px at 92% 12%, rgba(232, 184, 109, 0.10), transparent 55%),
    radial-gradient(120% 90% at 50% 40%, transparent 40%, rgba(0, 0, 0, 0.55) 100%),
    linear-gradient(180deg, #1a100c 0%, var(--bg) 35%, #0a0706 100%);
  pointer-events: none;
  z-index: 0;
}

/* Scanlines */
body.theme-crt::after,
.theme-crt-root::after {
  content: "";
  position: fixed;
  inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.18) 0px,
      rgba(0, 0, 0, 0.18) 1px,
      transparent 1px,
      transparent 3px
    );
  opacity: 0.35;
  pointer-events: none;
  z-index: 2;
  mix-blend-mode: multiply;
  animation: crt-scan-drift 12s linear infinite;
}

@keyframes crt-scan-drift {
  from { background-position: 0 0; }
  to { background-position: 0 12px; }
}

@keyframes crt-flicker {
  0%, 100% { opacity: 1; }
  92% { opacity: 1; }
  93% { opacity: 0.92; }
  94% { opacity: 1; }
  97% { opacity: 0.96; }
}

@keyframes phosphor-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 184, 109, 0.0), 0 10px 28px rgba(138, 69, 32, 0.35); }
  50% { box-shadow: 0 0 18px 2px rgba(232, 184, 109, 0.22), 0 12px 32px rgba(138, 69, 32, 0.45); }
}

@media (prefers-reduced-motion: reduce) {
  body.theme-crt::after,
  .theme-crt-root::after {
    animation: none;
  }
}

/* Keep page content above the CRT vignette (fixed ::before at z-index 0).
   Without this, shells like .room-page paint underneath and look blank.
   Do NOT apply to fixed overlays (player) — relative would pin them in document flow. */
.theme-crt .wrap,
.theme-crt .app-shell,
.theme-crt .party-page,
.theme-crt .tv-app,
.theme-crt .room-page,
.theme-crt .app {
  position: relative;
  z-index: 1;
}

body.theme-crt > *:not(script):not(style):not(.player-overlay):not(.site-banner-ad) {
  position: relative;
  z-index: 1;
}

/* Fullscreen player must stay fixed over the CRT chrome */
.theme-crt .player-overlay,
body.theme-crt > .player-overlay {
  position: fixed !important;
  inset: 0;
  z-index: 10000 !important;
}

.theme-crt h1,
.theme-crt h2,
.theme-crt .brand-title,
.theme-crt .display-font {
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  font-weight: 400;
}

.theme-crt .mono,
.theme-crt code,
.theme-crt .ver,
.theme-crt .eyebrow {
  font-family: var(--font-mono);
}

.theme-crt .btn.primary,
.theme-crt button.primary {
  background: linear-gradient(180deg, var(--accent-2) 0%, var(--accent) 48%, var(--accent-deep) 100%);
  color: #1a100c;
  border: 1px solid rgba(240, 230, 212, 0.35);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2);
  animation: phosphor-pulse 3.6s ease-in-out infinite;
}

.theme-crt .btn.primary:hover,
.theme-crt button.primary:hover {
  filter: brightness(1.06);
}

/* Brand mark — real logo art (not a letter chip) */
.theme-crt .brand {
  gap: 10px;
}

.theme-crt .brand-mark,
.theme-crt img.logo,
.theme-crt .logo.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 4px;
  object-fit: cover;
  display: block;
  flex: 0 0 auto;
  background: #0a0706 !important;
  box-shadow:
    0 0 0 1px rgba(232, 184, 109, 0.35),
    0 0 14px rgba(196, 120, 58, 0.35) !important;
  color: transparent !important;
  font-size: 0 !important;
}

.theme-crt .brand-wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 13px;
  color: var(--text);
}

.theme-crt .brand-wordmark em {
  font-style: normal;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.14em;
}

.theme-crt .brand-wordmark .domain {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: lowercase;
  margin-top: 2px;
}
