/* ==========================================================================
   Lovecraft Arcade — 3-Tier Bookshelf Carousel
   Dark wood & occult aesthetic, procedural textures, responsive
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Tokens
   -------------------------------------------------------------------------- */

:root {
  --color-bg: #0d0b08;
  --color-wood-dark: #1a1208;
  --color-wood-mid: #2a1e0e;
  --color-wood-light: #3d2b14;
  --color-wood-highlight: #5a3d1a;
  --color-gold: #c9a84c;
  --color-gold-dim: #8a6d2f;
  --color-green-glow: #2ecc71;
  --color-green-dim: #1a7a42;
  --color-green-bright: #4ade80;
  --color-text: #d4c5a9;
  --color-text-muted: #7a6d55;
  --color-text-heading: #e8dcc0;
  --color-surface: #12100a;
  --color-candle: #f5a623;
  --color-candle-glow: rgba(245, 166, 35, 0.3);
  --color-flame-core: #fff8e0;
  --color-flame-mid: #f5a623;
  --color-flame-outer: #e85d04;

  --font-display: 'Cinzel', 'Times New Roman', serif;
  --font-body: 'EB Garamond', 'Georgia', serif;
  --font-ui: system-ui, -apple-system, sans-serif;

  --card-width: 180px;
  --card-height: 260px;
  --card-gap: 0.75rem;
  --active-scale: 1.15;

  --transition-card: 500ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-fast: 200ms ease;

  --z-bg: 0;
  --z-shelf: 1;
  --z-cards: 2;
  --z-card-active: 15;
  --z-columns: 6;
  --z-nav: 10;
  --z-top-tier: 5;
  --z-skip: 100;
}

/* --------------------------------------------------------------------------
   2. Google Fonts
   -------------------------------------------------------------------------- */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700;900&family=EB+Garamond:ital,wght@0,400;0,600;1,400&display=swap');

/* --------------------------------------------------------------------------
   3. Base Reset
   -------------------------------------------------------------------------- */

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

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   4. Skip Link
   -------------------------------------------------------------------------- */

.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  padding: 0.75rem 1.25rem;
  background: var(--color-bg);
  color: var(--color-gold);
  border: 1px solid var(--color-gold);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  text-decoration: none;
  z-index: var(--z-skip);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 0;
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   5. Page Wrapper & Background
   -------------------------------------------------------------------------- */

.page-wrapper {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E"),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 40px,
      rgba(60, 40, 15, 0.15) 40px,
      rgba(60, 40, 15, 0.15) 41px
    ),
    linear-gradient(180deg, #1a1208 0%, #0d0b08 30%, #0a0806 100%);
}

/* Vignette overlay — darkens edges to focus attention on center */
.page-wrapper::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(
    ellipse 70% 60% at 50% 45%,
    transparent 0%,
    transparent 50%,
    rgba(0, 0, 0, 0.4) 80%,
    rgba(0, 0, 0, 0.7) 100%
  );
  will-change: auto;
  transform: translateZ(0);
}

/* --------------------------------------------------------------------------
   6. Ambient Effects
   -------------------------------------------------------------------------- */

.ambient-fog {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(30, 60, 40, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 30%, rgba(40, 30, 60, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(20, 40, 30, 0.05) 0%, transparent 40%);
  animation: fog-drift 20s ease-in-out infinite alternate;
}

@keyframes fog-drift {
  0% { opacity: 0.6; transform: translateX(-2%); }
  100% { opacity: 1; transform: translateX(2%); }
}

.ambient-particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(1px 1px at 10% 20%, rgba(200, 180, 100, 0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 30% 60%, rgba(200, 180, 100, 0.2) 0%, transparent 100%),
    radial-gradient(1px 1px at 70% 40%, rgba(200, 180, 100, 0.25) 0%, transparent 100%),
    radial-gradient(1px 1px at 90% 80%, rgba(200, 180, 100, 0.15) 0%, transparent 100%),
    radial-gradient(1px 1px at 50% 10%, rgba(200, 180, 100, 0.2) 0%, transparent 100%);
  animation: particles-float 15s ease-in-out infinite alternate;
}

@keyframes particles-float {
  0% { transform: translateY(0); opacity: 0.5; }
  100% { transform: translateY(-10px); opacity: 0.8; }
}

/* Dust motes */
.ambient-dust {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.dust-mote {
  position: absolute;
  width: 3px;
  height: 3px;
  background: rgba(220, 200, 150, 0.6);
  border-radius: 50%;
  box-shadow: 0 0 3px rgba(220, 200, 150, 0.4);
  animation: dust-float linear infinite;
}

.dust-mote:nth-child(1)  { left: 8%;  top: 15%; width: 3px; height: 3px; animation-duration: 18s; animation-delay: 0s; opacity: 0.5; }
.dust-mote:nth-child(2)  { left: 22%; top: 45%; width: 4px; height: 4px; animation-duration: 22s; animation-delay: -3s; opacity: 0.7; }
.dust-mote:nth-child(3)  { left: 35%; top: 70%; width: 3px; height: 3px; animation-duration: 20s; animation-delay: -7s; opacity: 0.45; }
.dust-mote:nth-child(4)  { left: 50%; top: 25%; width: 5px; height: 5px; animation-duration: 25s; animation-delay: -2s; opacity: 0.55; }
.dust-mote:nth-child(5)  { left: 65%; top: 55%; width: 3px; height: 3px; animation-duration: 19s; animation-delay: -10s; opacity: 0.6; }
.dust-mote:nth-child(6)  { left: 78%; top: 80%; width: 4px; height: 4px; animation-duration: 23s; animation-delay: -5s; opacity: 0.5; }
.dust-mote:nth-child(7)  { left: 90%; top: 35%; width: 3px; height: 3px; animation-duration: 17s; animation-delay: -8s; opacity: 0.65; }
.dust-mote:nth-child(8)  { left: 15%; top: 90%; width: 4px; height: 4px; animation-duration: 21s; animation-delay: -12s; opacity: 0.5; }
.dust-mote:nth-child(9)  { left: 42%; top: 10%; width: 3px; height: 3px; animation-duration: 24s; animation-delay: -4s; opacity: 0.55; }
.dust-mote:nth-child(10) { left: 58%; top: 65%; width: 5px; height: 5px; animation-duration: 26s; animation-delay: -9s; opacity: 0.4; }
.dust-mote:nth-child(11) { left: 73%; top: 20%; width: 3px; height: 3px; animation-duration: 16s; animation-delay: -6s; opacity: 0.6; }
.dust-mote:nth-child(12) { left: 30%; top: 50%; width: 4px; height: 4px; animation-duration: 20s; animation-delay: -14s; opacity: 0.5; }
.dust-mote:nth-child(13) { left: 5%;  top: 60%; width: 3px; height: 3px; animation-duration: 21s; animation-delay: -1s; opacity: 0.45; }
.dust-mote:nth-child(14) { left: 18%; top: 30%; width: 4px; height: 4px; animation-duration: 19s; animation-delay: -11s; opacity: 0.55; }
.dust-mote:nth-child(15) { left: 45%; top: 85%; width: 3px; height: 3px; animation-duration: 23s; animation-delay: -6s; opacity: 0.5; }
.dust-mote:nth-child(16) { left: 82%; top: 50%; width: 5px; height: 5px; animation-duration: 26s; animation-delay: -3s; opacity: 0.4; }
.dust-mote:nth-child(17) { left: 55%; top: 15%; width: 3px; height: 3px; animation-duration: 17s; animation-delay: -8s; opacity: 0.6; }
.dust-mote:nth-child(18) { left: 68%; top: 72%; width: 4px; height: 4px; animation-duration: 22s; animation-delay: -13s; opacity: 0.5; }
.dust-mote:nth-child(19) { left: 12%; top: 75%; width: 3px; height: 3px; animation-duration: 18s; animation-delay: -4s; opacity: 0.55; }
.dust-mote:nth-child(20) { left: 38%; top: 35%; width: 4px; height: 4px; animation-duration: 24s; animation-delay: -9s; opacity: 0.45; }
.dust-mote:nth-child(21) { left: 85%; top: 10%; width: 3px; height: 3px; animation-duration: 20s; animation-delay: -15s; opacity: 0.5; }
.dust-mote:nth-child(22) { left: 60%; top: 40%; width: 5px; height: 5px; animation-duration: 25s; animation-delay: -7s; opacity: 0.4; }
.dust-mote:nth-child(23) { left: 25%; top: 5%;  width: 3px; height: 3px; animation-duration: 19s; animation-delay: -2s; opacity: 0.6; }
.dust-mote:nth-child(24) { left: 48%; top: 58%; width: 4px; height: 4px; animation-duration: 21s; animation-delay: -10s; opacity: 0.5; }

@keyframes dust-float {
  0% {
    transform: translate(0, 0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translate(80px, -120px) rotate(360deg);
    opacity: 0;
  }
}

/* --------------------------------------------------------------------------
   7. TIER 1 — Top Shelf
   -------------------------------------------------------------------------- */

.top-tier {
  position: relative;
  z-index: var(--z-top-tier);
  padding: 1.5rem 1rem 0.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.top-tier-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 1.5rem;
}

/* Title Shield (center) */
.title-shield-area {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.title-shield {
  width: 100%;
  max-width: 400px;
  height: auto;
  filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.8));
}

.site-subtitle {
  font-family: var(--font-display);
  font-size: clamp(0.6rem, 1.8vw, 0.85rem);
  color: var(--color-text-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin: 0.75rem 0 0;
  line-height: 1.8;
}

/* --------------------------------------------------------------------------
   8. Shelf Nooks (Candle & Album)
   -------------------------------------------------------------------------- */

.shelf-nook {
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.shelf-nook--candle {
  justify-content: flex-end;
}

.shelf-nook--candle .shelf-nook-frame {
  animation: candle-nook-glow 2s ease-in-out infinite alternate;
}

@keyframes candle-nook-glow {
  0% {
    box-shadow:
      inset 0 0 30px rgba(0, 0, 0, 0.5),
      0 4px 16px rgba(0, 0, 0, 0.6),
      0 0 8px rgba(245, 166, 35, 0.1);
  }
  100% {
    box-shadow:
      inset 0 0 30px rgba(0, 0, 0, 0.5),
      0 4px 16px rgba(0, 0, 0, 0.6),
      0 0 15px rgba(245, 166, 35, 0.2),
      0 0 30px rgba(245, 166, 35, 0.08);
  }
}

.shelf-nook--album {
  justify-content: flex-start;
}

.shelf-nook-frame {
  position: relative;
  width: 200px;
  height: 200px;
  border-radius: 4px;
  overflow: hidden;
  box-shadow:
    inset 0 0 30px rgba(0, 0, 0, 0.5),
    0 4px 16px rgba(0, 0, 0, 0.6);
}

.shelf-nook-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Album nook specifics */
.shelf-nook-link {
  display: block;
  text-decoration: none;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  cursor: pointer;
  border: none;
  padding: 0;
  font: inherit;
}

.shelf-nook-link:hover {
  transform: scale(1.03);
  box-shadow:
    inset 0 0 30px rgba(0, 0, 0, 0.5),
    0 4px 20px rgba(201, 168, 76, 0.2);
}

.album-cover {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: auto;
  border-radius: 3px;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.7),
    0 0 8px rgba(201, 168, 76, 0.3),
    0 0 16px rgba(201, 168, 76, 0.15);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  animation: album-pulse 2.5s ease-in-out infinite alternate;
}

@keyframes album-pulse {
  0% {
    box-shadow:
      0 4px 12px rgba(0, 0, 0, 0.7),
      0 0 6px rgba(201, 168, 76, 0.2),
      0 0 12px rgba(201, 168, 76, 0.1);
  }
  100% {
    box-shadow:
      0 4px 12px rgba(0, 0, 0, 0.7),
      0 0 12px rgba(201, 168, 76, 0.45),
      0 0 24px rgba(201, 168, 76, 0.2);
  }
}

.album-cta-label {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-size: 0.6rem;
  color: var(--color-gold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.shelf-nook-link:hover .album-cover {
  transform: translateX(-50%) scale(1.05);
}

.album-label {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-size: 0.6rem;
  color: var(--color-gold);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.shelf-nook-link:hover .album-label {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   9. Procedural Candle Flame
   -------------------------------------------------------------------------- */

.candle-flame {
  position: absolute;
  /* Positioned at the candle wick — centered horizontally, near top of candle */
  top: 28%;
  left: 20%;
  transform: translateX(-50%);
  width: 20px;
  height: 50px;
  pointer-events: none;
}

.flame-body {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 36px;
  background:
    radial-gradient(ellipse at 50% 90%,
      var(--color-flame-core) 0%,
      var(--color-flame-mid) 40%,
      var(--color-flame-outer) 70%,
      transparent 100%
    );
  border-radius: 50% 50% 20% 20% / 70% 70% 30% 30%;
  animation: flame-flicker 0.8s ease-in-out infinite alternate;
  filter: blur(0.5px);
}

.flame-body::before {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 18px;
  background:
    radial-gradient(ellipse at 50% 80%,
      var(--color-flame-core) 0%,
      rgba(255, 248, 224, 0.6) 60%,
      transparent 100%
    );
  border-radius: 50% 50% 20% 20% / 70% 70% 30% 30%;
  animation: flame-inner 0.6s ease-in-out infinite alternate-reverse;
}

.flame-glow {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 60px;
  background: radial-gradient(
    circle,
    rgba(245, 166, 35, 0.25) 0%,
    rgba(245, 166, 35, 0.08) 40%,
    transparent 70%
  );
  border-radius: 50%;
  animation: glow-pulse 2s ease-in-out infinite alternate;
}

@keyframes flame-flicker {
  0% {
    transform: translateX(-50%) scaleX(1) scaleY(1);
    opacity: 1;
  }
  25% {
    transform: translateX(-48%) scaleX(0.9) scaleY(1.05);
  }
  50% {
    transform: translateX(-52%) scaleX(1.05) scaleY(0.95);
    opacity: 0.9;
  }
  75% {
    transform: translateX(-49%) scaleX(0.95) scaleY(1.02);
  }
  100% {
    transform: translateX(-51%) scaleX(1) scaleY(0.98);
    opacity: 0.95;
  }
}

@keyframes flame-inner {
  0% { transform: translateX(-50%) scaleY(1); opacity: 0.9; }
  100% { transform: translateX(-50%) scaleY(1.1); opacity: 1; }
}

@keyframes glow-pulse {
  0% { opacity: 0.6; transform: translateX(-50%) scale(1); }
  100% { opacity: 0.9; transform: translateX(-50%) scale(1.1); }
}

/* --------------------------------------------------------------------------
   10. TIER 2 — Bookshelf / Carousel
   -------------------------------------------------------------------------- */

.bookshelf {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 3.5rem;
  overflow: visible;
  background:
    linear-gradient(180deg,
      rgba(0, 0, 0, 0.4) 0%,
      transparent 15%,
      transparent 85%,
      rgba(0, 0, 0, 0.6) 100%
    ),
    repeating-linear-gradient(
      95deg,
      transparent,
      transparent 8px,
      rgba(90, 61, 26, 0.08) 8px,
      rgba(90, 61, 26, 0.08) 9px
    ),
    linear-gradient(180deg, var(--color-wood-mid) 0%, var(--color-wood-dark) 100%);
  border: 3px solid var(--color-wood-highlight);
  border-radius: 6px;
  box-shadow:
    inset 0 0 60px rgba(0, 0, 0, 0.7),
    0 10px 40px rgba(0, 0, 0, 0.8),
    0 0 1px var(--color-wood-highlight);
}

/* Top molding */
.bookshelf::before {
  content: '';
  position: absolute;
  top: -8px;
  left: -3px;
  right: -3px;
  height: 8px;
  background: linear-gradient(180deg,
    var(--color-wood-highlight) 0%,
    var(--color-wood-mid) 50%,
    var(--color-wood-dark) 100%
  );
  border-radius: 4px 4px 0 0;
  border: 1px solid var(--color-wood-highlight);
  border-bottom: none;
}

/* Columns */
.bookshelf-column {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 28px;
  z-index: var(--z-columns);
  background:
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 4px,
      rgba(90, 61, 26, 0.3) 4px,
      rgba(90, 61, 26, 0.3) 5px,
      transparent 5px,
      transparent 9px
    ),
    linear-gradient(90deg,
      var(--color-wood-dark) 0%,
      var(--color-wood-light) 30%,
      var(--color-wood-highlight) 50%,
      var(--color-wood-light) 70%,
      var(--color-wood-dark) 100%
    );
  border: 1px solid var(--color-wood-highlight);
  pointer-events: none;
}

.bookshelf-column--left {
  left: -3px;
  border-radius: 4px 0 0 4px;
}

.bookshelf-column--right {
  right: -3px;
  border-radius: 0 4px 4px 0;
}

.bookshelf-column::before {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  height: 20px;
  background: linear-gradient(180deg, var(--color-wood-highlight) 0%, var(--color-wood-mid) 100%);
  border-radius: 3px 3px 0 0;
  border: 1px solid var(--color-wood-highlight);
}

.bookshelf-column::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: -4px;
  right: -4px;
  height: 16px;
  background: linear-gradient(0deg, var(--color-wood-highlight) 0%, var(--color-wood-mid) 100%);
  border-radius: 0 0 3px 3px;
  border: 1px solid var(--color-wood-highlight);
}

/* Shelf surface */
.bookshelf-shelf {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 24px;
  z-index: var(--z-shelf);
  background: linear-gradient(180deg,
    var(--color-wood-highlight) 0%,
    var(--color-wood-mid) 30%,
    var(--color-wood-dark) 100%
  );
  border-top: 2px solid var(--color-wood-highlight);
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.5), inset 0 2px 4px rgba(90, 61, 26, 0.3);
}

.bookshelf-shelf::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: -3px;
  right: -3px;
  height: 10px;
  background: linear-gradient(180deg, var(--color-wood-mid) 0%, var(--color-wood-dark) 100%);
  border: 1px solid var(--color-wood-highlight);
  border-top: none;
  border-radius: 0 0 4px 4px;
}

/* --------------------------------------------------------------------------
   11. Carousel Mechanics
   -------------------------------------------------------------------------- */

.carousel {
  position: relative;
  padding: 0.5rem 0 1rem;
  z-index: var(--z-card-active);
  overflow: visible;
}

.carousel-viewport {
  overflow: visible;
  padding: 1.5rem 0 2rem;
}

.carousel-track {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: var(--card-gap);
  transition: transform var(--transition-card);
  will-change: transform;
  transform: translateZ(0);
  padding: 0 1rem;
}

/* Navigation buttons */
.carousel-nav {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: var(--z-nav);
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: auto;
  width: 44px;
  height: 44px;
  border-radius: 4px;
  background: rgba(26, 18, 8, 0.9);
  border: 2px solid var(--color-wood-highlight);
  color: var(--color-gold);
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  transition: background var(--transition-fast), box-shadow var(--transition-fast);
  z-index: var(--z-nav);
}

.carousel-btn--prev { left: 0.5rem; }
.carousel-btn--next { right: 0.5rem; }

.carousel-btn:hover {
  background: rgba(42, 30, 14, 0.95);
  box-shadow: 0 0 12px rgba(201, 168, 76, 0.3);
}

/* Dot indicators */
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--color-gold-dim);
  background: transparent;
  padding: 0;
  transition: background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.carousel-dot.active {
  background: var(--color-green-glow);
  border-color: var(--color-green-glow);
  box-shadow: 0 0 6px var(--color-green-glow), 0 0 12px rgba(46, 204, 113, 0.3);
}

/* --------------------------------------------------------------------------
   12. Game Cards
   -------------------------------------------------------------------------- */

.game-card {
  width: var(--card-width);
  flex-shrink: 0;
  position: relative;
  z-index: var(--z-cards);
  transition: transform var(--transition-card), filter var(--transition-card), z-index 0ms 250ms;
  transform-origin: bottom center;
  cursor: pointer;
  contain: layout style;
}

.game-card:not(.active) {
  transform: scale(0.85);
  filter: brightness(0.55) saturate(0.7);
}

/* Hover tilt on non-active cards — no perspective to avoid layout thrash */
.game-card:not(.active):hover {
  transform: scale(0.88) rotateY(-2deg);
  filter: brightness(0.7) saturate(0.8);
}

/* Keyboard focus ring */
.game-card:focus-visible {
  outline: none;
}

.game-card:focus-visible .card-inner {
  outline: 2px solid var(--color-gold);
  outline-offset: 3px;
  border-color: var(--color-gold);
}

.game-card.active {
  transform: scale(var(--active-scale)) translateY(-12px);
  z-index: var(--z-card-active);
  filter: brightness(1) saturate(1);
  transition: transform var(--transition-card), filter var(--transition-card), z-index 0ms 0ms;
  position: relative;
}

.card-inner {
  position: relative;
  width: 100%;
  height: var(--card-height);
  border-radius: 4px;
  overflow: hidden;
  border: 2px solid var(--color-wood-highlight);
  box-shadow: 2px 4px 12px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(0, 0, 0, 0.3);
  transition: border-color var(--transition-card), box-shadow var(--transition-card);
}

.game-card.active .card-inner {
  border-color: var(--color-green-glow);
  box-shadow:
    0 0 15px rgba(46, 204, 113, 0.4),
    0 0 30px rgba(46, 204, 113, 0.2),
    2px 4px 20px rgba(0, 0, 0, 0.8),
    inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.card-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.card-title-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: linear-gradient(180deg,
    rgba(0, 0, 0, 0.1) 0%,
    rgba(0, 0, 0, 0.3) 40%,
    rgba(0, 0, 0, 0.6) 100%
  );
  opacity: 1;
  transition: opacity var(--transition-fast);
}

.game-card.active .card-title-overlay {
  opacity: 0;
}

.game-card.coming-soon.active .card-title-overlay {
  opacity: 1;
}

.card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(0.75rem, 2.5vw, 1rem);
  color: var(--color-text-heading);
  text-align: center;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Active card CTA */
.card-cta {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  padding: 0.75rem;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.85) 0%, transparent 100%);
  transform: translateY(100%);
  transition: transform var(--transition-card);
}

.game-card.active .card-cta {
  transform: translateY(0);
}

.card-play-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 1rem;
  background: rgba(46, 204, 113, 0.15);
  border: 1.5px solid var(--color-green-glow);
  color: var(--color-green-bright);
  font-family: var(--font-display);
  font-size: 0.6rem;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: 3px;
  transition: background var(--transition-fast), box-shadow var(--transition-fast);
}

.card-play-btn:hover {
  background: rgba(46, 204, 113, 0.25);
  box-shadow: 0 0 12px rgba(46, 204, 113, 0.4);
}

.card-play-btn svg {
  width: 12px;
  height: 12px;
}

/* Coming Soon cards */
.game-card.coming-soon {
  cursor: default;
}

.card-coming-soon-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 60%, rgba(20, 30, 40, 0.9) 0%, rgba(10, 10, 15, 1) 100%);
}

.card-title-overlay--coming-soon {
  flex-direction: column;
  gap: 0.5rem;
  background: linear-gradient(180deg,
    rgba(0, 0, 0, 0.2) 0%,
    rgba(0, 0, 0, 0.5) 100%
  );
}

.coming-soon-badge {
  font-family: var(--font-display);
  font-size: 0.55rem;
  color: var(--color-gold-dim);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--color-gold-dim);
  border-radius: 2px;
  opacity: 0.8;
}

.game-card.coming-soon .card-inner {
  border-color: rgba(90, 61, 26, 0.4);
  box-shadow: 2px 4px 12px rgba(0, 0, 0, 0.6), inset 0 0 30px rgba(0, 0, 0, 0.6);
}

.game-card.coming-soon.active .card-inner {
  border-color: var(--color-gold-dim);
  box-shadow:
    0 0 10px rgba(138, 109, 47, 0.2),
    2px 4px 20px rgba(0, 0, 0, 0.8),
    inset 0 0 30px rgba(0, 0, 0, 0.5);
}

/* --------------------------------------------------------------------------
   13. TIER 3 — Game Info Panel
   -------------------------------------------------------------------------- */

.game-info-panel {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
}

.game-info-inner {
  padding: 1.5rem 2.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  background:
    linear-gradient(180deg,
      rgba(0, 0, 0, 0.4) 0%,
      transparent 30%,
      transparent 70%,
      rgba(0, 0, 0, 0.3) 100%
    ),
    repeating-linear-gradient(
      95deg,
      transparent,
      transparent 8px,
      rgba(90, 61, 26, 0.05) 8px,
      rgba(90, 61, 26, 0.05) 9px
    ),
    linear-gradient(180deg, var(--color-wood-dark) 0%, var(--color-surface) 100%);
  border: 2px solid rgba(90, 61, 26, 0.4);
  border-top: none;
  border-radius: 0 0 4px 4px;
  box-shadow:
    inset 0 0 30px rgba(0, 0, 0, 0.5),
    0 6px 20px rgba(0, 0, 0, 0.5);
}

.game-info-center {
  flex: 1;
  text-align: center;
}

.game-info-title {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  color: var(--color-text-heading);
  margin: 0 0 0.5rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: opacity 300ms ease;
}

.game-info-description {
  font-family: var(--font-body);
  font-size: clamp(0.9rem, 2vw, 1rem);
  color: var(--color-text);
  line-height: 1.7;
  margin: 0 0 1rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  transition: opacity 300ms ease;
}

.game-info-play-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.5rem;
  background: rgba(46, 204, 113, 0.12);
  border: 1.5px solid var(--color-green-glow);
  color: var(--color-green-bright);
  font-family: var(--font-display);
  font-size: 0.7rem;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: 3px;
  transition: background var(--transition-fast), box-shadow var(--transition-fast);
}

.game-info-play-btn:hover {
  background: rgba(46, 204, 113, 0.25);
  box-shadow: 0 0 15px rgba(46, 204, 113, 0.4);
}

.game-info-play-btn svg {
  width: 14px;
  height: 14px;
}

/* Quote (left side of info panel) */
.lovecraft-quote {
  margin: 0;
  max-width: 200px;
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--color-gold-dim);
  background: rgba(26, 18, 8, 0.4);
  border-radius: 0 4px 4px 0;
  text-align: left;
  flex-shrink: 0;
}

.lovecraft-quote p {
  font-family: var(--font-body);
  font-style: italic;
  font-size: clamp(0.8rem, 2vw, 0.95rem);
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.6;
}

/* Back to Arcade column (right side of info panel) */
.back-to-arcade-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.skull-books-img {
  width: 180px;
  height: 44px;
  object-fit: contain;
}

.back-to-arcade {
  display: inline-block;
  color: var(--color-gold);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
  white-space: nowrap;
  padding: 0.6rem 1.2rem;
  border: 1.5px solid var(--color-gold-dim);
  border-radius: 3px;
  background: rgba(26, 18, 8, 0.5);
}

.back-to-arcade:hover {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   15. Footer
   -------------------------------------------------------------------------- */

.site-footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  position: relative;
  z-index: 1;
}

.footer-inner {
  max-width: 600px;
  margin: 0 auto;
}

.site-footer a {
  color: var(--color-gold);
  text-decoration: none;
  opacity: 0.8;
}

.site-footer a:hover {
  opacity: 1;
}

.footer-copyright {
  margin: 1rem 0 0;
}

/* Tip Jar */
.tip-jar-section {
  margin-bottom: 1rem;
  text-align: center;
}

.tip-jar-text {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin: 0 0 0.75rem;
  line-height: 1.4;
}

.tip-jar-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.tip-jar-btn {
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.tip-jar-btn:hover {
  transform: scale(1.08);
}

.qr-code-wrapper {
  background: #fff;
  padding: 4px;
  border-radius: 4px;
  line-height: 0;
}

/* --------------------------------------------------------------------------
   16. Soundtrack Player
   -------------------------------------------------------------------------- */

.soundtrack-player {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(13, 11, 8, 0.92);
  border: 1.5px solid var(--color-wood-highlight);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.soundtrack-player.is-playing {
  border-color: var(--color-green-dim);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), 0 0 8px rgba(46, 204, 113, 0.15);
}

.soundtrack-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: none;
  color: var(--color-text);
  padding: 0.25rem;
  border-radius: 4px;
  transition: color var(--transition-fast);
}

.soundtrack-toggle:hover {
  color: var(--color-green-bright);
}

.soundtrack-icon {
  width: 18px;
  height: 18px;
}

.soundtrack-label {
  font-family: var(--font-display);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
}

.soundtrack-info {
  max-width: 140px;
  overflow: hidden;
}

.soundtrack-track-name {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

/* --------------------------------------------------------------------------
   17. Album Modal
   -------------------------------------------------------------------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  backdrop-filter: blur(4px);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-content {
  position: relative;
  max-width: 420px;
  width: 100%;
  background:
    linear-gradient(180deg, var(--color-wood-mid) 0%, var(--color-wood-dark) 100%);
  border: 2px solid var(--color-wood-highlight);
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  text-align: center;
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: color var(--transition-fast);
}

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

.album-modal-cover {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 6px;
  margin: 0 auto 1.25rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.album-modal-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--color-text-heading);
  margin: 0 0 0.75rem;
}

.album-modal-description {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin: 0 0 1.5rem;
}

.album-modal-links {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.album-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  border-radius: 4px;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.album-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.album-link--spotify {
  background: rgba(30, 215, 96, 0.12);
  border: 1.5px solid rgba(30, 215, 96, 0.4);
  color: #1ed760;
}

.album-link--spotify:hover {
  background: rgba(30, 215, 96, 0.2);
  transform: translateY(-1px);
}

.album-link--apple {
  background: rgba(252, 60, 68, 0.1);
  border: 1.5px solid rgba(252, 60, 68, 0.35);
  color: #fc3c44;
}

.album-link--apple:hover {
  background: rgba(252, 60, 68, 0.18);
  transform: translateY(-1px);
}

.album-link--other {
  background: rgba(201, 168, 76, 0.1);
  border: 1.5px solid rgba(201, 168, 76, 0.35);
  color: var(--color-gold);
}

.album-link--other:hover {
  background: rgba(201, 168, 76, 0.18);
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   18. Utilities
   -------------------------------------------------------------------------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   19. Focus Indicators
   -------------------------------------------------------------------------- */

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   20. Responsive Breakpoints
   -------------------------------------------------------------------------- */

/* Small phones */
@media (max-width: 600px) {
  :root {
    --card-width: 140px;
    --card-height: 200px;
    --active-scale: 1.1;
  }

  .top-tier-inner {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 1rem;
    justify-items: center;
  }

  /* Shield on top, nooks side by side below */
  .title-shield-area {
    order: 1;
  }

  .shelf-nook--candle {
    order: 2;
    justify-content: center;
  }

  .shelf-nook--album {
    order: 3;
    justify-content: center;
  }

  /* Stack nooks into a row below shield */
  .top-tier-inner {
    grid-template-columns: 1fr 1fr;
  }

  .title-shield-area {
    grid-column: 1 / -1;
  }

  .shelf-nook-frame {
    width: 150px;
    height: 150px;
  }

  .title-shield {
    max-width: 280px;
  }

  .bookshelf {
    padding: 1.5rem 2rem;
    margin: 0 0.5rem;
  }

  .bookshelf-column {
    width: 16px;
  }

  .carousel-btn {
    width: 36px;
    height: 36px;
    font-size: 1.4rem;
  }

  .game-info-inner {
    padding: 1.5rem 1rem;
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
  }

  .lovecraft-quote {
    max-width: 100%;
    border-left: none;
    border-top: 3px solid var(--color-gold-dim);
    border-radius: 4px 4px 0 0;
  }

  .candle-flame {
    top: 22%;
    width: 16px;
    height: 40px;
  }

  .flame-body {
    width: 11px;
    height: 28px;
  }

  .game-info-inner {
    padding: 1.25rem 1rem;
  }

  .soundtrack-player {
    bottom: 0.5rem;
    right: 0.5rem;
    padding: 0.4rem 0.6rem;
  }

  .soundtrack-label {
    display: none;
  }

  .soundtrack-info {
    max-width: 100px;
  }
}

/* Tablets */
@media (min-width: 601px) and (max-width: 900px) {
  :root {
    --card-width: 160px;
    --card-height: 230px;
  }

  .shelf-nook-frame {
    width: 170px;
    height: 170px;
  }

  .title-shield {
    max-width: 340px;
  }

  .bookshelf {
    padding: 1.5rem 3rem;
    margin: 0 1rem;
  }

  .game-info-inner {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
  }

  .lovecraft-quote {
    max-width: 100%;
  }
}

/* Large desktop */
@media (min-width: 1200px) {
  :root {
    --card-width: 200px;
    --card-height: 290px;
  }

  .shelf-nook-frame {
    width: 220px;
    height: 220px;
  }
}

/* --------------------------------------------------------------------------
   21. Reduced Motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  .ambient-fog,
  .ambient-particles,
  .ambient-dust,
  .flame-body,
  .flame-body::before,
  .flame-glow,
  .shelf-nook--candle .shelf-nook-frame,
  .album-cover {
    animation: none;
  }

  .dust-mote {
    animation: none;
    opacity: 0.2;
  }

  .game-card:not(.active):hover {
    transform: scale(0.85);
  }
}
