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

:root {
  --bg: #0a0e1a;
  --surface: #161b2e;
  --surface-2: #1f2740;
  --surface-3: #2a3556;
  --border: #3a4668;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --primary: #22d3ee;
  --primary-light: #67e8f9;
  --primary-dark: #0891b2;
  --accent: #f59e0b;
  --accent-light: #fbbf24;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(34, 211, 238, 0.08) 0%, transparent 42%),
    radial-gradient(circle at 88% 78%, rgba(245, 158, 11, 0.06) 0%, transparent 45%);
  background-attachment: fixed;
}

/* ── Topbar ── */
.topbar {
  background: rgba(10, 14, 26, 0.85);
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

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

.topbar-actions {
  display: flex;
  gap: 0.4rem;
}

.icon-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s;
}
.icon-btn:hover {
  background: var(--surface-2);
  border-color: var(--primary);
  color: var(--primary-light);
}
.icon-btn:active { transform: scale(0.92); }

/* ── Header ── */
.game-header {
  padding: 2rem 1.5rem 1.25rem;
}

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

.title-block h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  background: linear-gradient(135deg, #f1f5f9 0%, var(--primary-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.4rem;
  line-height: 1.1;
}

.title-block p {
  font-size: 0.92rem;
  color: var(--text-muted);
  max-width: 540px;
  line-height: 1.6;
}

.status-block {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.counter-pill {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  padding: 0.4rem 0.75rem;
  display: inline-flex;
  align-items: baseline;
  gap: 0.2rem;
  font-variant-numeric: tabular-nums;
}
.counter-num {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary-light);
}
.counter-divider {
  color: var(--text-muted);
  font-size: 0.9rem;
}
.counter-total {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.category-pill {
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.3);
  color: var(--primary-light);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.4rem 0.75rem;
  border-radius: 0.6rem;
}

/* ── Categories bar ── */
.categories-bar {
  background: rgba(22, 27, 46, 0.4);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0.65rem 1.5rem;
}
.categories-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.category-chip {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.35rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s;
}
.category-chip:hover {
  color: var(--text);
  border-color: var(--primary);
}
.category-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #0a0e1a;
}

/* ── Featured section ── */
.featured-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 3rem;
}

.viewer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.viewer-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0a0e1a;
  overflow: hidden;
}
.viewer-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.viewer-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  pointer-events: none;
  padding: 1.25rem;
  background: linear-gradient(180deg, rgba(10, 14, 26, 0) 55%, rgba(10, 14, 26, 0.55) 100%);
  transition: opacity 0.4s ease;
}
.viewer-overlay.fade {
  opacity: 0;
}

.viewer-emoji {
  font-size: 4rem;
  line-height: 1;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.6));
  animation: emojiFloat 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

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

/* ── Caption ── */
.viewer-caption {
  padding: 1.25rem 1.5rem 1.5rem;
}

.caption-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.caption-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

.streetview-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #0a0e1a;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.55rem 1rem;
  border-radius: 0.6rem;
  transition: all 0.2s;
  white-space: nowrap;
}
.streetview-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(34, 211, 238, 0.3);
}

.caption-text {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 0.85rem;
}

.caption-meta {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.meta-chip {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.3rem 0.65rem;
  font-size: 0.78rem;
  color: var(--text);
}
.meta-chip span:first-child {
  margin-right: 0.2rem;
}

/* ── Gallery ── */
.gallery-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 2.5rem 0 1rem;
}
.gallery-header h2 {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
}
.gallery-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
}

.gallery-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  padding: 0.9rem 0.75rem 0.75rem;
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.35rem;
  position: relative;
}
.gallery-tile:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 10px 22px rgba(34, 211, 238, 0.15);
  background: var(--surface-2);
}
.gallery-tile.active {
  border-color: var(--primary);
  background: rgba(34, 211, 238, 0.08);
}
.gallery-tile.active::after {
  content: '';
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.2);
}

.gallery-tile__emoji {
  font-size: 2.2rem;
  line-height: 1;
}

.gallery-tile__title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.gallery-tile__location {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.gallery-tile__category {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary-light);
  font-weight: 700;
  margin-top: 0.1rem;
}

/* ── Mobile ── */
@media (max-width: 600px) {
  .header-inner { flex-direction: column; align-items: flex-start; gap: 0.85rem; }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .caption-header { flex-direction: column; align-items: flex-start; }
  .streetview-link { width: 100%; justify-content: center; }
}
