/* ==========================================================================
   KOPITIAM KOPI KIA - VINTAGE NANYANG POSTER DESIGN SYSTEM & STYLES (COMPLETE UNIFIED THEME)
   ========================================================================== */

:root {
  --primary-gold: #f59e0b;
  --nanyang-blue: #0f386b;
  --nanyang-darkblue: #092142;
  --vintage-red: #c23b22;
  --parchment-bg: #fdfbf7;
  --parchment-card: #ffffff;
  --parchment-glass: rgba(253, 251, 247, 0.96);
  --text-dark: #331800;

  --gold-glow: rgba(245, 158, 11, 0.5);
  --cyan-glow: #06b6d4;
  --pink-glow: #ec4899;
  --green-glow: #22c55e;
  --iceblue-glow: #38bdf8;
  --blue-glow: #3b82f6;
  --white-glow: #e2e8f0;
  --emerald-glow: #10b981;

  --glass-bg: rgba(253, 251, 247, 0.94);
  --glass-border: var(--nanyang-blue);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);

  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Playfair Display', serif;
  --font-chinese: 'Noto Serif TC', serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}

.action-btn *, 
.btn-icon, 
.btn-label,
.header-icon-btn *,
.station-tab *,
.primary-cta-btn *,
.menu-grid-btn * {
  pointer-events: none !important;
}

body {
  background: #0f172a;
  font-family: var(--font-family);
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* ==========================================================================
   1. SMARTPHONE VIEWPORT (#mobile-viewport)
   ========================================================================== */
#mobile-viewport {
  position: relative;
  width: 100vw;
  height: 100vh;
  max-width: 480px;
  max-height: 960px;
  aspect-ratio: 9 / 16;
  border-radius: 36px;
  overflow: hidden;
  box-shadow: 
    0 0 0 10px #1e293b,
    0 0 0 12px #0f172a,
    0 25px 50px -12px rgba(0, 0, 0, 0.85),
    0 0 40px rgba(245, 158, 11, 0.2);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

@media (max-width: 500px) {
  #mobile-viewport {
    border-radius: 0;
    max-width: 100vw;
    max-height: 100vh;
    box-shadow: none;
  }
}

#game-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('assets/sprites/clean_background.jpg');
  background-size: cover;
  background-position: center center;
  z-index: 1;
}

#background-vignette {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, transparent 35%, rgba(6, 9, 17, 0.45) 100%);
  z-index: 2;
  pointer-events: none;
}

.glass-card {
  background: var(--parchment-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 2px solid var(--nanyang-blue);
  border-radius: 18px;
  box-shadow: var(--glass-shadow);
  color: var(--text-dark);
}

/* ==========================================================================
   2. MAIN MENU SCREEN (VINTAGE NANYANG BREAKFAST THEME)
   ========================================================================== */
.screen-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 150;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: env(safe-area-inset-top, 20px) 16px env(safe-area-inset-bottom, 24px) 16px;
  background-image: url('assets/sprites/home_screen_breakfast.jpg');
  background-size: cover;
  background-position: center center;
  overflow: hidden;
}

.breakfast-menu-content {
  position: relative;
  z-index: 10;
  width: 100%;
  height: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

.breakfast-artwork-spacer {
  flex: 1;
  width: 100%;
  pointer-events: none;
}

.breakfast-bottom-controls {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-bottom: max(24px, calc(env(safe-area-inset-bottom, 20px) + 12px));
}

/* Big Juicy START BREWING Button - Heritage Indigo Navy */
.btn-breakfast-play {
  appearance: none;
  -webkit-appearance: none;
  width: 86%;
  max-width: 320px;
  height: 64px;
  border-radius: 36px;
  border: 3.5px solid #0d2238;
  background: linear-gradient(180deg, #2b5687 0%, #1a3c63 48%, #0f2742 100%);
  color: #ffffff;
  font-family: 'Bebas Neue', 'Oswald', 'Impact', sans-serif;
  font-size: 2.35rem;
  font-weight: 900;
  letter-spacing: 2.5px;
  white-space: nowrap;
  line-height: 1;
  padding-top: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    0 6px 0 #071320,
    0 12px 28px rgba(10, 25, 45, 0.4),
    inset 0 2px 4px rgba(255, 255, 255, 0.45);
  text-shadow: 0 2px 4px rgba(5, 15, 28, 0.9);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  pointer-events: auto !important;
}

.btn-breakfast-play:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 8px 0 #071320,
    0 16px 32px rgba(26, 60, 99, 0.45),
    inset 0 2px 4px rgba(255, 255, 255, 0.6);
}

.btn-breakfast-play:active {
  transform: translateY(4px);
  box-shadow: 
    0 2px 0 #071320,
    0 6px 14px rgba(0, 0, 0, 0.3),
    inset 0 2px 2px rgba(0, 0, 0, 0.4);
}

/* 3 Circular Action Buttons Row - Heritage Indigo Navy */
.breakfast-circle-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 22px;
  width: 100%;
}

.circle-action-btn {
  appearance: none;
  -webkit-appearance: none;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 3px solid #0d2238;
  background: linear-gradient(180deg, #2b5687 0%, #1a3c63 50%, #0f2742 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    0 5px 0 #071320,
    0 8px 20px rgba(10, 25, 45, 0.35),
    inset 0 2px 3px rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  pointer-events: auto !important;
}

.circle-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 7px 0 #071320,
    0 12px 24px rgba(26, 60, 99, 0.4);
}

.circle-action-btn:active {
  transform: translateY(3px);
  box-shadow: 
    0 1px 0 #071320,
    0 4px 10px rgba(0, 0, 0, 0.3);
}

.circle-action-btn .action-svg {
  width: 27px;
  height: 27px;
  stroke: #ffffff;
  stroke-width: 2.2;
  filter: drop-shadow(0 1.5px 2px rgba(5, 15, 28, 0.7));
  pointer-events: none !important;
}

.copyright-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.92);
  border: 2px solid var(--nanyang-blue);
  padding: 6px 16px;
  border-radius: 14px;
  color: var(--nanyang-blue);
  font-size: 0.7rem;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  letter-spacing: 0.2px;
}

/* ==========================================================================
   3. UNIFIED IN-GAME HEADER & SHIFT HUD
   ========================================================================== */
#game-header,
.game-header-unified {
  position: relative;
  z-index: 1000;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 4px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.header-center-col {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.header-right-col {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.hud-stat-pill {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  padding: 6px 12px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 900;
  font-size: 0.82rem;
  color: var(--nanyang-darkblue);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  white-space: nowrap;
}

.hud-stat-pill.level-pill {
  border-color: var(--primary-gold);
  color: #1e3a8a;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-stat-pill.goal-pill {
  background: #f0fdf4;
  border-color: #86efac;
  color: #15803d;
}

.hud-stat-pill.queue-pill {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.hud-stat-pill.strikes-pill {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
}

.hud-stat-pill.timer-pill {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
}

.pill-icon {
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pill-sprite-icon {
  width: 15px;
  height: 15px;
  object-fit: contain;
  vertical-align: middle;
  display: inline-block;
  flex-shrink: 0;
}

.timer-sprite-icon {
  width: 15px;
  height: 15px;
  object-fit: contain;
  vertical-align: middle;
  display: inline-block;
  flex-shrink: 0;
}

.serve-bell-sprite {
  width: 22px;
  height: 22px;
  object-fit: contain;
  vertical-align: middle;
  display: inline-block;
  transition: transform 0.12s ease;
}

.serve-btn:active .serve-bell-sprite {
  transform: scale(0.9) rotate(-8deg);
}

.ice-cube-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.18));
}

.shop-balance-sprite {
  width: 18px;
  height: 18px;
  object-fit: contain;
  vertical-align: middle;
  display: inline-block;
  margin-right: 4px;
}

.volume-slider-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  vertical-align: middle;
  display: inline-block;
  flex-shrink: 0;
}

.hawker-avatar-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
  display: inline-block;
  border: 1.5px solid #b8a287;
  margin-right: 4px;
}

.rank-medal-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  vertical-align: middle;
  display: inline-block;
  margin-right: 4px;
}

.node-badge-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.header-icon-btn {
  background: #ffffff;
  border: 1.5px solid var(--nanyang-blue);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--nanyang-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto !important;
  z-index: 1000 !important;
}

.header-icon-btn:active {
  transform: scale(0.92);
  background: #f1f5f9;
}

.header-icon-btn .svg-icon {
  width: 15px;
  height: 15px;
}

.header-icon-btn * {
  pointer-events: none !important;
}

/* ==========================================================================
   4. UNIFIED ACTIVE SPOTLIGHT & "UP NEXT" MINI QUEUE
   ========================================================================== */
#active-order-spotlight {
  position: relative;
  z-index: 10;
  margin: 4px 10px 4px 10px;
  padding: 6px 10px 8px 10px;
  overflow: hidden;
  background: rgba(253, 251, 247, 0.98);
  border: 2px solid var(--nanyang-blue);
  border-left: 5px solid var(--primary-gold);
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.spotlight-top-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
  gap: 6px;
}

.spotlight-tag-row {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.spotlight-badge {
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.6px;
  color: var(--nanyang-blue);
  text-transform: uppercase;
}

.spotlight-timer-badge {
  display: flex;
  align-items: center;
  gap: 2px;
  background: #fef2f2;
  border: 1px solid #f87171;
  padding: 1px 5px;
  border-radius: 10px;
  font-weight: 900;
  font-size: 0.72rem;
  color: #dc2626;
}

/* Embedded Up Next Queue Strip */
.up-next-strip {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  overflow: hidden;
}

.up-next-label {
  font-size: 0.62rem;
  font-weight: 800;
  color: #64748b;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.queue-mini-chip {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 1px 5px;
  display: flex;
  align-items: center;
  gap: 3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.chip-avatar {
  font-size: 0.75rem;
  width: 15px;
  height: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
}

.chip-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chip-drink {
  font-size: 0.68rem;
  font-weight: 800;
  color: #1e3a8a;
  max-width: 65px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spotlight-body {
  display: flex;
  align-items: center;
  gap: 10px;
}

.spotlight-customer-avatar {
  font-size: 1.8rem;
  background: #ffffff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--primary-gold);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  padding: 0;
  flex-shrink: 0;
}

.customer-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.spotlight-order-details {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.customer-name-row {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 700;
  line-height: 1.2;
}

.order-name-row {
  font-size: 1.22rem;
  font-weight: 900;
  color: var(--nanyang-darkblue);
  line-height: 1.2;
  margin-top: 1px;
}

/* ==========================================================================
   PHYSICAL HAWKER COUNTER RECIPE CHIT
   ========================================================================== */
.counter-chit-paper {
  position: absolute;
  top: 28px;
  left: 14px;
  width: 106px;
  background: #fffdf5;
  border-radius: 6px;
  padding: 7px 6px 9px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.42), 0 2px 5px rgba(0, 0, 0, 0.2);
  border: 1px solid #e2d8be;
  transform: rotate(-3.5deg);
  z-index: 25;
  font-family: "Outfit", -apple-system, sans-serif;
  color: #2c1a0e;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.counter-chit-paper:hover {
  transform: rotate(-1deg) scale(1.03);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
}

.chit-pin {
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ef4444 0%, #991b1b 100%);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
  border: 1.5px solid #ffffff;
}

.chit-title {
  font-size: 0.62rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #78350f;
  border-bottom: 1.5px dashed #d97706;
  padding-bottom: 3px;
  margin-bottom: 5px;
}

.chit-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.62rem;
  font-weight: 800;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chit-item {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #451a03;
  transition: all 0.2s ease;
  line-height: 1.15;
}

.chit-num {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fef3c7;
  border: 1px solid #f59e0b;
  color: #92400e;
  font-size: 0.55rem;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chit-item.is-done {
  color: #16a34a;
  opacity: 0.55;
  text-decoration: line-through;
}

.chit-item.is-done .chit-num {
  background: #16a34a;
  border-color: #15803d;
  color: #ffffff;
  text-decoration: none;
}

.spotlight-progress-track {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(15, 56, 107, 0.12);
}

#spotlight-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #06b6d4, #22d3ee);
  transition: width 0.2s linear;
}

.shake-card { animation: shake 0.4s ease-in-out; }

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

/* ==========================================================================
   5. CENTER GLASS MUG OVERLAY (#glass-mug-overlay)
   ========================================================================== */
#glass-mug-overlay {
  position: relative;
  flex: 1;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  padding: 4px 0 10px 0;
  min-height: 130px;
}

#three-canvas-container {
  display: none !important;
}

.mug-glow-ring {
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  border-radius: 28px;
  border: 3px solid transparent;
  pointer-events: none;
  transition: all 0.3s ease;
}

.mug-active .mug-glow-ring {
  border-color: var(--cyan-glow);
  box-shadow: 0 0 35px var(--cyan-glow), inset 0 0 20px var(--cyan-glow);
  animation: pulseGlow 1.8s infinite ease-in-out;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.03); }
}

.mug-glass-body {
  position: relative;
  width: 115px;
  height: 145px;
  border: 3px solid rgba(255, 255, 255, 0.6);
  border-bottom-width: 12px;
  border-radius: 12px 12px 26px 26px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(4px);
  overflow: hidden;
  box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.4), 0 12px 25px rgba(0, 0, 0, 0.5);
}

.mug-glass-body.gold-skin {
  border-color: #fde047 !important;
  box-shadow: inset 0 0 20px rgba(253, 224, 71, 0.6), 0 12px 25px rgba(0, 0, 0, 0.6);
}

.mug-glass-body.plastic-cup-mode {
  width: 105px;
  height: 152px;
  border-radius: 12px 12px 20px 20px;
  border: 2.5px solid rgba(255, 255, 255, 0.9);
  border-bottom-width: 6px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(2px);
  clip-path: polygon(0% 0%, 100% 0%, 86% 100%, 14% 100%);
  box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.7), 0 10px 22px rgba(0, 0, 0, 0.4);
}

.mug-handle {
  position: absolute;
  right: -24px;
  top: 22px;
  width: 26px;
  height: 80px;
  border: 4px solid rgba(255, 255, 255, 0.6);
  border-left: none;
  border-radius: 0 20px 20px 0;
  pointer-events: none;
}

.glass-reflection-left {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 10px;
  height: 80%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.05) 100%);
  border-radius: 6px;
  pointer-events: none;
  z-index: 10;
}

.glass-reflection-right {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 60%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.02) 100%);
  border-radius: 4px;
  pointer-events: none;
  z-index: 10;
}

#mug-liquid-container {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column-reverse;
  overflow: hidden;
  border-radius: 0 0 18px 18px;
}

.liquid-layer {
  width: 100%;
  height: 0%;
  transition: height 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.3s ease;
  position: relative;
}

#liquid-condensed-milk { background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%); }
#liquid-evaporated-milk { background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%); }
#liquid-brew { background: linear-gradient(180deg, #451a03 0%, #78350f 100%); }

#liquid-brew.teh-color { background: linear-gradient(180deg, #9a3412 0%, #c2410c 100%); }
#liquid-brew.yuanyang-color { background: linear-gradient(180deg, #581c87 0%, #7c2d12 100%); }
#liquid-brew.coke-color { background: linear-gradient(180deg, #180903 0%, #3d1405 100%); }
#liquid-brew.sprite-color { background: linear-gradient(180deg, rgba(255, 255, 255, 0.7) 0%, rgba(209, 250, 229, 0.5) 100%); }
#liquid-brew.hundred-color { background: linear-gradient(180deg, rgba(224, 242, 254, 0.8) 0%, rgba(186, 230, 253, 0.6) 100%); }
#liquid-brew.bandung-color { background: linear-gradient(180deg, #f472b6 0%, #f43f5e 100%); }
#liquid-brew.lime-color { background: linear-gradient(180deg, #a3e635 0%, #65a30d 100%); }

#liquid-water { background: linear-gradient(180deg, rgba(147, 197, 253, 0.6) 0%, rgba(59, 130, 246, 0.4) 100%); }

.sugar-layer {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 0px;
  background: radial-gradient(circle, #ffffff 60%, rgba(255, 255, 255, 0) 100%);
  border-radius: 10px;
  transition: height 0.3s ease;
  z-index: 5;
}

.ice-layer {
  position: absolute;
  top: 10px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-around;
  z-index: 12;
  pointer-events: none;
}

.ice-cube {
  font-size: 1.2rem;
  animation: floatIce 2s infinite ease-in-out alternate;
}

.ice-cube.c2 { animation-delay: 0.4s; }
.ice-cube.c3 { animation-delay: 0.8s; }

@keyframes floatIce {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(4px) rotate(15deg); }
}

.liquid-foam-top {
  position: absolute;
  top: 0;
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  opacity: 0;
}

#mug-steam-container {
  position: absolute;
  top: -28px;
  display: flex;
  gap: 10px;
  pointer-events: none;
}

.steam-particle {
  font-size: 1.3rem;
  color: rgba(255, 255, 255, 0.7);
  animation: floatSteam 2s infinite ease-out;
}

.steam-particle.s2 { animation-delay: 0.6s; }
.steam-particle.s3 { animation-delay: 1.2s; }

@keyframes floatSteam {
  0% { opacity: 0; transform: translateY(10px) scale(0.8); }
  50% { opacity: 0.8; }
  100% { opacity: 0; transform: translateY(-25px) scale(1.3); }
}

#mug-status-badge {
  position: relative;
  margin-top: 10px;
  background: #ffffff;
  border: 2px solid var(--nanyang-blue);
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 900;
  color: var(--nanyang-darkblue);
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  z-index: 30;
  pointer-events: none;
}

.floating-score {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  font-weight: 900;
  color: #16a34a;
  text-shadow: 0 0 15px rgba(22, 163, 74, 0.6);
  pointer-events: none;
  z-index: 100;
  animation: floatUp 1.2s forwards cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes floatUp {
  0% { opacity: 1; transform: translate(-50%, 0) scale(0.8); }
  50% { opacity: 1; transform: translate(-50%, -60px) scale(1.2); }
  100% { opacity: 0; transform: translate(-50%, -100px) scale(1); }
}

/* ==========================================================================
   6. BOTTOM ACTION TOOLBAR (UNIFIED CLEAN HAWKER THEME)
   ========================================================================== */
#bottom-action-bar {
  position: relative;
  z-index: 30;
  padding: 6px 12px calc(14px + env(safe-area-inset-bottom, 0px)) 12px;
  background: rgba(253, 251, 247, 0.98);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 2px solid var(--nanyang-blue);
  border-radius: 18px 18px 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.12);
}

#station-tab-bar {
  display: flex;
  gap: 6px;
  background: rgba(15, 56, 107, 0.08);
  padding: 3px;
  border-radius: 10px;
  border: 1px solid rgba(15, 56, 107, 0.2);
}

.station-tab {
  flex: 1;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: var(--nanyang-blue);
  font-size: 0.72rem;
  font-weight: 900;
  padding: 5px 4px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.station-tab.active-tab {
  background: var(--nanyang-blue);
  color: #ffffff;
  border-color: var(--nanyang-darkblue);
  box-shadow: 0 2px 8px rgba(15, 56, 107, 0.25);
}

.tab-icon-img {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  object-fit: cover;
}

.action-grid {
  display: grid;
  gap: 5px;
  width: 100%;
}

.grid-8 { grid-template-columns: repeat(4, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.serve-row {
  width: 100%;
}

.serve-action-bar {
  width: 100%;
  min-height: 46px;
  background: linear-gradient(135deg, #15803d 0%, #16a34a 100%);
  color: #ffffff;
  border: 2px solid #86efac;
  border-radius: 14px;
  padding: 8px 16px;
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.35);
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.serve-action-bar:active {
  transform: scale(0.96);
  background: linear-gradient(135deg, #166534 0%, #15803d 100%);
}

.serve-bell-icon {
  font-size: 1.15rem;
}

.action-btn {
  appearance: none;
  -webkit-appearance: none;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  padding: 4px 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  cursor: pointer;
  outline: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.14);
}

.action-btn:active {
  transform: scale(0.94);
  background: #f8fafc;
}

/* Subtle Warm Card Border Accents */
.btn-kopi-card { border-color: #fca5a5; }
.btn-teh-card { border-color: #fdba74; }
.btn-water-card { border-color: #93c5fd; }
.btn-ice-card { border-color: #67e8f9; }
.btn-condensed-card { border-color: #fde047; }
.btn-evap-card { border-color: #cbd5e1; }
.btn-sugar-card { border-color: #fef08a; }
.btn-rinse-card { border-color: #94a3b8; background: #f8fafc; }
.btn-can-card { border-color: #93c5fd; }
.btn-dispenser-card { border-color: #f9a8d4; }

.btn-label {
  font-size: clamp(0.52rem, 1.12vh, 0.62rem);
  font-weight: 800;
  color: #1e293b;
  text-align: center;
  line-height: 1.1;
  background: rgba(0, 0, 0, 0.04);
  padding: 1px 2px;
  border-radius: 6px;
  width: 100%;
  min-height: 2.2em;
  display: flex;
  align-items: center;
  justify-content: center;
  word-break: break-word;
}

.soda-can-icon,
.sprite-icon {
  width: clamp(34px, 4.5vh, 40px);
  height: clamp(34px, 4.5vh, 40px);
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  margin-bottom: 2px;
}

/* ==========================================================================
   7. CAMPAIGN SAGA MAP, SHOP & MODALS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 99999 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.hidden { display: none !important; }

.modal-card {
  width: 100%;
  max-height: 84vh;
  overflow-y: auto;
  padding: 18px;
  background: var(--parchment-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 2.5px solid var(--nanyang-blue);
  border-radius: 24px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25);
  color: var(--text-dark);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  border-bottom: 2px solid rgba(15, 56, 107, 0.2);
  padding-bottom: 10px;
}

.modal-header h2 { font-size: 1.25rem; color: var(--nanyang-blue); font-weight: 900; }
.close-btn { background: none; border: none; color: var(--nanyang-blue); font-size: 1.8rem; font-weight: 900; cursor: pointer; }

/* ==========================================================================
   KOPITIAM EQUIPMENT SHOP (VINTAGE SETTINGS THEME HOMOGENEITY)
   ========================================================================== */
.shop-modal-card {
  width: 92%;
  max-width: 380px !important;
  max-height: 94vh !important;
  display: flex;
  flex-direction: column;
}

.shop-modal-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.shop-balance-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ebdcc7;
  border: 2px solid #b8a287;
  border-radius: 16px;
  padding: 8px 14px;
  margin-bottom: 10px;
  box-shadow: inset 0 2px 5px rgba(80, 50, 20, 0.15), 0 2px 4px rgba(255, 255, 255, 0.6);
  flex-shrink: 0;
}

.shop-balance-label {
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  font-weight: 800;
  color: #3a1e0d;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.shop-balance-icon {
  font-size: 1.1rem;
}

.shop-balance-bar strong {
  font-family: 'Bebas Neue', 'Oswald', sans-serif;
  font-size: 1.45rem;
  letter-spacing: 1px;
  color: #15803d;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
  line-height: 1;
}

.shop-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  max-height: 56vh;
  padding: 2px 3px 6px 1px;
  -webkit-overflow-scrolling: touch;
}

.shop-grid::-webkit-scrollbar {
  width: 5px;
}
.shop-grid::-webkit-scrollbar-track {
  background: #ebdcc7;
  border-radius: 10px;
}
.shop-grid::-webkit-scrollbar-thumb {
  background: #b8a287;
  border-radius: 10px;
}

.shop-item-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fdfbf6;
  border: 2px solid #d4c4ab;
  border-radius: 16px;
  padding: 8px 10px;
  box-shadow: 0 2px 5px rgba(60, 35, 15, 0.08), inset 0 1px 1px rgba(255, 255, 255, 0.9);
  transition: transform 0.1s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.shop-item-card:hover {
  border-color: #b8a287;
  box-shadow: 0 4px 10px rgba(60, 35, 15, 0.12);
}

.shop-item-card.item-locked {
  background: #ebe0cf;
  border-color: #c7b89f;
  opacity: 0.92;
  box-shadow: inset 0 1px 3px rgba(80, 50, 20, 0.1);
}

.shop-item-left {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  min-width: 0;
}

.shop-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.shop-upgrade-sprite {
  width: 44px;
  height: 44px;
  min-width: 44px;
  object-fit: contain;
  border-radius: 10px;
  background: radial-gradient(circle, #ffffff 40%, #fef3c7 100%);
  border: 2px solid #b8a287;
  box-shadow: 0 2px 5px rgba(60, 35, 15, 0.15);
  padding: 2px;
  flex-shrink: 0;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.shop-item-card:hover .shop-upgrade-sprite {
  transform: scale(1.05);
}

.shop-item-card.item-locked .shop-upgrade-sprite {
  filter: grayscale(0.85) opacity(0.55);
  border-color: #c4b69d;
  background: #dfd3bd;
  box-shadow: none;
}

.shop-item-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.shop-item-details h4 {
  margin: 0 0 2px 0;
  font-size: 0.88rem;
  font-weight: 800;
  color: #1a3c63;
  font-family: 'Outfit', sans-serif;
  letter-spacing: 0.1px;
  line-height: 1.2;
}

.shop-item-details .shop-desc {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: #5c432d;
  line-height: 1.2;
}

.shop-unlock-requirement {
  margin-top: 4px;
}

.shop-unlock-requirement .lock-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fae8e7;
  color: #8b1e1b;
  border: 1px solid #e8b2b0;
  font-size: 0.69rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  letter-spacing: 0.15px;
  line-height: 1.25;
  box-shadow: 0 1px 2px rgba(139, 30, 27, 0.08);
}

.shop-item-card .buy-btn {
  appearance: none;
  -webkit-appearance: none;
  background: linear-gradient(180deg, #15803d 0%, #166534 50%, #14532d 100%);
  color: #ffffff;
  border: 2px solid #052e16;
  border-radius: 12px;
  padding: 8px 13px;
  font-weight: 900;
  font-size: 1.05rem;
  font-family: 'Bebas Neue', 'Oswald', sans-serif;
  letter-spacing: 0.8px;
  cursor: pointer;
  box-shadow: 0 3.5px 0 #022c14, 0 6px 14px rgba(5, 46, 22, 0.3);
  text-shadow: 0 1.5px 2px rgba(2, 44, 20, 0.85);
  flex-shrink: 0;
  margin-left: 8px;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.shop-item-card .buy-btn:hover {
  transform: translateY(-1px);
}

.shop-item-card .buy-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #022c14;
}

.shop-item-card .buy-btn.bought {
  background: #d4c8b6 !important;
  color: #6e5e4b !important;
  border: 2px solid #b8a994 !important;
  box-shadow: inset 0 1px 3px rgba(80, 50, 20, 0.15) !important;
  text-shadow: none !important;
  cursor: default !important;
  font-size: 0.95rem;
  letter-spacing: 1px;
}

.shop-item-card .buy-btn.locked {
  background: linear-gradient(180deg, #2b5687 0%, #1a3c63 48%, #0f2742 100%) !important;
  color: #ffffff !important;
  border: 2px solid #0d2238 !important;
  box-shadow: 0 3px 0 #071320 !important;
  text-shadow: 0 1px 2px rgba(5, 15, 28, 0.85) !important;
  cursor: not-allowed !important;
  font-size: 0.92rem;
  padding: 8px 10px;
  letter-spacing: 0.6px;
}

.shop-modal-footer {
  margin-top: 10px;
  flex-shrink: 0;
}

/* ==========================================================================
   LEADERBOARD / HALL OF FAME (VINTAGE SETTINGS & SHOP THEME HOMOGENEITY)
   ========================================================================== */
.board-modal-card {
  width: 92%;
  max-width: 380px !important;
  max-height: 94vh !important;
  display: flex;
  flex-direction: column;
}

.board-modal-body {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 0;
}

/* Hawker Name Inset Panel */
.board-name-card {
  background: #ebdcc7;
  border: 2px solid #b8a287;
  border-radius: 16px;
  padding: 8px 12px;
  box-shadow: inset 0 2px 5px rgba(80, 50, 20, 0.15), 0 2px 4px rgba(255, 255, 255, 0.6);
  flex-shrink: 0;
}

.board-name-label {
  font-family: 'Outfit', sans-serif;
  font-size: 0.84rem;
  font-weight: 800;
  color: #3a1e0d;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
}

.name-input-row {
  display: flex;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.name-input-row input {
  flex: 1;
  min-width: 0;
  padding: 7px 12px;
  background: #fdfbf7;
  border: 2px solid #b8a287;
  border-radius: 12px;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.92rem;
  color: #1a3c63;
  outline: none;
  box-sizing: border-box;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.name-input-row input:focus {
  border-color: #1a3c63;
  background: #ffffff;
}

.btn-board-save {
  appearance: none;
  -webkit-appearance: none;
  background: linear-gradient(180deg, #15803d 0%, #166534 50%, #14532d 100%);
  color: #ffffff;
  border: 2px solid #052e16;
  border-radius: 12px;
  padding: 7px 16px;
  font-weight: 900;
  font-size: 1.05rem;
  font-family: 'Bebas Neue', 'Oswald', sans-serif;
  letter-spacing: 0.8px;
  cursor: pointer;
  box-shadow: 0 3px 0 #022c14, 0 4px 10px rgba(5, 46, 22, 0.3);
  text-shadow: 0 1.5px 2px rgba(2, 44, 20, 0.85);
  flex-shrink: 0;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.btn-board-save:hover {
  transform: translateY(-1px);
}

.btn-board-save:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #022c14;
}

/* Quick Stats Summary Badges */
.board-stats-summary {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.b-stat {
  flex: 1;
  background: #fdfbf7;
  border: 2px solid #d4c4ab;
  border-radius: 14px;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 2px 5px rgba(60, 35, 15, 0.08), inset 0 1px 1px rgba(255, 255, 255, 0.9);
}

.b-stat-label {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.8px;
  color: #876e50;
}

.b-stat-val {
  font-family: 'Bebas Neue', 'Oswald', sans-serif;
  font-size: 1.35rem;
  letter-spacing: 0.8px;
  color: #1a3c63;
  line-height: 1.1;
}

.b-stat-val.val-money {
  color: #15803d;
}

/* Leaderboard Table Container */
.leaderboard-table-container {
  background: #ebdcc7;
  border: 2px solid #b8a287;
  border-radius: 16px;
  overflow-y: auto;
  max-height: 38vh;
  box-shadow: inset 0 2px 6px rgba(80, 50, 20, 0.15), 0 2px 4px rgba(255, 255, 255, 0.6);
  padding: 5px;
  -webkit-overflow-scrolling: touch;
}

.leaderboard-table-container::-webkit-scrollbar {
  width: 5px;
}
.leaderboard-table-container::-webkit-scrollbar-track {
  background: #ebdcc7;
  border-radius: 10px;
}
.leaderboard-table-container::-webkit-scrollbar-thumb {
  background: #b8a287;
  border-radius: 10px;
}

.leaderboard-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 4px;
  font-size: 0.84rem;
}

.leaderboard-table thead th {
  font-family: 'Bebas Neue', 'Oswald', sans-serif;
  font-size: 0.88rem;
  letter-spacing: 1px;
  color: #5c432d;
  padding: 4px 8px;
  text-align: left;
  border-bottom: 1.5px solid #c7b59e;
}

.leaderboard-table thead th.score-col {
  text-align: right;
}

.leaderboard-table tbody tr {
  background: #fdfbf7;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(60, 35, 15, 0.08);
  transition: transform 0.1s ease;
}

.leaderboard-table tbody tr td {
  padding: 7px 10px;
  color: #3a1e0d;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
}

.leaderboard-table tbody tr td:first-child {
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}

.leaderboard-table tbody tr td:last-child {
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}

.leaderboard-table tbody tr.active-player-row {
  background: #fef3c7;
  outline: 2px solid #f59e0b;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}

.leaderboard-table tbody tr.active-player-row td {
  color: #78350f;
}

.rank-col {
  font-family: 'Bebas Neue', sans-serif !important;
  font-size: 1.05rem !important;
  letter-spacing: 0.5px;
  width: 52px;
  white-space: nowrap;
}

.name-col {
  white-space: nowrap;
}

.name-col .hawker-name-text {
  vertical-align: middle;
}

.score-col {
  text-align: right;
  font-family: 'Bebas Neue', 'Oswald', sans-serif !important;
  font-size: 1.15rem !important;
  letter-spacing: 0.5px;
  color: #15803d !important;
  white-space: nowrap;
  width: 78px;
}

.you-badge {
  display: inline-block;
  background: linear-gradient(180deg, #d97706 0%, #b45309 100%);
  color: #ffffff;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.8px;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.empty-board {
  text-align: center;
  padding: 16px !important;
  color: #8c765c !important;
  font-style: italic;
}

.board-modal-footer {
  margin-top: 6px;
  flex-shrink: 0;
}

/* ==========================================================================
   SETTINGS MODAL (ROYAL MATCH CASUAL 3D STYLE)
   ========================================================================== */
/* ==========================================================================
   SETTINGS MODAL (VINTAGE NANYANG KOPITIAM POSTER THEME)
   ========================================================================== */
.settings-modal-card {
  width: 92%;
  max-width: 360px;
  background: #f6f0e2 !important;
  border: 3.5px solid #876e50 !important;
  border-radius: 26px !important;
  box-shadow: 
    0 20px 48px rgba(30, 15, 5, 0.65),
    0 0 0 1.5px #af9673,
    inset 0 2px 4px rgba(255, 255, 255, 0.8) !important;
  padding: 18px 16px 14px 16px !important;
  color: #3a1e0d;
  position: relative;
  overflow: visible !important;
  max-height: 94vh;
}

.settings-modal-header {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  margin-bottom: 12px;
}

.settings-title-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.settings-title {
  font-size: 2.1rem;
  font-weight: 900;
  color: #1a3c63;
  font-family: 'Bebas Neue', 'Oswald', sans-serif;
  letter-spacing: 2.5px;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
  margin: 0;
  text-align: center;
}

.settings-chinese-subtitle {
  font-family: 'Noto Serif TC', serif;
  font-size: 0.95rem;
  font-weight: 900;
  color: #8b1e1b;
  letter-spacing: 3px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
  line-height: 1.2;
}

.settings-close-btn {
  position: absolute;
  right: -6px;
  top: -8px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2.5px solid #f6f0e2;
  background: linear-gradient(180deg, #c0392b 0%, #96281b 100%);
  color: #ffffff;
  font-size: 1.4rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 0 #5c140d, 0 6px 14px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.1s ease;
  line-height: 1;
}

.settings-close-btn:active {
  transform: scale(0.92);
}

.settings-toggles-card {
  background: #ebdcc7;
  border: 2px solid #b8a287;
  border-radius: 16px;
  padding: 10px 12px;
  box-shadow: inset 0 2px 6px rgba(80, 50, 20, 0.15), 0 2px 4px rgba(255, 255, 255, 0.6);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Audio Sliders Group */
.settings-sliders-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.volume-slider-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.volume-slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2px;
}

.volume-slider-label {
  font-size: 0.86rem;
  font-weight: 800;
  color: #3a1e0d;
  font-family: 'Outfit', sans-serif;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.volume-slider-label .volume-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.volume-percent-badge {
  font-size: 0.85rem;
  font-weight: 900;
  color: #1a3c63;
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.5px;
  background: #ffffff;
  padding: 1px 7px;
  border-radius: 7px;
  border: 1.5px solid #b8a287;
  min-width: 40px;
  text-align: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.slider-track-wrap {
  width: 100%;
  display: flex;
  align-items: center;
  height: 24px;
}

/* Range Input Styling - Retro Kopitiam Warm Brass/Gold & Dark Wood */
.kopitiam-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #2a180d;
  outline: none;
  margin: 0;
  border: 1.5px solid #6b4423;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(255, 255, 255, 0.4);
  touch-action: pan-y;
  cursor: pointer;
}

/* WebKit / Safari / iOS thumb */
.kopitiam-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fbbf24 0%, #d97706 100%);
  border: 2px solid #78350f;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.kopitiam-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.8);
}

.kopitiam-slider:active::-webkit-slider-thumb {
  transform: scale(1.15);
  background: linear-gradient(180deg, #fef08a 0%, #f59e0b 100%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

/* Firefox thumb */
.kopitiam-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fbbf24 0%, #d97706 100%);
  border: 2px solid #78350f;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45);
  cursor: pointer;
}

/* Firefox track */
.kopitiam-slider::-moz-range-track {
  height: 8px;
  border-radius: 4px;
  background: #2a180d;
  border: 1.5px solid #6b4423;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.settings-toggle-row {
  display: flex;
  justify-content: space-around;
  align-items: center;
  width: 100%;
}

.settings-toggle-row.row-secondary {
  padding-top: 6px;
  border-top: 1.5px dashed rgba(184, 162, 135, 0.7);
  justify-content: space-between;
}

.toggle-control-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.toggle-control-item.toggle-control-single {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0 4px;
}

.toggle-label {
  font-size: 0.88rem;
  font-weight: 800;
  color: #3a1e0d;
  font-family: 'Outfit', sans-serif;
  letter-spacing: 0.3px;
}

.setting-toggle-btn {
  appearance: none;
  -webkit-appearance: none;
  width: 72px;
  height: 32px;
  border-radius: 16px;
  border: 2px solid #0d2238;
  background: #1a3c63;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 8px;
  position: relative;
  cursor: pointer;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
  transition: background 0.15s ease, border-color 0.15s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.setting-toggle-btn .toggle-state-text {
  font-size: 0.9rem;
  font-weight: 900;
  color: #ffffff;
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 1px;
  user-select: none;
  pointer-events: none;
}

.setting-toggle-btn .toggle-knob {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fbbf24 0%, #d97706 100%);
  border: 2px solid #78350f;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
  position: absolute;
  left: calc(100% - 27px);
  transition: left 0.18s cubic-bezier(0.4, 0, 0.2, 1), background 0.15s ease;
  pointer-events: none;
}

.setting-toggle-btn.is-off {
  background: #b5aba0 !important;
  border-color: #8c8277 !important;
  justify-content: flex-end;
}

.setting-toggle-btn.is-off .toggle-knob {
  left: 3px !important;
  background: linear-gradient(180deg, #d1d5db 0%, #9ca3af 100%) !important;
  border-color: #6b7280 !important;
}

.setting-toggle-btn.is-off .toggle-state-text {
  color: #5c554e !important;
}

.settings-actions-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
}

.settings-action-btn {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Bebas Neue', 'Oswald', sans-serif;
  font-size: 1.35rem;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  box-sizing: border-box;
}

/* Button 1: Heritage Indigo Navy */
.settings-action-btn.btn-blue {
  background: linear-gradient(180deg, #2b5687 0%, #1a3c63 48%, #0f2742 100%);
  border: 2.5px solid #0d2238;
  color: #ffffff;
  box-shadow: 0 4px 0 #071320, 0 8px 18px rgba(10, 25, 45, 0.35);
  text-shadow: 0 1.5px 3px rgba(5, 15, 28, 0.85);
}

/* Button 2: Roasted Coffee Teak Brown */
.settings-action-btn.btn-green {
  background: linear-gradient(180deg, #15803d 0%, #166534 50%, #14532d 100%);
  border: 2.5px solid #052e16;
  color: #ffffff;
  box-shadow: 0 4px 0 #022c14, 0 8px 18px rgba(5, 46, 22, 0.35);
  text-shadow: 0 1.5px 3px rgba(2, 44, 20, 0.85);
}

/* Button 4: Amber Restart */
.settings-action-btn.btn-amber-pause {
  background: linear-gradient(180deg, #d97706 0%, #b45309 50%, #78350f 100%);
  border: 2.5px solid #451a03;
  color: #ffffff;
  box-shadow: 0 4px 0 #2e1002, 0 8px 18px rgba(120, 53, 15, 0.35);
  text-shadow: 0 1.5px 3px rgba(69, 26, 3, 0.85);
}

/* Button 5: Crimson Quit */
.settings-action-btn.btn-red {
  background: linear-gradient(180deg, #dc2626 0%, #b91c1c 50%, #7f1d1d 100%);
  border: 2.5px solid #450a0a;
  color: #ffffff;
  box-shadow: 0 4px 0 #330505, 0 8px 18px rgba(127, 29, 29, 0.35);
  text-shadow: 0 1.5px 3px rgba(69, 10, 10, 0.85);
}

.pause-level-info {
  background: #ffffff;
  border: 2px solid var(--primary-gold);
  border-radius: 14px;
  padding: 8px 14px;
  text-align: center;
  font-weight: 900;
  font-size: 0.95rem;
  color: var(--nanyang-darkblue);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  margin-bottom: 6px;
}

.btn-pause-highlight {
  border-color: #f59e0b !important;
  color: #b45309 !important;
}

.btn-pause-highlight:active {
  background: #fef3c7 !important;
}

.settings-action-btn:hover {
  transform: translateY(-2px);
}

.settings-action-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
}

.settings-action-btn .action-btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-modal-footer {
  text-align: center;
  margin-top: 14px;
}

.settings-modal-footer .version-tag {
  font-size: 0.95rem;
  font-weight: 900;
  font-family: 'Bebas Neue', 'Outfit', sans-serif;
  color: #7c6248;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

/* Restart Confirmation Modal Styling */
.restart-confirm-card {
  max-width: 360px !important;
  text-align: center;
  padding-bottom: 20px;
}

.restart-confirm-body-text {
  padding: 14px 8px 18px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.restart-warning-icon {
  font-size: 2.2rem;
  margin-bottom: 4px;
  animation: pulse 1.5s infinite ease-in-out;
}

.restart-confirm-prompt {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--nanyang-darkblue);
  margin: 0;
}

.restart-confirm-sub {
  font-family: 'Outfit', sans-serif;
  font-size: 0.84rem;
  font-weight: 600;
  color: #64748b;
  margin: 0;
  line-height: 1.35;
}

.restart-confirm-actions {
  display: flex;
  gap: 12px;
  width: 100%;
  margin-top: 6px;
}

.restart-confirm-actions .confirm-choice-btn {
  flex: 1;
  height: 48px;
  font-size: 1.35rem;
}

/* Feedback Modal Card Styling */
#feedback-modal {
  z-index: 100005 !important;
}

.feedback-card-content {
  background: #ebdcc7;
  border: 2px solid #b8a287;
  border-radius: 18px;
  padding: 16px 14px;
  box-shadow: inset 0 2px 6px rgba(80, 50, 20, 0.15), 0 2px 4px rgba(255, 255, 255, 0.6);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.feedback-desc {
  font-size: 0.95rem;
  font-weight: 700;
  color: #3a1e0d;
  line-height: 1.4;
  margin: 0;
  font-family: 'Outfit', sans-serif;
}

.feedback-email-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 2px solid #1a3c63;
  padding: 8px 16px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.support-email-address {
  font-family: var(--font-family);
  font-size: 1.05rem;
  color: #1a3c63;
  font-weight: 800;
  letter-spacing: 0.5px;
}

/* ==========================================================================
   8. AGENTIC UI/UX OPTIMIZER MODAL & MODES
   ========================================================================== */
.ux-score-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #ffffff;
  border: 2px solid var(--nanyang-blue);
  padding: 14px;
  border-radius: 18px;
  margin-bottom: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.ux-score-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  border: 2px solid #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #1c1005;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.ux-score-circle span { font-size: 1.6rem; font-weight: 900; line-height: 1; }
.ux-score-circle small { font-size: 0.6rem; font-weight: 900; text-transform: uppercase; }

.ux-breakdown-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 700;
}

.ux-metric-row {
  display: flex;
  justify-content: space-between;
  color: var(--nanyang-darkblue);
}

.ux-sub-title {
  font-size: 0.95rem;
  color: var(--nanyang-blue);
  margin-bottom: 4px;
  font-weight: 900;
}

.ux-mode-desc {
  font-size: 0.78rem;
  color: #475569;
  margin-bottom: 10px;
  font-weight: 600;
}

.ux-mode-selector {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.ux-mode-btn {
  background: #ffffff;
  border: 2px solid var(--nanyang-blue);
  border-radius: 14px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.ux-mode-btn strong { font-size: 0.88rem; color: var(--nanyang-darkblue); }
.ux-mode-btn small { font-size: 0.72rem; color: #64748b; }

.ux-mode-btn.active-ux-mode {
  border-color: var(--primary-gold);
  background: rgba(245, 158, 11, 0.12);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25);
}

.ux-audit-details-box {
  background: rgba(15, 56, 107, 0.06);
  border: 1.5px solid var(--nanyang-blue);
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 0.76rem;
}

.ux-audit-details-box h4 { font-size: 0.82rem; color: var(--nanyang-blue); margin-bottom: 2px; font-weight: 800; }
.ux-audit-details-box p { color: #334155; font-weight: 600; }

/* UX MODE: ENHANCED THUMB-ZONE ERGONOMICS */
body.ux-mode-thumb .action-btn {
  min-height: 48px;
  padding: 10px 6px;
  border-width: 2.5px;
}

body.ux-mode-thumb #bottom-action-bar {
  padding-bottom: 20px;
}

body.ux-mode-thumb .vintage-cta-btn {
  padding: 18px;
  font-size: 1.3rem;
}

/* UX MODE: HIGH CONTRAST SUNLIGHT OUTDOOR PLAY */
body.ux-mode-contrast .glass-card,
body.ux-mode-contrast .modal-card,
body.ux-mode-contrast .vintage-brand-title {
  background: #ffffff !important;
  border: 3px solid #000000 !important;
  box-shadow: 0 6px 0px #000000 !important;
}

body.ux-mode-contrast .nanyang-header,
body.ux-mode-contrast .kopikia-header {
  color: #000000 !important;
}

body.ux-mode-contrast .chinese-calligraphy {
  color: #b91c1c !important;
}

#toast-container {
  position: absolute;
  bottom: 125px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 6px;
  width: 85%;
  max-height: 100px;
  overflow: hidden;
  pointer-events: none !important;
}

.toast {
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(239, 68, 68, 0.6);
  color: #fecaca;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  animation: popToast 0.3s ease, fadeOutToast 0.4s ease 1.8s forwards;
  text-align: center;
}

.toast-success { border-color: rgba(34, 197, 94, 0.6); color: #bbf7d0; }

/* ==========================================================================
   9. CINEMATIC BOOT SPLASH SEQUENCE (TICTACS SOFTWARE & COVER ART)
   ========================================================================== */
.splash-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #f7f6f0;
  z-index: 100000 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: inherit;
  transition: opacity 0.5s ease-out;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.splash-overlay.splash-fade-out {
  opacity: 0;
  pointer-events: none !important;
}

.splash-overlay.hidden {
  display: none !important;
  pointer-events: none !important;
}

.splash-step {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 0;
  left: 0;
  transition: opacity 0.4s ease-in-out;
}

.splash-step.splash-fade-out {
  opacity: 0;
  pointer-events: none !important;
}

.splash-step.splash-fade-in {
  opacity: 1;
}

#splash-studio-screen {
  background: #f7f6f0;
}

.studio-logo-img {
  width: 75%;
  max-width: 290px;
  height: auto;
  animation: splashPulse 1.8s ease-in-out infinite alternate;
}

#splash-cover-screen {
  background: #111827;
}

.splash-cover-art {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('assets/sprites/kopi_cover_portrait.jpg');
  background-size: cover;
  background-position: center top;
  filter: brightness(0.98);
}

.splash-cover-content {
  position: absolute;
  bottom: calc(env(safe-area-inset-bottom, 20px) + 36px);
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.splash-tap-prompt {
  font-family: var(--font-family);
  font-size: clamp(1rem, 3.8vw, 1.25rem);
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 2.5px;
  background: linear-gradient(135deg, rgba(15, 33, 66, 0.95), rgba(30, 58, 102, 0.95));
  padding: 14px 34px;
  border-radius: 40px;
  border: 2.5px solid var(--primary-gold);
  animation: promptPulse 1.2s ease-in-out infinite alternate;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(217, 119, 6, 0.4);
  white-space: nowrap;
  cursor: pointer;
  outline: none;
}

@keyframes splashPulse {
  0% { transform: scale(0.96); opacity: 0.88; }
  100% { transform: scale(1.02); opacity: 1; }
}

@keyframes promptPulse {
  0% { opacity: 0.85; transform: scale(0.97); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5); }
  100% { opacity: 1; transform: scale(1.03); box-shadow: 0 12px 36px rgba(217, 119, 6, 0.6); }
}

/* ==========================================================================
   10. AFK JOURNEY STYLED NARRATIVE DIALOGUE & TUTORIAL OVERLAYS
   ========================================================================== */
.story-afk-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at center, rgba(15, 23, 42, 0.7) 0%, rgba(5, 10, 20, 0.88) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: env(safe-area-inset-top, 16px) 16px env(safe-area-inset-bottom, 20px) 16px;
  box-sizing: border-box;
  touch-action: manipulation;
  animation: afkFadeIn 0.25s ease-out forwards;
}

.story-afk-overlay.hidden {
  display: none !important;
  pointer-events: none !important;
}

@keyframes afkFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Top Bar: Chapter Title & Dev Back */
.story-afk-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 8px 8px;
}

.btn-story-dev-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border: 1.5px solid #38bdf8;
  border-radius: 18px;
  padding: 6px 12px;
  color: #ffffff;
  font-family: 'Outfit', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
  z-index: 100;
}

.btn-story-dev-back:active {
  transform: scale(0.95);
  background: #0284c7;
}

.btn-story-dev-back.hidden {
  display: none !important;
}

.story-afk-chapter-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(30, 41, 59, 0.75);
  border: 1.5px solid rgba(251, 191, 36, 0.6);
  border-radius: 20px;
  padding: 6px 14px;
  color: #fef3c7;
  font-family: 'Outfit', sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.story-afk-chapter-pill.story-chapter-stretched {
  flex: 1;
  min-width: 0;
  width: auto;
  justify-content: center;
  text-align: center;
  padding: 8px 12px;
  font-size: 0.82rem;
  letter-spacing: 0.6px;
}

#story-chapter-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Player Name Input Inside Narrative Dialogue */
.story-name-input-container {
  margin-top: 12px;
  width: 100%;
}

.story-name-input-wrap {
  display: flex;
  gap: 8px;
  width: 100%;
}

.story-name-input {
  flex: 1;
  height: 46px;
  background: #ffffff;
  border: 2px solid #b45309;
  border-radius: 12px;
  padding: 0 14px;
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a3c63;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.story-name-input:focus {
  border-color: #d97706;
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.25), inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.story-name-submit-btn {
  appearance: none;
  -webkit-appearance: none;
  height: 46px;
  padding: 0 18px;
  border-radius: 12px;
  background: linear-gradient(180deg, #16a34a 0%, #15803d 100%);
  border: 2px solid #14532d;
  color: #ffffff;
  font-family: 'Bebas Neue', 'Oswald', sans-serif;
  font-size: 1.25rem;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 3px 0 #052e16, 0 4px 10px rgba(22, 163, 74, 0.35);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.story-name-submit-btn:hover {
  transform: translateY(-1px);
}

.story-name-submit-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #052e16;
}

.chapter-star-icon {
  color: #fbbf24;
  font-size: 0.85rem;
}

.btn-afk-skip {
  appearance: none;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(6px);
  border-radius: 18px;
  padding: 6px 14px;
  color: #ffffff;
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: all 0.15s ease;
}

.btn-afk-skip:active {
  transform: scale(0.94);
  background: rgba(255, 255, 255, 0.3);
}

/* Character Bust Stage */
.story-afk-character-stage {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  pointer-events: none;
}

.character-bust-container {
  width: 240px;
  height: 280px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.5));
  animation: bustEnter 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes bustEnter {
  0% { opacity: 0; transform: translateY(30px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.story-afk-avatar {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

.story-afk-avatar[src$=".png"] {
  border-radius: 0;
}

/* Curved Parchment Dialogue Card */
.story-afk-dialogue-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  background: #fdfaf3;
  background-image: radial-gradient(circle at top right, rgba(251, 191, 36, 0.1) 0%, transparent 60%);
  border: 3px solid #876e50;
  border-radius: 24px;
  padding: 16px 18px 14px 18px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), inset 0 2px 4px rgba(255, 255, 255, 0.8);
  box-sizing: border-box;
  cursor: pointer;
  user-select: none;
  animation: cardSlideUp 0.3s ease-out forwards;
}

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

.dialogue-speaker-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 8px;
}

.speaker-name {
  font-family: 'Outfit', -apple-system, sans-serif;
  font-size: 1.2rem;
  font-weight: 900;
  color: #1a3c63;
  margin: 0;
  letter-spacing: 0.2px;
}

.speaker-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  color: #854d0e;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.speaker-divider {
  width: 42px;
  height: 3px;
  background: linear-gradient(90deg, #d97706, #fbbf24);
  border-radius: 2px;
  margin-top: 4px;
}

.dialogue-speech-body {
  min-height: 58px;
  display: flex;
  align-items: center;
}

.speech-text {
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 0.98rem;
  font-weight: 700;
  color: #2b1f17;
  line-height: 1.45;
  margin: 0;
}

/* Highlighted Text Styles */
.hl-gold {
  color: #b45309;
  font-weight: 900;
  background: rgba(251, 191, 36, 0.2);
  padding: 1px 4px;
  border-radius: 4px;
}

.hl-blue {
  color: #1d4ed8;
  font-weight: 900;
  background: rgba(59, 130, 246, 0.15);
  padding: 1px 4px;
  border-radius: 4px;
}

.hl-red {
  color: #b91c1c;
  font-weight: 900;
  background: rgba(239, 68, 68, 0.15);
  padding: 1px 4px;
  border-radius: 4px;
}

/* Dialogue Card Footer */
.dialogue-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1.5px dashed rgba(135, 110, 80, 0.3);
}

.dialogue-meta-left {
  flex: 1;
  min-width: 0;
}

.dialogue-unlock-notice {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  color: #78350f;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 3px 8px;
  line-height: 1.25;
}

.dialogue-tap-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #8c7355;
  flex-shrink: 0;
}

.tap-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.8px;
}

.bouncing-chevron {
  display: flex;
  align-items: center;
  animation: bounceDown 1.2s infinite ease-in-out;
}

@keyframes bounceDown {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

/* ==========================================================================
   11. LIVE RECIPE CHECKLIST HUD & TUTORIAL COACHING
   ========================================================================== */
.recipe-checklist-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.checklist-tag {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.08);
  color: #4b5563;
  border: 1px solid rgba(0, 0, 0, 0.1);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: all 0.2s ease;
}

.checklist-tag.is-done {
  background: #dcfce7 !important;
  color: #15803d !important;
  border-color: #86efac !important;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.35);
  transform: scale(1.04);
}

/* ==========================================================================
   ROYAL MATCH STYLE FTUE SPOTLIGHT TUTORIAL STYLING
   ========================================================================== */
.tutorial-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 8000;
  pointer-events: auto; /* Block background clicks */
  transition: opacity 0.3s ease;
}

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

#tutorial-mask-cutout {
  transition: x 0.25s cubic-bezier(0.2, 0.8, 0.2, 1),
              y 0.25s cubic-bezier(0.2, 0.8, 0.2, 1),
              width 0.25s cubic-bezier(0.2, 0.8, 0.2, 1),
              height 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Glowing Beacon Box around Cutout */
.tutorial-spotlight-beacon {
  position: fixed;
  z-index: 8100;
  border: 3px solid #fbbf24;
  border-radius: 16px;
  box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.35), 0 0 24px rgba(251, 191, 36, 0.85);
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  animation: beaconPulse 1.4s infinite alternate ease-in-out;
}

@keyframes beaconPulse {
  0% {
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.3), 0 0 16px rgba(251, 191, 36, 0.7);
    border-color: #fbbf24;
  }
  100% {
    box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.5), 0 0 30px rgba(245, 158, 11, 0.95);
    border-color: #f59e0b;
  }
}

/* Floating Royal Match-Style Speech Bubble */
.tutorial-floating-bubble {
  position: fixed;
  z-index: 8500;
  width: calc(100% - 32px);
  max-width: 380px;
  background: #fffdfa;
  border: 2.5px solid #b45309;
  border-radius: 20px;
  padding: 12px 14px 12px 64px; /* Left padding accommodates overlapping avatar */
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(251, 191, 36, 0.3);
  pointer-events: auto;
  transition: top 0.25s cubic-bezier(0.2, 0.8, 0.2, 1),
              left 0.25s cubic-bezier(0.2, 0.8, 0.2, 1),
              opacity 0.2s ease,
              transform 0.2s ease;
  animation: bubblePop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bubblePop {
  0% { opacity: 0; transform: scale(0.88); }
  100% { opacity: 1; transform: scale(1); }
}

.tutorial-bubble-avatar-wrap {
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 3px solid #fbbf24;
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tutorial-bubble-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tutorial-bubble-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tutorial-bubble-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tutorial-bubble-speaker {
  font-family: 'Outfit', sans-serif;
  font-size: 0.86rem;
  font-weight: 900;
  color: #1a3c63;
  letter-spacing: 0.3px;
}

.tutorial-bubble-badge {
  font-family: 'Outfit', sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  background: #fef3c7;
  color: #b45309;
  padding: 2px 8px;
  border-radius: 8px;
  border: 1px solid #fde68a;
  letter-spacing: 0.5px;
}

.tutorial-bubble-text {
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: #2b1f17;
  line-height: 1.35;
}

.tutorial-bubble-text strong {
  color: #b45309;
  font-weight: 900;
}

.tutorial-bubble-text em {
  font-style: normal;
  color: #dc2626;
  font-weight: 800;
}

/* Action Button in Bubble (For Narrative Next Steps - Matching Video End Card Primary Button) */
.tutorial-bubble-btn {
  margin-top: 6px;
  align-self: flex-end;
  appearance: none;
  -webkit-appearance: none;
  background: linear-gradient(180deg, #16a34a 0%, #15803d 50%, #166534 100%);
  border: 2px solid #14532d;
  color: #ffffff;
  border-radius: 12px;
  height: 42px;
  padding: 0 16px;
  font-family: 'Bebas Neue', 'Oswald', sans-serif;
  font-size: 1.18rem;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 3px 0 #052e16, 0 4px 14px rgba(22, 163, 74, 0.4);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.tutorial-bubble-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #052e16;
}

.tutorial-bubble-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex-shrink: 0;
}

/* Speech Arrow */
.tutorial-bubble-arrow {
  position: absolute;
  width: 16px;
  height: 16px;
  background: #fffdfa;
  border-style: solid;
  border-color: #b45309;
  transform: rotate(45deg);
}

.tutorial-bubble-arrow.arrow-bottom {
  bottom: -9px;
  left: 50%;
  border-width: 0 2.5px 2.5px 0;
}

.tutorial-bubble-arrow.arrow-top {
  top: -9px;
  left: 50%;
  border-width: 2.5px 0 0 2.5px;
}

/* Glowing Target Outline (for illuminated buttons to receive touches) */
.tutorial-target-glow {
  position: relative;
  z-index: 8500 !important;
  pointer-events: auto !important;
}

/* Floating Pointer Hand */
.tutorial-pointer {
  position: fixed;
  z-index: 8600;
  pointer-events: none;
  transition: top 0.25s cubic-bezier(0.2, 0.8, 0.2, 1),
              left 0.25s cubic-bezier(0.2, 0.8, 0.2, 1),
              opacity 0.2s ease;
}

.pointer-hand-graphic {
  width: 50px;
  height: 50px;
  display: block;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.6));
  animation: pointerBounce 0.7s infinite alternate ease-in-out;
  pointer-events: none;
}

@keyframes pointerBounce {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-12px) scale(1.08); }
}

.countdown-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100000 !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

.countdown-overlay.hidden {
  display: none !important;
}

.countdown-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: countdownPop 0.4s ease;
}

.countdown-num {
  font-family: var(--font-display);
  font-size: 5rem;
  font-weight: 900;
  color: var(--primary-gold);
  text-shadow: 0 4px 20px rgba(245, 158, 11, 0.6);
}

.countdown-text {
  font-family: var(--font-family);
  font-size: 1.2rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 3px;
}

@keyframes countdownPop {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   11. VECTOR SVG ICONS & PREMIUM RESULT BUTTON STYLING
   ========================================================================== */
.svg-icon {
  display: inline-block;
  width: 1.2em;
  height: 1.2em;
  vertical-align: -0.18em;
  fill: currentColor;
  flex-shrink: 0;
}

.icon-star {
  color: var(--primary-gold);
  filter: drop-shadow(0 2px 4px rgba(245, 158, 11, 0.4));
}

.star-big .icon-star {
  width: 38px;
  height: 38px;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.star-empty .icon-star {
  color: #cbd5e1;
  filter: none;
  opacity: 0.4;
}

.icon-title-badge {
  width: 32px;
  height: 32px;
  vertical-align: -0.22em;
  margin-right: 6px;
}

.icon-break-badge {
  color: #dc2626;
  filter: drop-shadow(0 4px 10px rgba(220, 38, 38, 0.3));
}

.icon-victory-badge {
  color: #f59e0b;
  filter: drop-shadow(0 4px 10px rgba(245, 158, 11, 0.4));
}

/* Modal Result Action Buttons */
.result-btn-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 20px;
  width: 100%;
}

.result-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 16px;
  font-family: var(--font-family);
  font-weight: 900;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: 0.5px;
}

.result-btn.secondary-btn {
  background: #ffffff;
  border: 2px solid var(--nanyang-blue);
  color: var(--nanyang-blue);
  box-shadow: 0 4px 12px rgba(15, 56, 107, 0.12);
}

.result-btn.secondary-btn:hover {
  background: #f1f5f9;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(15, 56, 107, 0.18);
}

.result-btn.primary-result-btn {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  border: 2px solid var(--nanyang-darkblue);
  color: var(--nanyang-darkblue);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.35);
}

.result-btn.primary-result-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 22px rgba(245, 158, 11, 0.45);
}

/* Recipe Guide Categorized Modal Styling */
.recipe-guide-card {
  max-width: 390px;
  max-height: 85vh;
  overflow-y: auto;
}

.recipe-guide-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 4px;
}

.recipe-category {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.recipe-cat-title {
  font-family: var(--font-family);
  font-size: 0.98rem;
  font-weight: 900;
  color: var(--nanyang-darkblue);
  border-bottom: 2px solid var(--primary-gold);
  padding-bottom: 4px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.5px;
}

.recipe-cards-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.recipe-card-item {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 0.84rem;
  line-height: 1.35;
  color: #334155;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.recipe-card-item strong {
  color: var(--nanyang-blue);
  font-weight: 800;
}

/* ==========================================================================
   FULLSCREEN INTRO PROLOGUE VIDEO OVERLAY
   ========================================================================== */
.intro-video-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.intro-video-overlay .video-container {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000000;
}

.intro-video-overlay video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.btn-skip-video {
  position: absolute;
  top: calc(18px + env(safe-area-inset-top, 0px));
  right: 18px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  color: #ffffff;
  border-radius: 20px;
  padding: 6px 14px;
  font-family: 'Bebas Neue', 'Oswald', sans-serif;
  font-size: 1.1rem;
  letter-spacing: 1px;
  cursor: pointer;
  z-index: 100;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  transition: transform 0.1s ease, background 0.2s ease;
}

.btn-skip-video:active {
  transform: scale(0.92);
  background: rgba(15, 23, 42, 0.95);
}

/* Subtitles Bar (Cinematic Singlish Dialogue) */
.intro-subtitles-bar {
  position: absolute;
  bottom: calc(32px + env(safe-area-inset-bottom, 0px));
  left: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  padding: 8px 14px;
  text-align: center;
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  z-index: 90;
  pointer-events: none;
  animation: subFadeIn 0.2s ease forwards;
}

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

.subtitle-speaker-badge {
  display: inline-block;
  font-family: 'Bebas Neue', 'Oswald', sans-serif;
  font-size: 0.95rem;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--primary-gold);
  margin: 0 auto 4px auto;
  text-align: center;
}

.subtitle-text {
  display: block;
  text-align: center;
  font-family: var(--font-family);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.4;
  color: #ffffff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
  word-wrap: break-word;
}

.sub-sprite-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 4px;
  vertical-align: -4px;
  display: inline-block;
  margin-right: 6px;
}

.sub-action-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.sub-action-sprite {
  width: 30px;
  height: 30px;
  object-fit: contain;
  border-radius: 6px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.sub-action-icon-rush {
  color: var(--primary-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sub-action-text {
  text-align: center;
  font-family: var(--font-family);
  font-size: 1.02rem;
  font-weight: 800;
  font-style: italic;
  line-height: 1.35;
  color: #ffffff;
  display: inline-block;
}

.sub-icon-rush {
  color: var(--primary-gold);
  display: inline-flex;
  vertical-align: -3px;
  margin-right: 6px;
}

.sub-glossary {
  color: #fef08a;
  display: inline;
}

.sub-loud {
  color: #f87171;
  font-weight: 900;
  letter-spacing: 0.5px;
  display: inline;
}

/* ==========================================================================
   VIDEO END ACTION CARD (CENTERED FREEZE FRAME MODAL)
   ========================================================================== */
.intro-video-end-actions {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px 20px;
  z-index: 120;
  animation: endCardFadeIn 0.35s ease forwards;
}

@keyframes endCardFadeIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.video-end-card {
  width: 100%;
  max-width: 345px;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 2px solid var(--primary-gold);
  border-radius: 24px;
  padding: 20px 16px 18px 16px;
  text-align: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.9);
}

.video-end-avatar-wrap {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2.5px solid var(--primary-gold);
  background: #ffffff;
  overflow: hidden;
  margin: -40px auto 10px auto;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-end-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-end-title {
  font-family: 'Bebas Neue', 'Oswald', 'Outfit', sans-serif;
  font-size: 1.45rem;
  letter-spacing: 0.8px;
  color: var(--primary-gold);
  margin: 0 0 4px 0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.video-end-subtitle {
  font-family: var(--font-family);
  font-size: 0.88rem;
  font-weight: 600;
  color: #e2e8f0;
  margin: 0 0 16px 0;
  line-height: 1.35;
}

.video-end-btn-group {
  display: flex;
  gap: 8px;
  width: 100%;
}

.video-end-btn {
  appearance: none;
  -webkit-appearance: none;
  flex: 1;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-family: 'Bebas Neue', 'Oswald', sans-serif;
  font-size: 1.15rem;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.video-end-btn.btn-secondary {
  background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
  border: 2px solid #475569;
  color: #ffffff;
  box-shadow: 0 3px 0 #0f172a;
}

.video-end-btn.btn-primary {
  background: linear-gradient(180deg, #16a34a 0%, #15803d 50%, #166534 100%);
  border: 2px solid #14532d;
  color: #ffffff;
  box-shadow: 0 4px 0 #052e16, 0 6px 16px rgba(22, 163, 74, 0.4);
}

.video-end-btn:hover {
  transform: translateY(-2px);
}

.video-end-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   RESET PROGRESS CONFIRMATION MODAL
   ========================================================================== */
.reset-modal-card {
  max-width: 320px;
  background: #fff8ee;
  border: 3px solid #dc2626;
  border-radius: 24px;
  padding: 24px 20px 20px 20px;
  text-align: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  animation: modalScaleIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.reset-icon-badge {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #fee2e2;
  border: 2px solid #ef4444;
  color: #dc2626;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px auto;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

.reset-modal-title {
  font-family: 'Bebas Neue', 'Oswald', sans-serif;
  font-size: 1.6rem;
  letter-spacing: 1.5px;
  color: #991b1b;
  margin: 0 0 8px 0;
}

.reset-modal-desc {
  font-family: var(--font-family);
  font-size: 0.92rem;
  font-weight: 600;
  color: #4b5563;
  line-height: 1.4;
  margin: 0 0 8px 0;
}

.reset-modal-warning {
  font-family: var(--font-family);
  font-size: 0.88rem;
  font-weight: 800;
  color: #dc2626;
  margin: 0 0 16px 0;
}

.reset-modal-btn-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.reset-action-btn {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bebas Neue', 'Oswald', sans-serif;
  font-size: 1.3rem;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.btn-cancel-reset {
  background: linear-gradient(180deg, #2b5687 0%, #1a3c63 100%);
  border: 2px solid #0d2238;
  color: #ffffff;
  box-shadow: 0 3px 0 #071320;
}

.btn-confirm-reset {
  background: linear-gradient(180deg, #dc2626 0%, #b91c1c 50%, #991b1b 100%);
  border: 2px solid #7f1d1d;
  color: #ffffff;
  box-shadow: 0 4px 0 #450a0a, 0 6px 16px rgba(220, 38, 38, 0.35);
}

.reset-action-btn:hover {
  transform: translateY(-2px);
}

.reset-action-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   THE KOPI KIA JOURNEY (BRIGHT CONTINUOUS SAGA MAP)
   ========================================================================== */
.kopi-journey-viewport {
  position: relative;
  width: 100vw;
  max-width: 480px;
  height: 100vh;
  background: #fdf8f0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.4);
}

/* Real Live Header Covering Top Edge */
.journey-sticky-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 8px 10px;
  background: linear-gradient(180deg, rgba(254, 243, 199, 0.96) 0%, rgba(254, 243, 199, 0.85) 75%, rgba(254, 243, 199, 0) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: auto;
}

.journey-header-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--nanyang-darkblue);
  color: var(--nanyang-darkblue);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.1s ease;
}

.journey-header-btn:active {
  transform: scale(0.92);
}

.journey-title-signboard {
  background: linear-gradient(180deg, #92400e 0%, #78350f 100%);
  border: 2px solid #f59e0b;
  border-radius: 12px;
  padding: 4px 10px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 1;
  min-width: 0;
}

.signboard-text {
  font-family: 'Bebas Neue', 'Oswald', sans-serif;
  font-size: 1.02rem;
  letter-spacing: 1.1px;
  color: #fef3c7;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.journey-stats-pill {
  background: rgba(255, 255, 255, 0.96);
  border: 1.5px solid var(--primary-gold);
  border-radius: 16px;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  color: #1e3a8a;
  font-weight: 900;
  font-size: 0.74rem;
  flex-shrink: 0;
}

.journey-stats-pill .stat-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.journey-stats-pill .stat-divider {
  width: 1px;
  height: 12px;
  background: #cbd5e1;
}

/* Scroll Canvas with Authentic Hainanese Kopitiam Wooden Counter */
.journey-scroll-canvas {
  flex: 1;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  position: relative;
  scroll-behavior: smooth;
  background-color: #3b200e;
  background-image: url('assets/sprites/journey_map_hainanese_wood_bg.jpg');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: top center;
}

.journey-canvas-content {
  position: relative;
  width: 100%;
  min-height: 2200px;
  padding: 0;
}

/* SVG Connecting Track Line */
.journey-svg-track {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.track-underlay {
  fill: none;
  stroke: rgba(120, 53, 15, 0.35);
  stroke-width: 16px;
  stroke-linecap: round;
  filter: blur(2px);
}

.track-main {
  fill: none;
  stroke: #92400e;
  stroke-width: 10px;
  stroke-linecap: round;
}

.track-dash {
  fill: none;
  stroke: #fde047;
  stroke-width: 4.5px;
  stroke-dasharray: 8 9;
  stroke-linecap: round;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}

/* Nodes Layer */
.journey-nodes-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
}

.journey-node-wrapper {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  z-index: 10;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.journey-node-wrapper:active {
  transform: translate(-50%, -50%) scale(0.94);
}

/* Diorama-as-Level-Node Frame */
.journey-node-diorama-frame {
  position: relative;
  width: 106px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.2s ease;
}

.journey-node-diorama-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.38));
  transition: transform 0.2s ease, filter 0.2s ease;
}

.journey-node-wrapper:hover .journey-node-diorama-frame {
  transform: scale(1.06);
}

.journey-node-lvl-tag {
  position: absolute;
  top: -2px;
  left: -2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);
  border: 2px solid #ffffff;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bebas Neue', 'Oswald', sans-serif;
  font-size: 1.15rem;
  color: #ffffff;
  line-height: 1;
  z-index: 5;
}

/* Tutorial Node: Uncle Kai Training Apprentice Emblem */
.journey-node-stall-disc {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background-image: url('assets/sprites/training_stall_apprentice_badge.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45));
  display: flex;
  align-items: center;
  justify-content: center;
}

.journey-node-stall-disc .node-number {
  font-size: 1.8rem;
}

/* 1. Unlocked & Completed Stages */
.journey-node-wrapper.is-completed .journey-node-lvl-tag {
  background: linear-gradient(135deg, #22c55e 0%, #15803d 100%);
}

/* 2. Active Stage (Glowing Golden Aura) */
.journey-node-wrapper.is-active .journey-node-diorama-img {
  filter: drop-shadow(0 0 16px rgba(245, 158, 11, 0.95)) drop-shadow(0 8px 16px rgba(0, 0, 0, 0.45));
  animation: activeDioramaGlow 2s infinite ease-in-out;
}

.journey-node-wrapper.is-active .journey-node-stall-disc {
  filter: drop-shadow(0 0 16px rgba(245, 158, 11, 0.95)) drop-shadow(0 8px 16px rgba(0, 0, 0, 0.45));
  animation: activeDioramaGlow 2s infinite ease-in-out;
}

@keyframes activeDioramaGlow {
  0%, 100% {
    filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.7)) drop-shadow(0 6px 12px rgba(0, 0, 0, 0.4));
  }
  50% {
    filter: drop-shadow(0 0 22px rgba(245, 158, 11, 1)) drop-shadow(0 8px 18px rgba(0, 0, 0, 0.5));
  }
}

/* 3. Locked Stages (Dimmed, Desaturated with Center Lock Badge) */
.journey-node-wrapper.is-locked .journey-node-diorama-img {
  filter: grayscale(0.7) brightness(0.65) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.25));
  opacity: 0.8;
}

.journey-node-wrapper.is-locked .journey-node-lvl-tag {
  background: linear-gradient(135deg, #64748b 0%, #475569 100%);
  color: #94a3b8;
  border-color: #cbd5e1;
}

.journey-node-lock-tag {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.78);
  border: 2px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  z-index: 6;
  backdrop-filter: blur(2px);
}

.journey-node-lock-tag .node-lock-icon {
  width: 17px;
  height: 17px;
  color: #f8fafc;
}

/* Active Avatar Token Bobbing on Top */
.active-token-avatar {
  position: absolute;
  top: -34px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffffff;
  border: 2.5px solid var(--primary-gold);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: tokenBob 1.2s infinite alternate ease-in-out;
  z-index: 10;
}

.active-token-avatar img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.active-halo-ring {
  position: absolute;
  top: -8px;
  left: -8px;
  right: -8px;
  bottom: -8px;
  border-radius: 50%;
  border: 2.5px dashed #facc15;
  animation: haloSpin 8s linear infinite;
  pointer-events: none;
}

@keyframes activeSaucerPulse {
  0%, 100% {
    filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.7)) drop-shadow(0 6px 12px rgba(0, 0, 0, 0.4));
  }
  50% {
    filter: drop-shadow(0 0 22px rgba(245, 158, 11, 1)) drop-shadow(0 8px 18px rgba(0, 0, 0, 0.5));
  }
}

@keyframes tokenBob {
  0% { transform: translateY(0); }
  100% { transform: translateY(-7px); }
}

@keyframes haloSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* 3. Locked Stages (Dimmed Saucer with 3D Silver Padlock) */
.journey-node-wrapper.is-locked .journey-node-disc {
  filter: brightness(0.65) grayscale(0.4) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.25));
  opacity: 0.9;
}

.journey-node-wrapper.is-locked .node-lock-icon {
  width: 26px;
  height: 26px;
  color: #ffffff;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.9));
}

/* Tutorial Node: Uncle Kai Training Apprentice Emblem */
.journey-node-wrapper.is-tutorial .journey-node-disc {
  width: 88px;
  height: 88px;
  background-image: url('assets/sprites/training_stall_apprentice_badge.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45));
}

.journey-node-wrapper.is-tutorial .node-number {
  display: none;
}

/* Stall Name Signboard Badge */
.journey-node-badge {
  margin-top: 6px;
  background: #ffffff;
  border: 1.5px solid #d97706;
  border-radius: 10px;
  padding: 2px 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  max-width: 180px;
}

.journey-node-badge span {
  font-size: 0.68rem;
  font-weight: 900;
  color: #78350f;
  text-overflow: ellipsis;
  overflow: hidden;
}

.journey-node-wrapper.is-locked .journey-node-badge {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.journey-node-wrapper.is-locked .journey-node-badge span {
  color: #64748b;
}

/* Star Rating Under Node */
.journey-node-stars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  margin-top: 3px;
}

.journey-node-stars .svg-star {
  width: 14px;
  height: 14px;
}

/* Decorative Props Layer */
.journey-props-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}

.journey-prop-img {
  position: absolute;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.28));
  pointer-events: none;
}

/* Handcrafted Landmark Dioramas Layer */
.journey-dioramas-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 6;
  pointer-events: none;
}

.journey-diorama-sprite {
  position: absolute;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.38));
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
}

.journey-diorama-sprite:active {
  transform: translate(-50%, -50%) scale(0.92);
}

.journey-diorama-sprite:hover {
  transform: translate(-50%, -50%) scale(1.06);
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.45));
}

.journey-diorama-sprite.is-locked {
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.3)) saturate(0.85) brightness(0.92);
}

/* Floating Quick Snap FAB */
.journey-snap-fab {
  position: absolute;
  bottom: 24px;
  right: 18px;
  z-index: 90;
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
  border: 2.5px solid #ffffff;
  border-radius: 26px;
  padding: 4px 14px 4px 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35), 0 0 15px rgba(245, 158, 11, 0.5);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.journey-snap-fab:active {
  transform: scale(0.92);
}

.snap-fab-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ffffff;
  border: 1.5px solid #78350f;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.snap-fab-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.snap-fab-label {
  font-family: 'Bebas Neue', 'Oswald', sans-serif;
  font-size: 1.1rem;
  letter-spacing: 1px;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* Briefing Bottom Sheet */
.journey-briefing-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  animation: fadeInBriefing 0.2s ease-out;
}

@keyframes fadeInBriefing {
  from { opacity: 0; }
  to { opacity: 1; }
}

.briefing-card {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border-radius: 24px;
  padding: 22px 20px 18px 20px;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.35);
  border: 2.5px solid var(--primary-gold);
  position: relative;
  text-align: center;
  animation: slideUpBriefing 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

.briefing-close-btn {
  position: absolute;
  top: 12px;
  right: 14px;
  background: #f1f5f9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.4rem;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.briefing-badge {
  display: inline-block;
  background: var(--nanyang-darkblue);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 900;
  padding: 3px 12px;
  border-radius: 12px;
  letter-spacing: 1.2px;
  margin-bottom: 6px;
}

.briefing-title {
  font-family: 'Bebas Neue', 'Oswald', sans-serif;
  font-size: 1.7rem;
  color: #78350f;
  letter-spacing: 0.8px;
  margin: 0 0 14px 0;
}

.briefing-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.briefing-meta-box {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.briefing-meta-box .meta-icon {
  font-size: 1.1rem;
}

.briefing-meta-box .meta-label {
  font-size: 0.62rem;
  font-weight: 900;
  color: #64748b;
  letter-spacing: 0.6px;
}

.briefing-meta-box .meta-val {
  font-family: 'Bebas Neue', 'Oswald', sans-serif;
  font-size: 1.35rem;
  color: var(--nanyang-darkblue);
  letter-spacing: 0.8px;
}

.briefing-star-thresholds {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 8px;
  background: #fffbeb;
  border: 1px dashed #f59e0b;
  border-radius: 12px;
  margin-bottom: 16px;
  font-size: 0.75rem;
  font-weight: 800;
  color: #92400e;
}

.btn-journey-play {
  width: 100%;
  height: 50px;
  border-radius: 16px;
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
  border: 2px solid #15803d;
  color: #ffffff;
  font-family: 'Bebas Neue', 'Oswald', sans-serif;
  font-size: 1.35rem;
  letter-spacing: 1.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 0 #14532d, 0 6px 16px rgba(34, 197, 94, 0.4);
  transition: transform 0.1s ease;
}

.btn-journey-play:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #14532d;
}

/* Briefing Bottom Sheet */
.journey-briefing-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  animation: fadeInBriefing 0.2s ease-out;
}

@keyframes fadeInBriefing {
  from { opacity: 0; }
  to { opacity: 1; }
}

.briefing-card {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border-radius: 24px;
  padding: 22px 20px 18px 20px;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.5);
  border: 2.5px solid var(--primary-gold);
  position: relative;
  text-align: center;
  animation: slideUpBriefing 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

.briefing-close-btn {
  position: absolute;
  top: 12px;
  right: 14px;
  background: #f1f5f9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.4rem;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.briefing-badge {
  display: inline-block;
  background: var(--nanyang-darkblue);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 900;
  padding: 3px 12px;
  border-radius: 12px;
  letter-spacing: 1.2px;
  margin-bottom: 6px;
}

.briefing-title {
  font-family: 'Bebas Neue', 'Oswald', sans-serif;
  font-size: 1.65rem;
  color: #78350f;
  letter-spacing: 0.8px;
  margin: 0 0 4px 0;
}

/* Level Landmark Hero Diorama in Briefing Sheet */
.briefing-diorama-wrap {
  width: 100%;
  height: 108px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2px 0 10px 0;
}

.briefing-diorama-img {
  max-width: 135px;
  max-height: 102px;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.22));
  animation: dioramaBriefingFloat 3s ease-in-out infinite alternate;
}

@keyframes dioramaBriefingFloat {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-3px) scale(1.03); }
}

.briefing-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.briefing-meta-box {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.meta-custom-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.14));
  margin-bottom: 2px;
}

.meta-custom-icon.meta-icon-queue {
  width: 44px;
  height: 32px;
}

.stat-custom-coin-icon {
  width: 17px;
  height: 17px;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
  margin-right: 2px;
}

.stat-star-icon {
  vertical-align: middle;
  filter: drop-shadow(0 1px 2px rgba(245, 158, 11, 0.45));
}

.briefing-meta-box .meta-label {
  font-size: 0.62rem;
  font-weight: 900;
  color: #64748b;
  letter-spacing: 0.6px;
}

.briefing-meta-box .meta-val {
  font-family: 'Bebas Neue', 'Oswald', sans-serif;
  font-size: 1.35rem;
  color: var(--nanyang-darkblue);
  letter-spacing: 0.8px;
}

.briefing-star-thresholds {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 8px 10px;
  background: #fffbeb;
  border: 1.5px dashed #f59e0b;
  border-radius: 14px;
  margin-bottom: 14px;
  font-size: 0.8rem;
  font-weight: 800;
  color: #92400e;
}

.briefing-star-target-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  letter-spacing: 0.3px;
}

.svg-briefing-star {
  width: 15px;
  height: 15px;
  filter: drop-shadow(0 1px 2px rgba(245, 158, 11, 0.45));
  vertical-align: middle;
}

.btn-journey-play {
  width: 100%;
  height: 50px;
  border-radius: 16px;
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
  border: 2px solid #15803d;
  color: #ffffff;
  font-family: 'Bebas Neue', 'Oswald', sans-serif;
  font-size: 1.35rem;
  letter-spacing: 1.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 0 #14532d, 0 6px 16px rgba(34, 197, 94, 0.4);
  transition: transform 0.1s ease;
}

.btn-journey-play:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #14532d;
}

.hidden { display: none !important; }
