/* ==========================================================================
   Sombrero Bound - Premium Fiesta Ascent Mobile Stylesheet
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-dark: #0f071e;
  --bg-surface: rgba(22, 11, 44, 0.75);
  --primary: #ff4757;
  --primary-glow: rgba(255, 71, 87, 0.45);
  --secondary: #ffa502;
  --secondary-glow: rgba(255, 165, 2, 0.4);
  --accent: #2ed573;
  --accent-cyan: #00d2d3;
  --accent-purple: #9b59b6;
  --text-main: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.72);
  --text-faint: rgba(255, 255, 255, 0.45);
  --border-glass: rgba(255, 255, 255, 0.18);
  --border-glass-bright: rgba(255, 255, 255, 0.32);
  --glass-bg: rgba(25, 14, 46, 0.65);
  --glass-card: rgba(255, 255, 255, 0.08);

  /* Typography */
  --font-display: 'Fredoka', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Shadows */
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.38);
  --shadow-glow: 0 0 20px rgba(255, 71, 87, 0.5);

  /* Radius */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.45;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Tap & Focus Ergonomics */
button, input, select, textarea {
  font-family: inherit;
  font-size: 16px; /* Prevents auto-zoom on iOS */
  color: inherit;
  border: none;
  outline: none;
  background: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

button:active {
  transform: scale(0.96);
}

/* App Container (Strict Mobile Container <= 480px) */
.app-container {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  background: url('bg.jpg') center top / cover no-repeat;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.85);
}

/* Background Atmospheric Overlay (Crisp Background Preservation) */
.bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(15, 7, 30, 0.45) 0%,
    rgba(15, 7, 30, 0.25) 30%,
    rgba(15, 7, 30, 0.35) 70%,
    rgba(15, 7, 30, 0.75) 100%
  );
  pointer-events: none;
  z-index: 1;
}

/* Top Status Bar */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 12px 16px;
  background: rgba(15, 7, 30, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--glass-card);
  padding: 4px 12px 4px 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-glass);
  cursor: pointer;
  transition: var(--transition);
}

.user-chip:active {
  transform: scale(0.96);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--secondary);
  box-shadow: 0 0 10px var(--secondary-glow);
}

.user-meta {
  display: flex;
  flex-direction: column;
}

.user-level {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--secondary);
}

.user-title {
  font-size: 11px;
  color: var(--text-muted);
}

.wallet-pills {
  display: flex;
  align-items: center;
  gap: 8px;
}

.currency-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-glass);
}

.coin-pill {
  background: rgba(255, 165, 2, 0.16);
  color: #ffd32a;
}

.star-pill {
  background: rgba(46, 213, 115, 0.16);
  color: #2ed573;
}

/* Main Viewport & Views */
.main-viewport {
  position: relative;
  flex: 1;
  z-index: 10;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 74px);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.view {
  display: none;
  padding: 16px;
  animation: fadeIn 0.25s ease-out forwards;
}

.view.active {
  display: block;
}

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

/* Glass Panels & Cards */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 18px;
}

.glass-card {
  background: var(--glass-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 14px;
}

/* Buttons */
.btn {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 12px 20px;
  min-height: 48px;
  border-radius: var(--radius-md);
  gap: 8px;
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.btn-primary {
  background: linear-gradient(135deg, #ff4757, #ff6b81);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 6px 18px var(--primary-glow);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid var(--border-glass-bright);
}

.btn-accent {
  background: linear-gradient(135deg, #2ed573, #10ac84);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 14px rgba(46, 213, 115, 0.35);
}

.btn-gold {
  background: linear-gradient(135deg, #ffa502, #ff7f50);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 14px var(--secondary-glow);
}

.btn-outline {
  border: 1px solid var(--border-glass-bright);
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.25);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  min-height: 36px;
  padding: 6px 14px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.btn-lg {
  min-height: 52px;
  font-size: 17px;
  border-radius: var(--radius-lg);
}

.btn-pulse {
  animation: pulseButton 2s infinite;
}

@keyframes pulseButton {
  0% { transform: scale(1); box-shadow: 0 6px 18px var(--primary-glow); }
  50% { transform: scale(1.02); box-shadow: 0 8px 26px rgba(255, 71, 87, 0.7); }
  100% { transform: scale(1); box-shadow: 0 6px 18px var(--primary-glow); }
}

/* VIEW 1: HOME VIEW COMPONENTS */
.hero-card {
  position: relative;
  text-align: center;
  padding: 24px 18px 20px 18px;
  margin-bottom: 16px;
  background: radial-gradient(circle at 50% 20%, rgba(255, 71, 87, 0.25), transparent 70%), var(--glass-bg);
}

.hero-badge {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(255, 165, 2, 0.2);
  border: 1px solid rgba(255, 165, 2, 0.4);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  color: #ffd32a;
  margin-bottom: 12px;
}

.hero-img-wrap {
  width: 110px;
  height: 110px;
  margin: 0 auto 12px;
  position: relative;
}

.hero-logo {
  width: 100%;
  height: 100%;
  border-radius: 26px;
  object-fit: cover;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 20px var(--primary-glow);
  border: 2px solid rgba(255, 255, 255, 0.35);
}

.floating-anim {
  animation: floatingHero 3s ease-in-out infinite;
}

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

.game-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  background: linear-gradient(135deg, #ffffff 40%, #ffa502 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.15;
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.game-tagline {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 320px;
  margin: 0 auto 18px;
}

.hero-actions {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 10px;
}

/* Quick Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}

.stat-icon {
  font-size: 26px;
}

.stat-details {
  display: flex;
  flex-direction: column;
}

.stat-lbl {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-num {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
}

/* Card Header Rows */
.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.ch-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.ch-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
}

.ch-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.badge-tag {
  background: rgba(46, 213, 115, 0.2);
  color: #2ed573;
  border: 1px solid rgba(46, 213, 115, 0.4);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
}

/* Daily Reward Days Row */
.daily-reward-card {
  margin-bottom: 16px;
}

.daily-days-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.daily-day-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 2px;
  border-radius: var(--radius-sm);
  background: var(--glass-card);
  border: 1px solid var(--border-glass);
  text-align: center;
  gap: 4px;
  transition: var(--transition);
}

.daily-day-pill .d-day {
  font-size: 10px;
  color: var(--text-faint);
  font-weight: 600;
}

.daily-day-pill .d-icon {
  font-size: 16px;
}

.daily-day-pill .d-val {
  font-size: 10px;
  font-weight: 700;
  color: #ffd32a;
}

.daily-day-pill.claimed {
  background: rgba(46, 213, 115, 0.2);
  border-color: rgba(46, 213, 115, 0.5);
  opacity: 0.7;
}

.daily-day-pill.current {
  background: rgba(255, 165, 2, 0.25);
  border-color: #ffa502;
  box-shadow: 0 0 10px var(--secondary-glow);
  transform: translateY(-2px);
}

.daily-day-pill.locked {
  opacity: 0.5;
}

/* Quests List */
.quests-card {
  margin-bottom: 16px;
}

.quests-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quest-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--glass-card);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
}

.quest-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  margin-right: 12px;
}

.quest-title {
  font-size: 13px;
  font-weight: 600;
}

.quest-bar-wrap {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.quest-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #ffa502, #ff4757);
  border-radius: var(--radius-full);
  transition: width 0.3s;
}

.quest-reward {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: #ffd32a;
  white-space: nowrap;
}

/* SECTION HEADERS (For Inner Views) */
.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 4px 0;
}

.icon-back-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--glass-card);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-titles {
  flex: 1;
}

.view-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.view-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

/* VIEW 2: LEVEL SELECT GRID (30 Levels) */
.levels-scroller {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.levels-tier-badge {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 8px;
  background: rgba(255, 165, 2, 0.1);
  border-radius: var(--radius-sm);
  display: inline-block;
  align-self: flex-start;
}

.levels-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.level-card {
  position: relative;
  aspect-ratio: 1;
  background: var(--glass-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  transition: var(--transition);
}

.level-card.unlocked {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}

.level-card.unlocked:active {
  transform: scale(0.92);
}

.level-card.current {
  background: rgba(255, 71, 87, 0.25);
  border-color: #ff4757;
  box-shadow: 0 0 12px var(--primary-glow);
}

.level-card.locked {
  opacity: 0.45;
  cursor: not-allowed;
}

.level-num {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
}

.level-stars {
  font-size: 9px;
  letter-spacing: -1px;
  color: #ffd32a;
}

.level-lock-icon {
  font-size: 14px;
  opacity: 0.7;
}

/* VIEW 3: GAMEPLAY CANVAS & HUD */
#viewGame {
  padding: 0;
  height: calc(100vh - 74px - env(safe-area-inset-top, 0px));
  height: calc(100dvh - 74px - env(safe-area-inset-top, 0px));
  display: none;
  flex-direction: column;
  position: relative;
}

#viewGame.active {
  display: flex;
}

.game-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 12px 14px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.hud-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hud-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(15, 7, 30, 0.75);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-glass-bright);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.hud-center-meters {
  flex: 1;
  background: rgba(15, 7, 30, 0.75);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  padding: 4px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.altitude-meter {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.alt-label {
  font-size: 9px;
  color: var(--text-faint);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.alt-val {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: #ffd32a;
}

.target-progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 2px;
}

.target-fill {
  height: 100%;
  background: linear-gradient(90deg, #2ed573, #00d2d3);
  border-radius: var(--radius-full);
  transition: width 0.2s ease-out;
}

.hud-score-box {
  background: rgba(15, 7, 30, 0.75);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  padding: 4px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.score-label {
  font-size: 9px;
  color: var(--text-faint);
  font-weight: 700;
}

.score-val {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
}

.hud-powerups-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.powerup-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(15, 7, 30, 0.85);
  backdrop-filter: blur(8px);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--secondary);
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  animation: badgePop 0.2s ease-out;
}

@keyframes badgePop {
  0% { transform: scale(0.6); }
  100% { transform: scale(1); }
}

.combo-bubble {
  align-self: center;
  background: linear-gradient(135deg, #ff4757, #ffa502);
  padding: 4px 14px;
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(255, 71, 87, 0.5);
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.2s ease-out;
}

.combo-bubble.show {
  opacity: 1;
  transform: scale(1);
}

/* Canvas Wrapper */
.canvas-wrapper {
  position: relative;
  width: 100%;
  flex: 1;
  overflow: hidden;
  touch-action: none;
}

#gameCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Touch Control Zones Overlay */
.touch-zones-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  z-index: 10;
  pointer-events: auto;
}

.touch-zone {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 24px;
  touch-action: none;
  opacity: 0.25;
  transition: opacity 0.15s;
}

.touch-zone:active {
  opacity: 0.6;
  background: radial-gradient(circle at center 80%, rgba(255, 255, 255, 0.15), transparent 70%);
}

.zone-hint {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 1px;
}

/* VIEW 4: SOMBRERO WARDROBE SHOP */
.wardrobe-stage {
  text-align: center;
  margin-bottom: 16px;
  padding: 20px 16px;
  background: radial-gradient(circle at 50% 30%, rgba(255, 165, 2, 0.25), transparent 70%), var(--glass-bg);
}

.stage-pedestal {
  display: inline-block;
  position: relative;
  margin-bottom: 12px;
}

.preview-hero-frame {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 3px solid var(--secondary);
  box-shadow: 0 0 20px var(--secondary-glow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.avatar-hat-render {
  font-size: 34px;
  position: absolute;
  top: -12px;
}

.avatar-face-render {
  font-size: 32px;
  margin-top: 14px;
}

.preview-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.preview-perk {
  font-size: 12px;
  color: #2ed573;
  font-weight: 600;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.shop-card {
  background: var(--glass-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  position: relative;
}

.shop-card.equipped {
  border-color: #2ed573;
  box-shadow: 0 0 12px rgba(46, 213, 115, 0.3);
}

.shop-hat-icon {
  font-size: 36px;
  margin-bottom: 2px;
}

.shop-hat-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
}

.shop-hat-benefit {
  font-size: 11px;
  color: var(--text-muted);
  min-height: 28px;
}

.shop-action-btn {
  width: 100%;
  margin-top: 6px;
}

/* VIEW 5: ACHIEVEMENTS */
.achievements-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.ach-count-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 70px;
}

.ach-done-text {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: #ffd32a;
}

.ach-lbl {
  font-size: 11px;
  color: var(--text-muted);
}

.ach-progress-bar-wrap {
  flex: 1;
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.ach-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #ffa502, #2ed573);
  border-radius: var(--radius-full);
  transition: width 0.3s;
}

.achievements-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ach-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}

.ach-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.ach-card.unlocked .ach-icon-box {
  background: rgba(46, 213, 115, 0.2);
  box-shadow: 0 0 10px rgba(46, 213, 115, 0.3);
}

.ach-body {
  flex: 1;
}

.ach-title {
  font-size: 14px;
  font-weight: 700;
}

.ach-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.ach-progress-text {
  font-size: 10px;
  color: var(--text-faint);
}

.ach-reward-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: #ffd32a;
}

/* VIEW 6: SETTINGS */
.settings-group {
  margin-bottom: 16px;
  padding: 14px;
}

.group-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.setting-item:last-child {
  border-bottom: none;
}

.setting-item.clickable {
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  transition: var(--transition);
}

.setting-item.clickable:active {
  background: rgba(255, 255, 255, 0.08);
}

.setting-item.danger {
  color: #ff4757;
}

.item-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.item-name {
  font-size: 14px;
  font-weight: 600;
  display: block;
}

.item-desc {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
}

.item-chevron {
  font-size: 20px;
  color: var(--text-faint);
}

.item-action-text {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: #ff4757;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.2);
  transition: 0.3s;
  border-radius: 34px;
}

.slider::before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

input:checked + .slider {
  background: linear-gradient(135deg, #2ed573, #10ac84);
}

input:checked + .slider::before {
  transform: translateX(20px);
}

/* BOTTOM NAVIGATION (Ergonomic Mobile Bar) */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 8px 10px calc(env(safe-area-inset-bottom, 0px) + 8px) 10px;
  background: rgba(15, 7, 30, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-glass);
}

.nav-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 48px;
  height: 48px;
  color: var(--text-faint);
  transition: var(--transition);
}

.nav-tab.active {
  color: var(--secondary);
}

.tab-icon {
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tab-label {
  font-size: 10px;
  font-weight: 600;
}

.nav-tab-play {
  margin-top: -16px;
}

.play-icon-glow {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff4757, #ff6b81);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px var(--primary-glow);
  border: 2px solid rgba(255, 255, 255, 0.4);
  transition: var(--transition);
}

.nav-tab-play:active .play-icon-glow {
  transform: scale(0.92);
}

/* MODALS & BOTTOM SHEETS */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: flex-end;
  justify-content: center;
  animation: modalFadeIn 0.25s ease-out forwards;
}

.modal-overlay.active {
  display: flex;
}

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

.modal-sheet {
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: rgba(22, 11, 44, 0.94);
  border: 1px solid var(--border-glass);
  border-bottom: none;
  padding: 20px 18px calc(env(safe-area-inset-bottom, 0px) + 18px) 18px;
  display: flex;
  flex-direction: column;
  animation: sheetSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes sheetSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  text-align: center;
  margin-bottom: 16px;
}

.modal-pill {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(255, 165, 2, 0.2);
  border: 1px solid rgba(255, 165, 2, 0.4);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  color: #ffd32a;
  margin-bottom: 8px;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
}

.modal-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.sheet-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.close-sheet-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  font-size: 22px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sheet-scrollable {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  padding-right: 4px;
  margin-bottom: 14px;
}

.modal-footer {
  margin-top: 6px;
}

.modal-footer-dual {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 10px;
  margin-top: 14px;
}

/* Pause Modal */
.pause-modal {
  text-align: center;
}

.modal-actions-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

/* Result Modal */
.result-sheet {
  text-align: center;
}

.result-badge-wrap {
  margin-bottom: 8px;
}

.result-badge {
  display: inline-block;
  padding: 4px 14px;
  background: rgba(46, 213, 115, 0.2);
  border: 1px solid #2ed573;
  color: #2ed573;
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.result-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 8px;
}

.result-stars {
  display: flex;
  justify-content: center;
  gap: 8px;
  font-size: 32px;
  margin-bottom: 16px;
}

.result-stats-card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 12px 8px;
}

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

.r-lbl {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.r-val {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
}

/* Welcome Carousel & Features */
.welcome-carousel {
  text-align: center;
  margin-bottom: 16px;
}

.slide-illustration {
  width: 130px;
  height: 130px;
  margin: 0 auto 12px;
}

.welcome-hero-img {
  width: 100%;
  height: 100%;
  border-radius: 30px;
  object-fit: cover;
  box-shadow: 0 10px 30px var(--primary-glow);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.slide-info h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}

.slide-info p {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 320px;
  margin: 0 auto;
}

.welcome-features {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--glass-card);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
}

.feat-icon {
  font-size: 22px;
}

.feat-txt {
  display: flex;
  flex-direction: column;
}

.feat-txt strong {
  font-size: 13px;
  color: #ffffff;
}

.feat-txt span {
  font-size: 11px;
  color: var(--text-muted);
}

/* About Screen Hero */
.about-hero {
  text-align: center;
  margin-bottom: 14px;
}

.about-logo {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  margin-bottom: 8px;
  border: 2px solid var(--secondary);
}

.about-hero h4 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

.version-tag {
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.about-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 14px;
}

.help-section {
  background: var(--glass-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 12px;
}

.help-section h5 {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 8px;
}

.help-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.help-list strong {
  color: #ffffff;
}

.info-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

.info-row span {
  color: var(--text-muted);
}

.info-row strong {
  color: #ffffff;
}

/* Forms (Contact Support) */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass-bright);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 16px;
  color: #ffffff;
  transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.14);
}

.support-success-msg {
  display: none;
  background: rgba(46, 213, 115, 0.2);
  border: 1px solid #2ed573;
  color: #ffffff;
  padding: 12px;
  border-radius: var(--radius-md);
  margin-top: 12px;
  font-size: 13px;
  text-align: center;
}

/* Rate Modal */
.rate-content {
  text-align: center;
  padding: 10px 0;
}

.rate-stars-picker {
  display: flex;
  justify-content: center;
  gap: 8px;
  font-size: 38px;
  color: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  margin-bottom: 12px;
}

.rate-stars-picker .picker-star {
  transition: transform 0.2s, color 0.2s;
}

.rate-stars-picker .picker-star.active {
  color: #ffd32a;
  transform: scale(1.1);
  text-shadow: 0 0 12px rgba(255, 211, 42, 0.5);
}

.rate-prompt {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.rate-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass-bright);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 14px;
  color: #ffffff;
  margin-bottom: 14px;
}

/* Legal Documents */
.legal-text {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

.legal-text h4 {
  font-family: var(--font-display);
  font-size: 16px;
  color: #ffffff;
  margin-bottom: 4px;
}

.legal-text h5 {
  font-family: var(--font-display);
  font-size: 13px;
  color: #ffffff;
  margin: 12px 0 4px 0;
}

.legal-text p {
  margin-bottom: 8px;
}

/* Toast Notification */
.toast-notice {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 70px);
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(22, 11, 44, 0.95);
  backdrop-filter: blur(14px);
  border: 1px solid var(--secondary);
  border-radius: var(--radius-full);
  padding: 10px 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 15px var(--secondary-glow);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

.toast-msg {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}
