/* Пацанский Ход — стили для Mini App */

:root {
    --bg: #1a1612;
    --bg-soft: #2a241d;
    --bg-card: #332b22;
    --fg: #f0e6d2;
    --fg-mute: #a89b86;
    --accent: #e8a44a;        /* семечный/пивной янтарь */
    --accent-2: #c47a3a;
    --danger: #d04545;
    --ok: #6dba4f;
    --border: #4a3f33;
    --radius: 12px;
    --shadow: 0 4px 12px rgba(0,0,0,0.4);
}

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

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

.app {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px 16px 80px;
    min-height: 100vh;
}

.hero {
    text-align: center;
    padding: 20px 0 24px;
}

.hero h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 4px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.hero .sub {
    color: var(--fg-mute);
    font-size: 14px;
}

/* Loading */
.loader {
    text-align: center;
    padding: 40px 0;
    color: var(--fg-mute);
}

/* ME Card */
.me-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}
.me-card.hidden { display: none; }
.me-card h2 { font-size: 16px; margin-bottom: 8px; color: var(--accent); }
.me-stats { font-size: 14px; color: var(--fg); }
.me-stats .row { display: flex; justify-content: space-between; padding: 4px 0; }
.me-stats .row .v { color: var(--accent); font-weight: 600; }

/* Rating list */
.rating h2 {
    font-size: 18px;
    margin: 16px 0 12px;
    color: var(--accent);
}
.rating-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.rating-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    transition: transform 0.1s;
}
.rating-item:active { transform: scale(0.98); }
.rating-item.is-self {
    border-color: var(--accent);
    background: linear-gradient(90deg, var(--bg-card) 0%, rgba(232,164,74,0.1) 100%);
}
.rank {
    font-size: 18px;
    font-weight: 800;
    color: var(--fg-mute);
    min-width: 30px;
    text-align: center;
}
.rank.top1 { color: gold; }
.rank.top2 { color: silver; }
.rank.top3 { color: #cd7f32; }
.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-soft);
    object-fit: cover;
    flex-shrink: 0;
}
.player-info { flex: 1; min-width: 0; }
.player-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.player-meta {
    font-size: 12px;
    color: var(--fg-mute);
    margin-top: 2px;
}
.player-stats {
    text-align: right;
    font-size: 13px;
}
.player-stats .rating {
    color: var(--accent);
    font-weight: 700;
    font-size: 16px;
}
.player-stats .br {
    color: var(--fg-mute);
    font-size: 11px;
}

/* Profile */
.profile {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}
.profile .avatar-big {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    margin: 0 auto 12px;
    display: block;
    background: var(--bg-soft);
    object-fit: cover;
}
.profile h2 {
    text-align: center;
    font-size: 22px;
    margin-bottom: 4px;
}
.profile .district {
    text-align: center;
    color: var(--fg-mute);
    font-size: 14px;
    margin-bottom: 16px;
}
.profile .stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
}
.profile .stat {
    background: var(--bg-soft);
    border-radius: 8px;
    padding: 8px 12px;
}
.profile .stat .label { font-size: 11px; color: var(--fg-mute); text-transform: uppercase; }
.profile .stat .value { font-size: 18px; font-weight: 700; color: var(--accent); }

/* Actions */
.actions h2 {
    font-size: 18px;
    margin: 20px 0 12px;
    color: var(--accent);
}
.action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.action-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 12px;
    color: var(--fg);
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.1s;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.action-btn:active {
    transform: scale(0.96);
    background: var(--bg-soft);
}
.action-btn .icon { font-size: 28px; }
.action-btn .name { font-weight: 600; }
.action-btn .cost { font-size: 11px; color: var(--fg-mute); }
.action-btn.big {
    grid-column: 1 / -1;
    padding: 18px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    color: #1a1612;
    border: none;
}
.action-btn.big .cost { color: rgba(0,0,0,0.6); }

/* Toast */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--accent);
    color: var(--fg);
    padding: 12px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 90%;
    z-index: 1000;
    text-align: center;
    font-size: 14px;
    white-space: pre-wrap;
}
.toast.hidden { display: none; }
.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: var(--bg-soft);
    border-top: 1px solid var(--border);
    padding: 8px 0;
    z-index: 100;
}
.nav-item {
    flex: 1;
    text-align: center;
    padding: 8px 0;
    color: var(--fg-mute);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}
.nav-item.active { color: var(--accent); }

/* Mute */
.muted { color: var(--fg-mute); }
.empty { text-align: center; padding: 40px 0; color: var(--fg-mute); }
