/* === Spunfork — Delassus-inspired redesign === */
/* Bold color blocks, elegant typography, minimal chrome */
/* Fonts loaded via <link> in index.html for non-blocking render */

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* === Screen Reader Only === */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* === Skip Link === */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  padding: 12px 24px;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  z-index: 9999;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

:root {
  /* Core palette */
  --bg: #f5f0eb;
  --bg-warm: #e8554e;
  --surface: #ffffff;
  --surface-alt: rgba(255, 255, 255, 0.12);
  --accent: #e8554e;
  --accent-hover: #d4433b;
  --text-dark: #1a1a1a;
  --text-body: #3d3d3d;
  --text-muted: #8a8a8a;
  --text-on-color: #ffffff;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 50px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 50px rgba(0, 0, 0, 0.12);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* Cuisine mood colors */
  --mood-default: #f5f0eb;
  --mood-mexican: #c96a3f;
  --mood-italian: #8b6f4e;
  --mood-chinese: #b54545;
  --mood-japanese: #4a5568;
  --mood-thai: #c07832;
  --mood-indian: #b8633e;
  --mood-american: #5c6e58;
  --mood-pizza: #c75a3a;
  --mood-seafood: #3d7a8a;
  --mood-mediterranean: #7a8a5c;
  --mood-korean: #8b4d5c;
  --mood-vietnamese: #6b7a4a;
  --mood-bbq: #7a4a3a;
  --mood-breakfast: #c4976a;
  --mood-burgers: #6b5a4a;

  /* Font */
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-dark);
  min-height: 100vh;
  transition: background-color 4s ease, color 0.8s ease;
  -webkit-font-smoothing: antialiased;
}

/* When a cuisine mood is active, body gets a color class */
body.mood-active {
  background: var(--mood-color, var(--bg));
  color: var(--mt);
}

/* --- Mood text theme: white text on dark backgrounds --- */
body.mood-light-text {
  --mt: #ffffff;
  --mt-secondary: rgba(255, 255, 255, 0.85);
  --mt-muted: rgba(255, 255, 255, 0.6);
  --mt-surface: rgba(255, 255, 255, 0.12);
  --mt-surface-hover: rgba(255, 255, 255, 0.2);
  --mt-input: rgba(255, 255, 255, 0.15);
  --mt-border: rgba(255, 255, 255, 0.25);
  --mt-overlay: rgba(255, 255, 255, 0.08);
}

/* --- Mood text theme: dark text on light backgrounds --- */
body.mood-dark-text {
  --mt: var(--text-dark);
  --mt-secondary: var(--text-body);
  --mt-muted: var(--text-muted);
  --mt-surface: rgba(255, 255, 255, 0.3);
  --mt-surface-hover: rgba(255, 255, 255, 0.4);
  --mt-input: rgba(255, 255, 255, 0.5);
  --mt-border: rgba(0, 0, 0, 0.12);
  --mt-overlay: rgba(255, 255, 255, 0.25);
}

/* === Layout Container === */
.app-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 24px;
}

/* === Auth Bar === */
.auth-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 16px 0 8px;
  font-size: 0.82rem;
}

.auth-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 400;
  color: var(--text-body);
}

body.mood-active .auth-user-info { color: var(--mt); }

.auth-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.auth-link {
  color: var(--text-body);
  text-decoration: none;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  transition: background var(--transition), color var(--transition);
}

.auth-link:hover {
  background: rgba(0, 0, 0, 0.06);
}

body.mood-active .auth-link { color: var(--mt); }
body.mood-active .auth-link:hover { background: var(--mt-surface); }

.auth-sep { color: var(--text-muted); font-weight: 300; }
body.mood-active .auth-sep { color: var(--mt-muted); }

.auth-btn {
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--text-muted);
  background: transparent;
  color: var(--text-body);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all var(--transition);
}

.auth-btn:hover {
  border-color: var(--text-dark);
  color: var(--text-dark);
}

body.mood-active .auth-btn {
  border-color: var(--mt-border);
  color: var(--mt);
}

body.mood-active .auth-btn:hover {
  border-color: var(--mt);
  background: var(--mt-surface);
}

.auth-disabled { opacity: 0.35; pointer-events: none; }

/* Upsell banner for anonymous users */
.auth-upsell {
  text-align: center;
  padding: 14px 20px;
  margin: 16px 0;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1.5px dashed #d0ccc7;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.auth-upsell p { margin: 0; }

.auth-upsell .auth-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.auth-upsell .auth-link:hover {
  text-decoration: underline;
}

body.mood-active .auth-upsell {
  background: var(--mt-surface);
  border-color: var(--mt-border);
  color: var(--mt-secondary);
}

body.mood-active .auth-upsell .auth-link {
  color: var(--mt);
}

/* === Header === */
header {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 0 24px;
  text-align: center;
}

header h1 {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 400;
  color: var(--text-dark);
  letter-spacing: -0.01em;
  margin-bottom: 24px;
}

.fork-icon {
  display: inline-block;
  width: 0.5em;
  height: 1.1em;
  vertical-align: baseline;
  margin-left: 0.02em;
  position: relative;
  top: 0.08em;
}

body.mood-active header h1 { color: var(--mt); }

/* === Seasonal Banner === */
.seasonal-banner {
  display: inline-block;
  background: rgba(0, 0, 0, 0.08);
  color: var(--text-body);
  font-weight: 500;
  font-size: 0.82rem;
  padding: 6px 20px;
  border-radius: var(--radius-pill);
  margin-bottom: 20px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

body.mood-active .seasonal-banner {
  background: var(--mt-surface);
  color: var(--mt);
}

/* === Location Bar === */
.location-bar {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 32px;
}

body.mood-active .location-bar {
  background: var(--mt-surface);
  box-shadow: none;
}

.loc-current {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 400;
}

.loc-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.loc-controls input[type="text"] {
  flex: 0 0 100px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid #e0dcd7;
  background: #fff;
  color: var(--text-dark);
  font-size: 0.85rem;
  font-family: var(--font-body);
  transition: border-color var(--transition);
}

.loc-controls input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
}

body.mood-active .loc-controls input[type="text"] {
  background: var(--mt-input);
  border-color: var(--mt-border);
  color: var(--mt);
}

body.mood-active .loc-controls input[type="text"]::placeholder {
  color: var(--mt-muted);
}

.loc-controls select {
  flex: 1 1 150px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid #e0dcd7;
  background: #fff;
  color: var(--text-dark);
  font-size: 0.85rem;
  font-family: var(--font-body);
}

body.mood-active .loc-controls select {
  background: var(--mt-input);
  border-color: var(--mt-border);
  color: var(--mt);
}

.loc-controls button {
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.85rem;
  font-family: var(--font-body);
  transition: background var(--transition), transform 0.15s;
}

.loc-controls button:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.save-loc-group {
  display: flex;
  gap: 6px;
  flex: 1 1 150px;
}

.save-loc-group input { flex: 1; }

/* === Main === */
main {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 0 24px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.status {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin-bottom: 20px;
  text-align: center;
  min-height: 1.5em;
  color: var(--text-dark);
  font-weight: 400;
}

body.mood-active .status { color: var(--mt); }

/* === Filter Bar === */
.filter-bar {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-bottom: 24px;
  padding: 10px 20px;
  background: var(--surface);
  border-radius: var(--radius);
  font-size: 0.85rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  z-index: 10;
}

body.mood-active .filter-bar {
  background: var(--mt-surface);
  box-shadow: none;
}

.filter-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-body);
  cursor: pointer;
  font-weight: 500;
  transition: color var(--transition);
}

.filter-label:hover { color: var(--text-dark); }

.filter-label input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}

.filter-select {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1.5px solid #e0dcd7;
  background: #fff;
  color: var(--text-dark);
  font-size: 0.85rem;
  font-family: var(--font-body);
}

body.mood-active .filter-select {
  background: var(--mt-input);
  border-color: var(--mt-border);
  color: var(--mt);
}

/* --- Dietary dropdown --- */
.dietary-dropdown {
  position: relative;
}

.dietary-btn {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid #e0dcd7;
  background: #fff;
  color: var(--text-body);
  font-size: 0.85rem;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.dietary-btn:hover {
  border-color: var(--accent);
}

.dietary-btn.has-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

body.mood-active .dietary-btn {
  background: var(--mt-input);
  border-color: var(--mt-border);
  color: var(--mt-secondary);
}

body.mood-active .dietary-btn.has-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.dietary-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 10px 14px;
  z-index: 100;
  min-width: 170px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

body.mood-active .dietary-menu {
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.dietary-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-body);
  cursor: pointer;
  white-space: nowrap;
}

body.mood-active .dietary-option {
  color: var(--text-body); /* always dark since menu is white surface */
}

.dietary-option input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}

/* === Wheel === */
.wheel-container {
  position: relative;
  width: 100%;
  max-width: 440px;
  aspect-ratio: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 8px 0;
  filter: drop-shadow(0 18px 36px rgba(0, 0, 0, 0.4));
  transition: transform 0.4s ease, z-index 0s;
}

#wheel {
  display: block;
  border-radius: 50%;
}

/* --- Spin focus: overlay + wheel pop --- */
.spin-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.spin-overlay.active {
  display: block;
  opacity: 1;
}

body.spin-active .wheel-container {
  z-index: 950;
  transform: scale(1.08);
  filter: drop-shadow(0 24px 60px rgba(0, 0, 0, 0.5));
}

@media (prefers-reduced-motion: reduce) {
  body.spin-active .wheel-container {
    transform: none;
  }
  .spin-overlay {
    transition: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

/* === Buttons === */
.btn-row {
  display: flex;
  gap: 14px;
  margin-top: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.spin-btn {
  padding: 16px 40px;
  font-size: 1.05rem;
  font-weight: 600;
  font-family: var(--font-body);
  border: none;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(232, 85, 78, 0.35);
  transition: transform 0.2s, box-shadow 0.2s, background var(--transition);
  letter-spacing: 0.01em;
}

.spin-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(232, 85, 78, 0.45);
  background: var(--accent-hover);
}

.spin-btn:active:not(:disabled) {
  transform: translateY(0);
}

.spin-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.surprise-btn {
  padding: 16px 28px;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-body);
  border: 2px solid var(--text-dark);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-dark);
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.01em;
}

.surprise-btn:hover:not(:disabled) {
  background: var(--text-dark);
  color: #fff;
  transform: translateY(-2px);
}

body.mood-active .surprise-btn {
  border-color: var(--mt);
  color: var(--mt);
}

body.mood-active .surprise-btn:hover:not(:disabled) {
  background: var(--mt-surface);
  color: var(--mt);
}

.surprise-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.restart-btn {
  padding: 16px 28px;
  font-size: 1rem;
  font-weight: 500;
  font-family: var(--font-body);
  border: 1.5px solid var(--text-muted);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.restart-btn:hover {
  border-color: var(--text-dark);
  color: var(--text-dark);
}

body.mood-active .restart-btn {
  border-color: var(--mt-muted);
  color: var(--mt-muted);
}

body.mood-active .restart-btn:hover {
  border-color: var(--mt);
  color: var(--mt);
}

/* === Result Card === */
.result-card {
  margin-top: 32px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px;
  width: 100%;
  text-align: center;
  animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-lg);
}

body.mood-active .result-card {
  background: rgba(255, 255, 255, 0.95);
  color: var(--text-dark);
}

body.mood-active .result-card h2,
body.mood-active .result-card .stars,
body.mood-active .result-card .price-level,
body.mood-active .result-card .distance,
body.mood-active .result-card .vicinity {
  color: var(--text-dark);
}

body.mood-active .result-card .distance,
body.mood-active .result-card .vicinity {
  color: var(--text-muted);
}

.result-card h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 400;
  margin-bottom: 8px;
  color: var(--text-dark);
}

.stars {
  font-size: 1.1rem;
  color: #e8a838;
  margin-bottom: 6px;
  letter-spacing: 2px;
}

.stars .star { margin: 0 1px; }
.stars .rating-num {
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0;
  font-weight: 500;
}

.price-level {
  color: #4a9e6d;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: 2px;
}

.distance {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.vicinity {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.maps-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 24px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-pill);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all var(--transition);
  margin-bottom: 12px;
}

.maps-link:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.fav-btn {
  display: block;
  margin: 8px auto 0;
  padding: 10px 24px;
  border: 1.5px solid var(--text-muted);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-body);
  font-size: 0.9rem;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition);
}

.fav-btn:hover {
  border-color: #e8a838;
  color: #e8a838;
}

.fav-btn.is-fav {
  background: #e8a838;
  border-color: #e8a838;
  color: #fff;
  font-weight: 600;
}

/* === Collapsible Panels (Favorites, History, Badges) === */
.favs-section,
.history-section,
.badges-section {
  width: 100%;
  margin-top: 16px;
}

.favs-toggle,
.history-toggle,
.badges-toggle {
  display: block;
  width: 100%;
  padding: 14px 20px;
  background: var(--surface);
  border: 1.5px solid #e8e4df;
  color: var(--text-body);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  border-radius: var(--radius);
  transition: all var(--transition);
  text-align: left;
  letter-spacing: 0.01em;
}

.favs-toggle:hover,
.history-toggle:hover,
.badges-toggle:hover {
  border-color: var(--text-muted);
  background: #faf8f5;
}

body.mood-active .favs-toggle,
body.mood-active .history-toggle,
body.mood-active .badges-toggle {
  background: var(--mt-surface);
  border-color: var(--mt-border);
  color: var(--mt);
}

body.mood-active .favs-toggle:hover,
body.mood-active .history-toggle:hover,
body.mood-active .badges-toggle:hover {
  background: var(--mt-surface-hover);
}

.favs-panel,
.history-panel,
.badges-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.favs-panel.open { max-height: 600px; }
.history-panel.open { max-height: 800px; overflow-y: auto; }
.badges-panel.open { max-height: 600px; overflow-y: auto; }

.favs-list,
.history-list {
  padding: 10px 0;
}

.fav-item,
.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid #f0ece7;
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  transition: box-shadow var(--transition);
}

.fav-item:hover,
.history-item:hover {
  box-shadow: var(--shadow-sm);
}

body.mood-active .fav-item,
body.mood-active .history-item {
  background: var(--mt-overlay);
  border-color: var(--mt-border);
}

.fav-info strong,
.history-info strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-dark);
}

.fav-info small,
.history-info small {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 400;
}

body.mood-active .fav-info strong,
body.mood-active .history-info strong { color: var(--mt); }
body.mood-active .fav-info small,
body.mood-active .history-info small { color: var(--mt-muted); }

.fav-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 50%;
  transition: all var(--transition);
}

.fav-remove:hover {
  color: var(--accent);
  background: rgba(232, 85, 78, 0.08);
}

.fav-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 24px 16px;
  font-size: 0.9rem;
}

body.mood-active .fav-empty { color: var(--mt-muted); }

/* === Stats Bar === */
.stats-bar {
  display: flex;
  justify-content: space-around;
  padding: 16px 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 400;
}

.stats-bar strong {
  color: var(--text-dark);
  font-weight: 700;
}

body.mood-active .stats-bar { color: var(--mt-muted); }
body.mood-active .stats-bar strong { color: var(--mt); }

/* === Badges === */
.badges-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 0;
}

.badge-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid #f0ece7;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

body.mood-active .badge-card {
  background: var(--mt-overlay);
  border-color: var(--mt-border);
}

.badge-icon { font-size: 1.3rem; }

.badge-label {
  color: var(--text-dark);
  font-weight: 500;
}

body.mood-active .badge-label { color: var(--mt); }

/* === History Load More === */
.history-load-more {
  display: block;
  width: 100%;
  padding: 10px;
  background: transparent;
  border: 1.5px solid #e0dcd7;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  font-family: var(--font-body);
  font-weight: 500;
  margin-top: 6px;
  transition: all var(--transition);
}

.history-load-more:hover {
  border-color: var(--text-body);
  color: var(--text-body);
}

body.mood-active .history-load-more {
  border-color: var(--mt-muted);
  color: var(--mt-muted);
}

body.mood-active .history-load-more:hover {
  border-color: var(--mt);
  color: var(--mt);
}

/* === Photo Upload === */
.photo-upload {
  margin-top: 16px;
  text-align: center;
}

.photo-btn {
  padding: 10px 24px;
  border: 1.5px solid var(--text-muted);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-body);
  font-size: 0.9rem;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition);
}

.photo-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.photo-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.photo-preview {
  display: block;
  margin: 12px auto 0;
  max-width: 200px;
  max-height: 200px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.photo-thumbnail {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

/* === Modals === */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: #fff;
  border-radius: var(--radius);
  padding: 40px 36px;
  width: 90%;
  max-width: 400px;
  position: relative;
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-lg);
}

.modal-content h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.6rem;
  margin-bottom: 24px;
  text-align: center;
  color: var(--text-dark);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color var(--transition);
}

.modal-close:hover { color: var(--text-dark); }

.modal-content input {
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid #e0dcd7;
  background: #faf8f5;
  color: var(--text-dark);
  font-size: 0.95rem;
  font-family: var(--font-body);
  transition: border-color var(--transition);
}

.modal-content input:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
}

.modal-submit {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  margin-top: 8px;
  transition: background var(--transition), transform 0.15s;
}

.modal-submit:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.modal-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.modal-switch a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.modal-switch a:hover { text-decoration: underline; }

.form-error {
  color: var(--accent);
  font-size: 0.85rem;
  min-height: 1.2em;
  margin-bottom: 4px;
  font-weight: 500;
}

/* === Toast Notifications === */
.toast-notification {
  position: fixed;
  bottom: -80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  color: var(--text-dark);
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.95rem;
  font-family: var(--font-body);
  z-index: 2000;
  box-shadow: var(--shadow-lg);
  transition: bottom 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  border: 1px solid #f0ece7;
}

.toast-notification.show {
  bottom: 32px;
}

/* === Scroll-triggered Fade-in === */
.fade-in {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays based on DOM order */
header .fade-in:nth-of-type(1) { transition-delay: 0.05s; }
header .fade-in:nth-of-type(2) { transition-delay: 0.15s; }
main > .fade-in:nth-of-type(1) { transition-delay: 0.2s; }
main > .fade-in:nth-of-type(2) { transition-delay: 0.3s; }
main > .fade-in:nth-of-type(3) { transition-delay: 0.4s; }
main > .fade-in:nth-of-type(4) { transition-delay: 0.5s; }

/* Smooth mood color transition on status text */
.status {
  transition: color 0.6s ease, opacity 0.4s ease;
}

/* === Utility === */
.hidden { display: none !important; }

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

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

/* === Group Spin === */
.group-btn {
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  border: 2px solid var(--text-dark);
  background: transparent;
  color: var(--text-dark);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.group-btn:hover { background: var(--text-dark); color: #fff; }
body.mood-active .group-btn { border-color: var(--mt-muted); color: var(--mt); }
body.mood-active .group-btn:hover { background: var(--mt-surface); }

.group-panel {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 28px;
  max-width: 500px;
  margin: 20px auto;
}
body.mood-active .group-panel {
  background: var(--mt-surface);
  color: var(--mt);
}

.group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.group-header h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin: 0;
}
.group-close {
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px 8px;
}
.group-close:hover { color: var(--text-dark); }
body.mood-active .group-close { color: var(--mt-muted); }
body.mood-active .group-close:hover { color: var(--mt); }

.group-invite label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}
body.mood-active .group-invite label { color: var(--mt-secondary); }

.invite-link-row {
  display: flex;
  gap: 8px;
}
.invite-link-row input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  background: var(--bg);
}
body.mood-active .invite-link-row input {
  background: var(--mt-input);
  border-color: var(--mt-border);
  color: var(--mt);
}

.copy-btn {
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.85rem;
  transition: var(--transition);
}
.copy-btn:hover { background: var(--accent-hover); }

.group-members {
  margin-top: 20px;
}
.group-members h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-body);
}
body.mood-active .group-members h4 { color: var(--mt-secondary); }

.member-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.member-list li {
  padding: 6px 14px;
  background: var(--bg);
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 500;
}
body.mood-active .member-list li { background: var(--mt-overlay); color: var(--mt); }
.member-list li.voted-approve { background: #d4edda; color: #155724; }
.member-list li.voted-decline { background: #f8d7da; color: #721c24; }

.group-status {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 16px;
  text-align: center;
}
body.mood-active .group-status { color: var(--mt-secondary); }

#group-start-spin {
  margin-top: 20px;
  width: 100%;
}

/* Vote panel */
.group-vote h4 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 16px;
  text-align: center;
}

.vote-tally {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
}
.vote-entry {
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 500;
}
.vote-entry.approve { background: #d4edda; color: #155724; }
.vote-entry.decline { background: #f8d7da; color: #721c24; }
.vote-entry.pending { background: #e2e3e5; color: #383d41; }

.vote-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.vote-btn {
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  border: none;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
}
.vote-btn.approve { background: #28a745; color: #fff; }
.vote-btn.approve:hover { background: #218838; }
.vote-btn.decline { background: #dc3545; color: #fff; }
.vote-btn.decline:hover { background: #c82333; }
.vote-btn.veto {
  background: transparent;
  border: 2px solid #856404;
  color: #856404;
}
.vote-btn.veto:hover { background: #856404; color: #fff; }
.vote-btn:disabled { opacity: 0.5; cursor: not-allowed; }

#vote-status {
  text-align: center;
  margin-top: 12px;
  font-weight: 500;
}

/* === Responsive === */
@media (max-width: 480px) {
  header h1 { font-size: 1.8rem; }
  .status { font-size: 1.15rem; }
  .spin-btn { padding: 14px 32px; font-size: 0.95rem; }
  .surprise-btn { padding: 14px 24px; font-size: 0.9rem; }
  .btn-row { gap: 10px; }
  .loc-controls { flex-direction: column; }
  .loc-controls input[type="text"],
  .loc-controls select { flex: 1 1 100%; }
  .save-loc-group { flex: 1 1 100%; }
  .filter-bar { flex-direction: column; gap: 10px; padding: 12px 16px; }
  .stats-bar { flex-direction: column; gap: 6px; text-align: center; }
  .badges-list { justify-content: center; }
  .result-card { padding: 24px 20px; }
  .result-card h2 { font-size: 1.4rem; }
  .wheel-container { max-width: 340px; }
}

@media (min-width: 768px) {
  header h1 { font-size: 2.8rem; }
  .status { font-size: 1.5rem; }
}

/* === Result Actions Row === */
.result-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* === Exclude Button === */
.exclude-btn {
  display: block;
  padding: 10px 24px;
  border: 1.5px solid var(--text-muted);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition);
  min-height: 44px;
}

.exclude-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(232, 85, 78, 0.06);
}

.exclude-btn.is-excluded {
  background: var(--text-muted);
  border-color: var(--text-muted);
  color: #fff;
  font-weight: 600;
}

/* === Excluded Restaurants Panel === */
.excluded-section {
  width: 100%;
  margin-top: 16px;
}

.excluded-toggle {
  display: block;
  width: 100%;
  padding: 14px 20px;
  background: var(--surface);
  border: 1.5px solid #e8e4df;
  color: var(--text-body);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  border-radius: var(--radius);
  transition: all var(--transition);
  text-align: left;
  letter-spacing: 0.01em;
}

.excluded-toggle:hover {
  border-color: var(--text-muted);
  background: #faf8f5;
}

body.mood-active .excluded-toggle {
  background: var(--mt-surface);
  border-color: var(--mt-border);
  color: var(--mt);
}

body.mood-active .excluded-toggle:hover {
  background: var(--mt-surface-hover);
}

.excluded-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.excluded-panel.open { max-height: 600px; overflow-y: auto; }

.excluded-list {
  padding: 10px 0;
}

.excluded-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid #f0ece7;
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  transition: box-shadow var(--transition);
}

.excluded-item:hover {
  box-shadow: var(--shadow-sm);
}

body.mood-active .excluded-item {
  background: var(--mt-overlay);
  border-color: var(--mt-border);
}

.excluded-info strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-dark);
}

.excluded-info small {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 400;
}

body.mood-active .excluded-info strong { color: var(--mt); }
body.mood-active .excluded-info small { color: var(--mt-muted); }

.excluded-restore {
  background: none;
  border: 1.5px solid var(--text-muted);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 14px;
  min-height: 36px;
  transition: all var(--transition);
}

.excluded-restore:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* === Disliked Cuisines Panel === */
.disliked-section {
  width: 100%;
  margin-top: 16px;
}

.disliked-toggle {
  display: block;
  width: 100%;
  padding: 14px 20px;
  background: var(--surface);
  border: 1.5px solid #e8e4df;
  color: var(--text-body);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  border-radius: var(--radius);
  transition: all var(--transition);
  text-align: left;
  letter-spacing: 0.01em;
}

.disliked-toggle:hover {
  border-color: var(--text-muted);
  background: #faf8f5;
}

body.mood-active .disliked-toggle {
  background: var(--mt-surface);
  border-color: var(--mt-border);
  color: var(--mt);
}

body.mood-active .disliked-toggle:hover {
  background: var(--mt-surface-hover);
}

.disliked-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.disliked-panel.open { max-height: 600px; overflow-y: auto; }

.disliked-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 12px 0 8px;
  text-align: center;
}

body.mood-active .disliked-hint { color: var(--mt-muted); }

.disliked-cuisine-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0 14px;
}

.disliked-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border: 1.5px solid #e0dcd7;
  background: var(--surface);
  color: var(--text-body);
  min-height: 40px;
}

.disliked-chip:hover {
  border-color: var(--text-muted);
}

.disliked-chip.is-disliked {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  text-decoration: line-through;
}

.disliked-chip.is-disliked:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

body.mood-active .disliked-chip {
  background: var(--mt-input);
  border-color: var(--mt-border);
  color: var(--mt);
}

body.mood-active .disliked-chip.is-disliked {
  background: rgba(232, 85, 78, 0.8);
  border-color: rgba(232, 85, 78, 0.8);
}

/* === Focus Visible Styles === */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
canvas:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.modal-content input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 0;
  border-color: var(--accent);
}

/* === Mood-Active Contrast Fixes === */
body.mood-active .filter-label {
  color: var(--mt-secondary);
}

body.mood-active .loc-current {
  color: var(--mt-secondary);
}

/* === Touch Targets (min 44x44px) === */
.fav-remove {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.modal-close {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.group-close {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dietary-btn {
  min-height: 44px;
}

.vote-btn {
  min-height: 44px;
}

.copy-btn {
  min-height: 44px;
}

/* === Wheel Tooltip === */
.wheel-tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 100;
  background: rgba(30, 30, 42, 0.92);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.wheel-tooltip.visible {
  opacity: 1;
}

/* Small arrow pointing down */
.wheel-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(30, 30, 42, 0.92);
}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  html {
    scroll-behavior: auto;
  }

  body {
    transition: none;
  }

  .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .toast-notification {
    transition: none;
  }

  .result-card {
    animation: none;
  }

  .modal-content {
    animation: none;
  }
}

/* === Footer === */
.site-footer {
  margin-top: 48px;
  padding: 32px 20px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  text-align: center;
}

body.mood-active .site-footer {
  border-top-color: var(--mt-border);
}

.footer-content {
  max-width: 680px;
  margin: 0 auto;
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text-dark);
  margin-bottom: 12px;
}

body.mood-active .footer-brand {
  color: var(--mt);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color var(--transition);
}

.footer-links a:hover {
  color: var(--accent);
}

body.mood-active .footer-links a {
  color: var(--mt-muted);
}

body.mood-active .footer-links a:hover {
  color: var(--mt);
}

.footer-copy {
  font-size: 0.78rem;
  color: var(--text-muted);
}

body.mood-active .footer-copy {
  color: var(--mt-muted);
}

/* === Legal Pages === */
.legal-page {
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

.legal-page h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.legal-updated {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.legal-page section {
  margin-bottom: 28px;
}

.legal-page h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 10px;
}

.legal-page p {
  font-size: 0.92rem;
  color: var(--text-body);
  line-height: 1.7;
  margin-bottom: 10px;
}

.legal-page ul {
  padding-left: 24px;
  margin-bottom: 10px;
}

.legal-page li {
  font-size: 0.92rem;
  color: var(--text-body);
  line-height: 1.7;
  margin-bottom: 6px;
}

.legal-page a {
  color: var(--accent);
  text-decoration: none;
}

.legal-page a:hover {
  text-decoration: underline;
}

.header-home {
  color: inherit;
  text-decoration: none;
}
