/* ==========================================================================
   THE 12:10 DASH - COZY RETRO-ANIME STYLESHEET
   Warm Afternoon in Dhaka Aesthetic + Full Mobile Touchscreen Support
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Comfortaa:wght@500;700&family=Press+Start+2P&family=Outfit:wght@400;600;700&display=swap');

:root {
  --font-pixel: 'Press Start 2P', monospace;
  --font-cozy: 'Comfortaa', cursive, sans-serif;
  --font-ui: 'Outfit', sans-serif;

  /* Cozy Dhaka Afternoon Palette */
  --bg-dark: #12131c;
  --cozy-panel: rgba(26, 23, 34, 0.90);
  --cozy-border: #f4b886;
  --cozy-border-soft: rgba(244, 184, 134, 0.4);
  --accent-gold: #ffbe0b;
  --accent-rose: #ff758f;
  --accent-teal: #3a86ff;
  --accent-amber: #fb5607;
  --text-main: #fffdf9;
  --text-soft: #d3d1e0;
  --text-dim: #9b98ab;

  --game-w: 1280px;
  --game-h: 720px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-cozy);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  touch-action: none;
}

/* Master Game Container (Strict 16:9 Aspect Ratio with Letterbox / Pillarbox) */
#game-viewport {
  position: relative;
  aspect-ratio: 16 / 9;
  width: min(100vw, calc(100vh * (16 / 9)));
  height: min(100vh, calc(100vw * (9 / 16)));
  max-width: var(--game-w);
  max-height: var(--game-h);
  background-color: #0b0c10;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.9), 0 0 25px rgba(244, 184, 134, 0.15);
  margin: auto;
}

.game-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* ==========================================================================
   TINY PLAY GAME STUDIO - CINEMATIC INTRO SPLASH (Gameloft Style)
   ========================================================================== */
.studio-intro-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #040308;
  z-index: 150;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
  transition: opacity 0.85s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.85s ease;
}

.studio-intro-layer.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.studio-intro-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 50%, rgba(26, 20, 38, 0.75) 0%, rgba(4, 3, 8, 1) 85%);
  pointer-events: none;
}

.studio-intro-ambient-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 540px;
  height: 540px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(140, 180, 255, 0.2) 0%, rgba(255, 230, 180, 0.08) 45%, transparent 72%);
  pointer-events: none;
  animation: studioPulseGlow 3.5s infinite alternate ease-in-out;
}

@keyframes studioPulseGlow {
  0% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.6; }
  100% { transform: translate(-50%, -50%) scale(1.15); opacity: 0.95; }
}

.studio-intro-anamorphic-streak {
  position: absolute;
  top: 50%;
  left: -20%;
  width: 140%;
  height: 2px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, transparent 0%, rgba(90, 160, 255, 0.6) 35%, rgba(255, 255, 255, 0.95) 50%, rgba(255, 215, 120, 0.6) 65%, transparent 100%);
  box-shadow: 0 0 16px rgba(100, 180, 255, 0.9), 0 0 35px rgba(255, 255, 255, 0.8);
  pointer-events: none;
  animation: streakExpand 2.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0.85;
}

@keyframes streakExpand {
  0% { transform: translateY(-50%) scaleX(0.2); opacity: 0; }
  35% { opacity: 0.9; }
  100% { transform: translateY(-50%) scaleX(1); opacity: 0.55; }
}

.studio-intro-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 152;
  animation: studioEntrance 3.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes studioEntrance {
  0% {
    opacity: 0;
    transform: scale(0.86);
    filter: blur(8px) brightness(1.6);
  }
  25% {
    opacity: 1;
    filter: blur(0px) brightness(1.15);
  }
  80% {
    opacity: 1;
    transform: scale(1.02);
    filter: brightness(1);
  }
  100% {
    opacity: 1;
    transform: scale(1.05);
    filter: brightness(1);
  }
}

.studio-card-container {
  position: relative;
  padding: 8px;
}

.studio-card {
  position: relative;
  width: 220px;
  height: 220px;
  background: #ffffff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 
    0 0 55px rgba(255, 255, 255, 0.35),
    0 15px 45px rgba(0, 0, 0, 0.9),
    0 0 95px rgba(120, 180, 255, 0.25);
}

.studio-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Gameloft-style Light Sweep Beam across the Studio Logo */
.studio-card-shine {
  position: absolute;
  top: -60%;
  left: -130%;
  width: 200%;
  height: 220%;
  background: linear-gradient(
    115deg,
    transparent 35%,
    rgba(255, 255, 255, 0.4) 45%,
    rgba(255, 255, 255, 0.95) 50%,
    rgba(255, 235, 170, 0.8) 54%,
    transparent 65%
  );
  transform: rotate(25deg);
  pointer-events: none;
  animation: shineSweep 1.6s 0.75s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes shineSweep {
  0% { left: -140%; opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { left: 130%; opacity: 0; }
}

.studio-presents-label {
  font-family: var(--font-cozy), 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 36px;
  letter-spacing: 12px;
  text-indent: 12px;
  text-shadow: 0 0 16px rgba(255, 255, 255, 0.7), 0 2px 8px rgba(0, 0, 0, 0.8);
  animation: presentsFade 2.4s 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}

@keyframes presentsFade {
  0% {
    opacity: 0;
    transform: translateY(8px);
    letter-spacing: 6px;
  }
  100% {
    opacity: 0.95;
    transform: translateY(0);
    letter-spacing: 12px;
  }
}

.studio-skip-btn {
  position: absolute;
  bottom: 24px;
  right: 28px;
  font-family: var(--font-cozy);
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  padding: 6px 14px;
  letter-spacing: 1px;
  cursor: pointer;
  z-index: 155;
  transition: all 0.2s;
  backdrop-filter: blur(6px);
}

.studio-skip-btn:hover, .studio-skip-btn:active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.4);
  transform: scale(1.05);
}

/* Background Scene Layer */
#scene-layer {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: opacity 0.4s ease-in-out;
}

/* Interactive Canvas for Mini-Games */
#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  pointer-events: auto;
}

/* Warm Dhaka Afternoon Light Bloom */
#atmosphere-layer {
  pointer-events: none;
  background: radial-gradient(circle at 75% 20%, rgba(255, 220, 160, 0.18) 0%, rgba(255, 140, 80, 0.08) 50%, rgba(10, 12, 24, 0.3) 100%);
  mix-blend-mode: screen;
}

#vignette-layer {
  pointer-events: none;
  box-shadow: inset 0 0 70px rgba(0, 0, 0, 0.55);
}

/* ==========================================================================
   COZY HEADS-UP DISPLAY (HUD)
   ========================================================================== */
#hud-layer {
  pointer-events: none;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px 20px;
}

/* Clock Badge */
.hud-clock-card {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--cozy-panel);
  border: 2px solid var(--cozy-border);
  box-shadow: 0 4px 18px rgba(0,0,0,0.5), 0 0 12px var(--cozy-border-soft);
  padding: 7px 16px;
  border-radius: 20px;
  backdrop-filter: blur(8px);
}

.hud-clock-icon {
  font-size: 18px;
  animation: clockBounce 2s infinite ease-in-out;
}

@keyframes clockBounce {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.15) rotate(10deg); color: var(--accent-gold); }
}

.hud-clock-text {
  font-family: var(--font-pixel);
  font-size: 13px;
  color: var(--accent-gold);
}

.hud-clock-sub {
  font-family: var(--font-cozy);
  font-size: 11px;
  color: var(--text-soft);
}

/* Doha Mood Badge */
.hud-mood-card {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  background: var(--cozy-panel);
  border: 2px solid var(--cozy-border);
  box-shadow: 0 4px 18px rgba(0,0,0,0.5), 0 0 12px var(--cozy-border-soft);
  padding: 7px 16px;
  border-radius: 20px;
  backdrop-filter: blur(8px);
}

.hud-mood-title {
  font-family: var(--font-cozy);
  font-weight: 700;
  font-size: 11px;
  color: #ffb5c5;
}

.hud-mood-hearts {
  font-size: 18px;
  color: var(--accent-rose);
  letter-spacing: 3px;
  text-shadow: 0 0 10px rgba(255, 117, 143, 0.7);
  animation: heartPulse 1.8s infinite ease-in-out;
}

@keyframes heartPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

/* Center Objective Pill */
.hud-objective-pill {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(22, 20, 30, 0.88);
  border: 1.5px solid var(--cozy-border);
  padding: 6px 20px;
  border-radius: 25px;
  font-family: var(--font-cozy);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.hud-actions {
  display: flex;
  gap: 8px;
  pointer-events: auto;
  margin-top: 6px;
}

.hud-btn {
  background: var(--cozy-panel);
  border: 1.5px solid var(--cozy-border);
  color: var(--text-main);
  font-family: var(--font-cozy);
  font-weight: 700;
  font-size: 11px;
  padding: 6px 12px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(6px);
}

.hud-btn:hover, .hud-btn:active {
  background: var(--cozy-border);
  color: #1a1625;
  transform: translateY(-1px);
}

/* ==========================================================================
   ACTORS LAYER (Exploratory / Dialogue Sprite Placement)
   ========================================================================== */
#actors-layer {
  pointer-events: none;
}

.actor-sprite {
  position: absolute;
  bottom: 50px;
  width: 140px;
  height: 210px;
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  transition: transform 0.3s ease;
  filter: drop-shadow(0 15px 12px rgba(0, 0, 0, 0.5));
}

#actor-boy {
  left: 20%;
}

#actor-doha {
  right: 25%;
}

/* ==========================================================================
   COZY VISUAL NOVEL DIALOGUE SYSTEM (Dedicated Glassmorphic Avatar Frame)
   ========================================================================== */
#dialogue-layer {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 65;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 20px;
  pointer-events: none;
}

/* Dialogue Box (Cozy Dark Glassmorphism with Warm Amber Rim) */
.dialogue-box {
  width: calc(100% - 48px);
  max-width: 1040px;
  min-height: 155px;
  background: linear-gradient(135deg, rgba(24, 20, 34, 0.94), rgba(15, 13, 22, 0.96));
  border: 2px solid rgba(244, 184, 134, 0.45);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.75), 0 0 20px rgba(244, 184, 134, 0.15);
  border-radius: 18px;
  padding: 16px 24px;
  position: relative;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor: pointer;
  pointer-events: auto;
  display: flex;
  align-items: stretch;
  gap: 22px;
}

/* Dedicated Character Portrait Frame (Bottom-Left Anchor) */
.dialogue-avatar-container {
  width: 130px;
  min-width: 130px;
  height: 145px;
  background: radial-gradient(circle at 50% 25%, rgba(255, 235, 210, 0.16), rgba(12, 10, 18, 0.75));
  border-radius: 14px;
  border: 1.5px solid rgba(244, 184, 134, 0.4);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.65), 0 4px 12px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.dialogue-avatar {
  width: 100%;
  height: 100%;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: bottom center;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.55));
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s ease;
}

.dialogue-avatar.avatar-pop {
  animation: avatarPopAnim 0.28s ease-out;
}

@keyframes avatarPopAnim {
  0% { transform: scale(0.92) translateY(8px); opacity: 0.7; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* Dialogue Text Body */
.dialogue-content-container {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  padding-top: 8px;
}

/* Speaker Name Badges */
.speaker-badge {
  position: absolute;
  top: -28px;
  left: 0;
  font-family: var(--font-cozy);
  font-weight: 700;
  font-size: 13px;
  padding: 5px 22px;
  border-radius: 14px;
  letter-spacing: 0.8px;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  transition: all 0.25s ease;
}

.speaker-badge.speaker-rabin,
.speaker-badge.speaker-boy {
  background: linear-gradient(135deg, #f4b886, #f39c6b);
  color: #21191d;
  box-shadow: 0 4px 14px rgba(244, 184, 134, 0.4);
}

.speaker-badge.speaker-doha {
  background: linear-gradient(135deg, #ff758f, #e05370);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(255, 117, 143, 0.45);
}

.speaker-badge.speaker-system {
  background: linear-gradient(135deg, #70a1ff, #3742fa);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(112, 161, 255, 0.4);
}

.dialogue-text {
  font-size: 17px;
  line-height: 1.55;
  color: var(--text-main);
  min-height: 52px;
  font-family: var(--font-cozy);
  font-weight: 600;
  margin-top: 4px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  word-break: break-word;
}

.dialogue-hint {
  align-self: flex-end;
  margin-top: auto;
  font-family: var(--font-cozy);
  font-weight: 700;
  font-size: 10px;
  color: var(--accent-gold);
  letter-spacing: 0.5px;
  animation: pulseBlink 1s infinite alternate;
  padding-top: 4px;
}

/* Banglish Choice Buttons */
.dialogue-choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.choice-btn {
  background: rgba(45, 38, 55, 0.95);
  border: 1.5px solid var(--cozy-border);
  color: var(--text-main);
  padding: 11px 20px;
  border-radius: 14px;
  font-family: var(--font-cozy);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.choice-btn:hover, .choice-btn:active {
  background: var(--cozy-border);
  color: #1a1523;
  transform: translateX(6px);
  box-shadow: 0 0 14px var(--cozy-border);
}

/* ==========================================================================
   MINI-GAME OVERLAYS & MOBILE INTERACTION
   ========================================================================== */

/* QTE Prompts (Doberman Chase) */
#qte-container {
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  z-index: 70;
  pointer-events: auto;
}

.qte-key-box {
  width: 110px;
  height: 110px;
  background: rgba(30, 24, 38, 0.95);
  border: 4px solid var(--accent-gold);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 0 35px rgba(255, 190, 11, 0.7);
  animation: qteBounce 0.45s infinite alternate ease-in-out;
  touch-action: manipulation;
}

.qte-key-label {
  font-family: var(--font-pixel);
  font-size: 32px;
  color: var(--accent-gold);
}

.qte-tap-hint {
  font-family: var(--font-cozy);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  margin-top: 2px;
}

@keyframes qteBounce {
  0% { transform: scale(1); }
  100% { transform: scale(1.18); box-shadow: 0 0 50px #ffbe0b; }
}

.qte-timer-bar {
  width: 220px;
  height: 12px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.qte-timer-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff758f, #ffbe0b);
  width: 100%;
  transition: width 0.1s linear;
}

/* ==========================================================================
   COZY TOUCH CONTROLS FOR MOBILE PHONES
   ========================================================================== */
#mobile-controls {
  position: absolute;
  bottom: 20px;
  left: 0;
  width: 100%;
  padding: 0 max(24px, env(safe-area-inset-right)) 0 max(24px, env(safe-area-inset-left));
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
  z-index: 85;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

#mobile-controls.hidden {
  display: none !important;
  pointer-events: none !important;
  opacity: 0;
  transform: translateY(20px);
}

.touch-btn-group {
  display: flex;
  gap: 16px;
  pointer-events: auto;
}

.touch-btn {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: rgba(26, 22, 36, 0.88);
  border: 2.5px solid var(--cozy-border);
  color: var(--text-main);
  font-family: var(--font-cozy);
  font-weight: 700;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65), 0 0 15px rgba(244, 184, 134, 0.25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  touch-action: none;
  transition: transform 0.08s ease, background 0.08s ease;
}

.touch-btn-icon {
  font-size: 24px;
  line-height: 1;
}

.touch-btn-label {
  font-size: 10px;
  letter-spacing: 0.6px;
  margin-top: 2px;
}

.touch-btn-slide {
  border-color: #ff758f;
  color: #ffb3c1;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65), 0 0 15px rgba(255, 117, 143, 0.3);
}

.touch-btn-jump {
  border-color: #ffbe0b;
  color: #ffea79;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65), 0 0 15px rgba(255, 190, 11, 0.35);
}

.touch-btn:active {
  transform: scale(0.88);
}

.touch-btn-slide:active {
  background: rgba(255, 117, 143, 0.45);
  color: #fff;
}

.touch-btn-jump:active {
  background: rgba(255, 190, 11, 0.45);
  color: #fff;
}

/* Modals */
.game-modal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 14, 22, 0.92);
  backdrop-filter: blur(10px);
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 30px;
}

.modal-card {
  background: var(--cozy-panel);
  border: 2.5px solid var(--cozy-border);
  border-radius: 24px;
  padding: 35px 40px;
  width: 90%;
  max-width: 580px;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.8), 0 0 20px var(--cozy-border-soft);
  text-align: center;
}

.modal-title {
  font-family: var(--font-pixel);
  font-size: 20px;
  color: var(--accent-gold);
  margin-bottom: 20px;
}

.modal-menu-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.menu-btn {
  background: rgba(45, 38, 55, 0.9);
  border: 2px solid var(--cozy-border);
  color: var(--text-main);
  font-family: var(--font-cozy);
  font-weight: 700;
  font-size: 15px;
  padding: 13px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.menu-btn:hover, .menu-btn:active {
  background: var(--cozy-border);
  color: #1a1523;
  transform: translateY(-2px);
  box-shadow: 0 0 16px var(--cozy-border);
}

/* Memory Gallery Polaroid Card */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  width: 100%;
  max-height: 420px;
  overflow-y: auto;
  padding: 12px;
}

.photo-card {
  background: #fffdfa;
  padding: 12px 12px 28px 12px;
  border-radius: 6px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
  transform: rotate(-2deg);
  transition: transform 0.3s;
}

.photo-card:hover {
  transform: rotate(0deg) scale(1.04);
}

.photo-card img {
  width: 100%;
  border-radius: 3px;
  display: block;
}

.photo-card-caption {
  font-family: var(--font-cozy);
  color: #2b2533;
  font-size: 13px;
  margin-top: 10px;
  font-weight: 700;
  text-align: center;
}

/* Screen Transitions */
.fade-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  z-index: 95;
}

.fade-overlay.blackout {
  opacity: 1;
  pointer-events: auto;
}

/* ==========================================================================
   SMARTPHONE CAMERA INTERFACE (Viewfinder, Grid, Focus Box & Shutter)
   ========================================================================== */
#camera-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 70;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: auto;
  user-select: none;
}

/* Camera Top Status Bar */
.cam-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0) 100%);
  z-index: 75;
}

.cam-badge {
  font-family: var(--font-cozy);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  padding: 4px 12px;
  border-radius: 12px;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  letter-spacing: 0.5px;
}

.cam-clock {
  font-family: var(--font-cozy);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-gold);
  letter-spacing: 1px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

/* Viewfinder Area & Rule-of-Thirds Grid */
.cam-viewfinder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.cam-viewfinder.is-dragging {
  cursor: grabbing;
}

.cam-grid-v {
  position: absolute;
  top: 0;
  width: 1px;
  height: 100%;
  background: rgba(255, 255, 255, 0.15);
  pointer-events: none;
}

.cam-grid-v1 { left: 33.333%; }
.cam-grid-v2 { left: 66.666%; }

.cam-grid-h {
  position: absolute;
  left: 0;
  height: 1px;
  width: 100%;
  background: rgba(255, 255, 255, 0.15);
  pointer-events: none;
}

.cam-grid-h1 { top: 33.333%; }
.cam-grid-h2 { top: 66.666%; }

/* Directional Pan Guidance Pill */
.cam-arrow-guide {
  position: absolute;
  bottom: 85px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(14, 12, 22, 0.85);
  border: 1.5px solid var(--accent-gold);
  color: var(--accent-gold);
  font-family: var(--font-cozy);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 16px;
  border-radius: 20px;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: pulseGuide 1.2s infinite alternate ease-in-out;
  z-index: 76;
}

@keyframes pulseGuide {
  0% { transform: translateX(-50%) translateY(0); }
  100% { transform: translateX(-50%) translateY(-4px); }
}

.cam-arrow-icon {
  font-size: 16px;
}

/* Movable Focus Reticle Box */
.cam-focus-box {
  position: absolute;
  width: 240px;
  height: 200px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  top: 50%;
  left: 50%;
}

.cam-bracket {
  position: absolute;
  width: 28px;
  height: 28px;
  border-color: #ffbe0b;
  border-style: solid;
  transition: all 0.2s ease;
}

.bracket-tl { top: 0; left: 0; border-width: 3px 0 0 3px; }
.bracket-tr { top: 0; right: 0; border-width: 3px 3px 0 0; }
.bracket-bl { bottom: 0; left: 0; border-width: 0 0 3px 3px; }
.bracket-br { bottom: 0; right: 0; border-width: 0 3px 3px 0; }

.cam-focus-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border: 2px dashed rgba(255, 190, 11, 0.6);
  border-radius: 50%;
  transition: all 0.2s ease;
}

.cam-focus-label {
  position: absolute;
  bottom: -28px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-cozy);
  font-weight: 700;
  font-size: 11px;
  color: #ffbe0b;
  background: rgba(18, 15, 26, 0.85);
  padding: 3px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 190, 11, 0.4);
  white-space: nowrap;
  letter-spacing: 0.5px;
  backdrop-filter: blur(6px);
}

/* Locked / Perfectly Aligned State */
.cam-focus-box.locked .cam-bracket {
  border-color: #00f5d4;
  box-shadow: 0 0 14px rgba(0, 245, 212, 0.7);
}

.cam-focus-box.locked .cam-focus-ring {
  border: 2.5px solid #00f5d4;
  box-shadow: 0 0 16px rgba(0, 245, 212, 0.8);
  animation: pulseFocusRing 0.8s infinite alternate ease-in-out;
}

.cam-focus-box.locked .cam-focus-label {
  color: #00f5d4;
  border-color: #00f5d4;
  background: rgba(10, 25, 22, 0.9);
  box-shadow: 0 0 12px rgba(0, 245, 212, 0.5);
}

@keyframes pulseFocusRing {
  0% { transform: translate(-50%, -50%) scale(0.95); opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
}

/* Hint Banner */
.cam-hint-bar {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 18, 28, 0.85);
  border: 1.5px solid var(--cozy-border);
  color: var(--text-main);
  padding: 6px 20px;
  border-radius: 20px;
  font-family: var(--font-cozy);
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  z-index: 75;
  pointer-events: none;
  animation: pulseBlink 1.5s infinite alternate;
}

/* Camera Bottom Bar & Real Shutter Button */
.cam-bottom-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 20px 20px 20px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0) 100%);
  z-index: 75;
}

.cam-zoom-row {
  display: flex;
  gap: 12px;
}

.cam-zoom-btn {
  font-family: var(--font-cozy);
  font-size: 11px;
  font-weight: 700;
  color: #bbb;
  background: rgba(255, 255, 255, 0.12);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.2s;
  outline: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.cam-zoom-btn.active {
  color: var(--accent-gold);
  border-color: var(--accent-gold);
  background: rgba(255, 190, 11, 0.25);
  box-shadow: 0 0 10px rgba(255, 190, 11, 0.4);
}

.cam-modes-row {
  display: flex;
  gap: 22px;
  font-family: var(--font-cozy);
  font-size: 11px;
  font-weight: 700;
  color: #888;
  letter-spacing: 1px;
}

.cam-modes-row .active {
  color: var(--accent-gold);
  text-shadow: 0 0 8px rgba(255, 190, 11, 0.6);
}

/* Dedicated Shutter Button */
.cam-shutter-wrap {
  margin-top: 4px;
}

.cam-shutter-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 4px solid #ffffff;
  padding: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 25px rgba(255, 255, 255, 0.4);
  transition: all 0.15s ease-out;
  touch-action: manipulation;
}

.cam-shutter-btn:active {
  transform: scale(0.90);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.cam-shutter-btn.ready {
  border-color: #00f5d4;
  box-shadow: 0 0 35px rgba(0, 245, 212, 0.8), 0 0 15px #ffbe0b;
  animation: pulseShutter 1.2s infinite alternate ease-in-out;
}

@keyframes pulseShutter {
  0% { transform: scale(1); box-shadow: 0 0 25px rgba(0, 245, 212, 0.7); }
  100% { transform: scale(1.08); box-shadow: 0 0 40px rgba(0, 245, 212, 1); }
}

.cam-shutter-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.cam-shutter-btn.ready .cam-shutter-inner {
  background: linear-gradient(135deg, #00f5d4, #ffbe0b);
}

.cam-shutter-icon {
  font-size: 22px;
}

/* Flash Screen Overlay */
.cam-flash-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #ffffff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease-out;
  z-index: 90;
}

.cam-flash-overlay.flash {
  opacity: 1;
}

/* Captured Photo Polaroid Preview Modal */
.cam-preview-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(12, 10, 18, 0.88);
  backdrop-filter: blur(12px);
  z-index: 85;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.polaroid-frame {
  background: #fffdf9;
  padding: 14px 14px 28px 14px;
  border-radius: 8px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.85);
  max-width: 500px;
  width: 90%;
  text-align: center;
  transform: rotate(-1.5deg);
}

.polaroid-frame img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 4px;
  display: block;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.15);
}

.polaroid-caption {
  font-family: var(--font-cozy);
  font-size: 15px;
  font-weight: 700;
  color: #211c27;
  margin-top: 14px;
}

.polaroid-rating {
  font-family: var(--font-cozy);
  font-size: 13px;
  font-weight: 700;
  color: #e76f51;
  margin-top: 6px;
}

.polaroid-sub {
  font-size: 11px;
  font-weight: 600;
  color: #6c757d;
  margin-top: 4px;
}

.cam-continue-btn {
  margin-top: 20px;
  background: linear-gradient(135deg, #f4b886, #f39c6b);
  border: 2px solid var(--accent-gold);
  color: #1a1625;
  font-family: var(--font-cozy);
  font-weight: 700;
  font-size: 14px;
  padding: 12px 30px;
  border-radius: 25px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(244, 184, 134, 0.4);
  transition: all 0.2s;
}

.cam-continue-btn:hover, .cam-continue-btn:active {
  transform: translateY(-2px) scale(1.04);
  background: var(--accent-gold);
}

/* ==========================================================================
   40 MINUTES EMOTIONAL EPILOGUE CARD
   ========================================================================== */
.ending-card {
  max-width: 660px;
  width: 92%;
  max-height: 90vh;
  overflow-y: auto;
  background: radial-gradient(circle at 50% 15%, rgba(42, 30, 52, 0.96), rgba(15, 12, 22, 0.98));
  border: 1.5px solid rgba(244, 184, 134, 0.4);
  border-radius: 20px;
  padding: 30px 24px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85), inset 0 0 35px rgba(244, 184, 134, 0.08);
  backdrop-filter: blur(18px);
  animation: fadeInEpilogue 1.2s ease-out;
}

@keyframes fadeInEpilogue {
  0% { opacity: 0; transform: translateY(18px) scale(0.97); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.ending-badge {
  display: inline-block;
  font-family: var(--font-cozy);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--accent-gold);
  background: rgba(255, 190, 11, 0.12);
  border: 1px solid rgba(255, 190, 11, 0.35);
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.ending-title {
  font-family: var(--font-pixel);
  font-size: 32px;
  color: var(--accent-gold);
  letter-spacing: 3px;
  margin-bottom: 18px;
  text-shadow: 0 0 20px rgba(244, 184, 134, 0.5);
}

.ending-note-box {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 22px 20px;
  margin-bottom: 22px;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

.ending-bangla-intro {
  font-family: 'Hind Siliguri', 'Kalpurush', var(--font-cozy), sans-serif;
  font-size: 14px;
  line-height: 1.8;
  color: #eedcc8;
  margin-bottom: 14px;
  font-weight: 500;
}

.ending-divider {
  color: var(--accent-gold);
  font-size: 12px;
  letter-spacing: 6px;
  margin: 14px 0;
  opacity: 0.85;
}

.ending-user-quote {
  font-family: 'Hind Siliguri', var(--font-cozy), Georgia, serif;
  font-size: 15px;
  font-style: italic;
  line-height: 1.85;
  color: #ffffff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
  margin-bottom: 16px;
  white-space: pre-line;
}

.ending-signature {
  font-family: var(--font-cozy);
  font-size: 12px;
  color: var(--accent-gold);
  font-weight: 700;
  letter-spacing: 1px;
}

.ending-btn-group {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.ending-gallery-btn {
  background: linear-gradient(135deg, #f4b886, #f39c6b);
  color: #15101e;
  border: 2px solid var(--accent-gold);
  padding: 12px 24px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.2s;
}

.ending-gallery-btn:hover {
  transform: translateY(-2px);
  background: var(--accent-gold);
}

.ending-menu-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 12px 24px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.2s;
}

.ending-menu-btn:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   MOBILE & COMPACT SCREEN OPTIMIZATIONS
   ========================================================================== */
@media (max-width: 820px), (max-height: 520px) {
  #dialogue-layer {
    padding-bottom: 10px;
  }

  .dialogue-box {
    width: calc(100% - 24px);
    padding: 10px 14px;
    gap: 12px;
    min-height: 110px;
    border-radius: 14px;
  }

  .dialogue-avatar-container {
    width: 80px;
    min-width: 80px;
    height: 98px;
    border-radius: 10px;
  }

  .speaker-badge {
    top: -22px;
    font-size: 10px;
    padding: 3px 12px;
    border-radius: 10px;
  }

  .dialogue-text {
    font-size: 13px;
    line-height: 1.45;
    min-height: 40px;
  }

  .dialogue-hint {
    font-size: 8px;
  }

  .choice-btn {
    padding: 8px 14px;
    font-size: 12px;
    border-radius: 10px;
  }

  .hud-clock-card, .hud-mood-card {
    padding: 4px 10px;
  }

  .hud-clock-icon {
    font-size: 14px;
  }

  .hud-clock-text {
    font-size: 10px;
  }

  .hud-clock-sub {
    font-size: 9px;
  }

  .hud-mood-title {
    font-size: 9px;
  }

  .hud-mood-hearts {
    font-size: 13px;
    letter-spacing: 1px;
  }

  .hud-objective-pill {
    font-size: 10px;
    padding: 4px 12px;
    top: 8px;
  }

  .hud-btn {
    padding: 4px 8px;
    font-size: 10px;
  }

  .touch-btn {
    width: 66px;
    height: 66px;
  }
  
  .touch-btn-icon {
    font-size: 20px;
  }
  
  .touch-btn-label {
    font-size: 9px;
  }
}

/* ==========================================================================
   MOBILE FULLSCREEN LANDSCAPE EXPANSION
   ========================================================================== */
@media (max-width: 950px) and (orientation: landscape), (max-height: 520px) {
  html, body {
    padding: 0;
    margin: 0;
    background: #000;
  }

  #game-viewport {
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    aspect-ratio: auto;
  }

  #hud-layer {
    padding: 6px max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left));
  }
}

/* ==========================================================================
   PORTRAIT ORIENTATION PROMPT (Clean & Cozy)
   ========================================================================== */
#rotate-prompt {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(14, 12, 22, 0.96);
  z-index: 99999;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px;
  text-align: center;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

@media (orientation: portrait) and (max-width: 900px) {
  #rotate-prompt {
    display: flex;
  }
}

.rotate-card {
  background: var(--cozy-panel);
  border: 2px solid var(--cozy-border);
  border-radius: 24px;
  padding: 30px 24px;
  max-width: 340px;
  width: 92%;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.85), 0 0 25px rgba(244, 184, 134, 0.25);
}

.rotate-phone-anim {
  font-size: 48px;
  margin-bottom: 16px;
  display: inline-block;
  animation: phoneRotateAnim 2.2s infinite ease-in-out;
}

@keyframes phoneRotateAnim {
  0%, 20% { transform: rotate(0deg) scale(1); }
  45%, 75% { transform: rotate(-90deg) scale(1.1); }
  90%, 100% { transform: rotate(0deg) scale(1); }
}

.rotate-title {
  font-family: var(--font-pixel);
  font-size: 13px;
  color: var(--accent-gold);
  line-height: 1.6;
  margin-bottom: 12px;
}

.rotate-text {
  font-family: var(--font-cozy);
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.6;
  font-weight: 600;
}
