:root {
  --ink: #f8fafc;
  --muted: #a7b0c0;
  --paper: #070a12;
  --surface: #101724;
  --surface-soft: #151f2e;
  --line: rgba(255, 255, 255, 0.12);
  --brand: #22c55e;
  --accent: #38bdf8;
  --danger: #ef4444;
  --neutral: #38bdf8;
  --shadow: 0 14px 32px rgba(0, 0, 0, 0.26);
  --shadow-soft: 0 8px 20px rgba(0, 0, 0, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #070a12 0%, #090f1a 48%, #070a12 100%);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

.hero {
  min-height: 52vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px clamp(18px, 5vw, 72px) 34px;
  color: white;
  background:
    linear-gradient(90deg, rgba(7, 10, 18, 0.92), rgba(7, 10, 18, 0.62)),
    linear-gradient(135deg, #f97316 0%, #8b5cf6 19%, #fde047 36%, #16a34a 53%, #2563eb 70%, #050505 100%);
}

.workspace-page .hero {
  min-height: 30vh;
}

.workspace-page .hero-content {
  width: min(980px, 100%);
}

.workspace-page h1 {
  font-size: clamp(2.4rem, 5vw, 4.8rem);
}

.public-page .admin-section {
  display: none;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  background: rgba(7, 10, 18, 0.32);
  backdrop-filter: blur(10px);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.topbar a:hover {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.topbar .brand-link {
  margin-right: auto;
  gap: 8px;
  color: white;
  background: rgba(7, 10, 18, 0.46);
}

.brand-link img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.hero-content-wrap {
  display: flex;
  align-items: flex-end;
}

.hero-content {
  width: min(860px, 100%);
}

.eyebrow {
  display: block;
  margin: 0 0 3px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: clamp(0.66rem, 0.72vw, 0.74rem);
  font-weight: 800;
  color: #86efac;
}

.hero .eyebrow {
  color: #bbf7d0;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-family: "Baloo 2", Inter, system-ui, sans-serif;
  font-size: clamp(3rem, 7vw, 6.4rem);
  line-height: 0.86;
  letter-spacing: 0;
  max-width: 920px;
}

.hero-content > p:not(.eyebrow) {
  max-width: 680px;
  margin: 22px 0 0;
  font-size: clamp(1.1rem, 2.4vw, 1.7rem);
  font-weight: 700;
}

.hero-actions,
.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  cursor: pointer;
  text-decoration: none;
  font: inherit;
  font-weight: 800;
  transition: transform 160ms ease, filter 160ms ease, border-color 160ms ease;
}

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

.button.primary:hover {
  filter: brightness(1.08);
}

.button.ghost:hover {
  border-color: #bbf7d0;
}

.button.primary {
  color: #04110a;
  background: var(--brand);
}

.button.ghost {
  color: inherit;
  border: 1px solid currentColor;
  background: transparent;
}

.button.danger {
  color: white;
  background: var(--danger);
}

.section {
  padding: 10px clamp(18px, 5vw, 72px);
}

.band {
  background: #0b111c;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(980px, 100%);
  min-height: 46px;
  margin: 0 auto;
  padding: 7px 0 9px;
  border-bottom: 1px solid transparent;
  cursor: pointer;
  list-style: none;
  transition: border-color 160ms ease, color 160ms ease;
}

.section-heading:hover {
  border-bottom-color: rgba(255, 255, 255, 0.14);
}

.section-heading::-webkit-details-marker {
  display: none;
}

.section-title {
  display: block;
  margin: 0;
  font-size: clamp(1.18rem, 2vw, 1.65rem);
  font-weight: 800;
  line-height: 0.95;
}

.toggle-arrow {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: #bbf7d0;
  background: rgba(255, 255, 255, 0.055);
  font-size: 1.05rem;
  font-weight: 900;
  transition: transform 180ms ease, background 180ms ease;
}

.section-toggle[open] .toggle-arrow {
  transform: rotate(180deg);
  background: rgba(34, 197, 94, 0.18);
}

.section-body {
  padding-top: 14px;
  padding-bottom: 8px;
}

.scoreboard,
.teams-grid,
.events-grid,
.schedule-list,
.discipline-list,
.food-ranking,
.food-panel,
.materials-overview,
.materials-list,
.admin-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
}

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

.score-category {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025));
  padding: 14px;
  box-shadow: var(--shadow-soft);
}

.score-category h3 {
  margin: 0 0 10px;
  color: #bbf7d0;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

.score-card {
  position: relative;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 72px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-left: 8px solid var(--team-color);
  border-radius: 8px;
  background: rgba(16, 23, 36, 0.94);
  box-shadow: none;
}

.rank {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--team-color);
  font-weight: 900;
}

.score-card h4 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}

.score-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.score-total {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 900;
  color: var(--metric-color, var(--team-color));
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.teams-grid,
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.team-card,
.event-card,
.schedule-item,
.discipline-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.team-card {
  background: var(--surface-soft);
}

.team-card {
  overflow: hidden;
}

.team-swatch {
  height: 12px;
  background: var(--team-color);
}

.team-card-body,
.event-card,
.schedule-item,
.discipline-item {
  padding: 18px;
}

.team-card h3,
.event-card h3,
.schedule-item h3,
.discipline-item h3 {
  margin: 0 0 8px;
}

.team-card p,
.event-card p,
.schedule-item p,
.discipline-item p {
  margin: 0;
  color: var(--muted);
}

.event-card {
  border-top: 8px solid var(--team-color);
}

.schedule-list,
.discipline-list,
.food-ranking,
.food-panel,
.materials-overview,
.materials-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.food-ranking {
  margin-bottom: 18px;
}

.food-rank-card,
.food-team {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.food-rank-card {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border-left: 8px solid var(--team-color);
}

.food-rank-card h3,
.food-team h3 {
  margin: 0 0 6px;
}

.food-rank-card p,
.food-team p {
  margin: 0;
  color: var(--muted);
}

.food-rank-card strong {
  display: block;
  color: var(--metric-color, var(--team-color));
  font-size: 1.8rem;
  line-height: 1;
  text-align: right;
}

.food-rank-card span {
  display: block;
  color: var(--muted);
  text-align: right;
  font-size: 0.82rem;
  font-weight: 800;
}

.food-team {
  overflow: hidden;
}

.food-team header {
  padding: 16px 18px;
  color: white;
  background: var(--team-color);
}

.food-team header h3,
.food-team header p,
.material-team header h3,
.material-team header p {
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.28);
}

.food-team header p {
  color: rgba(255, 255, 255, 0.82);
}

.food-team ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 16px 18px 18px;
  list-style: none;
}

.food-team li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.food-team li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.food-team li strong {
  color: var(--ink);
  text-align: right;
}

.materials-overview {
  margin-bottom: 18px;
}

.material-summary,
.material-team {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.material-summary {
  padding: 18px;
  border-top: 8px solid var(--team-color);
}

.material-summary h3,
.material-team h3 {
  margin: 0 0 8px;
}

.material-summary p,
.material-team p {
  margin: 0;
  color: var(--muted);
}

.material-team header p {
  color: rgba(255, 255, 255, 0.82);
}

.material-team {
  overflow: hidden;
}

.material-team header {
  padding: 16px 18px;
  color: white;
  background: var(--team-color);
}

.material-team ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 16px 18px 18px;
  list-style: none;
}

.material-team li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.material-team small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.material-team li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.status-pill {
  min-width: 86px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 10px;
  color: #e5e7eb;
  background: #334155;
  font-size: 0.78rem;
  font-weight: 900;
}

.status-pill.done {
  color: #052e16;
  background: #86efac;
}

.status-pill.partial {
  color: #422006;
  background: #facc15;
}

.status-pill.pending {
  color: #450a0a;
  background: #fca5a5;
}

.empty-state {
  padding: 24px;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.admin-section {
  background: #080d18;
  color: white;
}

.single-panel {
  background: #080d18;
}

.single-panel .section-heading {
  cursor: default;
}

.single-panel .section-heading:hover {
  border-bottom-color: transparent;
}

.single-panel .section-body {
  padding-top: 0;
}

.split-workspace {
  display: grid;
  grid-template-columns: minmax(320px, 460px) minmax(0, 1fr);
  gap: 18px;
  width: min(1180px, 100%);
  margin: 0 auto;
}

.rehearsal-form,
.rehearsal-sync .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rehearsal-sync {
  margin: 18px 0 0;
}

.admin-section .eyebrow {
  color: #5eead4;
}

.admin-shell {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.admin-sync-status {
  margin: 0;
  padding: 12px 18px;
  color: #d1fae5;
  background: rgba(34, 197, 94, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  font-weight: 800;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  padding: 12px;
  overflow-x: auto;
  background: rgba(0, 0, 0, 0.18);
}

.tab-button {
  flex: 0 0 auto;
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  padding: 0 14px;
  color: #d1d5db;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.tab-button.active {
  color: #03110a;
  background: var(--brand);
}

.admin-panel {
  display: none;
  padding: 18px;
}

.admin-panel.active {
  display: block;
}

.sync-box {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.sync-box h3,
.sync-box p {
  margin: 0;
}

.sync-box p {
  color: #d1d5db;
}

.sync-grid {
  margin-top: 2px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

label {
  display: grid;
  gap: 7px;
  color: #d1d5db;
  font-weight: 700;
}

label.wide {
  grid-column: span 2;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #344054;
  border-radius: 8px;
  padding: 0 12px;
  color: white;
  background: #090f1a;
  font: inherit;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid #86efac;
  outline-offset: 2px;
}

textarea {
  min-height: 280px;
  padding: 14px;
  resize: vertical;
}

.file-button input {
  display: none;
}

.table-wrap {
  margin-top: 20px;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
}

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

th,
td {
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  text-align: left;
}

th {
  color: #bbf7d0;
  background: rgba(0, 0, 0, 0.28);
}

tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.025);
}

.mini-action {
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  color: white;
  background: transparent;
  cursor: pointer;
}

footer {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 24px clamp(18px, 5vw, 72px);
  color: #d1d5db;
  background: #080d18;
  text-align: center;
}

@media (max-width: 760px) {
  .hero {
    min-height: 54vh;
    padding-bottom: 28px;
  }

  .topbar {
    justify-content: flex-start;
  }

  .topbar .brand-link {
    width: 100%;
    margin-right: 0;
  }

  .hero-actions {
    gap: 10px;
  }

  .button {
    min-height: 42px;
    padding: 0 15px;
  }

  .scoreboard {
    grid-template-columns: 1fr;
    gap: 12px;
  }

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

  .score-card {
    grid-template-columns: 44px 1fr;
  }

  .score-category {
    padding: 12px;
  }

  .food-rank-card,
  .food-team li {
    grid-template-columns: 1fr;
  }

  .food-rank-card strong,
  .food-rank-card span,
  .food-team li strong {
    text-align: left;
  }

  .material-team li {
    grid-template-columns: 1fr;
  }

  .score-total {
    grid-column: 2;
  }

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

  label.wide {
    grid-column: auto;
  }
}
