:root {
  --ink: #16232f;
  --ink-soft: #4f6272;
  --panel: rgba(253, 251, 246, 0.93);
  --line: rgba(33, 41, 51, 0.14);
  --accent: #0d7a5f;
  --accent-strong: #095b46;
  --danger: #a31e2f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  background: #e6ebe5;
  min-height: 100vh;
}

#atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  transition: background 500ms ease;
}

body.theme-default #atmosphere {
  background:
    radial-gradient(1200px 700px at 18% -15%, #cee3d0 0%, transparent 62%),
    radial-gradient(1000px 600px at 90% 0%, #e9dbc6 0%, transparent 60%),
    linear-gradient(180deg, #eef2e9 0%, #dde6dd 100%);
}

body.theme-riviera #atmosphere {
  background:
    radial-gradient(1400px 850px at 5% 8%, rgba(216, 244, 226, 0.8) 0%, transparent 62%),
    radial-gradient(1300px 700px at 85% -10%, rgba(180, 218, 243, 0.8) 0%, transparent 58%),
    linear-gradient(160deg, #e8f1e7 0%, #dce7d4 55%, #d6e0cf 100%);
}

body.theme-florida #atmosphere {
  background:
    radial-gradient(1200px 800px at 15% 0%, rgba(190, 236, 214, 0.8) 0%, transparent 60%),
    radial-gradient(1100px 650px at 85% 0%, rgba(156, 216, 244, 0.76) 0%, transparent 58%),
    linear-gradient(160deg, #e7f3eb 0%, #dbefe8 55%, #d2e7df 100%);
}

body.theme-desert #atmosphere {
  background:
    radial-gradient(1200px 700px at 10% 0%, rgba(246, 215, 180, 0.78) 0%, transparent 62%),
    radial-gradient(1100px 700px at 88% -5%, rgba(233, 186, 145, 0.72) 0%, transparent 58%),
    linear-gradient(160deg, #f3e8d7 0%, #ead9c1 52%, #e4d1b7 100%);
}

body.theme-texas #atmosphere {
  background:
    radial-gradient(1200px 700px at 10% -5%, rgba(240, 220, 184, 0.82) 0%, transparent 60%),
    radial-gradient(1100px 650px at 86% 0%, rgba(213, 199, 160, 0.72) 0%, transparent 58%),
    linear-gradient(160deg, #efe4cd 0%, #e2d4b9 53%, #dcc9a9 100%);
}

body.theme-major #atmosphere {
  background:
    radial-gradient(1300px 750px at 14% -5%, rgba(198, 232, 206, 0.8) 0%, transparent 58%),
    radial-gradient(1200px 700px at 88% 0%, rgba(204, 222, 194, 0.74) 0%, transparent 56%),
    linear-gradient(160deg, #e8efe1 0%, #d9e4cf 54%, #cfddc3 100%);
}

.page-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 14px 36px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3.6vw, 2.5rem);
  letter-spacing: 0.02em;
}

.course-label {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 0.96rem;
}

.card {
  background: var(--panel);
  backdrop-filter: blur(2px);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(29, 43, 58, 0.08);
}

.top-card {
  margin-top: 14px;
  padding: 14px;
  display: grid;
  grid-template-columns: 1.1fr 1.4fr 1fr auto;
  gap: 12px;
  align-items: center;
}

.selector-block label {
  display: block;
  font-size: 0.86rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--ink-soft);
}

select,
input,
button {
  font: inherit;
  border-radius: 10px;
}

select,
input {
  width: 100%;
  border: 1px solid rgba(49, 68, 85, 0.28);
  background: #ffffff;
  color: var(--ink);
  padding: 10px 11px;
}

button {
  border: 0;
  background: var(--accent);
  color: #fff;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: var(--accent-strong);
}

.ghost-button {
  background: rgba(11, 104, 80, 0.12);
  color: var(--ink);
  border: 1px solid rgba(12, 76, 61, 0.25);
}

.ghost-button:hover {
  background: rgba(11, 104, 80, 0.2);
}

.meta-title {
  margin: 0 0 4px;
  font-size: 1.08rem;
  font-weight: 700;
}

.meta-line {
  margin: 2px 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.weather-widget {
  border: 1px solid rgba(53, 78, 98, 0.19);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  padding: 9px 10px;
  min-height: 92px;
}

.weather-title {
  margin: 0;
  font-size: 0.76rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.weather-location {
  margin: 6px 0 2px;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.weather-temp {
  margin: 0;
  font-size: 1.28rem;
  font-weight: 700;
}

.weather-conditions {
  margin: 2px 0 0;
  font-size: 0.84rem;
  color: var(--ink-soft);
}

.leaderboard-card {
  margin-top: 12px;
  padding: 10px 12px 12px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

th,
td {
  border-bottom: 1px solid rgba(32, 44, 58, 0.11);
  padding: 10px 8px;
  text-align: left;
}

th {
  color: var(--ink-soft);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

tr.is-leader {
  background: rgba(175, 232, 201, 0.42);
}

.muted {
  color: var(--ink-soft);
}

.hidden {
  display: none !important;
}

.admin-drawer {
  margin-top: 12px;
  border: 1px solid rgba(35, 49, 64, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.52);
}

.admin-drawer summary {
  list-style: none;
  cursor: pointer;
  padding: 8px 12px;
  font-size: 0.78rem;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-drawer summary::-webkit-details-marker {
  display: none;
}

.admin-inner {
  border-top: 1px solid rgba(35, 49, 64, 0.12);
  padding: 10px 12px 12px;
  display: grid;
  gap: 10px;
}

.admin-inner label {
  font-size: 0.82rem;
  color: var(--ink-soft);
  font-weight: 700;
}

.mini-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.upload-form {
  display: grid;
  gap: 8px;
}

.danger-button {
  background: var(--danger);
}

.danger-button:hover {
  background: #7f1623;
}

.subtle-danger-button {
  background: rgba(163, 30, 47, 0.1);
  color: #5a1220;
  border: 1px solid rgba(127, 22, 35, 0.28);
}

.subtle-danger-button:hover {
  background: rgba(163, 30, 47, 0.18);
}

.error {
  color: var(--danger);
  font-weight: 700;
}

@media (max-width: 900px) {
  .top-card {
    grid-template-columns: 1fr;
  }

  .mini-actions {
    grid-template-columns: 1fr;
  }

  .ghost-button {
    width: 100%;
  }
}
