:root {
  --bg0: #0c1a24;
  --bg1: #143044;
  --sand: #e8d5a3;
  --foam: #f4f7f2;
  --lagoon: #2bb3c0;
  --lagoon-deep: #1a7a86;
  --coral: #e07a5f;
  --ink: #0a1218;
  --muted: #9bb0bc;
  --card: rgba(244, 247, 242, 0.06);
  --radius: 12px;
  --font: "DM Sans", system-ui, sans-serif;
  --display: "Outfit", "DM Sans", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--foam);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(43, 179, 192, 0.35), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 0%, rgba(224, 122, 95, 0.22), transparent 50%),
    linear-gradient(165deg, var(--bg0), var(--bg1) 45%, #0a1520);
  background-attachment: fixed;
}

a {
  color: var(--lagoon);
  text-decoration: none;
}

a:hover {
  color: var(--sand);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(244, 247, 242, 0.08);
}

.brand {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: 0.06em;
  color: var(--sand);
}

.site-header nav {
  display: flex;
  gap: 1rem;
  font-size: 0.95rem;
}

.site-header nav a {
  color: var(--foam);
}

.nav-muted {
  opacity: 0.55;
}

main {
  width: min(960px, 100% - 2rem);
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.site-footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.hero {
  text-align: center;
  padding: 2.5rem 0 3rem;
  animation: rise 0.7s ease-out both;
}

.hero-brand {
  font-family: var(--display);
  font-size: clamp(2.8rem, 10vw, 4.5rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--sand);
  margin: 0;
  line-height: 1;
  text-shadow: 0 8px 40px rgba(232, 213, 163, 0.25);
}

.hero h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.4rem, 4vw, 2rem);
  margin: 0.75rem 0 0.5rem;
}

.hero-lead {
  max-width: 36rem;
  margin: 0 auto 1.5rem;
  color: var(--muted);
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.btn {
  display: inline-block;
  padding: 0.7rem 1.25rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  font-size: 0.95rem;
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--lagoon), var(--lagoon-deep));
  color: #041218;
}

.btn-primary:hover {
  color: #041218;
}

.btn-ghost {
  background: transparent;
  border-color: rgba(244, 247, 242, 0.25);
  color: var(--foam);
}

.btn-danger {
  background: transparent;
  border-color: var(--coral);
  color: var(--coral);
}

.section-lead {
  color: var(--muted);
  margin-top: -0.25rem;
}

.podium h2,
.recent h2,
.page-narrow h1 {
  font-family: var(--display);
}

.podium-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: grid;
  gap: 1rem;
}

@media (min-width: 720px) {
  .podium-list {
    grid-template-columns: repeat(3, 1fr);
    align-items: end;
  }
  .podium-item.rank-1 {
    order: 2;
  }
  .podium-item.rank-2 {
    order: 1;
  }
  .podium-item.rank-3 {
    order: 3;
  }
}

.podium-item {
  background: var(--card);
  border: 1px solid rgba(244, 247, 242, 0.1);
  border-radius: var(--radius);
  overflow: hidden;
  animation: rise 0.6s ease-out both;
}

.podium-item.rank-1 {
  animation-delay: 0.05s;
  border-color: rgba(232, 213, 163, 0.45);
}

.podium-item.rank-2 {
  animation-delay: 0.12s;
}

.podium-item.rank-3 {
  animation-delay: 0.18s;
}

.podium-photo img,
.preview-plate,
.admin-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #061018;
}

.podium-meta {
  padding: 0.9rem 1rem 1.1rem;
  display: grid;
  gap: 0.2rem;
}

.podium-meta .rank {
  color: var(--sand);
  font-weight: 700;
  font-size: 0.85rem;
}

.plate {
  font-family: var(--display);
  font-size: 1.35rem;
  letter-spacing: 0.04em;
}

.points {
  color: var(--lagoon);
  font-weight: 700;
}

.nick {
  color: var(--muted);
  font-size: 0.9rem;
}

.recent-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}

.recent-list li {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(244, 247, 242, 0.08);
}

.empty {
  color: var(--muted);
  padding: 1.5rem;
  background: var(--card);
  border-radius: var(--radius);
}

.page-narrow {
  max-width: 560px;
  margin: 0 auto;
  animation: rise 0.5s ease-out both;
}

.flash {
  width: min(960px, 100% - 2rem);
  margin: 1rem auto 0;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
}

.flash-success {
  background: rgba(43, 179, 192, 0.2);
  border: 1px solid var(--lagoon);
}

.flash-error {
  background: rgba(224, 122, 95, 0.2);
  border: 1px solid var(--coral);
}

.upload-form label {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.upload-form input[type="text"],
.admin-form input[type="text"],
.admin-form input[type="password"],
.admin-form input[type="number"],
.admin-form textarea {
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  border: 1px solid rgba(244, 247, 242, 0.2);
  background: rgba(0, 0, 0, 0.25);
  color: var(--foam);
  font: inherit;
}

.file-drop {
  display: grid;
  place-items: center;
  gap: 0.35rem;
  min-height: 180px;
  padding: 1.25rem;
  text-align: center;
  border: 2px dashed rgba(43, 179, 192, 0.5);
  border-radius: var(--radius);
  background: var(--card);
  cursor: pointer;
  font-weight: 600;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.file-drop:hover,
.file-drop:focus-visible {
  border-color: var(--lagoon);
  outline: none;
}

.file-drop.is-dragover {
  border-color: var(--sand);
  background: rgba(232, 213, 163, 0.12);
  transform: scale(1.01);
}

.file-drop small {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.85rem;
}

.file-drop input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.crop-wrap {
  max-height: 420px;
  overflow: hidden;
  background: #000;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.crop-wrap img {
  display: block;
  max-width: 100%;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0;
}

.hint {
  color: var(--muted);
  font-size: 0.9rem;
}

.hidden {
  display: none !important;
}

.preview-row {
  margin-bottom: 1rem;
}

.rules ul {
  line-height: 1.6;
  color: var(--muted);
}

.rules strong {
  color: var(--foam);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid rgba(244, 247, 242, 0.1);
  vertical-align: top;
}

.admin-thumb {
  width: 140px;
  border-radius: 8px;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: rgba(224, 122, 95, 0.25);
  color: var(--coral);
}

.flag-list {
  margin: 0.35rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.85rem;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
