@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;700;800&family=Oswald:wght@500;600;700&display=swap');

:root {
  --grass: #11845f;
  --grass-deep: #062d24;
  --lime: #d7ff4f;
  --gold: #f7c948;
  --red: #ef3e36;
  --blue: #2f80ed;
  --ink: #101816;
  --paper: #fffdf2;
  --muted: #708077;
  --line: rgba(16, 24, 22, 0.12);
  --shadow: 0 24px 80px rgba(4, 22, 18, 0.22);
  color: var(--ink);
  background: #071f1a;
  font-family: "Manrope", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 16% 12%, rgba(215, 255, 79, 0.22), transparent 22rem),
    radial-gradient(circle at 88% 8%, rgba(47, 128, 237, 0.24), transparent 24rem),
    linear-gradient(135deg, #061915 0%, #0b3329 42%, #101816 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

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

.hidden {
  display: none !important;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 14px clamp(18px, 4vw, 64px);
  color: white;
  background: rgba(5, 23, 19, 0.82);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(18px);
}

.brand {
  font-family: "Oswald", sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand span {
  display: inline-grid;
  place-items: center;
  margin-right: 8px;
  padding: 4px 7px;
  color: #071f1a;
  background: var(--lime);
  border-radius: 5px;
}

.topbar nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.topbar nav a {
  padding: 9px 12px;
  border-radius: 6px;
  color: #d7e7df;
  font-size: 0.9rem;
  font-weight: 800;
}

.topbar nav a.active,
.topbar nav a:hover {
  color: #071f1a;
  background: var(--lime);
}

.app-shell,
.page-shell,
.admin-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
}

.hero-arena,
.page-hero,
.admin-header {
  display: grid;
  grid-template-columns: 1fr minmax(240px, 360px);
  gap: 28px;
  align-items: end;
  padding: 54px clamp(18px, 4vw, 64px) 42px;
  color: white;
}

.hero-arena {
  min-height: 430px;
  background:
    linear-gradient(115deg, rgba(6, 45, 36, 0.9), rgba(6, 45, 36, 0.48)),
    repeating-linear-gradient(90deg, transparent 0 86px, rgba(255, 255, 255, 0.08) 86px 88px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.page-hero.compact,
.admin-header {
  min-height: 260px;
  grid-template-columns: 1fr;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--lime);
  font-weight: 900;
  text-transform: uppercase;
}

h1 {
  max-width: 850px;
  margin-bottom: 18px;
  font-family: "Oswald", sans-serif;
  font-size: clamp(2.7rem, 8vw, 7.6rem);
  line-height: 0.92;
  letter-spacing: 0;
  text-transform: uppercase;
}

.compact h1 {
  font-size: clamp(2.6rem, 6vw, 5.8rem);
}

.intro {
  max-width: 720px;
  margin-bottom: 0;
  color: #d8e9e3;
  font-size: 1.08rem;
}

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

.primary-link,
.ghost-link,
.wide-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 6px;
  padding: 0 16px;
  font-weight: 900;
}

.primary-link,
.wide-link {
  color: #071f1a;
  background: var(--lime);
}

.ghost-link {
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.live-ticket,
.pin-box {
  display: grid;
  gap: 10px;
  padding: 24px;
  border: 1px solid rgba(215, 255, 79, 0.38);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(215, 255, 79, 0.18), rgba(255, 255, 255, 0.06)),
    rgba(5, 23, 19, 0.8);
  box-shadow: var(--shadow);
}

.pin-box button {
  min-height: 44px;
  border-radius: 6px;
  color: #071f1a;
  background: var(--lime);
  font-weight: 900;
}

.pin-box small {
  color: #d8e9e3;
}

.admin-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 6px;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.24);
  font-weight: 900;
}

.ticket-label,
.place {
  color: var(--lime);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.live-ticket strong {
  font-family: "Oswald", sans-serif;
  font-size: 2.2rem;
  line-height: 1;
  text-transform: uppercase;
}

.live-ticket small {
  color: #d8e9e3;
}

.content-grid,
.admin-grid {
  display: grid;
  grid-template-columns: minmax(260px, 330px) 1fr minmax(260px, 360px);
  gap: 24px;
  align-items: start;
  padding: 30px clamp(18px, 4vw, 64px) 64px;
}

.admin-grid {
  grid-template-columns: minmax(280px, 360px) 1fr;
}

.page-shell {
  padding-bottom: 64px;
}

.auth-panel,
.entry-panel,
.matches-panel,
.leaderboard-panel,
.wide-panel,
.info-card,
.prize-card {
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 8px;
  background: rgba(255, 253, 242, 0.94);
  box-shadow: var(--shadow);
}

.auth-panel,
.entry-panel,
.leaderboard-panel {
  position: sticky;
  top: 86px;
}

.auth-panel,
.entry-panel,
.matches-panel,
.leaderboard-panel,
.wide-panel {
  padding: 20px;
}

.wide-panel,
.rule-grid,
.prize-grid {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}

.section-title {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
}

.section-title h2 {
  margin: 0;
  font-size: 1.08rem;
}

.dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
    margin-right: 30px;
  background: var(--red);
  box-shadow: 16px 0 0 var(--lime), 32px 0 0 var(--blue);
}

.auth-forms,
.entry-form,
.signed-in,
#matchForm {
  display: grid;
  gap: 14px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 5px;
  border-radius: 8px;
  background: #e9eee4;
}

.auth-tabs label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 6px;
  color: #5c6b63;
  background: transparent;
  font-weight: 900;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.auth-radio {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.auth-pane,
.auth-panel-copy {
  display: none;
}

#auth-login:checked ~ .auth-tabs label[for="auth-login"],
#auth-register:checked ~ .auth-tabs label[for="auth-register"] {
  color: white;
  background: var(--grass-deep);
  box-shadow: 0 10px 24px rgba(6, 45, 36, 0.18);
}

#auth-login:checked ~ .login-copy,
#auth-login:checked ~ .login-pane,
#auth-register:checked ~ .register-copy,
#auth-register:checked ~ .register-pane {
  display: grid;
}

.auth-panel-copy {
  gap: 4px;
  padding: 14px;
  border: 1px solid rgba(16, 24, 22, 0.08);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(215, 255, 79, 0.16), transparent),
    #f6f8ee;
}

.auth-panel-copy strong {
  color: var(--ink);
}

.auth-panel-copy span {
  color: #627169;
  font-size: 0.9rem;
  line-height: 1.35;
}

label {
  display: grid;
  gap: 7px;
  color: #526058;
  font-size: 0.84rem;
  font-weight: 900;
}

input {
  width: 100%;
  min-height: 46px;
  border: 1px solid #cbd2c3;
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--ink);
  background: white;
}

input:focus {
  border-color: var(--grass);
  outline: 3px solid rgba(215, 255, 79, 0.45);
}

.entry-form button,
.signed-in button,
.prediction-row button,
.result-form button,
#matchForm button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  border-radius: 6px;
  padding: 0 14px;
  color: white;
  background: var(--grass-deep);
  font-weight: 900;
}

.signed-in strong {
  font-family: "Oswald", sans-serif;
  font-size: 2rem;
  text-transform: uppercase;
}

.rules {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.rules p {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: #526058;
}

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

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

.match-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(16, 24, 22, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(17, 132, 95, 0.1), transparent 42%),
    white;
}

.match-meta,
.teams-row,
.prediction-row,
.result-form {
  display: flex;
  align-items: center;
}

.match-meta {
  justify-content: space-between;
  gap: 12px;
  color: #65746c;
  font-size: 0.82rem;
  font-weight: 900;
}

.match-meta span {
  color: var(--grass);
  text-transform: uppercase;
}

.teams-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  font-family: "Oswald", sans-serif;
  font-size: 1.55rem;
  line-height: 1;
  text-transform: uppercase;
}

.teams-row strong {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.teams-row strong:last-child {
  justify-content: flex-end;
  text-align: right;
}

.team-flag,
.flag-fallback {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid rgba(16, 24, 22, 0.08);
}

.team-flag {
  object-fit: cover;
  background: white;
}

.flag-fallback {
  display: inline-grid;
  place-items: center;
  color: white;
  background: var(--grass-deep);
  font-family: "Manrope", sans-serif;
  font-size: 0.72rem;
  font-weight: 900;
}

.versus-badge {
  display: grid;
  justify-self: center;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: white;
  background: var(--red);
  font-size: 0.88rem;
}

.prediction-row,
.result-form {
  display: grid;
  grid-template-columns: 74px 18px 74px minmax(120px, 1fr);
  gap: 10px;
}

.result-form {
  grid-template-columns: 74px 18px 74px minmax(120px, 1fr) minmax(120px, 1fr);
}

.prediction-row input,
.result-form input {
  text-align: center;
  font-weight: 900;
}

.prediction-row span,
.result-form span {
  color: var(--grass-deep);
  font-size: 1.3rem;
  font-weight: 900;
  text-align: center;
}

.match-status {
  margin: 0;
  color: #65746c;
  font-size: 0.86rem;
}

.match-status[data-state] {
  display: inline-flex;
  width: fit-content;
  border-radius: 6px;
  padding: 7px 10px;
  font-weight: 900;
}

.match-status[data-state="saving"] {
  color: #5a645f;
  background: #eef2e6;
}

.match-status[data-state="saved"] {
  color: #0b4b39;
  background: rgba(215, 255, 79, 0.42);
}

.match-status[data-state="error"] {
  color: #8e231d;
  background: rgba(239, 62, 54, 0.14);
}

.result {
  margin-left: 8px;
  color: var(--grass);
}

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

.leaderboard li {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border-radius: 8px;
  background: #f2f6ea;
}

.leaderboard-full li {
  grid-template-columns: 52px 1fr auto;
  min-height: 76px;
}

.rank {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #071f1a;
  background: var(--gold);
  font-weight: 900;
}

.leaderboard strong {
  font-size: 1.02rem;
}

.leaderboard small {
  display: block;
  color: #69756e;
}

.leader-stats {
  text-align: right;
}

.leaderboard b {
  display: block;
  color: var(--grass-deep);
  font-size: 1.45rem;
}

.wide-link {
  width: 100%;
  margin-top: 14px;
}

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

.prize-grid {
  grid-template-columns: 1.25fr 0.85fr;
}

.info-card,
.prize-card {
  min-height: 240px;
  padding: 24px;
}

.info-card span,
.prize-card .place {
  display: inline-grid;
  place-items: center;
  min-width: 54px;
  height: 42px;
  margin-bottom: 28px;
  border-radius: 6px;
  color: #071f1a;
  background: var(--lime);
  font-family: "Oswald", sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
}

.info-card h2,
.prize-card h2 {
  margin-bottom: 12px;
  font-family: "Oswald", sans-serif;
  font-size: 2rem;
  line-height: 1;
  text-transform: uppercase;
}

.info-card p,
.prize-card p {
  color: #526058;
}

.feature-card,
.first-prize {
  color: white;
  background:
    linear-gradient(135deg, rgba(215, 255, 79, 0.16), transparent),
    #082820;
}

.feature-card p,
.first-prize p {
  color: #d8e9e3;
}

.first-prize h2 {
  font-size: clamp(2.4rem, 5vw, 4.8rem);
}

.second-prize {
  background:
    linear-gradient(135deg, rgba(239, 62, 54, 0.13), transparent),
    var(--paper);
}

.empty,
.empty-row {
  color: #69756e;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  max-width: min(420px, calc(100vw - 36px));
  padding: 14px 16px;
  border-radius: 8px;
  color: white;
  background: red;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
}

.admin-login-panel {
  width: min(460px, calc(100% - 36px));
  margin: 0 auto;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 8px;
  background: rgba(255, 253, 242, 0.94);
  box-shadow: var(--shadow);
}

.form-error {
  margin: 0;
  color: var(--red);
  font-weight: 900;
}

@media (max-width: 1120px) {
  .content-grid,
  .admin-grid {
    grid-template-columns: 1fr 1fr;
  }

  .matches-panel {
    grid-column: 1 / -1;
    order: 3;
  }

  .auth-panel,
  .entry-panel,
  .leaderboard-panel {
    position: static;
  }

  .rule-grid,
  .all-matches {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

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

  .hero-arena,
  .page-hero,
  .admin-header,
  .content-grid,
  .admin-grid,
  .rule-grid,
  .prize-grid,
  .all-matches {
    grid-template-columns: 1fr;
  }

  .hero-arena,
  .page-hero,
  .admin-header {
    min-height: 0;
  }

  .prediction-row,
  .result-form {
    grid-template-columns: 1fr 18px 1fr;
  }

  .prediction-row button,
  .result-form button {
    grid-column: 1 / -1;
  }

  .teams-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    font-size: 1.25rem;
  }

  .versus-badge {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 50%;
  }

  .team-flag,
  .flag-fallback {
    width: 30px;
    height: 30px;
  }
}
