:root {
  --bg: #ffffff;
  --bg-soft: #f4f4f5;
  --card: #ffffff;
  --text: #0a0a0a;
  --muted: #6b6b6b;
  --line: #e4e4e7;
  --line-strong: #d4d4d8;
  --ink: #0a0a0a;
  --ink-soft: #262626;
  --gold: #d4af37;
  --silver: #8c9099;
  --bronze: #b87333;
  --other: #4b5563;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.1), 0 18px 40px rgba(0, 0, 0, 0.14);
}

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

body {
  font-family: "Poppins", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.hero {
  text-align: center;
  padding: 5rem 1.5rem 2.5rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.hero h1 {
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.subtitle {
  color: var(--muted);
  margin-top: 0.75rem;
  font-size: 1.05rem;
  max-width: 40ch;
  margin-left: auto;
  margin-right: auto;
}

.stats {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2.25rem;
}

.stat {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1.5rem;
  min-width: 96px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.stat:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
}

.stat .num {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1;
  color: var(--ink);
}

.stat .label {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 0.4rem;
}

/* Each stat number uses its corresponding medal color */
.stat.gold .num { color: var(--gold); }
.stat.silver .num { color: var(--silver); }
.stat.bronze .num { color: var(--bronze); }
.stat.other .num { color: var(--other); }

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem 3rem;
}

.filters {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.filter-btn {
  background: var(--bg);
  color: var(--ink-soft);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.5rem 1.15rem;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.18s ease;
}

.filter-btn:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.filter-btn.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

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

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: var(--line-strong);
}

.card-img {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
}

/* Images keep their original color and fill the whole card image area */
.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  padding: 0;
  transition: transform 0.3s ease;
}

.card:hover .card-img img {
  transform: scale(1.06);
}

.card-body {
  padding: 1.1rem 1.15rem 1.25rem;
  border-top: 1px solid var(--line);
}

.card-body .sport {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.card-body .rank {
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.card-body .event {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--line);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 100;
  padding: 2rem;
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: 90vw;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: var(--shadow-hover);
}

.lightbox-caption {
  color: var(--ink);
  margin-top: 1.25rem;
  text-align: center;
  font-size: 1rem;
  font-weight: 500;
}

.lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.75rem;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: var(--ink);
  border: none;
  color: #fff;
  font-size: 1.75rem;
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.lightbox-close:hover {
  transform: scale(1.08);
}

footer {
  text-align: center;
  color: var(--muted);
  padding: 2.5rem 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
}

.powered-by {
  margin-top: 0.4rem;
}

footer a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
  transition: border-color 0.2s ease;
}

footer a:hover {
  border-color: var(--ink);
}
