/* ============================================================
   RPG City — Frontend Styles
   Минимальный, расширяемый CSS для игрового интерфейса
   ============================================================ */

/* ── Переменные ────────────────────────────────────────────── */
:root {
    --rpg-primary:      #2E75B6;
    --rpg-primary-dark: #1F3864;
    --rpg-accent:       #375623;
    --rpg-danger:       #C55A11;
    --rpg-success:      #375623;
    --rpg-text:         #1a1a1a;
    --rpg-text-muted:   #666;
    --rpg-bg:           #f5f5f5;
    --rpg-bg-card:      #ffffff;
    --rpg-border:       #e0e0e0;
    --rpg-radius:       8px;
    --rpg-shadow:       0 2px 8px rgba(0,0,0,0.08);
}

/* ── Обёртка ───────────────────────────────────────────────── */
.rpg-wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--rpg-text);
}

/* ── HUD (шапка) ───────────────────────────────────────────── */
.rpg-hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--rpg-primary-dark);
    color: #fff;
    padding: 12px 16px;
    border-radius: var(--rpg-radius);
    margin-bottom: 8px;
}

.rpg-hud__name {
    font-size: 1.2em;
    font-weight: bold;
}

.rpg-hud__level {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    margin-left: 8px;
}

.rpg-hud__stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.rpg-stat {
    font-size: 0.9em;
    background: rgba(255,255,255,0.15);
    padding: 4px 8px;
    border-radius: 6px;
}

/* ── Опыт ──────────────────────────────────────────────────── */
.rpg-exp-bar {
    position: relative;
    background: var(--rpg-border);
    border-radius: 4px;
    height: 20px;
    margin-bottom: 8px;
    overflow: hidden;
}

.rpg-exp-bar__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--rpg-primary), #5BA3E0);
    transition: width 0.5s ease;
}

.rpg-exp-bar__label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.75em;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    white-space: nowrap;
}

/* ── Баннер активного действия ─────────────────────────────── */
.rpg-action-banner {
    padding: 10px 16px;
    border-radius: var(--rpg-radius);
    margin-bottom: 8px;
    font-size: 0.95em;
}

.rpg-action-banner--active {
    background: #FFF3CD;
    border: 1px solid #FFC107;
    color: #856404;
}

.rpg-action-banner--free {
    background: #D4EDDA;
    border: 1px solid #C3E6CB;
    color: #155724;
}

/* ── Лимит действий ────────────────────────────────────────── */
.rpg-daily-actions {
    text-align: right;
    font-size: 0.85em;
    color: var(--rpg-text-muted);
    margin-bottom: 12px;
}

/* ── Табы ──────────────────────────────────────────────────── */
.rpg-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--rpg-border);
    flex-wrap: wrap;
}

.rpg-tab {
    padding: 8px 16px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.95em;
    color: var(--rpg-text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
}

.rpg-tab:hover { color: var(--rpg-primary); }

.rpg-tab--active {
    color: var(--rpg-primary);
    border-bottom-color: var(--rpg-primary);
    font-weight: 600;
}

/* ── Содержимое таба ───────────────────────────────────────── */
.rpg-tab-content {
    background: var(--rpg-bg-card);
    border-radius: var(--rpg-radius);
    padding: 16px;
    box-shadow: var(--rpg-shadow);
    min-height: 200px;
}

.rpg-section h3 {
    margin: 0 0 8px;
    color: var(--rpg-primary-dark);
}

.rpg-hint {
    color: var(--rpg-text-muted);
    font-size: 0.875em;
    margin-bottom: 12px;
}

.rpg-coming-soon {
    text-align: center;
    padding: 40px;
    color: var(--rpg-text-muted);
    font-size: 1.1em;
}

/* ── Таблица работ ─────────────────────────────────────────── */
.rpg-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.rpg-table th {
    text-align: left;
    padding: 8px;
    background: var(--rpg-bg);
    border-bottom: 2px solid var(--rpg-border);
    color: var(--rpg-text-muted);
    font-weight: 600;
}

.rpg-table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--rpg-border);
    vertical-align: middle;
}

.rpg-table tr:last-child td { border-bottom: none; }

.rpg-hours-select {
    padding: 4px 8px;
    border: 1px solid var(--rpg-border);
    border-radius: 4px;
    font-size: 0.9em;
}

/* ── Карточки еды ──────────────────────────────────────────── */
.rpg-food-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.rpg-food-card {
    background: var(--rpg-bg);
    border-radius: var(--rpg-radius);
    padding: 12px;
    text-align: center;
    border: 1px solid var(--rpg-border);
    transition: box-shadow 0.2s;
}

.rpg-food-card:hover { box-shadow: var(--rpg-shadow); }

.rpg-food-card__icon  { font-size: 2em; margin-bottom: 6px; }
.rpg-food-card__name  { font-weight: 600; font-size: 0.85em; margin-bottom: 4px; }
.rpg-food-card__stats { font-size: 0.8em; color: var(--rpg-accent); margin-bottom: 4px; }
.rpg-food-card__price { font-weight: bold; color: var(--rpg-primary); margin-bottom: 8px; }

/* ── Кнопки ────────────────────────────────────────────────── */
.rpg-btn {
    display: inline-block;
    padding: 7px 14px;
    border-radius: 6px;
    border: 1px solid var(--rpg-border);
    background: #fff;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.15s, transform 0.1s;
    line-height: 1.4;
}

.rpg-btn:hover { background: var(--rpg-bg); }
.rpg-btn:active { transform: scale(0.97); }

.rpg-btn--primary {
    background: var(--rpg-primary);
    color: #fff;
    border-color: var(--rpg-primary);
}

.rpg-btn--primary:hover { background: var(--rpg-primary-dark); }

.rpg-btn--small { padding: 4px 10px; font-size: 0.8em; }

/* ── Уведомления ───────────────────────────────────────────── */
.rpg-notice {
    padding: 10px 16px;
    border-radius: var(--rpg-radius);
    margin-bottom: 8px;
    font-size: 0.9em;
}

.rpg-notice--success { background: #D4EDDA; border: 1px solid #C3E6CB; color: #155724; }
.rpg-notice--error   { background: #F8D7DA; border: 1px solid #F5C6CB; color: #721C24; }
.rpg-notice--info    { background: #D1ECF1; border: 1px solid #BEE5EB; color: #0C5460; }

/* ── Модальное окно ─────────────────────────────────────────── */
.rpg-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.rpg-modal {
    background: #fff;
    border-radius: var(--rpg-radius);
    padding: 24px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.rpg-modal h2 { margin: 0 0 16px; color: var(--rpg-primary-dark); }

.rpg-modal label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 0.9em;
}

.rpg-modal label input,
.rpg-modal label select {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 8px 10px;
    border: 1px solid var(--rpg-border);
    border-radius: 6px;
    font-size: 1em;
    box-sizing: border-box;
}

.rpg-modal__actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 16px;
}

/* ── Loading ───────────────────────────────────────────────── */
.rpg-loading {
    text-align: center;
    padding: 40px;
    color: var(--rpg-text-muted);
}

/* ── Лента событий ─────────────────────────────────────────── */
.rpg-feed {
    margin-top: 16px;
    font-size: 0.85em;
    color: var(--rpg-text-muted);
}

/* ── Жильё: таблица эффектов голода ───────────────────────────────── */
.rpg-hunger-effect-table {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 16px;
    font-size: 0.85em;
}
.rpg-hunger-row {
    display: grid;
    grid-template-columns: 60px 110px 1fr;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 4px;
    background: color-mix(in srgb, var(--col) 12%, white);
    border-left: 3px solid var(--col);
    color: var(--col);
}

/* ── Жильё: коммуналка ─────────────────────────────────────────────── */
.rpg-housing-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}
.rpg-housing-regen {
    background: #E8F5E9;
    color: #2E7D32;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
}
.rpg-housing-utility,
.rpg-housing-rent {
    background: var(--rpg-bg);
    padding: 12px;
    border-radius: var(--rpg-radius);
    margin-bottom: 12px;
}
.rpg-housing-utility__balance { margin-bottom: 8px; }
.rpg-housing-utility__actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.rpg-input-small {
    width: 80px;
    padding: 5px 8px;
    border: 1px solid var(--rpg-border);
    border-radius: 5px;
    font-size: 0.9em;
}

/* ── Мебель: список и магазин ──────────────────────────────────────── */
.rpg-furniture-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.rpg-furniture-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--rpg-bg);
    border-radius: 6px;
    font-size: 0.9em;
}
.rpg-furniture-item__name { flex: 1; }
.rpg-furniture-item__tier { font-size: 0.75em; }
.rpg-furniture-shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 10px;
}
.rpg-furniture-shop-item {
    background: var(--rpg-bg);
    border: 1px solid var(--rpg-border);
    border-radius: var(--rpg-radius);
    padding: 10px;
    font-size: 0.88em;
}

/* ── Покупка квартир ───────────────────────────────────────────────── */
.rpg-apt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
    margin-top: 10px;
}
.rpg-apt-card {
    border: 1px solid var(--rpg-border);
    border-radius: var(--rpg-radius);
    padding: 14px;
    background: var(--rpg-bg-card);
    box-shadow: var(--rpg-shadow);
}
.rpg-apt-card--locked { opacity: 0.65; }
.rpg-apt-card__head   { display: flex; justify-content: space-between; margin-bottom: 6px; }
.rpg-apt-card__stats  { font-size: 0.82em; color: var(--rpg-text-muted); margin-bottom: 8px; }
.rpg-apt-card__price  { display: flex; align-items: center; gap: 8px; }

/* ── Бизнес-панель ─────────────────────────────────────────────────── */
.rpg-biz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.rpg-biz-finances {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}
.rpg-biz-stat {
    background: var(--rpg-bg);
    border-radius: var(--rpg-radius);
    padding: 10px;
    text-align: center;
}
.rpg-biz-stat span  { display: block; font-size: 0.78em; color: var(--rpg-text-muted); }
.rpg-biz-stat strong{ font-size: 1.1em; }
.rpg-biz-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

/* ── Оборудование ──────────────────────────────────────────────────── */
.rpg-eq-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding: 8px;
    background: var(--rpg-bg);
    border-radius: 6px;
}
.rpg-eq-shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 8px;
}
.rpg-eq-card {
    border: 1px solid var(--rpg-border);
    border-radius: var(--rpg-radius);
    padding: 10px;
    background: var(--rpg-bg-card);
    font-size: 0.88em;
}
.rpg-eq-card--current { border-color: var(--rpg-primary); background: #E3F2FD; }

/* ── Склад бизнеса ─────────────────────────────────────────────────── */
.rpg-storage-grid { display: flex; flex-direction: column; gap: 4px; }
.rpg-storage-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 10px;
    background: var(--rpg-bg);
    border-radius: 5px;
    font-size: 0.9em;
}

/* ── Тиры оборудования/мебели ──────────────────────────────────────── */
.rpg-tier--basic      { color: #666;    font-size: 0.78em; }
.rpg-tier--improved   { color: #1565c0; font-size: 0.78em; }
.rpg-tier--industrial,
.rpg-tier--premium    { color: #6a1b9a; font-size: 0.78em; font-weight: 600; }

/* ── Badges ────────────────────────────────────────────────────────── */
.rpg-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.78em;
    background: var(--rpg-bg);
    color: var(--rpg-text-muted);
    border: 1px solid var(--rpg-border);
}
.rpg-badge--locked { background: #fce4d6; color: #c55a11; border-color: #c55a11; }

/* ── Прочие утилиты ────────────────────────────────────────────────── */
.rpg-divider     { border: none; border-top: 1px solid var(--rpg-border); margin: 14px 0; }
.rpg-text-muted  { color: var(--rpg-text-muted); }
.rpg-row--locked { opacity: 0.55; pointer-events: none; }
.rpg-table-wrap  { overflow-x: auto; }
.rpg-btn--full   { width: 100%; }
.rpg-btn--danger { border-color: var(--rpg-danger); color: var(--rpg-danger); }
.rpg-btn--danger:hover { background: #FBE9E7; }

/* ── Лента событий ─────────────────────────────────────────────────── */
.rpg-feed__title    { margin: 12px 0 6px; font-size: 0.9em; color: var(--rpg-text-muted); }
.rpg-feed-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 5px 0;
    border-bottom: 1px solid var(--rpg-border);
    font-size: 0.85em;
}
.rpg-feed-item:last-child  { border-bottom: none; }
.rpg-feed-item__icon { font-size: 1em; }
.rpg-feed-item__text { flex: 1; }
.rpg-feed-item__time { color: var(--rpg-text-muted); white-space: nowrap; }

/* ── Auth-страница ─────────────────────────────────────────────────── */
.rpg-auth-wrap {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}
.rpg-auth-card {
    background: var(--rpg-bg-card);
    border-radius: var(--rpg-radius);
    padding: 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.10);
}
.rpg-auth-card__title { margin: 0 0 4px; color: var(--rpg-primary-dark); }
.rpg-auth-card__sub   { color: var(--rpg-text-muted); margin: 0 0 20px; font-size: 0.9em; }
.rpg-auth-label {
    display: block;
    margin-bottom: 14px;
    font-size: 0.9em;
    font-weight: 600;
    color: var(--rpg-text);
}
.rpg-auth-label input,
.rpg-auth-label select {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 9px 12px;
    border: 1.5px solid var(--rpg-border);
    border-radius: 6px;
    font-size: 1em;
    box-sizing: border-box;
    transition: border-color 0.2s;
}
.rpg-auth-label input:focus { border-color: var(--rpg-primary); outline: none; }
.rpg-auth-divider {
    border: none;
    border-top: 1px solid var(--rpg-border);
    margin: 18px 0 10px;
}
.rpg-auth-section-title { font-weight: 700; margin: 0 0 12px; color: var(--rpg-primary-dark); }
.rpg-auth-switch { text-align: center; margin-top: 16px; font-size: 0.9em; color: var(--rpg-text-muted); }
.rpg-auth-switch a { color: var(--rpg-primary); text-decoration: none; font-weight: 600; }
.rpg-gender-select { display: flex; gap: 12px; margin-top: 6px; }
.rpg-gender-option {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1.5px solid var(--rpg-border);
    border-radius: 6px;
    cursor: pointer;
    font-weight: normal;
    transition: border-color 0.2s;
}
.rpg-gender-option:has(input:checked) { border-color: var(--rpg-primary); background: #EEF5FF; }

/* ── Рынок: подтабы ────────────────────────────────────────────────── */
.rpg-market-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--rpg-border);
}
.rpg-market-tab {
    padding: 6px 12px;
    border: 1px solid var(--rpg-border);
    border-radius: 20px;
    background: #fff;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.15s;
    color: var(--rpg-text-muted);
}
.rpg-market-tab:hover { background: var(--rpg-bg); }
.rpg-market-tab--active {
    background: var(--rpg-primary);
    color: #fff;
    border-color: var(--rpg-primary);
}

/* ── Рынок бизнесов: карточки ──────────────────────────────────────── */
.rpg-biz-listing-card {
    border: 1px solid var(--rpg-border);
    border-radius: var(--rpg-radius);
    padding: 14px;
    margin-bottom: 12px;
    background: var(--rpg-bg-card);
    box-shadow: var(--rpg-shadow);
}
.rpg-biz-listing-card__head {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    flex-wrap: wrap;
    gap: 4px;
}
.rpg-biz-listing-card__stats {
    font-size: 0.85em;
    color: var(--rpg-text-muted);
    margin-bottom: 6px;
}
.rpg-biz-listing-card__warn {
    font-size: 0.8em;
    color: var(--rpg-danger);
    background: #FBE9E7;
    padding: 6px 10px;
    border-radius: 4px;
    margin-bottom: 8px;
}
.rpg-biz-listing-card__price {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ── Аукционы: карточки ─────────────────────────────────────────────── */
.rpg-auction-card {
    border: 2px solid var(--rpg-primary);
    border-radius: var(--rpg-radius);
    padding: 14px;
    margin-bottom: 14px;
    background: linear-gradient(135deg, #f0f7ff 0%, #fff 100%);
}
.rpg-auction-card__head {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    flex-wrap: wrap;
    gap: 4px;
}
.rpg-auction-card__stats {
    font-size: 0.9em;
    margin-bottom: 4px;
}
.rpg-auction-card__bid {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--rpg-border);
}

/* ── Выставление товара ─────────────────────────────────────────────── */
.rpg-list-item-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 10px;
}
.rpg-select-small {
    padding: 5px 8px;
    border: 1px solid var(--rpg-border);
    border-radius: 5px;
    font-size: 0.9em;
    max-width: 200px;
}

/* ── Случайные события: модальное окно ──────────────────────────────── */
.rpg-event-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 16px;
}
.rpg-event-card {
    background: #fff;
    border-radius: 16px;
    border-left: 6px solid var(--rpg-primary);
    padding: 32px 28px;
    max-width: 440px;
    width: 100%;
    text-align: center;
    box-shadow: 0 16px 48px rgba(0,0,0,0.25);
    animation: rpg-event-in 0.3s ease;
}
@keyframes rpg-event-in {
    from { transform: scale(0.85); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}
.rpg-event-card__icon     { font-size: 3em; margin-bottom: 8px; }
.rpg-event-card__category { font-size: 0.75em; font-weight: 700; letter-spacing: 1px; margin-bottom: 6px; }
.rpg-event-card__title    { margin: 0 0 10px; font-size: 1.3em; color: #1a1a1a; }
.rpg-event-card__desc     { color: #555; font-size: 0.95em; line-height: 1.5; margin-bottom: 16px; }
.rpg-event-card__effects  {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 10px;
    border-radius: 8px;
    border: 2px solid;
    margin-bottom: 20px;
    font-weight: 600;
    font-size: 1.05em;
}
.rpg-event-close { min-width: 140px; }

/* ── Мафия: карточка ────────────────────────────────────────────────── */
.rpg-mafia-card {
    border-left: 4px solid var(--rpg-danger);
    background: #FFF8F7;
    padding: 12px 14px;
    border-radius: 0 var(--rpg-radius) var(--rpg-radius) 0;
    margin-bottom: 8px;
}
.rpg-mafia-card__name  { font-weight: 700; font-size: 1.05em; margin-bottom: 6px; }
.rpg-mafia-card__stats { font-size: 0.88em; color: var(--rpg-text-muted); margin-bottom: 4px; }
.rpg-mafia-card__fee   { font-size: 0.9em; margin-bottom: 6px; }
.rpg-mafia-card__rep   { font-size: 0.88em; margin-bottom: 10px; }

/* ── Репутация: прогресс-бар ─────────────────────────────────────────── */
.rpg-rep-bar {
    background: var(--rpg-border);
    border-radius: 4px;
    height: 6px;
    margin-top: 4px;
    overflow: hidden;
}
.rpg-rep-bar__fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
}

/* ════════════════════════════════════════════════════════════
   AUTH FORMS
   ════════════════════════════════════════════════════════════ */
.rpg-auth-wrap {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}
.rpg-auth-card {
    background: var(--rpg-bg-card);
    border-radius: var(--rpg-radius);
    padding: 36px 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.10);
}
.rpg-auth-card--wide { max-width: 540px; }

.rpg-auth-card__logo  { font-size: 2.5em; text-align: center; margin-bottom: 8px; }
.rpg-auth-card__title {
    margin: 0 0 4px;
    text-align: center;
    font-size: 1.5em;
    color: var(--rpg-primary-dark);
}
.rpg-auth-card__sub {
    text-align: center;
    color: var(--rpg-text-muted);
    font-size: 0.9em;
    margin: 0 0 24px;
}
.rpg-auth-section {
    background: var(--rpg-bg);
    border-radius: var(--rpg-radius);
    padding: 16px;
    margin-bottom: 16px;
}
.rpg-auth-section__label {
    font-weight: 700;
    font-size: 0.85em;
    color: var(--rpg-text-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 12px;
}
.rpg-auth-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media(max-width:480px){ .rpg-auth-row { grid-template-columns: 1fr; } }

.rpg-auth-label {
    display: block;
    margin-bottom: 12px;
    font-size: 0.9em;
    font-weight: 600;
    color: var(--rpg-text);
}
.rpg-auth-label input,
.rpg-auth-label select {
    display: block;
    width: 100%;
    margin-top: 5px;
    padding: 10px 12px;
    border: 1.5px solid var(--rpg-border);
    border-radius: 7px;
    font-size: 1em;
    box-sizing: border-box;
    transition: border-color 0.15s;
    background: #fff;
}
.rpg-auth-label input:focus { border-color: var(--rpg-primary); outline: none; }
.rpg-auth-hint { display: block; margin-top: 4px; font-size: 0.78em; color: var(--rpg-text-muted); font-weight: normal; }

/* Пол */
.rpg-gender-select {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 6px;
}
.rpg-gender-option { display: block; cursor: pointer; }
.rpg-gender-option input { display: none; }
.rpg-gender-option__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 10px;
    border: 2px solid var(--rpg-border);
    border-radius: var(--rpg-radius);
    transition: border-color 0.15s, background 0.15s;
    text-align: center;
}
.rpg-gender-option input:checked + .rpg-gender-option__inner {
    border-color: var(--rpg-primary);
    background: #EEF5FF;
}
.rpg-gender-option__icon { font-size: 1.8em; margin-bottom: 4px; }
.rpg-gender-option__text { font-size: 0.88em; font-weight: 600; }

/* Стартовые условия */
.rpg-auth-start-info {
    background: #E8F5E9;
    border-radius: var(--rpg-radius);
    padding: 12px 16px;
    margin-bottom: 16px;
}
.rpg-auth-start-info__title { font-size: 0.85em; color: #2e7d32; font-weight: 700; margin-bottom: 6px; }
.rpg-auth-start-info__items { display: flex; gap: 12px; flex-wrap: wrap; font-size: 0.88em; color: #2e7d32; }

.rpg-auth-switch {
    text-align: center;
    margin-top: 16px;
    font-size: 0.9em;
    color: var(--rpg-text-muted);
}
.rpg-auth-switch a { color: var(--rpg-primary); font-weight: 600; text-decoration: none; }
.rpg-auth-switch a:hover { text-decoration: underline; }

/* ════════════════════════════════════════════════════════════
   PROFILE PAGE
   ════════════════════════════════════════════════════════════ */
.rpg-profile {}

.rpg-profile-header {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    background: var(--rpg-primary-dark);
    color: #fff;
    padding: 20px;
    border-radius: var(--rpg-radius);
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.rpg-profile-avatar {
    position: relative;
    flex-shrink: 0;
}
.rpg-profile-avatar img,
.rpg-profile-avatar__placeholder {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.4);
    object-fit: cover;
    font-size: 2.5em;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.15);
}
.rpg-profile-premium {
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    background: #FFC107;
    color: #333;
    font-size: 0.65em;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 8px;
    white-space: nowrap;
}
.rpg-profile-identity   { flex: 1; min-width: 200px; }
.rpg-profile-name       { margin: 0 0 8px; font-size: 1.4em; color: #fff; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rpg-profile-level      { background: rgba(255,255,255,0.2); padding: 3px 10px; border-radius: 12px; font-size: 0.65em; font-weight: 700; }
.rpg-profile-money      { font-size: 1.05em; font-weight: 600; margin-top: 4px; }

.rpg-profile-exp-bar {
    position: relative;
    height: 18px;
    background: rgba(255,255,255,0.2);
    border-radius: 9px;
    overflow: hidden;
    margin-bottom: 4px;
}
.rpg-profile-exp-fill {
    height: 100%;
    background: #FFC107;
    border-radius: 9px;
    transition: width 0.5s;
}
.rpg-profile-exp-bar span {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75em;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

/* Секции профиля */
.rpg-profile-section {
    background: var(--rpg-bg-card);
    border-radius: var(--rpg-radius);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--rpg-shadow);
}
.rpg-profile-section__title {
    margin: 0 0 12px;
    font-size: 1em;
    color: var(--rpg-primary-dark);
    font-weight: 700;
}

/* Сетка статов */
.rpg-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
}
.rpg-stat-card {
    background: var(--rpg-bg);
    border-radius: var(--rpg-radius);
    padding: 10px;
    text-align: center;
    border: 1px solid var(--rpg-border);
}
.rpg-stat-card__icon  { font-size: 1.4em; }
.rpg-stat-card__value { font-weight: 700; font-size: 1.05em; margin: 4px 0 2px; }
.rpg-stat-card__label { font-size: 0.75em; color: var(--rpg-text-muted); }

/* Действия: точки */
.rpg-profile-actions-bar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.rpg-action-dot {
    width: 20px; height: 20px;
    border-radius: 50%;
    background: var(--rpg-bg);
    border: 2px solid var(--rpg-border);
    transition: background 0.2s;
}
.rpg-action-dot--used { background: var(--rpg-primary); border-color: var(--rpg-primary); }
.rpg-profile-actions-label { font-size: 0.85em; color: var(--rpg-text-muted); margin-left: 4px; }

/* Карточка жилья/бизнеса */
.rpg-profile-card { padding: 4px 0; }
.rpg-profile-card__name {
    display: flex; align-items: center; gap: 8px;
    font-weight: 700; margin-bottom: 4px; flex-wrap: wrap;
}
.rpg-profile-card__stats { font-size: 0.88em; color: var(--rpg-text-muted); margin-bottom: 4px; }
.rpg-profile-card__balance { font-size: 0.9em; margin-top: 6px; }

/* Фракции */
.rpg-profile-factions { display: flex; flex-direction: column; gap: 10px; }
.rpg-faction-row { display: grid; grid-template-columns: 140px 1fr 100px; gap: 10px; align-items: center; }
@media(max-width:480px){ .rpg-faction-row { grid-template-columns: 1fr; gap: 4px; } }
.rpg-faction-row__name  { font-weight: 600; font-size: 0.9em; }
.rpg-faction-row__value { font-size: 0.85em; text-align: right; }

/* Код операции */
.rpg-tx-code {
    font-family: monospace;
    font-size: 0.82em;
    background: var(--rpg-bg);
    padding: 1px 5px;
    border-radius: 3px;
    color: var(--rpg-primary-dark);
}

/* Кнопки профиля */
.rpg-profile-footer {
    display: flex;
    gap: 10px;
    padding-top: 8px;
    flex-wrap: wrap;
}


/* ── Аватары и выбор персонажа ─────────────────────────────── */
.rpg-auth-card--wide { max-width: 720px; }
.rpg-avatar-picker { display: grid; gap: 12px; margin-top: 6px; }
.rpg-avatar-picker__group { display: none; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.rpg-avatar-picker__group.is-active { display: grid; }
.rpg-avatar-option { display: block; cursor: pointer; }
.rpg-avatar-option input { display: none; }
.rpg-avatar-option img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 18px;
    border: 3px solid transparent;
    background: #f3f4f6;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.rpg-avatar-option:hover img { transform: translateY(-2px); }
.rpg-avatar-option.is-selected img,
.rpg-avatar-option input:checked + img {
    border-color: var(--rpg-primary);
    box-shadow: 0 0 0 3px rgba(46,117,182,0.12);
}
.rpg-hud__identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.rpg-hud__avatar {
    width: 54px; height: 54px; flex: 0 0 54px;
    border-radius: 50%; overflow: hidden; background: rgba(255,255,255,0.12);
    border: 2px solid rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 28px;
}
.rpg-hud__avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 640px) {
    .rpg-avatar-picker__group { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rpg-hud { align-items: flex-start; gap: 12px; }
    .rpg-hud__stats { justify-content: flex-start; }
}
