
:root {
  --bg: #07150f;
  --panel: #10241a;
  --panel-light: #173424;
  --text: #f7fff9;
  --muted: #abc7b5;
  --accent: #5ef08b;
  --blue: #2f8cff;
  --red: #f24b58;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(94,240,139,.12), transparent 35%),
    linear-gradient(180deg, #07150f, #0b1b13 55%, #07150f);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, a { font: inherit; }

.site-header {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 76px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  color: white;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -.02em;
}

.small-play-button,
.primary-button {
  border: 0;
  color: #06200f;
  background: var(--accent);
  font-weight: 800;
  cursor: pointer;
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(94,240,139,.18);
}

.small-play-button { padding: 11px 18px; }

.hero {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  min-height: calc(100vh - 76px);
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 64px;
  align-items: center;
  padding: 60px 0 96px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .16em;
}

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

h1 {
  max-width: 760px;
  margin-bottom: 22px;
  font-size: clamp(44px, 7vw, 84px);
  line-height: .98;
  letter-spacing: -.06em;
}

.hero-text {
  max-width: 650px;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 14px;
  margin: 34px 0 30px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 26px;
  text-decoration: none;
}

.secondary-button {
  color: white;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  background: rgba(255,255,255,.04);
}

.feature-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: #cae5d2;
  font-size: 14px;
}

.preview-card {
  padding: 18px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 28px;
  background: rgba(255,255,255,.06);
  box-shadow: 0 30px 80px rgba(0,0,0,.34);
  transform: rotate(2deg);
}

.preview-pitch {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 4px solid rgba(255,255,255,.92);
  border-radius: 18px;
  background:
    repeating-linear-gradient(
      90deg,
      #188348 0,
      #188348 10%,
      #1d914f 10%,
      #1d914f 20%
    );
}

.preview-pitch::before,
.preview-pitch::after {
  content: "";
  position: absolute;
  top: 31%;
  width: 17%;
  height: 38%;
  border: 4px solid white;
}

.preview-pitch::before { left: -4px; }
.preview-pitch::after { right: -4px; }

.preview-line {
  position: absolute;
  left: 50%;
  top: 0;
  width: 4px;
  height: 100%;
  background: white;
}

.preview-circle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22%;
  aspect-ratio: 1;
  border: 4px solid white;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.preview-player {
  position: absolute;
  width: 42px;
  aspect-ratio: 1;
  border: 4px solid white;
  border-radius: 50%;
  top: 47%;
}

.preview-player.blue { left: 27%; background: var(--blue); }
.preview-player.red { right: 25%; background: var(--red); }

.preview-ball {
  position: absolute;
  left: 50%;
  top: 50%;
  font-size: 34px;
  transform: translate(-50%, -50%);
}

.game-section {
  width: min(1220px, calc(100% - 20px));
  margin: 0 auto;
  min-height: 100vh;
  padding: 16px 0 32px;
}

.game-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.game-toolbar h2 { margin: 0; }

.ghost-button {
  padding: 11px 18px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  color: white;
  background: rgba(255,255,255,.05);
  cursor: pointer;
}

.game-mount {
  min-height: 76vh;
  display: grid;
  place-items: center;
}

.info-section {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 100px 0;
}

.section-heading { max-width: 680px; }

.section-heading h2 {
  font-size: clamp(34px, 5vw, 58px);
  letter-spacing: -.045em;
}

.instruction-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 38px;
}

.instruction-card {
  min-height: 220px;
  padding: 26px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 22px;
  background: var(--panel);
}

.instruction-card p {
  color: var(--muted);
  line-height: 1.65;
}

.blue-card { border-top: 4px solid var(--blue); }
.red-card { border-top: 4px solid var(--red); }

footer {
  padding: 32px 16px 44px;
  color: var(--muted);
  text-align: center;
}

.hidden { display: none !important; }

@media (max-width: 850px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 34px;
    padding-top: 40px;
  }

  .preview-card { transform: none; }

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

  .feature-row { flex-direction: column; gap: 8px; }

  .game-toolbar { padding: 0 6px; }
}


.country-selection {
  width: min(960px, calc(100% - 24px));
  margin: 36px auto;
  padding: 42px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 28px;
  background: rgba(16,36,26,.96);
  box-shadow: 0 30px 80px rgba(0,0,0,.35);
}

.selection-heading {
  max-width: 650px;
  margin: 0 auto 32px;
  text-align: center;
}

.selection-heading h2 {
  font-size: clamp(34px, 5vw, 56px);
  letter-spacing: -.045em;
  margin-bottom: 12px;
}

.selection-heading p:last-child {
  color: var(--muted);
}

.country-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 24px;
  align-items: center;
}

.country-picker {
  display: block;
  padding: 24px;
  border-radius: 22px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
}

.country-picker > span {
  display: block;
  margin-bottom: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 13px;
}

.country-picker select {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 12px;
  color: white;
  background: #0d2117;
  font-weight: 700;
}

.country-preview {
  display: flex;
  min-height: 150px;
  margin-top: 16px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 16px;
  background: rgba(0,0,0,.18);
}

.large-flag {
  font-size: 64px;
  line-height: 1;
}

.versus-badge {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #06200f;
  font-weight: 900;
}

.blue-picker { border-top: 4px solid var(--blue); }
.red-picker { border-top: 4px solid var(--red); }

.selection-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 30px;
}

@media (max-width: 720px) {
  .country-selection { padding: 24px 16px; }
  .country-grid {
    grid-template-columns: 1fr;
  }
  .versus-badge {
    margin: -4px auto;
  }
}

.world-cup-button{min-height:54px;padding:0 24px;border:0;border-radius:999px;background:linear-gradient(135deg,#ffe36e,#e6a800);color:#211700;font-weight:900;cursor:pointer}.event-banner{display:flex;gap:12px;justify-content:center;align-items:center;margin:0 auto 24px;padding:14px;border:1px solid #d9aa22;border-radius:16px;background:rgba(255,214,70,.12)}.event-banner span{color:var(--muted)}.round-progress{display:flex;justify-content:center;gap:10px;margin-bottom:12px}.round-progress span{padding:8px 12px;border-radius:999px;background:rgba(255,255,255,.08);color:var(--muted);font-weight:800;font-size:13px}.round-progress span.active{background:#ffe36e;color:#211700}.round-progress span.done{background:var(--accent);color:#06200f}@media(max-width:700px){.hero-actions{flex-wrap:wrap}.event-banner{flex-direction:column;text-align:center}.round-progress span{font-size:11px;padding:7px 9px}}


.opponent-mode-selector {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 0 auto 28px;
  flex-wrap: wrap;
}

.mode-choice {
  min-width: 190px;
  padding: 14px 20px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  color: white;
  background: rgba(255,255,255,.06);
  font-weight: 800;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}

.mode-choice:hover {
  transform: translateY(-1px);
}

.mode-choice.active {
  color: #06200f;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 10px 24px rgba(94,240,139,.18);
}

.difficulty-selector{width:min(520px,100%);margin:-12px auto 28px;padding:16px;text-align:center;border:1px solid rgba(255,255,255,.12);border-radius:18px;background:rgba(255,255,255,.04)}
.difficulty-selector>span{display:block;margin-bottom:10px;color:var(--muted);font-size:13px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}
.difficulty-buttons{display:flex;justify-content:center;gap:8px}
.difficulty-choice{min-width:100px;padding:10px 14px;border:1px solid rgba(255,255,255,.14);border-radius:999px;color:white;background:rgba(255,255,255,.06);font-weight:800;cursor:pointer}
.difficulty-choice.active{color:#06200f;background:#ffe36e;border-color:#ffe36e}


.online-play-button {
  min-height: 54px;
  padding: 0 24px;
  border: 1px solid rgba(115,190,255,.55);
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg,#1677ff,#5947e8);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(22,119,255,.2);
}

.username-modal,
.challenge-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(1,8,5,.88);
  backdrop-filter: blur(10px);
}

.username-card,
.challenge-card {
  width: min(480px,100%);
  padding: 32px;
  text-align: center;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 26px;
  background: #10241a;
  box-shadow: 0 30px 90px rgba(0,0,0,.55);
}

.username-card input,
.friend-add-row input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 12px;
  color: white;
  background: #07150f;
  font: inherit;
}

.username-card button {
  margin-top: 12px;
}

.form-error {
  min-height: 20px;
  color: #ff8181;
}

.online-lobby,
.online-game-section {
  min-height: 100vh;
  padding: 40px max(20px,5vw);
  background:
    radial-gradient(circle at 15% 10%,rgba(22,119,255,.16),transparent 30%),
    #07150f;
}

.lobby-header {
  max-width: 1100px;
  margin: 0 auto 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.lobby-grid {
  max-width: 1100px;
  margin: auto;
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 20px;
}

.lobby-card {
  padding: 24px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 22px;
  background: rgba(255,255,255,.055);
}

.friends-card {
  grid-column: 1 / -1;
}

.friend-add-row {
  display: flex;
  gap: 10px;
}

.friend-add-row input {
  flex: 1;
}

.lobby-status {
  min-height: 22px;
  color: #ffe36e;
}

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

.friend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255,255,255,.06);
}

.friend-identity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.online-dot,
.offline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.online-dot { background: #63ef8d; box-shadow: 0 0 12px #63ef8d; }
.offline-dot { background: #718078; }

.empty-state {
  color: var(--muted);
}

.challenge-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
}

.online-game-section .game-toolbar {
  max-width: 1100px;
  margin: 0 auto 14px;
}

.online-canvas {
  display: block;
  width: min(96vw,1100px);
  height: auto;
  max-height: 72vh;
  margin: auto;
  border: 3px solid white;
  border-radius: 14px;
  background: #198b45;
  touch-action: none;
}

.online-controls {
  width: min(96vw,1100px);
  margin: 12px auto 0;
  display: flex;
  justify-content: center;
}

.online-control-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(255,255,255,.08);
}

.online-dpad {
  display: grid;
  grid-template-columns: 44px 44px 44px;
  grid-template-rows: 44px 44px 44px;
  gap: 3px;
}

.online-dpad button {
  padding: 0;
  border-radius: 10px;
}

.online-shoot {
  width: 72px;
  height: 72px;
  padding: 0;
}

@media (max-width:720px) {
  .lobby-grid { grid-template-columns: 1fr; }
  .friends-card { grid-column: auto; }
  .friend-add-row { flex-direction: column; }
  .lobby-header { align-items: flex-start; flex-direction: column; }
}
