/* ═══════════════════════════════════════════════ */
/*  MESS INTEL V2 — Design System                 */
/* ═══════════════════════════════════════════════ */

/* ─── THEME TOKENS ─── */
:root,
[data-theme="dark"] {
  --bg-primary: #0a0a0f;
  --bg-secondary: #111118;
  --bg-card: rgba(255, 255, 255, 0.035);
  --bg-card-hover: rgba(255, 255, 255, 0.06);
  --bg-card-solid: #16161e;
  --bg-glass: rgba(255, 255, 255, 0.04);
  --text-primary: #f0f0f0;
  --text-secondary: #a0a0aa;
  --text-muted: #555560;
  --border: rgba(255, 255, 255, 0.07);
  --border-hover: rgba(255, 255, 255, 0.14);
  --shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
  --gradient-mesh-1: rgba(251, 191, 36, 0.04);
  --gradient-mesh-2: rgba(52, 211, 153, 0.03);
  --gradient-mesh-3: rgba(139, 92, 246, 0.03);
}

[data-theme="light"] {
  --bg-primary: #f5f5f0;
  --bg-secondary: #eeeee8;
  --bg-card: rgba(0, 0, 0, 0.03);
  --bg-card-hover: rgba(0, 0, 0, 0.06);
  --bg-card-solid: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.7);
  --text-primary: #1a1a1a;
  --text-secondary: #666666;
  --text-muted: #999999;
  --border: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(0, 0, 0, 0.15);
  --shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
  --gradient-mesh-1: rgba(251, 191, 36, 0.06);
  --gradient-mesh-2: rgba(52, 211, 153, 0.05);
  --gradient-mesh-3: rgba(139, 92, 246, 0.04);
}

/* Tier colours — universal */
:root {
  --tier-1: #ff3b3b;
  --tier-2: #ff8c00;
  --tier-3: #888;
  --tier-4: #34d399;
  --tier-5: #fbbf24;
  --star-color: #fbbf24;
  --star-empty: #333;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --nav-height: 72px;
  --header-height: 56px;
}

[data-theme="light"] {
  --star-empty: #ddd;
}

/* ─── RESET ─── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.5s ease, color 0.3s ease;
}

/* ─── BACKGROUND EFFECTS ─── */
.noise-overlay {
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.02;
  pointer-events: none;
  z-index: 9999;
}

.gradient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse at 20% 0%, var(--gradient-mesh-1) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, var(--gradient-mesh-2) 0%, transparent 50%),
    radial-gradient(ellipse at 40% 80%, var(--gradient-mesh-3) 0%, transparent 50%);
  transition: background 0.5s ease;
}

/* ─── APP HEADER ─── */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  transition: background 0.3s ease;
}

[data-theme="light"] .app-header {
  background: rgba(245, 245, 240, 0.85);
}

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

.header-logo {
  font-size: 20px;
}

.header-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.25s var(--ease);
}

.icon-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

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

[data-theme="dark"] .icon-moon {
  display: none;
}

[data-theme="light"] .icon-sun {
  display: none;
}

/* ─── MAIN ─── */
.app-main {
  padding: calc(var(--header-height) + 16px) 20px calc(var(--nav-height) + 24px);
  max-width: 680px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.view {
  animation: viewIn 0.4s var(--ease);
}

.view.hidden {
  display: none;
}

/* ─── BOTTOM NAV ─── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: rgba(10, 10, 15, 0.9);
  backdrop-filter: blur(24px);
  border-top: 1px solid var(--border);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
  transition: background 0.3s ease;
}

[data-theme="light"] .bottom-nav {
  background: rgba(245, 245, 240, 0.9);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.5px;
  padding: 8px 20px;
  border-radius: 12px;
  transition: all 0.3s var(--ease);
}

.nav-item:hover {
  color: var(--text-secondary);
}

.nav-item.active {
  color: var(--star-color);
}

.nav-item.active svg {
  stroke: var(--star-color);
}

/* ─── TODAY VIEW ─── */
.today-hero {
  text-align: center;
  padding: 24px 0 20px;
  animation: fadeInUp 0.6s var(--ease);
}

.today-greeting {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 4px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.today-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 8vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -1.5px;
  line-height: 1.1;
  margin-bottom: 6px;
}

[data-theme="dark"] .today-title {
  background: linear-gradient(180deg, #fff 30%, #666 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Countdown Ring */
.countdown-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  backdrop-filter: blur(20px);
  margin-bottom: 24px;
  animation: fadeInUp 0.6s var(--ease) 0.1s both;
}

.countdown-ring {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  position: relative;
}

.countdown-ring svg {
  transform: rotate(-90deg);
}

.countdown-ring circle {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
}

.countdown-ring .ring-bg {
  stroke: var(--border);
}

.countdown-ring .ring-progress {
  stroke: var(--tier-4);
  transition: stroke-dashoffset 1s var(--ease);
}

.countdown-ring.is-live .ring-progress {
  stroke: var(--star-color);
}

.countdown-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}

.countdown-info {
  flex: 1;
}

.countdown-status {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 2px;
}

.countdown-sub {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.countdown-status .live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tier-4);
  margin-right: 8px;
  animation: pulse 2s ease-in-out infinite;
  vertical-align: middle;
}

/* Countdown Timer Digits */
.countdown-timer {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 6px 0 4px;
  font-family: var(--font-mono);
}

.ct-digit {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 6px;
  border-radius: 6px;
  min-width: 34px;
  text-align: center;
  border: 1px solid var(--border);
  transition: color 0.3s;
}

[data-theme="light"] .ct-digit {
  background: rgba(0, 0, 0, 0.03);
}

.ct-sep {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-muted);
  animation: blinkSep 1s step-end infinite;
  padding: 0 1px;
}

.ct-secs {
  font-size: 18px;
  opacity: 0.7;
  min-width: 30px;
}

/* Active serving state — green glow */
.countdown-card.is-serving {
  border-color: rgba(52, 211, 153, 0.2);
  box-shadow: 0 0 30px rgba(52, 211, 153, 0.05);
}

.countdown-card.is-serving .ct-digit {
  color: var(--tier-4);
  border-color: rgba(52, 211, 153, 0.15);
  background: rgba(52, 211, 153, 0.06);
}

.countdown-card.is-serving .ct-sep {
  color: rgba(52, 211, 153, 0.5);
}

/* Waiting state — subtle amber hint */
.countdown-card.is-waiting .ct-digit {
  color: var(--star-color);
  border-color: rgba(251, 191, 36, 0.12);
  background: rgba(251, 191, 36, 0.04);
}

.countdown-card.is-waiting .ct-sep {
  color: rgba(251, 191, 36, 0.4);
}

@keyframes blinkSep {

  0%,
  49% {
    opacity: 1;
  }

  50%,
  100% {
    opacity: 0.3;
  }
}

.countdown-range-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--tier-4);
  background: rgba(52, 211, 153, 0.1);
  padding: 2px 8px;
  border-radius: 12px;
  margin-top: 6px;
  border: 1px solid rgba(52, 211, 153, 0.2);
}

.countdown-card.is-waiting .countdown-ring {
  animation: slowPulse 4s ease-in-out infinite;
}

@keyframes slowPulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.8;
  }

  50% {
    transform: scale(1.05);
    opacity: 1;
  }
}

.ct-unit {
  display: flex;
  align-items: center;
}

.hidden {
  display: none !important;
}

/* Verdict Pill */
.verdict-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 28px;
  animation: fadeInUp 0.6s var(--ease) 0.15s both;
}

.verdict-pill .v-emoji {
  font-size: 18px;
}

.verdict-pill .v-score {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  padding: 3px 10px;
  border-radius: 100px;
  border: 1px solid var(--border);
}

/* Meal Cards */
.meal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 16px;
  backdrop-filter: blur(20px);
  transition: all 0.35s var(--ease);
  animation: fadeInUp 0.5s var(--ease) both;
}

.meal-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.meal-card.is-now {
  border-color: rgba(52, 211, 153, 0.25);
  box-shadow: 0 0 40px rgba(52, 211, 153, 0.04);
}

.meal-card-hero {
  height: 120px;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}

.meal-card-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--bg-card-solid) 0%, transparent 100%);
}

[data-theme="light"] .meal-card-hero::after {
  background: linear-gradient(to top, var(--bg-card-solid) 0%, rgba(255, 255, 255, 0.3) 100%);
}

.meal-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  flex-wrap: wrap;
  gap: 8px;
}

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

.meal-card-label {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.meal-now-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--tier-4);
  animation: pulse 2s ease-in-out infinite;
}

.meal-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.meal-card-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.meal-card-avg {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 100px;
}

.meal-card-body {
  padding: 0 20px 16px;
}

/* Food Items */
.food-list {
  list-style: none;
}

.food-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  gap: 10px;
  transition: all 0.2s var(--ease);
}

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

.food-item:hover {
  padding-left: 6px;
}

.food-name {
  font-size: 13px;
  color: var(--text-primary);
  flex: 1;
  transition: color 0.2s;
}

.food-item:hover .food-name {
  color: var(--star-color);
}

/* ─── STAR RATING ─── */
.rating-row {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.star-rating {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  cursor: pointer;
  flex-shrink: 0;
}

.stars-wrap {
  display: flex;
  gap: 2px;
}

.star-rating .star {
  font-size: 16px;
  transition: all 0.15s var(--ease);
  user-select: none;
  opacity: 0.3;
  filter: grayscale(1);
}

.star-rating .star.filled {
  opacity: 1;
  filter: grayscale(0);
}

.star-rating .star:hover {
  transform: scale(1.3);
}

.star-rating .star.pop {
  animation: starPop 0.35s var(--ease-bounce);
}

/* Community Rating Label */
.community-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.3px;
  animation: fadeIn 0.4s var(--ease);
}

.community-rating .cr-avg {
  color: var(--star-color);
  font-weight: 600;
}

.community-rating .cr-votes {
  opacity: 0.7;
}

/* Community Status Card (Stats View) */
.community-status-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  margin-bottom: 16px;
  border-radius: 100px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.community-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff3b3b;
  flex-shrink: 0;
}

.community-status-dot.active {
  background: var(--tier-4);
  animation: pulse 2s ease-in-out infinite;
}

/* Hero dish highlight */
.food-item.hero-dish {
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.06) 0%, transparent 100%);
  padding: 10px 8px;
  margin: 0 -8px;
  border-radius: 10px;
  border-bottom: none;
}

.food-item.hero-dish .food-name {
  font-weight: 600;
}

.food-item.hero-dish::before {
  content: '👑';
  font-size: 12px;
  margin-right: 4px;
}

/* Worth going meter */
.worth-meter {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin: 0 20px 16px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.worth-meter-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.worth-meter-bar {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.worth-meter-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.8s var(--ease), background 0.3s;
}

.worth-meter-value {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  min-width: 32px;
  text-align: right;
}

/* ─── WEEKLY VIEW ─── */
.weekly-header {
  text-align: center;
  padding: 24px 0 20px;
}

.weekly-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.weekly-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}

.weekly-day-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 20px;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  animation: fadeInUp 0.4s var(--ease) both;
}

.weekly-day-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.weekly-day-card.is-today {
  border-color: rgba(251, 191, 36, 0.2);
}

.weekly-day-card.expanded {
  grid-column: 1 / -1;
}

.weekly-day-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.weekly-day-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  min-width: 40px;
}

.weekly-day-verdict {
  font-size: 14px;
}

.weekly-day-desc {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.weekly-day-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.weekly-day-score {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 100px;
}

.weekly-day-chevron {
  color: var(--text-muted);
  transition: transform 0.3s var(--ease);
  font-size: 14px;
}

.weekly-day-card.expanded .weekly-day-chevron {
  transform: rotate(180deg);
}

/* Expanded day detail */
.weekly-day-detail {
  display: none;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  margin-top: 16px;
  animation: fadeIn 0.3s var(--ease);
  width: 100%;
}

.weekly-day-card.expanded .weekly-day-detail {
  display: block;
}

.weekly-day-card.expanded {
  flex-wrap: wrap;
}

.weekly-meal-mini {
  margin-bottom: 12px;
}

.weekly-meal-mini-header {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

/* ─── STATS VIEW ─── */
.stats-header {
  text-align: center;
  padding: 24px 0 20px;
}

.stats-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Bar chart */
.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 16px;
  animation: fadeInUp 0.5s var(--ease) both;
}

.chart-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 140px;
  gap: 8px;
  padding-top: 10px;
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
}

.bar {
  width: 100%;
  max-width: 40px;
  border-radius: 6px 6px 3px 3px;
  transition: height 0.8s var(--ease-bounce);
  min-height: 4px;
  position: relative;
}

.bar-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.bar-value {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Donut chart */
.donut-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
}

.donut-chart {
  width: 140px;
  height: 140px;
  position: relative;
}

.donut-chart svg {
  transform: rotate(-90deg);
}

.donut-chart circle {
  fill: none;
  stroke-width: 20;
}

.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.donut-center-value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
}

.donut-center-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.donut-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}

.donut-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* Achievement cards */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.achievement-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  text-align: center;
  transition: all 0.3s var(--ease);
  animation: fadeInUp 0.5s var(--ease) both;
}

.achievement-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.achievement-emoji {
  font-size: 28px;
  margin-bottom: 6px;
}

.achievement-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}

.achievement-desc {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

/* ─── TOAST ─── */
.toast {
  position: fixed;
  bottom: calc(var(--nav-height) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
  z-index: 200;
  opacity: 0;
  transition: all 0.4s var(--ease);
  pointer-events: none;
  white-space: nowrap;
}

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

/* ─── ONBOARDING ─── */
.onboarding {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  animation: fadeIn 0.3s ease;
}

.onboarding.hidden {
  display: none;
}

.onboarding-card {
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 32px;
  text-align: center;
  max-width: 300px;
  box-shadow: var(--shadow-lg);
}

.onboarding-emoji {
  font-size: 40px;
  margin-bottom: 12px;
}

.onboarding-card h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.onboarding-card p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
}

.onboarding-btn {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 32px;
  border-radius: 100px;
  border: none;
  background: var(--star-color);
  color: #000;
  cursor: pointer;
  transition: all 0.25s var(--ease);
}

.onboarding-btn:hover {
  transform: scale(1.05);
}

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

/* ─── TIER COLORS ─── */
.tier-1 {
  background: rgba(255, 59, 59, 0.12);
  color: var(--tier-1);
  border-color: rgba(255, 59, 59, 0.2);
}

.tier-2 {
  background: rgba(255, 140, 0, 0.12);
  color: var(--tier-2);
  border-color: rgba(255, 140, 0, 0.2);
}

.tier-3 {
  background: rgba(136, 136, 136, 0.12);
  color: var(--tier-3);
  border-color: rgba(136, 136, 136, 0.2);
}

.tier-4 {
  background: rgba(52, 211, 153, 0.12);
  color: var(--tier-4);
  border-color: rgba(52, 211, 153, 0.2);
}

.tier-5 {
  background: rgba(251, 191, 36, 0.12);
  color: var(--tier-5);
  border-color: rgba(251, 191, 36, 0.2);
}

/* ─── VERDICT COLORS ON PILLS ─── */
.verdict-abort {
  color: var(--tier-1);
}

.verdict-warning {
  color: var(--tier-2);
}

.verdict-mid {
  color: var(--tier-3);
}

.verdict-decent {
  color: var(--tier-4);
}

.verdict-legendary {
  color: var(--tier-5);
}

/* ─── DYNAMIC AURA ─── */
body[data-aura="verdict-abort"] {
  --glow-color: rgba(255, 59, 59, 0.15);
}

body[data-aura="verdict-warning"] {
  --glow-color: rgba(255, 140, 0, 0.15);
}

body[data-aura="verdict-mid"] {
  --glow-color: rgba(136, 136, 136, 0.15);
}

body[data-aura="verdict-decent"] {
  --glow-color: rgba(52, 211, 153, 0.15);
}

body[data-aura="verdict-legendary"] {
  --glow-color: rgba(251, 191, 36, 0.15);
}

body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 50% 50%, var(--glow-color, transparent) 0%, transparent 60%);
  z-index: -1;
  pointer-events: none;
  transition: background 1.5s ease;
}

/* ─── CONFETTI ─── */
.confetti {
  position: fixed;
  font-size: 20px;
  pointer-events: none;
  z-index: 9999;
  animation: confettiExplode 1s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes confettiExplode {
  0% {
    transform: translate(0, 0) scale(0.5) rotate(0deg);
    opacity: 1;
  }

  100% {
    transform: translate(var(--tx), var(--ty)) scale(1.5) rotate(45deg);
    opacity: 0;
  }
}

/* ─── ANIMATIONS ─── */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

@keyframes starPop {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.5);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes shimmer {

  0%,
  100% {
    border-color: rgba(52, 211, 153, 0.25);
  }

  50% {
    border-color: rgba(52, 211, 153, 0.1);
  }
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar {
  width: 5px;
}

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

::-webkit-scrollbar-thumb {
  background: #222;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #444;
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: #ccc;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 480px) {
  .app-main {
    padding-left: 16px;
    padding-right: 16px;
  }

  .meal-card-hero {
    height: 90px;
  }

  .countdown-card {
    padding: 16px;
    gap: 14px;
  }

  .countdown-ring {
    width: 52px;
    height: 52px;
  }

  .achievements-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .achievement-card {
    padding: 12px;
  }

  .donut-container {
    gap: 20px;
  }

  .bar-chart {
    height: 110px;
  }
}