:root {
  color-scheme: dark;
  --bg: #071711;
  --panel: #10251b;
  --panel-soft: #142b20;
  --green: #b8ef72;
  --green-bright: #c7ff7f;
  --muted: #9aaca0;
  --line: rgba(221, 243, 224, .11);
  --font: "Alexandria", Tahoma, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; overflow-x: hidden; background: var(--bg); color: #eff7ec; font-family: var(--font); }
button, input { font: inherit; }
button { color: inherit; }
.ambient { position: fixed; pointer-events: none; border-radius: 50%; filter: blur(90px); opacity: .1; z-index: -1; }
.ambient-one { width: 420px; height: 420px; top: -240px; right: 9%; background: #b8ef72; }
.ambient-two { width: 500px; height: 500px; bottom: -350px; left: -180px; background: #18854a; opacity: .13; }
.app-shell { width: min(1160px, calc(100% - 64px)); min-height: 100vh; margin: 0 auto; padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); display: flex; flex-direction: column; }
.topbar { height: 86px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.brand { color: #f5faef; text-decoration: none; display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 800; letter-spacing: -.8px; }
.brand-mark { width: 32px; height: 32px; background: var(--green); color: #101d13; display: grid; place-items: center; border-radius: 10px 10px 10px 3px; font-size: 16px; }
.brand-dot { color: var(--green); }
.topbar-right { display: flex; align-items: center; gap: 20px; }
.live-pill { color: #b6c3b9; font-size: 10px; display: flex; gap: 8px; align-items: center; border: 1px solid var(--line); padding: 8px 12px; border-radius: 30px; }
.live-pill i, .status-dot, .match-live i { width: 7px; height: 7px; display: inline-block; background: #85db7d; border-radius: 50%; box-shadow: 0 0 10px #85db7d; }
.text-button, .inline-button { border: 0; background: none; color: var(--green); cursor: pointer; }
.text-button { font-size: 11px; }
.auth-layout { flex: 1; display: grid; grid-template-columns: 1.15fr .85fr; gap: 90px; align-items: center; padding: 50px 4% 70px; }
.hero-copy { padding-bottom: 12px; }
.eyebrow { display: flex; align-items: center; gap: 10px; color: var(--green); font-size: 11px; font-weight: 600; letter-spacing: .3px; }
.eyebrow-line { width: 23px; height: 1px; background: var(--green); }
h1, h2, p { margin-top: 0; }
.hero-copy h1 { font-size: clamp(52px, 7vw, 83px); line-height: 1.23; letter-spacing: -4px; font-weight: 700; margin: 25px 0 18px; }
.hero-copy h1 span, .welcome-row h1 span { color: var(--green); }
.hero-copy > p { color: #aab9ac; font-size: 13px; line-height: 2.2; max-width: 470px; margin-bottom: 30px; }
.feature-list { display: grid; gap: 14px; }
.feature-list > div { display: flex; align-items: center; gap: 13px; color: #d9e5d8; font-size: 11px; }
.feature-icon { direction: ltr; color: #9aad9b; font-size: 9px; letter-spacing: .4px; width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid rgba(199,255,127,.24); border-radius: 9px; }
.hero-foot { margin-top: 44px; display: flex; align-items: center; gap: 12px; color: #657a6a; font-size: 10px; }
.hero-foot-rule { width: 32px; height: 1px; background: #526c52; }
.auth-card { width: 100%; max-width: 390px; padding: 36px 36px 25px; border: 1px solid rgba(220,245,218,.13); border-radius: 20px; background: linear-gradient(145deg, rgba(21,45,31,.95), rgba(13,31,22,.97)); box-shadow: 0 25px 80px #0003; }
.card-kicker { display: flex; align-items: center; gap: 9px; color: #b2c2b4; font-size: 10px; }
.card-kicker .status-dot { width: 6px; height: 6px; }
.auth-card h2 { font-size: 24px; margin: 22px 0 7px; letter-spacing: -.8px; }
.auth-subtitle { font-size: 10px; color: #8ea18f; margin-bottom: 25px; }
#auth-form { display: flex; flex-direction: column; }
#auth-form label { font-size: 10px; color: #c3d0c3; margin-bottom: 9px; }
.input-wrap { height: 47px; border: 1px solid rgba(224,244,221,.13); border-radius: 9px; display: flex; align-items: center; padding: 0 13px; margin-bottom: 18px; gap: 10px; background: #091a11; color: #78917c; }
.input-wrap:focus-within { border-color: rgba(184,239,114,.65); }
.input-wrap input { min-width: 0; width: 100%; border: 0; outline: 0; background: none; color: white; font-size: 11px; }
.input-wrap input::placeholder { color: #536657; }
.primary-button { border: 0; border-radius: 9px; background: var(--green); color: #132016; cursor: pointer; font-weight: 700; transition: .2s; }
.primary-button:hover, .mode-card:hover { transform: translateY(-2px); filter: brightness(1.06); }
.full-button { min-height: 48px; display: flex; align-items: center; justify-content: space-between; padding: 0 17px; font-size: 11px; margin-top: 5px; }
.full-button b { font-size: 18px; font-weight: 400; }
.auth-switch { display: flex; justify-content: center; gap: 4px; align-items: center; color: #819484; font-size: 9px; margin-top: 18px; }
.inline-button { font-size: 9px; }
.phone-help { border-top: 1px solid var(--line); color: #91a393; font-size: 9px; line-height: 1.9; text-align: center; margin: 15px 0 0; padding-top: 13px; }
.phone-help bdi { color: var(--green); }
.card-note { border-top: 1px solid var(--line); text-align: center; color: #708474; margin-top: 23px; padding-top: 16px; font-size: 9px; }
.card-note span { color: var(--green); padding-left: 5px; }
.message { color: #ffb4a9; font-size: 10px; min-height: 16px; margin: 8px 0 0; line-height: 1.8; }
.message.success { color: var(--green); }
.hidden { display: none !important; }
.lobby-screen { flex: 1; padding: 55px 4% 55px; }
.welcome-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 35px; }
.welcome-row h1 { margin: 15px 0 6px; font-size: clamp(25px, 4vw, 36px); letter-spacing: -1.2px; }
.welcome-row p { color: #91a393; font-size: 11px; margin: 0; }
.player-badge { display: flex; align-items: center; gap: 11px; border: 1px solid var(--line); border-radius: 12px; padding: 9px 13px; min-width: 160px; }
.player-badge > span:first-child { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: #243d2b; color: var(--green); font-weight: 700; }
.player-badge strong, .player-badge small { display: block; }
.player-badge strong { font-size: 10px; }
.player-badge small { color: #7e9281; font-size: 8px; margin-top: 4px; }
.online-indicator { width: 7px; height: 7px; background: #84d87c; border-radius: 50%; margin-right: auto; }
.mode-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.mode-card { position: relative; overflow: hidden; min-height: 255px; border: 1px solid var(--line); border-radius: 15px; padding: 23px; text-align: right; display: flex; flex-direction: column; align-items: flex-start; background: #0d2016; cursor: pointer; transition: transform .18s, filter .18s, border-color .2s; }
.friend-card { background: linear-gradient(148deg, #1a3620, #102418 75%); }
.mode-card:hover { border-color: rgba(184,239,114,.44); }
.mode-icon { width: 35px; height: 35px; border-radius: 10px; display: grid; place-items: center; color: var(--green); background: rgba(184,239,114,.1); font-size: 18px; margin-bottom: 18px; }
.mode-tag { position: absolute; top: 29px; left: 20px; color: #9db99a; font-size: 8px; }
.mode-card strong { font-size: 16px; margin-bottom: 8px; }
.mode-description { color: #8ea092; font-size: 9px; line-height: 1.9; max-width: 215px; }
.mode-action { display: flex; align-items: center; justify-content: space-between; color: var(--green); font-size: 9px; width: 100%; margin-top: auto; padding-top: 16px; }
.mode-action b { font-size: 16px; font-weight: 400; }
.mode-decoration { position: absolute; bottom: -22px; left: 14px; color: #ffffff08; font-family: Arial,sans-serif; font-size: 100px; font-weight: 800; pointer-events: none; }
.join-input-row { display: flex; height: 38px; margin-top: 15px; width: 100%; z-index: 1; }
.join-input-row input { min-width: 0; flex: 1; width: 70%; border: 1px solid rgba(226,245,222,.13); border-radius: 8px 0 0 8px; outline: 0; background: #09180f; padding: 0 11px; color: var(--green); letter-spacing: 2px; font-weight: 600; font-size: 11px; }
.join-input-row input::placeholder { color: #536657; letter-spacing: 1px; font-size: 9px; }
.join-input-row button { width: 41px; border: 0; border-radius: 0 8px 8px 0; background: var(--green); color: #172219; font-size: 18px; cursor: pointer; }
.join-card .message { min-height: 14px; position: relative; z-index: 1; font-size: 8px; margin-top: 4px; }
.lobby-tip { display: flex; align-items: center; gap: 10px; margin-top: 24px; padding: 14px 17px; border: 1px solid var(--line); border-radius: 10px; color: var(--green); font-size: 9px; }
.lobby-tip > span:first-child { font-size: 13px; }
.lobby-tip p { color: #8ea092; font-size: 9px; margin: 0; }
.game-screen { flex: 1; padding: 24px 0 35px; display: flex; flex-direction: column; }
.match-header { display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center; margin-bottom: 16px; }
.back-button { width: fit-content; border: 1px solid var(--line); background: transparent; color: #a8b7a8; padding: 8px 12px; border-radius: 8px; font-size: 9px; cursor: pointer; }
.back-button span { color: var(--green); margin-left: 6px; }
.match-title { display: flex; align-items: center; flex-direction: column; gap: 4px; }
.match-title strong { font-size: 12px; }
.match-live { display: flex; align-items: center; gap: 5px; color: var(--green); font-size: 8px; }
.match-live i { width: 5px; height: 5px; }
.match-code { color: #96a597; font-size: 8px; letter-spacing: 2px; }
.match-clock { direction: ltr; margin-top: 3px; color: var(--green); font: 700 15px/1 Arial, sans-serif; letter-spacing: 1px; font-variant-numeric: tabular-nums; text-shadow: 0 0 12px #b8ef7240; }
.match-clock.clock-warning { color: #ff9a73; text-shadow: 0 0 12px #ff684b70; animation: clock-pulse 1s ease-in-out infinite; }
@keyframes clock-pulse { 50% { opacity: .55; } }
.scoreboard { display: flex; gap: 12px; align-items: center; justify-content: flex-end; color: #b8c8b9; font-size: 8px; }
.scoreboard strong { direction: ltr; display: flex; gap: 8px; align-items: center; font: 700 20px Arial,sans-serif; color: white; }
.scoreboard strong i { color: #779079; font-style: normal; font-size: 14px; }
.pitch-frame { position: relative; border: 1px solid rgba(211,244,207,.19); border-radius: 13px; overflow: hidden; background: #174a2e; box-shadow: 0 20px 65px #0004; }
#pitch { display: block; width: 100%; height: auto; aspect-ratio: 12 / 7; }
.goal-overlay { position: absolute; z-index: 2; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; background: radial-gradient(ellipse, #c5ff7f35 0, #091b12dc 58%, #06120bdc 100%); backdrop-filter: blur(4px); animation: goal-screen-in .28s ease-out both; }
.goal-overlay.hidden { display: none !important; }
.match-end-overlay { position: absolute; z-index: 3; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: radial-gradient(ellipse, #102b1deF 0, #07140df2 75%); backdrop-filter: blur(6px); text-align: center; animation: goal-screen-in .35s ease-out both; }
.match-end-overlay.hidden { display: none !important; }
.match-end-whistle { color: var(--green); font-size: clamp(32px, 8vw, 64px); filter: drop-shadow(0 0 16px #b8ef7280); }
.match-end-overlay > strong { color: #f4f8ef; font-size: clamp(22px, 5vw, 38px); }
.match-end-result { color: var(--green); font: 700 clamp(18px, 4vw, 28px)/1.2 Arial, sans-serif; direction: rtl; }
.goal-burst { position: absolute; width: min(46vw, 360px); aspect-ratio: 1; border: 2px solid #d7ff9a42; border-radius: 50%; box-shadow: 0 0 0 24px #d7ff9a0d, 0 0 0 50px #d7ff9a08, inset 0 0 60px #d7ff9a1c; animation: goal-burst 1.8s ease-out infinite; }
.goal-kicker, .goal-team { position: relative; color: #d9f6c1; font-size: clamp(9px, 2vw, 14px); font-weight: 600; letter-spacing: 3px; text-shadow: 0 2px 12px #0009; }
.goal-word { position: relative; margin: 4px 0 -4px; color: #d4ff8f; font: italic 900 clamp(54px, 13vw, 118px)/1 Arial, sans-serif; letter-spacing: 2px; text-shadow: 0 0 22px #beff6d88, 0 5px 0 #477331, 0 12px 36px #000a; animation: goal-word-pop .55s cubic-bezier(.18,.9,.28,1.25) both; }
.goal-arabic { position: relative; color: #fff; font-size: clamp(25px, 6vw, 50px); font-weight: 800; text-shadow: 0 0 18px #d4ff8f9c, 0 4px 18px #000c; animation: goal-word-pop .6s .08s cubic-bezier(.18,.9,.28,1.25) both; }
.goal-team { margin-top: 8px; color: #ffffffbd; font-size: clamp(9px, 1.8vw, 12px); letter-spacing: 1px; }
@keyframes goal-screen-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes goal-word-pop { from { opacity: 0; transform: translateY(16px) scale(.65); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes goal-burst { 0%, 100% { transform: scale(.9); opacity: .55; } 50% { transform: scale(1.06); opacity: 1; } }
.pitch-label { position: absolute; bottom: 12px; right: 15px; color: #eff8e78a; font-size: 8px; pointer-events: none; }
.pitch-label span { color: var(--green); }
.waiting-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 11px; background: rgba(5,18,10,.73); backdrop-filter: blur(3px); }
.waiting-overlay strong { font-size: 15px; }
.waiting-overlay > span:not(.waiting-spinner) { color: #a7b7a8; font-size: 9px; }
.waiting-spinner { width: 25px; height: 25px; border: 2px solid #ffffff2b; border-top-color: var(--green); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.copy-code { border: 1px solid #d9f4c040; background: #c9f78418; color: var(--green); padding: 8px 12px; border-radius: 7px; font-size: 9px; cursor: pointer; }
.copy-code b { direction: ltr; display: inline-block; margin-right: 7px; letter-spacing: 2px; }
.controls-row { display: flex; justify-content: space-between; align-items: center; min-height: 76px; }
.control-hint { display: flex; align-items: center; gap: 5px; color: #91a293; font-size: 9px; }
.key { direction: ltr; min-width: 21px; height: 21px; display: grid; place-items: center; border: 1px solid #ffffff20; border-radius: 5px; color: #c9d6c9; font: 10px Arial,sans-serif; }
.control-hint > span:nth-child(5) { margin: 0 8px 0 14px; }
.space-key { padding: 0 7px; font-size: 8px; }
.match-status { display: flex; align-items: center; gap: 8px; color: #9aab9c; font-size: 9px; }
.match-status .status-dot { width: 6px; height: 6px; }
.mobile-controls { display: none; }
.site-footer { display: flex; height: 56px; border-top: 1px solid var(--line); align-items: center; justify-content: space-between; color: #6e8172; font-size: 8px; }
.site-footer > span:first-child { color: #b9c7ba; font-weight: 700; font-size: 11px; }
.site-footer > span:nth-child(2) b { color: var(--green); padding-right: 4px; }
.welcome-intro { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; overflow: auto; padding: 24px; background: radial-gradient(ellipse at 50% 38%, #193e29 0, #0b2015 46%, #050e09 100%); transition: opacity .55s ease, visibility .55s ease; }
.welcome-intro::before, .welcome-intro::after { position: absolute; content: ""; width: min(62vw, 480px); aspect-ratio: 1; border: 1px solid #c7ff7f12; border-radius: 50%; pointer-events: none; }
.welcome-intro::after { width: min(78vw, 620px); }
.welcome-intro.intro-dismissed { opacity: 0; visibility: hidden; pointer-events: none; }
.intro-card { position: relative; width: min(100%, 600px); display: flex; flex-direction: column; align-items: center; text-align: center; padding: clamp(32px, 8vw, 72px) clamp(22px, 7vw, 64px); border: 1px solid #dcf5da20; border-radius: 26px; background: linear-gradient(145deg, #183323eF, #0a1a11f5); box-shadow: 0 30px 110px #0008, inset 0 1px #ffffff08; animation: intro-arrive .8s cubic-bezier(.2,.75,.2,1) both; }
.intro-ball { display: grid; place-items: center; width: 74px; height: 74px; margin-bottom: 24px; border: 1px solid #c7ff7f45; border-radius: 22px 22px 22px 7px; background: #c7ff7f12; font-size: 37px; }
.intro-kicker { margin-bottom: 14px; color: var(--green); font-size: 11px; font-weight: 700; letter-spacing: 2px; }
.intro-card h1 { margin: 0; color: #f1f7ee; font-size: clamp(27px, 6vw, 44px); line-height: 1.75; letter-spacing: -.8px; }
.intro-caption { margin: 18px 0 0; color: #99ad9c; font-size: 12px; }
.intro-start { min-width: 190px; min-height: 51px; display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 34px; padding: 0 19px; border: 0; border-radius: 10px; background: var(--green); color: #132016; font-size: 12px; font-weight: 700; cursor: pointer; transition: transform .18s, filter .18s; }
.intro-start:hover { transform: translateY(-2px); filter: brightness(1.08); }
.intro-start span { font-size: 19px; font-weight: 400; }
@keyframes intro-arrive { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (max-width: 850px) {
  .app-shell { width: min(100% - 40px, 700px); }
  .auth-layout { gap: 35px; padding-right: 0; padding-left: 0; }
  .auth-card { padding: 29px 25px 21px; }
  .hero-copy h1 { font-size: 58px; }
  .mode-card { padding: 18px; }
}
@media (max-width: 620px) {
  body { min-height: 100svh; }
  .app-shell { width: calc(100% - 32px); }
  .topbar { height: 67px; }
  .live-pill { font-size: 8px; padding: 7px 9px; }
  .auth-layout { grid-template-columns: 1fr; gap: 27px; padding: 36px 0 44px; }
  .hero-copy { padding: 0; }
  .hero-copy h1 { margin: 17px 0 9px; font-size: 47px; line-height: 1.2; letter-spacing: -2px; }
  .hero-copy > p { font-size: 10px; line-height: 1.9; max-width: 390px; margin-bottom: 15px; }
  .feature-list { display: none; }
  .hero-foot { display: none; }
  .auth-card { max-width: none; padding: 23px 20px 18px; }
  .auth-card h2 { margin-top: 16px; font-size: 21px; }
  .auth-subtitle { margin-bottom: 20px; }
  .input-wrap { margin-bottom: 14px; }
  .lobby-screen { padding: 35px 0 40px; }
  .welcome-row { align-items: flex-end; margin-bottom: 23px; }
  .welcome-row h1 { font-size: 24px; }
  .welcome-row p { font-size: 9px; }
  .player-badge { min-width: auto; padding: 7px; gap: 7px; }
  .player-badge > span:first-child { width: 29px; height: 29px; }
  .player-badge strong { font-size: 8px; }
  .player-badge small { font-size: 7px; }
  .online-indicator { display: none; }
  .mode-grid { grid-template-columns: 1fr; gap: 10px; }
  .mode-card { min-height: 174px; padding: 16px 18px; }
  .mode-icon { width: 31px; height: 31px; margin-bottom: 10px; }
  .mode-tag { top: 24px; }
  .mode-card strong { font-size: 14px; margin-bottom: 5px; }
  .mode-description { font-size: 8px; }
  .mode-action { padding-top: 8px; }
  .join-input-row { margin-top: 9px; max-width: 280px; }
  .join-card .message { position: absolute; bottom: 12px; right: 18px; }
  .lobby-tip { align-items: flex-start; flex-wrap: wrap; gap: 7px; }
  .lobby-tip p { flex-basis: 100%; line-height: 1.8; }
  .game-screen { padding-top: 16px; }
  .match-header { grid-template-columns: auto 1fr auto; gap: 8px; margin-bottom: 11px; }
  .back-button { padding: 7px 8px; font-size: 8px; }
  .match-title strong { font-size: 10px; }
  .match-clock { font-size: 13px; }
  .scoreboard { gap: 5px; font-size: 7px; }
  .scoreboard strong { font-size: 16px; gap: 5px; }
  .pitch-frame { border-radius: 8px; }
  #pitch { aspect-ratio: 12 / 8.5; }
  .pitch-label { bottom: 6px; right: 8px; font-size: 6px; }
  .controls-row { min-height: 140px; justify-content: center; position: relative; }
  .desktop-hint { display: none; }
  .match-status { position: absolute; top: 11px; left: 2px; font-size: 8px; }
  .mobile-controls { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 17px 8px 0; }
  .dpad { display: grid; grid-template-columns: 39px 39px 39px; grid-template-rows: 39px 39px; gap: 4px; }
  .dpad button { border: 1px solid #ffffff24; border-radius: 9px; color: #e3f0e1; background: #14281b; touch-action: none; font-size: 17px; }
  .dpad .pad-up { grid-column: 2; grid-row: 1; }
  .dpad .pad-left { grid-column: 1; grid-row: 2; }
  .dpad .pad-down { grid-column: 2; grid-row: 2; }
  .dpad .pad-right { grid-column: 3; grid-row: 2; }
  .dpad button:active, .shoot-button:active { background: #34502c; transform: scale(.96); }
  .shoot-button { width: 75px; height: 75px; border: 1px solid #cef9926b; border-radius: 50%; background: #b8ef7222; color: var(--green); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; touch-action: none; }
  .shoot-button span { font-size: 26px; }
  .shoot-button b { font-size: 9px; }
  .site-footer { height: 47px; font-size: 7px; }
  .site-footer > span:last-child { display: none; }
}
