/* =========================================================================
   PHULJADI NIGHTS — L'ATTITUDE 13.05
   PREMIUM FESTIVE EDITORIAL DESIGN SYSTEM
   Palette:
   --bg-primary: #100D20 (Midnight Navy)
   --bg-secondary: #251329 (Deep Plum)
   --bg-supporting: #401D32 (Burgundy Depth)
   --accent-primary: #E7BD78 (Champagne Gold)
   --accent-secondary: #C58A45 (Amber Gold)
   --text-main: #F8F1E7 (Warm Ivory)
   --text-secondary: #B6A9A4 (Muted Silk)
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;0,700;1,400&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --bg-primary: #100D20;
  --bg-secondary: #251329;
  --bg-supporting: #401D32;
  --accent-primary: #E7BD78;
  --accent-secondary: #C58A45;
  --text-main: #F8F1E7;
  --text-secondary: #B6A9A4;

  --font-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --ease-cinematic: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);

  --z-canvas-bg: 1;
  --z-lanterns: 2;
  --z-canvas-fg: 5;
  --z-content: 20;
  --z-modal: 50;
  --z-guard: 100;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-sans);
  user-select: none;
}

/* Background Atmosphere */
.app-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: radial-gradient(circle at 50% 35%, var(--bg-secondary) 0%, var(--bg-primary) 70%, #080611 100%);
}

.canvas-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#particle-canvas {
  z-index: var(--z-canvas-bg);
}

#fireworks-canvas {
  z-index: var(--z-canvas-fg);
}

/* Atmospheric subtle vignette */
.vignette-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, transparent 55%, rgba(10, 8, 20, 0.8) 100%);
  z-index: 3;
}

/* Lantern Flanks */
.lantern-container {
  position: absolute;
  top: -10px;
  pointer-events: none;
  z-index: var(--z-lanterns);
  transition: opacity 0.8s var(--ease-smooth);
}

.lantern-left {
  left: 4.5vw;
}

.lantern-right {
  right: 4.5vw;
}

.lantern-subtle-sway {
  transform-origin: top center;
  animation: gentleSway 6.5s ease-in-out infinite alternate;
}

.lantern-right .lantern-subtle-sway {
  animation-delay: -3.2s;
}

@keyframes gentleSway {
  0% { transform: rotate(-1.5deg); }
  100% { transform: rotate(1.5deg); }
}

/* Screen Management */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: var(--z-content);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.65s var(--ease-smooth), transform 0.65s var(--ease-smooth);
  padding: 2.5rem 4rem;
}

.screen.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.screen.exiting {
  opacity: 0;
  transform: translateY(-8px);
}

/* Button & Control Design System */
.btn-gold {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.95rem 2.4rem;
  background: rgba(37, 19, 41, 0.4);
  border: 1px solid var(--accent-primary);
  color: var(--accent-primary);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 2px;
  outline: none;
  transition: all 0.26s var(--ease-smooth);
  box-shadow: 0 4px 20px rgba(16, 13, 32, 0.5), inset 0 0 12px rgba(231, 189, 120, 0.04);
}

.btn-gold:hover:not(:disabled) {
  background: rgba(231, 189, 120, 0.12);
  border-color: #f7d69e;
  color: #fff;
  box-shadow: 0 6px 24px rgba(231, 189, 120, 0.18), inset 0 0 15px rgba(231, 189, 120, 0.1);
  transform: translateY(-1px);
}

.btn-gold:active:not(:disabled) {
  transform: translateY(0);
}

.btn-gold:disabled {
  opacity: 0.35;
  border-color: rgba(182, 169, 164, 0.3);
  color: var(--text-secondary);
  cursor: not-allowed;
  box-shadow: none;
}

.btn-text {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0.5rem 1rem;
  transition: color 0.2s ease;
}

.btn-text:hover {
  color: var(--accent-primary);
}

/* ---------------- SCREEN 1: WELCOME ---------------- */
.welcome-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 820px;
}

.brand-eyebrow {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 2.8rem;
}

.inst-name {
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.club-brand {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.4em;
  color: var(--accent-primary);
  text-transform: uppercase;
}

.gold-divider-line {
  width: 48px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
  margin: 0 auto;
}

.welcome-title {
  font-family: var(--font-serif);
  font-size: 3.8rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.15;
  color: var(--text-main);
  margin-bottom: 1.4rem;
  text-shadow: 0 4px 30px rgba(231, 189, 120, 0.15);
}

.welcome-text {
  font-size: 1.05rem;
  font-weight: 300;
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 580px;
  margin-bottom: 0.8rem;
}

.welcome-subtext {
  font-size: 0.88rem;
  font-style: italic;
  font-family: var(--font-serif);
  color: var(--accent-primary);
  margin-bottom: 3.2rem;
  letter-spacing: 0.06em;
}

/* ---------------- SCREEN 2: PUZZLE ---------------- */
.puzzle-layout {
  display: grid;
  grid-template-columns: 1.05fr 1.25fr;
  width: 100%;
  max-width: 1180px;
  gap: 5rem;
  align-items: center;
}

.puzzle-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.puzzle-brand-tag {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  color: var(--accent-primary);
  text-transform: uppercase;
  margin-bottom: 1.2rem;
}

.puzzle-heading {
  font-family: var(--font-serif);
  font-size: 2.8rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.15;
  color: var(--text-main);
  margin-bottom: 0.8rem;
}

.puzzle-subheading {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 2.6rem;
  line-height: 1.6;
}

.clue-card {
  position: relative;
  background: rgba(37, 19, 41, 0.45);
  border: 1px solid rgba(231, 189, 120, 0.25);
  padding: 1.8rem 2.2rem;
  border-radius: 4px;
  margin-bottom: 1.8rem;
  box-shadow: 0 8px 30px rgba(16, 13, 32, 0.4);
}

.clue-label {
  font-size: 0.68rem;
  letter-spacing: 0.25em;
  color: var(--accent-secondary);
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.clue-text {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 400;
  color: var(--text-main);
  line-height: 1.35;
  min-height: 4.2rem;
  display: flex;
  align-items: center;
  transition: opacity 0.3s ease;
}

.puzzle-instructions {
  font-size: 0.78rem;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.puzzle-instructions::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-primary);
}

/* Puzzle Right Side */
.puzzle-right {
  display: flex;
  flex-direction: column;
}

.puzzle-progress-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.6rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid rgba(231, 189, 120, 0.15);
}

.progress-counter {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--accent-primary);
  text-transform: uppercase;
}

.progress-steps {
  display: flex;
  gap: 0.9rem;
}

.progress-step {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: rgba(182, 169, 164, 0.4);
  transition: all 0.35s ease;
}

.progress-step.current {
  color: var(--text-main);
  text-shadow: 0 0 10px rgba(231, 189, 120, 0.5);
}

.progress-step.completed {
  color: var(--accent-primary);
}

/* Word Selection Grid */
.word-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem;
  margin-bottom: 1.6rem;
}

.word-tile {
  background: rgba(22, 16, 36, 0.65);
  border: 1px solid rgba(231, 189, 120, 0.22);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 1.15rem 1.4rem;
  border-radius: 3px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s var(--ease-smooth);
  outline: none;
  box-shadow: 0 4px 15px rgba(8, 6, 17, 0.4);
}

.word-tile:hover {
  border-color: rgba(231, 189, 120, 0.55);
  background: rgba(37, 19, 41, 0.8);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(16, 13, 32, 0.6);
}

.word-tile.selected {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #120e21;
  font-weight: 700;
  box-shadow: 0 0 20px rgba(231, 189, 120, 0.35);
  transform: translateY(-2px);
}

.word-tile.correct {
  background: linear-gradient(135deg, #e7bd78 0%, #c58a45 100%);
  border-color: #fff;
  color: #100d20;
  font-weight: 700;
  box-shadow: 0 0 25px rgba(231, 189, 120, 0.6);
}

.word-tile.shake-incorrect {
  animation: tileShake 0.36s cubic-bezier(.36,.07,.19,.97) both;
  border-color: #7d2642;
  background: rgba(64, 29, 50, 0.85);
  color: #f7dcd5;
}

@keyframes tileShake {
  10%, 90% { transform: translate3d(-2px, 0, 0); }
  20%, 80% { transform: translate3d(4px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
  40%, 60% { transform: translate3d(6px, 0, 0); }
}

/* Feedback message */
.puzzle-feedback {
  min-height: 1.6rem;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  margin-bottom: 1.2rem;
  text-align: center;
  transition: opacity 0.25s ease;
  font-weight: 500;
}

.puzzle-feedback.error {
  color: #e5989b;
}

.puzzle-feedback.success {
  color: var(--accent-primary);
}

/* Actions Row */
.puzzle-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.puzzle-actions .btn-gold {
  flex: 1.5;
}

.puzzle-utility-buttons {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.4rem;
}

/* Hint panel */
.hint-panel {
  display: none;
  margin-top: 1rem;
  padding: 0.9rem 1.2rem;
  background: rgba(37, 19, 41, 0.5);
  border-left: 2px solid var(--accent-primary);
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-style: italic;
  animation: fadeIn 0.3s ease;
}

.hint-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------- SCREEN 3: CINEMATIC REVEAL ---------------- */
.reveal-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 760px;
}

.reveal-pause-text {
  font-size: 0.86rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent-primary);
  margin-bottom: 2rem;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.reveal-halo {
  position: absolute;
  width: 450px;
  height: 450px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(231, 189, 120, 0.12) 0%, rgba(64, 29, 50, 0.08) 50%, transparent 70%);
  pointer-events: none;
  opacity: 0;
  transform: scale(0.6);
  transition: all 1.8s var(--ease-cinematic);
}

.reveal-halo.active {
  opacity: 1;
  transform: scale(1.1);
}

.reveal-message {
  font-family: var(--font-serif);
  font-size: 3.4rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.2;
  color: var(--text-main);
  margin-bottom: 3rem;
  opacity: 0;
  transform: translateY(12px);
  transition: all 1.2s var(--ease-cinematic);
  text-shadow: 0 4px 30px rgba(231, 189, 120, 0.2);
}

.reveal-btn-wrap {
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.9s var(--ease-smooth);
}

.reveal-ready .reveal-pause-text,
.reveal-ready .reveal-message,
.reveal-ready .reveal-btn-wrap {
  opacity: 1;
  transform: translateY(0);
}

/* ---------------- SCREEN 4: GRAND ANNOUNCEMENT ---------------- */
.announcement-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 900px;
}

.event-poster-card {
  position: relative;
  width: 100%;
  max-width: 780px;
  background: linear-gradient(180deg, rgba(37, 19, 41, 0.65) 0%, rgba(16, 13, 32, 0.85) 100%);
  border: 1px solid rgba(231, 189, 120, 0.35);
  box-shadow: 0 16px 60px rgba(8, 6, 17, 0.75), inset 0 0 40px rgba(231, 189, 120, 0.03);
  padding: 3.4rem 4rem 3rem 4rem;
  border-radius: 4px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Corner ornamental filigree */
.poster-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border-color: var(--accent-primary);
  border-style: solid;
  pointer-events: none;
  opacity: 0.6;
}

.corner-tl { top: 12px; left: 12px; border-width: 1px 0 0 1px; }
.corner-tr { top: 12px; right: 12px; border-width: 1px 1px 0 0; }
.corner-bl { bottom: 12px; left: 12px; border-width: 0 0 1px 1px; }
.corner-br { bottom: 12px; right: 12px; border-width: 0 1px 1px 0; }

.poster-eyebrow {
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.36em;
  color: var(--accent-primary);
  text-transform: uppercase;
  margin-bottom: 1.6rem;
}

.poster-title-wrap {
  position: relative;
  margin-bottom: 0.8rem;
}

.poster-main-title {
  font-family: var(--font-serif);
  font-size: 4.6rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  line-height: 1.05;
  color: var(--text-main);
  text-shadow: 0 4px 40px rgba(231, 189, 120, 0.35);
}

.poster-subtitle {
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent-secondary);
  margin-bottom: 2.2rem;
}

.poster-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  width: 100%;
  max-width: 380px;
  margin-bottom: 2.4rem;
}

.poster-divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(231, 189, 120, 0.4), transparent);
}

.poster-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  width: 100%;
  max-width: 650px;
  margin-bottom: 2.4rem;
  padding: 1.4rem 0;
  border-top: 1px solid rgba(231, 189, 120, 0.12);
  border-bottom: 1px solid rgba(231, 189, 120, 0.12);
}

.poster-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.meta-label {
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 600;
}

.meta-value {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: 0.04em;
}

.poster-closing {
  font-family: var(--font-serif);
  font-size: 1.85rem;
  font-style: italic;
  color: var(--accent-primary);
  letter-spacing: 0.08em;
  margin-bottom: 0.4rem;
}

.poster-actions {
  display: flex;
  gap: 1.8rem;
  align-items: center;
  margin-top: 2.4rem;
}

/* Staggered Poster Reveal Animation */
.poster-animate-item {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.8s var(--ease-cinematic), transform 0.8s var(--ease-cinematic);
}

.poster-revealed .poster-animate-item {
  opacity: 1;
  transform: translateY(0);
}

.poster-revealed .item-delay-1 { transition-delay: 0.2s; }
.poster-revealed .item-delay-2 { transition-delay: 0.45s; }
.poster-revealed .item-delay-3 { transition-delay: 0.7s; }
.poster-revealed .item-delay-4 { transition-delay: 0.95s; }
.poster-revealed .item-delay-5 { transition-delay: 1.2s; }

/* ---------------- SCREEN 5: EXIT STATE ---------------- */
.exit-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 640px;
}

.exit-heading {
  font-family: var(--font-serif);
  font-size: 3.2rem;
  font-weight: 400;
  color: var(--text-main);
  margin-bottom: 1.4rem;
}

.exit-sub {
  font-size: 1rem;
  color: var(--accent-primary);
  margin-bottom: 2.8rem;
  letter-spacing: 0.12em;
}

/* ---------------- MODAL OVERLAY ---------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 8, 20, 0.85);
  backdrop-filter: blur(8px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-box {
  background: var(--bg-secondary);
  border: 1px solid var(--accent-primary);
  padding: 2.6rem 3rem;
  max-width: 460px;
  width: 90%;
  text-align: center;
  border-radius: 4px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  transform: scale(0.95);
  transition: transform 0.3s var(--ease-smooth);
}

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

.modal-title {
  font-family: var(--font-serif);
  font-size: 1.9rem;
  margin-bottom: 0.8rem;
  color: var(--text-main);
}

.modal-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 2rem;
}

.modal-actions {
  display: flex;
  gap: 1.2rem;
  justify-content: center;
}

/* ---------------- MOBILE / NARROW VIEWPORT GUARD ---------------- */
.desktop-guard {
  display: none;
  position: fixed;
  inset: 0;
  background-color: var(--bg-primary);
  background-image: radial-gradient(circle at 50% 40%, var(--bg-secondary) 0%, var(--bg-primary) 85%);
  z-index: var(--z-guard);
  padding: 2.5rem;
  text-align: center;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.guard-card {
  max-width: 460px;
  border: 1px solid rgba(231, 189, 120, 0.3);
  padding: 3rem 2.2rem;
  background: rgba(37, 19, 41, 0.6);
  border-radius: 4px;
}

.guard-brand {
  font-size: 0.74rem;
  letter-spacing: 0.3em;
  color: var(--accent-primary);
  margin-bottom: 1.8rem;
}

.guard-title {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  margin-bottom: 1.2rem;
  color: var(--text-main);
  line-height: 1.25;
}

.guard-text {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

@media (max-width: 900px), (max-height: 480px) {
  .desktop-guard {
    display: flex;
    pointer-events: auto;
  }
}

