:root {
  color-scheme: dark;
  font-family: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --evergreen: #0d3b2e;
  --evergreen-light: #1e5b44;
  --cranberry: #c1352c;
  --cranberry-light: #f26b5e;
  --gold: #ffd166;
  --frost: #e2f6ff;
  --snow: #f8fbff;
  --charcoal: #10141a;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #1c4233 0%, #091511 60%, #050908 100%);
  color: var(--snow);
  font-size: 16px;
  line-height: 1.5;
}

#snow-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.page,
.admin-page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 3rem clamp(1.25rem, 4vw, 4rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.hero {
  text-align: center;
  max-width: 640px;
}

.hero h1 {
  font-family: 'Marcellus', 'Times New Roman', serif;
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  margin: 0.25rem 0 0.5rem;
  color: var(--gold);
}

.eyebrow {
  letter-spacing: 0.4em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--frost);
  opacity: 0.8;
}

.subtitle {
  margin: 0 auto;
  color: var(--snow);
  opacity: 0.9;
}

.meter-card,
.admin-panel {
  width: min(960px, 100%);
  background: rgba(12, 25, 21, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  border-radius: 32px;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  display: grid;
  gap: clamp(1.5rem, 3vw, 3rem);
  grid-template-columns: minmax(240px, 320px) 1fr;
  align-items: center;
  backdrop-filter: blur(12px);
}

.meter-visual {
  display: flex;
  justify-content: center;
}

.meter-frame {
  position: relative;
  width: 240px;
  padding: 2rem 1.5rem;
  border-radius: 42px;
  background: linear-gradient(180deg, rgba(7, 14, 12, 0.95), rgba(8, 20, 15, 0.85));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 25px 40px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.meter-cap {
  text-align: center;
}

.meter-percent {
  font-size: clamp(2.25rem, 4vw, 2.85rem);
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.08em;
  margin: 0;
  text-shadow: 0 8px 25px rgba(0, 0, 0, 0.65);
}

.meter-caption {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.82rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

.bar-wrapper {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 1.25rem;
}

.bar-track {
  position: relative;
  width: 120px;
  height: 380px;
  border-radius: 80px;
  background: linear-gradient(180deg, #05130e 0%, #041b13 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 0 35px rgba(0, 0, 0, 0.65);
  overflow: hidden;
}

#thermo-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(180deg, var(--cranberry) 0%, var(--cranberry-light) 65%, #ffc7a6 100%);
  height: 0%;
  transition: height 0.9s cubic-bezier(0.23, 1, 0.32, 1);
}

.bar-scale {
  list-style: none;
  margin: 0;
  padding: 0;
  height: 380px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

.bar-scale li {
  position: relative;
  padding-left: 1.4rem;
}

.bar-scale li::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 16px;
  height: 1px;
  background: rgba(255, 255, 255, 0.45);
  transform: translateY(-50%);
}

.stats {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

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

.stat-card {
  padding: 1.25rem 1.5rem;
  border-radius: 22px;
  background: rgba(4, 10, 8, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.35);
}

.stat-card.featured {
  background: linear-gradient(135deg, rgba(193, 53, 44, 0.25), rgba(14, 60, 46, 0.95));
  border-color: rgba(255, 209, 102, 0.35);
  box-shadow: 0 20px 35px rgba(193, 53, 44, 0.3);
}

.stat-card .label {
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 0.35rem;
}

.stat-card .value {
  margin: 0;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--frost);
}

.cta {
  border: none;
  border-radius: 999px;
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  background-image: linear-gradient(120deg, var(--cranberry), var(--gold));
  color: var(--charcoal);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

.admin-link,
.back-link a {
  color: var(--gold);
  text-decoration: none;
  font-weight: 600;
}

.admin-link:hover,
.back-link a:hover {
  text-decoration: underline;
}

.admin-body {
  background: radial-gradient(circle at top, #1e2a49 0%, #060814 70%);
}

.admin-panel header h1 {
  font-family: 'Marcellus', 'Times New Roman', serif;
  margin-bottom: 0.5rem;
  color: var(--gold);
}

.pin-field {
  display: grid;
  gap: 0.5rem;
}

.pin-field label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-weight: 600;
}

.pin-field input,
.action-card input {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: var(--snow);
  font-size: 1rem;
}

.pin-field input:focus,
.action-card input:focus {
  outline: 2px solid var(--gold);
}

.admin-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.action-card {
  background: rgba(4, 10, 8, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.35);
}

.action-card header h2 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--snow);
}

.action-card header p {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
}

.action-card label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-weight: 600;
}

.secondary-button {
  background-image: linear-gradient(120deg, var(--evergreen-light), var(--gold));
}

.admin-status {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 20px;
  padding: 1.25rem;
}

.form-status {
  min-height: 1.5rem;
  text-align: center;
  font-weight: 600;
  color: var(--gold);
}

.form-status.is-error {
  color: var(--cranberry-light);
}

.hint {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
}

@media (max-width: 800px) {
  .page,
  .admin-page {
    padding: 1.5rem;
    gap: 1.5rem;
  }

  .hero {
    max-width: 100%;
  }

  .meter-card,
  .admin-panel {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
    padding: 1.5rem;
  }

  .meter-frame {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
  }

  .bar-wrapper {
    flex-direction: column;
    align-items: center;
  }

  .bar-scale {
    flex-direction: row;
    height: auto;
    justify-content: space-between;
    width: 100%;
    margin-top: 1rem;
  }

  .bar-scale li {
    padding-left: 0;
  }

  .bar-scale li::before {
    display: none;
  }

  .stats {
    align-items: stretch;
  }

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

@media (max-height: 800px) and (orientation: landscape) {
  .page {
    flex-direction: row;
    align-items: stretch;
    padding: 2rem;
    gap: 3rem;
  }

  .hero {
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 40%;
  }

  .meter-card {
    width: 100%;
    flex: 1;
    grid-template-columns: 240px 1fr;
    gap: 2rem;
    height: auto;
    overflow-y: auto;
  }

  .bar-track {
    height: 320px;
  }

  .bar-scale {
    height: 320px;
  }
}
