:root {
  --bg: #101114;
  --panel: rgba(22, 24, 28, 0.88);
  --panel-strong: rgba(28, 31, 37, 0.96);
  --line: rgba(255, 255, 255, 0.14);
  --text: #f3f1eb;
  --muted: #b8b2a7;
  --accent: #f4b84a;
  --accent-2: #46d3b5;
  --danger: #ff766f;
  --ok: #71df8a;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

button,
.ghost-link {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  color: #12100c;
  background: var(--accent);
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button:hover,
.ghost-link:hover {
  filter: brightness(1.06);
}

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

#heroCanvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  background:
    radial-gradient(circle at 18% 18%, rgba(244, 184, 74, 0.16), transparent 27%),
    radial-gradient(circle at 82% 28%, rgba(70, 211, 181, 0.14), transparent 30%),
    linear-gradient(145deg, #101114 0%, #181b1d 52%, #111316 100%);
}

#heroCanvas::after {
  content: "";
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  min-height: 100vh;
  padding: 30px 0;
}

.hero {
  min-height: calc(100vh - 60px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: end;
}

.hero-copy {
  padding: clamp(24px, 6vw, 68px) 0;
  max-width: 780px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent-2);
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  font-size: 0.84rem;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(3.6rem, 13vw, 8.9rem);
  line-height: 0.88;
  letter-spacing: 0;
  max-width: 820px;
}

h2 {
  margin-bottom: 6px;
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 0.96;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.18rem;
}

.lede {
  max-width: 680px;
  color: var(--muted);
  font-size: clamp(1.02rem, 2vw, 1.35rem);
  line-height: 1.45;
}

.email-gate,
.admin-gate {
  margin-top: 32px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 800;
}

.gate-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(70, 211, 181, 0.18);
}

.form-note {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.form-note.error,
#voteMessage.error,
#adminMessage.error {
  color: var(--danger);
}

.form-note.ok,
#voteMessage.ok,
#adminMessage.ok {
  color: var(--ok);
}

.status-panel {
  margin-bottom: clamp(24px, 8vh, 82px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.status-panel div {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.status-panel div:last-child {
  border-bottom: 0;
}

.status-panel span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  text-transform: uppercase;
}

.status-panel strong {
  display: block;
  font-size: 1.08rem;
}

.hidden {
  display: none !important;
}

.app-view {
  padding: 28px 0 48px;
}

.toolbar {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.ghost-button,
.ghost-link {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--line);
}

.category-grid,
.results-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.award-card,
.result-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--panel-strong);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.2);
}

.award-card p,
.result-card p {
  color: var(--muted);
  line-height: 1.45;
}

.award-card select {
  margin-top: 8px;
}

.submit-bar {
  position: sticky;
  bottom: 14px;
  z-index: 2;
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 19, 22, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.submit-bar p {
  margin: 0;
  color: var(--muted);
}

.admin-gate {
  margin-bottom: 18px;
}

.result-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.86rem;
  font-weight: 800;
}

.winner {
  margin-bottom: 14px;
  color: var(--accent);
  font-weight: 900;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 10px;
  align-items: center;
  margin: 10px 0;
}

.bar-label {
  min-width: 0;
}

.bar-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.bar-team {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
}

.bar-track {
  grid-column: 1 / -1;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.leaderboard-view {
  min-height: 100vh;
  padding: 26px 0 42px;
}

.leaderboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.leaderboard-header h2 {
  font-size: clamp(3rem, 7vw, 7rem);
}

.live-panel {
  min-width: 230px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.live-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--ok);
  box-shadow: 0 0 18px var(--ok);
}

.live-panel strong,
.live-panel small {
  display: block;
}

.live-panel small {
  margin-top: 4px;
  color: var(--muted);
}

.leaderboard-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.leaderboard-stat,
.leaderboard-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(28, 31, 37, 0.93);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.22);
}

.leaderboard-stat {
  padding: 14px 16px;
}

.leaderboard-stat span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 900;
  text-transform: uppercase;
}

.leaderboard-stat strong {
  display: block;
  margin-top: 4px;
  font-size: clamp(1.6rem, 3vw, 2.7rem);
}

.leaderboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.leaderboard-card {
  min-width: 0;
  padding: 18px;
}

.leaderboard-card h3 {
  min-height: 2.8em;
  margin-bottom: 14px;
  font-size: clamp(1.15rem, 2vw, 1.7rem);
  line-height: 1.1;
}

.leaderboard-winner {
  border-left: 4px solid var(--accent);
  padding-left: 14px;
  margin-bottom: 16px;
}

.leaderboard-winner span,
.leaderboard-winner small,
.leaderboard-row span {
  color: var(--muted);
}

.leaderboard-winner span,
.leaderboard-winner strong,
.leaderboard-winner small {
  display: block;
}

.leaderboard-winner strong {
  margin-top: 4px;
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  line-height: 1;
}

.leaderboard-winner small {
  margin-top: 8px;
}

.leaderboard-toplist {
  display: grid;
  gap: 10px;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px 12px;
  align-items: center;
}

.leaderboard-row strong,
.leaderboard-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-row b {
  text-align: right;
  color: var(--accent);
  font-size: 1.25rem;
}

@media (max-width: 840px) {
  .hero {
    min-height: calc(100vh - 44px);
    grid-template-columns: 1fr;
    align-content: end;
  }

  .hero-copy {
    padding-bottom: 8px;
  }

  .status-panel {
    margin-bottom: 20px;
  }

  .category-grid,
  .results-grid,
  .leaderboard-grid,
  .leaderboard-stats {
    grid-template-columns: 1fr;
  }

  .toolbar,
  .submit-bar,
  .leaderboard-header {
    align-items: stretch;
    flex-direction: column;
  }

  .gate-row {
    grid-template-columns: 1fr;
  }
}
