/* ============================================
   ФАЙЛ: css/style.css
   СОВРЕМЕННЫЙ ДИЗАЙН (без лишних эффектов)
   ============================================ */

:root {
    --bg: #0b1220;
    --card: #151f33;
    --card-2: #101a2c;
    --border: #26334d;
    --text: #eef3fa;
    --muted: #8fa0b8;
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #22c55e;
    --radius: 16px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-tap-highlight-color: transparent;
}

/* ---------- Контейнер ---------- */
.app {
    max-width: 560px;
    margin: 0 auto;
    padding: 16px 16px 48px;
}

/* ---------- Шапка ---------- */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.header h1 { font-size: 20px; font-weight: 700; }
.header-right { display: flex; gap: 8px; flex-wrap: wrap; }

.user-badge, .day-badge {
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    background: rgba(59,130,246,.15);
    color: #9cc3ff;
    border: 1px solid rgba(59,130,246,.35);
}
.day-badge {
    background: rgba(124,58,237,.15);
    color: #cbb0ff;
    border-color: rgba(124,58,237,.35);
}

/* ---------- Статистика ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 18px;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.stat-icon { font-size: 20px; }
.stat-label { font-size: 12px; color: var(--muted); }
.stat-card b { font-size: 15px; font-weight: 700; }

.licenses, .faction-badge {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 14px;
    font-size: 14px;
    color: var(--muted);
}
.licenses b, .faction-badge b { color: var(--text); }

/* ---------- Кнопки ---------- */
.btn {
    display: inline-block;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    color: #fff;
    cursor: pointer;
    transition: background .15s, transform .05s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .4; cursor: not-allowed; }

.btn-primary { background: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { background: var(--danger); }
.btn-warning { background: var(--warning); color: #1a1a1a; }
.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
}
.btn.small { padding: 8px 14px; font-size: 13px; }

.main-buttons { display: flex; flex-direction: column; gap: 10px; }
.mt { margin-top: 14px; }

/* ---------- Карточки ---------- */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
}
.card h3 { font-size: 16px; margin-bottom: 8px; }

.item-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.item-info { display: flex; gap: 12px; align-items: center; }
.item-icon { font-size: 30px; }
.item-desc { font-size: 13px; color: var(--muted); margin-top: 2px; }
.item-price { font-size: 14px; font-weight: 700; color: var(--success); margin-top: 4px; }
.item-req { font-size: 12px; color: var(--muted); margin-top: 2px; }

.balance-bar {
    background: rgba(34,197,94,.1);
    border: 1px solid rgba(34,197,94,.35);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 15px;
}

/* ---------- Вход / Регистрация ---------- */
.auth-wrap {
    max-width: 420px;
    margin: 0 auto;
    padding: 48px 16px;
}

.logo {
    text-align: center;
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 28px;
    letter-spacing: -.5px;
}

.auth-wrap .card { padding: 20px; }

.tabs {
    display: flex;
    background: var(--card-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
    margin-bottom: 18px;
}
.tab {
    flex: 1;
    padding: 11px;
    background: transparent;
    border: none;
    border-radius: 9px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.tab.active { background: var(--primary); color: #fff; }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ---------- Поля ввода ---------- */
input[type="text"], input[type="password"], input[type="number"], select {
    width: 100%;
    padding: 14px;
    margin-bottom: 12px;
    background: var(--card-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 15px;
}
input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
}
input::placeholder { color: var(--muted); }

/* ---------- Алерты ---------- */
.alert {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 14px;
    font-size: 14px;
}
.alert.error {
    background: rgba(239,68,68,.12);
    border: 1px solid rgba(239,68,68,.4);
    color: #fca5a5;
}
.alert.info {
    background: rgba(59,130,246,.12);
    border: 1px solid rgba(59,130,246,.4);
    color: #9cc3ff;
}

/* ---------- Таблицы ---------- */
.info-table { width: 100%; border-collapse: collapse; }
.info-table td {
    padding: 9px 4px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.info-table td:first-child { color: var(--muted); }

.tx-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tx-table th, .tx-table td {
    padding: 8px 6px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}
.tx-table th { color: var(--muted); font-weight: 600; }
.green { color: var(--success); }
.red { color: var(--danger); }

.admin-role {
    background: rgba(239,68,68,.1);
    border: 1px solid rgba(239,68,68,.4);
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 14px;
}

.search-form { display: flex; gap: 8px; margin-bottom: 16px; }
.search-form input { flex: 1; margin: 0; }

.admin-action { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.admin-action input, .admin-action select { flex: 1; margin: 0; }
.admin-action input[type="number"] { flex: 0 0 90px; }

/* ---------- Автошкола ---------- */
.exam-card summary {
    cursor: pointer;
    font-size: 15px;
    padding: 4px 0;
}
.question { margin: 14px 0; }
.radio-label { display: block; padding: 8px 0; font-size: 14px; }
.radio-label input { width: auto; margin: 0 8px 0 0; }

/* ---------- Лидер-панель ---------- */
.member-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.member-row:last-child { border-bottom: none; }

/* ---------- Мини-игра ---------- */
.game-area { margin-top: 16px; }
.game-area.hidden { display: none; }
.game-hud {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 16px;
}
.game-field {
    position: relative;
    width: 100%;
    height: 320px;
    background: var(--card-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    touch-action: manipulation;
}
.target {
    position: absolute;
    font-size: 34px;
    cursor: pointer;
    user-select: none;
}

/* ---------- Мобильная адаптация ---------- */
@media (max-width: 480px) {
    .header h1 { font-size: 17px; }
    .btn { width: 100%; }
    .item-card { flex-direction: column; align-items: stretch; }
    .search-form { flex-direction: column; }
    .admin-action input[type="number"] { flex: 1; }
}

/* Экраны с малой высотой — кнопки всегда видны */
@media (max-height: 650px) {
    .main-buttons {
        position: sticky;
        bottom: 0;
        background: var(--bg);
        padding: 10px 0;
        z-index: 10;
    }
}
/* ============================================
   ДОПОЛНЕНИЯ v2 (добавить в конец style.css)
   ============================================ */
a.stat-card { text-decoration: none; color: inherit; }
a.stat-card:active { transform: scale(.98); }

.wallet-grid { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.wallet-card { display: flex; flex-direction: column; gap: 3px; margin-bottom: 0; }

.hint { font-size: 13px; color: var(--muted); margin-top: 10px; }

.msg-item { padding: 10px 0; border-bottom: 1px solid var(--border); }
.msg-item:last-child { border-bottom: none; }
.msg-from { font-size: 13px; font-weight: 600; color: #9cc3ff; }
.msg-date { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 6px; }
.msg-body { font-size: 14px; margin-top: 4px; }

.player-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 0; border-bottom: 1px solid var(--border); gap: 8px;
}
.player-row:last-child { border-bottom: none; }

.pager { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.page-info { font-size: 13px; color: var(--muted); }