:root {
  --grass-dark: #0b4d2b;
  --grass: #138a43;
  --grass-light: #6fd36f;
  --line: rgba(255, 255, 255, 0.72);
  --ink: #102015;
  --muted: #5d6b60;
  --paper: #fffdf4;
  --card: rgba(255, 255, 255, 0.92);
  --card-strong: #ffffff;
  --gold: #ffd166;
  --orange: #f77f00;
  --red: #d62828;
  --green: #0a9f4a;
  --blue: #1446a0;
  --shadow: 0 18px 50px rgba(8, 35, 18, 0.18);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #0b4d2b;
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at 10% 10%, rgba(255, 255, 255, 0.20), transparent 22%),
    linear-gradient(135deg, #0b4d2b 0%, #168a45 45%, #0d5d35 100%);
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

.hidden {
  display: none !important;
}

.app-shell {
  width: min(1600px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 20px 0 28px;
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 250px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  color: white;
  background:
    linear-gradient(120deg, rgba(4, 60, 30, 0.95), rgba(12, 134, 64, 0.88)),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.05) 0,
      rgba(255, 255, 255, 0.05) 90px,
      rgba(0, 0, 0, 0.05) 90px,
      rgba(0, 0, 0, 0.05) 180px
    );
}

.hero::before {
  content: "";
  position: absolute;
  inset: 26px;
  border: 3px solid var(--line);
  border-radius: 22px;
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 26px;
  bottom: 26px;
  width: 3px;
  background: var(--line);
  transform: translateX(-50%);
  pointer-events: none;
}

.hero__grass {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 50%, transparent 0 78px, rgba(255, 255, 255, 0.72) 80px 83px, transparent 85px),
    linear-gradient(to right, transparent calc(50% - 1px), rgba(255, 255, 255, 0.58) calc(50% - 1px), rgba(255, 255, 255, 0.58) calc(50% + 1px), transparent calc(50% + 1px));
  opacity: 0.5;
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: center;
  padding: 46px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.05;
}

h1 {
  max-width: 850px;
  font-size: clamp(2.6rem, 6vw, 5.7rem);
  letter-spacing: -0.06em;
  text-shadow: 0 7px 18px rgba(0, 0, 0, 0.25);
}

.hero__lead {
  max-width: 780px;
  margin: 18px 0 0;
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.92);
}

.hero-card {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(12px);
}

.hero-card strong {
  display: block;
  margin-bottom: 5px;
  font-size: 1.05rem;
}

.hero-card span {
  color: rgba(255, 255, 255, 0.9);
}

.ball {
  display: grid;
  place-items: center;
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background: white;
  color: #111;
  font-size: 2rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.host-map {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 46px 36px;
}

.host-map span {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: white;
  font-weight: 800;
  backdrop-filter: blur(10px);
}

main {
  margin-top: 18px;
}

.pitch-card {
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--radius-xl);
  background: var(--card);
  box-shadow: var(--shadow);
}

.intro-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 24px;
}

.intro-card h2 {
  font-size: clamp(1.7rem, 3vw, 3rem);
}

.intro-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

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

.step {
  padding: 9px 12px;
  border-radius: 999px;
  background: #e6efdf;
  color: #446047;
  font-size: 0.85rem;
  font-weight: 900;
  white-space: nowrap;
}

.step.active {
  background: var(--green);
  color: white;
}

.step.done {
  background: #193d25;
  color: white;
}

.notice {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  background: #fff2cc;
  box-shadow: var(--shadow);
}

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

.notice a {
  font-weight: 900;
}

.stage-area {
  margin-top: 18px;
  padding-bottom: 110px;
}

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

.group-card {
  overflow: hidden;
  min-height: 250px;
  border-radius: var(--radius-lg);
  background: var(--card-strong);
  box-shadow: 0 13px 34px rgba(8, 35, 18, 0.14);
}

.group-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 15px;
  color: white;
  background:
    linear-gradient(135deg, rgba(6, 76, 37, 0.96), rgba(12, 150, 68, 0.92)),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 24px,
      rgba(255, 255, 255, 0.08) 24px,
      rgba(255, 255, 255, 0.08) 48px
    );
}

.group-card__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 900;
}

.group-badge {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.18);
  font-weight: 900;
}

.group-count {
  font-size: 0.86rem;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.92);
}

.group-card.warning .group-card__header {
  background: linear-gradient(135deg, #8a4f00, #f77f00);
}

.group-card.valid .group-card__header {
  background: linear-gradient(135deg, #064c25, #0a9f4a);
}

.team-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.team-button {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 54px;
  padding: 9px 10px;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  background: #f4f8ee;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.team-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(19, 138, 67, 0.35);
  box-shadow: 0 8px 20px rgba(8, 35, 18, 0.12);
}

.team-button.selected {
  border-color: var(--green);
  background: #e5ffe9;
  box-shadow: inset 0 0 0 1px rgba(10, 159, 74, 0.12);
}

.team-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.team-flag {
  width: 40px;
  height: 28px;
  object-fit: cover;
  border-radius: 5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  background: white;
}

.team-name {
  overflow: hidden;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-meta {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.checkmark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #dbe8d6;
  color: transparent;
  font-weight: 900;
}

.team-button.selected .checkmark {
  background: var(--green);
  color: white;
}

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

.knockout-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 66px;
  padding: 12px;
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 24px rgba(8, 35, 18, 0.12);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.knockout-card:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(19, 138, 67, 0.35);
}

.knockout-card.selected {
  border-color: var(--green);
  background: #e5ffe9;
}

.knockout-card:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.knockout-card .team-flag {
  width: 46px;
  height: 32px;
}

.knockout-card strong {
  display: block;
  font-size: 1.02rem;
}

.knockout-card span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.summary-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 18px;
  align-items: start;
}

.summary-card,
.form-card,
.submission-card,
.admin-card {
  padding: 22px;
  border-radius: var(--radius-xl);
  background: var(--card-strong);
  box-shadow: var(--shadow);
}

.summary-card h3,
.form-card h3,
.submission-card h3,
.admin-card h3 {
  margin-bottom: 12px;
  font-size: 1.35rem;
}

.summary-round {
  padding: 14px 0;
  border-top: 1px solid #e2eadf;
}

.summary-round:first-of-type {
  border-top: 0;
}

.summary-round h4 {
  margin: 0 0 10px;
  font-size: 1rem;
  color: #174b29;
}

.summary-team-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.summary-chip {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 999px;
  background: #f1f7eb;
  font-weight: 900;
}

.summary-chip img {
  width: 23px;
  height: 16px;
  object-fit: cover;
  border-radius: 3px;
}

.form-card label {
  display: block;
  margin: 14px 0 6px;
  color: #1b3b25;
  font-weight: 900;
}

.form-card input {
  width: 100%;
  padding: 13px 14px;
  border: 2px solid #d7e5d0;
  border-radius: var(--radius-md);
  background: #fbfff7;
  color: var(--ink);
}

.form-card input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(10, 159, 74, 0.14);
}

.privacy-note {
  margin-top: 14px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: #fff7dc;
  color: #60440b;
  font-size: 0.92rem;
  line-height: 1.35;
}

.error-box {
  margin-top: 14px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: #ffe7e7;
  color: #8d1515;
  font-weight: 800;
}

.success-box {
  margin-top: 14px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: #e5ffe9;
  color: #075e2c;
  font-weight: 800;
}

.bottom-bar {
  position: fixed;
  z-index: 30;
  right: 50%;
  bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1480px, calc(100vw - 32px));
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.24);
  transform: translateX(50%);
  backdrop-filter: blur(16px);
}

.bottom-bar strong {
  display: block;
  font-size: 1.05rem;
}

.bottom-bar p {
  margin: 4px 0 0;
  color: var(--muted);
}

.bottom-bar__actions {
  display: flex;
  gap: 10px;
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease, background 0.12s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.btn--primary {
  background: var(--green);
  color: white;
  box-shadow: 0 10px 20px rgba(10, 159, 74, 0.24);
}

.btn--primary:disabled {
  background: #9fb4a2;
  box-shadow: none;
}

.btn--ghost {
  background: #eaf1e6;
  color: #1c4327;
}

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

.site-footer {
  display: flex;
  gap: 9px;
  justify-content: center;
  margin-top: 20px;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 900;
}

.site-footer a {
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.page-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
  color: white;
}

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

.page-header p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.1rem;
}

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

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

.submission-card__name {
  font-size: 1.3rem;
  font-weight: 900;
}

.submission-card__email {
  color: var(--blue);
  font-weight: 900;
}

.submission-card__meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.submission-rounds {
  display: grid;
  gap: 12px;
}

.submission-round {
  padding-top: 12px;
  border-top: 1px solid #e2eadf;
}

.submission-round h4 {
  margin: 0 0 9px;
  color: #174b29;
}

.admin-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.admin-actions input {
  width: 110px;
  padding: 10px;
  border: 2px solid #d7e5d0;
  border-radius: var(--radius-sm);
}

.loading {
  padding: 30px;
  border-radius: var(--radius-xl);
  background: var(--card);
  text-align: center;
  font-weight: 900;
  box-shadow: var(--shadow);
}

@media (max-width: 1200px) {
  .groups-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero__content,
  .summary-layout {
    grid-template-columns: 1fr;
  }

  .intro-card {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 860px) {
  .app-shell {
    width: min(100vw - 18px, 720px);
    padding-top: 9px;
  }

  .hero__content {
    padding: 32px 22px;
  }

  .host-map {
    padding: 0 22px 28px;
  }

  .groups-grid,
  .knockout-grid {
    grid-template-columns: 1fr;
  }

  .bottom-bar {
    flex-direction: column;
    align-items: stretch;
    bottom: 9px;
    width: calc(100vw - 18px);
  }

  .bottom-bar__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .btn {
    width: 100%;
  }

  .stage-area {
    padding-bottom: 180px;
  }

  .page-header {
    display: block;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: 2.45rem;
  }

  .hero-card {
    align-items: flex-start;
  }

  .ball {
    flex-basis: 48px;
    width: 48px;
    height: 48px;
    font-size: 1.6rem;
  }

  .team-button,
  .knockout-card {
    grid-template-columns: 38px minmax(0, 1fr) auto;
  }

  .team-flag,
  .knockout-card .team-flag {
    width: 38px;
    height: 27px;
  }
}

/* Stronger selected-state contrast */
.team-button.selected,
.knockout-card.selected {
  border-color: #006b2f;
  background: linear-gradient(135deg, #c8ffd5 0%, #effff1 100%);
  box-shadow:
    inset 0 0 0 2px rgba(0, 107, 47, 0.25),
    0 10px 24px rgba(0, 80, 35, 0.18);
}

.team-button.selected .team-name,
.knockout-card.selected strong {
  color: #003f1c;
}

.team-button.selected .team-meta,
.knockout-card.selected span span {
  color: #155c30;
}

.team-button.selected .checkmark,
.knockout-card.selected .checkmark {
  background: #007a35;
  color: #ffffff;
  box-shadow: 0 0 0 4px rgba(0, 122, 53, 0.18);
}

.team-button:not(.selected),
.knockout-card:not(.selected) {
  background: rgba(255, 255, 255, 0.88);
}

.team-button:not(.selected) .checkmark,
.knockout-card:not(.selected) .checkmark {
  background: #edf3ea;
  border: 1px solid #d3dfcf;
}
