/* Paintout Arena — screens around the fight, after the approved mockups (Арт/Экраны/1…5): the night city behind,
   dark panels with paint, sign-plate buttons (the main one pink with drips), paint name tags, the graffiti logo.
   System fonts only, no image files except the hero pictures. Made for a phone held sideways (740×340 … 932×430). */
:root {
  --bg: #0a0820;
  --panel: #161a35;
  --line: #2b3566;
  --text: #f4f2ff;
  --muted: #a9b0d8;
  --blue: #2fa8ff;
  --cyan: #2fd0ff;
  --pink: #ff3fa4;
  --yellow: #ffe14d;
  --green: #3ee38a;
  --ink: #0b0b14;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  /* brush shapes, used as masks (the colour comes from the element) */
  --brush: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 60' preserveAspectRatio='none'><path d='M8 14 L30 5 L60 10 L95 3 L130 9 L165 4 L193 12 L186 24 L199 34 L188 47 L160 53 L120 49 L85 57 L50 51 L20 55 L5 45 L12 32 L1 21 Z'/><circle cx='196' cy='8' r='4'/><circle cx='4' cy='56' r='3'/></svg>");
  --drips: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 22' preserveAspectRatio='none'><path d='M0 0H100V4Q92 4 91 9Q90 17 88 9Q86 4 70 4Q66 4 65 15Q64 21 62 15Q61 4 40 4Q36 4 35 11Q34 16 32 11Q31 4 14 4Q10 4 9 18Q8 22 6 18Q5 4 0 4Z'/></svg>");
  --splat: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='-36 -36 72 72'><path d='M0-30c5 0 6 8 11 9s9-6 13-2-3 9 0 13 10 4 9 9-9 4-10 9 4 10-1 13-9-3-13 0-4 9-9 9-5-8-9-10-10 4-13-1 3-9 0-13-10-5-9-10 9-4 10-9-4-10 1-13 9 3 13 0 3-14 8-14z'/><circle cx='30' cy='-28' r='4'/><circle cx='-31' cy='26' r='3'/></svg>");
  font-family: var(--font);
}
html { background: var(--bg); }
body { background: transparent; } /* the city layer (z-index -1) shows through */

/* the night city (scenery.js mountCity) */
.po-city { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.po-city svg { width: 100%; height: 100%; display: block; }

/* the core's sign-in / loading screens, in this game's colours */
.brand-robots { display: none; }
.brand h1 { font-size: 30px; font-weight: 900; font-style: italic; letter-spacing: 1px; color: var(--yellow); text-shadow: 3px 3px 0 var(--pink); }
.btn.primary { background: var(--pink); border-color: var(--pink); color: #fff; }
.screen { padding-top: calc(14px + var(--safe-t)); padding-bottom: calc(14px + var(--safe-b)); }

/* ---------------------------------------------------------------- shared pieces */
.po-screen {
  position: fixed; inset: 0;
  padding: calc(8px + var(--safe-t)) calc(14px + var(--safe-r)) calc(8px + var(--safe-b)) calc(14px + var(--safe-l));
  display: flex; flex-direction: column; gap: 8px; overflow: hidden; color: var(--text);
}
.po-screen h2 { margin: 0; }
[hidden] { display: none !important; }
.po-row { display: flex; gap: 8px; align-items: center; min-width: 0; }
.po-note { color: var(--muted); font-size: 13px; line-height: 1.3; }
.po-note.warn { color: var(--yellow); font-weight: 700; text-shadow: 0 1px 2px #000; }
.po-link { background: none; border: 0; color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; padding: 4px; cursor: pointer; text-shadow: 0 1px 2px #000; }
.po-field { min-height: 38px; border-radius: 10px; border: 3px solid var(--line); background: #0b0e22; color: var(--text); padding: 0 10px; font: 800 18px var(--font); -webkit-user-select: text; user-select: text; }
.po-field.code { width: 104px; text-transform: uppercase; letter-spacing: 4px; text-align: center; }
.po-icon { width: 40px; height: 40px; border-radius: 12px; border: 3px solid var(--line); background: #11152b; color: var(--text); display: grid; place-items: center; padding: 0; flex-shrink: 0; cursor: pointer; }
.po-role { display: inline-flex; align-items: center; gap: 5px; color: var(--yellow); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.4px; }
.po-wicon { display: inline-grid; color: var(--hc, var(--yellow)); flex-shrink: 0; }
.po-wicon svg { width: 16px; height: 16px; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

/* simple buttons (the settings sheet, messages) */
.po-btn { min-height: 42px; padding: 0 16px; border-radius: 12px; border: 3px solid var(--line); background: #1b2140; color: var(--text); font: 800 15px/1.1 var(--font); display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; }
.po-btn.pink { background: linear-gradient(#ff5cbc, #e01f86); border-color: var(--ink); color: #fff; }
.po-btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; }
.po-chip { min-height: 36px; padding: 2px 10px; border-radius: 10px; border: 2px solid var(--line); background: #0b0e22; color: var(--text); font: 800 14px/1.1 var(--font); cursor: pointer; }
.po-chip.on { border-color: var(--cyan); background: #2fd0ff2a; box-shadow: 0 0 10px #2fd0ff66; }

/* sign-plate buttons */
.po-plate {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; min-width: 0;
  border-radius: 12px; border: 3px solid var(--ink); color: #fff; cursor: pointer; white-space: nowrap;
  font: 900 15px/1 var(--font); letter-spacing: 0.4px; text-transform: uppercase; text-shadow: 0 2px 0 var(--ink);
  background: linear-gradient(#232a52, #141936);
  box-shadow: inset 0 0 0 2px #3a4580, inset 0 2px 0 2px #ffffff22, 0 3px 0 #000a;
}
.po-plate .txt { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.po-plate .ico { display: inline-grid; place-items: center; flex-shrink: 0; }
.po-plate:active:not(:disabled) { translate: 0 2px; box-shadow: inset 0 0 0 2px #3a4580, 0 1px 0 #000a; }
.po-plate:disabled { opacity: 0.45; cursor: default; }
.po-plate.blue { background: linear-gradient(#45d4ff, #1890e6); box-shadow: inset 0 0 0 2px #8be6ff, inset 0 3px 0 2px #ffffff44, 0 3px 0 #000a, 0 0 14px #2fd0ff55; }
.po-plate.pink { background: linear-gradient(#ff63c0, #e01f86); box-shadow: inset 0 0 0 2px #ff9fd6, inset 0 3px 0 2px #ffffff44, 0 3px 0 #000a, 0 0 18px #ff3fa466; }
/* rivets */
.po-plate.pink, .po-plate.big {
  background-image: radial-gradient(circle at 10px 10px, #fff9 2.5px, #0006 3.2px, transparent 3.6px), radial-gradient(circle at calc(100% - 10px) 10px, #fff9 2.5px, #0006 3.2px, transparent 3.6px),
    radial-gradient(circle at 10px calc(100% - 10px), #fff9 2.5px, #0006 3.2px, transparent 3.6px), radial-gradient(circle at calc(100% - 10px) calc(100% - 10px), #fff9 2.5px, #0006 3.2px, transparent 3.6px),
    linear-gradient(#ff63c0, #e01f86);
}
/* the main pink plate: paint drips under it, a splash behind */
.po-plate.pink::after { content: ''; position: absolute; left: 10%; right: 12%; top: calc(100% - 1px); height: 13px; background: #e01f86; -webkit-mask: var(--drips) center / 100% 100% no-repeat; mask: var(--drips) center / 100% 100% no-repeat; pointer-events: none; }
.po-plate.pink.big::before { content: ''; position: absolute; inset: -12px -22px -8px; z-index: -1; background: var(--pink); opacity: 0.85; -webkit-mask: var(--brush) center / 100% 100% no-repeat; mask: var(--brush) center / 100% 100% no-repeat; pointer-events: none; }
.po-plate.big { min-height: 56px; padding: 0 30px; font-size: 30px; font-style: italic; letter-spacing: 2px; border-radius: 14px; -webkit-text-stroke: 1px var(--ink); }
.po-plate.big .ico svg { width: 0.85em; height: 0.85em; }
.po-plate.small { min-height: 38px; padding: 0 11px; font-size: 13px; border-radius: 10px; }
.po-plate.square { width: 40px; padding: 0; }
.po-plate.on { box-shadow: inset 0 0 0 2px #fff, 0 0 0 3px var(--cyan), 0 0 18px var(--cyan); }

/* dark panels with paint */
.po-box {
  position: relative; border-radius: 16px; border: 3px solid var(--line);
  background: linear-gradient(160deg, #1b2042f2, #0f1228f5);
  box-shadow: inset 0 0 0 2px #0b0b14, 0 8px 22px #0009;
}
.po-box::before { content: ''; position: absolute; top: -6px; right: 22px; width: 64px; height: 20px; background: var(--cyan); opacity: 0.85; -webkit-mask: var(--drips) center / 100% 100% no-repeat; mask: var(--drips) center / 100% 100% no-repeat; pointer-events: none; }
.po-box::after { content: ''; position: absolute; bottom: -10px; left: -10px; width: 34px; height: 34px; background: var(--pink); opacity: 0.8; -webkit-mask: var(--splat) center / contain no-repeat; mask: var(--splat) center / contain no-repeat; pointer-events: none; }

/* paint name tags */
.po-ntag { position: relative; isolation: isolate; display: inline-block; padding: 2px 13px 3px; color: #0b0b14; font: 900 italic 15px/1.1 var(--font); white-space: nowrap; rotate: -3deg; max-width: 100%; overflow: visible; text-overflow: ellipsis; }
.po-ntag::before { content: ''; position: absolute; inset: -2px -4px; z-index: -1; background: var(--tag, var(--pink)); -webkit-mask: var(--brush) center / 100% 100% no-repeat; mask: var(--brush) center / 100% 100% no-repeat; }
.po-ntag.big { font-size: 24px; padding: 3px 18px 5px; }
.po-ntag.small { font-size: 11.5px; padding: 1px 9px 2px; }

/* segmented choices */
.po-seg { display: flex; gap: 3px; padding: 3px; border-radius: 12px; background: #0a0d20; border: 2px solid var(--line); min-width: 0; }
.po-seg-btn { flex: 1 1 0; min-width: 0; min-height: 36px; padding: 0 8px; border: 0; border-radius: 9px; background: transparent; color: #cfd6ff; font: 800 15px/1.1 var(--font); display: flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; }
.po-seg-btn .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.po-seg-btn .ico { display: inline-grid; flex-shrink: 0; }
.po-seg-btn.on { background: linear-gradient(#6fe6ff, #1fb2ef); color: #04121f; box-shadow: 0 0 12px #2fd0ff88, inset 0 2px 0 #fff8; }
.po-seg-btn:disabled { opacity: 0.4; cursor: default; }
.po-seg-btn.on:disabled { opacity: 0.8; }
.po-seg.sizes .po-seg-btn { font-size: 19px; font-weight: 900; }
.po-seg.small .po-seg-btn { min-height: 30px; font-size: 12.5px; padding: 0 6px; }
.po-seg-label { display: flex; align-items: center; gap: 6px; color: #fff; font-size: 14px; font-weight: 800; white-space: nowrap; }
.po-seg-label i { display: inline-grid; }

/* ---------------------------------------------------------------- logo */
.po-logo { --lw: clamp(160px, 46vh, 240px); position: relative; display: inline-flex; flex-direction: column; align-items: center; width: var(--lw); rotate: -5deg; flex-shrink: 0; pointer-events: none; }
.po-logo.small { --lw: clamp(96px, 30vh, 128px); }
.po-logo-bg { position: absolute; inset: -16% -6% -26%; }
.po-logo-bg svg { width: 100%; height: 100%; display: block; }
.po-logo-word { position: relative; display: flex; align-items: center; font: 900 italic calc(var(--lw) * 0.205) / 1 var(--font); letter-spacing: -0.5px; }
.po-logo-word b { color: var(--yellow); -webkit-text-stroke: calc(var(--lw) * 0.014) var(--ink); paint-order: stroke fill; text-shadow: calc(var(--lw) * 0.012) calc(var(--lw) * 0.014) 0 var(--pink), calc(var(--lw) * 0.022) calc(var(--lw) * 0.026) 0 var(--ink); }
.po-logo-word b.c { text-shadow: calc(var(--lw) * 0.012) calc(var(--lw) * 0.014) 0 var(--cyan), calc(var(--lw) * 0.022) calc(var(--lw) * 0.026) 0 var(--ink); }
.po-logo-o { width: 1.02em; height: 1.02em; display: inline-grid; margin: 0 0.02em; translate: 0 0.06em; }
.po-logo-o svg { width: 100%; height: 100%; }
.po-logo-arena { position: relative; margin-top: 1px; padding: 1px 0.6em 2px; background: var(--ink); color: #fff; font: 900 italic calc(var(--lw) * 0.09) / 1.1 var(--font); letter-spacing: 0.25em; border-radius: 6px; rotate: -2deg; border-bottom: 3px solid var(--yellow); }

/* top bar of the inner screens: back + small logo | title plate | actions */
.po-bar-top { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; min-height: 46px; flex-shrink: 0; }
.po-bar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.po-bar-right { justify-self: end; display: flex; gap: 6px; min-width: 0; }
.po-title-plate { position: relative; padding: 5px 26px; border-radius: 12px; border: 3px solid var(--line); background: linear-gradient(#1d2348, #11152e); box-shadow: inset 0 0 0 2px var(--ink), 0 4px 0 #0008; min-width: 0; max-width: 52vw; }
.po-title-plate::before, .po-title-plate::after { content: ''; position: absolute; top: -8px; width: 34px; height: 34px; opacity: 0.9; -webkit-mask: var(--splat) center / contain no-repeat; mask: var(--splat) center / contain no-repeat; pointer-events: none; }
.po-title-plate::before { left: -12px; background: var(--cyan); }
.po-title-plate::after { right: -12px; background: var(--pink); }
.po-title-plate h2 { position: relative; z-index: 1; font: 900 21px/1.15 var(--font); text-transform: uppercase; letter-spacing: 0.5px; color: #fff; text-shadow: 0 2px 0 var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* the glowing ring under a big hero */
.po-ring { position: absolute; left: 50%; bottom: 10px; width: 64%; height: 16%; translate: -50% 0; border-radius: 50%; border: 4px solid var(--cyan); box-shadow: 0 0 18px var(--cyan), inset 0 0 14px #2fd0ff99; pointer-events: none; }
.po-pic { display: block; user-select: none; -webkit-user-drag: none; }
.po-pic.full { position: relative; height: 100%; width: auto; max-width: 100%; object-fit: contain; object-position: 50% 100%; filter: drop-shadow(0 6px 10px #000c); }
.po-pic.head { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.po-pic-svg svg { width: 100%; height: 100%; }

/* ---------------------------------------------------------------- main menu */
.po-menu { display: grid; grid-template-columns: minmax(0, 480px) minmax(0, 1fr); gap: 0 14px; }
.po-menu-left { display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 10px; min-height: 0; min-width: 0; }
.po-menu-left .po-logo { align-self: center; margin: 4px 0 2px; }
.po-mode-panel { display: flex; flex-direction: column; gap: 6px; padding: 8px 14px 12px; }
.po-box-title { font: 900 21px/1.1 var(--font); text-transform: uppercase; color: #fff; text-shadow: 0 2px 0 var(--ink); letter-spacing: 0.4px; }
.po-play { align-self: center; width: 82%; margin-bottom: 10px; }
.po-menu-right { position: relative; display: flex; flex-direction: column; align-items: stretch; min-height: 0; min-width: 0; }
.po-top-btns { display: flex; gap: 6px; justify-content: flex-end; flex-shrink: 0; position: relative; z-index: 2; }
.po-top-btns .po-plate.small { max-width: 34vw; }
.po-menu-hero { position: relative; flex: 1; min-height: 0; width: 100%; display: flex; align-items: flex-end; justify-content: center; padding: 0 0 4px; border: 0; background: none; cursor: pointer; }
.po-menu-hero .po-ring { bottom: 2px; width: 58%; height: 14%; }
.po-menu-hero-tag { position: absolute; right: 2%; bottom: 8%; z-index: 2; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.po-menu-hero-tag small { font-size: 11px; color: #fff; padding: 1px 7px; border-radius: 8px; background: #0b0b14cc; }
.po-code { display: flex; align-items: center; justify-content: flex-end; min-height: 26px; flex-shrink: 0; }
.po-code-row { display: flex; gap: 6px; }
.po-menu-right > .po-note { text-align: right; flex-shrink: 0; }

/* ---------------------------------------------------------------- hero choice */
.po-heroes-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 25%) minmax(0, 1fr); gap: 12px; }
.po-hero-figure { position: relative; display: flex; align-items: flex-end; justify-content: center; min-height: 0; padding-bottom: 4px; }
.po-heroes-main { display: flex; flex-direction: column; gap: 8px; min-height: 0; min-width: 0; }
.po-htiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; height: clamp(74px, 24vh, 112px); flex-shrink: 0; }
.po-htile { position: relative; min-width: 0; padding: 0; border-radius: 12px; border: 3px solid var(--line); overflow: hidden; cursor: pointer; background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--hc) 55%, transparent), #12162e 72%); box-shadow: inset 0 0 0 2px var(--ink); }
.po-htile .po-pic.head { position: absolute; inset: 0; }
.po-htile .po-ntag { position: absolute; left: 50%; bottom: 3px; translate: -50% 0; max-width: 96%; }
.po-htile.on { border-color: #6fe6ff; box-shadow: 0 0 0 2px var(--cyan), 0 0 16px #2fd0ffaa; }
.po-heroes-low { flex: 1; min-height: 0; display: flex; gap: 14px; align-items: flex-end; }
.po-detail-wrap { flex: 1; min-width: 0; min-height: 0; align-self: stretch; display: flex; }
.po-detail { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 8px 12px 10px; overflow: hidden; }
.po-detail-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 1px; }
.po-line { display: flex; gap: 6px; align-items: baseline; font-size: 13px; line-height: 1.25; padding: 3px 8px; border-radius: 8px; background: #0a0d20cc; border: 1px solid var(--line); }
.po-line b { font-weight: 900; flex-shrink: 0; }
.po-line b.c { color: var(--cyan); }
.po-line b.p { color: var(--pink); }
.po-line strong { color: var(--yellow); }
.po-stat { display: grid; grid-template-columns: minmax(64px, auto) clamp(60px, 12vw, 120px) minmax(0, 1fr); align-items: center; gap: 8px; font-size: 13px; }
.po-stat b { font-weight: 900; }
.po-stat.plus b { color: var(--yellow); }
.po-stat.minus b { color: #ff7cc8; }
.po-meter { height: 10px; border-radius: 6px; background: #0a0d20; border: 1px solid var(--line); overflow: hidden; }
.po-meter span { display: block; height: 100%; background: linear-gradient(90deg, #1fb2ef, #6fe6ff); }
.po-stat.minus .po-meter span { background: linear-gradient(90deg, #e01f86, #ff7cc8); }
.po-stat-txt { line-height: 1.2; }
.po-stats4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px 12px; margin-top: 4px; padding-top: 8px; border-top: 1px dashed var(--line); }
.po-s4 { display: grid; gap: 4px; font-size: 12px; font-weight: 800; color: #c9cbe6; min-width: 0; }
.po-s4 span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.po-s4 .po-meter span { background: linear-gradient(90deg, var(--yellow), #ffe98a); }
.po-ready { flex-shrink: 0; margin-bottom: 12px; }

/* ---------------------------------------------------------------- arena choice */
.po-acards { flex: 1; min-height: 0; display: flex; gap: 10px; align-items: center; padding: 0 4px; }
.po-acard { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 5px 5px 8px; border-radius: 14px; border: 3px solid var(--line); background: linear-gradient(#1b2042, #10132a); color: #fff; cursor: pointer; box-shadow: inset 0 0 0 2px var(--ink), 0 6px 14px #0008; transition: scale 0.12s; }
.po-acard-map { display: block; }
.po-acard-map svg { width: 100%; height: auto; display: block; border-radius: 8px; }
.po-acard-name { font: 800 14px/1.15 var(--font); text-align: center; min-height: 2.3em; display: flex; align-items: center; justify-content: center; text-shadow: 0 2px 0 var(--ink); }
.po-badge { display: none; }
.po-acard.on { border-color: #6fe6ff; scale: 1.06; z-index: 1; box-shadow: 0 0 0 2px var(--cyan), 0 0 20px #2fd0ffaa; }
.po-acard.on .po-badge { display: block; position: absolute; left: 50%; bottom: -11px; translate: -50% 0; padding: 2px 10px; border-radius: 8px; border: 2px solid var(--ink); background: var(--cyan); color: #04121f; font: 900 11px/1.2 var(--font); text-transform: uppercase; white-space: nowrap; }
.po-arena-foot { display: flex; align-items: center; justify-content: center; gap: 22px; padding-bottom: 12px; flex-shrink: 0; }
.po-random { min-height: 48px; font-size: 18px; }

/* ---------------------------------------------------------------- team lobby */
.po-teams { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 62px minmax(0, 1fr); gap: 6px; }
.po-team { display: flex; flex-direction: column; gap: 5px; padding: 6px 8px 8px; min-height: 0; min-width: 0; }
.po-team.t0 { --tc: #2fa8ff; border-color: #2fa8ff; }
.po-team.t1 { --tc: #ff3fa4; border-color: #ff3fa4; }
.po-team.t1::before { background: var(--pink); }
.po-team.t1::after { background: var(--cyan); left: auto; right: -10px; }
.po-team-title { margin: 0; display: flex; align-items: center; justify-content: center; gap: 6px; font: 900 italic 17px/1.1 var(--font); text-transform: uppercase; color: var(--tc); text-shadow: 0 2px 0 var(--ink); flex-shrink: 0; }
.po-team-title .ico { display: inline-grid; }
.po-slot { flex: 1 1 0; min-height: 0; max-height: 78px; display: flex; align-items: center; gap: 10px; padding: 3px 10px 3px 3px; border-radius: 12px; border: 2px solid color-mix(in srgb, var(--tc) 55%, transparent); background: #0a0d20d9; overflow: hidden; }
.po-slot-pic { position: relative; flex: 0 0 auto; align-self: stretch; aspect-ratio: 1; border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--tc) 70%, transparent), transparent 72%); }
.po-slot-text { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.po-slot-name { font: 800 16px/1.15 var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.po-slot-sub { display: flex; align-items: center; gap: 8px; min-width: 0; }
.po-slot-sub small, .po-slot-text > small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.po-slot.me { box-shadow: 0 0 0 2px var(--tc), 0 0 12px color-mix(in srgb, var(--tc) 70%, transparent); }
.po-slot.off { opacity: 0.55; }
.po-slot.empty { border-style: dashed; background: #0a0d2099; }
.po-slot.empty .po-slot-pic { background: #1a2046; color: #4a5590; border: 2px dashed #4a5590; }
.po-slot.empty .po-slot-pic svg { width: 60%; height: 60%; }
.po-slot-invite { display: flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: #fff; font: 800 15px/1.1 var(--font); cursor: pointer; text-align: left; }
.po-slot-invite b { color: var(--tc); font-size: 22px; line-height: 0.8; }
.po-vs { position: relative; display: grid; place-items: center; align-self: center; }
.po-vs > svg { display: block; }
.po-vs b { position: absolute; font: 900 italic 22px/1 var(--font); color: #fff; -webkit-text-stroke: 1px var(--ink); text-shadow: 0 2px 0 var(--ink); }
.po-vs small { position: absolute; top: 100%; font-size: 11px; font-weight: 800; color: var(--yellow); white-space: nowrap; text-shadow: 0 1px 2px #000; }
.po-lobby-foot { display: flex; align-items: center; gap: 6px; padding: 5px 8px; flex-shrink: 0; }
.po-lobby-foot::before, .po-lobby-foot::after { display: none; }
.po-lobby-foot .po-seg { flex: 0 1 auto; }
.po-lobby-foot .po-seg-label { font-size: 12px; color: var(--muted); text-transform: uppercase; }
.po-mini-hero .ico:empty { display: none; }
.po-lobby-foot .po-plate { text-transform: none; letter-spacing: 0; }
.po-lobby-foot .po-seg-btn { flex: 0 0 auto; }
.po-arena-btn { max-width: 190px; white-space: normal; line-height: 1.05; text-align: left; }
.po-arena-btn .txt { overflow: visible; }
.po-mini-hero .ico img { width: 26px; height: 26px; border-radius: 6px; object-fit: cover; display: block; }
.po-start { flex-shrink: 0; margin-left: auto; min-height: 42px; font-size: 18px; font-style: italic; }
.po-start::after { display: none; }
.po-lobby-foot .po-note { margin-left: auto; font-size: 12px; text-align: right; }
/* a hero a teammate has: grey, «taken», not to be chosen */
.po-htile.taken { cursor: not-allowed; border-color: #3a4166; }
.po-htile.taken .po-pic, .po-htile.taken .po-ntag { filter: grayscale(1) brightness(0.55); }
.po-taken { position: absolute; left: 50%; top: 42%; translate: -50% -50%; rotate: -8deg; padding: 2px 6px; border-radius: 7px; border: 2px solid var(--ink); background: #e8ecff; color: #11152e; font: 900 11px/1.15 var(--font); text-transform: uppercase; white-space: nowrap; max-width: 96%; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 2px 0 #0008; }
/* how people are split (host): friend vs friend | together vs bots */
.po-format { display: flex; align-items: center; justify-content: center; gap: 10px; flex-shrink: 0; min-width: 0; }
.po-format .po-seg { flex: 0 1 auto; }
.po-format .po-seg-btn { flex: 0 1 auto; }
.po-format .po-seg-btn .ico svg { width: 17px; height: 17px; }
.po-format-hint { font-size: 11.5px; font-weight: 700; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.po-slot.po-botseat { border-style: solid; background: #0a0d20b3; }
.po-slot.po-botseat .po-slot-pic { background: #2a1030; color: #ff7cc4; border: 2px solid #ff3fa466; }
.po-slot.po-botseat .po-slot-pic svg { width: 62%; height: 62%; }

/* ---------------------------------------------------------------- result */
.po-result { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 6px; }
.po-res-head { position: relative; display: flex; align-items: center; justify-content: center; gap: 16px; min-height: 52px; }
.po-res-head .po-logo { position: absolute; left: 0; top: 50%; translate: 0 -50%; }
.po-res-title { position: relative; isolation: isolate; margin: 0; font: 900 italic min(12vh, 6.2vw, 56px) / 1.1 var(--font); letter-spacing: 1px; rotate: -2deg; white-space: nowrap; -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; }
.po-res-title::before { content: ''; position: absolute; inset: -18% -12%; z-index: -1; background: var(--cyan); opacity: 0.75; -webkit-mask: var(--brush) center / 100% 100% no-repeat; mask: var(--brush) center / 100% 100% no-repeat; }
.po-result.win .po-res-title { color: var(--yellow); text-shadow: 0 4px 0 var(--ink), 0 0 26px #ffe14d88; }
.po-result.lose .po-res-title { color: #fff; text-shadow: 0 4px 0 var(--ink); }
.po-result.lose .po-res-title::before { background: var(--pink); }
.po-result.draw .po-res-title { color: #fff; text-shadow: 0 4px 0 var(--ink); }
.po-result.draw .po-res-title::before { background: #8a8fb0; }
.po-res-score { display: flex; gap: 2px; }
.po-res-table-wrap { width: min(860px, 100%); justify-self: center; min-height: 0; overflow: auto; padding: 2px 8px 4px; }
.po-res-table-wrap::before, .po-res-table-wrap::after { display: none; }
.po-res-table { width: 100%; border-collapse: separate; border-spacing: 0 4px; table-layout: fixed; font-size: 15px; }
.po-res-table th { position: sticky; top: 0; z-index: 1; padding: 4px 8px 2px; background: #141936; color: #fff; font: 800 11px/1.2 var(--font); text-transform: uppercase; letter-spacing: 0.4px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.po-res-table th:nth-child(1) { width: 32%; }
.po-res-table th:nth-child(2) { width: 25%; }
.po-res-table .n { text-align: right; font-variant-numeric: tabular-nums; }
.po-res-table td { height: 30px; padding: 0 8px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.po-res-table tr.t0 td { background: linear-gradient(90deg, #1b5a9ae0, #142350e0); }
.po-res-table tr.t1 td { background: linear-gradient(90deg, #8a1f63e0, #2a1238e0); }
.po-res-table tr td:first-child { border-radius: 8px 0 0 8px; box-shadow: inset 5px 0 0 var(--blue); }
.po-res-table tr.t1 td:first-child { box-shadow: inset 5px 0 0 var(--pink); }
.po-res-table tr td:last-child { border-radius: 0 8px 8px 0; }
.po-res-table tr.mvp td { box-shadow: inset 0 2px 0 var(--cyan), inset 0 -2px 0 var(--cyan); }
.po-res-table tr.mvp td:first-child { box-shadow: inset 5px 0 0 var(--blue), inset 0 2px 0 var(--cyan), inset 0 -2px 0 var(--cyan); }
.po-res-table tr.t1.mvp td:first-child { box-shadow: inset 5px 0 0 var(--pink), inset 0 2px 0 var(--cyan), inset 0 -2px 0 var(--cyan); }
.po-res-table tr.mvp .n { color: #8be9ff; }
.po-res-table tr.me .nm { text-decoration: underline; text-decoration-color: var(--yellow); text-underline-offset: 3px; }
.po-res-player, .po-res-hero { overflow: hidden; }
.po-res-player > *, .po-res-hero > * { vertical-align: middle; }
.po-res-player .nm, .po-res-hero .nm { display: inline-block; max-width: calc(100% - 40px); overflow: hidden; text-overflow: ellipsis; }
.po-mvp { display: inline-flex; align-items: center; gap: 2px; margin-right: 6px; padding: 0 5px; border-radius: 7px; background: #ffe14d; color: var(--ink); font-size: 10px; }
.po-mvp svg { width: 13px; height: 13px; }
.po-res-pic { display: inline-block; width: 34px; height: 26px; margin-right: 6px; border-radius: 6px; overflow: hidden; background: #0006; }
.po-res-actions { display: flex; gap: 10px; justify-content: center; padding-bottom: 10px; min-width: 0; }
.po-res-actions .po-plate { flex: 1 1 0; max-width: 230px; white-space: normal; line-height: 1.05; text-align: center; }
.po-res-actions .po-plate .txt { overflow: visible; }
.po-res-actions .po-rematch { flex-grow: 1.3; max-width: 280px; font-size: 18px; }
.po-res-side { display: none; position: fixed; bottom: 4px; height: 62vh; width: 17vw; z-index: 0; pointer-events: none; opacity: 0.95; }
.po-res-side.l { left: 0; }
.po-res-side.r { right: 0; }
.po-res-side .po-pic.full { height: 100%; margin: 0 auto; }
@media (min-width: 1100px) { .po-res-side { display: block; } }

/* ---------------------------------------------------------------- message */
.po-msg { align-items: center; justify-content: center; text-align: center; gap: 16px; }

/* ---------------------------------------------------------------- settings strip (settings.js openSettings) */
.po-modal { position: fixed; inset: 0; z-index: 50; background: #05050ccc; display: flex; align-items: center; justify-content: center; padding: calc(6px + var(--safe-t)) calc(10px + var(--safe-r)) calc(6px + var(--safe-b)) calc(10px + var(--safe-l)); color: var(--text); font-family: var(--font); }
.po-drawer { position: fixed; inset: 0; z-index: 50; display: flex; justify-content: flex-end; background: #05050c8c; color: var(--text); font-family: var(--font); }
.po-drawer.battle { background: #05060c59; }
.po-strip { width: clamp(300px, 42vw, 430px); max-width: 100%; height: 100%; display: flex; flex-direction: column; min-height: 0;
  background: linear-gradient(170deg, #1b2042 0, #10132a 70%); border-left: 3px solid var(--line); box-shadow: -10px 0 30px #000a, inset 2px 0 0 var(--ink);
  padding: var(--safe-t) var(--safe-r) var(--safe-b) 0; animation: po-slide 0.18s ease-out; }
.po-drawer.still .po-strip { animation: none; }
@keyframes po-slide { from { transform: translateX(100%); } }
.po-strip-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px 6px 14px; border-bottom: 2px solid var(--line); flex: 0 0 auto; }
.po-strip-head h2 { font-size: 18px; font-weight: 900; text-transform: uppercase; margin: 0; min-width: 0; }
.po-strip-head .po-btn { min-height: 36px; white-space: nowrap; }
.po-set-x { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--line); background: #0b0e22; color: var(--text); font: 900 17px/1 var(--font); cursor: pointer; flex: 0 0 auto; }
.po-strip-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 2px 12px 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.po-set-sec { display: flex; flex-direction: column; gap: 1px; min-width: 0; padding-bottom: 4px; border-bottom: 1px solid #ffffff10; }
.po-set-sec:last-child { border-bottom: 0; }
.po-set-sec h3 { margin: 6px 0 1px; font-size: 12px; color: var(--yellow); font-weight: 900; text-transform: uppercase; letter-spacing: 0.8px; }
.po-set-sub { font-size: 12px; color: var(--muted); font-weight: 800; margin: 4px 0 2px; }
.po-set-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 38px; cursor: pointer; }
.po-set-label { font-size: 14px; font-weight: 700; display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.po-set-label small { font-size: 11px; color: var(--muted); font-weight: 500; }
.po-set-row.slider { display: grid; grid-template-columns: minmax(0, 1fr) clamp(96px, 14vw, 150px) 38px; }
.po-set-row.slider .po-set-label { font-size: 13px; }
.po-set-row output { font-size: 12px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.po-set-row input[type='range'] { width: 100%; accent-color: var(--pink); }
.po-set-btn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 46px; margin: 3px 0; padding: 4px 10px; border-radius: 12px;
  border: 2px solid var(--cyan); background: #2fd0ff1c; color: var(--text); text-align: left; cursor: pointer; font-family: var(--font); }
.po-set-btn .ico { font-size: 20px; line-height: 1; color: var(--cyan); flex: 0 0 auto; }
.po-set-sec .po-link { align-self: flex-start; }
.po-set-level { display: flex; flex-direction: column; gap: 4px; padding: 4px 0; }
.po-set-level.off .po-levels { opacity: 0.5; }
.po-levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.po-levels .po-chip { min-height: 34px; font-size: 13px; padding: 2px 4px; }
.po-levels .po-chip:disabled { cursor: not-allowed; }
.po-btn.danger { background: #3a1020; border-color: #ff4d6d; color: #fff; }
.po-set-leave { align-self: stretch; margin: 4px 0; }
.po-set-ask { display: flex; flex-direction: column; gap: 6px; padding: 6px 0; }
.po-set-ask[hidden] { display: none; }
.po-set-ask b { font-size: 15px; }
.po-set-ask-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.po-switch { appearance: none; -webkit-appearance: none; width: 46px; height: 26px; border-radius: 13px; background: #34344c; position: relative; flex-shrink: 0; cursor: pointer; transition: background 0.15s; margin: 0; }
.po-switch::after { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.po-switch:checked { background: var(--pink); }
.po-switch:checked::after { transform: translateX(20px); }
.po-langs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.po-langs .po-chip { min-height: 34px; font-size: 13px; padding: 2px 4px; }

/* ---------------------------------------------------------------- battle root */
.po-battle-root { position: fixed; inset: 0; overflow: hidden; background: var(--bg); }

/* ---------------------------------------------------------------- turn the phone */
.po-turn { display: none; }
@media (orientation: portrait) and (pointer: coarse) {
  body.po-wide .po-turn { display: flex; }
}
body.po-force-turn .po-turn { display: flex; }
.po-turn {
  position: fixed; inset: 0; z-index: 100; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px;
  background: var(--bg); color: var(--text); text-align: center; font-family: var(--font);
}
.po-turn-ico { color: var(--blue); animation: po-turn 1.8s ease-in-out infinite; }
.po-turn b { font-size: 24px; font-weight: 900; font-style: italic; text-transform: uppercase; }
.po-turn p { color: var(--muted); }
.po-turn small { color: var(--muted); font-size: 12px; max-width: 300px; opacity: 0.8; }
@keyframes po-turn { 0%, 30% { transform: rotate(0); } 60%, 100% { transform: rotate(-90deg); } }

/* ---------------------------------------------------------------- short screens (≈740×340) */
@media (max-height: 400px) {
  .po-screen { gap: 6px; padding-top: calc(6px + var(--safe-t)); padding-bottom: calc(6px + var(--safe-b)); }
  .po-menu-left { gap: 7px; }
  .po-mode-panel { gap: 5px; padding: 6px 12px 10px; }
  .po-box-title { font-size: 18px; }
  .po-seg-btn { min-height: 33px; font-size: 14px; }
  .po-seg.sizes .po-seg-btn { font-size: 17px; }
  .po-plate.big { min-height: 48px; font-size: 25px; }
  .po-bar-top { min-height: 42px; }
  .po-title-plate { padding: 3px 20px; }
  .po-title-plate h2 { font-size: 18px; }
  .po-line, .po-stat { font-size: 11.5px; }
  .po-line { line-height: 1.15; padding: 2px 7px; }
  .po-stat { gap: 6px; grid-template-columns: minmax(54px, auto) clamp(44px, 9vw, 90px) minmax(0, 1fr); }
  .po-stat-txt { line-height: 1.1; }
  .po-detail { gap: 2px; padding: 4px 10px 6px; }
  .po-detail-head { flex-wrap: nowrap; gap: 10px; margin-bottom: 0; }
  .po-detail-head .po-ntag.big { font-size: 16px; }
  .po-detail-head .po-role { font-size: 11px; white-space: nowrap; }
  .po-ntag.big { font-size: 20px; }
  /* the tilted logo: room above it, so the top of «UT» and its splats stay on screen */
  .po-menu-left .po-logo { --lw: clamp(116px, 34vh, 240px); margin: 14px 0 0; }
  .po-bar-left .po-logo { margin-top: 4px; }
  .po-res-table td { height: 26px; font-size: 14px; }
  .po-res-table { border-spacing: 0 3px; }
  .po-res-head { min-height: 44px; }
  .po-res-actions .po-plate { min-height: 40px; }
  .po-strip-head { padding: 4px 8px 4px 12px; }
  .po-strip-head .po-btn { min-height: 32px; }
  .po-set-x { width: 34px; height: 34px; }
  .po-set-row { min-height: 33px; }
  .po-set-sec h3 { margin: 4px 0 1px; }
  .po-set-btn { min-height: 40px; }
  .po-langs .po-chip, .po-levels .po-chip { min-height: 31px; }
  .po-acard-name { font-size: 13px; }
}
@media (max-width: 800px) {
  .po-lobby-foot .po-seg-label { display: none; }
  .po-mini-hero .txt { display: none; }
  .po-mini-hero { padding: 0 7px; }
  .po-arena-btn { max-width: 140px; }
  .po-top-btns .po-plate.small .txt { display: none; }
  .po-top-btns .po-plate.small { width: 40px; padding: 0; }
  .po-res-head .po-logo { display: none; }
  .po-bar-left .po-logo { --lw: 92px; }
}
/* the four stat meters only where the card has room for them (not on phones 340–370 px high) */
@media (max-height: 370px) { .po-stats4 { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .po-turn-ico { animation: none; }
  .po-acard { transition: none; }
}
