:root {
  color-scheme: dark;
  --bg: #071917;
  --bg-2: #102823;
  --ink: #f4f8ec;
  --muted: #d4ddd5;
  --line: rgba(244, 248, 236, 0.16);
  --panel: rgba(8, 27, 24, 0.9);
  --green: #36d399;
  --gold: #f4c95d;
  --red: #ff726f;
  --blue: #74c0fc;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(7, 25, 23, 0.97), rgba(7, 25, 23, 0.82) 54%, rgba(7, 25, 23, 0.97)),
    url("https://images.pexels.com/photos/32921540/pexels-photo-32921540.jpeg?auto=compress&cs=tinysrgb&w=1800") center / cover fixed,
    var(--bg);
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 12px 18px;
  color: #04110f;
  background: var(--gold);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

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

button.secondary,
.button.secondary {
  color: var(--ink);
  background: rgba(244, 248, 236, 0.08);
  border-color: var(--line);
}

button.danger {
  color: #160606;
  background: var(--red);
}

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

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px clamp(18px, 4vw, 54px);
  background: rgba(7, 25, 23, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 900;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  color: #04110f;
  background: var(--green);
  letter-spacing: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-links a {
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--muted);
  text-decoration: none;
  transition: color 160ms ease, background 160ms ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--ink);
  background: rgba(244, 248, 236, 0.09);
}

.app-shell {
  min-height: calc(100svh - 72px);
}

.hero {
  display: grid;
  min-height: calc(100svh - 72px);
  align-items: end;
  padding: clamp(28px, 6vw, 84px);
}

.hero-inner {
  max-width: 1120px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  color: var(--gold);
  font-weight: 900;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 40px;
  height: 2px;
  background: var(--gold);
}

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

h1 {
  max-width: 820px;
  margin-bottom: 18px;
  font-size: clamp(44px, 9vw, 112px);
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 18px;
  font-size: clamp(30px, 5vw, 62px);
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 12px;
  font-size: 22px;
}

.lead {
  max-width: 680px;
  color: var(--muted);
  font-size: clamp(18px, 2.4vw, 24px);
  line-height: 1.45;
}

.hero-actions,
.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-actions {
  margin-top: 30px;
}

.workspace {
  display: grid;
  gap: 28px;
  padding: clamp(22px, 4vw, 56px);
}

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

.big-number {
  display: block;
  margin-top: 10px;
  font-size: clamp(44px, 6vw, 76px);
  line-height: 1;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: clamp(22px, 4vw, 56px);
  align-items: start;
}

.surface {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(18px, 3vw, 34px);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.qr-card,
.qr-stage {
  display: grid;
  gap: 18px;
  justify-items: center;
}

.qr-image,
.qr-stage-image {
  width: min(100%, 320px);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.qr-stage-image {
  width: min(100%, 420px);
}

.plain-section {
  padding: clamp(12px, 2vw, 24px) 0;
}

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

.task-link {
  display: flex;
  min-height: 210px;
  flex-direction: column;
  justify-content: flex-end;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  text-decoration: none;
  background: linear-gradient(140deg, rgba(54, 211, 153, 0.18), rgba(244, 201, 93, 0.09));
  transition: transform 180ms ease, border-color 180ms ease;
}

.task-link:hover {
  transform: translateY(-3px);
  border-color: rgba(244, 201, 93, 0.72);
}

.task-link strong {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1;
}

.task-link span,
.muted {
  color: var(--muted);
}

.form-stack,
.status-stack {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.26);
}

input[type="file"] {
  min-height: auto;
}

.timer {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  width: min(260px, 80vw);
  border: 1px solid rgba(244, 201, 93, 0.45);
  border-radius: 50%;
  color: var(--gold);
  background: rgba(244, 201, 93, 0.08);
  font-size: clamp(44px, 10vw, 84px);
  font-weight: 950;
}

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

.metric {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.metric strong {
  display: block;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 8px;
  padding: 5px 10px;
  color: #061714;
  background: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.pill.pending {
  background: var(--blue);
}

.pill.rejected {
  background: var(--red);
}

.pill.gold {
  background: var(--gold);
}

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

.rank-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 96px 130px;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(3, 15, 13, 0.78);
  opacity: 1;
  animation: none;
}

.rank-row:first-child {
  border-color: rgba(244, 201, 93, 0.8);
  background: rgba(58, 47, 15, 0.88);
}

.rank-row strong {
  color: var(--ink);
  font-weight: 950;
}

.rank-row .muted {
  color: #e2e9e1;
}

.rank {
  color: var(--gold);
  font-size: 24px;
  font-weight: 950;
}

.score {
  text-align: right;
  color: var(--ink);
  font-size: 28px;
  font-weight: 950;
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tabs button {
  min-height: 38px;
  color: var(--ink);
  background: rgba(244, 248, 236, 0.08);
  border-color: var(--line);
}

.tabs button.active {
  color: #04110f;
  background: var(--green);
}

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

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

.media-thumb {
  width: 160px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
}

.video-thumb {
  width: 220px;
  min-height: 124px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--gold);
  font-size: 13px;
  text-transform: uppercase;
}

.display-mode {
  min-height: calc(100svh - 72px);
  padding: clamp(22px, 4vw, 56px);
  background: rgba(7, 25, 23, 0.78);
}

.display-mode h1 {
  max-width: none;
  font-size: clamp(44px, 7vw, 108px);
}

.display-mode .rank-row {
  grid-template-columns: 72px minmax(0, 1fr) 140px 170px;
  padding: 20px;
}

.display-mode .score {
  font-size: clamp(34px, 5vw, 76px);
}

.notice {
  border-left: 4px solid var(--gold);
  padding: 14px 16px;
  background: rgba(244, 201, 93, 0.1);
  color: var(--ink);
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 22px;
  color: var(--muted);
}

@keyframes rise {
  from {
    transform: translateY(8px);
  }
  to {
    transform: translateY(0);
  }
}

@media (max-width: 820px) {
  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .app-shell,
  .hero,
  .display-mode {
    min-height: auto;
  }

  .split,
  .task-grid,
  .metric-row,
  .summary-grid,
  .qr-grid {
    grid-template-columns: 1fr;
  }

  .rank-row,
  .display-mode .rank-row {
    grid-template-columns: 44px minmax(0, 1fr) 74px;
  }

  .rank-row .pill {
    grid-column: 2 / -1;
    width: fit-content;
  }

  .score {
    font-size: 24px;
  }
}
