/* ============================================================
   Anna's Little Universe — Visual Stylesheet (V2)
   Mobile-First Magical Interactive Fairytale Theme
   ============================================================ */

:root {
  --bg-deep: #060814;
  --bg-midnight: #0c1026;
  --bg-surface: rgba(18, 24, 54, 0.75);
  --bg-card: rgba(26, 34, 76, 0.85);
  --bg-card-hover: rgba(38, 48, 102, 0.95);
  
  --gold-primary: #ffd166;
  --gold-glow: rgba(255, 209, 102, 0.45);
  --gold-spark: #ffeaa7;
  
  --accent-purple: #a29bfe;
  --accent-cyan: #74b9ff;
  --accent-rose: #ff7675;
  --accent-emerald: #55efc4;
  
  --text-primary: #f8f9fa;
  --text-secondary: #b2bec3;
  --text-muted: #636e72;
  --text-gold: #ffeaa7;

  --border-glass: rgba(255, 255, 255, 0.12);
  --border-gold: rgba(255, 209, 102, 0.4);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-full: 9999px;

  --shadow-glow: 0 0 24px var(--gold-glow);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.45);
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-deep);
  background-image: 
    radial-gradient(ellipse at 50% 0%, #171b3e 0%, transparent 70%),
    radial-gradient(ellipse at 80% 100%, #151030 0%, transparent 60%);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ─── App Container (Mobile Frame) ────────────────────────── */
#app {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 100%;
  margin: 0 auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 1;
  background: rgba(6, 8, 20, 0.45);
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.8);
}

@media (min-width: 481px) {
  #app {
    border-left: 1px solid var(--border-glass);
    border-right: 1px solid var(--border-glass);
  }
}

/* ─── Screen System ───────────────────────────────────────── */
.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(100% - 64px);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.985);
  transition: opacity 0.35s ease, transform 0.35s ease;
  z-index: 2;
}

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

.screen-scroll {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.25rem 1rem 2rem;
  -webkit-overflow-scrolling: touch;
}

.screen-scroll::-webkit-scrollbar {
  width: 4px;
}
.screen-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.screen-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

/* ─── Buttons & Utility ───────────────────────────────────── */
button {
  font-family: inherit;
  border: none;
  outline: none;
  cursor: pointer;
  background: none;
}

.btn-magic {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.7rem;
  font-size: 1.02rem;
  font-weight: 700;
  color: #1e1302;
  background: linear-gradient(135deg, #ffeaa7 0%, #ffd166 50%, #f39c12 100%);
  border-radius: var(--radius-full);
  box-shadow: 0 6px 20px rgba(255, 209, 102, 0.4), 0 0 12px rgba(255, 234, 167, 0.3);
  transition: var(--transition);
  overflow: hidden;
}

.btn-magic::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(60deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transform: rotate(30deg);
  animation: shineSweep 4s infinite;
}

@keyframes shineSweep {
  0% { transform: translateX(-100%) rotate(30deg); }
  30%, 100% { transform: translateX(100%) rotate(30deg); }
}

.btn-magic:active {
  transform: scale(0.96);
  box-shadow: 0 2px 10px rgba(255, 209, 102, 0.3);
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-purple);
  background: rgba(162, 155, 254, 0.12);
  border: 1px solid rgba(162, 155, 254, 0.25);
  border-radius: var(--radius-full);
  transition: var(--transition);
}

.back-btn:active {
  background: rgba(162, 155, 254, 0.25);
  transform: translateX(-3px);
}

.screen-title {
  font-family: var(--font-serif);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text-gold);
  letter-spacing: 0.5px;
  text-shadow: 0 0 15px rgba(255, 234, 167, 0.3);
}

/* ─── 0. SECRET ENTRANCE GATE (SSIM) ──────────────────────── */
#gate-screen {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, #181d45 0%, #060814 90%);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

#gate-screen.hidden {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

#gate-screen.gate-unlocked-anim {
  opacity: 0;
  transform: scale(1.08);
  pointer-events: none;
}

body.gate-locked #bottom-nav {
  display: none !important;
}

.gate-scroll {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.gate-content {
  width: 100%;
  max-width: 360px;
  text-align: center;
  background: rgba(20, 26, 60, 0.85);
  border: 2px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 2.2rem 1.6rem;
  box-shadow: 0 0 45px rgba(255, 209, 102, 0.3);
  backdrop-filter: blur(16px);
  animation: fadeInDown 0.8s ease;
}

.gate-ring-icon {
  font-size: 3.2rem;
  margin-bottom: 0.8rem;
  animation: pulseRotate 6s infinite ease-in-out;
  filter: drop-shadow(0 0 14px var(--gold-glow));
}

.gate-title {
  font-family: var(--font-serif);
  font-size: 1.85rem;
  color: var(--gold-spark);
  margin-bottom: 1rem;
}

.gate-story {
  font-size: 1rem;
  color: #dfe6e9;
  line-height: 1.6;
  margin-bottom: 1.6rem;
}

.gate-inputs-container {
  display: flex;
  justify-content: center;
  gap: 0.7rem;
  margin-bottom: 1.2rem;
}

.gate-cell {
  width: 52px;
  height: 60px;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--gold-spark);
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  outline: none;
  transition: var(--transition);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
}

.gate-cell:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 15px var(--gold-glow);
  transform: translateY(-2px);
}

.gate-cell.correct {
  border-color: var(--accent-emerald);
  background: rgba(85, 239, 196, 0.2);
  color: var(--accent-emerald);
  box-shadow: 0 0 20px rgba(85, 239, 196, 0.5);
}

.gate-cell.shake {
  animation: shakeX 0.45s ease;
  border-color: var(--accent-rose);
}

@keyframes shakeX {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-7px); }
  40%, 80% { transform: translateX(7px); }
}

.gate-error {
  min-height: 22px;
  font-size: 0.88rem;
  color: var(--accent-rose);
  margin-bottom: 0.8rem;
}

.gate-success {
  font-size: 0.95rem;
  color: var(--accent-emerald);
  font-weight: 700;
  margin-bottom: 1rem;
}

.gate-submit-btn {
  width: 100%;
  margin-bottom: 1rem;
}

.gate-hint-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ─── 1. Splash Screen ────────────────────────────────────── */
#splash-screen {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  background: radial-gradient(circle at center, #1b2046 0%, #060814 85%);
}

.splash-content {
  text-align: center;
  padding: 2.5rem 1.5rem;
  max-width: 360px;
  animation: fadeInDown 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.splash-ornament {
  font-size: 2.2rem;
  color: var(--gold-primary);
  margin-bottom: 0.8rem;
  animation: pulseRotate 6s infinite ease-in-out;
  filter: drop-shadow(0 0 10px var(--gold-glow));
}

@keyframes pulseRotate {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.8; }
  50% { transform: scale(1.15) rotate(180deg); opacity: 1; }
}

.splash-title {
  font-family: var(--font-serif);
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1.2rem;
  color: #fff;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
}

.splash-title .title-line {
  display: block;
}

.splash-title .title-accent {
  color: var(--gold-primary);
  font-style: italic;
  font-weight: 400;
  text-shadow: 0 0 25px rgba(255, 209, 102, 0.5);
}

.splash-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 2.5rem;
  font-weight: 400;
}

.splash-date {
  margin-top: 1.8rem;
  font-size: 0.85rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ─── 2. Calendar Screen ──────────────────────────────────── */
.calendar-header {
  margin-bottom: 1.2rem;
}

.header-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.3rem;
}

.calendar-date {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.7rem;
  margin-bottom: 1.2rem;
}

.door-card {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.3, 1.5, 0.5, 1), box-shadow 0.25s, border-color 0.25s;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.door-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 40%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent);
  pointer-events: none;
}

.door-number {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  z-index: 1;
}

.door-status-icon {
  font-size: 0.85rem;
  margin-top: 0.2rem;
  z-index: 1;
}

.door-card.locked {
  opacity: 0.55;
  background: rgba(15, 18, 38, 0.6);
  border-color: rgba(255, 255, 255, 0.05);
  cursor: not-allowed;
}
.door-card.locked .door-number {
  color: #718096;
}

.door-card.available {
  border-color: var(--border-gold);
  background: linear-gradient(135deg, rgba(35, 45, 95, 0.95), rgba(45, 30, 80, 0.9));
  box-shadow: 0 0 15px rgba(255, 209, 102, 0.25);
  animation: gentlePulse 3s infinite ease-in-out;
}

.door-card.available:active {
  transform: scale(0.93);
}

@keyframes gentlePulse {
  0%, 100% { border-color: rgba(255, 209, 102, 0.4); box-shadow: 0 0 10px rgba(255, 209, 102, 0.2); }
  50% { border-color: rgba(255, 209, 102, 0.85); box-shadow: 0 0 20px rgba(255, 209, 102, 0.45); }
}

.door-card.opened {
  background: linear-gradient(135deg, rgba(20, 30, 60, 0.8), rgba(28, 48, 70, 0.8));
  border-color: rgba(85, 239, 196, 0.35);
}
.door-card.opened .door-number {
  color: var(--accent-emerald);
}

.door-card[data-day="31"] {
  grid-column: span 2;
  aspect-ratio: auto;
  min-height: 75px;
  background: linear-gradient(135deg, #301e52 0%, #1a2754 100%);
  border: 1px solid var(--gold-primary);
  box-shadow: 0 0 20px rgba(255, 209, 102, 0.35);
}
.door-card[data-day="31"] .door-number {
  font-size: 1.6rem;
  color: var(--gold-spark);
}

.calendar-progress {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding: 0.5rem;
}

/* ─── 3. Day Detail Screen ────────────────────────────────── */
.day-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.25rem;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(12px);
  animation: fadeInUp 0.4s ease;
}

.day-badge {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gold-spark);
  background: rgba(255, 209, 102, 0.15);
  border-radius: var(--radius-full);
  margin-bottom: 0.8rem;
}

.day-title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
  margin-bottom: 1.1rem;
}

.day-story {
  font-size: 1.05rem;
  line-height: 1.7;
  color: #dfe6e9;
  margin-bottom: 1.5rem;
}

.reward-box {
  position: relative;
  background: linear-gradient(135deg, rgba(40, 30, 80, 0.9), rgba(20, 35, 75, 0.95));
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 1.3rem 1.1rem;
  text-align: center;
  box-shadow: 0 0 25px rgba(255, 209, 102, 0.25);
  overflow: hidden;
  margin-bottom: 1.2rem;
}

.reward-glow {
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  height: 100px;
  background: radial-gradient(circle, rgba(255, 209, 102, 0.45) 0%, transparent 70%);
  filter: blur(20px);
  pointer-events: none;
}

.reward-badge-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--gold-primary);
  letter-spacing: 1px;
  margin-bottom: 0.4rem;
}

.reward-icon {
  font-size: 3rem;
  margin-bottom: 0.4rem;
  animation: bounceIn 0.6s cubic-bezier(0.3, 1.6, 0.5, 1);
  filter: drop-shadow(0 0 10px rgba(255, 234, 167, 0.5));
}

.reward-name {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: var(--gold-spark);
  margin-bottom: 0.4rem;
}

.reward-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.quest-item-notice {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: rgba(116, 185, 255, 0.12);
  border: 1px solid var(--accent-cyan);
  border-radius: var(--radius-md);
  padding: 0.8rem 1rem;
  margin-bottom: 1.2rem;
}

.quest-item-icon {
  font-size: 2rem;
}

.quest-item-info h4 {
  font-size: 0.95rem;
  color: var(--accent-cyan);
  margin-bottom: 2px;
}

.quest-item-info p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.day-actions {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.day-actions .btn-magic {
  width: 100%;
}

/* ─── 4. INVENTORY & DUAL TABS ────────────────────────────── */
.inventory-tabs {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
  border-radius: var(--radius-full);
}

.inv-tab-btn {
  flex: 1;
  padding: 0.65rem 1rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: var(--transition);
}

.inv-tab-btn.active {
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.25), rgba(162, 155, 254, 0.25));
  border: 1px solid var(--border-gold);
  color: var(--gold-spark);
  box-shadow: 0 0 12px rgba(255, 209, 102, 0.25);
}

.gifts-count-badge {
  background: var(--gold-primary);
  color: #1a1005;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.inventory-slot {
  aspect-ratio: 1 / 1;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.inventory-slot:active {
  transform: scale(0.95);
}

.inventory-slot.usable {
  border-color: var(--border-gold);
  box-shadow: 0 0 12px rgba(255, 209, 102, 0.2);
}

.inventory-slot-icon {
  font-size: 2.2rem;
  margin-bottom: 0.3rem;
}

.inventory-slot-name {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.2;
}

/* Gifts Grid */
.gifts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.gift-card-item {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.8rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.gift-card-item:active {
  transform: scale(0.96);
}

.gift-card-item.has-image {
  border-color: var(--accent-rose);
}

.gift-card-icon {
  font-size: 2.2rem;
  margin-bottom: 0.4rem;
}

.gift-card-date-badge {
  font-size: 0.68rem;
  color: var(--gold-spark);
  background: rgba(255, 209, 102, 0.15);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-bottom: 0.4rem;
}

.gift-card-title {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.gifts-empty, .inventory-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
}

/* Detail Panels */
.inventory-detail-panel {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.detail-card {
  position: relative;
  width: 100%;
  max-width: 360px;
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 1.8rem 1.4rem;
  text-align: center;
  box-shadow: var(--shadow-card), 0 0 30px rgba(255, 209, 102, 0.2);
  animation: zoomIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.detail-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.2rem;
  color: var(--text-muted);
  padding: 0.3rem;
}

.detail-icon {
  font-size: 3.5rem;
  margin-bottom: 0.6rem;
}

.detail-name {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: var(--gold-spark);
  margin-bottom: 0.6rem;
}

.detail-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.4rem;
}

.detail-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.detail-actions .btn-magic {
  width: 100%;
}

.gift-card-detail {
  max-height: 85vh;
  overflow-y: auto;
}

.gift-detail-img-wrap {
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 0.8rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.gift-detail-img-wrap img {
  width: 100%;
  height: auto;
  display: block;
}

.gift-detail-date {
  font-size: 0.8rem;
  color: var(--gold-spark);
  margin-bottom: 0.3rem;
}

.gift-detail-note {
  font-size: 0.8rem;
  color: var(--accent-emerald);
  font-style: italic;
  margin-top: 0.8rem;
}

/* ─── 5. Island Scene Screen ──────────────────────────────── */
#island-screen {
  overflow: hidden;
  background: #080c1e;
}

.island-scene {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.island-sky {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 60%;
  background: linear-gradient(180deg, #090e24 0%, #151d45 60%, #202b5e 100%);
  z-index: 1;
}

.island-moon {
  position: absolute;
  top: 25px;
  right: 35px;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  background: #fdf5e6;
  box-shadow: 0 0 35px #ffeaa7, 0 0 60px rgba(255, 234, 167, 0.5);
  z-index: 2;
}

.island-water {
  position: absolute;
  bottom: 0; left: 0; width: 100%; height: 50%;
  background: linear-gradient(180deg, #111a3d 0%, #070c1e 100%);
  z-index: 3;
  overflow: hidden;
}

.wave {
  position: absolute;
  left: -50%;
  width: 200%;
  height: 60px;
  border-radius: 45%;
  opacity: 0.25;
}

.wave-1 {
  top: 0;
  background: rgba(116, 185, 255, 0.3);
  animation: waveMotion 8s infinite linear;
}

.wave-2 {
  top: 15px;
  background: rgba(162, 155, 254, 0.2);
  animation: waveMotion 12s infinite linear reverse;
}

.wave-3 {
  top: 35px;
  background: rgba(255, 209, 102, 0.15);
  animation: waveMotion 15s infinite linear;
}

@keyframes waveMotion {
  0% { transform: translateX(0) scaleY(1); }
  50% { transform: translateX(25%) scaleY(1.2); }
  100% { transform: translateX(50%) scaleY(1); }
}

.island-body {
  position: absolute;
  bottom: 24%;
  left: 50%;
  transform: translateX(-50%);
  width: 320px;
  height: 140px;
  z-index: 5;
  transition: opacity 1.2s ease, filter 1.2s ease;
}

.island-ground {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 70px;
  background: radial-gradient(ellipse at 50% 100%, #1a2f26 0%, #0c1815 80%);
  border-radius: 160px 160px 20px 20px;
  border-top: 3px solid #2e4d3f;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}

.palm-tree {
  position: absolute;
  bottom: 50px;
  z-index: 6;
}

.palm-1 { left: 40px; transform: scale(1.1); }
.palm-2 { right: 50px; transform: scale(0.9) scaleX(-1); }

.palm-leaves {
  font-size: 2.8rem;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.6));
  animation: gentleSway 5s infinite ease-in-out;
}

@keyframes gentleSway {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(4deg); }
}

.chest-area {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 7;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.chest-area:active {
  transform: translateX(-50%) scale(0.92);
}

.chest {
  position: relative;
  width: 70px;
  height: 52px;
}

.chest-base {
  position: absolute;
  bottom: 0;
  width: 70px;
  height: 35px;
  background: linear-gradient(180deg, #8b4513 0%, #5c2c09 100%);
  border: 2px solid #ffd166;
  border-radius: 4px;
  box-shadow: 0 6px 14px rgba(0,0,0,0.6);
}

.chest-lid {
  position: absolute;
  top: 0;
  width: 70px;
  height: 22px;
  background: linear-gradient(180deg, #a0522d 0%, #8b4513 100%);
  border: 2px solid #ffd166;
  border-radius: 12px 12px 2px 2px;
  transform-origin: top center;
  transition: transform 0.8s cubic-bezier(0.3, 1.4, 0.5, 1);
}

.chest.opened .chest-lid {
  transform: translateY(-16px) rotateX(-50deg);
}

.chest-lock {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.1rem;
  z-index: 2;
  transition: opacity 0.5s;
}

.chest.opened .chest-lock {
  opacity: 0;
}

.chest-glow {
  position: absolute;
  top: -20px;
  left: -20px;
  width: 110px;
  height: 90px;
  background: radial-gradient(circle, rgba(255, 209, 102, 0.75) 0%, transparent 70%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

.chest.opened .chest-glow {
  opacity: 1;
  animation: chestGlowPulse 2s infinite ease-in-out;
}

@keyframes chestGlowPulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
}

.island-fog-layer {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: radial-gradient(circle at 50% 50%, rgba(200, 215, 255, 0.85) 0%, rgba(130, 150, 210, 0.75) 50%, transparent 85%);
  backdrop-filter: blur(14px);
  z-index: 10;
  pointer-events: none;
  transition: opacity 1.4s ease;
}

.island-fog-layer.dispersed {
  opacity: 0;
  pointer-events: none;
}

.island-ui {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  z-index: 15;
  background: rgba(12, 16, 38, 0.85);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1rem;
  backdrop-filter: blur(10px);
  text-align: center;
}

.island-message {
  font-size: 0.95rem;
  color: #fff;
  line-height: 1.5;
  margin-bottom: 0.8rem;
}

.island-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
}

.island-actions .btn-magic {
  width: 100%;
}

/* ─── 6. PUZZLE SCREEN & IMAGE TILES ──────────────────────── */
.puzzle-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1.5rem 0;
}

.puzzle-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: 290px;
  height: 290px;
  background: rgba(18, 24, 54, 0.85);
  border: 2px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 8px;
  box-shadow: 0 0 25px rgba(255, 209, 102, 0.2);
}

.puzzle-tile {
  background: linear-gradient(135deg, rgba(40, 50, 110, 0.95), rgba(25, 30, 75, 0.95));
  border: 1px solid rgba(255, 209, 102, 0.4);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  cursor: pointer;
  transition: transform 0.18s ease;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.puzzle-tile.image-tile {
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.puzzle-tile-corner-num {
  position: absolute;
  top: 3px;
  left: 5px;
  font-size: 0.7rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  background: rgba(0,0,0,0.4);
  padding: 1px 4px;
  border-radius: 4px;
}

.puzzle-tile:active {
  transform: scale(0.94);
}

.puzzle-tile.empty {
  background: transparent !important;
  border: 1px dashed rgba(255, 255, 255, 0.1) !important;
  cursor: default;
}

.puzzle-tile-label {
  font-size: 0.65rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.puzzle-complete, .game-complete-card {
  text-align: center;
  padding: 1.5rem;
  background: rgba(85, 239, 196, 0.15);
  border: 1px solid var(--accent-emerald);
  border-radius: var(--radius-md);
  margin-top: 1rem;
  animation: zoomIn 0.35s ease;
}

.puzzle-complete h3, .game-complete-card h3 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--accent-emerald);
  margin-bottom: 0.6rem;
}

.game-complete-card p {
  color: var(--text-primary);
  margin-bottom: 1rem;
}

/* ─── 7. QUIZ SCREEN ──────────────────────────────────────── */
.quiz-body {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.25rem;
  backdrop-filter: blur(12px);
  margin-top: 0.8rem;
}

.quiz-question {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
  margin-bottom: 1.4rem;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.quiz-option-btn {
  width: 100%;
  padding: 1rem 1.2rem;
  font-size: 0.98rem;
  font-weight: 600;
  text-align: left;
  color: #fff;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.quiz-option-btn:active {
  transform: scale(0.97);
}

.quiz-option-btn.correct {
  background: rgba(85, 239, 196, 0.25);
  border-color: var(--accent-emerald);
  color: var(--accent-emerald);
}

.quiz-option-btn.wrong {
  background: rgba(255, 118, 117, 0.25);
  border-color: var(--accent-rose);
  color: var(--accent-rose);
}

.quiz-result {
  text-align: center;
  padding: 1.8rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  margin-top: 1rem;
}

.quiz-score {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: var(--gold-spark);
  margin-bottom: 1.2rem;
}

/* ─── 8. MEMORY GAME (Real Photo Cards) ───────────────────── */
.memory-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin: 1rem 0;
}

.memory-card {
  aspect-ratio: 1 / 1;
  perspective: 1000px;
  cursor: pointer;
}

.memory-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.5s cubic-bezier(0.3, 1.4, 0.5, 1);
  transform-style: preserve-3d;
}

.memory-card.flipped .memory-card-inner,
.memory-card.matched .memory-card-inner {
  transform: rotateY(180deg);
}

.memory-card-back, .memory-card-front {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.memory-card-back {
  background: linear-gradient(135deg, #1f2756 0%, #121736 100%);
  border: 1.5px solid var(--border-gold);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.memory-back-rune {
  font-size: 1.6rem;
  color: var(--gold-primary);
  filter: drop-shadow(0 0 6px var(--gold-glow));
}

.memory-card-front {
  background: #000;
  border: 2px solid var(--gold-primary);
  transform: rotateY(180deg);
}

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

.memory-card.matched .memory-card-front {
  border-color: var(--accent-emerald);
  box-shadow: 0 0 16px rgba(85, 239, 196, 0.6);
}

/* ─── 9. HIDDEN OBJECTS GAME ──────────────────────────────── */
.hidden-game-wrapper {
  margin: 1rem 0;
}

.hidden-checklist {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.hidden-check-item {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.6rem;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-secondary);
  transition: var(--transition);
}

.hidden-check-item.found {
  border-color: var(--accent-emerald);
  background: rgba(85, 239, 196, 0.15);
  color: var(--accent-emerald);
  text-decoration: line-through;
}

.hidden-scene {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: linear-gradient(180deg, #10163a 0%, #1c2356 60%, #0d122b 100%);
  border: 2px solid var(--border-gold);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
}

.scene-decor.window {
  position: absolute;
  top: 15px;
  right: 20px;
  width: 75px;
  height: 90px;
  background: #090e24;
  border: 3px solid #8b5a2b;
  border-radius: 40px 40px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-around;
  color: #ffeaa7;
  font-size: 0.8rem;
}

.scene-decor.bookshelf {
  position: absolute;
  top: 25px;
  left: 20px;
  width: 90px;
  height: 50px;
  border-bottom: 4px solid #8b5a2b;
  display: flex;
  align-items: flex-end;
  padding-bottom: 2px;
  font-size: 1.2rem;
}

.scene-decor.desk {
  position: absolute;
  bottom: 20px;
  left: 30px;
  width: 110px;
  height: 60px;
  background: #4a2c11;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  font-size: 1.4rem;
}

.scene-decor.cozy-rug {
  position: absolute;
  bottom: 8px;
  right: 25px;
  width: 120px;
  height: 55px;
  background: radial-gradient(ellipse at center, #6c2b48 0%, #3e1628 100%);
  border-radius: 50%;
  border: 2px dashed rgba(255, 209, 102, 0.4);
}

.hidden-clickable-item {
  position: absolute;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 10;
  transform: translate(-50%, -50%);
  transition: transform 0.2s ease;
}

.hidden-clickable-item:active {
  transform: translate(-50%, -50%) scale(1.3);
}

.hidden-clickable-item.found {
  pointer-events: none;
  filter: drop-shadow(0 0 10px var(--accent-emerald));
  animation: foundPulse 1.5s infinite ease-in-out;
}

@keyframes foundPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1.1); }
  50% { transform: translate(-50%, -50%) scale(1.35); }
}

/* ─── 10. CONSTELLATION GAME ──────────────────────────────── */
.constellation-wrap {
  margin: 1rem 0;
}

.constellation-canvas {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: radial-gradient(circle at center, #181d48 0%, #080c1e 90%);
  border: 2px solid var(--border-gold);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

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

.constellation-line {
  stroke: var(--gold-primary);
  stroke-width: 2.5;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px var(--gold-glow));
  animation: drawLine 0.5s ease;
}

.constellation-star {
  position: absolute;
  width: 48px;
  height: 48px;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: transform 0.2s ease;
}

.constellation-star:active {
  transform: translate(-50%, -50%) scale(1.3);
}

.constellation-star .star-icon {
  font-size: 1.8rem;
  filter: drop-shadow(0 0 6px rgba(255, 234, 167, 0.4));
}

.constellation-star .star-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--gold-spark);
  background: rgba(0, 0, 0, 0.6);
  padding: 1px 5px;
  border-radius: var(--radius-full);
}

.constellation-star.connected .star-icon {
  filter: drop-shadow(0 0 14px var(--gold-primary));
  animation: starPulse 2s infinite ease-in-out;
}

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

/* ─── 11. POTION BREWING GAME ─────────────────────────────── */
.potion-game-wrap {
  margin: 1rem 0;
}

.cauldron-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.4rem;
}

.cauldron-steam {
  font-size: 1.5rem;
  margin-bottom: 0.3rem;
  animation: steamRise 3s infinite ease-in-out;
}

@keyframes steamRise {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50% { transform: translateY(-8px); opacity: 1; }
}

.cauldron {
  position: relative;
  width: 140px;
  height: 110px;
  background: radial-gradient(circle at 50% 30%, #3a3f5c 0%, #151829 80%);
  border-radius: 20px 20px 70px 70px;
  border: 4px solid #101324;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.cauldron-rim {
  position: absolute;
  top: 0; left: -10%; width: 120%; height: 16px;
  background: #252a42;
  border-radius: 50%;
  border: 2px solid #101324;
}

.cauldron-liquid {
  position: absolute;
  top: 10px; left: 0; width: 100%; height: 100%;
  background: radial-gradient(ellipse at 50% 50%, #e0aaff 0%, #2e1065 80%);
  transition: background 0.8s ease;
}

.cauldron-liquid.splash {
  animation: splashWave 0.6s ease;
}

@keyframes splashWave {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15) translateY(-4px); }
}

.cauldron-status {
  margin-top: 0.8rem;
  font-size: 0.95rem;
  color: var(--gold-spark);
  text-align: center;
  min-height: 40px;
}

.potion-shelf {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.potion-ingredient-btn {
  width: 100%;
  padding: 0.8rem 1.1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  transition: var(--transition);
}

.potion-ingredient-btn:active {
  transform: scale(0.97);
}

.potion-ingredient-btn.added {
  opacity: 0.45;
  border-color: var(--accent-emerald);
  text-decoration: line-through;
  pointer-events: none;
}

/* ─── 12. VARAN QUEST SCREEN ──────────────────────────────── */
.varan-quest-wrap {
  margin: 1rem 0;
}

.varan-character {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.varan-avatar {
  font-size: 4rem;
  animation: varanWag 3s infinite ease-in-out;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
}

@keyframes varanWag {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-5deg) scale(1.05); }
  75% { transform: rotate(5deg) scale(1.05); }
}

.varan-bubble {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 1rem;
  position: relative;
}

.varan-speech {
  font-size: 0.95rem;
  line-height: 1.5;
  color: #fff;
}

.varan-question-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.2rem;
}

.varan-q-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--gold-spark);
  margin-bottom: 1rem;
}

.varan-options {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.varan-opt-btn {
  width: 100%;
  padding: 0.9rem 1.1rem;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: left;
  color: #fff;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.varan-opt-btn:active {
  transform: scale(0.97);
}

.varan-opt-btn.correct {
  background: rgba(85, 239, 196, 0.25);
  border-color: var(--accent-emerald);
  color: var(--accent-emerald);
}

.varan-opt-btn.wrong {
  background: rgba(255, 118, 117, 0.25);
  border-color: var(--accent-rose);
  color: var(--accent-rose);
}

.varan-reveal-card {
  background: linear-gradient(135deg, rgba(35, 45, 95, 0.95), rgba(45, 30, 80, 0.9));
  border: 2px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 0 30px rgba(255, 209, 102, 0.3);
  animation: zoomIn 0.4s ease;
}

.varan-love-icon {
  font-size: 2.2rem;
  margin-bottom: 0.8rem;
}

.varan-reveal-text {
  font-size: 1.05rem;
  line-height: 1.6;
  color: #fff;
  margin-bottom: 1.4rem;
}

/* ─── 13. SPECIAL FETA MODAL (Day 14) ─────────────────────── */
.feta-card {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: linear-gradient(135deg, #1b2048 0%, #101633 100%);
  border: 2px solid var(--accent-rose);
  border-radius: var(--radius-lg);
  padding: 1.8rem 1.4rem;
  text-align: center;
  box-shadow: 0 0 40px rgba(255, 118, 117, 0.4);
  animation: zoomIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 1001;
  max-height: 90vh;
  overflow-y: auto;
}

.feta-img-container {
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 1rem;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6);
}

.feta-img {
  width: 100%;
  height: auto;
  display: block;
}

.feta-title {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  color: var(--gold-spark);
  margin-bottom: 0.4rem;
}

.feta-quote {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-rose);
  font-style: italic;
  margin-bottom: 0.8rem;
}

.feta-desc {
  font-size: 0.95rem;
  color: #dfe6e9;
  line-height: 1.6;
  margin-bottom: 1.4rem;
}

/* ─── 14. BOTTOM NAVIGATION ───────────────────────────────── */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 64px;
  background: rgba(10, 14, 34, 0.85);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-glass);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 20;
}

.nav-btn {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-secondary);
  transition: var(--transition);
}

.nav-icon {
  font-size: 1.35rem;
  transition: transform 0.2s ease;
}

.nav-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.nav-btn.active {
  color: var(--gold-primary);
}

.nav-btn.active .nav-icon {
  transform: scale(1.15) translateY(-2px);
  filter: drop-shadow(0 0 6px var(--gold-glow));
}

/* ─── 15. CHEST REVEAL MODAL ──────────────────────────────── */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
}

.chest-reward-card {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: linear-gradient(135deg, #1b2048 0%, #101633 100%);
  border: 2px solid var(--gold-primary);
  border-radius: var(--radius-lg);
  padding: 2rem 1.4rem;
  text-align: center;
  box-shadow: 0 0 40px rgba(255, 209, 102, 0.4);
  animation: zoomIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 1001;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.2rem;
  color: var(--text-muted);
}

.sparkle-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  animation: pulseRotate 4s infinite ease-in-out;
}

.chest-modal-title {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  color: var(--gold-spark);
  margin-bottom: 1rem;
}

.chest-modal-scroll {
  max-height: 260px;
  overflow-y: auto;
  margin-bottom: 1.4rem;
  text-align: left;
}

.chest-modal-intro {
  font-size: 1rem;
  color: #f1f2f6;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.secret-location-box {
  background: rgba(255, 209, 102, 0.1);
  border: 1px dashed var(--gold-primary);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1rem;
}

.secret-box-title {
  font-size: 0.95rem;
  color: var(--gold-spark);
  margin-bottom: 0.5rem;
}

.secret-final {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent-emerald);
  line-height: 1.5;
}

.chest-modal-signature {
  font-style: italic;
  text-align: center;
  color: var(--gold-spark);
  margin-top: 0.8rem;
}

/* ─── 17. TOAST NOTIFICATIONS ─────────────────────────────── */
.toast {
  position: fixed;
  bottom: 74px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(18, 24, 54, 0.95);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-full);
  padding: 0.7rem 1.4rem;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 15px rgba(255, 209, 102, 0.25);
  backdrop-filter: blur(12px);
  z-index: 5000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 90%;
  text-align: center;
}

.toast.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* ─── Animations ─────────────────────────────────────────── */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes bounceIn {
  0% { transform: scale(0.3); opacity: 0; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}
