/* ==========================================================================
   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-size: cover;
  background-position: 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 (BRIGHT VINTAGE THEME)
   ========================================================================== */
.screen-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 150;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background-size: cover;
  background-position: center;
}

.poster-vignette-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.15) 0%, rgba(253, 251, 247, 0.45) 100%);
  z-index: 1;
  pointer-events: none;
}

.vintage-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}

.vintage-pill {
  background: #ffffff;
  border: 2px solid var(--nanyang-blue);
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--nanyang-blue);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  text-transform: uppercase;
}

.vintage-brand-title {
  margin: 4px 0;
  padding: 12px 20px;
  background: rgba(253, 251, 247, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid var(--nanyang-blue);
  border-radius: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  width: 100%;
}

.vintage-poster-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.nanyang-header {
  font-family: var(--font-display);
  font-size: 2.3rem;
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--nanyang-blue);
}

.chinese-calligraphy {
  font-family: var(--font-chinese);
  font-size: 2.1rem;
  font-weight: 900;
  color: var(--vintage-red);
  letter-spacing: 4px;
  margin: 3px 0;
}

.kopikia-header {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--nanyang-blue);
}

.vintage-tagline {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.4;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.9);
}

.vintage-stats-bar {
  display: flex;
  gap: 8px;
  margin: 2px 0;
}

.vintage-stat-pill {
  background: #ffffff;
  border: 1.5px solid var(--primary-gold);
  padding: 6px 12px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 900;
  font-size: 0.85rem;
  color: var(--nanyang-darkblue);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.stat-icon { font-size: 0.95rem; }

.vintage-cta-btn {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  padding: 16px;
  border-radius: 22px;
  border: 2px solid #ffffff;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
  color: #1a0d03;
  font-size: 1.25rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 
    0 0 25px rgba(245, 158, 11, 0.5),
    0 8px 18px rgba(0, 0, 0, 0.2);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.vintage-cta-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 0 35px rgba(245, 158, 11, 0.8);
}

.vintage-cta-btn:active { transform: scale(0.97); }

.vintage-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
}

.vintage-grid-btn {
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid var(--nanyang-blue);
  padding: 12px 14px;
  border-radius: 16px;
  color: var(--nanyang-blue);
  font-size: 0.92rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transition: all 0.2s ease;
}

.vintage-grid-btn:hover {
  background: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.vintage-footer {
  margin-top: 4px;
  font-size: 0.7rem;
  color: var(--text-dark);
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.9);
}

/* ==========================================================================
   3. UNIFIED IN-GAME HEADER & SHIFT HUD
   ========================================================================== */
#game-header {
  position: relative;
  z-index: 10;
  padding: 12px 14px 4px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-back-btn {
  background: #ffffff;
  border: 2px solid var(--nanyang-blue);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--nanyang-blue);
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

#brand-title {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.header-level-badge {
  background: #ffffff;
  border: 2px solid var(--primary-gold);
  padding: 4px 12px;
  border-radius: 16px;
  font-weight: 900;
  font-size: 0.82rem;
  color: var(--nanyang-darkblue);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#game-stats {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-pill {
  background: #ffffff;
  border: 2px solid var(--primary-gold);
  padding: 5px 12px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 900;
  font-size: 0.88rem;
  color: var(--nanyang-darkblue);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.stat-icon-img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.header-icon-btn {
  background: #ffffff;
  border: 2px solid var(--nanyang-blue);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--nanyang-blue);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  pointer-events: auto !important;
  z-index: 1000 !important;
}

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

#shift-hud {
  position: relative;
  z-index: 10;
  margin: 4px 14px;
}

.hud-card {
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(253, 251, 247, 0.95);
  border: 2px solid var(--nanyang-blue);
  border-radius: 16px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.hud-target-row, .hud-timer-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
}

.hud-label {
  color: #64748b;
  font-weight: 800;
  font-size: 0.7rem;
}

#hud-goal-text { color: #16a34a; font-weight: 900; }
#shift-timer-text { color: #dc2626; font-weight: 900; }

/* ==========================================================================
   4. ACTIVE SPOTLIGHT & QUEUE BAR
   ========================================================================== */
#active-order-spotlight {
  position: relative;
  z-index: 10;
  margin: 4px 14px 6px 14px;
  padding: 12px 14px;
  overflow: hidden;
  background: rgba(253, 251, 247, 0.95);
  border: 2.5px solid var(--nanyang-blue);
  border-left: 6px solid var(--cyan-glow);
  border-radius: 18px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.spotlight-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

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

.spotlight-timer-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #fef2f2;
  border: 1.5px solid #f87171;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 900;
  font-size: 0.8rem;
  color: #dc2626;
}

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

.spotlight-customer-avatar {
  font-size: 2.1rem;
  background: #ffffff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2.5px solid var(--nanyang-blue);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  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;
}

.customer-name-row { font-size: 0.82rem; color: #475569; font-weight: 700; }
.order-name-row { font-size: 1.15rem; font-weight: 900; color: var(--nanyang-darkblue); }

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

#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(-8px); }
  40%, 80% { transform: translateX(8px); }
}

#customer-queue-row {
  position: relative;
  z-index: 10;
  padding: 0 14px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

#customer-queue-row::-webkit-scrollbar { display: none; }

.queue-card {
  flex: 1;
  min-width: 105px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.9);
  border: 1.5px solid var(--nanyang-blue);
  border-radius: 14px;
  opacity: 0.75;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.queue-card.active-queue {
  opacity: 1;
  border-color: var(--primary-gold);
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}

.queue-avatar {
  font-size: 1.2rem;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.queue-text { display: flex; flex-direction: column; line-height: 1.1; overflow: hidden; }
.q-name { font-size: 0.7rem; color: #475569; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
.q-drink { font-size: 0.78rem; font-weight: 800; color: var(--nanyang-blue); white-space: nowrap; text-overflow: ellipsis; }

/* ==========================================================================
   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: 6px 0 20px 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 PARCHMENT THEME)
   ========================================================================== */
#bottom-action-bar {
  position: relative;
  z-index: 30;
  padding: 10px 12px 14px 12px;
  background: rgba(253, 251, 247, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 2.5px solid var(--nanyang-blue);
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.15);
}

#station-tab-bar {
  display: flex;
  gap: 6px;
  background: rgba(15, 56, 107, 0.1);
  padding: 4px;
  border-radius: 12px;
  border: 1.5px solid var(--nanyang-blue);
}

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

.tab-icon-img {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  object-fit: cover;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

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

.action-grid { display: grid; gap: 6px; }
.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%; }

#btn-serve {
  width: 100%;
  min-height: 78px;
  background: linear-gradient(180deg, #ffffff 0%, #fdfbf7 100%);
  border: 2px solid var(--nanyang-blue);
}

#btn-serve .btn-label {
  background: rgba(15, 56, 107, 0.08);
  border: 1px solid rgba(15, 56, 107, 0.2);
  color: var(--nanyang-darkblue);
}

.tray-hero-sprite {
  width: 100%;
  max-width: 220px;
  height: clamp(44px, 6vh, 54px);
  object-fit: contain;
  mix-blend-mode: multiply;
  margin: 2px 0;
}

.action-btn {
  appearance: none;
  -webkit-appearance: none;
  background: linear-gradient(180deg, #ffffff 0%, #fdfbf7 100%);
  border: 2px solid var(--nanyang-blue);
  border-radius: 14px;
  padding: 6px 4px 5px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  cursor: pointer;
  outline: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.action-btn:active { transform: scale(0.93); }

.btn-icon {
  font-size: clamp(1.4rem, 3.2vh, 1.8rem);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2px 0;
}

.btn-label {
  font-size: clamp(0.58rem, 1.3vh, 0.68rem);
  font-weight: 900;
  color: var(--nanyang-darkblue);
  text-align: center;
  white-space: nowrap;
  background: rgba(15, 56, 107, 0.08);
  border: 1px solid rgba(15, 56, 107, 0.2);
  padding: 2px 6px;
  border-radius: 10px;
  width: 100%;
}

.soda-can-icon,
.sprite-icon {
  width: clamp(40px, 5.5vh, 48px);
  height: clamp(40px, 5.5vh, 48px);
  border-radius: 10px;
  object-fit: cover;
  border: 1.5px solid var(--nanyang-blue);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
  margin-bottom: 2px;
}

.btn-cyan { border-color: var(--cyan-glow); }
.btn-pink { border-color: var(--pink-glow); }
.btn-green { border-color: var(--green-glow); }
.btn-iceblue { border-color: var(--iceblue-glow); }
.btn-blue { border-color: var(--blue-glow); }
.btn-white { border-color: #cbd5e1; }
.btn-amber { border-color: var(--amber-glow); }
.btn-red { border-color: var(--red-glow); }
.btn-lime { border-color: var(--lime-glow); }
.btn-emerald { border-color: var(--emerald-glow); background: rgba(16, 185, 129, 0.15); }

/* ==========================================================================
   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; }

/* Leaderboard Player Name Card & Ranking */
.player-name-card {
  background: #ffffff;
  border: 2px solid var(--primary-gold);
  border-radius: 16px;
  padding: 10px 14px;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.name-input-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.name-input-row input {
  flex: 1;
  padding: 8px 12px;
  border: 2px solid var(--nanyang-blue);
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.9rem;
  outline: none;
}

.name-input-row button {
  padding: 8px 16px;
  border-radius: 10px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

.board-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  padding: 0;
}

.board-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  padding: 8px 14px;
  font-weight: 800;
  color: var(--nanyang-darkblue);
}

.board-item.active-player {
  border-color: var(--primary-gold);
  background: #fef3c7;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.25);
}

.leaderboard-entry-box {
  background: #fffbeb;
  border: 2px solid var(--primary-gold);
  border-radius: 16px;
  padding: 12px 14px;
  margin: 10px 0;
}

.leaderboard-title {
  font-weight: 900;
  color: var(--nanyang-darkblue);
  font-size: 0.9rem;
  margin-bottom: 4px;
}

/* ==========================================================================
   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: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #f7f6f0;
  z-index: 100000 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 0.5s ease-out;
}

.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.5s ease-in-out;
}

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

.splash-cover-art {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center center;
  filter: brightness(0.95);
}

.splash-cover-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  z-index: 10;
}

.splash-brand-badge {
  margin-bottom: 0;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
  transform: scale(0.92);
  width: 100%;
}

.splash-tap-prompt {
  font-family: var(--font-family);
  font-size: clamp(1rem, 3.2vw, 1.2rem);
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 3px;
  background: rgba(15, 33, 66, 0.92);
  padding: 12px 26px;
  border-radius: 30px;
  border: 2.5px solid var(--primary-gold);
  animation: promptPulse 1.2s ease-in-out infinite alternate;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7);
  white-space: nowrap;
}

.splash-fade-out { opacity: 0; }
.splash-fade-in { opacity: 1; }

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

@keyframes promptPulse {
  0% { opacity: 0.7; transform: scale(0.98); }
  100% { opacity: 1; transform: scale(1.04); }
}

.hidden { display: none !important; }
