/* PADEL WORLD - community screens (meta/meta.js). Art pack "Blue Night Arena": tokens and 9-slice sprites from ../style.css
   (.slice.panel / .panelHi / .pill, .sbtn, .ico, .pbar). Portrait first; every touch target >= 48 px. */

/* full-screen overlay above the game panels (z 10), below the bottom nav (z 12) */
.mscreen { position: fixed; inset: 0; z-index: 11; display: none; flex-direction: column; box-sizing: border-box; overflow-y: auto; overscroll-behavior: contain;
  touch-action: pan-y; user-select: text; -webkit-user-select: text;
  background: radial-gradient(ellipse 70% 40% at 50% 20%, rgba(18, 104, 150, .45), transparent 70%), linear-gradient(160deg, #10325f 0%, #0a1f42 45%, #07162F 75%, #0e2a55 100%);
  padding: calc(8px + var(--st)) calc(16px + var(--sr)) calc(96px + var(--sb)) calc(16px + var(--sl)); }
.mscreen.show { display: flex; }
.mhead { position: relative; display: flex; justify-content: center; align-items: center; min-height: 52px; width: min(100%, 520px); margin: 0 auto; }
.mhead .logoImg { width: 170px; }
.mback { position: absolute; left: -6px; top: 2px; width: 48px; height: 48px; border: 0; background: none; cursor: pointer; padding: 0; }
.mback::before { content: ''; position: absolute; left: 19px; top: 16px; width: 14px; height: 14px; border-left: 3px solid var(--white); border-bottom: 3px solid var(--white); transform: rotate(45deg); border-radius: 1px; }
.mback:focus-visible { outline: 2px solid var(--cyan); outline-offset: -4px; border-radius: 12px; }
.mbody { width: min(100%, 520px); margin: 0 auto; display: flex; flex-direction: column; gap: 9px; }
.mbody > .bigTitle { font-size: clamp(34px, 10vw, 54px); margin-bottom: 4px; overflow-wrap: anywhere; }
.msec { font-family: var(--display); font-weight: 700; font-style: italic; font-size: 22px; text-transform: uppercase; margin-top: 12px; }
.msec.danger, .cardTitle.danger { color: var(--coral); }
.mnote { margin: 2px 4px; color: var(--muted); font-size: 14px; line-height: 1.4; }
.mnote.small { font-size: 12px; } .mnote.test { color: var(--gold); font-size: 12px; }
.mtext { margin: 4px 2px 8px; font-size: 15px; line-height: 1.45; }

/* rows (panel_base 9-slice) */
.mrow { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 4px 12px; }
.mrow[role=button], .tcard, .pod[role=button] { cursor: pointer; }
.mrow[role=button]:active, .tcard:active { transform: scale(.985); }
.mrow .lcol { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mrow .lcol b, .mrow .nm { font-family: var(--display); font-weight: 700; font-size: 20px; line-height: 1.05; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mrow small { color: var(--muted); font-size: 12.5px; }
.mrow .rcol { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; text-align: right; white-space: nowrap; }
.mrow .rcol b { font-family: var(--display); font-weight: 600; font-size: 22px; font-variant-numeric: tabular-nums; }
.mrow .rcol b.div { color: var(--cyan); font-weight: 700; font-style: italic; text-transform: uppercase; font-size: 19px; }
.mrow.match .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--muted); }
.mrow.match.won .dot { background: var(--green); } .mrow.match.lost .dot { background: var(--coral); }
.mrow.match.won .lcol b { color: var(--green); } .mrow.match.lost .lcol b { color: var(--coral); }
.mrow.match.won .delta { color: var(--green); } .mrow.match.lost .delta { color: var(--coral); }
.flag { font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; font-style: normal; margin-right: 5px; }
.tbadge { flex: none; display: inline-block; font-family: var(--display); font-style: normal; font-weight: 700; font-size: 11px; letter-spacing: .06em; line-height: 1;
  padding: 3px 6px; border-radius: 6px; color: #1a1405; background: var(--gold); vertical-align: middle; }
.youTag { font-style: normal; font-size: 12px; color: var(--navy); background: var(--cyan); border-radius: 6px; padding: 1px 6px; vertical-align: middle; }

/* profile card (profile_portrait) */
.pcard { padding: 12px 14px 10px; display: flex; flex-direction: column; gap: 8px; }
.pc1 { display: flex; align-items: center; gap: 14px; }
.avatar.big { width: 84px; height: 84px; border-radius: 14px; background-size: 420px auto, auto; background-position: -156px -14px, 0 0; }
.avatar.sm { width: 40px; height: 40px; border-radius: 10px; background-size: 200px auto, auto; background-position: -74px -6px, 0 0; }
.pcinfo { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.pcname { font-family: var(--display); font-weight: 700; font-size: 32px; line-height: 1; overflow-wrap: anywhere; }
.pcsub { color: var(--muted); font-size: 14px; }
.xpbar { height: 10px; } .xprow { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); padding: 14px 6px; text-align: center; }
.stats3 div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.stats3 b { font-family: var(--display); font-weight: 700; font-size: clamp(26px, 8vw, 38px); line-height: 1; font-variant-numeric: tabular-nums; }
.statLink { cursor: pointer; border-radius: 10px; min-height: 48px; justify-content: center; }
.statLink:focus-visible { outline: 2px solid var(--cyan); }
.stats3 small { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.sbtn.btn .ico { width: 20px; height: 20px; }

/* forms */
.mform { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.mlabel { font-size: 13px; color: var(--cyan); text-transform: uppercase; letter-spacing: .04em; margin-top: 4px; }
.mline { display: flex; gap: 8px; align-items: center; }
.mline .minput { flex: 1; min-width: 0; }
.mline > .sbtn { flex: none; min-width: 110px; font-size: 17px; }
.mline.two > .sbtn { flex: 1; }
.minput { box-sizing: border-box; min-height: 48px; width: 100%; padding: 0 12px; border-radius: 12px; border: 1.5px solid rgba(110, 150, 210, .55); background: rgba(4, 14, 34, .7);
  color: var(--white); font: 600 16px var(--body); outline: none; }
.minput:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(24, 217, 255, .2); }
select.minput { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background: rgba(4, 14, 34, .7) linear-gradient(45deg, transparent 50%, var(--cyan) 50%) no-repeat calc(100% - 18px) 21px / 6px 6px; }
select.minput option { background: var(--surface); color: var(--white); }
select.period { margin-top: 2px; }
textarea.minput.area { min-height: 84px; padding: 10px 12px; resize: vertical; font-weight: 400; }
.mhelp { font-size: 13px; color: var(--muted); line-height: 1.35; min-height: 1em; }
.mhelp.ok { color: var(--green); } .mhelp.bad { color: var(--coral); font-weight: 600; }
.mtoggle { display: flex; align-items: center; gap: 12px; min-height: 52px; cursor: pointer; font-size: 15px; }
.mtoggle span { flex: 1; }
.mtoggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mtoggle i { flex: none; position: relative; width: 52px; height: 30px; border-radius: 15px; background: rgba(175, 197, 224, .25); border: 1.5px solid rgba(110, 150, 210, .6); transition: background .15s; }
.mtoggle i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 21px; height: 21px; border-radius: 50%; background: var(--white); transition: transform .15s; }
.mtoggle input:checked + i { background: var(--blue); border-color: var(--cyan); }
.mtoggle input:checked + i::after { transform: translateX(22px); }
.mtoggle input:focus-visible + i { outline: 2px solid var(--cyan); outline-offset: 2px; }
code.pid { flex: 1; min-width: 0; font: 600 13px ui-monospace, Menlo, Consolas, monospace; color: var(--cyan); overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; }
code.pid.sm { font-size: 11.5px; color: var(--muted); }
.dangerBtn { color: var(--coral); }
.sbtn.sm { min-height: 48px; font-size: 15px; padding: 0 4px; }

/* tabs (ranking_portrait pills); the visible pill is 40 px, the hit area 48 px */
.mtabs { display: flex; gap: 8px; }
.mtab { flex: 1; min-height: 48px; padding: 4px 0; border: 0; background: none; cursor: pointer; font-family: var(--display); font-weight: 700; font-size: 17px; text-transform: uppercase;
  color: var(--muted); position: relative; }
.mtab::before { content: ''; position: absolute; inset: 4px 0; border-radius: 20px; border: 1.5px solid rgba(110, 150, 210, .55); background: rgba(16, 41, 77, .7); z-index: -1; }
.mtab { isolation: isolate; }
.mtab.on { color: var(--cyan); } .mtab.on::before { border-color: var(--cyan); background: rgba(8, 120, 249, .22); }
.mtab:focus-visible { outline: 2px solid var(--cyan); outline-offset: -2px; border-radius: 20px; }
.mtabs.small .mtab { font-size: 14px; }

/* podium + rows */
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; align-items: end; margin-top: 4px; }
.pod { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 12px 4px 10px; min-width: 0; position: relative; }
.pod .ico { width: 36px; height: 36px; color: var(--cyan); }
.pod.p1 { order: 1; padding-top: 18px; } .pod.p1 .ico { color: var(--gold); width: 42px; height: 42px; }
.pod.p2 { order: 0; } .pod.p3 { order: 2; }
.pod .rk { font-family: var(--display); font-weight: 700; font-size: 28px; line-height: 1; }
.pod .nm { font-family: var(--display); font-weight: 700; font-size: clamp(13px, 3.7vw, 17px); letter-spacing: -.01em; line-height: 1.05; max-width: 100%; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pod .flag { margin: 0; font-size: 15px; }
.pod small { color: var(--muted); font-size: 12px; } .pod .dv { color: var(--cyan); }
.pod .tbadge { position: absolute; top: 6px; right: 6px; }
.pod.me, .rkrow.me { box-shadow: 0 0 0 2px var(--cyan); border-radius: 14px; }
.rkrow .rk { width: 44px; flex: none; font-family: var(--display); font-weight: 700; font-size: 22px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rkrow .nm { flex: 1; min-width: 0; }
.rkrow.mine { min-height: 64px; } .rkrow.mine .rk { color: var(--cyan); font-style: italic; width: auto; min-width: 60px; }
.rkrow.sm { min-height: 50px; opacity: .85; } .rkrow.sm .nm { font-size: 17px; }
.rkrow.test, .pod.test { background-image: repeating-linear-gradient(135deg, rgba(255, 213, 102, .07) 0 8px, transparent 8px 16px); }
.around { display: flex; flex-direction: column; gap: 6px; }
.gold { color: var(--gold); }

/* person rows, social */
.person .acts { display: flex; gap: 6px; flex: none; } .person .acts .sbtn { min-width: 96px; }
.person.req { flex-wrap: wrap; padding-bottom: 8px; } .person.req .acts { flex: 1 0 100%; } .person.req .acts .sbtn { flex: 1; }
.person .pend { color: var(--gold); white-space: nowrap; }
.chev { width: 10px; height: 10px; border-right: 2.5px solid var(--muted); border-top: 2.5px solid var(--muted); transform: rotate(45deg); margin-right: 6px; flex: none; }

/* tournaments */
.tcard { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.tban { display: flex; align-items: center; gap: 12px; padding: 12px 12px 8px; }
.tban .ico { width: 40px; height: 40px; color: var(--gold); flex: none; }
.tban b { display: block; font-family: var(--display); font-weight: 700; font-style: italic; font-size: 26px; line-height: 1; text-transform: uppercase; }
.tban small { color: var(--cyan); font-size: 13px; letter-spacing: .04em; }
.tmeta { display: flex; gap: 6px 14px; flex-wrap: wrap; padding: 0 12px 10px; color: var(--muted); font-size: 13px; }
.tmeta .tst { font-family: var(--display); font-weight: 700; letter-spacing: .04em; color: var(--muted); }
.st-open .tst { color: var(--green); } .st-InProgress .tst { color: var(--gold); } .st-Cancelled .tst { color: var(--coral); }
.thero { position: relative; display: flex; align-items: flex-end; justify-content: space-between; min-height: 150px; padding: 16px 18px; border-radius: 14px; overflow: hidden;
  background: radial-gradient(ellipse 60% 80% at 85% 30%, rgba(255, 213, 102, .35), transparent 60%), linear-gradient(135deg, #3a1f6e 0%, #7a2f7f 45%, #e0665a 100%);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .12); }
.thero .thTxt b { display: block; font-family: var(--display); font-weight: 700; font-style: italic; font-size: clamp(30px, 9vw, 46px); line-height: .95; text-transform: uppercase; text-shadow: 0 3px 10px rgba(0, 0, 0, .4); }
.thero .thTxt small { font-size: 14px; letter-spacing: .05em; text-transform: uppercase; font-weight: 600; }
.thero.st-open .tst { color: var(--lime); }
.thero > .ico { width: 92px; height: 92px; color: var(--gold); filter: drop-shadow(0 4px 16px rgba(0, 0, 0, .45)); flex: none; }
.regd { gap: 10px; min-height: 56px; } .regd .ico { color: var(--green); } .regd b { font-family: var(--display); font-weight: 700; font-size: 20px; color: var(--green); }
.sbtn.btn.big { min-height: 60px; font-size: 26px; }
.rewards { padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.rwrow { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.rwrow .ico { width: 30px; height: 30px; color: var(--gold); }
.rwrow b { display: block; font-family: var(--display); font-weight: 700; font-size: 19px; text-transform: uppercase; }
.rwrow small { color: var(--muted); font-size: 13px; }
.chipsWrap { display: flex; flex-wrap: wrap; gap: 6px; }
.pchip { padding: 6px 10px; border-radius: 14px; background: rgba(16, 41, 77, .8); border: 1px solid rgba(110, 150, 210, .45); font-size: 14px; }
.pchip.me { border-color: var(--cyan); color: var(--cyan); }
.bracket { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; touch-action: pan-x pan-y; scroll-snap-type: x proximity; }
.bcol { flex: 0 0 min(62%, 220px); display: flex; flex-direction: column; justify-content: space-around; gap: 10px; scroll-snap-align: start; }
.bhead { font-family: var(--display); font-weight: 700; font-size: 15px; color: var(--cyan); text-transform: uppercase; }
.bm { border-radius: 10px; overflow: hidden; border: 1.5px solid rgba(110, 150, 210, .45); background: rgba(16, 41, 77, .85); position: relative; }
.bside { padding: 7px 10px; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bside + .bside { border-top: 1px solid rgba(110, 150, 210, .3); }
.bside.won { font-weight: 700; color: var(--white); background: rgba(86, 236, 162, .14); }
.bside.won::after { content: ' ✓'; color: var(--green); }
.bside.me { color: var(--cyan); } .bside.tbd { color: var(--muted); font-style: italic; }
.bm .bsc { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--muted); background: rgba(7, 22, 47, .85); padding: 1px 5px; border-radius: 6px; }
.bm.st-Ready { border-color: var(--gold); }

/* states */
.mstate { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 22px 14px; }
.mstate > .ico { width: 44px; height: 44px; color: var(--muted); }
.mstate.off > .ico { color: var(--coral); }
.mstate b { font-family: var(--display); font-weight: 700; font-style: italic; font-size: 24px; text-transform: uppercase; }
.mstate p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; max-width: 380px; }
.mstate .sbtn { margin-top: 6px; }
.mspin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(24, 217, 255, .25); border-top-color: var(--cyan); animation: mspin .8s linear infinite; }
@keyframes mspin { to { transform: rotate(360deg); } }

/* modal sheet (z above nav) */
.msheet { position: fixed; inset: 0; z-index: 13; display: none; align-items: flex-end; justify-content: center; background: rgba(4, 12, 30, .7); padding: 12px 12px calc(12px + var(--sb)); }
.msheet.show { display: flex; }
.msheetCard { width: min(480px, 100%); max-height: 88vh; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 8px; user-select: text; -webkit-user-select: text; touch-action: pan-y; }
.cardTitle.sm { font-size: 28px; }
.pshead { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.pshead .pcname { font-size: 28px; }
.sbtn.partner { justify-content: flex-start; font-size: 20px; padding-left: 10px; }
@media (min-width: 700px) and (orientation: landscape) { .msheet { align-items: center; } }

/* toast */
#mToast { position: fixed; left: 50%; bottom: calc(96px + var(--sb)); transform: translate(-50%, 20px); z-index: 14; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  padding: 10px 18px; border-radius: 22px; background: rgba(7, 22, 47, .94); border: 1.5px solid var(--cyan); font-weight: 600; font-size: 15px; max-width: 86vw; text-align: center; }
#mToast.show { opacity: 1; transform: translate(-50%, 0); }
#mToast.bad { border-color: var(--coral); color: #ffd3cd; }

/* home hooks: the profile header opens the profile */
.profile.metaLink { cursor: pointer; border-radius: 14px; min-height: 52px; }
.profile.metaLink:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.pname .flag { font-size: .8em; }

/* landscape: two columns where it helps, nav is narrower */
@media (orientation: landscape) and (min-width: 820px) {
  .mbody { width: min(100%, 760px); }
  .podium { gap: 14px; }
}
@media (max-height: 540px) and (orientation: landscape) {
  .mscreen { padding-bottom: calc(76px + var(--sb)); }
  .mhead { min-height: 48px; } .mhead .logoImg { width: 130px; }
  .mbody > .bigTitle { font-size: 34px; }
  .thero { min-height: 104px; } .thero > .ico { width: 64px; height: 64px; }
}
