/* Пацанский Ход — стили под референс (граффити + металл) */

:root {
    --bg: #0e0c09;
    --bg-soft: #1a1612;
    --bg-card: #2a241d;
    --bg-card-2: #3a2f24;
    --fg: #f0e6d2;
    --fg-mute: #a89b86;
    --accent: #e8a44a;        /* золотой */
    --accent-2: #c47a3a;
    --accent-soft: #f5c475;
    --danger: #d04545;
    --ok: #6dba4f;
    --border: #4a3f33;
    --border-strong: #6b5a47;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 12px rgba(0,0,0,0.6);
    --shadow-card: 0 6px 0 #0a0805, 0 8px 24px rgba(0,0,0,0.5);
    --metal: linear-gradient(180deg, #3a2f24 0%, #2a2018 50%, #1f1810 100%);
    --metal-2: linear-gradient(135deg, #3a2f24 0%, #1a1410 100%);
    --gold: linear-gradient(180deg, #f5c475 0%, #e8a44a 50%, #c47a3a 100%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    background: var(--bg);
    color: var(--fg);
    font-family: "Oswald", "Russo One", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    letter-spacing: 0.01em;
}

/* Сброс ссылок */
a { color: inherit; text-decoration: none; }

/* === ФОН ДВОРА === */
.dvor-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        /* Засветка сверху */
        radial-gradient(ellipse 80% 40% at 50% -5%, rgba(232,164,74,0.15) 0%, transparent 60%),
        /* Текстура бетона */
        repeating-linear-gradient(45deg, rgba(255,255,255,0.012) 0 2px, transparent 2px 4px),
        repeating-linear-gradient(-45deg, rgba(255,255,255,0.012) 0 2px, transparent 2px 4px),
        /* Тёмная база с коричневатым */
        linear-gradient(180deg, #1a1410 0%, #0a0805 100%);
    pointer-events: none;
}
.dvor-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='400' height='400'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.4 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
    background-size: 200px 200px;
    opacity: 0.4;
    mix-blend-mode: overlay;
}
.dvor-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='800' height='400' viewBox='0 0 800 400'><text x='40' y='120' font-family='Russo One' font-size='80' font-weight='900' fill='rgba(232,164,74,0.04)' transform='rotate(-8 40 120)'>БРАТВА</text><text x='420' y='280' font-family='Russo One' font-size='60' font-weight='900' fill='rgba(232,164,74,0.03)' transform='rotate(5 420 280)'>ПАЦАНЫ</text><text x='180' y='340' font-family='Russo One' font-size='40' font-weight='900' fill='rgba(232,164,74,0.025)' transform='rotate(-2 180 340)'>ДВОР</text></svg>");
    background-repeat: no-repeat;
    background-size: 100% 100%;
    pointer-events: none;
}

/* === LAYOUT === */
.app {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px 16px 110px;
    min-height: 100vh;
    position: relative;
}
.dvor-app {
    padding-bottom: 110px;
}

/* === HERO / BANNER === */
.hero {
    text-align: center;
    padding: 8px 0 16px;
}
.hero img.banner {
    width: 100%;
    max-width: 460px;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.6);
}
.hero .sub {
    color: var(--fg-mute);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 10px;
}

/* === ПРОФИЛЬ-ШАПКА === */
.profile-header { margin-bottom: 14px; }

.profile-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--metal);
    border: 2px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 12px 14px;
    position: relative;
    box-shadow: var(--shadow-card);
}
/* Заклёпки по углам */
.profile-card::before, .profile-card::after {
    content: '';
    position: absolute;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #f5c475 0%, #a87a30 70%, #5a3a10 100%);
    box-shadow: 0 1px 2px rgba(0,0,0,0.6);
}
.profile-card::before { top: 6px; left: 6px; }
.profile-card::after { top: 6px; right: 6px; }

.profile-avatar {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: #0a0805;
    border: 2px solid var(--accent);
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px #0a0805, 0 0 0 4px var(--accent-2);
}

.profile-meta { flex: 1; min-width: 0; }
.profile-name {
    font-family: "Bebas Neue", "Oswald", sans-serif;
    font-size: 22px;
    font-weight: 900;
    color: var(--fg);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.05;
    display: flex; align-items: center; gap: 4px;
}
.profile-crown { color: var(--accent); font-size: 18px; }
.profile-status {
    font-size: 10px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-weight: 700;
    margin-top: 2px;
}
.profile-level {
    font-size: 11px;
    color: var(--fg-mute);
    text-transform: uppercase;
    margin-top: 6px;
    letter-spacing: 0.08em;
}
.profile-level b { color: var(--accent); font-size: 14px; }
.profile-progress {
    margin-top: 4px;
    height: 10px;
    background: #0a0805;
    border: 1px solid var(--border);
    border-radius: 5px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.5);
}
.profile-progress-fill {
    height: 100%;
    background: var(--gold);
    transition: width 0.4s;
    box-shadow: 0 0 8px rgba(232,164,74,0.6), inset 0 1px 0 rgba(255,255,255,0.3);
}
.profile-progress-text {
    font-size: 10px;
    color: var(--fg-mute);
    margin-top: 2px;
    font-family: monospace;
}

.profile-currency {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}
.coin {
    flex: 1;
    background: var(--metal);
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: "Bebas Neue", sans-serif;
    font-size: 16px;
    font-weight: 900;
    color: var(--fg);
    letter-spacing: 0.04em;
    position: relative;
    overflow: hidden;
}
.coin::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--coin-accent, var(--accent));
    opacity: 0.7;
}
.coin--money::before { background: #6dba4f; }   /* зелёный */
.coin--star::before  { background: #e8a44a; }   /* золотой */
.coin--energy::before { background: #f5c475; }  /* светло-золотой */
.coin-icon { width: 22px; height: 22px; flex-shrink: 0; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4)); position: relative; z-index: 1; }

/* === СТАТЫ === */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 18px;
}
.stat-cell {
    background: var(--metal);
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 10px 4px 8px;
    text-align: center;
    position: relative;
    box-shadow: 0 3px 0 #0a0805;
}
.stat-ico { width: 32px; height: 32px; margin: 0 auto 2px; display: block; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5)); }
.stat-val {
    font-family: "Bebas Neue", sans-serif;
    font-size: 22px;
    color: var(--accent);
    font-weight: 900;
    line-height: 1.1;
    margin-top: 2px;
}
.stat-lbl {
    font-size: 9px;
    color: var(--fg-mute);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
}

/* === СЕКЦИОННЫЙ ЗАГОЛОВОК === */
.section-title {
    font-family: "Bebas Neue", "Russo One", sans-serif;
    color: var(--accent);
    font-size: 18px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin: 8px 0 12px;
    text-shadow: 0 2px 0 #0a0805;
    position: relative;
    padding-left: 12px;
}
.section-title::before {
    content: '';
    position: absolute;
    left: 0; top: 4px; bottom: 4px;
    width: 4px;
    background: var(--gold);
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(232,164,74,0.5);
}
.drip-title {
    font-family: "Russo One", "Bebas Neue", sans-serif;
    color: var(--accent);
    font-size: 36px;
    text-transform: uppercase;
    text-align: center;
    letter-spacing: 0.05em;
    text-shadow: 2px 2px 0 #0a0805, 4px 4px 0 #1a1410;
    position: relative;
    line-height: 0.95;
    padding-bottom: 4px;
}
.drip-title::after {
    content: '';
    position: absolute;
    left: 25%;
    right: 25%;
    bottom: -2px;
    height: 4px;
    background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
    filter: blur(2px);
}
.drip-title-sm {
    font-family: "Russo One", sans-serif;
    color: var(--accent);
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-shadow: 0 1px 0 #0a0805;
}

/* === ДЕЙСТВИЯ — тайлы === */
.action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.action-tile {
    background: var(--metal-2);
    border: 2px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 12px 8px 10px;
    text-align: center;
    position: relative;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
    box-shadow: 0 4px 0 #0a0805, inset 0 1px 0 rgba(255,255,255,0.04);
    color: inherit;
    font-family: inherit;
}
.action-tile::before, .action-tile::after {
    content: '';
    position: absolute;
    width: 5px; height: 5px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #d0a050 0%, #6a4010 80%);
    box-shadow: 0 1px 1px rgba(0,0,0,0.5);
}
.action-tile::before { top: 4px; left: 4px; }
.action-tile::after { top: 4px; right: 4px; }
.action-tile:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #0a0805, inset 0 1px 0 rgba(255,255,255,0.04);
}
.action-tile:disabled { opacity: 0.4; cursor: not-allowed; }
.action-tile-img {
    width: 56px; height: 56px;
    margin: 0 auto 6px;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)) brightness(1.15) contrast(1.1);
    background: var(--bg);
    border-radius: 50%;
    padding: 6px;
    box-sizing: border-box;
    border: 1.5px solid var(--border);
}
.action-tile-name {
    font-family: "Bebas Neue", sans-serif;
    color: var(--accent);
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 0.06em;
    line-height: 1;
}
.action-tile-cost {
    font-size: 10px;
    color: var(--fg-mute);
    margin-top: 3px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.action-tile-cost .stat-reward {
    color: var(--accent);
    font-weight: 900;
}
.action-tile-cost .stat-reward.str { color: #ff6b3d; }  /* оранжевый — сила */
.action-tile-cost .stat-reward.baz { color: #6dbaff; }  /* голубой — базар */
.action-tile-cost .stat-reward.energy { color: var(--accent-soft); }
.action-tile--small {
    padding: 8px 4px 6px;
}
.action-tile--small .action-tile-img { width: 42px; height: 42px; padding: 4px; }
.action-tile--small .action-tile-name { font-size: 13px; }

/* === БОЛЬШАЯ КНОПКА ДВИЖЕНИЕ === */
.big-cta {
    width: 100%;
    margin: 18px 0 14px;
    padding: 18px 16px;
    background: var(--gold);
    border: 3px solid #6a4010;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: "Russo One", "Bebas Neue", sans-serif;
    color: #1a1410;
    box-shadow:
        0 5px 0 #0a0805,
        0 8px 24px rgba(232,164,74,0.4),
        inset 0 2px 0 rgba(255,255,255,0.4),
        inset 0 -2px 0 rgba(0,0,0,0.2);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: transform 0.08s, box-shadow 0.08s;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    justify-content: center;
}
.big-cta::before, .big-cta::after {
    content: '';
    position: absolute;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #fff8e0 0%, #c47a3a 60%, #4a2a10 100%);
    box-shadow: 0 1px 2px rgba(0,0,0,0.6);
    top: 8px;
}
.big-cta::before { left: 10px; }
.big-cta::after { right: 10px; }
.big-cta:active:not(:disabled) {
    transform: translateY(3px);
    box-shadow:
        0 2px 0 #0a0805,
        0 4px 12px rgba(232,164,74,0.3),
        inset 0 2px 0 rgba(255,255,255,0.3);
}
.big-cta:disabled, .big-cta.is-locked {
    background: linear-gradient(180deg, #2a241d 0%, #1a1410 100%);
    color: var(--fg-mute);
    border-color: var(--border);
    box-shadow: 0 5px 0 #0a0805, inset 0 1px 0 rgba(255,255,255,0.03);
    cursor: not-allowed;
    opacity: 0.65;
    text-shadow: none;
}
.big-cta:disabled::before, .big-cta.is-locked::before,
.big-cta:disabled::after, .big-cta.is-locked::after {
    background: radial-gradient(circle at 30% 30%, #6a5a47 0%, #3a2a1a 60%, #1a1410 100%);
}
/* T8: loading state — визуально отличается от "low energy" disabled.
   Курсор wait (не not-allowed): кнопка не "сломана", а "думает".
   Декоративные уголковые "заклёпки" (::before/::after) мягко пульсируют — даёт
   ощущение "загрузки" без отдельного спиннера. */
.big-cta.is-loading {
    cursor: wait;
    opacity: 0.85;
    background: linear-gradient(180deg, #3a2d20 0%, #1f1810 100%);
}
.big-cta.is-loading::before,
.big-cta.is-loading::after {
    background: radial-gradient(circle at 30% 30%, #8a7558 0%, #4a3a2a 60%, #2a201a 100%);
    animation: big-cta-pulse 1.6s ease-in-out infinite;
}
@keyframes big-cta-pulse {
    0%, 100% { filter: brightness(1); }
    50%      { filter: brightness(1.4); }
}
.big-cta-eyebrow {
    font-size: 11px;
    color: #4a2a10;
    font-weight: 700;
    letter-spacing: 0.1em;
}
.big-cta-text {
    font-size: 26px;
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 1px 0 rgba(255,255,255,0.3);
}
.big-cta-foot {
    font-size: 10px;
    color: #4a2a10;
    letter-spacing: 0.1em;
    font-weight: 700;
}

/* === SECONDARY ACTIONS (4 мелкие) === */
.secondary-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
}

/* === ЭКОНОМИКА-СТРИП === */
.economy-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    background: var(--metal);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 4px;
    box-shadow: 0 3px 0 #0a0805;
}
.econ-cell { text-align: center; padding: 0 4px; }
.econ-lbl {
    font-size: 9px;
    color: var(--fg-mute);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}
.econ-val {
    font-family: "Bebas Neue", sans-serif;
    color: var(--accent);
    font-size: 18px;
    font-weight: 900;
    margin-top: 2px;
}

/* === TOAST === */
.toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(16px);
    background: var(--bg-card);
    border: 2px solid var(--accent);
    color: var(--fg);
    padding: 12px 18px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 90%;
    z-index: 1000;
    text-align: center;
    font-size: 14px;
    white-space: pre-wrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.toast.error { border-color: var(--danger); }
.toast.ok { border-color: var(--ok); }

/* === BOTTOM NAV === */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    background: linear-gradient(180deg, #1a1410 0%, #0a0805 100%);
    border-top: 2px solid var(--border-strong);
    padding: 8px 0 max(8px, env(safe-area-inset-bottom));
    z-index: 100;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.5);
}
.nav-item {
    flex: 1;
    text-align: center;
    padding: 4px 0;
    color: var(--fg-mute);
    text-decoration: none;
    font-family: "Bebas Neue", sans-serif;
    font-size: 18px;
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: 0.06em;
    transition: color 0.15s, transform 0.1s, opacity 0.15s;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}
.nav-item:active {
    transform: scale(0.92);
    opacity: 0.6;
}
.nav-item .nav-ico {
    display: block;
    margin: 0 auto 2px;
    width: 24px;
    height: 24px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
}
.nav-item span {
    display: block;
    font-size: 9px;
    color: var(--fg-mute);
    margin-top: 2px;
    letter-spacing: 0.08em;
    font-weight: 700;
    transition: color 0.15s;
}
.nav-item.active { color: var(--accent); }
.nav-item.active span { color: var(--accent); }
.nav-item.active::after {
    content: '';
    position: absolute;
    left: 30%;
    right: 30%;
    bottom: 0;
    height: 2px;
    background: var(--gold);
    box-shadow: 0 0 8px var(--accent);
    border-radius: 2px 2px 0 0;
}

/* === LOADING === */
.hidden { display: none !important; }
.loader {
    text-align: center;
    padding: 40px 0;
    color: var(--fg-mute);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    /* T32: на медленном соединении текст должен пульсировать — иначе выглядит как
       зависшая страница. .loader — fallback, showSkeleton() использует .skeleton. */
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}
/* T32: контейнеры на /index (profile-header/stats-row/profile-currency/economy-strip)
   пока грузится /api/me — приглушаем содержимое pulse'ом, layout не ломаем.
   В отличие от showSkeleton() (который заменяет innerHTML), этот класс просто
   накидывается на существующий блок и снимается в finally. */
.is-loading-block {
    opacity: 0.55;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    pointer-events: none;
}
.empty {
    text-align: center;
    padding: 40px 0;
    color: var(--fg-mute);
    font-size: 13px;
}

/* === BOSSES === */
.boss-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 100px;
}
.boss-card {
    display: flex;
    gap: 12px;
    background: var(--metal);
    border: 2px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 12px;
    position: relative;
    box-shadow: 0 4px 0 #0a0805;
    cursor: pointer;
    transition: transform 0.1s;
}
.boss-card:active { transform: translateY(2px); box-shadow: 0 2px 0 #0a0805; }
.boss-card--disabled { opacity: 0.6; }
.boss-avatar-wrap {
    position: relative;
    width: 72px; height: 72px;
    flex-shrink: 0;
}
.boss-avatar {
    width: 72px; height: 72px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: #0a0805;
    border: 1.5px solid var(--accent-2);
}
.boss-kills {
    position: absolute;
    top: -6px; right: -6px;
    background: var(--gold);
    color: #1a1410;
    font-family: "Bebas Neue", sans-serif;
    font-size: 13px;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
.boss-info { flex: 1; min-width: 0; }
.boss-title {
    font-size: 9px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
}
.boss-name {
    font-family: "Bebas Neue", sans-serif;
    font-size: 18px;
    color: var(--fg);
    letter-spacing: 0.04em;
    line-height: 1.05;
}
.boss-stats {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    font-size: 11px;
    color: var(--fg-mute);
    flex-wrap: wrap;
}
.boss-stat { font-weight: 600; }
.boss-stat.br { color: var(--accent); font-weight: 900; }
.boss-bar {
    margin-top: 6px;
    height: 5px;
    background: #0a0805;
    border: 1px solid var(--border);
    border-radius: 3px;
    overflow: hidden;
}
.boss-bar-fill {
    height: 100%;
    background: var(--gold);
    transition: width 0.3s;
}
.boss-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    font-size: 11px;
}
.boss-attempts { color: var(--fg-mute); font-weight: 600; }
.boss-go { color: var(--accent); font-family: "Bebas Neue", sans-serif; font-weight: 900; letter-spacing: 0.06em; }
.boss-cd { color: var(--danger); font-weight: 700; }

/* === ИСТОРИЯ ЗАМЕСОВ С БОССАМИ === */
.boss-fights {
    margin-top: 18px;
}
.boss-fights-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.boss-fight-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--metal);
    border: 2px solid var(--border-strong);
    border-left: 4px solid var(--fg-mute);
    border-radius: var(--radius);
    padding: 10px 12px;
    cursor: pointer;
    box-shadow: 0 2px 0 #0a0805;
    transition: transform 0.1s, box-shadow 0.1s;
}
.boss-fight-card:active { transform: translateY(1px); box-shadow: 0 1px 0 #0a0805; }
.boss-fight-card.win { border-left-color: var(--ok); }
.boss-fight-card.lose { border-left-color: var(--danger); }
.bfc-avatar-wrap {
    position: relative;
    width: 44px; height: 44px;
    flex-shrink: 0;
}
.bfc-avatar {
    width: 44px; height: 44px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: #0a0805;
    border: 1.5px solid var(--border);
}
.bfc-result {
    position: absolute;
    bottom: -4px; right: -4px;
    font-size: 16px;
    line-height: 1;
    background: #0a0805;
    border: 1.5px solid var(--border-strong);
    border-radius: 50%;
    width: 22px; height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.bfc-info { flex: 1; min-width: 0; }
.bfc-name {
    font-family: "Bebas Neue", sans-serif;
    font-size: 15px;
    color: var(--fg);
    letter-spacing: 0.04em;
    line-height: 1.1;
}
.bfc-district {
    font-size: 10px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    margin-top: 1px;
}
.bfc-deltas {
    display: flex;
    gap: 8px;
    margin-top: 3px;
    font-size: 11px;
    font-weight: 700;
}
.bfc-money.pos { color: var(--ok); }
.bfc-money.zero, .bfc-rating.zero { color: var(--fg-mute); }
.bfc-rating.pos { color: var(--ok); }
.bfc-rating.neg { color: var(--danger); }
.bfc-date {
    font-size: 10px;
    color: var(--fg-mute);
    font-weight: 600;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 2px;
}
.bfc-replay-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    padding: 8px 10px;
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--fg);
}
.bfc-replay-stats b { color: var(--accent); font-weight: 800; }

/* === МОДАЛКА БОССА === */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.modal.hidden { display: none; }
.modal-content {
    background: var(--bg-soft);
    border: 2px solid var(--accent-2);
    border-radius: var(--radius);
    padding: 20px 16px 16px;
    max-width: 420px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 0 0 1px var(--border), 0 8px 32px rgba(0,0,0,0.7);
}
.modal-close {
    position: absolute;
    top: 8px; right: 8px;
    width: 32px; height: 32px;
    background: var(--metal);
    border: 1.5px solid var(--border-strong);
    border-radius: 50%;
    color: var(--fg);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.boss-modal-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.boss-avatar-big {
    width: 80px; height: 80px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 2px solid var(--accent);
    background: #0a0805;
}
.boss-modal-title {
    font-size: 10px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
}
.boss-modal-name {
    font-family: "Bebas Neue", sans-serif;
    font-size: 24px;
    color: var(--fg);
    letter-spacing: 0.04em;
    line-height: 1;
}
.boss-modal-flavor {
    font-size: 13px;
    color: var(--fg-mute);
    font-style: italic;
    margin-bottom: 12px;
    padding: 8px 10px;
    background: rgba(0,0,0,0.3);
    border-left: 2px solid var(--accent-2);
    border-radius: 4px;
}
.boss-modal-lore-wrap {
    margin: 0 0 12px 0;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    background: rgba(0,0,0,0.25);
    overflow: hidden;
}
.boss-modal-lore-toggle {
    display: block;
    padding: 9px 12px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: var(--accent-2);
    cursor: pointer;
    list-style: none;
    user-select: none;
    background: linear-gradient(90deg, rgba(232,164,74,0.08), transparent);
}
.boss-modal-lore-toggle::-webkit-details-marker { display: none; }
.boss-modal-lore-toggle::before {
    content: '▸';
    display: inline-block;
    margin-right: 6px;
    transition: transform 0.15s ease;
}
.boss-modal-lore-wrap[open] .boss-modal-lore-toggle::before { transform: rotate(90deg); }
.boss-modal-lore {
    padding: 10px 12px 12px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--fg);
    font-family: Georgia, 'Times New Roman', serif;
    font-style: italic;
    border-top: 1px solid var(--border);
    background: rgba(0,0,0,0.15);
}
/* T25: subtle fade+slide when lore opens (instant browser <details> toggle looks jarring) */
@keyframes boss-lore-reveal {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.boss-modal-lore-wrap[open] .boss-modal-lore {
    animation: boss-lore-reveal 0.25s ease-out;
}
.boss-modal-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 12px;
}
.bms {
    background: var(--metal);
    border: 1.5px solid var(--border);
    border-radius: 6px;
    padding: 6px 4px;
    text-align: center;
}
.bms span { display: block; font-size: 9px; color: var(--fg-mute); text-transform: uppercase; letter-spacing: 0.06em; }
.bms b { display: block; font-family: "Bebas Neue", sans-serif; font-size: 18px; color: var(--accent); font-weight: 900; }
.boss-modal-reward {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    justify-content: center;
}
.boss-modal-reward div {
    background: var(--metal);
    border: 1px solid var(--accent-2);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    color: var(--accent);
    font-weight: 700;
}
.boss-fight-btn {
    width: 100%;
    padding: 14px;
    background: var(--gold);
    border: 2px solid #6a4010;
    border-radius: var(--radius);
    color: #1a1410;
    font-family: "Russo One", "Bebas Neue", sans-serif;
    font-size: 16px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    box-shadow: 0 4px 0 #0a0805;
}
.boss-fight-btn:disabled {
    background: var(--metal);
    color: var(--fg-mute);
    border-color: var(--border);
    cursor: not-allowed;
    box-shadow: none;
}
.boss-fight-btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 2px 0 #0a0805; }

/* === FIGHT RESULT === */
.fight-result {
    margin-top: 14px;
    padding: 12px;
    border-radius: var(--radius);
    border: 2px solid var(--border);
}
.fight-result.fight-win { border-color: var(--ok); background: rgba(109,186,79,0.08); }
.fight-result.fight-lose { border-color: var(--danger); background: rgba(208,69,69,0.08); }
.fight-result-msg {
    font-family: "Bebas Neue", sans-serif;
    font-size: 16px;
    letter-spacing: 0.04em;
    margin-bottom: 10px;
    white-space: pre-wrap;
}
.fight-win .fight-result-msg { color: var(--ok); }
.fight-lose .fight-result-msg { color: var(--danger); }
.fight-log {
    max-height: 220px;
    overflow-y: auto;
    font-size: 12px;
    background: rgba(0,0,0,0.3);
    border-radius: 6px;
    padding: 8px;
}
.fight-line {
    padding: 4px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.fight-line:last-child { border-bottom: none; }
.fight-line .dmg { color: var(--danger); font-weight: 700; }
.fight-line .flavor { font-size: 11px; color: var(--fg-mute); font-style: italic; margin-top: 2px; }
.fight-boss b { color: var(--danger); }
.fight-you b { color: var(--ok); }

/* === QUESTS === */
.quest-tabs {
    display: flex;
    margin-bottom: 14px;
    background: var(--metal);
    border: 2px solid var(--border-strong);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 3px 0 #0a0805;
}
.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    border-right: 1px solid var(--border);
    padding: 12px 10px;
    color: var(--fg-mute);
    font-family: "Bebas Neue", sans-serif;
    font-size: 14px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
}
.tab-btn:last-child { border-right: none; }
.tab-btn.active {
    background: var(--gold);
    color: #1a1410;
    text-shadow: 0 1px 0 rgba(255,255,255,0.3);
}
.quest-list { display: flex; flex-direction: column; gap: 10px; padding-bottom: 100px; }
.quest-card {
    background: var(--metal);
    border: 2px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 14px 12px 12px;
    position: relative;
    box-shadow: 0 3px 0 #0a0805;
    overflow: hidden;
}
.quest-card.is-done { border-color: var(--ok); }
.quest-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.quest-head .quest-title { flex: 1; }
.quest-head .quest-type { flex-shrink: 0; }
.quest-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}
.quest-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    background: var(--bg);
    border: 1.5px solid var(--border-strong);
    border-radius: 8px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.quest-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
}
.quest-card.is-done .quest-icon { border-color: var(--ok); }
.quest-list--locked .quest-icon { opacity: 0.6; }
.quest-title {
    font-family: "Bebas Neue", sans-serif;
    color: var(--accent);
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.05;
}
.quest-type {
    font-size: 9px;
    color: var(--fg-mute);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 6px;
    white-space: nowrap;
}
.quest-desc {
    font-size: 13px;
    color: var(--fg);
    margin: 6px 0 10px;
    line-height: 1.4;
}
.quest-progress { margin-bottom: 10px; }
.quest-progress .bar {
    background: #0a0805;
    border: 1px solid var(--border);
    border-radius: 4px;
    height: 10px;
    overflow: hidden;
    margin-bottom: 4px;
}
.quest-progress .fill {
    display: block;
    height: 100%;
    background: var(--gold);
    transition: width 0.3s;
    box-shadow: inset 0 -1px 0 rgba(0,0,0,0.2);
}
.quest-card.is-done .quest-progress .fill { background: var(--ok); }
.quest-progress .bar-text {
    font-size: 11px;
    color: var(--fg-mute);
    font-family: monospace;
    font-weight: 700;
}
.quest-reward {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.quest-reward span {
    background: var(--bg);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.quest-reward span img { width: 14px; height: 14px; object-fit: contain; }
.quest-action { text-align: center; }
.claim-btn {
    background: var(--gold);
    border: 2px solid #6a4010;
    border-radius: 6px;
    padding: 8px 20px;
    color: #1a1410;
    font-family: "Bebas Neue", sans-serif;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 0.06em;
    cursor: pointer;
    text-transform: uppercase;
}
.claim-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.claimed, .in-progress { font-size: 12px; color: var(--fg-mute); font-weight: 700; }
/* === LOCKED QUESTIONS === */
.locked-section {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 2px solid var(--border);
}
.locked-title {
    font-size: 11px;
    color: var(--fg-mute);
    margin-bottom: 8px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.locked-title::before {
    content: '';
    display: inline-block;
    width: 24px;
    height: 2px;
    background: var(--border);
    border-radius: 1px;
}
.locked-title::after {
    content: '';
    display: inline-block;
    width: 24px;
    height: 2px;
    background: var(--border);
    border-radius: 1px;
}
.quest-list--locked .quest-card {
    opacity: 0.35;
    filter: grayscale(0.7);
}
.quest-card .lock-info {
    font-size: 11px;
    color: var(--danger);
    text-align: center;
    padding: 4px 0 0;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* === CLAN === */
.clan-card {
    background: var(--metal);
    border: 2px solid var(--accent-2);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 4px 0 #0a0805;
}
.clan-card h2 {
    font-family: "Bebas Neue", sans-serif;
    font-size: 22px;
    margin-bottom: 6px;
    color: var(--accent);
    letter-spacing: 0.04em;
}
.clan-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; font-size: 12px; }
.clan-meta span {
    background: var(--bg);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid var(--border);
    color: var(--fg);
}
/* Clan empty/create section */
.clan-empty {
    background: var(--metal);
    border: 2px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 20px 16px;
    margin-bottom: 14px;
    text-align: center;
}
.clan-empty h2 {
    font-family: "Bebas Neue", sans-serif;
    font-size: 20px;
    color: var(--accent);
    margin-bottom: 8px;
    letter-spacing: 0.04em;
}
.clan-empty p {
    font-size: 13px;
    color: var(--fg-mute);
    margin-bottom: 0;
}
.clan-create {
    margin-bottom: 16px;
}
.clan-input {
    width: 100%;
    padding: 12px 14px;
    background: #1a1612;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--fg);
    font-family: inherit;
    font-size: 14px;
    margin-bottom: 10px;
    transition: border-color 0.15s;
}
.clan-input::placeholder { color: var(--fg-mute); }
.clan-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(232,164,74,0.15); }
.clan-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.clan-btn {
    flex: 1;
    background: var(--gold);
    border: 2px solid #6a4010;
    border-radius: var(--radius-sm);
    padding: 10px;
    color: #1a1410;
    font-family: "Bebas Neue", sans-serif;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 0.04em;
    cursor: pointer;
    text-transform: uppercase;
}
.clan-btn.secondary {
    background: var(--metal);
    color: var(--fg);
    border-color: var(--border-strong);
}
.clan-btn:active:not(:disabled) { transform: translateY(2px); }
.clan-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* === ACHIEVEMENTS === */
.ach-list { display: flex; flex-direction: column; gap: 10px; padding-bottom: 100px; }
.ach-card {
    background: var(--metal);
    border: 2px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 14px;
    position: relative;
    box-shadow: 0 3px 0 #0a0805;
    display: flex;
    align-items: center;
    gap: 12px;
}
.ach-card.is-unlocked {
    border-color: var(--accent);
    background: linear-gradient(135deg, var(--metal) 0%, rgba(232,164,74,0.1) 100%);
}
.ach-icon {
    font-size: 32px;
    width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
    padding: 6px;
}
.ach-icon img { width: 100%; height: 100%; object-fit: contain; }
.ach-card.is-unlocked .ach-icon { border-color: var(--accent); }
.ach-info { flex: 1; min-width: 0; }
.ach-name {
    font-family: "Bebas Neue", sans-serif;
    color: var(--accent);
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 0.04em;
}
.ach-card.is-locked .ach-name { color: var(--fg-mute); }
.ach-desc { font-size: 12px; color: var(--fg-mute); margin-top: 2px; }
.ach-date { font-size: 10px; color: var(--ok); margin-top: 2px; font-weight: 700; }

/* === BATTLE === */
.battle-vs {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    background: var(--metal);
    border: 2px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: 0 3px 0 #0a0805;
}
.vs-player { text-align: center; }
.vs-vs {
    font-family: "Bebas Neue", sans-serif;
    font-size: 24px;
    color: var(--accent);
    text-shadow: 0 0 12px rgba(232,164,74,0.5);
    letter-spacing: 0.06em;
}
.avatar {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--border-strong);
    object-fit: cover;
    margin: 0 auto 6px;
    display: block;
}
.vs-name {
    font-family: "Bebas Neue", sans-serif;
    color: var(--fg);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.04em;
}
.vs-status { font-size: 11px; color: var(--fg-mute); margin-top: 2px; }
.battle-result-banner {
    text-align: center;
    padding: 14px;
    border-radius: var(--radius);
    font-family: "Bebas Neue", sans-serif;
    font-size: 20px;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
}
.battle-result-banner.win { background: rgba(109,186,79,0.15); border: 2px solid var(--ok); color: var(--ok); }
.battle-result-banner.lose { background: rgba(208,69,69,0.15); border: 2px solid var(--danger); color: var(--danger); }
.battle-log {
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px;
    max-height: 300px;
    overflow-y: auto;
    font-size: 12px;
    margin-bottom: 12px;
}
.battle-log-entry {
    padding: 4px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.battle-log-entry:last-child { border-bottom: none; }
.battle-meta {
    display: flex;
    justify-content: space-around;
    gap: 8px;
    font-size: 12px;
    color: var(--fg-mute);
    margin-bottom: 12px;
}
.battle-meta b { color: var(--accent); font-family: "Bebas Neue", sans-serif; font-size: 14px; }
.battle-actions { display: flex; gap: 8px; }
.battle-btn {
    flex: 1;
    background: var(--metal);
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 10px;
    color: var(--fg);
    text-align: center;
    text-decoration: none;
    font-family: "Bebas Neue", sans-serif;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 0.04em;
}

/* === SHARE (T9 marketing) === */
.share-slot { margin-top: 10px; }
.share-btn {
    display: block;
    width: 100%;
    background: linear-gradient(180deg, #2d9a4f 0%, #1f7a3c 50%, #155c2c 100%);
    border: 2px solid #6dba4f;
    border-radius: var(--radius);
    padding: 12px 14px;
    color: #fff;
    text-align: center;
    font-family: "Bebas Neue", sans-serif;
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
    box-shadow: 0 3px 0 #0a3d1c, 0 4px 12px rgba(0,0,0,0.5);
    cursor: pointer;
    transition: transform 0.08s ease, box-shadow 0.08s ease;
    -webkit-tap-highlight-color: transparent;
}
.share-btn:hover { filter: brightness(1.08); }
.share-btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 #0a3d1c, 0 2px 6px rgba(0,0,0,0.5);
}
.fight-result .share-btn { margin-top: 12px; }

/* === ACHIEVEMENT POPUP === */
.ach-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: pop 0.3s ease;
}
@keyframes pop { from { transform: scale(0.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.ach-popup {
    background: var(--metal);
    border: 3px solid var(--accent);
    border-radius: var(--radius);
    padding: 24px 20px;
    max-width: 340px;
    width: 100%;
    text-align: center;
    box-shadow: 0 0 40px rgba(232,164,74,0.4), 0 8px 32px rgba(0,0,0,0.8);
}
.ach-confetti { font-size: 18px; margin-bottom: 8px; }
.ach-popup-icon {
    width: 96px;
    height: 96px;
    margin: 0 auto 8px;
    background: var(--bg);
    border: 2px solid var(--accent);
    border-radius: 50%;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(232,164,74,0.4);
}
.ach-popup-icon img { width: 100%; height: 100%; object-fit: contain; }
.ach-popup-label {
    font-size: 12px;
    color: var(--accent);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 700;
}
.ach-popup-name {
    font-family: "Bebas Neue", sans-serif;
    font-size: 28px;
    color: var(--fg);
    margin: 4px 0 6px;
    letter-spacing: 0.04em;
}
.ach-popup-desc { font-size: 13px; color: var(--fg-mute); margin-bottom: 14px; }
.ach-popup-btn {
    background: var(--gold);
    border: 2px solid #6a4010;
    border-radius: var(--radius-sm);
    padding: 10px 24px;
    color: #1a1410;
    font-family: "Bebas Neue", sans-serif;
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 0.06em;
    cursor: pointer;
}

/* === STAGE / RATING === */
.rating-item {
    background: var(--metal);
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    transition: transform 0.1s;
}
.rating-item:active { transform: scale(0.99); }
.rating-item.is-self {
    border-color: var(--accent);
    background: linear-gradient(90deg, var(--metal) 0%, rgba(232,164,74,0.1) 100%);
}
.rank {
    font-family: "Bebas Neue", sans-serif;
    font-size: 18px;
    font-weight: 900;
    color: var(--fg-mute);
    min-width: 28px;
    text-align: center;
}
.rank.top1 { color: gold; }
.rank.top2 { color: silver; }
.rank.top3 { color: #cd7f32; }
.player-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
}
.player-meta { font-size: 11px; color: var(--fg-mute); }
.player-stats { text-align: right; font-size: 12px; }
.player-stats .rating {
    color: var(--accent);
    font-weight: 900;
    font-family: "Bebas Neue", sans-serif;
    font-size: 16px;
}
.player-stats .br { color: var(--fg-mute); font-size: 10px; }

/* === TG required === */
.tg-required {
    background: var(--metal);
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    padding: 20px;
    margin: 16px;
    text-align: center;
}
.tg-required h2 { color: var(--accent); margin-bottom: 8px; font-size: 16px; }
.tg-required p { color: var(--fg-mute); font-size: 13px; margin-bottom: 12px; }
.open-tg-btn {
    display: inline-block;
    background: var(--gold);
    color: #1a1410;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 900;
}

/* === ERROR STATE === */
.error-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--fg-mute);
}
.error-state-ico {
    font-size: 48px;
    margin-bottom: 12px;
    display: block;
    filter: drop-shadow(0 2px 8px rgba(208,69,69,0.3));
    animation: error-bob 2s ease-in-out infinite;
}
@keyframes error-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}
.error-state-msg {
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 16px;
    color: var(--fg);
}
.error-state-sub {
    font-size: 12px;
    color: var(--fg-mute);
    margin-bottom: 20px;
}
.retry-btn {
    background: var(--gold);
    border: 2px solid #6a4010;
    border-radius: var(--radius-sm);
    padding: 10px 24px;
    color: #1a1410;
    font-family: "Bebas Neue", sans-serif;
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 0.06em;
    cursor: pointer;
    text-transform: uppercase;
    box-shadow: 0 3px 0 #0a0805;
    transition: transform 0.1s, box-shadow 0.1s;
}
.retry-btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 #0a0805;
}
.retry-btn::before { content: '🔄 '; }

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--fg-mute);
}
.empty-state-ico {
    font-size: 48px;
    margin-bottom: 12px;
    display: block;
    opacity: 0.6;
}
.empty-state-msg {
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 8px;
    color: var(--fg);
}
.empty-state-sub {
    font-size: 12px;
    color: var(--fg-mute);
}

/* === SKELETON === */
@keyframes skeleton-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1. }
}
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 0%, var(--bg-card-2) 50%, var(--bg-card) 100%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite, skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-card {
    background: var(--metal);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 10px;
    display: flex;
    gap: 12px;
    align-items: center;
}
.skeleton-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
}
.skeleton-line {
    height: 12px;
    margin-bottom: 6px;
}
.skeleton-line.short { width: 40%; }
.skeleton-line.medium { width: 70%; }
.skeleton-line.long { width: 90%; }

/* === PROFILE BACK === */
.profile-back {
    margin: 18px 0 12px;
}
.profile-back-btn {
    text-decoration: none;
    color: var(--accent);
    padding: 14px 16px;
    font-size: 18px;
}
.profile-back-btn .big-cta-text {
    text-shadow: 0 1px 0 rgba(0,0,0,0.3);
}

/* ===========================================================================
 * T33: daily login bonus — streak card + reward modal
 * =========================================================================== */
.daily-streak-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    margin: 10px 14px 4px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #2a1410 0%, #401a10 100%);
    border: 1px solid var(--accent-2, #f4a04f);
    color: #fff8e7;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}
.daily-streak-card.hidden { display: none !important; }

/* T43: компактная карточка активных квестов на /index.
   Визуально — как daily-streak-card: маленькая, не отвлекает.
   Скрыта по умолчанию (class .hidden из HTML) — renderQuestProgressCard
   снимает hidden, если есть активные квесты. */
.quest-progress-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    margin: 4px 14px 4px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #14202a 0%, #1a2c40 100%);
    border: 1px solid rgba(120, 170, 230, .35);
    color: #f0f4ff;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
    transition: transform 0.1s ease, border-color 0.15s ease;
}
.quest-progress-card.hidden { display: none !important; }
.quest-progress-card:active { transform: scale(0.98); }
.quest-progress-card:hover { border-color: rgba(120, 170, 230, .65); }
.quest-progress-icon {
    font-size: 22px;
    line-height: 1;
    filter: drop-shadow(0 0 4px rgba(120, 170, 230, .35));
}
.quest-progress-list {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.qp-row {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.qp-row-text {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}
.qp-row-title {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.qp-row-meta {
    font-size: 11px;
    opacity: .8;
    white-space: nowrap;
}
.qp-row-bar {
    height: 4px;
    background: rgba(255, 255, 255, .08);
    border-radius: 2px;
    overflow: hidden;
}
.qp-row-fill {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #78aae6 0%, #b8e0a8 100%);
    transition: width 0.3s ease-out;
}
.quest-progress-cta,
.quest-progress-arrow {
    font-size: 18px;
    font-weight: 700;
    opacity: .55;
    flex-shrink: 0;
}
.daily-streak-flame {
    font-size: 28px;
    line-height: 1;
    filter: drop-shadow(0 0 6px rgba(255, 130, 30, .55));
}
.daily-streak-meta { flex: 1; min-width: 0; }
.daily-streak-label {
    font-size: 10px;
    letter-spacing: .12em;
    opacity: .75;
    margin-bottom: 2px;
    font-weight: 700;
}
.daily-streak-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
}
.daily-streak-val {
    font-size: 28px;
    font-weight: 900;
    line-height: 1;
    color: #ffb450;
}
.daily-streak-max {
    font-size: 11px;
    opacity: .8;
}

.daily-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .65);
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: daily-fade-in 0.2s ease-out;
}
.daily-modal-overlay.hidden { display: none !important; }
/* T-lock: prevent background page scroll while the daily modal is open (mobile TMA). */
body.daily-modal-open { overflow: hidden; }
.daily-modal {
    position: relative;
    background: linear-gradient(160deg, #2a1410 0%, #4a1a10 100%);
    border: 2px solid #f4a04f;
    border-radius: 14px;
    padding: 22px 20px 18px;
    max-width: 360px;
    width: 100%;
    text-align: center;
    color: #fff8e7;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .45);
    animation: daily-pop-in 0.32s cubic-bezier(.22,1.4,.36,1);
}
.daily-modal-close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: transparent;
    border: 0;
    color: #fff8e7;
    font-size: 20px;
    line-height: 1;
    opacity: .7;
    cursor: pointer;
}
.daily-modal-flame {
    font-size: 56px;
    line-height: 1;
    filter: drop-shadow(0 0 12px rgba(255, 130, 30, .6));
    margin-bottom: 4px;
}
.daily-modal-streak {
    font-size: 64px;
    font-weight: 900;
    line-height: 1;
    color: #ffb450;
    text-shadow: 0 2px 0 rgba(0, 0, 0, .35);
    margin: 6px 0;
}
.daily-modal-title {
    margin: 6px 0 12px;
    font-size: 18px;
    letter-spacing: .04em;
}
.daily-modal-reward {
    font-size: 22px;
    font-weight: 800;
    color: #ffd28a;
    margin-bottom: 6px;
}
.daily-modal-next {
    font-size: 13px;
    opacity: .8;
    margin-bottom: 14px;
}
.daily-modal-cta {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    border: 0;
    background: linear-gradient(180deg, #ffb450 0%, #d97a1c 100%);
    color: #2a1410;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: .08em;
    cursor: pointer;
    box-shadow: 0 3px 0 #6a3a14;
}
.daily-modal-cta:active { transform: translateY(1px); box-shadow: 0 2px 0 #6a3a14; }

@keyframes daily-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes daily-pop-in {
    from { opacity: 0; transform: translateY(12px) scale(.96); }
    to   { opacity: 1; transform: translateY(0)    scale(1);   }
}

/* T49: Welcome overlay — для brand-new user (cold profile). */
.welcome-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .72);
    z-index: 410;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: daily-fade-in 0.2s ease-out;
}
.welcome-modal-overlay.hidden { display: none !important; }
body.welcome-modal-open { overflow: hidden; }
body.boss-modal-open { overflow: hidden; }
.welcome-modal {
    position: relative;
    background: linear-gradient(160deg, #2a1410 0%, #4a1a10 100%);
    border: 2px solid #f4a04f;
    border-radius: 14px;
    padding: 22px 20px 18px;
    max-width: 380px;
    width: 100%;
    color: #fff8e7;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .45);
    animation: daily-pop-in 0.32s cubic-bezier(.22,1.4,.36,1);
}
.welcome-modal-emoji {
    font-size: 48px;
    line-height: 1;
    text-align: center;
    margin-bottom: 6px;
    filter: drop-shadow(0 0 12px rgba(255, 180, 80, .55));
}
.welcome-modal-title {
    margin: 4px 0 8px;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: .04em;
    text-align: center;
    color: #ffd28a;
}
.welcome-modal-sub {
    margin: 0 0 16px;
    font-size: 13px;
    line-height: 1.45;
    text-align: center;
    opacity: .88;
}
.welcome-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
}
.welcome-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(255, 180, 80, .07);
    border: 1px solid rgba(255, 180, 80, .18);
    border-radius: 10px;
    font-size: 13.5px;
    line-height: 1.4;
}
.welcome-step-icon {
    font-size: 22px;
    line-height: 1;
    flex-shrink: 0;
}
.welcome-step-text { color: #fff8e7; }
.welcome-step-text b { color: #ffd28a; }
.welcome-cta {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    border: 0;
    background: linear-gradient(180deg, #ffb450 0%, #d97a1c 100%);
    color: #2a1410;
    font-weight: 800;
    font-size: 15px;
    letter-spacing: .08em;
    cursor: pointer;
    box-shadow: 0 3px 0 #6a3a14;
}
.welcome-cta:active { transform: translateY(1px); box-shadow: 0 2px 0 #6a3a14; }
.welcome-cta:focus-visible { outline: 2px solid #ffd28a; outline-offset: 2px; }

/* === A11Y: respect prefers-reduced-motion ===
   Disables keyframe animations (pulse, bob, shimmer, pop, fade-in, lore-reveal)
   and zeroes transition durations for users who set reduce in their OS.
   Per WCAG 2.3.3 / 2.2.2: motion can trigger vestibular symptoms. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        animation-delay: 0ms !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}
