:root {
  --ink: #170d22;
  --muted: #6b6174;
  --purple: #4b197c;
  --violet: #7427b7;
  --cyan: #48c7cc;
  --gold: #ffc824;
  --white: #fff;
  --line: rgba(23, 13, 34, .14);
  --shadow: 0 18px 45px rgba(23, 13, 34, .16);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: #fbf8fd;
}

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

button { cursor: pointer; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 76px;
  padding: 10px clamp(18px, 5vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  height: 54px;
}

.brand img {
  display: block;
  width: 190px;
  max-width: 42vw;
  height: 54px;
  object-fit: contain;
  object-position: left center;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.main-nav button,
.ghost,
.secondary,
.primary {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 800;
}

.main-nav button {
  color: var(--muted);
  background: transparent;
}

.main-nav button:hover,
.main-nav button.is-active {
  color: var(--purple);
  background: rgba(116, 39, 183, .09);
}

.primary {
  color: #1f1032;
  background: var(--gold);
  box-shadow: 0 10px 24px rgba(255, 200, 36, .28);
}

.secondary {
  color: var(--white);
  background: var(--purple);
}

.ghost {
  color: var(--purple);
  border: 1px solid rgba(116, 39, 183, .22);
  background: var(--white);
}

.menu-toggle {
  display: none;
  width: 46px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 5px auto;
  background: var(--ink);
}

main {
  min-height: calc(100vh - 76px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
  gap: clamp(28px, 6vw, 72px);
  align-items: center;
  padding: clamp(28px, 6vw, 72px) clamp(18px, 5vw, 64px) 42px;
  background:
    linear-gradient(135deg, rgba(72, 199, 204, .18), transparent 34%),
    radial-gradient(circle at 88% 12%, rgba(255, 200, 36, .28), transparent 28%),
    linear-gradient(180deg, #fff, #f7eefc);
}

.hero-media img {
  display: block;
  width: 100%;
  aspect-ratio: 764 / 1080;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-copy {
  max-width: 760px;
}

.kicker {
  margin: 0 0 10px;
  color: var(--cyan);
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

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

h1 {
  margin: 0;
  color: var(--purple);
  font-size: clamp(3rem, 8vw, 6.8rem);
  line-height: .9;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.45rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.hero-text {
  max-width: 650px;
  margin: 24px 0;
  color: #33243f;
  font-size: 1.16rem;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.section {
  padding: clamp(30px, 5vw, 58px) clamp(18px, 5vw, 64px);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.stats-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding-top: 24px;
  padding-bottom: 24px;
  background: var(--purple);
}

.stat-card,
.timeline article,
.prize-grid article,
.contact-grid article,
.rank-list li,
.notice,
.choir-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 10px 26px rgba(23, 13, 34, .06);
}

.stat-card {
  padding: 20px;
  color: var(--white);
  border-color: rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .1);
}

.stat-card span,
.timeline span,
.prize-grid span,
.contact-grid span,
.rank-meta,
.choir-card span {
  display: block;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.stat-card span { color: rgba(255, 255, 255, .72); }

.stat-card strong {
  display: block;
  margin-top: 6px;
  color: var(--white);
  font-size: 1.9rem;
}

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

.legal-section {
  display: grid;
  gap: 14px;
}

.timeline article,
.prize-grid article,
.contact-grid article,
.legal-section article {
  padding: 20px;
}

.legal-section h2 {
  margin-bottom: 10px;
}

.rules-intro {
  display: grid;
  grid-template-columns: minmax(280px, .85fr) minmax(0, 1.35fr);
  gap: 18px;
  align-items: stretch;
  background: #fff;
}

.rules-quote,
.rules-summary article,
.rules-grid article,
.criteria-grid article,
.rules-duo article,
.rules-contact article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 10px 26px rgba(23, 13, 34, .06);
}

.rules-quote {
  padding: clamp(24px, 4vw, 36px);
  color: var(--white);
  background:
    linear-gradient(135deg, rgba(72, 199, 204, .28), transparent 42%),
    linear-gradient(145deg, var(--purple), #2a123d);
}

.rules-quote span,
.rules-summary span,
.rules-grid span,
.criteria-grid span,
.rules-contact span {
  display: block;
  color: var(--cyan);
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.rules-quote strong {
  display: block;
  margin: 14px 0;
  font-size: clamp(1.7rem, 4vw, 2.8rem);
  line-height: 1.04;
}

.rules-quote p,
.rules-grid p,
.criteria-grid p,
.rules-duo p,
.rules-contact p {
  color: var(--muted);
  line-height: 1.65;
}

.rules-quote p { color: rgba(255, 255, 255, .76); }

.rules-summary,
.rules-grid,
.criteria-grid,
.rules-duo {
  display: grid;
  gap: 14px;
}

.rules-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.rules-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.criteria-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.rules-duo {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: #fff;
}

.rules-summary article,
.rules-grid article,
.criteria-grid article,
.rules-duo article,
.rules-contact article {
  padding: 20px;
}

.rules-summary strong,
.criteria-grid strong,
.rules-contact strong {
  display: block;
  margin: 8px 0;
  color: var(--purple);
  font-size: 1.2rem;
  line-height: 1.2;
}

.rules-grid h3 {
  margin: 8px 0;
  color: var(--purple);
  font-size: 1.1rem;
}

.criteria-grid article {
  border-top: 4px solid var(--gold);
}

.rules-calendar {
  background: #f7eefc;
}

.rules-contact {
  padding-top: 24px;
  background: var(--purple);
}

.rules-contact article {
  color: var(--white);
  border-color: rgba(255, 255, 255, .2);
  background: rgba(255, 255, 255, .1);
}

.rules-contact span,
.rules-contact strong,
.rules-contact p {
  color: var(--white);
}

.timeline strong,
.contact-grid strong {
  display: block;
  margin-top: 6px;
  font-size: 1.08rem;
}

.prize-section { background: #fff; }

.prize-grid strong {
  display: block;
  margin: 8px 0;
  color: var(--purple);
  font-size: 1.55rem;
}

.page-head {
  padding: clamp(34px, 6vw, 76px) clamp(18px, 5vw, 64px) 28px;
  background: linear-gradient(135deg, #fff, #f2e5fa);
}

.page-head h1 {
  font-size: clamp(2.5rem, 7vw, 5.2rem);
}

.page-head p:last-child {
  max-width: 760px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.6;
}

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

.choir-card {
  overflow: hidden;
}

.choir-media {
  display: grid;
  place-items: center;
  min-height: 180px;
  color: var(--white);
  background:
    linear-gradient(135deg, rgba(23, 13, 34, .38), rgba(75, 25, 124, .18)),
    var(--card-bg, linear-gradient(135deg, #7427b7, #48c7cc));
}

.choir-media strong {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  border: 3px solid rgba(255, 255, 255, .7);
  border-radius: 50%;
  font-size: 2rem;
}

.choir-body {
  padding: 18px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--purple);
  background: rgba(116, 39, 183, .1);
  font-size: .78rem;
  font-weight: 900;
}

.choir-body h3 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

.choir-body p {
  min-height: 72px;
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.5;
}

.vote-count {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.vote-count strong {
  color: var(--purple);
  font-size: 1.45rem;
}

.candidate-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.candidate-actions button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  font-weight: 900;
}

.candidate-actions button:first-child {
  color: var(--white);
  background: var(--purple);
}

.candidate-actions button:last-child {
  color: #1f1032;
  background: var(--gold);
}

.rank-list {
  list-style: none;
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
}

.rank-list li {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px;
}

.rank-position {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: var(--ink);
  border-radius: 8px;
  background: var(--gold);
  font-weight: 1000;
}

.rank-list h3 { margin: 0 0 4px; }

.rank-score {
  color: var(--purple);
  font-size: 1.2rem;
  font-weight: 1000;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-width: 980px;
}

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

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

.wide { grid-column: 1 / -1; }

.notice {
  padding: 16px;
  background: #fff8db;
}

.notice p { margin-bottom: 0; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(23, 13, 34, .62);
}

.vote-modal {
  width: min(640px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  border-radius: 8px;
  padding: 24px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.checkout-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.checkout-head h2 { font-size: 1.9rem; }

.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  font-weight: 900;
}

.checkout-recap {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.checkout-recap article,
.checkout-total {
  border-radius: 8px;
  padding: 12px;
  background: #f7f0fb;
}

.checkout-summary {
  color: var(--muted);
  line-height: 1.55;
}

.checkout-total {
  display: flex;
  justify-content: space-between;
  font-weight: 1000;
}

.form-error {
  color: #b00020;
  font-weight: 800;
}

.success-mark {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  margin-bottom: 14px;
  color: var(--ink);
  border-radius: 50%;
  background: var(--gold);
  font-weight: 1000;
}

.auth-screen {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: clamp(24px, 5vw, 56px);
  align-items: center;
  min-height: calc(100vh - 76px);
  padding: clamp(34px, 6vw, 76px) clamp(18px, 5vw, 64px);
  background: linear-gradient(135deg, #fff, #f3e6fb);
}

.auth-screen h1 {
  font-size: clamp(2.6rem, 7vw, 5.6rem);
}

.auth-screen p {
  max-width: 620px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.6;
}

.login-card {
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.login-help {
  margin: 0;
  color: var(--muted);
  font-size: .92rem;
  font-weight: 800;
}

.dashboard-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: clamp(34px, 6vw, 76px) clamp(18px, 5vw, 64px) 28px;
  background: linear-gradient(135deg, #fff, #efe0f8);
}

.dashboard-head h1 {
  font-size: clamp(2.4rem, 6vw, 5rem);
}

.dashboard-head p:last-child {
  max-width: 760px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  padding-top: 24px;
  padding-bottom: 24px;
  background: var(--purple);
}

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

.admin-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background: var(--white);
  box-shadow: 0 10px 26px rgba(23, 13, 34, .06);
}

.compact-head {
  align-items: start;
  margin-bottom: 18px;
}

.compact-head h2 {
  font-size: 1.45rem;
}

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

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

.admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fcf9ff;
}

.admin-row strong {
  display: block;
  margin-bottom: 4px;
}

.admin-row span,
.admin-row p {
  color: var(--muted);
}

.admin-row p {
  margin: 6px 0 0;
  line-height: 1.45;
}

.admin-row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border-radius: 999px;
  padding: 0 12px;
  color: var(--purple);
  background: rgba(116, 39, 183, .1);
  font-weight: 900;
}

.danger {
  color: #9a1230;
  border-color: rgba(154, 18, 48, .24);
}

.empty-state {
  border: 1px dashed rgba(116, 39, 183, .28);
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  background: #fcf9ff;
  font-weight: 800;
}

@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-media {
    max-width: 420px;
  }

  .stats-band,
  .admin-stats,
  .timeline,
  .prize-grid,
  .contact-grid,
  .choir-grid,
  .rules-intro,
  .rules-grid,
  .criteria-grid,
  .rules-duo {
    grid-template-columns: 1fr;
  }

  .rules-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .auth-screen {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .site-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .menu-toggle {
    display: block;
  }

  .main-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .main-nav.is-open {
    display: flex;
  }

  .main-nav button {
    justify-content: center;
    width: 100%;
  }

  .hero {
    padding-top: 24px;
  }

  .hero-actions,
  .dashboard-head,
  .dashboard-actions,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .stats-band,
  .admin-stats,
  .timeline,
  .prize-grid,
  .contact-grid,
  .choir-grid,
  .rules-summary,
  .rules-grid,
  .criteria-grid,
  .rules-duo,
  .form-grid,
  .checkout-recap {
    grid-template-columns: 1fr;
  }

  .rank-list li {
    grid-template-columns: 48px minmax(0, 1fr);
  }

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

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

  .admin-row-actions {
    justify-content: stretch;
  }

  .admin-row-actions button,
  .admin-row-actions .status-pill {
    justify-content: center;
    width: 100%;
  }
}

@media (max-width: 420px) {
  .brand img {
    width: 150px;
  }

  h1 {
    font-size: 2.65rem;
  }

  .candidate-actions {
    grid-template-columns: 1fr;
  }
}
