:root {
  --surface-base: #090f0d;
  --surface-raised: #111a17;
  --surface-sunken: #0d1512;
  --surface-strong: #17271f;
  --surface-card: #15211c;
  --text-primary: #f3f8f4;
  --text-secondary: #a9b7b0;
  --text-on-strong: #f8fff8;
  --accent-primary: #48c78e;
  --accent-secondary: #e0b84f;
  --accent-info: #66b7d8;
  --accent-danger: #ef6f6f;
  --border-subtle: #26352f;
  --border-strong: #3e554b;
  --shadow-panel: 0 18px 50px rgb(0 0 0 / 0.34);
  --radius-panel: 8px;
  --radius-control: 6px;
  --font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  color: var(--text-primary);
  background:
    radial-gradient(circle at top left, rgb(72 199 142 / 0.12), transparent 32rem),
    var(--surface-base);
  font-family: var(--font-family);
  line-height: 1.5;
}

body {
  margin: 0;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.demo-switcher {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 16px;
  padding: 10px 12px;
  background: var(--surface-sunken);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
}

.demo-switcher strong {
  font-size: 0.92rem;
}

.demo-switcher span {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.demo-switcher a {
  color: var(--accent-primary);
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 5px 10px;
  color: var(--text-secondary);
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: none;
}

.site-nav a[aria-current="page"] {
  color: var(--text-on-strong);
  background: var(--surface-strong);
  border-color: var(--surface-strong);
}

.dashboard-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 260px);
  gap: 18px;
  align-items: center;
  min-height: 168px;
  padding: 18px;
  color: var(--text-on-strong);
  background: var(--surface-strong);
  border-radius: var(--radius-panel);
  overflow: hidden;
}

.dashboard-header img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid rgb(255 255 255 / 0.18);
  border-radius: var(--radius-control);
}

.header-copy {
  max-width: 720px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1;
}

h2 {
  font-size: 1.25rem;
  line-height: 1.25;
}

.summary {
  max-width: 620px;
  margin: 10px 0 0;
  color: rgb(247 255 244 / 0.82);
  font-size: 1.08rem;
}

.phase-pill {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  margin-top: 14px;
  padding: 8px 10px;
  color: var(--text-on-strong);
  background: rgb(255 255 255 / 0.08);
  border-radius: var(--radius-control);
}

.phase-pill span {
  color: rgb(243 248 244 / 0.72);
}

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

.countdown-card {
  min-height: 112px;
  padding: 16px;
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-panel);
}

.countdown-card span,
.match-item span,
.match-item time,
.admin-intro {
  color: var(--text-secondary);
}

.countdown-card strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 2rem;
  line-height: 1.05;
}

.countdown-card time {
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.spotlight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.spotlight-card,
.panel {
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-panel);
}

.spotlight-card {
  display: grid;
  gap: 7px;
  min-height: 116px;
  padding: 16px;
}

.spotlight-card span,
.section-heading > p,
.prize-list dt {
  color: var(--text-secondary);
}

.spotlight-card strong {
  display: block;
  font-size: 1.32rem;
  line-height: 1.1;
}

.spotlight-card small {
  color: var(--text-secondary);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 16px;
}

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

.section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-heading > p {
  margin: 0;
  font-size: 0.9rem;
}

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

.contender-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.contender-card {
  display: grid;
  gap: 8px;
  min-height: 142px;
  padding: 12px;
  background: var(--surface-sunken);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-panel);
}

.contender-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.left-pill,
.owner-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 24px;
  padding: 2px 7px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.left-pill.active,
.owner-pill {
  color: var(--surface-strong);
  background: rgb(28 124 84 / 0.12);
  border-color: rgb(28 124 84 / 0.32);
}

.left-pill.eliminated,
.empty-owner {
  color: var(--text-secondary);
  background: var(--surface-raised);
}

.contender-teams {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mini-team {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 5px 6px;
  font-size: 0.78rem;
  font-weight: 700;
}

.mini-team.eliminated {
  color: var(--text-secondary);
  opacity: 0.64;
  text-decoration: line-through;
}

.contender-run {
  margin-top: auto;
  color: var(--text-secondary);
  font-size: 0.84rem;
}

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

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

thead th {
  color: var(--text-secondary);
  font-size: 0.82rem;
  text-transform: uppercase;
}

tbody th {
  width: 160px;
}

.participant-name {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.participant-avatar {
  display: inline-block;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  background-image: url("/assets/avatars/participant-animals.png");
  background-repeat: no-repeat;
  background-size: 400% 400%;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
}

.avatar-0 {
  background-position: 0% 0%;
}

.avatar-1 {
  background-position: 33.333% 0%;
}

.avatar-2 {
  background-position: 66.666% 0%;
}

.avatar-3 {
  background-position: 100% 0%;
}

.avatar-4 {
  background-position: 0% 33.333%;
}

.avatar-5 {
  background-position: 33.333% 33.333%;
}

.avatar-6 {
  background-position: 66.666% 33.333%;
}

.avatar-7 {
  background-position: 100% 33.333%;
}

.avatar-8 {
  background-position: 0% 66.666%;
}

.avatar-9 {
  background-position: 33.333% 66.666%;
}

.avatar-10 {
  background-position: 66.666% 66.666%;
}

.avatar-11 {
  background-position: 100% 66.666%;
}

.avatar-12 {
  background-position: 0% 100%;
}

.avatar-13 {
  background-position: 33.333% 100%;
}

.avatar-14 {
  background-position: 66.666% 100%;
}

.avatar-15 {
  background-position: 100% 100%;
}

.team-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.team-list li {
  display: inline-flex;
}

.country-card,
.empty-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 6px 8px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  font-size: 0.82rem;
}

.country-card > span {
  display: grid;
  gap: 1px;
}

.country-card strong {
  line-height: 1.05;
}

.country-card small {
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.flag-img {
  flex: 0 0 auto;
  width: 34px;
  height: 24px;
  object-fit: cover;
  background: var(--surface-sunken);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
}

.empty-state {
  color: var(--text-secondary);
}

.side-panel {
  align-self: start;
}

.prize-list {
  margin: 0;
}

.prize-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--border-subtle);
}

.prize-list dd {
  margin: 0;
  font-weight: 800;
}

.status-box {
  margin-top: 16px;
  padding: 12px;
  color: var(--text-secondary);
  background: var(--surface-sunken);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  font-size: 0.92rem;
}

.match-countdowns,
.recent-results {
  margin-top: 20px;
}

.section-heading.compact {
  margin-bottom: 10px;
}

.match-list {
  display: grid;
  gap: 10px;
}

.match-item {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: var(--surface-sunken);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-panel);
}

.match-card-header,
.match-card-body,
.match-team-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.match-card-header,
.match-card-body {
  justify-content: space-between;
}

.match-card-header {
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.match-card-header time {
  text-align: right;
}

.match-round {
  color: var(--text-primary);
  font-weight: 800;
}

.match-teams {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.match-team-row {
  justify-content: space-between;
  min-width: 0;
}

.match-team-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  font-weight: 900;
}

.match-marker {
  display: grid;
  flex: 0 0 auto;
  min-width: 72px;
  padding-left: 10px;
  text-align: right;
  border-left: 1px solid var(--border-subtle);
}

.match-marker span {
  font-size: 0.76rem;
}

.match-marker strong,
.scoreline {
  color: var(--text-primary);
  font-size: 1.12rem;
  line-height: 1.1;
}

.match-owners,
.next-match {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.match-owners {
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.nation-statuses {
  margin-top: 20px;
}

.nation-status-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.status-chip {
  min-width: 154px;
  font-size: 0.84rem;
  font-weight: 800;
}

.status-chip.eliminated {
  color: var(--text-secondary);
  opacity: 0.62;
  text-decoration: line-through;
}

.status-chip.active {
  border-color: var(--accent-primary);
}

.empty-copy {
  margin: 0;
  color: var(--text-secondary);
}

.admin-shell {
  max-width: 1040px;
}

.schedule-shell {
  max-width: 1040px;
}

.schedule-panel h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1;
}

.schedule-intro {
  max-width: 620px;
  margin: 12px 0 0;
  color: var(--text-secondary);
}

.schedule-heading {
  align-items: end;
}

.schedule-meta {
  display: grid;
  gap: 4px;
  color: var(--text-secondary);
  font-size: 0.88rem;
  text-align: right;
}

.schedule-list {
  display: grid;
  gap: 18px;
}

.schedule-day {
  display: grid;
  gap: 10px;
}

.schedule-day h2 {
  font-size: 1.05rem;
}

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

.schedule-match-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: var(--surface-sunken);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-panel);
}

.schedule-match-card time {
  color: var(--text-primary);
  font-size: 1.08rem;
  font-weight: 900;
}

.schedule-teams {
  display: grid;
  gap: 7px;
}

.admin-panel h1 {
  font-size: 2rem;
  line-height: 1.1;
}

.text-link {
  color: var(--accent-primary);
  font-weight: 800;
  text-decoration: none;
}

.admin-intro {
  max-width: 720px;
  margin: 0 0 18px;
}

.admin-form {
  display: grid;
  gap: 18px;
}

.nation-pool {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: var(--surface-sunken);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-panel);
}

.nation-pool-list,
.team-dropzone {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px;
  min-height: 58px;
  padding: 10px;
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
}

.team-dropzone {
  min-height: 116px;
}

.drag-over {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.nation-chip {
  font: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: grab;
}

.nation-chip.dragging {
  opacity: 0.55;
}

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

.admin-participant {
  display: grid;
  gap: 6px;
  font-weight: 800;
}

.admin-participant-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-participant textarea {
  width: 100%;
  min-height: 104px;
  resize: vertical;
  padding: 10px;
  color: var(--text-primary);
  background: var(--surface-sunken);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  font: inherit;
  font-weight: 500;
}

.activation-check {
  display: flex;
  gap: 10px;
  align-items: center;
  width: fit-content;
  font-weight: 800;
}

.activation-check input {
  width: 18px;
  height: 18px;
}

button:not(.nation-chip) {
  width: fit-content;
  min-height: 44px;
  padding: 0 18px;
  color: var(--text-on-strong);
  background: var(--accent-primary);
  border: 0;
  border-radius: var(--radius-control);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.admin-alert {
  margin: 0 0 16px;
  padding: 12px;
  border-radius: var(--radius-control);
}

.admin-alert.success {
  color: var(--surface-strong);
  background: var(--surface-sunken);
  border: 1px solid var(--accent-primary);
}

.admin-alert.error {
  color: var(--accent-danger);
  background: var(--surface-raised);
  border: 1px solid var(--accent-danger);
}

.admin-alert ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

@media (max-width: 860px) {
  .dashboard-header,
  .content-grid,
  .spotlight-grid,
  .countdown-grid,
  .admin-grid,
  .schedule-day-grid {
    grid-template-columns: 1fr;
  }

  .schedule-heading {
    align-items: start;
  }

  .schedule-meta {
    text-align: left;
  }

  .contender-list {
    grid-auto-flow: column;
    grid-auto-columns: minmax(230px, 78%);
    grid-template-columns: none;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
  }

  .contender-card {
    scroll-snap-align: start;
  }

  .match-card-body {
    align-items: stretch;
  }

  .match-marker {
    min-width: 66px;
  }

  .dashboard-header {
    padding: 22px;
  }

  .dashboard-header img {
    display: none;
  }

  .side-panel {
    order: -1;
  }

  .spotlight-card {
    min-height: 84px;
  }
}
