:root {
  --bg: #170f0a;
  --card-bg: rgba(23, 15, 10, 0.72);
  --accent: #ffb347;
  --accent-2: #ff6b4a;
  --text: #fff6ea;
  --text-dim: #e8d9c6;
  --scrim-top: rgba(20, 12, 8, 0.55);
  --scrim-bottom: rgba(12, 7, 5, 0.92);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}

/* ---------- Mosaic hero background ---------- */

.mosaic-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 1fr;
  gap: 2px;
  overflow: hidden;
}

.mosaic-bg .tile {
  background-size: cover;
  background-position: center;
  width: 100%;
  height: 100%;
  animation: mosaicZoom 22s ease-in-out infinite;
  will-change: transform;
}

@keyframes mosaicZoom {
  0% { transform: scale(1); }
  50% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .mosaic-bg .tile { animation: none; }
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to bottom, var(--scrim-top) 0%, var(--scrim-bottom) 75%, var(--bg) 100%);
}

/* ---------- Hero content ---------- */

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1.5rem 4rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.8rem;
  color: var(--accent);
  margin: 0 0 1rem;
  font-weight: 600;
}

.hero h1 {
  font-size: clamp(2.5rem, 8vw, 5rem);
  margin: 0 0 0.75rem;
  background: linear-gradient(120deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.tagline {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  color: var(--text);
  max-width: 40rem;
  margin: 0 0 1.25rem;
  font-weight: 600;
}

.message {
  max-width: 34rem;
  color: var(--text-dim);
  line-height: 1.6;
  margin: 0 0 1.5rem;
  font-size: 1.02rem;
}

.see-you {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 800;
  color: var(--accent);
  margin: 0 0 2.5rem;
}

.scroll-hint {
  color: var(--text-dim);
  text-decoration: none;
  border: 1px solid rgba(255, 246, 234, 0.3);
  border-radius: 999px;
  padding: 0.6rem 1.3rem;
  font-size: 0.95rem;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.scroll-hint:hover {
  background: rgba(255, 246, 234, 0.08);
  border-color: rgba(255, 246, 234, 0.6);
}

/* ---------- Stats ---------- */

.stats-section {
  position: relative;
  background: var(--bg);
  padding: 0 1.25rem 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stat-number {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 800;
  color: var(--accent);
}

.stat-label {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-top: 0.35rem;
}

/* ---------- Ranking / podium ---------- */

.ranking-section {
  position: relative;
  background: var(--bg);
  padding: 1rem 1.25rem 2rem;
  max-width: 700px;
  margin: 0 auto;
}

.ranking-section h2 {
  text-align: center;
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin: 1rem 0 2rem;
  color: var(--text);
}

.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.podium-place {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px 12px 6px 6px;
  padding: 1rem 0.75rem;
  min-width: 6.5rem;
}

.podium-place .medal { font-size: 1.8rem; }
.podium-place .podium-name { font-weight: 700; color: var(--text); text-align: center; }
.podium-place .podium-score { color: var(--accent); font-size: 0.9rem; font-weight: 600; }

.podium-place.first { padding-top: 1.75rem; border-color: var(--accent); order: 2; }
.podium-place.second { order: 1; }
.podium-place.third { order: 3; }

.ranking-list {
  list-style: none;
  counter-reset: rank 3;
  margin: 0 0 1.5rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.ranking-list li {
  counter-increment: rank;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  padding: 0.55rem 1rem;
  color: var(--text-dim);
}

.ranking-list li::before {
  content: counter(rank) "º";
  color: var(--accent);
  font-weight: 700;
  margin-right: 0.75rem;
  min-width: 1.6rem;
}

.rank-name { flex: 1; text-align: left; color: var(--text); }
.rank-score { font-weight: 600; }

.ranking-footnote {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.95rem;
}

/* ---------- Gallery ---------- */

.gallery-section {
  position: relative;
  background: var(--bg);
  padding: 1rem 1.25rem 3rem;
  max-width: 1200px;
  margin: 0 auto;
}

.gallery-section h2 {
  text-align: center;
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin: 1rem 0 2rem;
  color: var(--text);
}

.gallery-section-full {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 2.5rem;
}

.gallery-subtitle {
  text-align: center;
  color: var(--text-dim);
  margin: -1.25rem 0 1.5rem;
  font-size: 0.95rem;
}

.full-gallery-toggle-wrap {
  display: flex;
  justify-content: center;
}

.full-gallery-toggle {
  font: inherit;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid rgba(255, 246, 234, 0.3);
  border-radius: 999px;
  padding: 0.7rem 1.5rem;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.full-gallery-toggle:hover {
  background: rgba(255, 246, 234, 0.08);
  border-color: rgba(255, 246, 234, 0.6);
}

.full-gallery-panel {
  margin-top: 2rem;
}

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

.gallery img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  display: block;
  transition: transform 0.2s ease, filter 0.2s ease;
  background: #241812;
}

.gallery img:hover {
  transform: scale(1.03);
  filter: brightness(1.08);
}

/* ---------- Footer ---------- */

.site-footer {
  text-align: center;
  padding: 2rem 1rem 3rem;
  color: var(--text-dim);
  font-size: 0.9rem;
  background: var(--bg);
}

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(5, 3, 2, 0.94);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.lightbox[data-open="true"] {
  display: flex;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.lightbox-close:hover,
.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox-close {
  top: 1.25rem;
  right: 1.25rem;
}

.lightbox-nav.prev { left: 1.25rem; top: 50%; transform: translateY(-50%); }
.lightbox-nav.next { right: 1.25rem; top: 50%; transform: translateY(-50%); }

@media (max-width: 600px) {
  .mosaic-bg { grid-template-columns: repeat(4, 1fr); }
  .lightbox-nav { width: 2.4rem; height: 2.4rem; font-size: 1.5rem; }
}
