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

:root {
  --c1: #FF6B6B;
  --c2: #FFE66D;
  --c3: #4ECDC4;
  --c4: #FF8B94;
  --c5: #A8E6CF;
  --c6: #FFD93D;
  --c7: #6C5CE7;
  --c8: #FD79A8;
  --bg: #1a1a2e;
  --card: #16213e;
  --text: #ffffff;
  --muted: #a0a0b0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(108,92,231,0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(253,121,168,0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(78,205,196,0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.page {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* ── Header ── */
header {
  text-align: center;
  margin-bottom: 40px;
  animation: slideDown 0.6s ease forwards;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.emoji-title {
  font-size: 3rem;
  margin-bottom: 8px;
  display: block;
  animation: bounce 2s infinite;
}

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

h1 {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(2rem, 6vw, 3.5rem);
  background: linear-gradient(135deg, var(--c1), var(--c2), var(--c3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
  margin-bottom: 8px;
}

.subtitle {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 600;
}

.visitor-count {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 8px;
}

.visitor-count span {
  color: var(--c2);
  font-family: 'Fredoka One', cursive;
  font-size: 1rem;
}
/* ── Controls ── */
.controls {
  background: var(--card);
  border-radius: 24px;
  padding: 24px;
  margin-bottom: 32px;
  border: 1px solid rgba(255,255,255,0.08);
  animation: slideUp 0.6s ease 0.2s both;
}

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

.controls-row {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.location-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--c7), var(--c8));
  color: white;
  border: none;
  border-radius: 50px;
  padding: 12px 20px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.location-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(108,92,231,0.4);
}

.location-status {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}

.location-status.got { color: var(--c3); }

.price-label {
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 16px;
  margin-bottom: 10px;
}

.price-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.price-btn {
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 50px;
  padding: 8px 18px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.price-btn.active {
  background: linear-gradient(135deg, var(--c2), var(--c1));
  color: #1a1a2e;
  border-color: transparent;
  transform: scale(1.05);
}

.price-btn:hover:not(.active) {
  border-color: rgba(255,255,255,0.3);
  color: white;
}

/* ── Main layout ── */
.main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: center;
  animation: slideUp 0.6s ease 0.4s both;
}

@media (max-width: 700px) {
  .main {
    grid-template-columns: 1fr;
  }
}

/* ── Wheel ── */
.wheel-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}

.wheel-container {
  position: relative;
  width: min(320px, calc(100vw - 80px));
  height: min(320px, calc(100vw - 80px));
  margin: 0 auto;
}

.wheel-container::after {
  content: '▼';
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2rem;
  color: white;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
  z-index: 10;
}

#wheel-canvas {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow:
    0 0 0 6px rgba(255,255,255,0.1),
    0 0 40px rgba(108,92,231,0.3),
    0 20px 60px rgba(0,0,0,0.5);
  cursor: pointer;
  transition: box-shadow 0.3s;
}

#wheel-canvas:hover {
  box-shadow:
    0 0 0 6px rgba(255,255,255,0.2),
    0 0 60px rgba(108,92,231,0.5),
    0 20px 60px rgba(0,0,0,0.5);
}

.spin-btn {
  background: linear-gradient(135deg, var(--c1), var(--c4));
  color: white;
  border: none;
  border-radius: 50px;
  padding: 16px 48px;
  font-family: 'Fredoka One', cursive;
  font-size: 1.3rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 8px 24px rgba(255,107,107,0.4);
}

.spin-btn:hover:not(:disabled) {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 32px rgba(255,107,107,0.5);
}

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

/* ── Result card ── */
.result-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.result-card {
  background: var(--card);
  border-radius: 24px;
  padding: 28px;
  border: 1px solid rgba(255,255,255,0.08);
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.result-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--c1), var(--c2), var(--c3));
  opacity: 0;
  transition: opacity 0.3s;
}

.result-card.has-result::before { opacity: 1; }

.result-placeholder {
  text-align: center;
  color: var(--muted);
}

.result-placeholder .big-emoji {
  font-size: 3rem;
  display: block;
  margin-bottom: 12px;
}

.result-placeholder p {
  font-weight: 600;
  font-size: 0.95rem;
}

.result-content { display: none; }

.result-content.show {
  display: block;
  animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

.result-emoji { font-size: 2.5rem; margin-bottom: 8px; display: block; }

.result-name {
  font-family: 'Fredoka One', cursive;
  font-size: 1.6rem;
  line-height: 1.2;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--c2), var(--c1));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.result-meta { display: flex; flex-direction: column; gap: 8px; }

.meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

.stars { color: var(--c2); }

/* ── Restaurant list ── */
.list-panel {
  background: var(--card);
  border-radius: 24px;
  padding: 24px;
  border: 1px solid rgba(255,255,255,0.08);
  margin-top: 32px;
  animation: slideUp 0.6s ease 0.6s both;
}

.list-title {
  font-family: 'Fredoka One', cursive;
  font-size: 1.2rem;
  margin-bottom: 16px;
  color: var(--c3);
}

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

.restaurant-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  transition: background 0.2s;
}

.restaurant-item:hover { background: rgba(255,255,255,0.08); }

.restaurant-item.winner {
  background: rgba(255,230,109,0.1);
  border-color: rgba(255,230,109,0.3);
}

.item-color { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.item-name { font-weight: 700; font-size: 0.9rem; flex: 1; }
.item-rating { font-size: 0.8rem; color: var(--c2); font-weight: 700; }
.item-distance { font-size: 0.8rem; color: var(--muted); font-weight: 600; }

/* ── Loading overlay ── */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26,26,46,0.8);
  z-index: 100;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  backdrop-filter: blur(4px);
}

.loading-overlay.show { display: flex; }

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255,255,255,0.1);
  border-top-color: var(--c1);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
  font-family: 'Fredoka One', cursive;
  font-size: 1.2rem;
  color: var(--muted);
}