@import url("https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Source+Sans+3:wght@400;600;700&display=swap");

:root {
  --bg: #f2eee5;
  --panel: #fffdf8;
  --ink: #1f1a16;
  --muted: #6f6457;
  --gold: #b88a3a;
  --gold-strong: #986d24;
  --line: #d8cfbf;
  --success: #2f6f3f;
  --danger: #8f2d21;
  --shadow: 0 10px 28px rgba(26, 17, 7, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Source Sans 3", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top right, #f7f4ec 0, var(--bg) 45%, #ebe2d1 100%);
}

body.admin-mode::after {
  content: "";
  position: fixed;
  inset: 0;
  border: 8px solid rgba(168, 21, 21, 0.9);
  box-shadow: inset 0 0 0 1px rgba(255, 215, 140, 0.52);
  pointer-events: none;
  z-index: 2600;
}

.emergency-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  pointer-events: none;
  background: rgba(9, 6, 4, 0.88);
  backdrop-filter: blur(3px);
}

.emergency-overlay.is-active {
  display: flex;
}

.emergency-overlay-inner {
  width: min(94vw, 720px);
  display: grid;
  gap: 0.7rem;
  justify-items: center;
}

.emergency-overlay img {
  width: 100%;
  max-height: min(84vh, 900px);
  object-fit: contain;
  border-radius: 14px;
  border: 2px solid rgba(255, 224, 170, 0.42);
  box-shadow:
    0 18px 36px rgba(0, 0, 0, 0.55),
    0 0 24px rgba(255, 199, 94, 0.2);
}

.emergency-overlay-label {
  margin: 0;
  color: #f4d9aa;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Bebas Neue", "Franklin Gothic Medium", sans-serif;
  letter-spacing: 0.04em;
}

.hero {
  padding: 2.4rem 1.2rem 2.2rem;
  color: #f8f1e4;
  background:
    radial-gradient(circle at 12% 15%, rgba(236, 188, 93, 0.2), transparent 30%),
    radial-gradient(circle at 88% 12%, rgba(236, 188, 93, 0.18), transparent 34%),
    linear-gradient(130deg, #24160f 0%, #11100d 44%, #4f3519 100%);
  border-bottom: 4px solid #29190f;
}

.hero-inner {
  width: min(1100px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: center;
}

.hero-copy {
  text-align: center;
}

.hero .kicker {
  margin: 0;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #d5b477;
}

.hero h1 {
  margin-top: 0.3rem;
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  color: #f5e5c8;
}

.hero .subtitle {
  margin: 0.35rem 0 0;
  font-size: 1.03rem;
  color: #e8dcc7;
}

.hero-statue {
  width: min(150px, 34vw);
  height: auto;
  object-fit: contain;
  justify-self: center;
  opacity: 0.98;
  filter:
    drop-shadow(0 9px 16px rgba(0, 0, 0, 0.34))
    drop-shadow(0 0 18px rgba(238, 185, 94, 0.16));
}

.hero-chips {
  margin-top: 0.7rem;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.lock-chip {
  display: inline-block;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(225, 184, 104, 0.5);
  background: rgba(9, 8, 7, 0.42);
  color: #f4e1b8;
  font-size: 0.9rem;
}

.countdown-chip {
  display: inline-block;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(133, 207, 255, 0.5);
  background: rgba(10, 16, 25, 0.58);
  color: #b9e4ff;
  font-size: 0.9rem;
  font-weight: 700;
}

.admin-chip {
  display: inline-block;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 192, 192, 0.78);
  background: linear-gradient(180deg, rgba(168, 21, 21, 0.95), rgba(124, 12, 12, 0.96));
  color: #ffe7bd;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-chip[hidden] {
  display: none !important;
}

.page {
  width: min(1200px, 100% - 2rem);
  margin: 1.4rem auto 2.4rem;
  display: grid;
  gap: 1rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: var(--shadow);
}

.panel-intro {
  display: grid;
  gap: 0.8rem;
}

.ballot-form {
  display: grid;
  gap: 0.35rem;
}

.ballot-meta-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
  align-items: end;
}

.ballot-field {
  display: grid;
  gap: 0.3rem;
}

.ballot-form label,
.admin-grid label {
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.ballot-submit {
  display: flex;
  align-items: end;
}

.ballot-submit button {
  width: 100%;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  min-height: 2.45rem;
  border-radius: 9px;
  border: 1px solid #c8bca8;
  padding: 0.5rem 0.66rem;
  background: #fff;
  color: var(--ink);
}

input:focus,
select:focus,
button:focus {
  outline: 2px solid rgba(184, 138, 58, 0.45);
  outline-offset: 1px;
}

button {
  min-height: 2.45rem;
  border: none;
  border-radius: 9px;
  padding: 0.5rem 0.95rem;
  background: linear-gradient(180deg, #c99b4c 0%, #aa7830 100%);
  color: #1f140b;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.04);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.status-text {
  min-height: 1.2rem;
  margin: 0.2rem 0 0;
  color: var(--muted);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-bottom: 0.7rem;
}

.section-head p {
  margin: 0;
  color: var(--muted);
}

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

.category-card {
  border: 1px solid #dfd5c6;
  border-radius: 10px;
  background: linear-gradient(180deg, #fffefb 0%, #f8f2e8 100%);
  overflow: hidden;
}

.category-title {
  margin: 0;
  padding: 0.46rem 0.7rem;
  font-size: 1rem;
  border-bottom: 1px solid #e6dbc8;
  color: #2a1a11;
  background: linear-gradient(90deg, rgba(220, 186, 121, 0.2), rgba(255, 255, 255, 0));
}

.option-list {
  padding: 0.46rem 0.62rem 0.62rem;
  display: grid;
  gap: 0.34rem;
}

.option {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.93rem;
  line-height: 1.24;
  padding: 0.17rem 0;
}

.option input {
  margin-top: 0.18rem;
  width: 0.95rem;
  height: 0.95rem;
  appearance: none;
  border: 2px solid #bca57c;
  border-radius: 3px;
  background: #fff;
  flex: 0 0 auto;
}

.option input:checked {
  background: linear-gradient(180deg, #d5ae64 0%, #b4832e 100%);
  border-color: #936723;
}

.option-text {
  display: inline-block;
}

.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

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

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
}

.leaderboard-table th,
.leaderboard-table td {
  text-align: left;
  border-bottom: 1px solid #e4dacc;
  padding: 0.45rem 0.42rem;
  white-space: nowrap;
}

.leaderboard-table th {
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6e6153;
}

.leaderboard-table tr.me {
  background: rgba(225, 191, 124, 0.16);
}

.results-list {
  display: grid;
  gap: 0.33rem;
}

.result-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.2rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid #e4dacc;
  border-radius: 8px;
  background: #fffdf8;
}

.result-item h3 {
  font-size: 0.95rem;
  color: #27160f;
}

.result-winner {
  font-weight: 700;
}

.result-pending {
  color: var(--muted);
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.38rem;
  margin-bottom: 0.75rem;
}

.admin-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.footer {
  padding: 0.9rem 1rem 1.4rem;
  text-align: center;
  color: #6f6253;
}

.good {
  color: var(--success);
}

.bad {
  color: var(--danger);
}

.is-hidden {
  display: none !important;
}

@media (min-width: 940px) {
  .hero-inner {
    grid-template-columns: 1fr 200px;
  }

  .hero-copy {
    text-align: left;
    padding-left: 0.6rem;
  }

  .hero .subtitle {
    max-width: 620px;
  }

  .hero-statue {
    width: 190px;
  }

  .split {
    grid-template-columns: 1fr 1fr;
  }

  .ballot-meta-grid {
    grid-template-columns: minmax(220px, 1.4fr) repeat(2, minmax(170px, 1fr)) minmax(160px, auto);
  }

  .admin-grid {
    grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr);
    column-gap: 0.7rem;
  }
}
