/* Єдиний профіль Time Town (town-profile.js): Профіль / Гардероб / Склад. Усі класи — з префіксом ttp-, усі правила — всередині .ttp:
 * сторінки стола (body, html, її теги й класи) цей файл не зачіпає. Кольори — змінні --ttp-*: за замовчуванням
 * нічна палітра Time Town (як у вікні Мафії); стіл може перевизначити їх на .ttp або передати theme у модуль.
 * --ttp-bottom — скільки місця знизу зайняте меню стола (кнопка «Зберегти» й підказки стають над ним). */
.ttp {
  --ttp-bg: #0F1220; --ttp-card: #171B2B; --ttp-inset: #121626; --ttp-line: #272C40; --ttp-line2: #1F2436; --ttp-chip: #262B40;
  --ttp-text: #ECE7DA; --ttp-muted: #B7B3BD; --ttp-soft: #D2CDC4; --ttp-gold: #E2BE6A; --ttp-gold2: #F2D28E;
  --ttp-ink: #1A1407; --ttp-night: #94B5F5; --ttp-green: #7FC9A0; --ttp-goldbg: #262019; --ttp-toast: #2B2519;
  --ttp-serif: 'Playfair Display', Georgia, serif;
  --ttp-num: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark; color: var(--ttp-text); font-family: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  font-size: 15px; line-height: 1.4; text-align: left; max-width: 640px; margin: 0 auto;
  -webkit-tap-highlight-color: transparent;
}
.ttp, .ttp *, .ttp *::before, .ttp *::after { box-sizing: border-box; }
.ttp button { font: inherit; color: inherit; margin: 0; }
.ttp button:focus-visible { outline: 2px solid var(--ttp-gold2); outline-offset: 2px; }
.ttp p { margin: 0; }

/* підвкладки */
.ttp-tabs, .ttp-seg { display: flex; gap: 4px; margin: 12px 16px 0; padding: 4px; border-radius: 14px; background: var(--ttp-card); border: 1px solid var(--ttp-line2); }
.ttp-tab { flex: 1; min-width: 0; min-height: 40px; padding: 6px 4px; border: 0; border-radius: 10px; background: none; color: var(--ttp-muted); font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ttp-tab.ttp-on { background: var(--ttp-chip); color: var(--ttp-gold2); }
.ttp-in { animation: ttp-in .24s ease-out; }
@keyframes ttp-in { from { opacity: 0; transform: translateY(8px); } }

/* спільне */
.ttp-section { padding: 14px 16px; }
.ttp-label { font-family: var(--ttp-serif); font-size: 17px; font-weight: 700; line-height: 1.25; color: var(--ttp-text); margin: 0 0 10px; }
.ttp-label.ttp-mt { margin-top: 22px; }
.ttp-cap { font-size: 13px; color: var(--ttp-muted); line-height: 1.45; }
.ttp-note { font-size: 13px; color: var(--ttp-muted); line-height: 1.5; margin-top: 10px; }
.ttp-card { background: var(--ttp-card); border: 1px solid var(--ttp-line2); border-radius: 18px; padding: 14px 16px; }
.ttp-card + .ttp-card { margin-top: 10px; }
.ttp-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ttp-stat { background: var(--ttp-inset); border-radius: 12px; padding: 12px 6px; text-align: center; min-width: 0; }
.ttp-stat b { display: block; font-size: 22px; font-weight: 600; line-height: 1.2; font-family: var(--ttp-num); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ttp-stat span { display: block; font-size: 13px; line-height: 1.25; color: var(--ttp-muted); }
.ttp-btn { width: 100%; min-height: 46px; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--ttp-line); background: var(--ttp-card); font-weight: 600; font-size: 15px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; text-align: center; }
.ttp-btn.ttp-primary { background: var(--ttp-gold); color: var(--ttp-ink); border-color: var(--ttp-gold); }
.ttp-btn:disabled { background: var(--ttp-line); color: var(--ttp-muted); border-color: var(--ttp-line); cursor: default; }
.ttp-btn:active:not(:disabled) { transform: scale(.98); }
.ttp-pill { display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 6px 14px; border-radius: 999px; background: var(--ttp-card); border: 1px solid var(--ttp-line); font-family: var(--ttp-num); font-variant-numeric: tabular-nums; font-size: 15px; font-weight: 600; white-space: nowrap; }
.ttp-pill.ttp-gold { color: var(--ttp-gold2); }
.ttp-pill.ttp-night { color: var(--ttp-night); }
.ttp-pill.ttp-game { color: var(--ttp-soft); }
.ttp-toast { position: fixed; left: 50%; bottom: calc(24px + var(--ttp-bottom, 0px)); transform: translateX(-50%); background: var(--ttp-toast); border: 1px solid var(--ttp-gold); color: var(--ttp-gold2); padding: 10px 16px; border-radius: 12px; font-size: 13px; line-height: 1.4; max-width: 90vw; z-index: 10010; text-align: center; }
.ttp-gate { min-height: 50vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 32px 24px; text-align: center; }
.ttp-gate .ttp-em { font-size: 44px; line-height: 1; }
.ttp-gate p { max-width: 320px; color: var(--ttp-soft); font-size: 15px; line-height: 1.5; }
.ttp-gate .ttp-btn { width: auto; min-width: 200px; margin-top: 8px; }
.ttp-h1 { margin: 10px 0 0; font-family: var(--ttp-serif); font-size: 22px; font-weight: 700; line-height: 1.15; overflow-wrap: anywhere; }
.ttp-gate .ttp-h1 { margin: 0; }
.ttp-ic { flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--ttp-inset); border: 1px solid var(--ttp-line); display: flex; align-items: center; justify-content: center; font-size: 20px; line-height: 1; }
.ttp-tx { flex: 1; min-width: 0; }
.ttp-tx b { display: block; font-size: 15px; font-weight: 600; }
.ttp-tx span { display: block; font-size: 13px; color: var(--ttp-muted); line-height: 1.4; margin-top: 2px; }
.ttp-cnt { flex: none; min-width: 44px; text-align: right; font-family: var(--ttp-num); font-variant-numeric: tabular-nums; font-size: 18px; font-weight: 700; color: var(--ttp-gold2); white-space: nowrap; }

/* профіль */
.ttp-hero { display: flex; flex-direction: column; align-items: center; padding: 16px 16px 4px; gap: 6px; text-align: center; }
.ttp-sub { font-size: 14px; color: var(--ttp-soft); }
.ttp-patron { display: inline-block; margin-top: 4px; padding: 3px 10px; border-radius: 999px; font-size: 13px; color: var(--ttp-gold); border: 1px solid rgba(226,190,106,.6); background: rgba(226,190,106,.08); }
.ttp-char { border-radius: 22px; padding: 4px; background: #2A2F3A; }
.ttp-char-wrap { position: relative; margin: 6px 0 14px; }
.ttp-lvl { position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%); background: var(--ttp-gold); color: var(--ttp-ink); font-family: var(--ttp-num); font-variant-numeric: tabular-nums; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; border: 2px solid var(--ttp-bg); }
.ttp-ava { flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.ttp-ava-in { width: 100%; height: 100%; border-radius: 50%; border: 3px solid var(--ttp-bg); background: var(--ttp-chip); display: flex; align-items: center; justify-content: center; font-family: var(--ttp-serif); font-weight: 700; overflow: hidden; }
.ttp-tokens { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.ttp-token { width: 40px; height: 40px; border-radius: 12px; background: var(--ttp-card); border: 1px solid var(--ttp-line); display: flex; align-items: center; justify-content: center; font-size: 20px; line-height: 1; }
.ttp-wallet { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 14px 16px 0; }
.ttp-wcell { display: flex; flex-direction: column; align-items: center; gap: 1px; min-height: 44px; padding: 10px 6px; border-radius: 12px; background: var(--ttp-card); border: 0; cursor: pointer; }
.ttp-wcell b { font-family: var(--ttp-num); font-variant-numeric: tabular-nums; font-size: 17px; font-weight: 600; }
.ttp-wcell span { font-size: 13px; color: var(--ttp-muted); }
.ttp-char svg { display: block; width: 100%; height: 100%; border-radius: 18px; background: var(--ttp-inset); }
.ttp-xp { width: 100%; max-width: 420px; margin-top: 10px; }
.ttp-bar { height: 8px; border-radius: 999px; background: var(--ttp-line2); overflow: hidden; }
.ttp-bar > div { height: 100%; background: var(--ttp-gold); border-radius: 999px; }
.ttp-xp-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--ttp-muted); margin-top: 8px; font-family: var(--ttp-num); font-variant-numeric: tabular-nums; }
.ttp-bal { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; padding: 14px 16px 0; }
.ttp-coin { display: flex; align-items: center; gap: 12px; }
.ttp-coin + .ttp-coin { border-top: 1px solid var(--ttp-line2); margin-top: 10px; padding-top: 10px; }
.ttp-bio { max-width: 340px; font-size: 15px; line-height: 1.45; font-style: italic; overflow-wrap: anywhere; }
.ttp-st-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.ttp-st-head b { font-size: 15px; font-weight: 600; }
.ttp-ach { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.ttp-ach + .ttp-ach { border-top: 1px solid var(--ttp-line2); }
.ttp-ach.ttp-done .ttp-ic { border-color: var(--ttp-gold); }
.ttp-ach b { display: block; font-size: 14px; font-weight: 600; }
.ttp-ach span { display: block; font-size: 13px; color: var(--ttp-muted); line-height: 1.35; }
.ttp-ach.ttp-locked { opacity: .5; }
/* Ігри й досягнення — рядок на гру, натиснув — розгорнувся */
.ttp-acc { padding: 4px 16px; }
.ttp-acc-i + .ttp-acc-i, .ttp-acc-idle { border-top: 1px solid var(--ttp-line2); }
.ttp-acc-b { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 8px 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.ttp-acc-b b { flex: none; font-size: 15px; font-weight: 600; }
.ttp-acc-s { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 8px; text-align: right; }
.ttp-acc-s .ttp-cap { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ttp-acc-c { flex: none; width: 8px; height: 8px; border-right: 2px solid var(--ttp-muted); border-bottom: 2px solid var(--ttp-muted); transform: rotate(45deg) translateY(-2px); transition: transform .2s; }
.ttp-acc-on .ttp-acc-c { transform: rotate(-135deg) translateY(-2px); }
.ttp-acc-body { padding: 2px 0 12px; }
.ttp-acc-bar { flex: none; width: 44px; height: 6px; border-radius: 3px; background: var(--ttp-line2); overflow: hidden; }
.ttp-acc-bar span { display: block; height: 100%; background: var(--ttp-gold); border-radius: 3px; }
.ttp-acc-idle { padding: 12px 0; }
@media (prefers-reduced-motion: reduce) { .ttp-acc-c { transition: none; } }
.ttp-ach .ttp-ok { margin-left: auto; flex: none; color: var(--ttp-gold); font-size: 16px; }

/* гардероб: редактор персонажа v3 */
.ttp-sexrow { display: flex; align-items: center; gap: 8px; padding: 0 16px; margin-top: 14px; }
.ttp-sexrow .ttp-cap { margin-right: 4px; }
.ttp-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.ttp-chip { min-height: 36px; padding: 6px 14px; border-radius: 999px; background: var(--ttp-card); border: 1px solid var(--ttp-line2); color: var(--ttp-muted); font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.ttp-chip.ttp-on { background: var(--ttp-chip); color: var(--ttp-text); border-color: var(--ttp-line); }
.ttp-chips.ttp-slots { padding: 0 16px; margin: 14px 0 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.ttp-chips.ttp-slots::-webkit-scrollbar { display: none; }
.ttp-chips.ttp-slots .ttp-chip { flex: none; }
.ttp-witem { background: var(--ttp-card); border: 2px solid transparent; border-radius: 14px; padding: 8px 6px 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; text-align: center; min-height: 44px; min-width: 0; }
.ttp-witem.ttp-sel { border-color: var(--ttp-gold); }
.ttp-thumb { width: 88px; max-width: 100%; height: 105px; border-radius: 12px; overflow: hidden; background: var(--ttp-inset); }
.ttp-thumb svg { width: 100%; height: 100%; display: block; }
.ttp-witem.ttp-locked .ttp-thumb { opacity: .45; }
.ttp-witem.ttp-locked.ttp-sel .ttp-thumb { opacity: 1; }
.ttp-n { font-size: 13px; font-weight: 600; line-height: 1.2; }
.ttp-t { font-size: 12px; line-height: 1.25; }
.ttp-sws { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 2px 0 14px; }
.ttp-csw { flex: none; width: 44px; height: 44px; padding: 0; border-radius: 50%; border: 3px solid var(--ttp-line); cursor: pointer; }
.ttp-csw.ttp-on { border-color: var(--ttp-bg); box-shadow: 0 0 0 3px var(--ttp-gold); }
.ttp-bottom { position: sticky; bottom: var(--ttp-bottom, 0px); z-index: 5; padding: 12px 16px; background: var(--ttp-bg); border-top: 1px solid var(--ttp-line2); }
.ttp-reset { width: 100%; min-height: 44px; margin-top: 4px; background: none; border: 0; color: var(--ttp-soft); font-size: 14px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* гардероб: рамки й рівні */
.ttp-frame { background: var(--ttp-card); border: 2px solid transparent; border-radius: 14px; padding: 12px 6px 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; min-width: 0; text-align: center; }
.ttp-frame.ttp-sel { border-color: var(--ttp-gold); }
.ttp-frame.ttp-locked { opacity: .55; }
.ttp-lvcard { text-align: center; }
.ttp-lvcard > b { display: block; font-family: var(--ttp-num); font-variant-numeric: tabular-nums; font-size: 34px; font-weight: 600; line-height: 1.2; color: var(--ttp-gold2); }
.ttp-lvcard .ttp-xp { margin: 12px auto 0; }
.ttp-rank { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; background: var(--ttp-card); border: 1px solid transparent; margin-bottom: 6px; }
.ttp-rank.ttp-me { background: var(--ttp-goldbg); border-color: var(--ttp-gold); color: var(--ttp-gold2); }
.ttp-rank b { flex: 1; font-weight: 600; }
.ttp-rank span { font-size: 13px; }
.ttp-rl { width: 52px; font-size: 13px; color: var(--ttp-muted); font-family: var(--ttp-num); font-variant-numeric: tabular-nums; }
.ttp-list { background: var(--ttp-card); border: 1px solid var(--ttp-line2); border-radius: 14px; overflow: hidden; }
.ttp-li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 16px; font-size: 15px; }
.ttp-li + .ttp-li { border-top: 1px solid var(--ttp-line2); }
.ttp-li.ttp-locked { opacity: .6; }
.ttp-li b { color: var(--ttp-gold2); }
.ttp-li i { font-style: normal; font-weight: 700; color: var(--ttp-green); }

/* склад: баланс, предмети з купівлею, підтримка */
.ttp-balance, .ttp-support { border-radius: 20px; padding: 18px; }
.ttp-balance b { display: block; font-family: var(--ttp-num); font-variant-numeric: tabular-nums; font-size: 28px; font-weight: 600; line-height: 1.25; color: var(--ttp-gold2); margin-bottom: 6px; }
.ttp-support { margin-top: 22px; }
.ttp-support .ttp-btn { margin-top: 12px; }
.ttp-items { display: grid; gap: 8px; }
.ttp-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--ttp-card); }
.ttp-e { flex: none; width: 34px; text-align: center; font-size: 26px; line-height: 1.15; }
.ttp-item .ttp-cnt { min-width: 0; font-size: 15px; font-weight: 600; color: var(--ttp-gold); }
.ttp-item.ttp-none .ttp-e, .ttp-item.ttp-none .ttp-tx > b { opacity: .55; }
.ttp-item.ttp-none .ttp-cnt { color: var(--ttp-muted); }
.ttp-buy { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 10px; }
.ttp-buy .ttp-btn { width: auto; min-height: 40px; padding: 0 16px; font-size: 14px; }
.ttp-use { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0; border: 0; background: none; color: var(--ttp-soft); font-size: 13px; cursor: pointer; }
.ttp-use span { margin: 0; color: inherit; }
.ttp-sw { flex: none; position: relative; width: 38px; height: 23px; border-radius: 999px; background: var(--ttp-chip); transition: background .2s; }
.ttp-sw::after { content: ""; position: absolute; left: 3px; top: 3px; width: 17px; height: 17px; border-radius: 50%; background: var(--ttp-soft); transition: transform .2s, background .2s; }
.ttp-sw.ttp-on { background: var(--ttp-gold); }
.ttp-sw.ttp-on::after { transform: translateX(15px); background: var(--ttp-ink); }

/* v4: фото Telegram ↔ персонаж (картка перевертається, як у вікні Мафії) */
.ttp-flip { position: relative; display: block; width: 150px; height: 180px; padding: 0; border: 0; background: none; cursor: pointer; perspective: 800px; }
.ttp-flip-in { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.2,.7,.2,1); }
.ttp-flip.ttp-flipped .ttp-flip-in { transform: rotateY(180deg); }
.ttp-flip:active .ttp-flip-in { scale: .97; }
.ttp-face { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.ttp-face.ttp-back { transform: rotateY(180deg); }
.ttp-flip-hint { font-size: 13px; color: var(--ttp-muted); margin-top: -6px; }
.ttp-photo { display: block; width: 100%; height: 100%; object-fit: cover; }

/* v4: банер «Ти зараз у грі» */
.ttp-ingame { display: flex; align-items: center; gap: 12px; margin: 14px 16px 0; padding: 12px 14px; border-radius: 16px; background: var(--ttp-goldbg); border: 1px solid rgba(226,190,106,.45); }
.ttp-ingame .ttp-tx b { font-size: 16px; }
.ttp-ingame .ttp-k { display: block; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ttp-gold2); margin: 0; }
.ttp-ingame .ttp-btn { width: auto; flex: none; min-height: 42px; padding: 0 16px; }
.ttp-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--ttp-green); box-shadow: 0 0 0 4px rgba(127,201,160,.18); }

/* v4: «Про мене» з редагуванням і «ховати з топів» */
.ttp-about-tx { font-size: 15px; line-height: 1.45; font-style: italic; overflow-wrap: anywhere; }
.ttp-about .ttp-edit { margin-top: 12px; min-height: 42px; }
.ttp-ta { display: block; width: 100%; min-height: 84px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--ttp-line); background: var(--ttp-inset); color: var(--ttp-text);
  font: inherit; line-height: 1.45; resize: vertical; }
.ttp-ta:focus { outline: 2px solid var(--ttp-gold2); outline-offset: 1px; }
.ttp-count { margin-top: 6px; text-align: right; }
.ttp-row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.ttp-about .ttp-ht { width: 100%; justify-content: space-between; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--ttp-line2); font-size: 14px; }
.ttp-use:disabled { opacity: .6; cursor: default; }

/* v4: досьє гри */
.ttp-dossier .ttp-grid3 + .ttp-drows { margin-top: 10px; }
.ttp-drow { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 14px; }
.ttp-drow + .ttp-drow { border-top: 1px solid var(--ttp-line2); }
.ttp-drow span { color: var(--ttp-soft); min-width: 0; overflow-wrap: anywhere; }
.ttp-drow b { flex: none; font-family: var(--ttp-num); font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ttp-gold2); max-width: 60%; text-align: right; overflow-wrap: anywhere; }

/* v4: дві колонки на ПК (opts.wide або всередині TTShell.mount({wide: true})) */
@media (min-width: 900px) {
  .ttp.ttp-2col { max-width: 1120px; }
  .ttp.ttp-2col .ttp-narrow { max-width: 640px; margin: 0 auto; }
  .ttp.ttp-2col .ttp-tabs { max-width: 608px; margin-left: auto; margin-right: auto; }
  .ttp.ttp-2col .ttp-pw { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 0 24px; align-items: start; padding: 0 8px; }
  .ttp.ttp-2col .ttp-pw-l { position: sticky; top: 12px; padding-bottom: 16px; }
  .ttp.ttp-2col .ttp-pw-r .ttp-section { padding-top: 22px; }
}

/* на весь екран поверх стола (TTProfile.open) */
.ttp-overlay { position: fixed; inset: 0; z-index: 10000; max-width: none; margin: 0; display: flex; flex-direction: column; background: var(--ttp-bg); }
.ttp-ov-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 0 8px 0 16px;
  padding-top: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px)); border-bottom: 1px solid var(--ttp-line2); }
.ttp-ov-head b { font-family: var(--ttp-serif); font-size: 20px; font-weight: 700; }
.ttp-ov-close { width: 44px; height: 44px; border: 0; border-radius: 12px; background: none; color: var(--ttp-soft); font-size: 20px; cursor: pointer; }
.ttp-ov-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding-bottom: env(safe-area-inset-bottom); }

.ttp-overlay.ttp-ov-top { z-index: 10005; }

@media (prefers-reduced-motion: reduce) { .ttp-in { animation: none; } .ttp-sw, .ttp-sw::after, .ttp-flip-in { transition: none; } }

/* ---------- Склад → Інвентар: сітка карток (смужка внизу — колір рідкості), картка обраного з діями ---------- */
.ttp-iv-bar { display: flex; gap: 10px; align-items: center; margin: 2px 0 12px; }
.ttp-iv-q { flex: 1; min-width: 0; min-height: 42px; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--ttp-line); background: var(--ttp-inset); color: var(--ttp-text); font: inherit; font-size: 15px; }
.ttp-iv-q::placeholder { color: var(--ttp-muted); }
.ttp-iv-q:focus { outline: 2px solid var(--ttp-gold2); outline-offset: 1px; }
.ttp-iv-bar .ttp-use { flex: none; margin: 0; }
.ttp-iv-chips { margin-bottom: 8px; }
.ttp-chips.ttp-slots.ttp-iv-sort { padding: 0; margin: 0 0 14px; }
.ttp-iv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.ttp-iv { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 6px; min-width: 0; min-height: 44px; padding: 6px 6px 10px; border-radius: 14px; cursor: pointer; text-align: center;
  background: linear-gradient(180deg, var(--ttp-card), var(--ttp-inset)); border: 2px solid var(--ttp-line2); box-shadow: inset 0 -3px 0 var(--rar, #9AA3B5); transition: transform .12s ease, border-color .12s ease; }
.ttp-iv:hover { border-color: var(--ttp-line); }
.ttp-iv:active { transform: scale(.97); }
.ttp-iv.ttp-sel { border-color: var(--ttp-gold); }
.ttp-iv[hidden], .ttp-iv-none[hidden] { display: none; }
.ttp-iv-pic { height: 78px; border-radius: 10px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--ttp-inset);
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--rar, #9AA3B5) 22%, transparent), transparent 70%), var(--ttp-inset); }
.ttp-iv-em { font-size: 38px; line-height: 1; }
.ttp-iv-char svg { width: 100%; height: 100%; display: block; }
.ttp-iv-n { font-size: 13px; line-height: 1.25; color: var(--ttp-soft); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.ttp-iv-cnt { position: absolute; top: 4px; right: 4px; min-width: 26px; padding: 2px 7px; border-radius: 999px; background: rgba(15,18,32,.88); border: 1px solid var(--ttp-line);
  color: var(--ttp-gold2); font-family: var(--ttp-num); font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 700; }
.ttp-iv-off { position: absolute; top: 4px; left: 4px; font-size: 13px; padding: 1px 5px; border-radius: 999px; background: rgba(15,18,32,.88); }
.ttp-iv-none { padding: 14px 4px; text-align: center; }
.ttp-iv-det { position: relative; display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; border-color: var(--rar, var(--ttp-line2)); }
.ttp-iv-det > .ttp-iv-pic { flex: none; width: 104px; height: 124px; }
.ttp-iv-det .ttp-iv-em { font-size: 54px; }
.ttp-iv-dt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; padding-right: 22px; }
.ttp-iv-dt b { font-family: var(--ttp-serif); font-size: 19px; line-height: 1.2; overflow-wrap: anywhere; }
.ttp-iv-rar { font-size: 13px; font-weight: 600; color: var(--rar, var(--ttp-soft)); filter: brightness(1.15); }
.ttp-iv-dt p { margin: 6px 0 0; font-size: 14px; line-height: 1.45; color: var(--ttp-soft); }
.ttp-iv-act { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.ttp-iv-act .ttp-use { margin: 0; }
.ttp-iv-act .ttp-btn { min-height: 42px; font-size: 14px; white-space: nowrap; }
.ttp-iv-x { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--ttp-inset); color: var(--ttp-muted); font-size: 14px; cursor: pointer; }
.ttp-iv-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 26px 18px; }
.ttp-iv-empty .ttp-btn { margin-top: 8px; max-width: 260px; }
@media (max-width: 360px) { .ttp-iv-det { flex-direction: column; } .ttp-iv-det > .ttp-iv-pic { width: 100%; height: 120px; } }
@media (prefers-reduced-motion: reduce) { .ttp-iv { transition: none; } .ttp-iv:active { transform: none; } }
.ttp-iv-char.ttp-iv-hat svg, .ttp-iv-char.ttp-iv-acc svg, .ttp-iv-char.ttp-iv-outfit svg { width: 86%; height: 86%; margin: auto; }
/* скін Gambit — як картка .sk у вікні Gambit: зброя з візерунком, назва зброї жирним, забарвлення, знос плашкою, ціна в 💰 */
.ttp-iv-gun { padding: 4px 6px; }
.ttp-iv-gun svg { display: block; width: 100%; max-width: 132px; height: auto; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .5)); }
.ttp-iv-det > .ttp-iv-gun { height: auto; min-height: 96px; }
.ttp-iv-sk { display: flex; flex-direction: column; gap: 1px; min-width: 0; text-align: left; }
.ttp-iv-sk b, .ttp-iv-sk span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ttp-iv-sk b { font-size: 13px; color: var(--ttp-text); }
.ttp-iv-sk span { font-size: 12px; color: var(--ttp-soft); }
.ttp-iv-skf { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 12px; }
.ttp-iv-skf i { font-style: normal; color: var(--ttp-soft); border: 1px solid var(--ttp-line); border-radius: 6px; padding: 0 5px; }
.ttp-iv-skf i:empty { border: 0; padding: 0; }
.ttp-iv-skf b { color: var(--ttp-gold2); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* «Статистика в іграх» і «Досягнення» — окремі кнопки профілю й їхні сторінки */
.ttp-pbtns { display: flex; flex-direction: column; gap: 8px; }
.ttp-pbtn { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--ttp-line, rgba(255,255,255,.08));
  background: var(--ttp-card); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.ttp-pbtn:active { transform: scale(.985); }
.ttp-pbtn:focus-visible, .ttp-pback:focus-visible { outline: 2px solid var(--ttp-gold, #E2BE6A); outline-offset: 2px; }
.ttp-pbtn-em { font-size: 26px; line-height: 1; }
.ttp-pbtn-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ttp-pbtn-tx b { font-size: 16px; font-weight: 600; }
.ttp-pbtn-tx span { font-size: 13px; color: var(--ttp-muted); }
.ttp-pbtn-c { font-style: normal; font-size: 22px; color: var(--ttp-muted); }
.ttp-pback { display: inline-flex; align-items: center; min-height: 40px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--ttp-line, rgba(255,255,255,.08));
  background: var(--ttp-card); color: inherit; font: inherit; font-size: 14px; cursor: pointer; }
.ttp-ptitle { margin: 14px 0 10px; font-family: var(--ttp-serif, Georgia, serif); font-size: 21px; line-height: 1.2; }
