:root {
  --bg-base: #070a12;
  --bg-gradient: radial-gradient(circle at 50% 12%, #13182e 0%, #090d18 55%, #05070e 100%);
  --glass-surface: rgba(18, 24, 38, 0.72);
  --glass-surface-hover: rgba(26, 34, 52, 0.85);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-border-subtle: rgba(255, 255, 255, 0.05);
  --glass-highlight: inset 0 1px 1px 0 rgba(255, 255, 255, 0.16);
  --glass-shadow: 0 12px 36px -6px rgba(0, 0, 0, 0.55);

  --accent-cyan: #38bdf8;
  --accent-gold: #facc15;
  --accent-orange: #fb923c;
  --accent-emerald: #10b981;
  --accent-purple: #c084fc;
  --accent-rose: #f43f5e;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;

  --font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', Roboto, sans-serif;
  --spring-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-base);
  font-family: var(--font-family);
  color: var(--text-primary);
  touch-action: none;
}

/* App Viewport Container */
#app-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  background: var(--bg-gradient);
}

/* Living Onsen Ambient Background Canvas */
#bg-ambient-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* Ambient Glow Background Orbs */
.ambient-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 1;
  opacity: 0.3;
}

.glow-primary {
  width: 440px;
  height: 440px;
  background: radial-gradient(circle, #2563eb 0%, #1e1b4b 65%, transparent 100%);
  top: -60px;
  left: 15%;
  animation: pulse-glow-1 8s infinite alternate ease-in-out;
}

.glow-secondary {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #f59e0b 0%, #7c2d12 65%, transparent 100%);
  bottom: -40px;
  right: 12%;
  animation: pulse-glow-2 10s infinite alternate ease-in-out;
}

.glow-onsen-warm {
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(251, 146, 60, 0.25) 0%, rgba(180, 83, 9, 0.12) 50%, transparent 80%);
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: pulse-onsen-warm 9s infinite alternate ease-in-out;
}

@keyframes pulse-glow-1 {
  0% { transform: scale(1) translate(0, 0); opacity: 0.25; }
  100% { transform: scale(1.15) translate(20px, 30px); opacity: 0.38; }
}

@keyframes pulse-glow-2 {
  0% { transform: scale(1) translate(0, 0); opacity: 0.2; }
  100% { transform: scale(1.2) translate(-25px, -20px); opacity: 0.35; }
}

@keyframes pulse-onsen-warm {
  0% { transform: translate(-50%, -50%) scale(0.92); opacity: 0.2; }
  100% { transform: translate(-50%, -46%) scale(1.12); opacity: 0.35; }
}

/* Living Japanese Spa Bamboo Silhouettes */
.bamboo-silhouette {
  position: absolute;
  bottom: 0;
  width: 170px;
  height: 520px;
  pointer-events: none;
  z-index: 1;
  opacity: 0.16;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: bottom;
  transition: opacity 0.3s ease;
}

.bamboo-silhouette-left {
  left: -20px;
  transform-origin: bottom left;
  animation: bamboo-sway-left 8s ease-in-out infinite alternate;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 500'%3E%3Cpath d='M30 500 L30 0 M38 500 L38 0' stroke='%2322c55e' stroke-width='6' stroke-linecap='round'/%3E%3Cellipse cx='34' cy='120' rx='6' ry='2' fill='%2315803d'/%3E%3Cellipse cx='34' cy='240' rx='6' ry='2' fill='%2315803d'/%3E%3Cellipse cx='34' cy='360' rx='6' ry='2' fill='%2315803d'/%3E%3Cpath d='M34 120 Q70 110 95 130 Q70 125 34 120' fill='%2322c55e'/%3E%3Cpath d='M34 120 Q65 135 85 160 Q60 145 34 120' fill='%2316a34a'/%3E%3Cpath d='M34 240 Q75 220 110 245 Q75 240 34 240' fill='%2322c55e'/%3E%3Cpath d='M34 240 Q70 260 100 285 Q65 265 34 240' fill='%2315803d'/%3E%3Cpath d='M34 360 Q80 345 115 375 Q75 365 34 360' fill='%2322c55e'/%3E%3Cpath d='M70 500 L70 180' stroke='%2316a34a' stroke-width='4'/%3E%3Cpath d='M70 280 Q105 265 135 290 Q100 285 70 280' fill='%234ade80'/%3E%3C/svg%3E");
}

.bamboo-silhouette-right {
  right: -20px;
  transform-origin: bottom right;
  transform: scaleX(-1);
  animation: bamboo-sway-right 10s ease-in-out infinite alternate;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 500'%3E%3Cpath d='M30 500 L30 0 M38 500 L38 0' stroke='%2322c55e' stroke-width='6' stroke-linecap='round'/%3E%3Cellipse cx='34' cy='120' rx='6' ry='2' fill='%2315803d'/%3E%3Cellipse cx='34' cy='240' rx='6' ry='2' fill='%2315803d'/%3E%3Cellipse cx='34' cy='360' rx='6' ry='2' fill='%2315803d'/%3E%3Cpath d='M34 120 Q70 110 95 130 Q70 125 34 120' fill='%2322c55e'/%3E%3Cpath d='M34 120 Q65 135 85 160 Q60 145 34 120' fill='%2316a34a'/%3E%3Cpath d='M34 240 Q75 220 110 245 Q75 240 34 240' fill='%2322c55e'/%3E%3Cpath d='M34 240 Q70 260 100 285 Q65 265 34 240' fill='%2315803d'/%3E%3Cpath d='M34 360 Q80 345 115 375 Q75 365 34 360' fill='%2322c55e'/%3E%3Cpath d='M70 500 L70 180' stroke='%2316a34a' stroke-width='4'/%3E%3Cpath d='M70 280 Q105 265 135 290 Q100 285 70 280' fill='%234ade80'/%3E%3C/svg%3E");
}

@keyframes bamboo-sway-left {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(2.2deg) skewX(-1deg); }
}

@keyframes bamboo-sway-right {
  0% { transform: scaleX(-1) rotate(0deg); }
  100% { transform: scaleX(-1) rotate(2.5deg) skewX(-1deg); }
}

/* Top Branding Bar from Stitch */
#top-branding-bar {
  width: 100%;
  max-width: 1140px;
  height: 42px;
  padding: 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
  border-bottom: 1px solid var(--glass-border-subtle);
  background: rgba(8, 12, 20, 0.4);
}

.brand-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-icon {
  font-size: 18px;
}

.brand-title {
  font-weight: 800;
  font-size: 14px;
  letter-spacing: -0.2px;
  color: #fff;
}

.brand-live-badge {
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 8px;
  letter-spacing: 0.3px;
}

.brand-right {
  display: flex;
  gap: 6px;
}

/* Main Content 3-Column Layout */
#main-content-layout {
  position: relative;
  width: 100%;
  max-width: 1140px;
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding: 8px 12px 14px;
  z-index: 2;
  overflow: hidden;
}

/* Desktop Side Panels (Hidden on mobile) */
.desktop-side-panel {
  display: none;
  width: 280px;
  height: 100%;
  max-height: 870px;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}

@media (min-width: 980px) {
  .desktop-side-panel {
    display: flex;
  }
}

.side-bento-card {
  background: var(--glass-surface);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow), var(--glass-highlight);
  border-radius: 22px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.bento-header-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: var(--accent-cyan);
  text-transform: uppercase;
}

.bento-status-pill {
  font-size: 10px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border-subtle);
  padding: 2px 7px;
  border-radius: 10px;
  color: var(--text-secondary);
}

/* Quests Items */
.quest-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(11, 16, 28, 0.5);
  border: 1px solid var(--glass-border-subtle);
  border-radius: 14px;
  padding: 10px 12px;
}

.quest-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
}

.quest-reward {
  color: var(--accent-gold);
  font-weight: 800;
}

.quest-progress-bg {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  margin: 3px 0;
}

.quest-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #10b981);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.quest-subtext {
  font-size: 10px;
  color: var(--text-tertiary);
  font-weight: 600;
}

.quest-reward-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(250, 204, 21, 0.1);
  border: 1px solid rgba(250, 204, 21, 0.25);
  border-radius: 14px;
  padding: 8px 10px;
}

.streak-icon {
  font-size: 20px;
  color: var(--accent-gold);
}

.streak-info {
  flex: 1;
}

.streak-title {
  font-size: 11px;
  font-weight: 800;
  color: #fff;
}

.streak-sub {
  font-size: 10px;
  color: var(--text-secondary);
}

.claim-btn {
  background: var(--accent-gold);
  border: none;
  color: #080c14;
  font-size: 11px;
  font-weight: 800;
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.1s var(--spring-bounce);
}

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

/* Mini Leaderboard in Side Panel */
.mini-leader-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mini-leader-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(11, 16, 28, 0.5);
  padding: 7px 10px;
  border-radius: 12px;
  font-size: 12px;
  border: 1px solid var(--glass-border-subtle);
}

.mini-leader-row.rank-1 {
  background: rgba(250, 204, 21, 0.08);
  border-color: rgba(250, 204, 21, 0.25);
}

.mini-leader-row.current-user-row {
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.08);
}

.mini-rank {
  font-weight: 800;
  width: 22px;
}

.mini-name {
  flex: 1;
  font-weight: 600;
}

.mini-score {
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

/* Charms Bento Items */
.charm-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(11, 16, 28, 0.5);
  border: 1px solid var(--glass-border-subtle);
  border-radius: 14px;
  padding: 10px;
}

.charm-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 18px;
}

.charm-info {
  flex: 1;
}

.charm-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.charm-name {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.charm-buff {
  font-size: 10px;
  font-weight: 800;
  color: #34d399;
}

.charm-desc {
  font-size: 10px;
  color: var(--text-secondary);
  line-height: 1.3;
}

/* Codex Bento Card */
.codex-featured-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: rgba(11, 16, 28, 0.5);
  border-radius: 16px;
  padding: 14px 10px;
  border: 1px solid var(--glass-border-subtle);
}

.codex-avatar-large {
  font-size: 42px;
  margin-bottom: 4px;
}

.codex-featured-title {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
}

.codex-quote {
  font-size: 11px;
  font-style: italic;
  color: var(--text-secondary);
  margin: 6px 0 10px;
  line-height: 1.3;
}

.codex-stats-row {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-bottom: 8px;
}

.codex-stat-chip {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 6px;
}

.stat-chip-label {
  display: block;
  font-size: 8px;
  font-weight: 800;
  color: var(--text-tertiary);
  letter-spacing: 0.5px;
}

.stat-chip-val {
  font-size: 12px;
  font-weight: 800;
  color: #fff;
}

.codex-next-hint {
  font-size: 10px;
  color: var(--accent-gold);
  border-top: 1px solid var(--glass-border-subtle);
  padding-top: 8px;
  width: 100%;
}

/* Center Game Cabinet Wrapper */
#game-wrapper {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 100%;
  max-height: 870px;
  background: rgba(12, 17, 29, 0.76);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  display: flex;
  flex-direction: column;
  z-index: 2;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

@media (min-width: 500px) and (min-height: 720px) {
  #game-wrapper {
    border-radius: 28px;
    border: 1px solid var(--glass-border);
    height: 98%;
  }
}

/* Bento Header HUD */
#hud-header {
  position: absolute;
  top: 8px;
  left: 10px;
  right: 10px;
  height: 82px;
  display: grid;
  grid-template-columns: 1.2fr 0.95fr 1.25fr;
  gap: 8px;
  z-index: 10;
  pointer-events: none;
}

.hud-card {
  pointer-events: auto;
  background: var(--glass-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow), var(--glass-highlight);
  border-radius: 18px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s ease, background 0.15s ease;
}

/* Score Bento */
.score-bento {
  padding: 8px 10px;
}

.score-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.score-label-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
}

.score-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
}

.score-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: var(--accent-cyan);
  text-transform: uppercase;
}

.combo-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: rgba(249, 115, 22, 0.2);
  border: 1px solid rgba(249, 115, 22, 0.5);
  border-radius: 8px;
  padding: 1px 4px;
  font-size: 9px;
  font-weight: 900;
  color: var(--accent-orange);
  animation: pulse-combo 0.6s infinite alternate;
}

@keyframes pulse-combo {
  from { transform: scale(0.95); }
  to { transform: scale(1.08); }
}

.score-value {
  font-size: 21px;
  font-weight: 900;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.high-score-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.trophy-icon {
  font-size: 10px;
}

.high-score-val {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.percentile-pill {
  font-size: 8px;
  font-weight: 800;
  color: #34d399;
  background: rgba(16, 185, 129, 0.15);
  padding: 1px 4px;
  border-radius: 6px;
}

/* Next Creature Capsule */
.next-capsule {
  align-items: center;
  justify-content: center;
  padding: 5px;
}

.next-label {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
  text-transform: uppercase;
}

.next-canvas-wrapper {
  position: relative;
  width: 44px;
  height: 44px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1px 0;
}

#next-canvas {
  width: 42px;
  height: 42px;
  z-index: 2;
}

.next-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px dashed rgba(255, 255, 255, 0.2);
  animation: rotate-ring 16s linear infinite;
}

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

.next-creature-title {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-secondary);
}

/* Actions Bento */
.actions-bento {
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  gap: 5px;
}

.coin-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.35);
  border-radius: 12px;
  padding: 2px 5px 2px 7px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 2px 5px rgba(0, 0, 0, 0.2);
}

.coin-info {
  display: flex;
  align-items: center;
  gap: 4px;
}

.coin-icon {
  font-size: 13px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}

.coin-val {
  color: var(--accent-gold);
  font-size: 13px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.3px;
}

.coin-ad-plus-btn {
  background: linear-gradient(135deg, #10b981, #059669);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  padding: 1px 5px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  transition: transform 0.1s var(--spring-bounce), filter 0.15s ease;
  flex-shrink: 0;
}

.coin-ad-plus-btn:hover {
  filter: brightness(1.15);
  transform: scale(1.05);
}

.coin-ad-plus-btn:active {
  transform: scale(0.92);
}

.coin-ad-plus-btn .plus-txt {
  font-weight: 900;
  font-size: 11px;
  line-height: 1;
}

.coin-ad-plus-btn .tv-ico {
  font-size: 10px;
  line-height: 1;
}

.score-bottom-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
}

.actions-buttons-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 4px;
}

.tactile-icon-btn {
  flex: 1;
  max-width: 32px;
  height: 28px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 13px;
  color: #fff;
  cursor: pointer;
  transition: transform 0.1s var(--spring-bounce), background 0.15s ease, border-color 0.15s ease;
}

.tactile-icon-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.tactile-icon-btn:active {
  transform: scale(0.88) translateY(1px);
  background: rgba(255, 255, 255, 0.22);
}

@media (max-width: 440px) {
  #hud-header {
    top: 4px;
    left: 6px;
    right: 6px;
    gap: 5px;
    height: 78px;
    grid-template-columns: 1.15fr 0.9fr 1.35fr;
  }
  .hud-card {
    padding: 6px 6px;
    border-radius: 14px;
  }
  .score-value {
    font-size: 18px;
  }
  .coin-val {
    font-size: 12px;
  }
  .tactile-icon-btn {
    height: 25px;
    font-size: 11px;
    border-radius: 7px;
  }
}

/* Evolution Progress Ribbon */
#evolution-tracker {
  position: absolute;
  top: 94px;
  left: 10px;
  right: 10px;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border-subtle);
  border-radius: 12px;
  padding: 5px 12px;
  z-index: 10;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

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

.tracker-tag {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--accent-gold);
  text-transform: uppercase;
}

.tracker-tier-name {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}

.tracker-bar-container {
  position: relative;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: visible;
  display: flex;
  align-items: center;
}

.tracker-fill-bar {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #38bdf8 0%, #facc15 80%, #ef4444 100%);
  box-shadow: 0 0 8px rgba(250, 204, 21, 0.6);
  transition: width 0.4s var(--spring-bounce);
}

.tracker-pips {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2px;
}

.tracker-pip-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transition: background 0.3s ease, transform 0.3s ease;
}

.tracker-pip-dot.active {
  background: #fff;
  transform: scale(1.6);
  box-shadow: 0 0 6px #fff;
}

/* Danger Alert Banner */
#danger-alert {
  position: absolute;
  top: 125px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(220, 38, 38, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.3px;
  padding: 6px 12px;
  border-radius: 28px;
  display: none;
  z-index: 25;
  box-shadow: 0 0 28px rgba(239, 68, 68, 0.85), 0 6px 18px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
  white-space: nowrap;
  border: 1.5px solid rgba(254, 202, 202, 0.4);
  align-items: center;
}

.danger-info-wrap {
  display: inline-flex;
  align-items: center;
  margin-right: 8px;
}

.danger-rescue-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 18px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 14px rgba(245, 158, 11, 0.6);
  transition: transform 0.15s ease, filter 0.15s ease;
  pointer-events: auto;
}

.danger-rescue-btn:hover {
  transform: scale(1.05);
  filter: brightness(1.15);
}

.danger-rescue-btn:active {
  transform: scale(0.95);
}

.danger-rescue-shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  animation: rescue-shine 1.6s infinite;
}

@keyframes rescue-shine {
  0% { left: -100%; }
  40%, 100% { left: 200%; }
}

.danger-pulsar {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  margin-right: 6px;
  animation: pulse-dot 0.55s infinite alternate;
}

@keyframes pulse-danger {
  from { transform: translateX(-50%) scale(0.96); opacity: 0.9; }
  to { transform: translateX(-50%) scale(1.04); opacity: 1; }
}

@keyframes pulse-dot {
  from { transform: scale(0.8); opacity: 0.6; }
  to { transform: scale(1.3); opacity: 1; }
}

/* Main Canvas Area */
#canvas-container {
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

#game-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Floating Island Booster Dock with Hotkey Badges */
#booster-bar {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  height: 72px;
  background: var(--glass-surface);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow), var(--glass-highlight);
  border-radius: 22px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 10px;
  z-index: 10;
}

.booster-btn {
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  transition: transform 0.12s var(--spring-bounce);
}

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

.booster-icon-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.booster-btn.active .booster-icon-wrap {
  border-color: var(--accent-gold);
  background: rgba(250, 204, 21, 0.22);
  box-shadow: 0 0 16px rgba(250, 204, 21, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.pause-dock-btn .pause-icon-wrap {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.45);
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.pause-dock-btn:hover .pause-icon-wrap {
  background: rgba(239, 68, 68, 0.28);
  border-color: rgba(239, 68, 68, 0.7);
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.pause-dock-btn .hotkey-badge {
  background: rgba(239, 68, 68, 0.3);
  border-color: rgba(239, 68, 68, 0.6);
  color: #fecaca;
}

.booster-icon {
  font-size: 20px;
}

.booster-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.2px;
}

.booster-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #2563eb;
  border: 1.5px solid #0f172a;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.booster-btn.free-ad .booster-count {
  background: #10b981;
}

.hotkey-badge {
  position: absolute;
  bottom: -4px;
  left: -4px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid var(--glass-border);
  color: #cbd5e1;
  font-size: 9px;
  font-weight: 800;
  padding: 0 4px;
  border-radius: 6px;
}

/* Modals & Sheets (Stitch Style) */
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(4, 7, 15, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  z-index: 300;
}

.modal-card {
  width: 100%;
  max-width: 390px;
  background: rgba(18, 25, 42, 0.94);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 28px;
  padding: 26px 22px;
  text-align: center;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(28px) scale(0.96);
  transition: transform 0.32s var(--spring-bounce);
  max-height: 88vh;
  overflow-y: auto;
}

.modal-overlay.open .modal-card {
  transform: translateY(0) scale(1);
}

.modal-icon-badge {
  font-size: 44px;
  margin-bottom: 8px;
  display: inline-block;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
}

.modal-title {
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.3px;
  margin-bottom: 4px;
}

.modal-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

/* Stats Bento Grid */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.stat-item {
  background: rgba(11, 16, 29, 0.65);
  border: 1px solid var(--glass-border-subtle);
  border-radius: 18px;
  padding: 12px;
}

.stat-item.highlight-card {
  background: rgba(250, 204, 21, 0.08);
  border-color: rgba(250, 204, 21, 0.25);
}

.stat-title {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
}

.stat-val {
  font-size: 24px;
  font-weight: 900;
  color: #fff;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.stat-gold {
  color: var(--accent-gold);
}

/* Tactile Buttons */
.btn {
  position: relative;
  width: 100%;
  padding: 14px 20px;
  border-radius: 18px;
  font-size: 15px;
  font-weight: 800;
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  overflow: hidden;
  transition: transform 0.12s var(--spring-bounce), box-shadow 0.15s ease;
}

.btn:active {
  transform: scale(0.96) translateY(2px);
}

.btn-revive {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-shimmer {
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  animation: btn-shine 2.5s infinite;
}

@keyframes btn-shine {
  0% { left: -100%; }
  35% { left: 140%; }
  100% { left: 140%; }
}

.btn-reward {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* Shop Bento Items */
.shop-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.shop-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(11, 16, 29, 0.6);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  padding: 10px 14px;
}

.shop-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.shop-icon-circle {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
}

.shop-card-title {
  font-weight: 800;
  font-size: 14px;
}

.shop-card-desc {
  font-size: 11px;
  color: var(--text-secondary);
}

.shop-buy-btn {
  background: var(--accent-gold);
  color: #0b0f19;
  border: none;
  font-weight: 900;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(250, 204, 21, 0.35);
  transition: transform 0.1s var(--spring-bounce);
}

.shop-buy-btn:active {
  transform: scale(0.92);
}

/* Leaderboard Rows */
.lb-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.lb-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(11, 16, 29, 0.6);
  border: 1px solid var(--glass-border-subtle);
  border-radius: 14px;
  padding: 10px 14px;
  font-size: 13px;
}

.lb-rank {
  font-weight: 900;
  color: var(--accent-gold);
  width: 26px;
}

.lb-name {
  flex: 1;
  text-align: left;
  font-weight: 700;
}

.lb-score {
  font-weight: 900;
  color: #fff;
}

/* Help & Evolution Guide List */
.controls-guide-card {
  background: rgba(11, 16, 29, 0.7);
  border: 1px solid var(--glass-border-subtle);
  padding: 12px;
  border-radius: 16px;
  font-size: 13px;
  text-align: left;
  margin-bottom: 16px;
  line-height: 1.5;
}

.evo-section-title {
  font-size: 14px;
  margin: 12px 0 8px;
  text-align: left;
  color: var(--accent-gold);
  font-weight: 800;
}

.evo-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 20px;
}

.evo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(11, 16, 29, 0.6);
  border: 1px solid var(--glass-border-subtle);
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
}

.evo-tier-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 11px;
  font-weight: 900;
  color: #0b0f19;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* ========================================================
   Monetization & Rewarded Ad UI Components (Google Stitch)
   ======================================================== */

/* 1. Top Brand Bar Ad Pill */
.tactile-ad-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.25), rgba(16, 185, 129, 0.25));
  border: 1px solid rgba(250, 204, 21, 0.5);
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  padding: 4px 10px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s var(--spring-bounce), box-shadow 0.2s ease;
  animation: pulse-ad-glow 2.5s infinite alternate;
}

.tactile-ad-pill-btn:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 0 18px rgba(250, 204, 21, 0.4);
}

.tactile-ad-pill-btn:active {
  transform: scale(0.94);
}

.ad-pill-icon {
  font-size: 12px;
}

.ad-pill-label {
  color: var(--accent-gold);
  font-weight: 900;
  letter-spacing: 0.3px;
}

@keyframes pulse-ad-glow {
  0% { box-shadow: 0 0 8px rgba(250, 204, 21, 0.15); }
  100% { box-shadow: 0 0 18px rgba(16, 185, 129, 0.35); }
}

/* 2. Coin Badge Ad Plus Button */
.coin-ad-plus-btn {
  background: linear-gradient(135deg, #10b981, #059669);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  border-radius: 12px;
  padding: 2px 6px;
  margin-left: 4px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.4);
  transition: transform 0.1s var(--spring-bounce);
  animation: bounce-subtle 3s infinite;
}

.coin-ad-plus-btn:hover {
  transform: scale(1.08);
}

.coin-ad-plus-btn:active {
  transform: scale(0.9);
}

@keyframes bounce-subtle {
  0%, 80%, 100% { transform: translateY(0); }
  85% { transform: translateY(-2px); }
  90% { transform: translateY(0); }
  95% { transform: translateY(-1px); }
}

/* 3. Floating Free Gift Chest Button */
.floating-gift-ad-btn {
  position: absolute;
  bottom: 84px;
  right: 14px;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid rgba(250, 204, 21, 0.6);
  border-radius: 16px;
  padding: 6px 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 16px rgba(250, 204, 21, 0.25);
  cursor: pointer;
  transition: transform 0.2s var(--spring-bounce), box-shadow 0.2s ease;
  animation: gift-wobble 4s infinite ease-in-out;
}

.floating-gift-ad-btn:hover {
  transform: scale(1.06) translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5), 0 0 24px rgba(250, 204, 21, 0.45);
}

.floating-gift-ad-btn:active {
  transform: scale(0.92);
}

.gift-pulse-ring {
  position: absolute;
  inset: -4px;
  border-radius: 18px;
  border: 2px solid rgba(250, 204, 21, 0.4);
  animation: ring-pulse 2s infinite ease-out;
  pointer-events: none;
}

@keyframes ring-pulse {
  0% { transform: scale(0.95); opacity: 1; }
  100% { transform: scale(1.15); opacity: 0; }
}

@keyframes gift-wobble {
  0%, 85%, 100% { transform: rotate(0deg); }
  87% { transform: rotate(-6deg) scale(1.05); }
  91% { transform: rotate(6deg) scale(1.05); }
  95% { transform: rotate(-3deg) scale(1.03); }
  98% { transform: rotate(0deg); }
}

.floating-gift-icon {
  font-size: 22px;
  filter: drop-shadow(0 2px 6px rgba(250, 204, 21, 0.5));
}

.floating-gift-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.1;
}

.gift-text-title {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: var(--accent-gold);
  text-transform: uppercase;
}

.gift-text-tag {
  font-size: 11px;
  font-weight: 800;
  color: #34d399;
}

/* 4. Active Quests Ad Item */
.quest-item.quest-ad-card {
  border-color: rgba(250, 204, 21, 0.35);
  background: rgba(234, 179, 8, 0.06);
}

.quest-ad-action-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.quest-watch-ad-btn {
  background: linear-gradient(135deg, #10b981, #059669);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
  transition: transform 0.1s var(--spring-bounce);
}

.quest-watch-ad-btn:active {
  transform: scale(0.92);
}

/* 5. Shop Ad Hero Banner */
.shop-ad-hero-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.15), rgba(16, 185, 129, 0.12));
  border: 1.5px solid rgba(250, 204, 21, 0.4);
  border-radius: 16px;
  padding: 12px 14px;
  margin-bottom: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.shop-ad-hero-icon {
  font-size: 28px;
  filter: drop-shadow(0 2px 8px rgba(250, 204, 21, 0.4));
}

.shop-ad-hero-text {
  flex: 1;
  text-align: left;
}

.shop-ad-hero-title {
  font-size: 13px;
  font-weight: 900;
  color: #fff;
}

.shop-ad-hero-sub {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.shop-hero-ad-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #0b0f19;
  font-size: 12px;
  font-weight: 900;
  padding: 8px 14px;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
  transition: transform 0.1s var(--spring-bounce);
  white-space: nowrap;
}

.shop-hero-ad-btn:active {
  transform: scale(0.92);
}

/* Dual Actions inside Shop Card */
.shop-card-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.shop-free-ad-btn {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.3));
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #34d399;
  font-size: 11px;
  font-weight: 900;
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.1s var(--spring-bounce), background 0.15s ease;
  white-space: nowrap;
}

.shop-free-ad-btn:hover {
  background: rgba(16, 185, 129, 0.35);
  transform: scale(1.04);
}

.shop-free-ad-btn:active {
  transform: scale(0.92);
}

/* Pulsing free-ad booster button */
.booster-btn.free-ad .booster-count {
  background: #10b981;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
  animation: pulse-free-badge 1s infinite alternate;
}

@keyframes pulse-free-badge {
  from { transform: scale(1); box-shadow: 0 0 4px #10b981; }
  to { transform: scale(1.15); box-shadow: 0 0 10px #10b981; }
}

/* ==========================================================================
   Main Menu Overlay ('Главное меню')
   ========================================================================== */
.main-menu-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, rgba(13, 20, 36, 0.94) 0%, rgba(6, 10, 20, 0.98) 100%);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 120;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.main-menu-overlay.open {
  display: flex;
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.btn-play-hero *,
.menu-nav-btn * {
  pointer-events: none;
}

.menu-card {
  position: relative;
  width: 100%;
  max-width: 390px;
  background: rgba(18, 25, 42, 0.92);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 32px;
  padding: 26px 20px 22px 20px;
  text-align: center;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateY(24px) scale(0.95);
  transition: transform 0.4s var(--spring-bounce);
  overflow: hidden;
}

.main-menu-overlay.open .menu-card {
  transform: translateY(0) scale(1);
}

.menu-mascot-glow {
  position: absolute;
  top: 15px;
  width: 240px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.35) 0%, rgba(217, 119, 6, 0.12) 55%, transparent 80%);
  filter: blur(34px);
  pointer-events: none;
  animation: pulse-mascot-glow 4s infinite alternate ease-in-out;
}

@keyframes pulse-mascot-glow {
  from { transform: scale(0.9); opacity: 0.6; }
  to { transform: scale(1.18); opacity: 0.95; }
}

.menu-mascot-container {
  position: relative;
  margin-bottom: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mascot-avatar-wrap {
  animation: mascot-float 3.6s infinite ease-in-out;
  filter: drop-shadow(0 14px 26px rgba(0, 0, 0, 0.5));
}

@keyframes mascot-float {
  0% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(1deg); }
  100% { transform: translateY(0px) rotate(0deg); }
}

.mascot-steam-left {
  animation: steam-rise-1 2.5s infinite linear;
}

.mascot-steam-right {
  animation: steam-rise-2 2.9s infinite linear 0.7s;
}

@keyframes steam-rise-1 {
  0% { opacity: 0; transform: translateY(5px); }
  40% { opacity: 0.85; }
  100% { opacity: 0; transform: translateY(-14px); }
}

@keyframes steam-rise-2 {
  0% { opacity: 0; transform: translateY(5px); }
  40% { opacity: 0.85; }
  100% { opacity: 0; transform: translateY(-14px); }
}

.mascot-onsen-badge {
  margin-top: -6px;
  background: rgba(245, 158, 11, 0.22);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fde047;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 12px;
  border-radius: 12px;
  letter-spacing: 0.4px;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.menu-title-wrap {
  margin-bottom: 12px;
}

.menu-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
  margin-bottom: 3px;
}

.menu-title-sub {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #fb923c;
  text-transform: uppercase;
}

.menu-title-main {
  font-size: 27px;
  font-weight: 900;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fef08a 0%, #facc15 35%, #fb923c 70%, #f43f5e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 10px rgba(250, 204, 21, 0.4));
}

.menu-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 2px;
}

.menu-stats-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 8px 20px;
  margin-bottom: 16px;
  width: 100%;
}

.menu-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.menu-stat-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: var(--text-tertiary);
  text-transform: uppercase;
}

.menu-stat-value {
  font-size: 15px;
  font-weight: 900;
  color: #f8fafc;
}

.menu-stat-divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.12);
}

/* Big Juicy PLAY Button with tactile physics */
.btn-play-hero {
  position: relative;
  width: 100%;
  height: 58px;
  border: none;
  border-radius: 20px;
  background: linear-gradient(180deg, #34d399 0%, #10b981 60%, #059669 100%);
  box-shadow: 0 8px 0 #047857, 0 16px 30px rgba(16, 185, 129, 0.5), inset 0 2px 2px rgba(255, 255, 255, 0.5);
  color: #ffffff;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.15s ease;
  margin-bottom: 14px;
  overflow: hidden;
}

.btn-play-hero:hover {
  filter: brightness(1.06);
  transform: translateY(-2px);
  box-shadow: 0 10px 0 #047857, 0 20px 36px rgba(16, 185, 129, 0.55), inset 0 2px 2px rgba(255, 255, 255, 0.5);
}

.btn-play-hero:active {
  transform: translateY(6px);
  box-shadow: 0 2px 0 #047857, 0 6px 14px rgba(16, 185, 129, 0.4), inset 0 2px 2px rgba(255, 255, 255, 0.3);
}

.btn-play-hero .play-icon {
  font-size: 20px;
}

/* Secondary Navigation Grid in Menu */
.menu-nav-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
}

.menu-nav-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 9px 6px;
  color: #f1f5f9;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: transform 0.12s var(--spring-bounce), background 0.15s ease, border-color 0.15s ease;
}

.menu-nav-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.25);
}

.menu-nav-btn:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.2);
}

.menu-nav-icon {
  font-size: 18px;
}

.menu-nav-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Language Selection Modal */
.lang-modal-card {
  max-width: 360px;
}

.lang-options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 0;
}

.lang-opt-btn {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  color: #fff;
  transition: all 0.15s ease;
  width: 100%;
  text-align: left;
}

.lang-opt-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.lang-opt-btn.active {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.6);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.25);
}

.lang-opt-flag {
  font-size: 26px;
}

.lang-opt-details {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.lang-opt-name {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
}

.lang-opt-sub {
  font-size: 11px;
  color: var(--text-tertiary);
}

.lang-opt-check {
  font-size: 18px;
  font-weight: 900;
  color: #10b981;
  width: 22px;
  text-align: right;
}

/* ==========================================================================
   Pause Modal ('Пауза')
   ========================================================================== */
.pause-modal-card {
  max-width: 360px;
  padding: 24px 20px;
}

.pause-stats-strip {
  display: flex;
  justify-content: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 8px 16px;
  margin: 12px 0 16px 0;
  width: 100%;
}

.pause-stat-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pause-stat-title {
  font-size: 9px;
  font-weight: 800;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pause-stat-val {
  font-size: 16px;
  font-weight: 900;
  color: #ffffff;
}

.pause-actions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.btn-pause-action {
  height: 46px;
  font-size: 14px;
  font-weight: 800;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
}

.btn-action-icon {
  font-size: 16px;
}

.btn-menu-return {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  color: #cbd5e1;
}

/* Compact layout for short vertical screens */
@media (max-height: 680px) {
  .menu-card {
    padding: 16px 16px 14px 16px;
    max-height: 94vh;
  }
  .mascot-svg {
    width: 100px;
    height: 100px;
  }
  .menu-title-main {
    font-size: 22px;
  }
  .btn-play-hero {
    height: 48px;
    font-size: 18px;
    margin-bottom: 10px;
  }
  .pause-modal-card {
    padding: 18px 16px;
  }
  .btn-pause-action {
    height: 40px;
    font-size: 13px;
  }
}


/* ========================================================
   Active Tool Banner (Cancel & Tool Guidance UI)
   ======================================================== */
.active-tool-banner {
  position: absolute;
  top: 135px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.9), rgba(236, 72, 153, 0.9));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  border-radius: 20px;
  padding: 8px 16px;
  box-shadow: 0 8px 24px rgba(168, 85, 247, 0.4), 0 0 16px rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  animation: bounce-tool-banner 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bounce-tool-banner {
  0% { transform: translate(-50%, -20px) scale(0.9); opacity: 0; }
  100% { transform: translate(-50%, 0) scale(1); opacity: 1; }
}

.cancel-tool-btn {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease;
}

.cancel-tool-btn:hover {
  background: rgba(0, 0, 0, 0.4);
  transform: scale(1.05);
}

.cancel-tool-btn:active {
  transform: scale(0.92);
}

/* ========================================================
   Interactive FTUE Tutorial Modal Styles
   ======================================================== */
.tutorial-modal-card {
  max-width: 440px;
  width: 92%;
  background: linear-gradient(180deg, #131d2e 0%, #0d1522 100%);
  border: 1.5px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7), 0 0 30px rgba(56, 189, 248, 0.15);
  border-radius: 24px;
  padding: 24px 22px;
  text-align: center;
}

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

.tutorial-badge {
  font-size: 11px;
  font-weight: 900;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 4px 10px;
  border-radius: 12px;
  letter-spacing: 0.5px;
}

.tutorial-step-indicator {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.tutorial-slides-container {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-bottom: 20px;
}

.tutorial-slide {
  animation: fade-in-slide 0.3s ease;
}

@keyframes fade-in-slide {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.tut-visual-icon {
  font-size: 52px;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 12px rgba(250, 204, 21, 0.3));
}

.tut-slide-title {
  font-size: 18px;
  font-weight: 900;
  color: #fff;
  margin: 0 0 8px;
}

.tut-slide-desc {
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.5;
  margin: 0 0 14px;
}

.tut-tip-chip {
  display: inline-block;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 12px;
  text-align: left;
}

.tut-merge-demo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
}

.tut-creature {
  font-size: 38px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tut-creature.tut-result {
  background: rgba(234, 179, 8, 0.2);
  border: 1.5px solid rgba(250, 204, 21, 0.6);
  font-size: 42px;
  width: 60px;
  height: 60px;
  animation: bounce-subtle 2s infinite;
}

.tut-plus, .tut-arrow {
  font-size: 18px;
  font-weight: 900;
  color: var(--accent-gold);
}

.tut-boosters-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
}

.tut-booster-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 8px 10px;
  font-size: 18px;
}

.tut-booster-chip span {
  font-size: 10px;
  font-weight: 800;
  color: var(--text-secondary);
}

.tut-footer-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.tut-footer-nav button {
  flex: 1;
}

/* Milestone Mystery Gift Modal */
.gift-modal-card {
  border: 2px solid rgba(250, 204, 21, 0.6) !important;
  box-shadow: 0 0 35px rgba(250, 204, 21, 0.35), 0 20px 40px rgba(0, 0, 0, 0.7) !important;
}

.gift-badge-glow {
  background: radial-gradient(circle, rgba(250, 204, 21, 0.3) 0%, transparent 70%);
  border-color: #facc15 !important;
  animation: gift-wobble 3s infinite ease-in-out;
}

.gift-preview-prizes {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 14px 0 20px;
}

.gift-prize-pill {
  background: rgba(250, 204, 21, 0.15);
  border: 1px solid rgba(250, 204, 21, 0.5);
  color: #fef08a;
  font-weight: 800;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 14px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Booster Count Empty Ad Indicator */
.booster-count.empty-ad {
  background: linear-gradient(135deg, #eab308, #ca8a04) !important;
  color: #fff !important;
  font-size: 9px !important;
  font-weight: 900 !important;
  border: 1px solid rgba(255, 255, 255, 0.6) !important;
  box-shadow: 0 0 8px rgba(234, 179, 8, 0.7) !important;
  padding: 1px 4px !important;
  border-radius: 8px !important;
}

/* ==========================================================================
   Start Gate Blur Overlay ("Кликни, чтобы начать" - Web Audio Unlock)
   ========================================================================== */
#start-gate-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 99999;
  background: radial-gradient(circle at 50% 40%, rgba(15, 23, 42, 0.88) 0%, rgba(6, 10, 20, 0.98) 100%);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  cursor: pointer;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s ease;
  user-select: none;
}

#start-gate-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.start-gate-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 440px;
  width: 100%;
  padding: 38px 28px 30px;
  background: rgba(24, 33, 54, 0.75);
  border: 2px solid rgba(245, 158, 11, 0.4);
  border-radius: 36px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.8), 0 0 40px rgba(245, 158, 11, 0.25);
  transform: scale(1);
  animation: gateCardPop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.start-gate-mascot-badge {
  position: relative;
  width: 105px;
  height: 105px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.3) 0%, rgba(245, 158, 11, 0.05) 70%);
  border: 2px solid rgba(245, 158, 11, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  margin-bottom: 18px;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.3);
  animation: gateFloat 2.4s ease-in-out infinite alternate;
}

.gate-steam {
  position: absolute;
  top: -10px;
  font-size: 22px;
  animation: gateSteam 1.8s ease-in-out infinite;
}

.gate-citrus {
  position: absolute;
  top: 4px;
  right: 18px;
  font-size: 24px;
}

.start-gate-title {
  font-size: 32px;
  font-weight: 1000;
  color: #ffffff;
  letter-spacing: 1px;
  margin-bottom: 6px;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.7);
}

.start-gate-subtitle {
  font-size: 16px;
  font-weight: 700;
  color: #cbd5e1;
  margin-bottom: 24px;
  line-height: 1.4;
}

.start-gate-prompt-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 16px 28px;
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  border: 2px solid #fef08a;
  border-radius: 999px;
  color: #ffffff;
  font-size: 18px;
  font-weight: 1000;
  letter-spacing: 1.5px;
  box-shadow: 0 10px 30px rgba(234, 88, 12, 0.5), 0 0 20px rgba(245, 158, 11, 0.4);
  animation: gatePulse 1.2s ease-in-out infinite alternate;
}

.gate-hand-icon {
  font-size: 24px;
  animation: gateTap 1.2s ease-in-out infinite alternate;
}

.start-gate-subtip {
  margin-top: 14px;
  font-size: 13px;
  color: #64748b;
  font-weight: 600;
}

@keyframes gateCardPop {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes gateFloat {
  0% { transform: translateY(0); }
  100% { transform: translateY(-8px); }
}

@keyframes gateSteam {
  0% { transform: translateY(0) scale(0.8); opacity: 0.4; }
  50% { opacity: 0.9; }
  100% { transform: translateY(-10px) scale(1.1); opacity: 0; }
}

@keyframes gatePulse {
  0% { transform: scale(1); box-shadow: 0 8px 25px rgba(234, 88, 12, 0.4); }
  100% { transform: scale(1.04); box-shadow: 0 12px 35px rgba(234, 88, 12, 0.7), 0 0 25px rgba(245, 158, 11, 0.6); }
}

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

