/* Soova Steam Profile Renderer — под экран телефона в Telegram.
   Настоящие картинки Steam + свои панели. Тема Steam задаёт цвета панелей и акцент (подобраны на глаз). */

.profile {
  --page: #0e141b;          /* фон страницы под картинкой */
  --panel: rgba(16, 22, 32, .72);
  --panel-line: rgba(255, 255, 255, .07);
  --accent: #66c0f4;        /* заголовки витрин, ссылки */
  --ink: #e9eef3;
  --ink-2: #a9b4bf;
  position: relative;
  min-height: var(--screen, 100vh);
  color: var(--ink);
  background: var(--page);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
}
.profile.theme-Summer { --page: #2b1d14; --panel: rgba(58, 36, 20, .66); --accent: #ffc36b; --panel-line: rgba(255, 210, 150, .12); }
.profile.theme-Midnight { --page: #0b0b22; --panel: rgba(20, 18, 54, .7); --accent: #a99cff; }
.profile.theme-Cosmic { --page: #160d24; --panel: rgba(42, 18, 58, .66); --accent: #f08bdc; --panel-line: rgba(240, 139, 220, .14); }
.profile.theme-Ghost { --page: #1d2024; --panel: rgba(220, 226, 232, .14); --accent: #e6ebf0; --panel-line: rgba(255, 255, 255, .16); }
.profile.theme-MutedBlue { --page: #121b26; --panel: rgba(34, 52, 74, .68); --accent: #9cc6ea; }
.profile.theme-DarkMode { --page: #0a0a0a; --panel: rgba(18, 18, 18, .78); --accent: #c9c9c9; }
.profile.theme-SteamDeck { --page: #0d1117; --panel: rgba(23, 29, 37, .74); --accent: #1a9fff; }
.profile.theme-GameProfile { --panel: rgba(0, 0, 0, .55); --accent: #f2f2f2; }

/* Нет фона — мягкий градиент в цветах темы, чтобы пустой профиль не выглядел сломанным */
.profile--nobg {
  background:
    radial-gradient(120% 60% at 50% -10%, color-mix(in srgb, var(--accent) 28%, transparent), transparent 70%),
    linear-gradient(180deg, color-mix(in srgb, var(--page) 70%, #26303c), var(--page) 60%);
}

/* ---------- фон ---------- */
/* Высота фона — один экран телефона; --screen задаётся только для снимков экрана во всю длину */
.bg { position: absolute; inset: 0 0 auto 0; height: var(--screen, 100vh); overflow: hidden; pointer-events: none; }
.bg__media { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }
/* Затемнение снизу: картинка «перетекает» в цвет страницы, панели читаются */
.bg__shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .05) 0%, rgba(0, 0, 0, .25) 35%, var(--page) 100%); }

.profile__body { position: relative; max-width: 560px; margin: 0 auto; padding: 20px 12px 32px; }

/* ---------- шапка: аватар, ник, уровень, статистика — одной карточкой ---------- */
.hero {
  position: relative;
  display: flex; align-items: center; gap: 16px;
  padding: 16px 14px; margin: 6px 0 12px;
  border-radius: 18px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--panel) 92%, var(--accent) 8%), var(--panel));
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.avatar { position: relative; flex: none; width: 84px; height: 84px; }
.avatar__img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; display: block; box-shadow: 0 4px 14px rgba(0, 0, 0, .45); }
.avatar--framed .avatar__img { border-radius: 0; box-shadow: none; }
/* Рамка Steam больше аватара примерно на 22% и центрируется по нему */
.avatar__frame { position: absolute; width: 122%; height: 122%; left: -11%; top: -11%; pointer-events: none; }
/* Тень под текстом — чтобы ник и подпись читались и на светлых фонах */
.identity { min-width: 0; flex: 1; text-shadow: 0 1px 2px rgba(0, 0, 0, .8); }
/* Ник и уровень в одну строку; не хватает места — уровень переносится вниз (flex-wrap) */
.identity__row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.name {
  margin: 0; font-size: 22px; line-height: 1.15; font-weight: 800; min-width: 0; max-width: 100%;
  /* Длинный ник без пробелов не вылезает за экран: перенос в любом месте, максимум 2 строки */
  overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hero--long .name { font-size: 18px; flex-basis: 100%; }
.level {
  flex: none; display: inline-grid; place-items: center; min-width: 32px; height: 32px; padding: 0 6px;
  border: 2px solid var(--lvl); border-radius: 999px; font-size: 13px; font-weight: 800; color: #fff;
  background: rgba(0, 0, 0, .35); text-shadow: none;
}
.level--high { box-shadow: 0 0 0 2px rgba(0, 0, 0, .4), 0 0 0 4px var(--lvl); }
.stats { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font-size: 12px; color: rgba(255, 255, 255, .72); }
.stat b { color: #fff; font-weight: 700; }
/* Уровень при длинном нике — второстепенная метка */
.stat--lvl { padding: 0 7px; border: 1px solid rgba(255, 255, 255, .22); border-radius: 999px; line-height: 18px; }
.stat--lvl b { font-weight: 600; }
.hero__more {
  all: unset; position: absolute; top: 6px; right: 8px; width: 32px; height: 28px; display: grid; place-items: center;
  border-radius: 8px; font-size: 20px; line-height: 1; color: rgba(255, 255, 255, .75); cursor: pointer;
}
.hero__more:active { background: rgba(255, 255, 255, .1); }
.identity { padding-right: 18px; }

/* ---------- витрины ---------- */
.showcase {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 12px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  overflow: hidden;
}
.showcase__title {
  margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.showcase--empty { text-align: center; color: var(--ink-2); padding: 16px 12px 18px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.tile { display: flex; flex-direction: column; gap: 2px; padding: 12px 6px; border-radius: 10px; background: rgba(255, 255, 255, .05); }
.tile b { font-size: 22px; color: var(--ink); line-height: 1.1; }
.tile span { font-size: 12px; }
.empty__text { font-size: 14px; }

/* Иллюстрации и скриншоты: без панели и рамок — только картинки, подпись маленькой меткой поверх */
.showcase--media { position: relative; padding: 0; background: none; border: 0; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.showcase--media .showcase__title {
  position: absolute; top: 8px; left: 8px; z-index: 1; margin: 0; padding: 3px 8px; border-radius: 999px;
  background: rgba(0, 0, 0, .5); color: rgba(255, 255, 255, .9); font-size: 10px; letter-spacing: .06em;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.showcase--media .art { border-radius: 0; background: none; }
.showcase--media .thumbs { gap: 2px; margin-top: 2px; }
/* Первая крупно, остальные рядом в ряд */
.art { margin: 0; border-radius: 8px; overflow: hidden; background: rgba(0, 0, 0, .25); }
.art img { width: 100%; height: auto; display: block; }
.art--main img { max-height: 70vh; object-fit: cover; object-position: top; }
.art--tall img { max-height: 520px; object-fit: cover; object-position: top; }
.thumbs { display: grid; gap: 6px; margin-top: 6px; }
.thumbs--1 { grid-template-columns: 1fr; }
.thumbs--2 { grid-template-columns: 1fr 1fr; }
.thumbs--3 { grid-template-columns: 1fr 1fr 1fr; }
.art--thumb img { aspect-ratio: 1 / 1 !important; object-fit: cover; object-position: top; }
.is-broken { display: none; }

/* Игры */
.game { border-radius: 8px; overflow: hidden; background: rgba(0, 0, 0, .3); }
.game__img { width: 100%; aspect-ratio: 460 / 215; object-fit: cover; display: block; }
.game__name { padding: 6px 8px; font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game--big .game__name { font-size: 15px; color: var(--ink); font-weight: 600; }
.games { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
.games--flush { margin-top: 0; }

/* Текст «Информация»: обычный — с переносом; ASCII-арт — как есть, мелко, с прокруткой вбок внутри панели */
.text { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.text a, .link, .steam-link { color: var(--accent); text-decoration: none; }
.text--art { white-space: pre; overflow-wrap: normal; overflow-x: auto; font-size: 10px; line-height: 1.15; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; padding-bottom: 4px; }
.text--clamped { max-height: 16em; overflow-y: hidden; -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent); mask-image: linear-gradient(180deg, #000 70%, transparent); }
.text--art.text--clamped { max-height: 20em; }
.text hr { border: 0; border-top: 1px solid var(--panel-line); margin: 8px 0; }
.spoiler { background: currentColor; border-radius: 3px; }
.spoiler:active, .spoiler:hover { background: transparent; }
.emo { width: 18px; height: 18px; vertical-align: -3px; }
.more { all: unset; display: block; margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--accent); cursor: pointer; }

/* Предметы */
.items { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.item { aspect-ratio: 1; border-radius: 8px; background: rgba(0, 0, 0, .35); border: 1px solid var(--item, var(--panel-line)); display: grid; place-items: center; overflow: hidden; }
.item img { width: 86%; height: 86%; object-fit: contain; }
.item--empty { color: var(--ink-2); font-weight: 700; }
.items + .text { margin-top: 10px; }

/* Значки: своё оформление (картинок значков API не отдаёт) — уровень в кружке и подпись */
.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.badge { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 8px 4px; border-radius: 10px; background: rgba(0, 0, 0, .25); }
.badge__lvl { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--accent); font-weight: 700; font-size: 13px; }
.badge__name { font-size: 11px; color: var(--ink-2); line-height: 1.2; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Достижения */
.ach { display: grid; gap: 8px; }
.ach__row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ach__img { width: 96px; flex: none; aspect-ratio: 460 / 215; object-fit: cover; border-radius: 6px; }
.ach__name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ach__row > div { min-width: 0; }

/* Мастерская и руководства */
.file { display: flex; gap: 10px; align-items: center; }
.file + .file { margin-top: 8px; }
.file__img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; flex: none; }
.file__title { font-weight: 600; overflow-wrap: anywhere; }

/* Steam Replay — упрощённо (точный вид Steam не воспроизводим) */
.replay { padding: 14px; border-radius: 10px; background: linear-gradient(135deg, rgba(102, 192, 244, .25), rgba(118, 82, 201, .25)); }
.replay__year { font-size: 30px; font-weight: 800; line-height: 1; margin-bottom: 4px; }
.replay .link { display: inline-block; margin-top: 8px; }
.showcase .link { font-size: 14px; font-weight: 600; }
.game + .link { display: inline-block; margin-top: 10px; }

.center { text-align: center; }
.steam-link { display: inline-block; margin-top: 6px; padding: 10px 16px; border-radius: 10px; background: var(--panel); border: 1px solid var(--panel-line); font-weight: 600; }
.profile .muted { color: var(--ink-2); }
.profile .small { font-size: 12px; }

/* ---------- компактный вид для оценки ---------- */
.full-btn {
  all: unset; box-sizing: border-box; display: flex; justify-content: center; align-items: baseline; gap: 8px; width: 100%;
  padding: 13px; margin: 2px 0 12px; border-radius: 14px; cursor: pointer; text-align: center;
  background: var(--panel); border: 1px solid var(--panel-line); color: var(--ink); font-weight: 700; font-size: 15px;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.full-btn span { font-weight: 500; font-size: 13px; color: var(--ink-2); }
