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

:root {
  --bg: #0a0f1f;
  --surface: #131b30;
  --surface-2: #1c2540;
  --border: #2a3457;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --primary: #6366f1;
  --primary-light: #818cf8;
  --gold: #f59e0b;
  --gold-light: #fbbf24;
  --red: #ef4444;
  --green: #10b981;
  --blue: #38bdf8;
  --star-gold: #fbbf24;
  --star-empty: #334155;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* ── Topbar ── */
.topbar {
  padding: 0.55rem 1.5rem;
  background: #060a16;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.back-link {
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.back-link:hover { color: var(--text); }

.topbar-tag {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ── Header ── */
.game-header {
  background: linear-gradient(135deg, #131b30 0%, #0a0f1f 100%);
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 1.5rem 0.75rem;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
}

.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-emoji {
  font-size: 2.6rem;
  line-height: 1;
  filter: drop-shadow(0 4px 12px rgba(56, 189, 248, 0.4));
}

.brand-title {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, #38bdf8, #818cf8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.stats-strip {
  display: flex;
  gap: 1.25rem;
}

.stat-item {
  text-align: center;
  padding: 0.25rem 0.75rem;
  border-left: 1px solid var(--border);
}
.stat-item:first-child { border-left: none; }

.stat-num {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--gold-light);
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.1rem;
}

/* ── Filter bar ── */
.filter-bar {
  max-width: 1180px;
  margin: 1rem auto 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-right: 0.25rem;
}

.filter-buttons {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.filter-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.4rem 0.8rem;
  border-radius: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.filter-btn:hover {
  border-color: var(--primary-light);
  color: var(--text);
}

.filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.sort-select {
  margin-left: auto;
}

.sort-select select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.4rem 0.7rem;
  border-radius: 0.5rem;
  font-size: 0.78rem;
  cursor: pointer;
  font-family: inherit;
}
.sort-select select:focus { outline: 2px solid var(--primary-light); }

/* ── Main ── */
.game-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 2.5rem;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 960px) {
  .game-main { grid-template-columns: 1fr; }
  .side-panel { order: -1; }
  .stats-strip { width: 100%; justify-content: space-around; }
  .stat-item { border-left: none; }
}

/* ── Reviews list ── */
.reviews-section { min-width: 0; }

.reviews-header {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}

.reviews-header h2 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
}

.reviews-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 0.1rem 0.5rem;
  background: var(--surface);
  border-radius: 999px;
  border: 1px solid var(--border);
}

.reviews-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.review-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.875rem;
  padding: 1rem 1.1rem;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  scroll-margin-top: 200px;
}

.review-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--border);
  transition: background 0.2s;
}

.review-card.rating-5::before { background: var(--green); }
.review-card.rating-4::before { background: var(--blue); }
.review-card.rating-3::before { background: var(--gold); }
.review-card.rating-2::before { background: #fb923c; }
.review-card.rating-1::before { background: var(--red); }

.review-card:hover {
  border-color: var(--primary-light);
  background: #1a2545;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.review-card.highlighted {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.3), 0 8px 24px rgba(245, 158, 11, 0.15);
}

.review-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.review-stars {
  letter-spacing: 0.05em;
  font-size: 0.95rem;
  line-height: 1;
}

.star-filled { color: var(--star-gold); }
.star-empty { color: var(--star-empty); }

.review-location-chip {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.review-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.35rem;
  line-height: 1.35;
}

.review-body {
  font-size: 0.88rem;
  color: #cbd5e1;
  line-height: 1.55;
  margin-bottom: 0.7rem;
}

.review-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.review-author {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.author-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.7rem;
}

.review-date {
  color: var(--text-muted);
}

.review-helpful {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--text-muted);
}

.helpful-icon { font-size: 0.85rem; }

.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
  background: var(--surface);
  border-radius: 0.875rem;
  border: 1px dashed var(--border);
}
.empty-emoji { font-size: 3rem; margin-bottom: 0.5rem; }

/* ── Side panel ── */
.side-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: sticky;
  top: 180px;
}

@media (max-width: 960px) {
  .side-panel { position: static; }
}

.globe-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 0.9rem;
  overflow: hidden;
}

.globe-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.globe-card-header h3 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 700;
}

.globe-coord {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.globe-wrapper {
  position: relative;
  border-radius: 0.625rem;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0b1e3a;
}

#world-svg {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 1;
}

.continents path {
  transition: fill 0.2s;
}

.pin {
  cursor: pointer;
  transition: transform 0.15s;
  transform-origin: center;
  transform-box: fill-box;
}
.pin:hover { transform: scale(1.6); }

.pin-ring {
  opacity: 0.55;
  animation: pinPulse 2s ease-in-out infinite;
  transform-origin: center;
  transform-box: fill-box;
}

@keyframes pinPulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 0.1; transform: scale(2.2); }
}

.globe-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 15, 31, 0) 50%, rgba(10, 15, 31, 0.95) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0.6rem 0.75rem;
  pointer-events: none;
}

.globe-overlay-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.globe-overlay-loc {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.globe-overlay-rating {
  margin-top: 0.25rem;
  font-size: 0.75rem;
}

.globe-caption {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  text-align: center;
  line-height: 1.4;
}

/* ── Featured ── */
.featured-card {
  background: linear-gradient(135deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1rem;
}

.featured-eyebrow {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: 0.4rem;
  font-weight: 700;
}

.featured-body {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.5;
}

.featured-body .feat-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.featured-body .feat-stars {
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.featured-body .feat-loc {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* ── Footer ── */
.game-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* ── Animations ── */
@keyframes cardIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.review-card {
  animation: cardIn 0.3s ease both;
}

@media (prefers-reduced-motion: reduce) {
  .review-card, .pin-ring { animation: none !important; }
  html { scroll-behavior: auto; }
}
