﻿/* Szata aplikacji SectorFront. Tokeny wg design/brandkit (SECTORFRONT_BRANDBOOK.md, design-tokens.json): płasko, spokojnie,
   jeden akcent (Signal Orange) na głównej akcji. Jedyne źródło kolorów, kształtu, ruchu i typografii: zmienne na :root poniżej.
   Komponenty zagnieżdżone w .ui (styl ekranu walki: mecz.css, również w .ui).
   Wymaga zagnieżdżania CSS (Chrome 120+, Safari 17.2+, Firefox 117+). */
:root {
  /* ---- Powierzchnie (grafit marki) ---- */
  --color-bg-0: #0F1720;        /* tło ekranu (Canvas) */
  --color-bg-1: #25333D;        /* karta, panel, nawigacja (Steel) */
  --color-bg-2: #17242E;        /* panel miękki: pole formularza, kontrolka drugorzędna, studzienka w karcie */
  --color-bg-3: #33444F;        /* wybrane / wciśnięte pole na karcie */
  --color-line: #3B4C58;        /* obrys 1 px, linia podziału (token border.default) */
  --color-outline: #3B4C58;     /* obrys komponentów (ta sama wartość co linia) */
  --color-overlay: #0B1219;     /* tło poza kolumną gry na szerokim oknie */
  --color-scrim: rgba(11, 18, 25, .78); /* przyciemnienie pod oknem */

  /* ---- Tekst ---- */
  --color-text-1: #E6EBEF;      /* główny (Cold Light) */
  --color-text-2: #B6C3CD;      /* drugorzędny */
  --color-text-3: #94A2AD;      /* pomocniczy (min. 4,5:1 na kartach i tle) */

  /* ---- Akcent główny: Signal Orange — jedna główna akcja na ekran; tekst na nim zawsze ciemny ---- */
  --color-accent: #F15D22;
  --color-accent-hover: #FF763D;
  --color-accent-pressed: #C44717;
  --color-on-accent: #101820;   /* tekst na akcencie (token text.onAccent) */
  --color-accent-hi: var(--color-accent); /* stare nazwy: gradienty zniknęły, to samo źródło */
  --color-accent-lo: var(--color-accent);
  --color-accent-edge: var(--color-accent-pressed);
  --color-gold: #D8B36A;        /* Tactical Gold: nagrody prestiżowe, oszczędnie */
  /* ramka trofeum Bastiona wg poziomu 1–4 (stal, brąz, srebro, złoto) */
  --color-trophy-1: #8C9BA6;
  --color-trophy-2: #B07A4A;
  --color-trophy-3: #E6EBEF;
  --color-trophy-4: var(--color-gold);

  /* ---- Dwie strony walki: kolor + znak (A = trójkąt, B = romb) + kreskowanie paska B ---- */
  --color-side-a: #4AA9E8;      /* Oddział A: błękit (tokeny team.alpha) */
  --color-side-a-lo: #2B7DB8;
  --color-side-a-ink: #0F1720;
  --color-side-b: #EF6A70;      /* Oddział B: koral (token team.bravo). Blisko pomarańczu akcentu, więc zawsze z romb-em, kreskowaniem paska i nazwą; nigdy nie wypełnia przycisków */
  --color-side-b-lo: #C24F73;
  --color-side-b-ink: #0F1720;

  /* ---- Zasoby (zawsze z ikoną) ---- */
  --color-ammo: #F2A24B;        /* ammo: bursztyn */
  --color-cash: #6BD8A9;        /* kasa: zieleń */
  --color-xp: #A8B4F0;          /* XP: lawenda */
  --color-premium: var(--color-gold); /* Chwała: złoto marki */

  /* ---- Rzadkości przedmiotów (zawsze z liczbą kresek 1–5) ---- */
  --color-rarity-common: #A9B6C1;
  --color-rarity-uncommon: #6BD8A9;
  --color-rarity-rare: #6AB4F5;
  --color-rarity-epic: #B793F0;
  --color-rarity-legendary: #D8B36A;

  /* ---- Siedem wyników terminala (zawsze z ikoną i nazwą) ---- */
  --color-result-attack: #E6EBEF;   /* zwykły atak */
  --color-result-crit: #FF7276;     /* krytyk */
  --color-result-big: #D8B36A;      /* duża kasa/XP */
  --color-result-small: #6BD8A9;    /* mała kasa/XP */
  --color-result-ammo: #F2A24B;     /* zwrot ammo */
  --color-result-armor: #4DD0E1;    /* odbudowa pancerza */
  --color-result-empty: #8C9BA6;    /* pusty wynik */
  --color-result-gift: var(--color-gold); /* prezent */

  /* ---- Stany ---- */
  --color-success: #6BD8A9;
  --color-warning: #F5C963;
  --color-error: #FF7276;           /* tekst błędu na ciemnym tle */
  --color-error-solid: #B8312A;     /* wypełnienie przycisku niszczącego (biały tekst) */
  --color-focus: #82C9FA;           /* fokus z klawiatury */

  /* ---- Typografia: Montserrat (nagłówki, duże liczby, CTA), Inter (interfejs); pliki w web/fonty ---- */
  --font-display: "Montserrat", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, Menlo, monospace;

  --fs-display-xl: 40px;  /* wynik losowania */
  --fs-display-l: 28px;   /* tytuł ekranu, baner */
  --fs-title: 20px;       /* nagłówek sekcji */
  --fs-heading: 16px;     /* nagłówek karty, przycisk */
  --fs-body: 15px;        /* tekst */
  --fs-small: 13px;       /* tekst pomocniczy */
  --fs-label: 12px;       /* etykieta wersalikami (minimum w grze) */
  --fs-num-xl: 32px;
  --fs-num-m: 17px;

  /* ---- Kształt: płasko; karta 12, kontrolka 10, obrys 1 px ---- */
  --radius-s: 6px;
  --radius-m: 10px;
  --radius-l: 12px;
  --radius-xl: 16px;
  --radius-pill: 999px;
  --stroke-thin: 1px;   /* karty, pola */
  --stroke-thick: 1px;  /* przyciski, okna */
  --press-depth: 0px;   /* dawny „cokół” przycisku: brak */
  --shadow-float: 0 12px 32px rgba(0, 0, 0, .42); /* jedyny cień: okno, arkusz, powiadomienie */

  /* ---- Siatka 4 pt i marginesy ---- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;   /* margines ekranu */
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --safe-top: 47px;      /* wcięcie: pasek stanu / wyspa */
  --safe-bottom: 34px;   /* wcięcie: wskaźnik domu */
  --tap-min: 44px;       /* minimalne pole dotyku */
  --tabbar-h: 64px;

  /* ---- Ruch: 140–220 ms; losowanie i kadr krytyka mają własne czasy (mechanika rytmu) ---- */
  --dur-fast: 140ms;
  --dur-base: 220ms;
  --dur-slow: 320ms;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-pop: cubic-bezier(.3, 1.4, .5, 1);
}
:root { --warn-ic: url("../ikony/warn.svg"); }

/* ---------- globalne: reset, ramka telefonu, baner połączenia ---------- */
*, *::before, *::after { box-sizing: border-box; }
/* bez domyślnych marginesów przeglądarki: odstępy dają gap/padding komponentów (karty osiągnięć, drzewka, sklepu, bazy) */
h1, h2, h3, h4, p { margin: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; height: 100%; background: var(--color-overlay); color-scheme: dark; }
body {
  margin: 0; min-height: 100%; background: var(--color-overlay); color: var(--color-text-1);
  font-family: var(--font-body); font-size: var(--fs-body); line-height: 1.4;
}
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.conn-banner {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%); width: min(100%, 500px); z-index: 80;
  background: var(--color-warning); color: var(--color-on-accent); font-weight: 700; padding: 0.6rem 1rem; text-align: center; margin: 0;
}

/* Kolumna gry: na telefonie pełna szerokość, na szerszym oknie do 500 px, zawsze na CAŁĄ wysokość okna (bez karty „pływającej”).
   contain: layout — elementy position: fixed w środku (pasek akcji meczu) trzymają się ramki, nie okna przeglądarki.
   Ekran walki rozdziela nadmiar wysokości w mecz.css (--fd-h rośnie z oknem do granicy). */
.frame {
  position: relative; width: 100%; max-width: 500px; height: 100vh; height: 100dvh; margin: 0 auto;
  display: flex; flex-direction: column; overflow: hidden; contain: layout;
  background: var(--color-bg-0);
}
@media (min-width: 501px) {
  .frame { border-left: 1px solid var(--color-line); border-right: 1px solid var(--color-line); }
}
.ui {
  position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top);
  padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right);
  background: var(--color-bg-0);
}

@keyframes ui-in-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ui-in-slide { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes ui-sheet { from { transform: translateY(100%); } to { transform: none; } }
@keyframes ui-dialog { from { opacity: 0; transform: translateY(-50%) scale(.96); } to { opacity: 1; transform: translateY(-50%) scale(1); } }
@keyframes ui-scrim { from { opacity: 0; } to { opacity: 1; } }
@keyframes ui-idle { 0%, 100% { transform: translateY(0) scaleY(1); } 50% { transform: translateY(-3px) scaleY(1.008); } }
@keyframes ui-pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
@keyframes ui-rise { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ui-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.no-motion *, .no-motion *::before, .no-motion *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }


.ui {
/* ==========================================================================
   Ikony: siatka 24, kreska 2, końce i łączenia okrągłe
   ========================================================================== */
.ic-ammo { color: var(--color-ammo); }
.ic-cash { color: var(--color-cash); }
.ic-xp { color: var(--color-xp); }
.ic-premium { color: var(--color-premium); }
.ic-accent { color: var(--color-accent); }
.ic-muted { color: var(--color-text-3); }
.ic-a { color: var(--color-side-a); }
.ic-b { color: var(--color-side-b); }
.ic-ink { color: var(--color-on-accent); }

/* ==========================================================================
   Typografia: Montserrat do nagłówków i dużych liczb, Inter do reszty; wersaliki tylko w krótkich etykietach
   ========================================================================== */
.t-display { font-family: var(--font-display); font-weight: 800; letter-spacing: -.02em; line-height: 1.05; }
.t-xl { font-size: var(--fs-display-xl); }
.t-l { font-size: var(--fs-display-l); }
.t-title { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-title); letter-spacing: -.02em; line-height: 1.15; }
.t-heading { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-heading); letter-spacing: -.01em; line-height: 1.2; }
.t-body { font-size: var(--fs-body); line-height: 1.4; }
.t-small { font-size: var(--fs-small); line-height: 1.4; color: var(--color-text-2); }
.t-label { font-family: var(--font-body); font-weight: 600; font-size: var(--fs-label); text-transform: uppercase; letter-spacing: .08em; color: var(--color-text-3); }
.num { font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums lining-nums; letter-spacing: -.01em; }
.t-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--color-text-2); }
.dim { color: var(--color-text-3); }
.center { text-align: center; }
.ex { /* oznaczenie „przykład”: dyskretne, nie zasłania treści */
  display: inline-block; font-family: var(--font-body); font-style: italic; font-weight: 500; font-size: 11px;
  letter-spacing: .02em; text-transform: none; color: var(--color-text-3); border: 1px dashed var(--color-line);
  border-radius: var(--radius-pill); padding: 0 6px; line-height: 16px; vertical-align: middle; white-space: nowrap;
}

/* ==========================================================================
   Przyciski: płasko. Główny: pomarańcz z ciemnym napisem; drugorzędny: ciemny panel ze spokojną ramką.
   Stany: normal / pressed / disabled / focus (fokus: obrys globalny)
   ========================================================================== */
.btn {
  --btn-bg: var(--color-bg-2); --btn-bg-pressed: var(--color-bg-3); --btn-ink: var(--color-text-1); --btn-line: var(--color-line);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 20px; width: 100%;
  font-family: var(--font-display); font-weight: 700; font-size: var(--fs-heading); letter-spacing: -.005em;
  color: var(--btn-ink); text-decoration: none;
  background: var(--btn-bg); border: var(--stroke-thick) solid var(--btn-line); border-radius: var(--radius-l);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.btn:active, .btn.is-pressed { background: var(--btn-bg-pressed); transform: scale(.985); }
.btn--primary { --btn-bg: var(--color-accent); --btn-bg-pressed: var(--color-accent-pressed); --btn-ink: var(--color-on-accent); --btn-line: transparent; }
.btn--danger { --btn-bg: var(--color-error-solid); --btn-bg-pressed: #8E241F; --btn-ink: #fff; --btn-line: transparent; }
.btn--gold { --btn-bg: var(--color-gold); --btn-bg-pressed: #B8955A; --btn-ink: var(--color-on-accent); --btn-line: transparent; }
.btn--ghost { --btn-bg: transparent; --btn-bg-pressed: var(--color-bg-2); }
.btn--s { min-height: var(--tap-min); font-size: 15px; padding: 0 14px; width: auto; border-radius: var(--radius-m); }
.btn--xl { min-height: 76px; font-size: 22px; border-radius: var(--radius-l); }
.btn[disabled], .btn.is-disabled {
  --btn-bg: var(--color-bg-2); --btn-bg-pressed: var(--color-bg-2); --btn-ink: var(--color-text-3); --btn-line: var(--color-line); cursor: not-allowed; transform: none;
}
.btn--ghost[disabled], .btn--ghost.is-disabled { --btn-bg: transparent; border-style: dashed; }
.btn-sub { display: block; font-family: var(--font-body); font-weight: 500; font-size: 12px; letter-spacing: 0; opacity: .85; }
.btn-stack { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.btn-row { display: flex; gap: var(--space-3); }
.btn-row .btn { flex: 1; }
.btn-link { background: none; border: 0; min-height: var(--tap-min); padding: 0 8px; color: var(--color-text-1); font-weight: 600; font-family: var(--font-body); font-size: var(--fs-body); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.btn-link[disabled] { color: var(--color-text-3); text-decoration: none; cursor: not-allowed; }
.btn-round {
  width: var(--tap-min); height: var(--tap-min); border-radius: 50%; display: inline-grid; place-items: center; flex: none; padding: 0;
  background: var(--color-bg-2); border: 1px solid var(--color-line); color: var(--color-text-1); cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out);
}
.btn-round:active { background: var(--color-bg-3); }

/* ==========================================================================
   Pasek zasobów (stały na każdym ekranie poza startowymi)
   ========================================================================== */
.resbar { flex: none; display: flex; align-items: center; gap: 6px; padding: 0 var(--space-4); height: 52px; }
.lvl { position: relative; flex: none; width: 46px; height: 46px; margin-right: 2px; }
.lvl-badge {
  --xp: 54; width: 46px; height: 46px; border-radius: 50%; padding: 3px; position: relative;
  background: conic-gradient(var(--color-xp) calc(var(--xp) * 1%), var(--color-bg-3) 0); /* pierścień postępu XP: dane, nie ozdoba */
}
.lvl-in { width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; background: var(--color-bg-1); font-family: var(--font-display); font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.chip {
  position: relative; display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 10px 0 7px;
  background: var(--color-bg-2); border: var(--stroke-thin) solid var(--color-outline); border-radius: var(--radius-pill);
  font-family: var(--font-display); font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.chip .ic { width: 20px; height: 20px; }
.chip .of { color: var(--color-text-3); font-weight: 600; font-size: 12px; font-family: var(--font-body); }
.chip--plus { padding-right: 2px; gap: 4px; }
.chip-plus {
  position: relative; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--color-accent); color: var(--color-on-accent); margin-left: 2px;
}
.chip-plus::after { content: ""; position: absolute; inset: -10px; } /* pole dotyku 44 px */
.chip-plus .ic { width: 14px; height: 14px; stroke-width: 3; }
.resbar .spacer { flex: 1; }
.resbar .btn-round { width: 36px; height: 36px; }
.resbar .chip-ammo { min-width: 0; }

/* Górny pasek (wspólny dla ekranów z zakładkami): avatar z poziomem i pierścieniem XP, ammo, kasa, Chwała, ustawienia.
   Ikona + liczba, bez pigułek; linia pod paskiem. W walce ten sam układ w niższej wersji (.topbar.m-res, mecz.css). */
.topbar { position: relative; flex: none; display: flex; align-items: center; gap: var(--space-2); min-height: 72px; padding: var(--space-3) var(--space-4); }
.topbar::after { content: ""; position: absolute; left: var(--space-4); right: var(--space-4); bottom: 0; height: 1px; background: var(--color-line); }
.tb-avatar { position: relative; flex: none; width: 48px; height: 48px; margin-right: var(--space-1); color: inherit; text-decoration: none; border-radius: 50%; }
.tb-avatar .lvl-badge { display: block; width: 48px; height: 48px; padding: 2px; }
.tb-av-in { display: block; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; background: var(--color-bg-2); }
.tb-lv {
  position: absolute; right: -7px; bottom: -5px; min-width: 24px; height: 24px; padding: 0 3px; border-radius: 12px; display: grid; place-items: center;
  background: var(--color-bg-0); border: 2px solid var(--color-accent); font: 700 var(--fs-label) / 1 var(--font-display); font-variant-numeric: tabular-nums;
}
.tb-sep { flex: none; width: 1px; height: 36px; margin: 0 var(--space-1); background: var(--color-line); }
.tb-stat {
  flex: 1 1 auto; min-width: 0; min-height: var(--tap-min); display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 0 2px; overflow: hidden;
  color: var(--color-text-1); text-decoration: none; white-space: nowrap;
  font-family: var(--font-display); font-weight: 700; font-size: 17px; line-height: 1; font-variant-numeric: tabular-nums;
}
a.tb-stat:active { opacity: .7; }
.tb-stat .ic { width: 24px; height: 24px; flex: none; }
.tb-stat > span:not(.ic) { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tb-stat .of { color: var(--color-text-3); font: 600 var(--fs-label) / 1 var(--font-body); }
.tb-gear { position: relative; flex: none; width: var(--tap-min); height: var(--tap-min); display: grid; place-items: center; color: var(--color-text-1); text-decoration: none; border-radius: 50%; }
.tb-gear .ic { width: 28px; height: 28px; }
.tb-adm {
  position: absolute; left: 50%; bottom: -3px; transform: translateX(-50%); padding: 0 5px; border-radius: var(--radius-pill);
  background: var(--color-gold); color: var(--color-on-accent); font: 800 var(--fs-label) / 14px var(--font-display); letter-spacing: .04em;
}
@media (max-width: 430px) {
  .topbar { gap: var(--space-1); padding-left: var(--space-2); padding-right: var(--space-2); }
  .tb-avatar, .tb-avatar .lvl-badge { width: 42px; height: 42px; }
  .tb-sep { display: none; }
  .tb-stat { font-size: 14px; gap: 2px; padding: 0; }
  .tb-stat .ic { width: 18px; height: 18px; }
}

/* ==========================================================================
   Paski postępu i proporcji
   ========================================================================== */
.bar { position: relative; height: 10px; border-radius: var(--radius-pill); background: var(--color-bg-2); border: 1px solid var(--color-outline); overflow: hidden; }
.bar > i { position: absolute; inset: 0 auto 0 0; width: var(--v, 50%); border-radius: inherit; background: var(--bar-c, var(--color-accent)); }
.bar--xp { --bar-c: var(--color-xp); }
.bar--ammo { --bar-c: var(--color-ammo); }
.bar--l { height: 16px; }
.bar--s { height: 8px; }
.bar-seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.bar-seg i { height: 12px; border-radius: 4px; background: var(--color-bg-2); border: 1px solid var(--color-outline); }
.bar-seg i.on { background: var(--color-result-armor); border-color: var(--color-result-armor); }
.bar-seg i.warn { background: var(--color-warning); border-color: var(--color-warning); }
.bar-seg i.bad { background: var(--color-error); border-color: var(--color-error); }

.ratio { position: relative; display: block; height: 14px; border-radius: var(--radius-pill); overflow: hidden; border: 1px solid var(--color-outline); background: var(--color-bg-2); }
.ratio .b { position: absolute; inset: 0; background:
  repeating-linear-gradient(135deg, rgba(15,23,32,.35) 0 3px, transparent 3px 8px),
  var(--color-side-b); } /* B: kreskowanie = dodatkowy znak (nie tylko kolor) */
/* A: pas przesuwany transformem (zamiast zmiany szerokości), na prawej krawędzi jasny ukośny separator */
.ratio .a { position: absolute; inset: 0; z-index: 1; background: var(--color-side-a); transform: translateX(calc(var(--a, 50%) - 100%)); transition: transform var(--dur-base) var(--ease-out); }
.ratio .a::after { content: ""; position: absolute; top: 0; bottom: 0; right: -2px; width: 4px; background: var(--color-text-1); transform: skewX(-18deg); }
.ratio--s { height: 10px; }
.ratio--s .a::after { width: 3px; }
.ratio--l { height: 16px; }

/* ==========================================================================
   Znaki stron (A = trójkąt, B = romb), odznaka klasy, znacznik rzadkości
   ========================================================================== */
.side-mark { display: inline-grid; place-items: center; width: 22px; height: 22px; flex: none; }
.side-mark .ic { width: 22px; height: 22px; }
.side-a { color: var(--color-side-a); }
.side-b { color: var(--color-side-b); }
.side-tag { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-display); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; font-size: 13px; }
.side-tag--a { color: var(--color-side-a); }
.side-tag--b { color: var(--color-side-b); }

.class-badge {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px 0 6px; border-radius: var(--radius-pill);
  background: var(--color-bg-2); border: 1px solid var(--color-outline); font-family: var(--font-display); font-weight: 700; font-size: 12px;
  letter-spacing: .05em; text-transform: uppercase; white-space: nowrap;
}
.class-badge .ic { width: 18px; height: 18px; }
.cls-assault { --cls: #F15D22; }
.cls-sniper { --cls: #8FBBE0; }
.cls-engineer { --cls: #E0B860; }
.cls-support { --cls: #78C9A0; }
.class-badge .ic, .cls-ico { color: var(--cls); }

.rarity { --rc: var(--color-rarity-common); display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-display); font-weight: 700; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--rc); }
.rarity .pips { display: inline-flex; gap: 2px; }
.rarity .pips i { width: 6px; height: 12px; border-radius: 2px; background: var(--rc); transform: skewX(-14deg); }
.rarity .pips i.off { background: transparent; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--rc) 45%, transparent); }
.r-common { --rc: var(--color-rarity-common); }
.r-uncommon { --rc: var(--color-rarity-uncommon); }
.r-rare { --rc: var(--color-rarity-rare); }
.r-epic { --rc: var(--color-rarity-epic); }
.r-legendary { --rc: var(--color-rarity-legendary); }
/* ==========================================================================
   Karty, listy, zakładki
   ========================================================================== */
.card {
  position: relative; background: var(--color-bg-1); border: var(--stroke-thin) solid var(--color-outline); border-radius: var(--radius-l);
  padding: var(--space-3);
}
.card--raised { background: var(--color-bg-2); }
.card.is-selected { border-color: var(--color-accent); box-shadow: inset 0 0 0 1px var(--color-accent); }
.card.is-locked { opacity: .6; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.list { display: flex; flex-direction: column; border-radius: var(--radius-l); overflow: hidden; background: var(--color-bg-1); border: var(--stroke-thin) solid var(--color-outline); }
.list-row { display: flex; align-items: center; gap: var(--space-3); min-height: 56px; padding: 6px var(--space-3); border-top: 1px solid var(--color-line); }
.list-row:first-child { border-top: 0; }
.list-row.is-you { background: color-mix(in srgb, var(--color-accent) 12%, transparent); box-shadow: inset 3px 0 0 var(--color-accent); }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .t-heading, .list-row .t-small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--color-bg-2); border: 1px solid var(--color-outline); border-radius: var(--radius-l); }
.tab-btn { min-height: 44px; display: grid; place-items: center; border-radius: var(--radius-m); font-family: var(--font-display); font-weight: 600; font-size: 14px; letter-spacing: -.005em; color: var(--color-text-2); background: transparent; border: 0; transition: background-color var(--dur-fast) var(--ease-out); }
.tab-btn.is-active { background: var(--color-accent); color: var(--color-on-accent); }

.avatar { position: relative; width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--color-bg-2); border: 2px solid var(--sc, var(--color-outline)); color: var(--cls, var(--color-text-2)); }
.avatar .ic { width: 22px; height: 22px; }
.avatar--s { width: 32px; height: 32px; border-width: 2px; }
.avatar--s .ic { width: 18px; height: 18px; }
.avatar--a { --sc: var(--color-side-a); }
.avatar--b { --sc: var(--color-side-b); }
.avatar .lv { position: absolute; right: -6px; bottom: -6px; min-width: 20px; height: 18px; padding: 0 3px; border-radius: 9px; background: var(--color-bg-0); border: 1px solid var(--color-outline); color: var(--color-text-1); font: 700 11px/16px var(--font-display); text-align: center; font-variant-numeric: tabular-nums; }
.avatar .bot { position: absolute; left: -4px; top: -4px; width: 16px; height: 16px; border-radius: 4px; background: var(--color-bg-0); border: 1px solid var(--color-outline); display: grid; place-items: center; color: var(--color-text-3); }
.avatar .bot .ic { width: 11px; height: 11px; }
.avatar .av-img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: 50% 6%; }

/* ==========================================================================
   Pola formularza
   ========================================================================== */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > .t-label { padding-left: 2px; }
.input {
  display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 14px; border-radius: var(--radius-m);
  background: var(--color-bg-2); border: var(--stroke-thin) solid var(--color-outline);
  font-size: 16px; color: var(--color-text-1);
  transition: border-color var(--dur-fast) var(--ease-out);
}
.input .ph { color: var(--color-text-3); }
.input .grow { flex: 1; min-width: 0; }
.input .caret { display: inline-block; width: 2px; height: 22px; background: var(--color-accent); vertical-align: middle; margin-left: 1px; }
.input.is-focus { border-color: var(--color-focus); box-shadow: inset 0 0 0 1px var(--color-focus); }
.input.is-error { border-color: var(--color-error); box-shadow: inset 0 0 0 1px var(--color-error); }
.input.is-ok { border-color: var(--color-success); }
.input.is-disabled { opacity: .55; }
.input .eye { width: var(--tap-min); height: var(--tap-min); margin-right: -10px; display: grid; place-items: center; color: var(--color-text-2); }
.err { display: flex; gap: 6px; align-items: flex-start; color: var(--color-error); font-size: var(--fs-small); font-weight: 600; line-height: 1.3; }
.err .ic { width: 16px; height: 16px; margin-top: 1px; }
.hint { color: var(--color-text-3); font-size: var(--fs-small); }
.reqs { display: flex; flex-direction: column; gap: 3px; font-size: var(--fs-small); color: var(--color-text-2); }
.reqs li { list-style: none; display: flex; gap: 6px; align-items: center; }
.reqs { margin: 0; padding: 0 2px; }
.reqs .ic { width: 16px; height: 16px; }
.reqs .ok { color: var(--color-success); }
.reqs .no { color: var(--color-text-3); }
.check { display: flex; gap: 12px; align-items: center; min-height: var(--tap-min); font-size: var(--fs-body); }
.check-box { flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--color-bg-2); border: 1px solid var(--color-outline); display: grid; place-items: center; color: var(--color-on-accent); }
.check-box.on { background: var(--color-accent); border-color: var(--color-accent); }
.check-box.is-error { border-color: var(--color-error); box-shadow: inset 0 0 0 1px var(--color-error); }
.check-box .ic { width: 18px; height: 18px; stroke-width: 3; }
.switch { position: relative; flex: none; width: 56px; height: 32px; border-radius: 16px; background: var(--color-bg-2); border: 1px solid var(--color-outline); transition: background-color var(--dur-fast) var(--ease-out); }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--color-text-2); transition: left var(--dur-fast) var(--ease-out); }
.switch.on { background: var(--color-accent); border-color: var(--color-accent); }
.switch.on::after { left: 27px; background: var(--color-on-accent); }
.switch-hit { display: grid; place-items: center; min-width: 64px; min-height: var(--tap-min); }
.slider { position: relative; height: 10px; border-radius: 6px; background: var(--color-bg-2); border: 1px solid var(--color-outline); }
.slider > i { position: absolute; left: 0; top: 0; bottom: 0; width: var(--v, 60%); border-radius: 6px; background: var(--color-accent); }
.slider > b { position: absolute; top: 50%; left: var(--v, 60%); width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 50%; background: var(--color-text-1); border: 1px solid var(--color-outline); }
/* ==========================================================================
   Dolna nawigacja (5 zakładek: Baza, Żołnierz, Oddział, Nagrody, Sklep): ikona + podpis, aktywna w kolorze akcentu z kropką
   ========================================================================== */
.tabbar { flex: none; position: relative; z-index: 4; background: var(--color-bg-1); border-top: 1px solid var(--color-line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar-in { height: var(--tabbar-h); display: grid; grid-template-columns: repeat(5, 1fr); padding: 0 var(--space-2); }
.tab {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: var(--tabbar-h);
  font-family: var(--font-body); font-weight: 500; font-size: var(--fs-small); line-height: 1.1; color: var(--color-text-2);
}
.tab .ic { width: 28px; height: 28px; }
.tab[aria-current="page"] { color: var(--color-text-1); }
.tab[aria-current="page"] .ic { color: var(--color-accent); }
.tab[aria-current="page"]::after { content: ""; position: absolute; left: 50%; bottom: 5px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--color-accent); }
.dot { position: absolute; top: 8px; right: 50%; margin-right: -22px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--color-error-solid); border: 2px solid var(--color-bg-1); color: #fff; font: 700 11px/14px var(--font-display); text-align: center; font-variant-numeric: tabular-nums; }
/* ==========================================================================
   Okno dialogowe, arkusz od dołu, powiadomienie (jedyne miejsca z cieniem: budują hierarchię nad treścią)
   ========================================================================== */
.scrim { position: absolute; inset: 0; background: var(--color-scrim); z-index: 20; }
.dialog {
  position: absolute; left: 24px; right: 24px; top: 50%; transform: translateY(-50%); z-index: 22; padding: 20px 18px 16px; text-align: center;
  background: var(--color-bg-1); border: 1px solid var(--color-outline); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-float); display: flex; flex-direction: column; gap: 12px;
}
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 22; padding: 10px 16px calc(var(--safe-bottom) + 6px);
  background: var(--color-bg-1); border: 1px solid var(--color-outline); border-bottom: 0; border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: var(--shadow-float); display: flex; flex-direction: column; gap: 12px;
}
.intro-list { margin: 0; padding-left: 18px; display: grid; gap: 8px; }
.sheet-grab { width: 44px; height: 4px; border-radius: 2px; background: var(--color-line); margin: 0 auto 2px; }
.toast {
  position: absolute; left: 16px; right: 16px; top: calc(var(--safe-top) + 6px); z-index: 25; display: flex; gap: 10px; align-items: center; padding: 10px 12px; min-height: 52px;
  background: var(--color-bg-1); border: 1px solid var(--color-outline); border-left: 4px solid var(--tc, var(--color-success)); border-radius: var(--radius-m);
  box-shadow: var(--shadow-float); font-weight: 600; font-size: 14px;
}
.toast--err { --tc: var(--color-error); }
.toast--warn { --tc: var(--color-warning); }
.toast .ic { color: var(--tc, var(--color-success)); }

/* ==========================================================================
   Ekran powitalny, logo (plik z marki wstawiany jako obraz; pole ochronne = 0,5 wysokości sygnetu)
   ========================================================================== */
.logo-slot {
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
}
.logo-mark { width: 96px; height: 96px; border-radius: var(--radius-xl); display: grid; place-items: center; background: var(--color-bg-1); border: 1px solid var(--color-outline); color: var(--color-accent); }
.logo-mark .ic { width: 64px; height: 64px; }
.logo-symbol { display: block; width: 72px; height: 72px; }
.logo-h { margin: 0; padding: 24px 0 8px; line-height: 0; }
.logo-img { display: block; width: min(270px, 74vw); height: auto; }
.logo-desc { margin: 0; font-family: var(--font-body); font-weight: 600; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--color-text-2); }
.logo-tag { margin: 0; font-family: var(--font-body); font-weight: 500; font-size: 14px; color: var(--color-text-3); }
.logo-ph { font-size: 11px; color: var(--color-text-3); font-style: italic; border: 1px dashed var(--color-line); border-radius: 999px; padding: 1px 8px; }
.hero-art { position: relative; display: grid; place-items: end center; }

/* ==========================================================================
   Baza: żołnierz w centrum, odliczanie
   ========================================================================== */
.stage { position: relative; display: grid; place-items: end center; }
.stage::before { content: ""; position: absolute; left: 50%; bottom: 8px; width: 220px; height: 52px; margin-left: -110px; border-radius: 50%; background: var(--color-bg-0); opacity: .55; }
.stage::after { content: ""; position: absolute; left: 50%; bottom: 14px; width: 180px; height: 40px; margin-left: -90px; border-radius: 50%; border: 1px solid var(--color-line); }
.stage svg { position: relative; z-index: 1; }
.nameplate { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.countdown { font-family: var(--font-display); font-weight: 700; font-size: 32px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; color: var(--color-text-1); line-height: 1; }
/* ==========================================================================
   Sylwetka żołnierza, plecak, sloty
   ========================================================================== */
.soldier { display: block; }
.slot {
  position: relative; width: 64px; height: 64px; display: grid; place-items: center; border-radius: var(--radius-m);
  background: var(--color-bg-2); border: var(--stroke-thin) solid var(--color-outline);
}
.slot .ic { width: 32px; height: 32px; color: var(--color-text-3); }
.slot.is-filled { background: color-mix(in srgb, var(--rc) 14%, var(--color-bg-2)); border-color: var(--rc); }
.slot.is-filled .ic { color: var(--color-text-1); }
.slot.is-active { border-color: var(--color-accent); box-shadow: inset 0 0 0 1px var(--color-accent); }
.slot .plus { position: absolute; right: -4px; bottom: -4px; width: 20px; height: 20px; border-radius: 50%; background: var(--color-bg-0); border: 1px solid var(--color-outline); display: grid; place-items: center; font: 700 10px/1 var(--font-display); color: var(--color-text-1); }
.slot .up { position: absolute; left: 4px; bottom: 3px; font: 700 11px/1 var(--font-display); color: var(--color-text-1); font-variant-numeric: tabular-nums; }
.slot .lbl { position: absolute; top: 3px; left: 5px; font: 600 10px/1 var(--font-body); color: var(--color-text-3); letter-spacing: .04em; }
.item { position: relative; aspect-ratio: 1; display: grid; place-items: center; border-radius: var(--radius-m); background: color-mix(in srgb, var(--rc) 14%, var(--color-bg-2)); border: var(--stroke-thin) solid var(--rc); }
.item .ic { width: 34px; height: 34px; color: var(--color-text-1); }
.item .up { position: absolute; right: 4px; top: 3px; font: 700 12px/1 var(--font-display); color: var(--color-text-1); font-variant-numeric: tabular-nums; }
.item .pips { position: absolute; left: 5px; bottom: 5px; display: flex; gap: 2px; }
.item .pips i { width: 4px; height: 9px; border-radius: 1px; background: var(--rc); transform: skewX(-14deg); }
.item.is-selected { border-color: var(--color-accent); box-shadow: inset 0 0 0 2px var(--color-accent); }
.item.is-equipped::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 18px; height: 18px; border-radius: 50%; background: var(--color-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230F1720' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E") center/12px no-repeat; border: 2px solid var(--color-bg-1); }
.item.is-dim { opacity: .35; }
.grid5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.filter { display: flex; gap: 6px; }
.filter .fbtn { flex: 1; min-height: var(--tap-min); display: grid; place-items: center; border-radius: var(--radius-m); background: var(--color-bg-2); border: var(--stroke-thin) solid var(--color-outline); color: var(--color-text-2); }
.filter .fbtn.is-active { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-on-accent); }
.filter .fbtn .ic { width: 24px; height: 24px; }
.statrow { display: flex; justify-content: space-between; align-items: center; min-height: 32px; font-size: 15px; border-top: 1px solid var(--color-line); }
.statrow:first-child { border-top: 0; }
.statrow .v { font-family: var(--font-display); font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }
.statrow .v.up { color: var(--color-success); }
.statrow .v.down { color: var(--color-error); }
/* ==========================================================================
   Mapa sektorów, wyniki, oddział
   ========================================================================== */
.sector-card { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px 9px; }
.sector-card .hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sector-card .hd .t-heading { display: flex; align-items: center; gap: 8px; }
.sector-no { width: 30px; height: 30px; display: grid; place-items: center; border-radius: var(--radius-m); background: var(--color-bg-2); border: 1px solid var(--color-outline); font-family: var(--font-display); font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.sector-card.is-selected .sector-no { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-on-accent); }
.pts-pill { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-display); font-weight: 700; font-size: 13px; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--color-bg-2); font-variant-numeric: tabular-nums; }
.pts-pill .ic { width: 14px; height: 14px; color: var(--color-warning); }
.sums { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.sums .r { text-align: right; }
.banner { position: relative; text-align: center; padding: 14px 12px 12px; border-radius: var(--radius-xl); overflow: hidden; border: 1px solid var(--color-outline); background: var(--color-bg-1); }
.banner--win { border-color: var(--color-accent); box-shadow: inset 0 0 0 1px var(--color-accent); }
.banner--lose { background: var(--color-bg-1); }
.sec-result { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.sec-res { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; border-radius: var(--radius-m); background: var(--color-bg-2); border: 1px solid var(--color-outline); font-family: var(--font-display); font-weight: 700; }
.sec-res .n { font-size: 12px; color: var(--color-text-3); letter-spacing: .04em; }
.sec-res .ic { width: 22px; height: 22px; }
.sec-res .p { font-size: 13px; }
.sec-res.w { border-color: var(--color-accent); box-shadow: inset 0 0 0 1px var(--color-accent); }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: var(--radius-m); background: var(--color-bg-2); border: 1px solid var(--color-outline); }
.stat .num { font-size: 22px; line-height: 1.1; }
.rank-no { font-family: var(--font-display); font-weight: 700; }
/* ==========================================================================
   Ustawienia
   ========================================================================== */
.set-row { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 4px 12px; border-top: 1px solid var(--color-line); }
.set-row:first-child { border-top: 0; }
.set-row .grow { flex: 1; min-width: 0; }
.set-row .ic { color: var(--color-text-2); }
.seg { display: grid; grid-auto-flow: column; gap: 4px; padding: 3px; border-radius: var(--radius-m); background: var(--color-bg-2); border: 1px solid var(--color-outline); }
.seg span { min-height: 36px; min-width: 52px; padding: 0 10px; display: grid; place-items: center; border-radius: var(--radius-s); font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--color-text-2); }
.seg span.on { background: var(--color-accent); color: var(--color-on-accent); }

/* ==========================================================================
   Wybór klasy
   ========================================================================== */
.cgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ccard { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 8px 10px; border-radius: var(--radius-l); background: var(--color-bg-1); border: var(--stroke-thin) solid var(--color-outline); text-align: center; }
.ccard .art { position: relative; display: grid; place-items: end center; height: 92px; width: 100%; }
.ccard .art svg { position: relative; height: 92px; width: auto; }
.ccard .cn { font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: -.01em; display: flex; align-items: center; gap: 6px; line-height: 1.1; }
.ccard .cn .ic { width: 20px; height: 20px; color: var(--cls); }
.ccard .role { font-size: 12.5px; color: var(--color-text-2); line-height: 1.25; }
.ccard .ab { font-size: 12.5px; line-height: 1.2; padding: 4px 6px; border-radius: 8px; background: var(--color-bg-2); width: 100%; }
.ccard .ab b { color: var(--cls); font-family: var(--font-display); font-weight: 700; }
.ccard.is-selected { border-color: var(--color-accent); box-shadow: inset 0 0 0 1px var(--color-accent); }
.ccard.is-selected::after { content: ""; position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; background: var(--color-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230F1720' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E") center/16px no-repeat; }
/* ---- nagłówek podekranu, drobne narzędzia ---- */
.hdr { flex: none; display: flex; align-items: center; gap: 12px; min-height: 52px; }
.hdr .t-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list--tight .list-row { min-height: 44px; padding-top: 3px; padding-bottom: 3px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.sb { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.join { grid-column: 1 / -1; height: 12px; margin: -10px auto 0; width: 50%; border: 2px solid var(--color-line); border-top: 0; }
.node.stub::before { content: ""; position: absolute; top: -13px; left: 50%; width: 2px; height: 11px; margin-left: -1px; background: var(--color-line); }
.node.stub-on::before { background: var(--color-accent); }
.pill-dot { display: inline-flex; align-items: center; gap: 4px; }
.sep { height: 1px; background: var(--color-line); margin: 2px 0; }



.stage--s::before { width: 120px; margin-left: -60px; } .stage--s::after { width: 104px; margin-left: -52px; height: 28px; }

.ic-warn { color: var(--color-warning); }

.content > * { flex-shrink: 0; }

/* ==========================================================================
   Dodatki aplikacji (poza makietami): ikony maską, układ ekranów, stany
   ========================================================================== */
.ic { -webkit-mask: center / contain no-repeat; mask: center / contain no-repeat; background-color: currentColor; width: 24px; height: 24px; flex: none; display: inline-block; vertical-align: middle; }
.ic-s { width: 18px; height: 18px; }
.ic-l { width: 32px; height: 32px; }
.ic-xl { width: 56px; height: 56px; }

.scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }
.view { display: flex; flex-direction: column; gap: var(--space-3); padding: 8px var(--space-4) var(--space-6); min-height: 100%; }
.view.enter-fade { animation: ui-in-fade var(--dur-fast) var(--ease-out) both; }
.view.enter-slide { animation: ui-in-slide var(--dur-base) var(--ease-out) both; }
.view--center { align-items: center; justify-content: center; text-align: center; gap: var(--space-4); }
.view--start { justify-content: center; gap: var(--space-6); }
.view > * { flex-shrink: 0; }
.stack { display: flex; flex-direction: column; gap: var(--space-3); }
.form { display: flex; flex-direction: column; gap: var(--space-3); }
.center-row { justify-content: center; }
.notice { margin: 0; padding: 10px 12px; border-radius: var(--radius-m); background: var(--color-bg-2); border: 1px solid var(--color-outline); border-left: 4px solid var(--color-warning); font-size: var(--fs-small); }
.fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.fieldset > legend { padding: 0 2px 6px; }
.btn-round-spacer { width: var(--tap-min); height: var(--tap-min); flex: none; }
.adm-label { font-weight: 800; font-size: .7rem; } /* G-11: zamiast atrybutu style w index.html (CSP bez 'unsafe-inline') */
a.btn, a.btn-round, a.tab { text-decoration: none; }
a.btn { color: var(--btn-ink); }
.hdr h2 { margin: 0; }

.resbar { padding-top: 4px; }
.status { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); text-align: center; padding: var(--space-4); color: var(--color-text-2); }
.status.is-error p { color: var(--color-error); font-weight: 600; }

/* pola: input wewnątrz opakowania .input */
.input input, .input select { flex: 1; min-width: 0; height: 48px; background: transparent; border: 0; outline: 0; padding: 0; font-size: 16px; color: var(--color-text-1); }
.input select { appearance: none; -webkit-appearance: none; }
.input textarea { flex: 1; min-width: 0; min-height: 120px; resize: vertical; background: transparent; border: 0; outline: 0; padding: 12px 0; font: inherit; font-size: 16px; color: var(--color-text-1); }
.input:has(textarea) { align-items: stretch; }
.count-row { display: flex; justify-content: flex-end; }
.input select option { background: var(--color-bg-2); }
.input:focus-within { border-color: var(--color-focus); box-shadow: inset 0 0 0 1px var(--color-focus); }
.input:has(input[aria-invalid="true"]) { border-color: var(--color-error); box-shadow: inset 0 0 0 1px var(--color-error); }
.input .eye { background: none; border: 0; cursor: pointer; }
.input .eye .ic { width: 24px; height: 24px; }
.err { margin: 0; }
.err::before { content: ""; flex: none; width: 16px; height: 16px; margin-top: 1px; background-color: currentColor; -webkit-mask: var(--warn-ic) center / contain no-repeat; mask: var(--warn-ic) center / contain no-repeat; }
.hint { margin: 0; }
.check { margin: 0; }
.check input, .side-choice input { width: 24px; height: 24px; accent-color: var(--color-accent); flex: none; }
.ex { white-space: nowrap; }
.btn[aria-busy="true"] { cursor: progress; }

/* klasy */
.cgrid .ccard { cursor: pointer; padding-top: 10px; }
.cgrid .ccard input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.cgrid .ccard:has(input:focus-visible) { outline: 3px solid var(--color-focus); outline-offset: 2px; }
.ccard .art img { position: relative; height: 92px; width: auto; }
.equip-stage .soldier-art { height: 165px; }
.class-desc { margin: 0; min-height: 3.2em; font-size: var(--fs-small); color: var(--color-text-2); }

/* baza, żołnierz */
.nameplate .t-title { font-size: 24px; text-align: center; max-width: 220px; overflow-wrap: anywhere; }
.stage { flex: 1; min-height: 200px; }
.soldier-art { display: block; }
.soldier-art svg, .soldier-art img { display: block; height: 100%; width: auto; max-width: 100%; }
.stage .soldier-art { position: relative; z-index: 1; height: clamp(180px, 30dvh, 300px); }
.stage--s { flex: none; min-height: 0; }
.stage--s .soldier-art { height: 186px; }
.soldier-idle > img { animation: ui-idle 3.2s ease-in-out infinite; transform-origin: 50% 100%; }
#v-base { background: var(--color-bg-0); } /* bez pełnoekranowej tekstury (brandbook): tło płaskie */
#v-base .stage::before, #v-base .stage::after { display: none; }
.soon { font-family: var(--font-body); font-style: italic; font-weight: 500; font-size: 11px; letter-spacing: 0; text-transform: none; color: var(--color-text-3); }
.soldier-card { display: flex; gap: 6px; padding: 10px 12px 10px 4px; }
.soldier-card .stage--s { width: 124px; margin-right: 6px; }
.sd-info { flex: 1; min-width: 0; gap: 8px; justify-content: center; }
.sd-info .t-title { font-size: 22px; overflow-wrap: anywhere; }
.sd-info .class-badge { align-self: flex-start; }
.lvl-row { gap: 8px; align-items: baseline; }
.lvl-row .num { font-size: 28px; line-height: 1; }
.lvl-row .t-small { font-size: 12px; }
.sd-num { font-size: 22px; }
.stat-grid { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.stat .num { font-size: 19px; }
.btn .ic { width: 24px; height: 24px; }
.btn-row .btn-stack { align-items: center; }
.btn--ghost .btn-sub { opacity: 1; }
.stats { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.stats > div { min-width: 0; }
.stats dt { color: var(--color-text-3); font-size: var(--fs-small); }
.stats dd { margin: 0; overflow-wrap: anywhere; }

/* wyposażenie */
.equip-stage { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; }
.slot-col { display: flex; flex-direction: column; gap: 14px; }
.slot { cursor: pointer; padding: 0; }
.slot .lbl { position: static; display: block; font-size: 10px; margin-top: 2px; }
.slot-wrap { display: flex; flex-direction: column; align-items: center; }
.slot-wrap .slot-name { font: 500 10.5px/1.15 var(--font-body); color: var(--color-text-2); margin-top: 6px; text-align: center; max-width: 78px; overflow-wrap: anywhere; }
.slot .item-img, .item .item-img { width: 36px; height: 36px; object-fit: contain; }
.slot .pips { position: absolute; left: 5px; bottom: 5px; display: flex; gap: 2px; }
.slot .pips i { width: 4px; height: 9px; border-radius: 1px; background: var(--rc); transform: skewX(-14deg); }
.item { cursor: pointer; padding: 0; width: 100%; }
.filter .fbtn { cursor: pointer; padding: 0; }
.filter .fbtn[aria-pressed="true"] { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-on-accent); }
.grid5 .item.is-selected { border-color: var(--color-accent); box-shadow: inset 0 0 0 2px var(--color-accent); }

/* arkusz i okno */
.overlay { position: absolute; inset: 0; z-index: 30; }
.overlay .scrim { animation: ui-scrim var(--dur-fast) var(--ease-out) both; }
.overlay .sheet { animation: ui-sheet var(--dur-base) var(--ease-out) both; max-height: 88%; overflow-y: auto; padding-bottom: calc(env(safe-area-inset-bottom) + 16px); }
.overlay .dialog { animation: ui-dialog var(--dur-base) var(--ease-out) both; }
.sheet-head { display: flex; align-items: flex-start; gap: 12px; }
.sheet-head .grow { min-width: 0; }
.sheet-head .t-title { overflow-wrap: anywhere; }
.sheet-item { width: 72px; height: 72px; flex: none; }
.sheet-item .item-img { width: 48px; height: 48px; }
.sheet-item .ic { width: 40px; height: 40px; }
.sheet .statrow { color: var(--color-text-2); }
.sheet .statrow .v { font-size: 16px; color: var(--color-text-1); }
.sheet-btns { display: flex; flex-direction: column; gap: 10px; }
.sheet .btn-round { margin-left: auto; }

/* toasty */
.toast-host { position: absolute; left: 0; right: 0; top: 0; z-index: 40; pointer-events: none; }
.toast-host .toast { position: relative; left: auto; right: auto; top: auto; margin: 8px 16px 0; pointer-events: auto; animation: ui-in-fade var(--dur-base) var(--ease-out) both; }

/* ustawienia */
.set-row .ic { width: 24px; height: 24px; }
.set-row button.switch-hit { background: none; border: 0; cursor: pointer; padding: 0; }
.set-row button[aria-checked="true"] .switch { background: var(--color-accent); border-color: var(--color-accent); }
.set-row button[aria-checked="true"] .switch::after { left: 27px; background: var(--color-on-accent); }
.set-row .ex { margin-left: auto; }
#set-email-value, #admin-reset-result { overflow-wrap: anywhere; }
#admin-msg { position: sticky; top: 8px; z-index: 2; padding: 8px 10px; border-radius: var(--radius-m); background: var(--color-bg-2); border: var(--stroke-thin) solid var(--color-outline); }
#admin-lobby { margin: 0; padding: 0; list-style: none; }
#admin-list, #admin-invites, #admin-feedback, #admin-sch-list { margin: 0; padding: 0; list-style: none; }
.admin-row { flex-direction: column; align-items: stretch; gap: 6px; padding: 8px 12px; }
.admin-row .grow { flex: none; overflow-wrap: anywhere; }
.admin-ctl { display: flex; gap: 8px; align-items: center; }
.admin-ctl .input { flex: 1; min-width: 0; padding: 0 8px; }
.admin-ctl .input input, .admin-ctl .input select { height: var(--tap-min); font-size: 15px; }
.admin-ctl .input select { cursor: pointer; }
.input:has(select)::after { content: ""; flex: none; width: 8px; height: 8px; margin: 0 4px 3px 6px; border-right: 2px solid var(--color-text-2); border-bottom: 2px solid var(--color-text-2); transform: rotate(45deg); pointer-events: none; }
.admin-ctl .btn { flex: none; }
.admin-ctl--wrap { flex-wrap: wrap; }
.admin-ctl--wrap .input { flex: 1 1 100%; }
.admin-ctl--wrap .btn { flex: 1 1 auto; padding: 0 8px; }
.set-row.is-soon { color: var(--color-text-3); }
.view--center .logo-mark { margin-bottom: 4px; }

/* ekran startowy */
.logo-desc, .logo-tag { text-align: center; }
.hero-art { display: flex; justify-content: center; gap: 4px; position: relative; }
.hero-art img { height: 96px; width: auto; position: relative; opacity: .95; }

/* poczekalnia */
.acc-card { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--radius-m); background: var(--color-bg-2); border: 1px solid var(--color-outline); }
.acc-card .soldier-art { height: 72px; flex: none; }
.side-choices { display: flex; gap: 10px; }
.mode-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.mode-choice { flex: 1 1 30%; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; min-height: 64px; padding: 8px 10px; overflow-wrap: anywhere; border-radius: var(--radius-m); background: var(--color-bg-2); border: var(--stroke-thin) solid var(--color-outline); font-family: var(--font-display); font-weight: 700; font-size: 14px; cursor: pointer; }
.mode-choice input { width: 22px; height: 22px; accent-color: var(--color-accent); flex: none; }
.mode-choice:has(input:checked) { background: var(--color-bg-3); border-color: var(--color-accent); box-shadow: inset 0 0 0 1px var(--color-accent); }
.mode-choice:has(input:focus-visible) { outline: 3px solid var(--color-focus); outline-offset: 2px; }
.mode-choice:has(input:disabled) { opacity: .6; cursor: default; }
.side-choice { flex: 1; display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 12px; border-radius: var(--radius-m); background: var(--color-bg-2); border: var(--stroke-thin) solid var(--color-outline); font-family: var(--font-display); font-weight: 700; font-size: 15px; cursor: pointer; }
.side-choice.side-a { color: var(--color-side-a); }
.side-choice.side-b { color: var(--color-side-b); }
.side-choice:has(input:checked) { background: var(--color-bg-3); border-color: var(--color-accent); box-shadow: inset 0 0 0 1px var(--color-accent); }
.side-choice:has(input:focus-visible) { outline: 3px solid var(--color-focus); outline-offset: 2px; }
.side-choice input { position: relative; }

/* wynik */
.banner { margin-top: 4px; }
.banner--draw { background: color-mix(in srgb, var(--color-warning) 8%, var(--color-bg-1)); }
.text-a { color: var(--color-side-a); }
.text-b { color: var(--color-side-b); }

/* poziom — nakładka awansu */
.dialog .levelup-num { font-family: var(--font-display); font-weight: 800; font-size: 60px; line-height: 1; color: var(--color-accent); animation: ui-pop 420ms var(--ease-pop) both; }

/* wybór płci i wyglądu */
.look-wrap { display: flex; gap: 12px; align-items: stretch; }
.preview-art { height: 150px; width: 100px; flex: none; padding: 6px; border-radius: var(--radius-m); background: var(--color-bg-2); border: 1px solid var(--color-outline); display: grid; place-items: center; }
.preview-art svg, .preview-art img { height: 100%; width: auto; }
.apick { display: flex; flex-direction: column; gap: 10px; }
.seg-row, .looks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg-btn { min-height: 48px; border-radius: var(--radius-m); background: var(--color-bg-2); border: var(--stroke-thin) solid var(--color-outline); font-family: var(--font-display); font-weight: 600; font-size: 14px; cursor: pointer; padding: 0 4px; }
.seg-btn[aria-pressed="true"] { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-on-accent); }
/* przełącznik języka: mały, żeby nie dominował nad ekranem startowym i wierszem ustawień */
.lang-switch { align-self: center; width: 132px; gap: 6px; }
.lang-switch .seg-btn { min-height: 40px; font-size: 13px; }
.set-row .lang-switch { align-self: auto; width: 176px; flex: none; }
.look { height: 96px; padding: 6px 0 0; display: grid; place-items: end center; border-radius: var(--radius-m); background: var(--color-bg-2); border: var(--stroke-thin) solid var(--color-outline); cursor: pointer; overflow: hidden; }
.look[aria-pressed="true"] { border-color: var(--color-accent); box-shadow: inset 0 0 0 2px var(--color-accent); }
.look .soldier-art { height: 86px; }
.sheet .apick { margin: 4px 0; }
.sheet .look-wrap .preview-art { height: 140px; }
[tabindex="-1"]:focus { outline: none; }
.side-choice { font-size: 14px; padding: 0 8px; gap: 6px; }
.side-choice .ic { width: 20px; height: 20px; }
.filter { gap: 3px; }
.filter .fbtn { min-width: 44px; }

}

/* ==========================================================================
   Gospodarka: Chwała, ammo, następny krok, nagrody, osiągnięcia, drzewko, sklep
   ========================================================================== */
@keyframes ui-reward-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
/* duża nagroda: delikatne rozjaśnienie tła karty w kolorze złota (bez poświaty) */
@keyframes ui-big-glow { 0%, 100% { background-color: var(--color-bg-1); } 50% { background-color: color-mix(in srgb, var(--color-gold) 16%, var(--color-bg-1)); } }
.ui {

/* pasek zasobów: ammo i Chwała jako odnośniki do sklepu (pole dotyku 44 px) */
.resbar { gap: 5px; }
.resbar .chip { flex: none; padding: 0 8px 0 6px; gap: 4px; font-size: 14px; }
.resbar .chip-ammo { height: 42px; }
.chip-link { color: inherit; text-decoration: none; cursor: pointer; }
.chip-link::after { content: ""; position: absolute; inset: -5px -2px; }
.chip-link:active { background: var(--color-bg-3); }

/* następny krok, rozliczenie, karta nagrody */
.next-step { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; min-height: 64px; border-color: var(--color-accent); }
.next-step .grow { display: flex; flex-direction: column; gap: 2px; }
.next-step .ic-l { width: 32px; height: 32px; }
.reward-card, .settle { display: flex; flex-direction: column; gap: 8px; border-color: var(--color-accent); }
.reward-card:focus { outline: none; }
.reward-in { animation: ui-reward-in 320ms var(--ease-out) both; }
.reward-card.is-big, .settle.is-big { border-color: var(--color-gold); animation: ui-reward-in 320ms var(--ease-out) both, ui-big-glow 1.6s ease-in-out 2; }
.reward-big { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 24px; letter-spacing: -.02em; color: var(--color-premium); text-align: center; }
.reward-big .ic { width: 40px; height: 40px; animation: ui-pop 520ms var(--ease-pop) both; }
.reward-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.reward-line { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 19px; font-variant-numeric: tabular-nums; animation: ui-rise 320ms var(--ease-out) calc(var(--i, 0) * 110ms) both; }
.reward-line .ic { width: 26px; height: 26px; }

.stat-grid--2 { grid-template-columns: 1fr 1fr; }
.stat-link { color: inherit; text-decoration: none; cursor: pointer; min-height: var(--tap-min); }
.stat .ic-s { width: 18px; height: 18px; vertical-align: -2px; }
.badge-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.badge-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px 0 8px; border-radius: var(--radius-pill); background: var(--color-bg-2); border: 1px solid var(--color-outline); font-family: var(--font-display); font-weight: 600; font-size: 13px; }
.bmark { display: inline-block; vertical-align: -3px; margin-right: 4px; color: var(--color-gold); }
.bmark .ic { width: 14px; height: 14px; }

/* osiągnięcia */
.ach { display: flex; flex-direction: column; gap: 8px; }
.ach.is-claimable { border-color: var(--color-accent); }
.ach .t-heading { overflow-wrap: anywhere; }
.ach-tag { font-family: var(--font-body); font-weight: 600; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--color-text-3); white-space: nowrap; }
.ach-tag.ok { color: var(--color-success); }
.ach-stage { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--radius-m); background: var(--color-bg-2); border: 1px solid var(--color-outline); }
.ach-stage .grow { display: flex; flex-direction: column; }
.ach-stage .btn { flex: none; }
.ach-done { display: flex; align-items: center; gap: 4px; margin: 0; color: var(--color-success); }
.badge-tile { flex-direction: row; align-items: center; gap: 12px; }
.badge-tile .grow { display: flex; flex-direction: column; }
.badge-tile.is-locked { border-style: dashed; }

/* drzewko */
.points-badge { display: inline-block; padding: 2px 10px; border-radius: var(--radius-pill); background: var(--color-accent); color: var(--color-on-accent); font-family: var(--font-display); font-weight: 700; font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tree-head { display: flex; flex-direction: column; gap: 4px; }
.notice--calm { border-left-color: var(--color-line); color: var(--color-text-2); }
.tree-bonus { display: flex; flex-direction: column; gap: 8px; border-color: var(--color-accent); }
.tree-identity { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: var(--radius-m); background: var(--color-bg-2); border-left: 4px solid var(--color-accent); }
.tree-identity[hidden] { display: none; }
.tree-identity__ic { flex: none; width: 28px; height: 28px; color: var(--color-accent); }
.tree-identity__tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tree-identity__tx p { margin: 0; }
#tree-tabs .tab-btn { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2px; }
#tree-tabs .tab-btn .ic { width: 18px; height: 18px; }
.node .fxchip { font-size: 11px; line-height: 1.15; font-weight: 600; color: var(--color-success); overflow-wrap: anywhere; }
.node.is-locked .fxchip { color: var(--color-text-3); }
.fxlist { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.fxlist li { padding: 6px 10px; border-radius: var(--radius-s, 8px); background: var(--color-bg-2); font-size: var(--fs-small); }
.fxlist li.is-flag { border-left: 3px solid var(--color-gold); }
.fxlist li.is-stat { border-left: 3px solid var(--color-success); }
#tree-tabs .tab-btn { font-size: 13px; padding: 0 2px; line-height: 1.1; text-align: center; cursor: pointer; }
.tree { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 16px 12px; padding: 12px 4px 0; }
.tree .span2 { grid-column: 1 / -1; width: 56%; justify-self: center; }
.node { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 6px 6px; min-height: 92px; text-align: center; cursor: pointer; border-radius: var(--radius-m); color: var(--color-text-1); background: var(--color-bg-1); border: var(--stroke-thin) solid var(--color-outline); }
.node .nm { font-family: var(--font-display); font-weight: 600; font-size: 13px; line-height: 1.15; letter-spacing: -.01em; overflow-wrap: anywhere; }
.node .rk { font-family: var(--font-display); font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.node .req { font-size: 11px; line-height: 1.15; color: var(--color-text-3); }
.node .pipsr { display: flex; gap: 3px; }
.node .pipsr i { width: 12px; height: 8px; border-radius: 3px; background: var(--color-bg-2); box-shadow: inset 0 0 0 1px var(--color-line); }
.node .pipsr i.on { background: var(--color-accent); box-shadow: none; }
.node.is-full { border-color: var(--color-accent); box-shadow: inset 0 0 0 1px var(--color-accent); }
.node.is-partial { border-color: color-mix(in srgb, var(--color-accent) 55%, var(--color-outline)); }
.node.is-available { border-color: var(--color-accent); box-shadow: inset 0 0 0 1px var(--color-accent); }
.node.is-locked { background: var(--color-bg-2); color: var(--color-text-3); border-style: dashed; border-color: var(--color-line); }
.node.is-locked .nm { color: var(--color-text-3); }
.node .lock { position: absolute; top: 6px; right: 6px; width: 16px; height: 16px; color: var(--color-text-3); }
.node--main { min-height: 104px; background: color-mix(in srgb, var(--color-gold) 10%, var(--color-bg-1)); }
.node--main .nm { color: var(--color-gold); }
.node--main.is-locked { background: var(--color-bg-2); }
.node.stub::before { content: ""; position: absolute; top: -16px; left: 50%; width: 2px; height: 14px; margin-left: -1px; background: var(--color-line); }
.node.stub-on::before { background: var(--color-accent); }
.node.is-bump { animation: ui-pop 320ms var(--ease-pop) both; }
.reqs .ic { width: 16px; height: 16px; }

/* sklep */
.offer { display: flex; flex-direction: row; align-items: center; gap: 12px; }
.offer .grow { display: flex; flex-direction: column; gap: 2px; }
.offer .btn { flex: none; width: auto; min-width: 96px; }
.offer.is-locked { opacity: .75; }
.offer-status { font-size: var(--fs-small); font-weight: 600; color: var(--color-warning); }
.shop-ico { flex: none; width: 48px; height: 48px; display: grid; place-items: center; border-radius: var(--radius-m); background: var(--color-bg-2); border: 1px solid var(--color-outline); }
.shop-ico .item-img { width: 40px; height: 40px; object-fit: contain; }
.free-box { display: flex; flex-direction: column; gap: 4px; border-style: dashed; border-color: var(--color-line); }
.free-box p { margin: 0; }
.shop-note { text-align: center; }
.term-link { color: var(--color-text-1); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; display: inline-block; min-height: 24px; }

/* samouczek i ustawienia konta */
.tr-hint { position: absolute; left: 12px; right: 12px; z-index: 15; display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--color-bg-1); border: 1px solid var(--color-accent); border-radius: var(--radius-m); box-shadow: var(--shadow-float); font-weight: 500; font-size: 14px; }
.tr-hint p { margin: 0; flex: 1; }
.tr-hint .btn { flex: none; width: auto; }
.tr-glow { animation: ui-glow 1.4s ease-in-out infinite; outline: 2px solid var(--color-accent); outline-offset: 2px; }
#screen-result.is-training .res-full { display: none; }
.set-act { width: 100%; background: none; border: 0; border-top: 1px solid var(--color-line); color: inherit; text-align: left; font: inherit; cursor: pointer; }
.pw-field { display: flex; flex-direction: column; gap: 6px; }}
/* podświetlenie podpowiedzi samouczka: obrys pulsuje kolorem (bez poświaty) */
@keyframes ui-glow { 0%, 100% { outline-color: var(--color-accent); } 50% { outline-color: transparent; } }

/* ==========================================================================
   Wspólne klocki ekranów (rusztowanie P0): kafelek nagrody, „Powrót”, „i”.
   Nowe ekrany dopisują własne style w css/ekrany/<ekran>.css, nie tutaj.
   ========================================================================== */
.ui {
  /* kafelek nagrody: jedyny format nagrody w grze (rewards.js); obwódka wg rodzaju, rzadkości (.r-*) i typu skrzynki */
  .rtile-row { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
  .rtile {
    position: relative; flex: none; display: grid; place-items: center; width: 56px; height: 56px;
    border-radius: var(--radius-m); border: var(--stroke-thin) solid var(--rc, var(--color-line));
    background: color-mix(in srgb, var(--rc, var(--color-line)) 14%, var(--color-bg-2));
  }
  .rtile-ic { width: 28px; height: 28px; color: var(--color-text-1); }
  .rtile-img { object-fit: contain; }
  /* ikony nagród z grafika/nagrody (img albo inline SVG): kwadrat, bez zniekształceń */
  .nagroda-img { object-fit: contain; flex: none; }
  .nagroda-svg { display: inline-block; flex: none; line-height: 0; }
  .nagroda-svg svg { width: 100%; height: 100%; display: block; }
  .nagroda-bastion--1 .ramka { fill: var(--color-trophy-1); }
  .nagroda-bastion--2 .ramka { fill: var(--color-trophy-2); }
  .nagroda-bastion--3 .ramka { fill: var(--color-trophy-3); }
  .nagroda-bastion--4 .ramka { fill: var(--color-trophy-4); }
  .rtile-n {
    position: absolute; right: -4px; bottom: -4px; min-width: 20px; padding: 0 4px; border-radius: var(--radius-pill);
    background: var(--color-bg-0); border: 1px solid var(--color-outline); color: var(--color-text-1); text-align: center;
    font: 700 12px/18px var(--font-display); font-variant-numeric: tabular-nums;
  }
  .rtile-pips { position: absolute; left: 4px; bottom: 4px; display: flex; gap: 2px; }
  .rtile-pips i { width: 4px; height: 9px; border-radius: 1px; background: var(--rc); transform: skewX(-14deg); }
  .rtile--ammo { --rc: var(--color-ammo); }
  .rtile--cash { --rc: var(--color-cash); }
  .rtile--xp { --rc: var(--color-xp); }
  .rtile--premium { --rc: var(--color-premium); }
  .rtile--cosmetic { --rc: var(--color-accent); }
  .rtile--crate-field { --rc: var(--color-rarity-uncommon); }
  .rtile--crate-tactical { --rc: var(--color-rarity-rare); }
  .rtile--crate-elite { --rc: var(--color-rarity-epic); }
  .rtile--crate-command { --rc: var(--color-rarity-legendary); }
  .rtile--pending { border-style: dashed; }

  /* „Powrót” ekranów podrzędnych: stały, na dole widoku, w strefie kciuka */
  .btn-back { flex: none; margin-top: auto; min-height: 56px; position: sticky; bottom: var(--space-2); z-index: 2; }

  /* okrągłe „i”: otwiera arkusz z objaśnieniem (openOverlay + sheetHead) */
  .info-btn {
    flex: none; display: inline-grid; place-items: center; width: var(--tap-min); height: var(--tap-min); padding: 0; border-radius: 50%;
    background: var(--color-bg-2); border: 1px solid var(--color-outline); color: var(--color-text-1); cursor: pointer;
  }
  .info-btn .ic { width: 22px; height: 22px; }
}

/* Arkusze i okna (wspólny styl, w tym samouczek „Rozumiem”): lżejsza skala — tytuł 17 px, tekst 14 px, przycisk 44-48 px, obrys 1 px */
.overlay .sheet { gap: 10px; padding-top: 8px; border-color: color-mix(in srgb, var(--color-outline) 60%, transparent); }
.sheet .sheet-head .t-title { font-size: 17px; font-weight: 600; letter-spacing: 0; }
.sheet .t-body, .sheet .intro-list { font-size: 14px; line-height: 1.4; }
.sheet .intro-list { gap: 6px; }
.sheet > .btn:not(.btn-round), .sheet-btns .btn { min-height: 48px; font-size: 15px; font-weight: 600; }
.sheet-btns { gap: 8px; }
