/* ═══════════════════════════════════════════════════════════
   Arcade Edition — For You, Always.
   Theme: Howl's Moving Castle — Deep Blue Magic
   ═══════════════════════════════════════════════════════════ */

/* ── Variables ──────────────────────────────────────────── */
:root {
  /* Loading & Password screens — Howl night sky */
  --blue-deep: #050d1a;
  --blue-night: #0a1628;
  --blue-mid: #0f2444;
  --blue-royal: #1a3a6e;
  --blue-bright: #2563a8;
  --blue-sky: #4a90d9;
  --blue-light: #7ec8e3;
  --blue-glow: #93d4f5;
  --magic-teal: #00e5cc;
  --star-white: #d6eeff;

  /* Main menu — warm Ghibli tones */
  --gold: #f4c653;
  --gold-dim: #c9962a;
  --cream: #e8d5b0;
  --cream-dim: #b8a07a;
  --brown-dark: #2C1810;
  --brown-mid: #5A3E2B;
  --warm-white: rgba(255, 252, 245, 0.92);
  --label-bg: rgba(255, 255, 255, 0.85);
  --label-border: rgba(44, 24, 16, 0.15);
  --label-color: #2C1810;
  --label-hover: #f4c653;
}

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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'DM Sans', sans-serif;
  background: #2C1810;
  -webkit-font-smoothing: antialiased;
  image-rendering: pixelated;
}

/* ── Screen System ─────────────────────────────────────── */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s ease;
  z-index: 1;
}

.screen.active {
  opacity: 1;
  pointer-events: all;
  z-index: 10;
}

.screen.fade-out {
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.screen.fade-in {
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/* ═══════════════════════════════════════════════════════════
   LOADING SCREEN — Dreamy Ghibli
   ═══════════════════════════════════════════════════════════ */
#loading-screen {
  background:
    linear-gradient(180deg, rgba(26, 14, 8, 0.52) 0%, rgba(44, 24, 16, 0.35) 60%, rgba(26, 14, 8, 0.55) 100%),
    url('assets/bg_ghibli.webp') no-repeat center center / cover;
  flex-direction: column;
  gap: 2rem;
  overflow: hidden;
}

/* ── Pixel Lanterns ──────────────────────────────────────── */
.lantern-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.lantern {
  position: absolute;
  width: 16px;
  height: 22px;
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(255, 200, 80, 0.9) 0%, rgba(240, 140, 30, 0.85) 100%);
  box-shadow:
    0 0 12px 6px rgba(255, 190, 60, 0.45),
    0 0 28px 10px rgba(255, 160, 30, 0.2),
    inset 0 2px 4px rgba(255, 240, 180, 0.6);
  animation: lanternFloat ease-in-out infinite;
  image-rendering: pixelated;
}

.lantern::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 10px;
  background: rgba(180, 120, 50, 0.7);
}

.lantern::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 8px;
  background: rgba(220, 160, 60, 0.8);
}

.lantern-1 {
  top: 8%;
  left: 12%;
  animation-duration: 6s;
  animation-delay: 0s;
  width: 14px;
  height: 20px;
}

.lantern-2 {
  top: 12%;
  right: 15%;
  animation-duration: 7.5s;
  animation-delay: 1.2s;
  width: 18px;
  height: 24px;
}

.lantern-3 {
  top: 5%;
  left: 42%;
  animation-duration: 5.5s;
  animation-delay: 2.5s;
  width: 12px;
  height: 18px;
  opacity: 0.75;
}

.lantern-4 {
  top: 18%;
  right: 38%;
  animation-duration: 8s;
  animation-delay: 0.7s;
  width: 10px;
  height: 16px;
  opacity: 0.6;
}

@keyframes lanternFloat {

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

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

/* ── Sparkle Dust ────────────────────────────────────────── */
.loading-dust {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.dust-particle {
  position: absolute;
  background: rgba(255, 230, 160, 0.9);
  border-radius: 50%;
  box-shadow: 0 0 6px 2px rgba(255, 210, 100, 0.6);
  animation: dustDrift linear forwards;
}

@keyframes dustDrift {
  0% {
    transform: translateY(100vh) scale(0);
    opacity: 0;
  }

  20% {
    opacity: 1;
    transform: translateY(80vh) scale(1);
  }

  80% {
    opacity: 0.8;
  }

  100% {
    transform: translateY(-10vh) scale(0.5);
    opacity: 0;
  }
}

/* ── Emblem & Text ───────────────────────────────────────── */
.loading-hero {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 2rem;
  animation: fadeInHero 1.2s ease-out forwards;
}

@keyframes fadeInHero {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

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

.loading-emblem {
  position: relative;
  width: 90px;
  height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 3.5rem;
}

.emblem-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2.5px solid rgba(244, 198, 83, 0.5);
  /* Thicker and more opaque */
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.emblem-ring-outer {
  border-left-color: rgba(244, 198, 83, 1);
  border-right-color: rgba(244, 198, 83, 1);
  animation: spinOuter 8s linear infinite;
  box-shadow: 0 0 15px rgba(244, 198, 83, 0.3);
}

.emblem-ring-inner {
  inset: 12px;
  border-top-color: rgba(244, 198, 83, 1);
  border-bottom-color: rgba(244, 198, 83, 1);
  animation: spinInner 5s linear infinite reverse;
}

.emblem-star {
  font-size: 1.8rem;
  color: #F4C653;
  filter: drop-shadow(0 0 12px rgba(244, 198, 83, 0.9)) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
  animation: starPulse 2.5s ease-in-out infinite;
}

@keyframes spinOuter {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes spinInner {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes starPulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.8;
  }

  50% {
    transform: scale(1.15);
    opacity: 1;
    filter: drop-shadow(0 0 20px rgba(244, 198, 83, 0.9));
  }
}

/* Loading text */
.loading-text {
  position: absolute;
  bottom: -45px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: 'Caveat', cursive;
  font-weight: 700;
  font-size: clamp(2rem, 6.5vw, 2.8rem); /* Slightly larger for Caveat */
  color: #FFFFFF;
  text-shadow:
    0 0 10px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(244, 198, 83, 0.9),
    0 0 60px rgba(244, 198, 83, 0.6),
    0 3px 8px rgba(0, 0, 0, 1),
    0 6px 24px rgba(0, 0, 0, 0.8);
  opacity: 1;
  letter-spacing: 0.5px;
}

.loading-name {
  color: #F4C653;
  font-weight: 800;
  text-shadow:
    0 0 8px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(244, 198, 83, 1),
    0 0 40px rgba(244, 198, 83, 0.7),
    0 3px 8px rgba(0, 0, 0, 1);
}

/* Loading bar */
.loading-bar-container {
  width: 220px;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  z-index: 3;
  box-shadow: 0 0 12px rgba(244, 198, 83, 0.15);
}

.loading-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #D4A86A, #F4C653, #fff2cc);
  border-radius: 4px;
  transition: width 0.3s ease;
  box-shadow: 0 0 10px rgba(244, 198, 83, 0.6);
}

/* ═══════════════════════════════════════════════════════════
   PASSWORD GATE — Dreamy Ghibli Card
   ═══════════════════════════════════════════════════════════ */
#password-screen {
  background:
    linear-gradient(180deg, rgba(12, 7, 3, 0.38) 0%, rgba(44, 24, 16, 0.22) 50%, rgba(12, 7, 3, 0.45) 100%),
    url('assets/bg_ghibli.webp') no-repeat center center / cover;
  overflow: hidden;
}

#password-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(12, 7, 3, 0.55) 100%);
  pointer-events: none;
}

/* ── Password Card: Solid Parchment ───────────────────── */
.password-card {
  position: relative;
  background: #F5EDD8;
  border: 3px solid #C4913A;
  border-radius: 16px;
  padding: 2.8rem 2.2rem 2.4rem;
  text-align: center;
  max-width: 340px;
  width: 90%;
  box-shadow:
    0 0 0 6px rgba(196, 145, 58, 0.18),
    0 20px 60px rgba(0, 0, 0, 0.45),
    0 8px 24px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  z-index: 10;
  animation: cardAppear 0.65s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes cardAppear {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.94);
  }

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

.password-card::before,
.password-card::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: #C4913A;
  border-style: solid;
}

.password-card::before {
  top: 10px;
  left: 10px;
  border-width: 2px 0 0 2px;
}

.password-card::after {
  bottom: 10px;
  right: 10px;
  border-width: 0 2px 2px 0;
}

/* Animated Crystal Ball SVG */
.password-icon-container {
  width: 72px;
  height: 86px;
  margin: 0 auto 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 6px 15px rgba(157, 110, 191, 0.4));
  animation: ballFloat 4s ease-in-out infinite;
}

.crystal-ball-svg {
  width: 100%;
  height: 100%;
}

@keyframes ballFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.ball-overlay {
  animation: glowPulse 4s ease-in-out infinite alternate;
}

@keyframes glowPulse {
  from { opacity: 0.4; }
  to { opacity: 0.95; }
}

.particles circle {
  animation: particleDance 3.5s infinite ease-in-out;
}

.p2 { animation-delay: -1.2s; }
.p3 { animation-delay: -2.4s; }

@keyframes particleDance {
  0%, 100% { transform: translate(0, 0); opacity: 0.3; }
  50% { transform: translate(5px, -10px); opacity: 1; }
}

.star-s1, .star-s2 {
  opacity: 0;
  transform-origin: center;
  animation: starTwinkle 4s infinite;
}

.star-s2 { animation-delay: 2s; }

@keyframes starTwinkle {
  0%, 100% { opacity: 0; transform: scale(0.6) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.1) rotate(90deg); }
}

.password-title {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 600;
  font-size: 1.45rem;
  color: #3B1F08;
  margin-bottom: 0.3rem;
  letter-spacing: 0.2px;
  text-shadow: none;
}

.password-subtitle {
  font-size: 0.78rem;
  color: #8C6535;
  margin-bottom: 1.6rem;
  letter-spacing: 0.4px;
  font-weight: 400;
}

.password-subtitle::after {
  content: '';
  display: block;
  width: 36px;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, #C4913A, transparent);
  margin: 0.8rem auto 0;
}

.password-input {
  width: 100%;
  padding: 13px 16px;
  border: 2px solid #D4A86A;
  border-radius: 10px;
  background: rgba(255, 246, 230, 0.9);
  color: #3B1F08;
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  text-align: center;
  letter-spacing: 5px;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
  caret-color: #C4913A;
}

.password-input::placeholder {
  color: rgba(139, 101, 53, 0.45);
  letter-spacing: 2px;
  font-size: 0.85rem;
}

.password-input:focus {
  border-color: #C4913A;
  box-shadow: 0 0 0 3px rgba(196, 145, 58, 0.18), 0 2px 12px rgba(196, 145, 58, 0.12);
  background: #FFFDF5;
}

.password-input.shake {
  animation: shakeInput 0.4s ease;
  border-color: rgba(220, 60, 60, 0.6);
}

@keyframes shakeInput {

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

  25% {
    transform: translateX(-8px);
  }

  75% {
    transform: translateX(8px);
  }
}

.password-btn {
  width: 100%;
  padding: 13px;
  margin-top: 1rem;
  border: 2px solid #C4913A;
  border-bottom-width: 4px;
  border-radius: 10px;
  background: linear-gradient(180deg, #D4A86A 0%, #B87830 100%);
  color: #2C1008;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.58rem;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  box-shadow: 0 4px 12px rgba(160, 90, 20, 0.3);
}

.password-btn:hover {
  background: linear-gradient(180deg, #E0BB7A 0%, #C4913A 100%);
  border-color: #A8720A;
  box-shadow: 0 6px 20px rgba(160, 90, 20, 0.45);
  transform: translateY(-1px);
}

.password-btn:active {
  transform: translateY(2px);
  border-bottom-width: 2px;
  box-shadow: 0 1px 4px rgba(160, 90, 20, 0.25);
}

.password-error {
  color: #C0392B;
  font-size: 0.72rem;
  margin-top: 0.9rem;
  min-height: 1.1em;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
}

/* ── Password Hint (Note Scrap) ─────────────────────────── */
#password-hint-container {
  margin-top: 1.6rem;
  display: flex;
  justify-content: center;
}

.hint-scrap {
  position: relative;
  background: linear-gradient(160deg, #fdf3dc 0%, #f9e8c2 100%);
  padding: 14px 20px 14px 18px;
  max-width: 260px;
  min-width: 160px;
  border-radius: 3px 12px 12px 3px;
  box-shadow:
    3px 6px 18px rgba(0, 0, 0, 0.12),
    0 1px 4px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transform: rotate(-1.8deg);
  animation: hintSlideUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;

  /* Left accent stripe */
  border-left: 3.5px solid #c4913a;
}

/* Paper grain texture overlay */
.hint-scrap::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23grain)'/%3E%3C/svg%3E");
  opacity: 0.04;
  pointer-events: none;
  z-index: 0;
}


.hint-label {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: 'DM Sans', sans-serif;
  font-size: 7.5px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #c4913a;
  margin-bottom: 6px;
  font-weight: 700;
}

.hint-text {
  position: relative;
  z-index: 1;
  font-family: 'Caveat', cursive;
  font-size: 1.2rem;
  color: #3d2008;
  line-height: 1.4;
  display: block;
}

@keyframes hintSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px) rotate(-4deg) scale(0.92);
  }

  to {
    opacity: 1;
    transform: rotate(-1.8deg) scale(1);
  }
}

/* ═══════════════════════════════════════════════════════════
   MAIN MENU
   ═══════════════════════════════════════════════════════════ */
/* ══════════════════════════════════════════════════════════
   MAIN MENU — Living Diorama
   ══════════════════════════════════════════════════════════ */
#menu-screen {
  overflow: hidden;
  flex-direction: column;
  /* CSS custom props driven by the parallax JS */
  --px: 0px;
  --py: 0px;
}

/* ── Parallax Layer Base ───────────────────────────────── */
.parallax-layer {
  position: absolute;
  inset: -30px;
  /* extra bleed so layers never clip at edges */
  will-change: transform;
  pointer-events: none;
}

/* Layer 0 — Background */
.layer-bg {
  background: url('assets/bg_ghibli.webp') no-repeat center center;
  background-size: cover;
  transform: translate3d(calc(var(--px) * 0.03), calc(var(--py) * 0.03), 0);
  z-index: 0;
}

/* ── God Rays (Layer 1) ─────────────────────────────────── */
.layer-rays {
  z-index: 1;
  transform: translate3d(calc(var(--px) * 0.05), calc(var(--py) * 0.05), 0);
}

.god-ray {
  position: absolute;
  top: -20%;
  width: 180px;
  height: 160%;
  border-radius: 80px;
  opacity: 0;
  animation: rayPulse 8s ease-in-out infinite;
  pointer-events: none;
  transform-origin: top center;
  will-change: transform, opacity;
}

.ray-1 {
  left: 10%;
  background: linear-gradient(180deg, rgba(255, 220, 120, 0.18) 0%, transparent 80%);
  transform: rotate(-18deg);
  animation-delay: 0s;
}

.ray-2 {
  left: 38%;
  background: linear-gradient(180deg, rgba(255, 240, 180, 0.12) 0%, transparent 75%);
  transform: rotate(-5deg);
  animation-delay: 2.5s;
  width: 120px;
}

.ray-3 {
  left: 60%;
  background: linear-gradient(180deg, rgba(255, 210, 100, 0.14) 0%, transparent 70%);
  transform: rotate(10deg);
  animation-delay: 5s;
  width: 150px;
}

@keyframes rayPulse {

  0%,
  100% {
    opacity: 0;
  }

  30%,
  70% {
    opacity: 1;
  }
}

/* ── Petal Particles (Layer 2) ──────────────────────────── */
.layer-petals {
  z-index: 2;
  transform: translate3d(calc(var(--px) * 0.08), calc(var(--py) * 0.08), 0);
}

.petal {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50% 0 50% 0;
  opacity: 0;
  animation: petalDrift linear infinite;
  pointer-events: none;
  will-change: transform, opacity;
}

@keyframes petalDrift {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg);
    opacity: 0;
  }

  10% {
    opacity: 0.8;
  }

  90% {
    opacity: 0.6;
  }

  100% {
    transform: translateY(-120vh) translateX(80px) rotate(540deg);
    opacity: 0;
  }
}

/* ── Layer 3 — Menu + Sign container ───────────────────── */
.layer-menu {
  z-index: 3;
  pointer-events: none;
  transform: translate3d(calc(var(--px) * 0.14), calc(var(--py) * 0.14), 0);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.menu-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.3s ease, filter 0.3s;
  animation: itemFloat 3.5s ease-in-out infinite;
  position: relative;
}

.menu-item:nth-child(1) {
  animation-delay: 0s;
}

.menu-item:nth-child(2) {
  animation-delay: 0.5s;
}

.menu-item:nth-child(3) {
  animation-delay: 1s;
}

.menu-item:nth-child(4) {
  animation-delay: 1.5s;
}

.menu-item:nth-child(5) {
  animation-delay: 2s;
}

@keyframes itemFloat {

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

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

/* ── Organic Stepping-Stone Menu Layout ─────────────────── */
.menu-items {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 1.2rem 1.8rem;
  width: 100%;
  max-width: 680px;
  padding: 1rem 1.5rem 0;
  pointer-events: auto;
  margin-top: 30px;
}

.menu-item {
  flex: 0 0 100px;
  /* Base width for consistency */
}

/* Row undulation — row 1 items sit higher, row 2 lower */
.menu-item.row-1 {
  margin-top: 0px;
}

.menu-item.row-1:nth-child(even) {
  margin-top: -15px;
}

.menu-item.row-2 {
  margin-top: 8px;
}

.menu-item.row-2:nth-child(even) {
  margin-top: -10px;
}

/* Emoji/fallback icon for quiz if PNG missing */
.menu-icon-emoji {
  font-family: 'Press Start 2P', monospace;
  width: 68px;
  height: 68px;
  image-rendering: auto;
}

/* Hide broken quiz icon gracefully */
.menu-icon-emoji:not([src]),
.menu-icon-emoji[src=""] {
  visibility: hidden;
}

.menu-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
  width: 100%;
  transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.8s ease;
}

.menu-item:not(.locked):hover {
  transform: translateY(-8px) scale(1.06);
}

.menu-item.locked {
  filter: grayscale(1) brightness(0.4);
  pointer-events: none;
  opacity: 0.8;
}

/* Icon wrapper — adds glow ring on hover */
.menu-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-icon-wrap::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(244, 198, 83, 0);
  transition: border-color 0.3s, box-shadow 0.3s;
  pointer-events: none;
}

.menu-item:hover .menu-icon-wrap::after {
  border-color: rgba(244, 198, 83, 0.6);
  box-shadow: 0 0 18px rgba(244, 198, 83, 0.3);
}

.menu-icon {
  width: 68px;
  height: 68px;
  object-fit: contain;
  image-rendering: pixelated;
  animation: float 3s ease-in-out infinite;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
  transition: filter 0.3s;
  pointer-events: none;
}

.menu-item:hover .menu-icon {
  filter: drop-shadow(0 6px 18px rgba(244, 198, 83, 0.65)) brightness(1.12);
}

.menu-item:nth-child(even) .menu-icon {
  animation-delay: 1.5s;
}

.item-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.55rem;
  color: #4A3B2A;
  background: rgba(255, 255, 255, 0.85);
  border: 1.5px solid rgba(244, 198, 83, 0.35);
  padding: 6px 14px;
  border-radius: 50px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
  text-align: center;
  white-space: nowrap;
}

.menu-item:hover .item-label {
  background: #f4c653;
  color: #fff;
  border-color: #f4c653;
  box-shadow: 0 6px 20px rgba(244, 198, 83, 0.5);
  transform: scale(1.04);
}

@keyframes float {

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

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

/* ── Iris Overlay (Cinematic Room Transition) ───────────── */
.iris-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  background: radial-gradient(circle at var(--iris-x, 50%) var(--iris-y, 50%),
      transparent 0%,
      rgba(10, 20, 15, 0) var(--iris-r, 150%),
      rgba(10, 20, 15, 1) calc(var(--iris-r, 150%) + 5%));
  transition: --iris-r 0.0s;
  opacity: 0;
}

.iris-overlay.active {
  pointer-events: all;
  animation: irisClose 0.7s cubic-bezier(0.6, 0, 0.8, 1) forwards;
}

@keyframes irisClose {
  0% {
    opacity: 1;
    --iris-r: 140%;
  }

  100% {
    opacity: 1;
    --iris-r: 0%;
  }
}

/* ── Legacy Sprite Removal (Cleaning Up) ────────────────── */

/* Camera — original warm tones */






/* ── Wooden Name Sign (Main Menu) ──────────────────────── */
.wood-sign-block {
  position: absolute;
  top: 2%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(320px, 78vw);
  aspect-ratio: 4 / 2;
  min-height: 80px;
  opacity: 0;
  animation: fadeInTitle 1.2s ease 0.4s forwards;
}

.wood-sign-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  image-rendering: pixelated;
  pointer-events: none;
  user-select: none;
}

.wood-sign-text {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 8px 32px 12px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.wood-sign-label {
  font-family: 'Dancing Script', 'Cormorant Garamond', cursive;
  font-style: normal;
  font-weight: 700;
  font-size: clamp(1rem, 4.5vw, 1.45rem);
  color: #fff8ea;
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.5),
    0 0 12px rgba(255, 210, 120, 0.4);
  letter-spacing: 0.5px;
  display: block;
  line-height: 1.15;
  white-space: nowrap;
  transition: font-size 0.3s ease;
}

.sign-name-highlight {
  font-style: italic;
  color: #ffe066;
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.5),
    0 0 16px rgba(255, 220, 80, 0.7),
    0 0 30px rgba(255, 180, 40, 0.3);
}

.wood-sign-name {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(0.4rem, 1.8vw, 0.58rem);
  color: #ffe9a0;
  text-shadow:
    0 1px 0 rgba(80, 30, 0, 0.8),
    0 0 8px rgba(200, 140, 50, 0.5);
  letter-spacing: 2px;
  text-transform: uppercase;
  display: block;
  word-break: break-word;
  line-height: 1.8;
  max-width: 90%;
}

@keyframes fadeInTitle {
  to {
    opacity: 1;
  }
}

/* ── Modal System ───────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(44, 24, 16, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  width: 90%;
  height: 85%;
  max-width: 1000px;
  background: rgba(253, 250, 247, 0.97);
  border: 1px solid rgba(244, 198, 83, 0.2);
  border-radius: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 40px 100px rgba(44, 24, 16, 0.35);
  transform: scale(0.92);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid rgba(90, 62, 43, 0.2);
  font-size: 20px;
  color: #5A3E2B;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.2s;
}

.modal-close-btn:hover {
  transform: rotate(90deg) scale(1.1);
  border-color: var(--gold);
  color: var(--gold-dim);
}

#room-iframe,
#music-iframe {
  width: 100%;
  height: 100%;
  background: #fdfaf7;
}

/* ─ Mobile ──────────────────────────────────────────────── */
@media (max-width: 480px) {
  .menu-items {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-end;
    gap: 1.4rem 0.8rem;
    max-width: 350px;
    padding: 0.5rem;
    margin-top: 20px;
  }

  .menu-item {
    flex: 0 0 92px;
    /* Adjusted for larger icons */
    width: auto;
  }

  /* Reset grid specific properties just in case */
  .menu-item:nth-child(7),
  .menu-item:nth-child(8) {
    grid-column: auto;
  }

  .menu-icon {
    width: 62px;
    height: 62px;
  }

  .item-label {
    font-size: 0.52rem;
    padding: 5px 10px;
  }

  .wood-sign-block {
    width: 270px;
    top: 5%;
  }

  .wood-sign-label {
    font-size: 1.25rem;
  }

  .wood-sign-name {
    font-size: 0.48rem;
  }

  .menu-item {
    margin-top: 0 !important;
  }

  /* Stepping-stone for 3-3-2 */
  .menu-item:nth-child(2),
  .menu-item:nth-child(5) {
    margin-top: -14px !important;
  }
}

@media (min-width: 768px) {
  .menu-items {
    max-width: 700px;
    gap: 2rem 2.5rem;
    padding: 1.5rem;
  }

  .menu-icon {
    width: 86px;
    height: 86px;
  }

  .item-label {
    font-size: 0.62rem;
    padding: 8px 16px;
  }

  .wood-sign-block {
    width: 280px;
  }

  .wood-sign-label {
    font-size: 1.35rem;
  }

  .wood-sign-name {
    font-size: 0.55rem;
  }
}