:root {
  color-scheme: light;
  --ink: #073043;
  --muted: #617280;
  --navy: #073b4c;
  --navy-soft: #0a5365;
  --gold: #f9c96b;
  --sand: #f5d59b;
  --sand-light: #fff4df;
  --line: #c8d7dd;
  --paper: #ffffff;
  --soft: #f7fbfc;
  --danger: #d84949;
  --green: #0c8f63;
  --shadow: 0 24px 55px rgba(7, 48, 67, 0.16);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--sand-light);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background:
    linear-gradient(180deg, rgba(7, 59, 76, 0.08) 0 46%, rgba(255, 244, 223, 0.94) 46% 100%),
    radial-gradient(circle at 88% 15%, rgba(249, 201, 107, 0.28), transparent 24%),
    var(--sand-light);
  overflow-x: hidden;
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.hero {
  position: relative;
  min-height: 420px;
  margin: 0 calc(50% - 50vw);
  padding: 70px clamp(34px, 6vw, 100px) 96px;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(4, 39, 52, 0.98) 0 43%, rgba(4, 39, 52, 0.78) 64%, rgba(238, 165, 70, 0.66) 100%),
    linear-gradient(180deg, #063447, #0a5365 72%, #dca55d 72% 100%);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.33;
  background:
    radial-gradient(90px 280px at 96% 10%, transparent 30%, rgba(0, 0, 0, 0.2) 31%, transparent 32%),
    linear-gradient(115deg, transparent 0 66%, rgba(255, 255, 255, 0.16) 66.2% 66.7%, transparent 67%),
    repeating-linear-gradient(0deg, transparent 0 40px, rgba(255, 255, 255, 0.12) 41px 42px),
    repeating-linear-gradient(90deg, transparent 0 52px, rgba(255, 255, 255, 0.09) 53px 54px);
  mask-image: linear-gradient(90deg, transparent 0 52%, #000 58% 100%);
}

.hero-shade {
  position: absolute;
  inset: auto 0 0;
  height: 126px;
  background:
    linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.14)),
    repeating-linear-gradient(103deg, rgba(255, 255, 255, 0.18) 0 2px, transparent 2px 18px);
}

.brand-area {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: clamp(28px, 4vw, 58px);
}

.logo-mark {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: clamp(140px, 13vw, 184px);
  aspect-ratio: 1;
  border: 6px solid var(--gold);
  border-radius: 50%;
  background: rgba(4, 44, 58, 0.78);
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.22);
}

.logo-ball {
  width: 82px;
  aspect-ratio: 1;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background:
    conic-gradient(from 30deg, #fff 0 24%, var(--gold) 0 42%, #fff 0 68%, #eaf5f8 0 100%);
  box-shadow: inset 0 0 0 3px rgba(7, 48, 67, 0.12);
}

.logo-ball::before,
.logo-ball::after {
  content: "";
  position: absolute;
  width: 74px;
  height: 34px;
  border: 4px solid var(--ink);
  border-color: var(--ink) transparent transparent transparent;
  border-radius: 50%;
}

.logo-ball::before {
  transform: rotate(42deg) translate(4px, -8px);
}

.logo-ball::after {
  transform: rotate(-38deg) translate(-7px, 18px);
}

.logo-wave {
  position: absolute;
  left: 34px;
  right: 34px;
  bottom: 28px;
  height: 18px;
  border-top: 6px solid #0f7891;
  border-bottom: 6px solid #0f7891;
  border-radius: 50%;
}

.brand-copy p,
.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

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

h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(4rem, 8vw, 7.2rem);
  line-height: 0.9;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 8px 26px rgba(0, 0, 0, 0.26);
}

.pb3-line {
  display: grid;
  grid-template-columns: minmax(50px, 1fr) auto minmax(50px, 1fr);
  align-items: center;
  gap: clamp(18px, 3vw, 36px);
  margin-top: 16px;
  color: var(--gold);
}

.pb3-line span {
  height: 4px;
  background: var(--gold);
}

.pb3-line strong {
  font-size: clamp(2.4rem, 4.7vw, 4.4rem);
  line-height: 1;
  letter-spacing: 0.14em;
}

.hero-tabs {
  position: absolute;
  z-index: 3;
  top: 70px;
  right: clamp(28px, 6vw, 82px);
  display: flex;
  gap: 14px;
}

.hero-tabs span {
  min-width: 138px;
  padding: 17px 24px;
  border: 1px solid rgba(249, 201, 107, 0.86);
  border-radius: 999px;
  color: #fff;
  background: rgba(7, 48, 67, 0.72);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.16);
  font-size: 1rem;
  font-weight: 900;
  text-align: center;
}

.hero-tabs .active {
  color: var(--ink);
  background: linear-gradient(180deg, #ffe09a, var(--gold));
}

.net-art {
  position: absolute;
  z-index: 1;
  right: -2%;
  bottom: 54px;
  width: 46%;
  height: 154px;
  border: 5px solid rgba(249, 201, 107, 0.5);
  border-left: 9px solid rgba(7, 48, 67, 0.82);
  border-right: 9px solid rgba(7, 48, 67, 0.82);
  background:
    repeating-linear-gradient(90deg, transparent 0 38px, rgba(4, 39, 52, 0.56) 39px 41px),
    repeating-linear-gradient(0deg, transparent 0 21px, rgba(4, 39, 52, 0.5) 22px 24px);
}

.panel,
.results-section,
.share-output {
  position: relative;
  z-index: 4;
  margin-top: -86px;
  padding: clamp(24px, 4vw, 56px);
  border: 1px solid rgba(200, 215, 221, 0.62);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.results-section,
.share-output {
  margin-top: 24px;
}

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

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

h3 {
  margin: 0;
  font-size: 1.2rem;
}

.counter,
.court-info {
  display: inline-flex;
  align-items: center;
  min-height: 54px;
  padding: 0 28px;
  border: 1px solid #a7c5cf;
  border-radius: 999px;
  color: var(--ink);
  background: #f7fbfc;
  font-weight: 900;
}

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

.list-field span,
.share-output label {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 800;
}

textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: var(--soft);
  outline: none;
  padding: 20px 22px;
  resize: vertical;
}

#athleteNames {
  min-height: 230px;
  font-size: 1.08rem;
  line-height: 1.7;
}

textarea:focus {
  border-color: #7eb4c4;
  box-shadow: 0 0 0 4px rgba(7, 87, 106, 0.1);
}

.notice {
  min-height: 28px;
  margin: 14px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.notice.is-warning {
  color: #a55d16;
}

.notice.is-success {
  color: #0a7550;
}

.tool-row,
.actions-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 22px;
}

.actions-strip {
  margin-top: 26px;
}

.btn {
  min-height: 62px;
  border: 0;
  border-radius: 10px;
  padding: 16px 28px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 12px 26px rgba(7, 48, 67, 0.1);
  font-weight: 900;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(7, 48, 67, 0.15);
}

.btn.draw {
  min-width: 220px;
  color: #fff;
  background: linear-gradient(180deg, #087f98, #06516a);
}

.btn.secondary {
  color: var(--ink);
  background: #fff8ea;
}

.btn.whatsapp {
  color: #fff;
  background: #0c8f63;
}

.btn.ghost {
  border: 1px solid #b9d5dd;
  color: #07576a;
  background: #ffffff;
}

.btn.danger {
  border-color: rgba(216, 73, 73, 0.42);
  color: var(--danger);
}

.share-output {
  padding: 24px;
}

.share-output textarea {
  min-height: 180px;
  margin-top: 10px;
}

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

.team-card,
.reserve-card {
  overflow: hidden;
  border: 1px solid #dce8ec;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 12px 26px rgba(7, 48, 67, 0.08);
}

.team-card header,
.reserve-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  color: #fff;
  background: linear-gradient(90deg, #073b4c, #087f98);
}

.team-card:nth-child(2n) header {
  background: linear-gradient(90deg, #d86938, #ef9d42);
}

.team-card:nth-child(3n) header {
  background: linear-gradient(90deg, #0a7550, #0c8f63);
}

.team-count {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-weight: 900;
}

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

.player-list li {
  padding: 13px 14px;
  border-radius: 12px;
  background: #eef6f8;
  color: var(--ink);
  font-weight: 900;
}

.reserve-card {
  margin-top: 18px;
}

.reserve-card header {
  background: linear-gradient(90deg, #64747c, #43545b);
}

.empty-state {
  display: grid;
  gap: 8px;
  min-height: 170px;
  place-items: center;
  border: 1px dashed #a9c8d1;
  border-radius: 18px;
  color: var(--muted);
  background:
    radial-gradient(circle at 50% 45%, rgba(126, 180, 196, 0.14), transparent 24%),
    #f8fcfd;
  padding: 26px;
  text-align: center;
  font-weight: 800;
}

@media (max-width: 980px) {
  .hero {
    min-height: 360px;
    padding: 42px 24px 96px;
  }

  .brand-area {
    align-items: flex-start;
  }

  .logo-mark {
    width: 108px;
  }

  .logo-ball {
    width: 62px;
  }

  .hero-tabs {
    position: relative;
    top: auto;
    right: auto;
    margin-top: 24px;
  }

  .net-art {
    width: 62%;
    height: 108px;
  }

  .panel {
    margin-top: -64px;
  }
}

@media (max-width: 700px) {
  .app-shell {
    width: min(100% - 20px, 1480px);
  }

  .hero {
    min-height: 330px;
    margin: 0;
    padding-bottom: 76px;
  }

  .brand-area {
    gap: 16px;
  }

  .logo-mark {
    width: 78px;
    border-width: 4px;
  }

  .logo-ball {
    width: 44px;
  }

  .logo-wave {
    left: 18px;
    right: 18px;
    bottom: 16px;
    height: 12px;
    border-width: 4px;
  }

  .brand-copy p,
  .eyebrow {
    margin-bottom: 8px;
    font-size: 0.72rem;
    letter-spacing: 0.16em;
  }

  h1 {
    font-size: clamp(2rem, 13vw, 3.3rem);
  }

  .pb3-line {
    gap: 12px;
    margin-top: 10px;
  }

  .pb3-line strong {
    font-size: 2rem;
  }

  .hero-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
  }

  .hero-tabs span {
    min-width: 0;
    padding: 12px 10px;
    font-size: 0.82rem;
  }

  .net-art {
    display: none;
  }

  .panel,
  .results-section {
    padding: 22px 16px;
    border-radius: 18px;
  }

  .section-heading {
    display: grid;
  }

  h2 {
    font-size: 1.85rem;
  }

  #athleteNames {
    min-height: 210px;
  }

  .tool-row,
  .actions-strip {
    display: grid;
    grid-template-columns: 1fr;
  }

  .btn {
    width: 100%;
  }
}
