* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #ff8000;
  --primary-dark: #e67300;
  --primary-light: #ffd9b3;
  --primary-glow: rgba(255, 128, 0, 0.18);
  --accent-2: #ffb347;
  --bg: #0a0e1a;
  --bg-surface: rgba(255,255,255,0.04);
  --bg-elevated: rgba(255,255,255,0.06);
  --text: #e8e8ed;
  --text-light: #8888a0;
  --text-muted: #55556a;
  --border: rgba(255,255,255,0.08);
  --border-hover: rgba(255, 128, 0, 0.4);
  --success: #22c55e;
  --success-dark: #16a34a;
  --danger: #ef4444;
  --voted: rgba(255,128,0,0.08);
  --voted-border: var(--primary);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: 'effra', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background:
    radial-gradient(ellipse 80% 60% at 80% 0%, rgba(255,128,0,0.10), transparent 60%),
    radial-gradient(ellipse 70% 50% at 0% 100%, rgba(255,179,71,0.06), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Landing (anonymous) ---- */
.landing {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.landing-inner {
  max-width: 480px;
  width: 100%;
  text-align: center;
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 3rem 2rem 2.5rem;
  box-shadow: var(--shadow-lg), 0 0 60px var(--primary-glow);
  animation: landingIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.landing-logo {
  display: inline-block;
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 8px 24px rgba(255,128,0,0.35));
}
.landing-mark {
  animation: float 6s ease-in-out infinite;
}
.landing-title {
  font-family: 'ratio', 'effra', sans-serif;
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.6rem;
  color: var(--text);
}
.landing-title::first-letter,
.landing-title {
  background: linear-gradient(135deg, #fff 0%, var(--accent-2) 60%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.landing-tag {
  color: var(--text-light);
  font-size: 1rem;
  margin-bottom: 2rem;
  line-height: 1.5;
}
.landing-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent-2) 100%);
  color: #fff;
  padding: 0.95rem 1.8rem;
  border-radius: 100px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(255,128,0,0.35), inset 0 1px 0 rgba(255,255,255,0.25);
  transition: transform var(--transition), box-shadow var(--transition);
}
.landing-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(255,128,0,0.5), inset 0 1px 0 rgba(255,255,255,0.3);
}
.landing-btn:active { transform: translateY(0); }
.landing-meta {
  margin-top: 2rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}
.landing-meta a { color: var(--text-light); }

@keyframes landingIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ---- Header ---- */
header {
  background:
    radial-gradient(circle at 80% 0%, rgba(255,128,0,0.18) 0%, transparent 50%),
    radial-gradient(circle at 0% 100%, rgba(255,179,71,0.10) 0%, transparent 50%),
    rgba(10, 14, 26, 0.6);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border-bottom: 1px solid var(--border);
  color: white;
  padding: 2rem 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
}

header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255,128,0,0.10) 0%, transparent 70%);
  pointer-events: none;
}

/* Animated SVG header decoration */
.header-waves {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: .9;
}
header > *:not(.header-waves) { position: relative; z-index: 1; }
.header-waves .wave { transform-box: fill-box; }
.header-sparks circle {
  animation: sparkTwinkle 3.6s ease-in-out infinite;
  transform-origin: center;
}
.header-sparks circle:nth-child(1) { animation-delay: 0s; }
.header-sparks circle:nth-child(2) { animation-delay: .6s; }
.header-sparks circle:nth-child(3) { animation-delay: 1.2s; }
.header-sparks circle:nth-child(4) { animation-delay: 1.8s; }
.header-sparks circle:nth-child(5) { animation-delay: 2.4s; }
.header-sparks circle:nth-child(6) { animation-delay: 3.0s; }
@keyframes sparkTwinkle {
  0%, 100% { opacity: 0; transform: scale(.6); }
  50%      { opacity: .9; transform: scale(1.2); }
}

/* ---- anime.js effects (ripple, burst, sparks) ---- */
.fx-ripple {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 120px;
  height: 120px;
  margin: -60px 0 0 -60px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,128,0,.55) 0%, rgba(255,179,71,.25) 45%, transparent 70%);
  pointer-events: none;
  z-index: 5;
}
.restaurant-card { position: relative; overflow: hidden; }
.fx-burst {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 10;
}
.fx-spark {
  position: absolute;
  left: 0;
  top: 0;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffd9b3 0%, #ff8000 60%, transparent 100%);
  box-shadow: 0 0 6px rgba(255,128,0,.8);
}
.winner-card { position: relative; overflow: visible; }

/* ---- anime.js layer (lean): letters, rings, confetti ---- */
.fx-letter { display: inline-block; }
.fx-aurora { display: none !important; }
.fx-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 80px;
  height: 80px;
  margin: -40px 0 0 -40px;
  border-radius: 50%;
  border: 2px solid rgba(255,128,0,.85);
  pointer-events: none;
  z-index: 6;
}
.fx-confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}
.fx-confetti {
  position: absolute;
  width: 10px;
  height: 14px;
  border-radius: 2px;
  pointer-events: none;
}
.fx-particles, .fx-flash, .fx-blob { display: none !important; }

.header-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-logo {
  height: 42px;
  width: auto;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
.wordmark-icon {
  filter: drop-shadow(0 4px 12px rgba(255,128,0,0.35));
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.wordmark:hover .wordmark-icon {
  transform: rotate(-12deg) scale(1.05);
}
.wordmark-text {
  font-family: 'ratio', 'effra', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #fff;
  line-height: 1;
}
.wordmark-text-accent {
  background: linear-gradient(135deg, var(--accent-2) 0%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-left: 0.15em;
}

.subtitle {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-top: 0.3rem;
  font-weight: 400;
}

.status-badge {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 0.5rem 1.2rem;
  border-radius: 100px;
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-badge.open::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s ease-in-out infinite;
}

.status-badge.closed::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

.header-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
}

.countdown {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* ---- Navigation ---- */
nav {
  display: flex;
  background: rgba(16, 23, 41, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-btn {
  background: none;
  border: none;
  padding: 1rem 1.5rem;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  font-weight: 500;
}

.nav-btn:hover {
  color: var(--text-light);
}

.nav-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
  text-shadow: 0 0 20px rgba(255,128,0,0.3);
}

/* ---- Main ---- */
main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.3s ease; }

h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

/* ---- Auth ---- */
.login-banner {
  background: linear-gradient(135deg, var(--bg-elevated) 0%, rgba(211,34,68,0.1) 100%);
  border: 1px solid rgba(211,34,68,0.25);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.login-banner h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.login-banner p {
  color: var(--text-light);
  margin-bottom: 1.2rem;
  font-size: 0.9rem;
}

.btn-login {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  padding: 0.6rem 1.8rem;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
  box-shadow: 0 4px 15px rgba(211,34,68,0.3);
}

.btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(211,34,68,0.4);
}

.btn-logout {
  color: var(--text-muted);
  font-size: 0.82rem;
  text-decoration: none;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.btn-logout:hover {
  color: var(--danger);
  border-color: var(--danger);
}

.user-badge {
  font-size: 0.95rem;
  color: var(--text-light);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.user-badge strong {
  color: var(--text);
}

.admin-tag {
  background: var(--primary-glow);
  color: var(--primary);
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 600;
  vertical-align: middle;
}

/* ---- Quote Banner ---- */
.quote-banner {
  background: linear-gradient(135deg, var(--bg-elevated) 0%, rgba(211,34,68,0.12) 100%);
  border: 1px solid rgba(211,34,68,0.25);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 1.2rem 1.6rem;
  margin-bottom: 1.5rem;
}

.quote-text {
  display: block;
  font-family: 'ratio', 'effra', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  font-style: italic;
  color: #fff;
  letter-spacing: -0.01em;
}

.quote-sub {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.88rem;
  color: var(--text-light);
}

/* ---- Vote Header ---- */
.vote-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.voter-input {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.voter-input label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-light);
}

.voter-input input {
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  width: 180px;
  transition: all var(--transition);
  background: var(--bg-surface);
  color: var(--text);
}

.voter-input input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.week-info {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.current-vote {
  background: var(--voted);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-md);
  padding: 0.8rem 1.2rem;
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.95rem;
}

.current-vote strong {
  color: var(--primary);
}

.vote-hint {
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* ---- Filter / Sort Bar ---- */
.filter-sort-bar {
  display: flex;
  justify-content: flex-start;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1.2rem;
  margin-bottom: 1.2rem;
  padding: 1rem 1.4rem;
  background: var(--bg-surface);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
}

.filter-group, .sort-group {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1rem;
}

.filter-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.filter-item label,
.filter-sort-bar label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
  font-weight: 600;
}

.filter-sort-bar select {
  padding: 0.5rem 2.2rem 0.5rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-family: inherit;
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238888a0' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
}

.filter-sort-bar select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.85rem !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  color: var(--text-light) !important;
  padding-bottom: 0.1rem;
}

.toggle-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.restaurant-count {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
  font-weight: 500;
}

/* ---- Restaurant Grid ---- */
.restaurant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.1rem;
}

.restaurant-card {
  background: var(--bg-surface);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-lg);
  padding: 1.3rem;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.restaurant-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(211,34,68,0.08), var(--shadow-md);
}

.restaurant-card.voted {
  border-color: var(--primary);
  background: var(--voted);
  box-shadow: 0 0 0 1px var(--primary), 0 4px 20px rgba(211,34,68,0.1);
}

.restaurant-grid.locked .restaurant-card {
  cursor: not-allowed;
  opacity: 0.7;
  filter: saturate(0.7);
}

.restaurant-grid.locked .restaurant-card:hover {
  transform: none;
  border-color: rgba(255,255,255,0.1);
  box-shadow: none;
}

.restaurant-grid.locked .restaurant-card.voted {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.restaurant-card.voted::after {
  content: 'Jouw stem';
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  background: var(--primary);
  color: white;
  padding: 0.2rem 0.7rem;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  margin-bottom: 0.6rem;
}

.card-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg-elevated);
  flex-shrink: 0;
}

.card-logo-placeholder {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-muted);
}

.card-title {
  flex: 1;
  min-width: 0;
}

.card-title .name {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-title .cuisine {
  color: var(--text-light);
  font-size: 0.8rem;
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-link {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all var(--transition);
  text-decoration: none;
}

.card-link:hover {
  color: var(--primary);
  border-color: var(--border-hover);
  background: var(--primary-glow);
}

.card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
  font-size: 0.85rem;
  margin-bottom: 0.6rem;
}

.card-meta .star {
  color: #facc15;
}

.card-meta .rating {
  font-weight: 600;
  color: var(--text);
}

.card-meta .rating .rating-max {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.78rem;
}

.card-meta .rating-count {
  color: var(--text-light);
  font-size: 0.8rem;
}

.card-rating {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.card-rating .rating-source {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.12rem 0.38rem;
  border-radius: 100px;
  color: var(--text-light);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
}

.card-rating-ours .rating-source {
  color: var(--primary);
  background: rgba(211, 34, 68, 0.12);
  border-color: rgba(211, 34, 68, 0.3);
}

.card-meta .closed-badge {
  background: rgba(239,68,68,0.15);
  color: var(--danger);
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.card-footer .vote-count {
  background: var(--primary-glow);
  color: var(--primary);
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 600;
}

.card-footer .recent-winner {
  background: rgba(250,204,21,0.1);
  color: #facc15;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
}

/* ---- Results ---- */
#results-container {
  margin-bottom: 1.5rem;
}

.result-bar {
  display: flex;
  align-items: center;
  margin-bottom: 0.6rem;
  gap: 0.8rem;
}

.result-bar .bar-name {
  width: 180px;
  font-weight: 600;
  text-align: right;
  flex-shrink: 0;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-bar .bar-track {
  flex: 1;
  background: var(--bg-elevated);
  border-radius: 100px;
  height: 34px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.result-bar .bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  border-radius: 100px;
  display: flex;
  align-items: center;
  padding-left: 0.9rem;
  padding-right: 0.5rem;
  color: white;
  font-weight: 600;
  font-size: 0.82rem;
  animation: barGrow 0.6s ease backwards;
  min-width: fit-content;
  white-space: nowrap;
}

.result-bar:first-child .bar-fill {
  background: linear-gradient(90deg, var(--success), var(--success-dark));
}

.winner-card {
  background: linear-gradient(135deg, var(--success), var(--success-dark));
  color: white;
  padding: 2.5rem 2rem;
  border-radius: var(--radius-xl);
  text-align: center;
  margin: 1.5rem 0;
  position: relative;
  overflow: hidden;
}

.winner-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 60%);
  pointer-events: none;
}

.winner-card h3 { font-size: 1.3rem; margin-bottom: 0.5rem; font-weight: 500; opacity: 0.9; }
.winner-card .winner-name { font-size: 2.2rem; font-weight: 800; letter-spacing: -0.02em; }

.btn-finalize {
  background: linear-gradient(135deg, var(--success), var(--success-dark));
  color: white;
  border: none;
  padding: 0.9rem 2.2rem;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  transition: all var(--transition);
  box-shadow: 0 4px 15px rgba(34,197,94,0.3);
}

.btn-finalize:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(34,197,94,0.4);
}

.voters-list {
  margin-top: 1.2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.voters-list span,
.voter-chip {
  display: inline-block;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 0.2rem 0.65rem;
  border-radius: 100px;
  margin: 0.15rem;
  font-size: 0.78rem;
  color: var(--text-light);
}

.bar-voters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.4rem;
  padding-left: 0.2rem;
}

/* ---- Stats ---- */
.stats-facts {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.fact-item {
  background: linear-gradient(135deg, var(--bg-elevated) 0%, rgba(211,34,68,0.08) 100%);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 0.8rem 1.2rem;
  font-size: 0.92rem;
  color: var(--text);
}

.stats-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.8rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stats-section {
  margin-bottom: 2rem;
}

.stats-section h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.8rem;
  color: var(--text-light);
}

.stat-bar {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.5rem;
}

.stat-bar-name {
  width: 160px;
  text-align: right;
  font-weight: 600;
  font-size: 0.88rem;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-bar-track {
  flex: 1;
  background: var(--bg-elevated);
  border-radius: 100px;
  height: 30px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.stat-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  border-radius: 100px;
  display: flex;
  align-items: center;
  padding-left: 0.8rem;
  padding-right: 0.5rem;
  color: white;
  font-weight: 600;
  font-size: 0.78rem;
  white-space: nowrap;
  min-width: fit-content;
  animation: barGrow 0.6s ease backwards;
}

.stat-bar-fill.voter-fill {
  background: linear-gradient(90deg, var(--success), var(--success-dark));
}

.streak-card {
  background: var(--bg-surface);
  border: 1px solid rgba(250,204,21,0.2);
  border-left: 3px solid #facc15;
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
  font-weight: 600;
  color: #facc15;
}

/* ---- History ---- */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.history-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-md);
  transition: all var(--transition);
  overflow: hidden;
}

.history-item:hover:not(.expanded) {
  background: var(--bg-elevated);
}

.history-item:nth-child(n+4):not(.expanded) {
  border-left-color: var(--text-muted);
}

.history-item.expanded {
  border-left-color: var(--primary);
  background: var(--bg-elevated);
}

.history-summary {
  padding: 1rem 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  user-select: none;
}

.history-main { flex: 1; min-width: 0; }
.history-item .week { color: var(--text-muted); font-size: 0.85rem; margin-top: 0.15rem; }
.history-item .winner-name { font-weight: 700; font-size: 1.05rem; }

.history-meta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.history-rating {
  font-weight: 700;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--text);
}

.history-rating-star { color: #facc15; }
.history-rating-max { color: var(--text-muted); font-weight: 500; font-size: 0.85rem; }
.history-rating-count { color: var(--text-muted); font-weight: 500; font-size: 0.82rem; }

.history-rating-empty {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.82rem;
  font-style: italic;
}

.my-rating-badge {
  background: var(--primary-glow);
  color: var(--primary);
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 600;
}

.history-toggle {
  color: var(--text-muted);
  font-size: 0.75rem;
  width: 1rem;
  text-align: center;
}

.history-detail {
  padding: 0.3rem 1.2rem 1.2rem 1.2rem;
  border-top: 1px solid var(--border);
  animation: fadeIn 0.25s ease;
}

/* Aggregate block */
.rating-aggregate {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.agg-big {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  letter-spacing: -0.02em;
}

.agg-max {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 500;
}

.agg-count {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  margin-left: auto;
}

/* Readonly star row */
.stars-readonly {
  display: inline-flex;
  gap: 2px;
  font-size: 1rem;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.stars-readonly .star.filled { color: #facc15; }

/* Rating widget */
.rating-widget-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
}

.rating-widget-label {
  font-size: 0.78rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.rating-widget {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.rating-zero {
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 100px;
  width: 28px;
  height: 28px;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.rating-zero:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.rating-zero.active {
  background: rgba(239,68,68,0.15);
  border-color: var(--danger);
  color: var(--danger);
}

.rating-stars {
  display: inline-flex;
  gap: 1px;
}

.rating-star {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1.4rem;
  line-height: 1;
  padding: 0 1px;
  transition: color var(--transition), transform var(--transition);
  font-family: inherit;
}

.rating-star:hover,
.rating-star:focus-visible {
  color: #facc15;
  transform: scale(1.15);
  outline: none;
}

.rating-star.active { color: #facc15; }

.rating-score {
  margin-left: 0.5rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  min-width: 2.5rem;
  font-variant-numeric: tabular-nums;
}

.rating-score-max { color: var(--text-muted); font-weight: 500; font-size: 0.85rem; }

.rating-comment {
  width: 100%;
  margin-top: 0.8rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  min-height: 60px;
  resize: vertical;
  transition: all var(--transition);
}

.rating-comment:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.rating-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.8rem;
  flex-wrap: wrap;
}

.rating-actions .btn-primary,
.rating-actions .btn-secondary {
  padding: 0.5rem 1.2rem;
  font-size: 0.88rem;
}

.rating-status {
  font-size: 0.82rem;
  font-weight: 500;
}

.rating-login-hint {
  padding: 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.rating-login-hint a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.rating-login-hint a:hover { text-decoration: underline; }

/* Ratings list */
.ratings-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.rating-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
}

.rating-item.is-mine {
  border-color: var(--border-hover);
  background: var(--voted);
}

.rating-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.2rem;
  gap: 0.5rem;
}

.rating-item-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.you-tag {
  background: var(--primary-glow);
  color: var(--primary);
  padding: 0.1rem 0.45rem;
  border-radius: 100px;
  font-size: 0.68rem;
  font-weight: 600;
  margin-left: 0.3rem;
  vertical-align: middle;
}

.rating-item-score {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.rating-item-comment {
  margin-top: 0.4rem;
  color: var(--text-light);
  font-size: 0.9rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Reactions + comments on a rating */
.rating-reactions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.65rem;
  align-items: center;
  flex-wrap: wrap;
}

.rx-btn, .rx-comment-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-light);
  padding: 0.28rem 0.65rem;
  border-radius: 100px;
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all var(--transition);
}

.rx-btn:hover:not([disabled]),
.rx-comment-btn:hover:not([disabled]) {
  border-color: rgba(255,255,255,0.2);
  color: var(--text);
}

.rx-btn[disabled], .rx-comment-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.rx-btn.active.up {
  color: var(--success);
  border-color: rgba(34,197,94,0.4);
  background: rgba(34,197,94,0.08);
}

.rx-btn.active.down {
  color: var(--danger);
  border-color: rgba(239,68,68,0.4);
  background: rgba(239,68,68,0.08);
}

.rx-arrow { font-size: 0.72rem; line-height: 1; }
.rx-count { font-weight: 600; font-variant-numeric: tabular-nums; }

.rating-comments-list {
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 280px;
  overflow-y: auto;
}

.rating-comment-item {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text);
  padding: 0.15rem 0;
  line-height: 1.4;
}

.rating-comment-item.is-mine .comment-body {
  color: var(--text);
}

.comment-name {
  font-weight: 600;
  color: var(--text-light);
  flex-shrink: 0;
}

.comment-body {
  flex: 1;
  color: var(--text-light);
  word-break: break-word;
  white-space: pre-wrap;
}

.comment-delete {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 0.3rem;
  flex-shrink: 0;
}

.comment-delete:hover { color: var(--danger); }

.comments-expand {
  align-self: flex-start;
  background: transparent;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 0.8rem;
  font-family: inherit;
  padding: 0.15rem 0;
}

.comments-expand:hover { text-decoration: underline; }

.rating-comment-form {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.comment-input {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
}

.comment-input:focus {
  outline: none;
  border-color: var(--primary);
}

.btn-sm {
  padding: 0.4rem 0.9rem;
  font-size: 0.82rem;
  box-shadow: none;
}

/* ---- Admin ---- */
.admin-actions {
  margin-bottom: 1.5rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  padding: 0.7rem 1.5rem;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  transition: all var(--transition);
  box-shadow: 0 4px 15px rgba(211,34,68,0.2);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(211,34,68,0.3);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  transition: all var(--transition);
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-danger {
  background: rgba(239,68,68,0.1);
  color: var(--danger);
  border: 1px solid rgba(239,68,68,0.2);
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  transition: all var(--transition);
}

.btn-danger:hover {
  background: rgba(239,68,68,0.2);
  border-color: var(--danger);
}

.refresh-status {
  margin-top: 0.6rem;
  font-size: 0.85rem;
}

.admin-add {
  margin-bottom: 1.5rem;
  padding: 1.2rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.admin-add h3 {
  margin-bottom: 0.8rem;
  font-size: 1rem;
  font-weight: 600;
}

.admin-help {
  font-size: 0.82rem;
  color: var(--text-light);
  line-height: 1.4;
  margin-bottom: 0.7rem;
}

.admin-add form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.admin-add input {
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--bg-elevated);
  color: var(--text);
  transition: all var(--transition);
}

.admin-add input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.admin-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all var(--transition);
}

.admin-item:hover {
  background: var(--bg-elevated);
}

.admin-item .info { font-weight: 600; font-size: 0.92rem; }
.admin-item .cuisine-tag {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-left: 0.5rem;
}

.admin-item.is-removed {
  opacity: 0.6;
}

.admin-item.is-removed .info {
  text-decoration: line-through;
  text-decoration-color: var(--text-muted);
}

.admin-item-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.status-pill {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 100px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.status-pill.status-removed {
  background: rgba(239,68,68,0.12);
  color: var(--danger);
  border: 1px solid rgba(239,68,68,0.3);
}

.status-pill.status-blocked {
  background: rgba(234,179,8,0.12);
  color: #facc15;
  border: 1px solid rgba(234,179,8,0.3);
}

.admin-item.is-blocked .info {
  color: var(--text-light);
}

.admin-item-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* ---- Shared ---- */
.loading {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.empty-state h3 {
  margin-bottom: 0.5rem;
  color: var(--text-light);
  font-weight: 600;
}

.empty-state p {
  font-size: 0.9rem;
}

/* ---- Footer ---- */
footer {
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--text-light);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}

footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
}

footer a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.footer-brand {
  margin-top: 0.4rem;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

/* ---- Animations ---- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes barGrow {
  from { width: 0; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

/* ---- Responsive ---- */
@media (max-width: 700px) {
  header {
    padding: 1.2rem;
    flex-direction: column;
    gap: 0.8rem;
    text-align: center;
  }

  header h1 {
    font-size: 1.6rem;
  }

  nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  nav::-webkit-scrollbar { display: none; }

  .nav-btn {
    padding: 0.8rem 1rem;
    font-size: 0.88rem;
    white-space: nowrap;
  }

  main {
    padding: 1.2rem 1rem;
  }

  .vote-header {
    flex-direction: column;
    align-items: stretch;
  }

  .voter-input {
    flex-direction: column;
    align-items: stretch;
  }

  .voter-input input { width: 100%; }

  .filter-sort-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group, .sort-group {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-sort-bar select {
    width: 100%;
  }

  .restaurant-grid {
    grid-template-columns: 1fr;
  }

  .result-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.3rem;
  }

  .result-bar .bar-name {
    text-align: left;
    width: auto;
  }

  .history-summary {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }

  .history-meta {
    justify-content: flex-start;
    width: 100%;
  }

  .rating-aggregate {
    gap: 0.6rem;
  }

  .agg-count { margin-left: 0; width: 100%; }
}

/* ---- View Transitions (Chromium) ---- */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.28s;
  animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}
::view-transition-old(root) {
  animation-name: vt-fade-out;
}
::view-transition-new(root) {
  animation-name: vt-fade-in;
}
@keyframes vt-fade-out {
  to { opacity: 0; transform: translateY(-4px); }
}
@keyframes vt-fade-in {
  from { opacity: 0; transform: translateY(4px); }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .landing-mark { animation: none; }
  .wordmark:hover .wordmark-icon { transform: none; }
}
