/* Mobile-first UI Overlay for Tour & Wheels (轉轉小鎮：觀光車業物語) */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang TC", "Microsoft JhengHei", sans-serif;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #0f172a; /* Sleek dark frame backdrop when viewed on PC */
  touch-action: pan-x pan-y;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Smartphone Screen Simulator Container */
#mobile-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 440px; /* Constrains to standard smartphone width on desktop */
  overflow: hidden;
  background-color: #d8f3dc;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

@media (max-width: 600px) {
  #mobile-wrapper {
    max-width: 100%;
    box-shadow: none;
  }
}

#renderCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  image-rendering: -moz-crisp-edges;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  z-index: 1;
}

/* UI Container with Safe Area Insets for iPhones and Notch screens */
#ui-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* Allows touching 3D canvas beneath */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  z-index: 10;
}

/* Interactive elements re-enable pointer events */
.clickable {
  pointer-events: auto;
}

/* Top HUD */
.top-hud {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  padding: 6px 12px;
  border-radius: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  color: #2b2d42;
  font-size: 13px;
}

.coin-val {
  color: #d97706;
}

.map-icon-btn {
  background: #0284c7;
  color: white;
  border: none;
  border-radius: 12px;
  padding: 4px 8px;
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 2px;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3);
  transition: transform 0.1s active;
}

.map-icon-btn:active {
  transform: scale(0.95);
}

.mission-bar {
  background: rgba(254, 243, 199, 0.95);
  border: 1px solid #fde68a;
  padding: 5px 12px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 600;
  color: #92400e;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Floating Coin Toast Notifications */
#coin-toasts {
  position: absolute;
  top: 85px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}

.coin-toast {
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid #fbbf24;
  padding: 5px 12px;
  border-radius: 18px;
  font-weight: 800;
  color: #b45309;
  font-size: 13px;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
  animation: floatUp 1.8s ease-out forwards;
}

@keyframes floatUp {
  0% { opacity: 0; transform: translateY(10px) scale(0.9); }
  15% { opacity: 1; transform: translateY(0) scale(1.05); }
  80% { opacity: 1; transform: translateY(-15px) scale(1); }
  100% { opacity: 0; transform: translateY(-30px); }
}

/* Bottom Controls */
.bottom-controls {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Vehicle Bay Drawer */
.vehicle-bay {
  display: flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  padding: 8px;
  border-radius: 18px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.vehicle-card {
  flex: 1;
  min-width: 95px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  text-align: center;
  transition: all 0.2s ease;
}

.vehicle-card.dirty {
  background: #fff7ed;
  border-color: #fdba74;
}

.btn-wash {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(14, 165, 233, 0.3);
  animation: pulse 1.2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* Action Buttons Row */
.action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.action-btn {
  background: white;
  border: none;
  border-radius: 16px;
  padding: 10px;
  font-weight: 700;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.1s active;
}

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

.action-btn.upgrade-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
}

.action-btn.shop-btn {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

.action-btn:disabled {
  background: #94a3b8;
  opacity: 0.6;
  cursor: not-allowed;
}

/* General Toast Notification */
#general-toast {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(15, 23, 42, 0.88);
  color: white;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 100;
}

/* ========================================= */
/* 2.5D Japanese JRPG Title Screen & Button  */
/* ========================================= */
.title-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(15, 23, 42, 0.45) 0%, rgba(15, 23, 42, 0.78) 100%);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  visibility: hidden;
}

.title-screen.active {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.jrpg-title-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
  padding: 20px;
  animation: titlePop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

/* JRPG Title Logo */
.jrpg-logo-wrapper {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.jrpg-subtitle {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 4px;
  color: #fef08a;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.jrpg-game-title {
  font-size: 40px;
  font-weight: 900;
  letter-spacing: 6px;
  margin-left: 6px;
  color: #ffffff;
  background: linear-gradient(180deg, #ffffff 15%, #fde047 60%, #eab308 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 0 #78350f) drop-shadow(0 8px 14px rgba(0, 0, 0, 0.7));
}

.jrpg-badge {
  display: inline-block;
  background: #dc2626;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 2px;
  padding: 3px 14px;
  border-radius: 20px;
  border: 2px solid #fef08a;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

/* 2.5D Japanese JRPG "開始遊戲" Button */
.jrpg-btn-container {
  position: relative;
}

.jrpg-start-btn {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 16px 42px;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 8px;
  text-indent: 8px; /* Optical balance for letter-spacing */
  color: #ffffff;
  
  /* 2.5D Japanese Lacquer & Golden Timber Styling */
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 45%, #b45309 100%);
  border: 3px solid #fef08a;
  border-radius: 18px;
  outline: 3px solid #78350f;
  
  /* 2.5D Physical Depth Extrusion */
  box-shadow: 
    0 8px 0 #78350f,
    0 10px 0 #451a03,
    0 16px 25px rgba(0, 0, 0, 0.55),
    inset 0 2px 0 rgba(255, 255, 255, 0.65),
    inset 0 -3px 0 rgba(0, 0, 0, 0.25);
    
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.15s ease;
  animation: jrpgPulse 2.4s infinite ease-in-out;
}

/* 2.5D Text Emboss */
.jrpg-start-btn .btn-text {
  text-shadow: 
    0 2px 0 #78350f,
    0 3px 0 #451a03,
    0 4px 6px rgba(0, 0, 0, 0.45);
}

/* Hover Lift */
.jrpg-start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 10px 0 #78350f,
    0 12px 0 #451a03,
    0 20px 30px rgba(0, 0, 0, 0.65),
    inset 0 2px 0 rgba(255, 255, 255, 0.85),
    inset 0 -3px 0 rgba(0, 0, 0, 0.25);
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 45%, #d97706 100%);
}

/* 2.5D Tactile Press Down Effect */
.jrpg-start-btn:active {
  transform: translateY(6px);
  box-shadow: 
    0 2px 0 #78350f,
    0 3px 0 #451a03,
    0 6px 12px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 3px 6px rgba(0, 0, 0, 0.3);
}

/* Title Screen Quick Settings Button */
.title-settings-icon-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.7);
  border: 2px solid #fef08a;
  color: #ffffff;
  font-size: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s ease, background 0.15s ease;
  z-index: 10;
}

.title-settings-icon-btn:hover {
  transform: rotate(30deg) scale(1.08);
  background: rgba(30, 41, 59, 0.9);
}

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

/* ========================================= */
/* 2.5D JRPG Settings Modal Styles           */
/* ========================================= */
#settingsModal {
  z-index: 2000;
}

.settings-card {
  background: #ffffff;
  border: 3px solid #78350f;
  border-radius: 22px;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 
    0 12px 0 #451a03,
    0 20px 40px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.settings-header {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: #ffffff;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px solid #fef08a;
}

.settings-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #fde047;
}

.settings-header h3 {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 1px;
}

.settings-close-x {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 14px;
  font-weight: 800;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.1s ease;
}

.settings-close-x:hover {
  background: rgba(239, 68, 68, 0.8);
}

.settings-close-x:active {
  transform: scale(0.9);
}

.settings-body {
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #fdfbf7;
}

.setting-item-panel {
  background: #ffffff;
  border: 2px solid #e2d9cc;
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.04);
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.setting-desc {
  display: flex;
  align-items: center;
  gap: 10px;
}

.setting-icon {
  font-size: 24px;
}

.setting-name {
  font-size: 15px;
  font-weight: 800;
  color: #1e293b;
}

.setting-sub {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
}

/* 2.5D Toggle Switch */
.jrpg-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  cursor: pointer;
}

.jrpg-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.jrpg-switch-slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #94a3b8;
  border-radius: 28px;
  border: 2px solid #475569;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25);
  transition: all 0.2s ease;
}

.jrpg-switch-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 2px;
  bottom: 2px;
  background: linear-gradient(180deg, #ffffff, #e2e8f0);
  border-radius: 50%;
  border: 1px solid #64748b;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.jrpg-switch input:checked + .jrpg-switch-slider {
  background: linear-gradient(180deg, #22c55e, #16a34a);
  border-color: #14532d;
}

.jrpg-switch input:checked + .jrpg-switch-slider:before {
  transform: translateX(24px);
  background: linear-gradient(180deg, #fef08a, #fde047);
  border-color: #854d0e;
}

/* Volume Slider Row */
.volume-slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 4px;
}

.vol-label {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  width: 30px;
}

.jrpg-range-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  border-radius: 6px;
  background: #cbd5e1;
  outline: none;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.jrpg-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fde047 0%, #d97706 100%);
  border: 2px solid #78350f;
  box-shadow: 
    0 3px 0 #78350f,
    0 4px 6px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.jrpg-range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.jrpg-range-slider::-webkit-slider-thumb:active {
  transform: scale(0.95);
}

.vol-percent {
  font-size: 13px;
  font-weight: 800;
  color: #1e293b;
  width: 42px;
  text-align: right;
}

/* Settings Modal Footer */
.settings-footer {
  padding: 12px 16px 16px;
  background: #fdfbf7;
  border-top: 1px solid #e2d9cc;
}

.jrpg-save-btn {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #ffffff;
  background: linear-gradient(180deg, #10b981 0%, #059669 100%);
  border: 2px solid #a7f3d0;
  border-radius: 14px;
  outline: 2px solid #064e3b;
  box-shadow: 
    0 4px 0 #064e3b,
    0 8px 15px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: all 0.1s ease;
}

.jrpg-save-btn:hover {
  background: linear-gradient(180deg, #34d399 0%, #10b981 100%);
  transform: translateY(-1px);
  box-shadow: 
    0 5px 0 #064e3b,
    0 10px 18px rgba(0, 0, 0, 0.3);
}

.jrpg-save-btn:active {
  transform: translateY(3px);
  box-shadow: 
    0 1px 0 #064e3b,
    0 3px 6px rgba(0, 0, 0, 0.2);
}

/* Gentle Breathing Pulse */
@keyframes jrpgPulse {
  0%, 100% {
    box-shadow: 
      0 8px 0 #78350f,
      0 10px 0 #451a03,
      0 16px 25px rgba(0, 0, 0, 0.55),
      inset 0 2px 0 rgba(255, 255, 255, 0.65),
      inset 0 -3px 0 rgba(0, 0, 0, 0.25);
  }
  50% {
    box-shadow: 
      0 8px 0 #78350f,
      0 10px 0 #451a03,
      0 20px 32px rgba(245, 158, 11, 0.5),
      inset 0 3px 0 rgba(255, 255, 255, 0.85),
      inset 0 -3px 0 rgba(0, 0, 0, 0.25);
  }
}

/* ========================================= */
/* Map Introduction Modal Styles (Mobile)     */
/* ========================================= */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(5px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.modal-card {
  background: #ffffff;
  border-radius: 24px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.25);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  0% { transform: translateY(20px) scale(0.96); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-header {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: white;
  padding: 14px 16px 12px;
  text-align: center;
}

.tag-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.25);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 800;
}

.zone-title {
  font-size: 13px;
  font-weight: 700;
  color: #fef08a;
  margin-top: 1px;
}

.modal-body {
  padding: 12px 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.zone-intro {
  font-size: 12px;
  line-height: 1.45;
  color: #475569;
  background: #f1f5f9;
  padding: 8px 12px;
  border-radius: 12px;
}

.landmark-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.landmark-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
}

.landmark-card.locked {
  background: #fff1f2;
  border-color: #fecdd3;
  opacity: 0.85;
}

.lm-icon {
  font-size: 22px;
  width: 36px;
  height: 36px;
  background: white;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.06);
  flex-shrink: 0;
}

.lm-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lm-name {
  font-size: 12px;
  font-weight: 700;
  color: #1e293b;
}

.landmark-card.locked .lm-name {
  color: #e11d48;
}

.lm-desc {
  font-size: 11px;
  color: #64748b;
  line-height: 1.3;
}

.pro-tip {
  background: #fefce8;
  border: 1px solid #fef08a;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 11px;
  color: #854d0e;
  line-height: 1.35;
}

.modal-footer {
  padding: 10px 16px 14px;
  background: white;
  border-top: 1px solid #f1f5f9;
}

.btn-primary-start {
  width: 100%;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: white;
  border: none;
  border-radius: 16px;
  padding: 12px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(2, 132, 199, 0.35);
  transition: transform 0.1s active;
}

.btn-primary-start:active {
  transform: scale(0.98);
}

/* ==========================================
   2.5D Retro Pixel Direct Touch Controls
   ========================================== */
/* Dynamic Floating Drag Joystick Indicator */
.floating-joystick {
  position: absolute;
  top: 0;
  left: 0;
  width: 86px;
  height: 86px;
  margin-top: -43px;
  margin-left: -43px;
  pointer-events: none;
  z-index: 999;
  display: none;
}

.joystick-base {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(4px);
  border: 2px solid rgba(254, 240, 138, 0.75);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.joystick-knob {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fef08a, #d97706);
  border: 2px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: transform 0.04s ease-out;
}

.control-hint-bar {
  position: absolute;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(6px);
  color: #fef08a;
  border: 1px solid rgba(254, 240, 138, 0.35);
  border-radius: 12px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: auto;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  z-index: 55;
  transition: opacity 0.3s;
}

/* ==========================================
   Pause Screen Overlay (離開畫面自動暫停)
   ========================================== */
.pause-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  animation: fadeIn 0.15s ease-out;
}

.pause-card {
  background: linear-gradient(180deg, #1e293b, #0f172a);
  border: 2px solid #fef08a;
  border-radius: 20px;
  padding: 24px 32px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  user-select: none;
  -webkit-user-select: none;
}

.pause-icon {
  font-size: 34px;
}

.pause-title {
  font-size: 18px;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: 1px;
}

.pause-resume-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: 2px solid #fef08a;
  border-radius: 14px;
  color: #ffffff;
  padding: 10px 24px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(217, 119, 6, 0.45);
  margin-top: 4px;
  transition: transform 0.1s ease, filter 0.1s ease;
  user-select: none;
  -webkit-user-select: none;
}

.pause-resume-btn:active {
  transform: scale(0.95);
  filter: brightness(1.15);
}

.pause-hint {
  font-size: 12px;
  color: #fef08a;
  opacity: 0.9;
}
