/* Ragdoll Soccer — sokin stadion: kunduzi (yorug' mavzu) va projektorli tun (qorong'i mavzu). Jamoa ranglari: ko'k va to'q sariq.
   Asosiy tugma — neytral «siyoh» (qorong'ida oq, yorug'da qora), bitta urg'u — jamoa rangi. Telefon portret: maydon tepada, katta tugmalar pastda. */
:root, :root[data-theme="dark"] { --c0: #3b82f6; --c1: #f59a3b; --c0a: rgba(59,130,246,.16); --c1a: rgba(245,154,59,.16); --glass: rgba(12,16,26,.62); --glass2: rgba(12,16,26,.82); --cap: #fff; --capsh: 0 2px 14px rgba(0,0,0,.55), 0 1px 2px rgba(0,0,0,.6); --ink: #f4f6fa; --ink-t: #0b0d12; --dim: rgba(4,6,12,.5); --pad-bg: #0d121d; }
:root[data-theme="light"] { --c0: #2563eb; --c1: #e8741a; --c0a: rgba(37,99,235,.12); --c1a: rgba(232,116,26,.13); --glass: rgba(255,255,255,.72); --glass2: rgba(255,255,255,.9); --cap: #101521; --capsh: 0 1px 12px rgba(255,255,255,.85), 0 0 2px rgba(255,255,255,.9); --ink: #121722; --ink-t: #fff; --dim: rgba(236,240,245,.52); --pad-bg: #e9edf2; }
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body { position: fixed; inset: 0; background: var(--bg); touch-action: none; }
#cv { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#touch { position: fixed; inset: 0; z-index: 5; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; cursor: pointer; }
#ui { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
#ui button, #ui a, #ui .mn-body, #ui .ov { pointer-events: auto; }
#probe { position: fixed; left: 0; top: 0; width: 0; height: 0; visibility: hidden; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.sp { flex: 1; }

/* yumaloq kichik tugma */
.rb { flex: none; display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--glass); color: var(--fg); cursor: pointer; text-decoration: none; transition: transform .08s, background .15s; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.rb:active { transform: scale(.93); }
.rb svg { width: 20px; height: 20px; }
.rb.txt { font-size: 13px; font-weight: 750; }
@media (pointer: coarse) { .rb { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--glass2); } }

/* ---------- HUD */
#hud { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: flex-start; gap: 8px; padding: calc(8px + env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 0 max(10px, env(safe-area-inset-left)); }
#board { margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto minmax(0, 1fr); align-items: center; column-gap: 10px; min-width: min(330px, calc(100vw - 132px)); max-width: min(520px, calc(100vw - 124px)); padding: 6px 14px 5px; border-radius: 16px; background: var(--glass); border: 1px solid var(--line); color: var(--fg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-variant-numeric: tabular-nums; }
@media (pointer: coarse) { #board { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--glass2); } }
#board .nm { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 13.5px; font-weight: 650; color: var(--mut); }
#board .nm b { font-weight: inherit; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#board .n0 { justify-content: flex-end; } #board .n1 { justify-content: flex-start; }
#board .nm i { flex: none; width: 10px; height: 10px; border-radius: 50%; }
#board .n0 i { background: var(--c0); } #board .n1 i { background: var(--c1); border-radius: 3px; } /* shakl ham farq qiladi: doira va kvadrat */
#board .sc { font-size: 26px; line-height: 1.1; font-weight: 800; letter-spacing: -.02em; min-width: 18px; text-align: center; }
#board .sc.pop { animation: pop .5s cubic-bezier(.2,1.4,.4,1); }
@keyframes pop { 0% { transform: scale(1); } 30% { transform: scale(1.45); } 100% { transform: scale(1); } }
#board .dash { width: 8px; height: 2px; border-radius: 1px; background: var(--mut); opacity: .6; }
#board small { grid-column: 1 / -1; text-align: center; font-size: 10.5px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--mut); opacity: .85; margin-top: -1px; }

/* sanoq va gol yozuvi */
#cap { position: absolute; left: 50%; top: var(--sc, 40%); transform: translate(-50%, -50%); width: min(560px, 92vw); text-align: center; color: var(--cap); text-shadow: var(--capsh); pointer-events: none; }
#cap[hidden] { display: none; }
#cap b { display: block; font-size: clamp(48px, 11vmin, 92px); line-height: 1; font-weight: 800; letter-spacing: -.035em; font-variant-numeric: tabular-nums; animation: capIn .32s cubic-bezier(.2,.9,.3,1.15) both; }
#cap small { display: block; margin-top: 10px; font-size: clamp(14px, 2.6vmin, 18px); font-weight: 650; letter-spacing: -.005em; }
#cap em { display: block; margin-top: 4px; font-style: normal; font-size: 12.5px; font-weight: 600; opacity: .78; }
#cap.go b { font-size: clamp(36px, 8vmin, 64px); letter-spacing: -.02em; }
#cap.goal b { font-size: clamp(56px, 13vmin, 112px); }
#cap.goal b::after { content: ""; display: block; width: 64px; height: 5px; margin: 12px auto 0; border-radius: 3px; background: var(--c0); box-shadow: none; }
#cap.goal.s1 b::after { background: var(--c1); }
@keyframes capIn { from { opacity: 0; transform: scale(1.18); } }

/* bosish joylari: landshaftda burchaklarda yumaloq ko'rsatkich (butun yarim ekran tugma), portretda maydon ostida katta tugmalar */
#pads { position: absolute; inset: 0; pointer-events: none; }
#pads[hidden] { display: none; }
.pad { position: absolute; bottom: calc(14px + env(safe-area-inset-bottom)); display: grid; place-items: center; align-content: center; gap: 2px; width: 92px; height: 92px; border-radius: 50%; border: 2px solid; color: var(--fg); transition: transform .07s, background .1s, box-shadow .1s; }
.pad.p0 { left: max(16px, env(safe-area-inset-left)); border-color: color-mix(in srgb, var(--c0) 70%, transparent); background: var(--c0a); }
.pad.p1 { right: max(16px, env(safe-area-inset-right)); border-color: color-mix(in srgb, var(--c1) 70%, transparent); background: var(--c1a); border-radius: 26px; }
.pad .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--c0); }
.pad.p1 .dot { background: var(--c1); border-radius: 4px; }
.pad b { display: none; }
.pad small { font-size: 13px; font-weight: 750; color: var(--fg); opacity: .9; max-width: 84px; text-align: center; line-height: 1.15; }
.pad small:empty { display: none; }
.pad.on { transform: scale(.94); }
.pad.p0.on { background: color-mix(in srgb, var(--c0) 42%, transparent); box-shadow: 0 0 0 6px var(--c0a); }
.pad.p1.on { background: color-mix(in srgb, var(--c1) 42%, transparent); box-shadow: 0 0 0 6px var(--c1a); }
#pads.solo .p1 { display: none; }
#pads.solo .p0 small { max-width: 80px; font-size: 11.5px; }
#cond { display: none; }
/* landshaft: maydonning yaqin chetida kichik ko'rsatkichlar (darvozani yopmaydi); butun yarim ekran — tugma */
body.landscape .pad { bottom: calc(8px + env(safe-area-inset-bottom)); width: auto; height: 38px; min-width: 60px; padding: 0 13px 0 11px; grid-auto-flow: column; gap: 8px; border-width: 1.5px; border-radius: 19px; }
body.landscape .pad.p1 { border-radius: 19px; }
body.landscape .pad b { display: block; font-size: 13px; font-weight: 750; white-space: nowrap; }
body.landscape .pad .dot { width: 11px; height: 11px; }
body.landscape .pad small { font-size: 12px; font-weight: 800; opacity: .75; max-width: none; white-space: nowrap; }
body.landscape #pads.solo .p0 small { font-size: 12px; }
body.landscape.touch #pads.solo { display: none; }
body.landscape .pad.on { transform: scale(.96); }
body.portrait #pads { top: var(--sb); display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto minmax(0, 1fr); gap: 10px 12px; padding: 10px max(12px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); background: var(--pad-bg); border-top: 1px solid var(--line); }
body.portrait #cond { display: block; grid-column: 1 / -1; text-align: center; font-size: 13.5px; font-weight: 650; color: var(--mut); min-height: 20px; padding-top: 2px; }
body.portrait .pad { position: relative; inset: auto; width: auto; height: auto; min-height: 120px; border-radius: 24px; border-width: 1.5px; align-self: stretch; grid-row: 2; gap: 8px; }
body.portrait .pad.p0 { grid-column: 1; } body.portrait .pad.p1 { grid-column: 2; border-radius: 24px; }
body.portrait #pads.solo .p0 { grid-column: 1 / -1; }
body.portrait .pad .dot { width: 22px; height: 22px; }
body.portrait .pad.p1 .dot { border-radius: 6px; }
body.portrait .pad b { display: block; font-size: 17px; font-weight: 750; letter-spacing: -.01em; }
body.portrait .pad.on { transform: scale(.975); }

/* birinchi o'yindagi ishora */
.hint { position: absolute; left: 50%; bottom: calc(124px + env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: min(420px, 88vw); padding: 10px 16px; border-radius: 14px; background: var(--glass2); border: 1px solid var(--line2); color: var(--fg); font-size: 14.5px; font-weight: 650; text-align: center; box-shadow: 0 10px 30px var(--shadow); animation: hintIn .4s ease both .5s; }
body.portrait .hint { bottom: auto; top: calc(var(--sb) - 58px); }
body.landscape .hint { bottom: calc(5px + env(safe-area-inset-bottom)); padding: 7px 14px; font-size: 13.5px; } /* maydonning yaqin chetida: o'yinchilarni yopmaydi */
body.portrait #hSound { display: none; } /* tor ekranda nomlarga joy: ovoz — pauza oynasida */
body.portrait #board { flex: 1; margin: 0; min-width: 0; max-width: none; column-gap: 8px; padding: 6px 12px 5px; }
body.portrait #board .nm { font-size: 13px; gap: 6px; }
@keyframes hintIn { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ---------- tugmalar */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 50px; padding: 0 18px; border: 1px solid var(--line2); border-radius: 15px; background: var(--sur2); color: var(--fg); font-size: 15.5px; font-weight: 700; cursor: pointer; transition: transform .08s, background .15s, filter .15s; }
.btn:hover { background: var(--sur3); }
.btn:active { transform: scale(.975); }
.btn svg { width: 19px; height: 19px; flex: none; }
.btn.pri { background: var(--ink); color: var(--ink-t); border-color: transparent; font-size: 16.5px; font-weight: 780; }
.btn.pri:hover { filter: brightness(1.08); background: var(--ink); }
.btn.ic { width: 50px; padding: 0; flex: none; }
.btn:focus-visible, .mbtn:focus-visible, .seg button:focus-visible, .rb:focus-visible, .lnk:focus-visible { outline: 2px solid var(--c0); outline-offset: 2px; }

/* ---------- menyu */
#menu { position: absolute; inset: 0; }
#menu[hidden] { display: none; }
.mn { position: absolute; inset: 0; display: flex; flex-direction: column; }
.mn-top { position: relative; display: flex; align-items: center; gap: 8px; padding: calc(8px + env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 0 max(10px, env(safe-area-inset-left)); }
.mn-top .gu-menu2 { top: calc(100% + 4px); right: max(10px, env(safe-area-inset-right)); pointer-events: auto; }
.mn-body { margin-top: auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 18px max(16px, env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); background: var(--sur); border-top: 1px solid var(--line); border-radius: 22px 22px 0 0; box-shadow: 0 -18px 50px var(--shadow); color: var(--fg); }
.mn-head h1 { margin: 0; font-size: clamp(28px, 8.2vw, 40px); line-height: 1.02; font-weight: 820; letter-spacing: -.035em; }
.mn-head p { margin: 5px 0 0; font-size: 15px; color: var(--mut); font-weight: 550; }
.mn-acts { display: grid; gap: 9px; }
.mcard { border: 1px solid var(--line2); border-radius: 18px; background: var(--sur2); overflow: hidden; }
.mbtn { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 10px 14px; border: 1px solid var(--line2); border-radius: 18px; background: var(--sur2); color: var(--fg); text-align: left; cursor: pointer; transition: background .15s, transform .08s; }
.mcard .mbtn { border: 0; border-radius: 0; background: transparent; }
.mbtn:hover { background: var(--sur3); }
.mbtn:active { transform: scale(.99); }
.mbtn .ic { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--c0a); color: var(--c0); }
#mPvp .ic { background: var(--c1a); color: var(--c1); }
.mbtn.cont .ic { background: var(--ink); color: var(--ink-t); }
.mbtn .ic svg { width: 22px; height: 22px; }
.mbtn .tx b { display: block; font-size: 16.5px; font-weight: 760; letter-spacing: -.01em; }
.mbtn .tx small { display: block; margin-top: 1px; font-size: 13px; color: var(--mut); line-height: 1.3; }
.mbtn .go { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: var(--ink-t); }
.mbtn .go svg { width: 14px; height: 14px; margin-left: 2px; fill: currentColor; }
.mbtn.cont { grid-template-columns: 42px minmax(0, 1fr); border-color: color-mix(in srgb, var(--fg) 30%, transparent); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; padding: 3px; margin: 0 10px 10px; border-radius: 12px; background: var(--sur3); }
.seg button { min-height: 40px; padding: 0 8px; border: 0; border-radius: 9px; background: transparent; color: var(--mut); font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--sur); color: var(--fg); box-shadow: 0 1px 3px var(--shadow); }
.seg.sm { margin: 0; flex: 1; max-width: 300px; background: var(--sur2); border: 1px solid var(--line); }
.seg.sm button { min-height: 38px; font-size: 13.5px; }
.seg.sm button[aria-pressed="true"] { background: var(--sur3); }
.mn-opts { display: flex; align-items: center; gap: 10px; }
.lnk { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 10px; margin-left: auto; border: 0; border-radius: 12px; background: transparent; color: var(--fg); font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.lnk:hover { background: var(--sur2); }
.mn-opts .lnk { min-width: 0; flex: 0 1 auto; }
.mn-opts .lnk span { overflow: hidden; text-overflow: ellipsis; }
.mn-opts .seg.sm { min-width: 0; }
.seg.sm button { overflow: hidden; text-overflow: ellipsis; }
.mn-acts, .mcard, .mbtn { min-width: 0; }
@media (max-width: 400px) { .mn-opts .lnk span { display: none; } .mn-opts .lnk { padding: 0 13px; border: 1px solid var(--line); } .mn-opts .seg.sm { max-width: none; } } /* tor telefon: «Qanday o'ynaladi» faqat belgi, o'yin uzunligi to'liq yoziladi */
.lnk svg { width: 19px; height: 19px; color: var(--mut); }
.mn-stats { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--mut); border-top: 1px solid var(--line); padding-top: 11px; }
.mn-stats .lbl { font-weight: 650; }
.mn-stats .lbl.r { margin-left: auto; }
.mn-stats .wins { display: flex; gap: 6px; }
.mn-stats .wins span { display: inline-flex; align-items: baseline; gap: 4px; padding: 3px 8px; border-radius: 8px; background: var(--sur2); }
.mn-stats .wins b { color: var(--fg); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.mn-stats .wins small { font-size: 11.5px; }
#menuSponsors:empty, #menuSponsors[hidden] { display: none; }
/* landshaft va kompyuter: karta markazda (tepada — maydon va o'yinchilar ko'rinib tursin) */
body.landscape .mn-body { position: absolute; left: 50%; top: max(70px, calc(env(safe-area-inset-top) + 64px)); transform: translateX(-50%); width: min(440px, calc(100vw - 28px)); margin: 0; border: 1px solid var(--line2); border-radius: 22px; padding: 20px; box-shadow: 0 24px 70px var(--shadow); }
@media (orientation: landscape) and (max-height: 560px) {
  body.landscape .mn-body { top: 50%; transform: translate(-50%, -50%); width: min(760px, calc(100vw - 24px - env(safe-area-inset-left) - env(safe-area-inset-right))); grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); grid-template-rows: auto 1fr auto; column-gap: 18px; row-gap: 8px; padding: 14px 16px; max-height: calc(100vh - 64px); }
  body.landscape .mn-head { grid-column: 1; grid-row: 1; align-self: end; }
  body.landscape .mn-acts { grid-column: 2; grid-row: 1 / span 3; align-self: center; gap: 7px; }
  body.landscape .mn-stats { grid-column: 1; grid-row: 2; align-self: start; border-top: 0; padding-top: 2px; }
  body.landscape #menuSponsors { grid-column: 1; grid-row: 3; margin: 0; }
  body.landscape .mn-head h1 { font-size: 30px; }
  body.landscape .mbtn { min-height: 54px; padding: 7px 12px; }
  body.landscape .seg { margin: 0 10px 8px; } body.landscape .seg button { min-height: 36px; }
  body.landscape .mn-stats .lbl.r { margin-left: 0; width: 100%; }
}
@media (min-width: 900px) and (min-height: 640px) { body.landscape .mn-body { top: max(80px, 11vh); } }
.gu-modal .gu-btn.primary { background: var(--ink); color: var(--ink-t); }
.gu-modal .gu-btn.primary:hover { filter: brightness(1.08); }
.help ol { margin: 0; padding-left: 20px; display: grid; gap: 9px; color: var(--fg); font-size: 15px; line-height: 1.45; }
.help .note { margin: 12px 0 0; font-size: 13.5px; }
.pz p { margin: 0; }
.pz-score { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; color: var(--fg) !important; font-size: 15px; font-weight: 650; }
.pz-score b { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; margin: 0 4px; }
.pz-score .d0, .pz-score .d1 { width: 10px; height: 10px; border-radius: 50%; background: var(--c0); order: -1; }
.pz-score .d1 { background: var(--c1); border-radius: 3px; order: 9; }
.pz-sub { text-align: center; margin-top: 4px !important; font-size: 13px; }
.pz-snd { margin: 6px auto 0 !important; display: flex !important; }
body.portrait .pad small { font-size: 13px; font-weight: 600; opacity: .7; max-width: 160px; }

/* ---------- natija */
#over { position: absolute; inset: 0; display: grid; place-items: center; padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); background: var(--dim); overflow: auto; }
#over[hidden] { display: none; }
.ov { width: min(420px, 100%); display: grid; gap: 14px; padding: 22px 20px 18px; border-radius: 24px; background: var(--sur); border: 1px solid var(--line2); box-shadow: 0 30px 80px var(--shadow); color: var(--fg); position: relative; overflow: hidden; }
.ov::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--c0); }
.ov.w1::before { background: var(--c1); }
.ov-head { text-align: center; }
.ov-k { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mut); }
.ov h2 { margin: 6px 0 0; font-size: 30px; line-height: 1.05; font-weight: 820; letter-spacing: -.03em; }
.ov-score { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto minmax(0, 1fr); align-items: center; gap: 10px; margin-top: 14px; font-variant-numeric: tabular-nums; }
.ov-score span { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 650; color: var(--mut); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-score .t0 { justify-content: flex-end; }
.ov-score span i { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--c0); }
.ov-score .t1 i { background: var(--c1); border-radius: 3px; }
.ov-score b { font-size: 46px; line-height: 1; font-weight: 820; letter-spacing: -.03em; }
.ov-score em { font-style: normal; font-size: 30px; font-weight: 700; color: var(--mut); }
.ov-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ov-stats span { display: grid; gap: 1px; padding: 9px 8px; border-radius: 12px; background: var(--sur2); text-align: center; }
.ov-stats b { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ov-stats small { font-size: 11.5px; color: var(--mut); line-height: 1.2; }
.ov-acts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; }
.ov-acts .pri { grid-column: 1 / -1; }
.ov-acts .btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#ovMenu { grid-column: 1 / span 2; }
.ov-ad:empty { display: none; }
@media (orientation: landscape) and (max-height: 520px) {
  .ov { width: min(720px, 100%); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto 1fr; column-gap: 18px; row-gap: 10px; padding: 18px 18px 14px; }
  .ov-head { grid-column: 1; grid-row: 1 / span 2; align-self: center; }
  .ov-stats { grid-column: 1; grid-row: 3; align-self: end; }
  .ov-acts { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .ov-ad { grid-column: 2; grid-row: 3; align-self: end; }
  .ov h2 { font-size: 26px; } .ov-score b { font-size: 40px; }
}
@media (prefers-reduced-motion: reduce) { #cap b, .hint, #board .sc.pop { animation: none !important; } }
