/* ══════════════════════════════════════════════════════════════
   Прикуп — стили (mobile-first)
══════════════════════════════════════════════════════════════ */

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

:root {
    --bg:          #1a472a;
    --bg-light:    #2d6a4f;
    --bg-dark:     #122e1c;
    --card-bg:     #fffef0;
    --card-border: #c8a900;
    --red:         #cc0000;
    --black:       #1a1a1a;
    --accent:      #f0c040;
    --btn-primary: #2196F3;
    --btn-hover:   #1565C0;
    --btn-sec:     #388E3C;
    --btn-sec-h:   #1B5E20;
    --text-light:  #e8f5e9;
    --shadow:      rgba(0,0,0,0.4);
    --selected:    #FFD700;
    --chat-bg:     rgba(0,0,0,.25);
}

html, body {
    height: 100%;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    background: var(--bg);
    color: var(--text-light);
    overflow-x: hidden;
}

/* ── Экраны ─────────────────────────────────────────────────── */
.screen { display: none; min-height: 100vh; padding: 16px; }
.screen.active { display: block; }

#screen-login.active {
    display: flex; align-items: center; justify-content: center;
}
/* Лобби и зал ожидания — строго в размер экрана, без скролла страницы */
#screen-lobby.active {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    padding: 0;
    overflow: hidden;
}
#screen-waiting.active {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    padding: 0;
    overflow: hidden;
}

/* ── Экран входа ─────────────────────────────────────────────── */
.login-box {
    background: var(--bg-light); border-radius: 16px;
    padding: 32px 24px; max-width: 380px; width: 100%;
    box-shadow: 0 8px 32px var(--shadow); text-align: center;
}
.login-box h1  { font-size: 2.2rem; color: var(--accent); margin-bottom: 4px; }
.subtitle      { color: #a5d6a7; margin-bottom: 24px; font-size: .95rem; }

.form-group { text-align: left; margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 6px; font-size: .9rem; color: #c8e6c9; }

.login-box input, .form-group input {
    width: 100%; padding: 12px 14px; border-radius: 8px;
    border: 1px solid #4caf50; background: rgba(255,255,255,.1);
    color: white; font-size: 1rem;
}
.login-box input:focus, .form-group input:focus {
    outline: none; border-color: var(--accent); background: rgba(255,255,255,.15);
}
input::placeholder { color: rgba(255,255,255,.4); }

.login-buttons { display: flex; flex-direction: column; gap: 12px; }
.divider {
    text-align: center; color: #81c784; font-size: .85rem; position: relative; padding: 0 8px;
}
.divider::before, .divider::after {
    content: ''; position: absolute; top: 50%; width: 38%; height: 1px; background: #4caf50;
}
.divider::before { left: 0; } .divider::after { right: 0; }
.join-row { display: flex; gap: 8px; }
.join-row input { flex: 1; letter-spacing: .15em; font-weight: bold; font-size: 1.1rem; }
.join-row .btn { white-space: nowrap; }

/* ── Кнопки ──────────────────────────────────────────────────── */
.btn {
    padding: 12px 20px; border-radius: 8px; border: none;
    font-size: 1rem; font-weight: 600; cursor: pointer;
    transition: background .15s, transform .1s;
    -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn-primary   { background: var(--btn-primary); color: white; }
.btn-primary:hover:not(:disabled) { background: var(--btn-hover); }
.btn-secondary { background: var(--btn-sec); color: white; }
.btn-secondary:hover:not(:disabled) { background: var(--btn-sec-h); }
.btn-google {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; padding: 10px; border-radius: 6px;
    background: #fff; color: #3c4043; border: 1px solid #dadce0;
    font-size: .95rem; font-weight: 500; text-decoration: none; cursor: pointer;
}
.btn-google:hover { background: #f8f9fa; }
.auth-divider {
    text-align: center; color: rgba(255,255,255,.5); font-size: .85rem;
    margin: 12px 0; position: relative;
}
.auth-divider::before, .auth-divider::after {
    content: ''; position: absolute; top: 50%; width: 40%; height: 1px;
    background: rgba(255,255,255,.2);
}
.auth-divider::before { left: 0; }
.auth-divider::after  { right: 0; }
.btn-chat { background: rgba(255,255,255,.15); color: white; padding: 12px 14px; }
.btn-chat:hover { background: rgba(255,255,255,.25); }

.btn-icon { background: none; border: none; font-size: 1.2rem; cursor: pointer; padding: 4px;
            -webkit-tap-highlight-color: transparent; color: var(--text-light); }

/* ── Лобби ───────────────────────────────────────────────────── */
.lobby-layout {
    display: flex;
    flex: 1;
    min-height: 0; /* critical: позволяет flex-детям с overflow работать */
}

.lobby-rooms-col {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column;
    border-right: 1px solid rgba(255,255,255,.1);
    overflow: hidden;
}

.lobby-chat-col {
    width: 300px; flex-shrink: 0;
    display: flex; flex-direction: column;
    background: var(--chat-bg);
    overflow: hidden;
    transition: width .2s ease;
}
.lobby-chat-col.chat-collapsed { width: auto; }
.lobby-chat-col.chat-collapsed .chat-messages,
.lobby-chat-col.chat-collapsed .chat-input-row { display: none; }
.chat-title-toggle {
    cursor: pointer; user-select: none;
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px;
}
.chat-title-toggle:hover { background: rgba(255,255,255,.05); }

.lobby-header {
    padding: 14px 16px 10px;
    background: var(--bg-dark);
    display: flex; flex-direction: column; gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,.1);
    position: sticky; top: 0; z-index: 10;
    flex-shrink: 0;
}

.lobby-title-row {
    display: flex; align-items: center; gap: 10px;
}
.lobby-title-row h2 { font-size: 1.3rem; color: var(--accent); }

.lobby-player-badge {
    background: rgba(255,255,255,.1); border-radius: 20px;
    padding: 4px 12px; font-size: .85rem; color: #a5d6a7;
    max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.room-list { overflow-y: auto; flex: 1; padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; min-height: 0; }

.empty-rooms-hint { color: #81c784; font-size: .9rem; text-align: center; padding: 24px 0; }

/* Карточка комнаты */
.room-card {
    background: var(--bg-light); border-radius: 12px;
    padding: 0 0 0 16px; display: flex; align-items: center; gap: 10px;
    cursor: pointer; transition: background .15s, box-shadow .15s;
    border: 2px solid transparent; overflow: hidden; min-height: 62px;
}
.room-card:hover { background: #376e56; box-shadow: 0 2px 8px var(--shadow); }
.room-card.room-playing { opacity: .65; cursor: default; }
.room-card.room-full    { opacity: .65; cursor: not-allowed; }

.room-card-info { flex: 1; min-width: 0; padding: 12px 0; }
.room-card-title {
    font-weight: 700; font-size: 1rem; color: var(--accent);
    font-family: monospace; letter-spacing: .1em;
}
.room-card-meta { font-size: .82rem; color: #a5d6a7; margin-top: 3px; }
.room-deck-badge {
    display: inline-block; background: rgba(255,255,255,.1);
    border-radius: 4px; padding: 0 5px; font-size: .72rem;
    font-weight: 700; color: #81c784; margin-left: 5px; vertical-align: middle;
}

.room-card-status {
    font-size: .78rem; font-weight: 700; border-radius: 20px; padding: 3px 10px; white-space: nowrap;
    flex-shrink: 0; margin-right: 14px;
}
.status-waiting  { background: rgba(33,150,243,.3); color: #90CAF9; }
.status-playing  { background: rgba(255,152,0,.3);  color: #FFCC80; }
.status-finished { background: rgba(120,120,120,.3); color: #aaa; }

.room-lock-icon { font-size: 1.1rem; }

/* ── Чат (общий) ─────────────────────────────────────────────── */
.chat-title { font-size: 1rem; padding: 12px 16px 8px; color: #c8e6c9; border-bottom: 1px solid rgba(255,255,255,.1); }

.chat-messages {
    flex: 1; overflow-y: auto; padding: 10px 14px;
    display: flex; flex-direction: column; gap: 6px;
    min-height: 0;
}
.chat-message {
    background: rgba(255,255,255,.07); border-radius: 8px;
    padding: 6px 10px; font-size: .87rem; line-height: 1.4;
    word-break: break-word;
}
.chat-message .msg-sender { font-weight: 700; color: var(--accent); margin-right: 6px; }
.chat-message .msg-time   { font-size: .75rem; color: #81c784; margin-left: 6px; float: right; }

.chat-input-row {
    display: flex; gap: 6px; padding: 10px 12px;
    background: rgba(0,0,0,.2); border-top: 1px solid rgba(255,255,255,.08);
}
.chat-input-row input {
    flex: 1; padding: 8px 12px; border-radius: 8px;
    border: 1px solid #4caf50; background: rgba(255,255,255,.1);
    color: white; font-size: .9rem;
}
.chat-input-row input:focus { outline: none; border-color: var(--accent); }
.btn-send { padding: 8px 12px; font-size: 1rem; }

/* ── Кнопка выхода из комнаты ────────────────────────────────── */
.btn-leave {
    background: rgba(244,67,54,.2); color: #ef9a9a;
    border: 1px solid rgba(244,67,54,.4);
    margin-top: 10px; width: 100%;
}
.btn-leave:hover:not(:disabled) { background: rgba(244,67,54,.35); }
.btn-leave:disabled { opacity: .3; }

/* ── Обратный отсчёт ─────────────────────────────────────────── */
.countdown-display { text-align: center; margin: 8px 0; }
.countdown-circle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 64px; height: 64px; border-radius: 50%;
    background: var(--btn-primary); color: white;
    font-size: 2rem; font-weight: 900;
    box-shadow: 0 0 20px rgba(33,150,243,.6);
    animation: pulse-cd .9s ease-in-out infinite;
}
@keyframes pulse-cd {
    0%,100% { transform: scale(1); } 50% { transform: scale(1.08); }
}
.countdown-text { color: #90CAF9; font-size: .9rem; margin-top: 6px; }

/* ── Зал ожидания ────────────────────────────────────────────── */
.waiting-layout {
    display: flex; gap: 12px; align-items: stretch;
    width: 100%; height: 100%; padding: 12px;
    box-sizing: border-box;
}
.waiting-box {
    background: var(--bg-light); border-radius: 16px; padding: 20px 18px;
    flex: 0 0 auto; width: 260px; text-align: center;
    box-shadow: 0 8px 32px var(--shadow);
    overflow-y: auto;
}
.waiting-box h2 { color: var(--accent); margin-bottom: 8px; }
.waiting-box h3 { margin: 16px 0 8px; color: #c8e6c9; font-size: .95rem; }
.room-id-display { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 4px; }
#room-id-label { font-size: 2rem; font-weight: 700; letter-spacing: .2em; color: var(--accent); font-family: monospace; }
#player-list { list-style: none; text-align: left; margin: 0 0 16px; }
#player-list li {
    padding: 8px 12px; background: rgba(255,255,255,.08);
    border-radius: 6px; margin-bottom: 6px; display: flex; align-items: center; gap: 8px;
}
.hint { font-size: .8rem; color: #81c784; margin-bottom: 12px; }

.room-chat-box {
    background: var(--bg-light); border-radius: 16px;
    flex: 1; min-width: 0;
    display: flex; flex-direction: column;
    box-shadow: 0 8px 32px var(--shadow); overflow: hidden;
}
.room-chat-box .chat-messages { flex: 1; min-height: 0; }

/* ── Создать комнату — кнопки выбора числа игроков ───────────── */
.max-players-buttons { display: flex; gap: 8px; }
.btn-count {
    flex: 1; padding: 10px; border-radius: 8px;
    border: 2px solid rgba(255,255,255,.2); background: rgba(255,255,255,.08);
    color: var(--text-light); font-size: 1.1rem; font-weight: 700;
    cursor: pointer; transition: border-color .15s, background .15s;
}
.btn-count:hover  { border-color: var(--accent); background: rgba(240,192,64,.15); }
.btn-count.active { border-color: var(--accent); background: rgba(240,192,64,.25); color: var(--accent); }

/* Кнопки выбора колоды — чуть меньше текста для длинных лейблов */
[data-deck].btn-count { font-size: 0.82rem; font-weight: 600; }

/* Индикатор прикупа (своего) */
.prikup-indicator {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(255,200,0,.13); border: 1px solid rgba(255,200,0,.35);
    border-radius: 6px; padding: 3px 10px; font-size: 12px; color: #f0c040;
    margin-bottom: 4px;
}

/* Карты прикупа у оппонента */
.opp-prikup-cards {
    display: flex; justify-content: center;
    margin-top: 4px; padding: 0 4px 2px;
}
.opp-prikup-card {
    width: 20px; height: 30px; flex-shrink: 0;
    background: #1a237e;
    background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.10) 0px, rgba(255,255,255,.10) 2px, transparent 2px, transparent 8px);
    border: 1px solid #5c6bc0; border-radius: 3px;
    margin-right: -8px;
    box-shadow: 1px 1px 3px rgba(0,0,0,.5);
}
.opp-prikup-card:last-child { margin-right: 0; }

/* ── Игровое поле ────────────────────────────────────────────── */
#screen-game { flex-direction: column; min-height: 100vh; padding: 8px; gap: 8px; position: relative; }
#screen-game.active { display: flex; }

/* Расстановка вокруг стола */
#game-board {
    display: grid;
    grid-template-areas:
        ".    top    ."
        "left table  right"
        ".    bottom .";
    grid-template-columns: min-content 1fr min-content;
    grid-template-rows: auto 1fr auto;
    gap: 6px;
    flex: 1;
    min-height: 0;
}
#seat-top {
    grid-area: top;
    display: flex;
    justify-content: center;
}
#seat-bottom {
    grid-area: bottom;
    display: none; /* shown only in spectator mode via JS */
    justify-content: center;
}
#seat-left {
    grid-area: left;
    display: flex;
    align-items: center;
    justify-content: center;
}
#seat-right {
    grid-area: right;
    display: flex;
    align-items: center;
    justify-content: center;
}
#table-area {
    grid-area: table;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(0,0,0,.18);
    border-radius: 14px;
    padding: 48px 20px 20px;
    min-height: 200px;
}

.opponent-badge {
    background: var(--bg-light); border-radius: 10px; padding: 8px 12px 6px;
    display: flex; flex-direction: column; gap: 5px; font-size: .9rem;
    border: 2px solid transparent;
    transition: border-color .25s, box-shadow .25s, opacity .25s;
    min-width: 96px;
}
.opponent-badge.active-player {
    border-color: var(--accent); box-shadow: 0 0 10px rgba(240,192,64,.55);
}
.opponent-badge.disconnected {
    border-color: #ef5350;
    box-shadow: 0 0 8px rgba(239,83,80,.45);
    opacity: .65;
}
.opp-badge-content { display: flex; flex-direction: column; gap: 3px; }
.opp-name { font-size: .8rem; color: #a5d6a7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-dot { color: #ef5350; font-size: .72rem; vertical-align: middle; }

/* Таймер под бейджем соперника */
.opp-timer-wrap {
    height: 5px; background: rgba(255,255,255,.18); border-radius: 3px; overflow: hidden;
}
.opp-timer-bar { height: 100%; width: 0%; background: var(--accent); border-radius: 3px; }

.mini-cards { display: flex; gap: 2px; }
.mini-card-back { width: 14px; height: 20px; background: #1565C0; border-radius: 2px; border: 1px solid #90CAF9; }
.opponent-count { font-weight: 700; color: var(--accent); font-size: 1rem; }


.zone { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.zone-label { font-size: .7rem; color: #a5d6a7; text-transform: uppercase; letter-spacing: .08em; }

#top-cards-row {
    display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
    min-height: 90px; align-items: center;
}

.empty-table { color: #81c784; font-size: .85rem; font-style: italic; }
.card-count  { font-size: .85rem; font-weight: 700; color: var(--accent); }

#pile-size-label { font-size: .8rem; color: #a5d6a7; }

#turn-info-row {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 32px;
}
#turn-info { text-align: center; font-size: .9rem; color: #c8e6c9; padding: 2px 0; flex: 1; }
#turn-info.your-turn { color: var(--accent); font-weight: 700; font-size: 1rem; }

/* Круговой таймер хода */
.turn-timer {
    position: relative; width: 36px; height: 36px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.timer-ring { width: 36px; height: 36px; transform: rotate(-90deg); }
.timer-ring-bg {
    fill: none; stroke: rgba(255,255,255,.15); stroke-width: 3;
}
.timer-ring-arc {
    fill: none; stroke: var(--accent); stroke-width: 3;
    stroke-dasharray: 94.25; stroke-dashoffset: 0;
    stroke-linecap: round;
    transition: stroke .5s;
}
.timer-ring-arc.urgent { stroke: #ef5350; }
#turn-timer-label {
    position: absolute; font-size: .75rem; font-weight: 700; color: var(--accent);
}
.timer-urgent #turn-timer-label { color: #ef5350; }

/* Строка: кнопки слева + карты справа */
#hand-row { display: flex; align-items: center; gap: 8px; }

#action-buttons { display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; padding: 2px 0; }
#action-buttons .btn { flex: 0 0 auto; width: 158px; max-width: none; padding: 11px 8px; font-size: 0.9rem; text-align: center; }
#btn-chat-toggle { width: 158px; max-width: none !important; }

#hand-area { flex: 1; min-width: 0; background: rgba(0,0,0,.15); border-radius: 12px; padding: 8px 10px; }
#hand-cards {
    display: flex; flex-wrap: wrap; gap: 0;
    justify-content: center; min-height: 90px;
    align-items: flex-end; padding-top: 16px;
    overflow: visible;
}
#hand-cards .card { margin-right: -20px; }
#hand-cards .card:last-child { margin-right: 0; }
#hand-cards .card:hover { z-index: 99 !important; }
#hand-cards .card.selected { z-index: 100 !important; }

/* Игровой чат (панель поверх) */
.game-chat-panel {
    position: fixed; right: 0; top: 0; bottom: 0; width: 300px;
    background: var(--bg-dark); border-left: 1px solid rgba(255,255,255,.1);
    display: flex; flex-direction: column; z-index: 150;
    box-shadow: -4px 0 16px var(--shadow);
    transition: transform .2s ease;
}
.game-chat-panel.hidden { transform: translateX(100%); }

.game-chat-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,.1);
    font-weight: 700; color: var(--accent);
}
.game-chat-panel .chat-messages { flex: 1; min-height: 0; }

/* ── Карты ───────────────────────────────────────────────────── */
.card {
    display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
    width: 60px; height: 90px;
    background: var(--card-bg); border-radius: 8px; border: 2px solid var(--card-border);
    font-size: 1rem; font-weight: 700; font-family: 'Segoe UI', monospace;
    cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
    transition: transform .15s, border-color .15s, box-shadow .15s;
    box-shadow: 1px 2px 4px var(--shadow); position: relative; flex-shrink: 0;
}
.card:hover { transform: translateY(-4px); }
.card.selected {
    transform: translateY(-12px);
    border-color: var(--selected);
    box-shadow: 0 0 10px rgba(255,215,0,.6), 0 4px 8px var(--shadow);
}
.card.red   { color: var(--red); }
.card.black { color: var(--black); }
.card-rank { font-size: 1.05rem; line-height: 1; }
.card-suit { font-size: 1.1rem;  line-height: 1; }

.card.pile-card { cursor: default; transform: none !important; }

.card.hint-valid {
    border-color: #4CAF50;
    box-shadow: 0 0 10px rgba(76,175,80,.75), 1px 2px 4px var(--shadow);
}
.card.hint-valid:hover { transform: translateY(-6px); }

.card.hint-invalid {
    opacity: .35;
    transform: none !important;
    border-color: rgba(180,30,30,.5);
    box-shadow: 0 0 6px rgba(180,30,30,.3), 1px 2px 4px var(--shadow);
}

.card.card-unplayable {
    opacity: .28;
    cursor: not-allowed;
    filter: grayscale(60%);
    transform: none !important;
    pointer-events: none;
}

.card.current-combo {
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(240,192,64,.7), 1px 2px 4px var(--shadow);
}

/* ── Ошибки ──────────────────────────────────────────────────── */
.error-msg, .game-error-msg {
    background: rgba(244,67,54,.85); color: white;
    border-radius: 8px; padding: 10px 14px; font-size: .9rem; text-align: center; margin-top: 10px;
}
.game-error-msg {
    position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
    width: calc(100% - 32px); max-width: 400px; z-index: 100;
    box-shadow: 0 4px 12px var(--shadow);
}

/* ── Статистика конца игры ───────────────────────────────────── */
.stats-table {
    width: 100%; border-collapse: collapse; margin-top: 14px;
    font-size: .9rem;
}
.stats-table th {
    padding: 7px 10px; text-align: center;
    color: #a5d6a7; font-size: .78rem; text-transform: uppercase;
    border-bottom: 1px solid rgba(255,255,255,.15);
}
.stats-table td {
    padding: 8px 10px; text-align: center;
    border-bottom: 1px solid rgba(255,255,255,.07);
}
.stats-table td:first-child { text-align: left; }
.stats-table .winner-row td { color: var(--accent); font-weight: 700; }
.stats-table .winner-row td:first-child::after { content: ' 👑'; }

/* ── Модалки ─────────────────────────────────────────────────── */
.modal {
    position: fixed; inset: 0; background: rgba(0,0,0,.7);
    display: flex; align-items: center; justify-content: center; z-index: 200;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.modal-box {
    background: var(--bg-light); border-radius: 16px; padding: 32px 24px;
    text-align: center; max-width: 360px; width: 90%;
    box-shadow: 0 8px 32px var(--shadow);
    flex-shrink: 0;
}
.modal-box-wide { max-width: 440px; }
.modal-box h2 { color: var(--accent); font-size: 1.6rem; margin-bottom: 12px; }
.modal-box p  { margin-bottom: 20px; color: #c8e6c9; }

/* ── Адаптив ─────────────────────────────────────────────────── */
@media (max-width: 640px) {
    /* Модал: прижать к верху, чтобы можно было скроллить содержимое */
    .modal { align-items: flex-start; padding: 16px 0 32px; }
    .modal-box { margin: 0 auto; }

    /* Лобби: столбцом, чат снизу фиксированной высоты */
    .lobby-layout { flex-direction: column; }
    .lobby-rooms-col { flex: 1 1 0; min-height: 0; border-right: none; border-bottom: 1px solid rgba(255,255,255,.1); }
    .lobby-chat-col { width: 100%; flex: 0 0 260px; border-top: none; }
    .lobby-chat-col.chat-collapsed { flex: 0 0 auto; width: 100%; }

    /* Зал ожидания: столбцом, весь контент скроллируется */
    .waiting-layout { flex-direction: column; padding: 8px; gap: 8px; height: auto; min-height: 100%; }
    .waiting-box { width: 100%; overflow-y: visible; max-height: none; }
    .room-chat-box { flex: 1 1 0; min-height: 180px; }
    #screen-waiting.active { overflow-y: auto; }
    /* Центрирование карт на столе: убираем асимметричный padding */
    #table-area { padding: 16px 12px; }

    /* Игровой чат */
    .game-chat-panel { width: 100%; right: 0; bottom: 0; top: auto; height: 60vh; border-top: 1px solid rgba(255,255,255,.1); }
    .game-chat-panel.hidden { transform: translateY(100%); }
}
@media (min-width: 600px) {
    .card { width: 72px; height: 108px; font-size: 1.1rem; }
    .card-rank { font-size: 1.2rem; } .card-suit { font-size: 1.3rem; }
    #action-buttons .btn { font-size: 1rem; padding: 13px 10px; width: 176px; }
    #btn-chat-toggle { width: 176px; }
    #screen-game.active { height: 100dvh; }
    #table-area { min-height: 280px; }
    #hand-cards .card { margin-right: -24px; }
}
@media (min-width: 641px) {
    /* На десктопе: чат-панель не лезет под шапку */
    body.has-header .game-chat-panel { top: 52px; }
}
@media (min-width: 900px) {
    #screen-game { max-width: 800px; margin: 0 auto; }
}

/* ── Mobile: smaller action buttons ────────────────────────── */
@media (max-width: 640px) {
    #action-buttons .btn { padding: 9px 8px; font-size: 0.85rem; width: 142px; }
    #btn-chat-toggle { width: 142px; }
}

/* ── Landscape-phone (напр. iPhone SE 667×375) ─────────────── */
@media (max-height: 480px) {
    .card                    { width: 44px; height: 64px; }
    .card-rank               { font-size: 0.8rem; }
    .card-suit               { font-size: 0.85rem; }
    .card-corner             { font-size: 0.65rem; }
    #table-area              { min-height: 80px; padding: 8px 10px; }
    #screen-game             { padding: 4px; gap: 4px; overflow: hidden; }
    #game-board              { gap: 3px; }
    #hand-area               { padding: 4px 6px; }
    #hand-cards              { min-height: 66px; }
    #action-buttons          { gap: 5px; }
    #action-buttons .btn     { padding: 5px 6px; font-size: 0.78rem; width: 100px; }
    #btn-chat-toggle         { width: 100px; }
    /* Компактные бейджи: скрываем мини-карты и таймер, фиксируем ширину */
    .opponent-badge          { padding: 4px 6px 3px; min-width: 52px; max-width: 68px;
                               overflow: hidden; font-size: 0.75rem; }
    .opp-name                { max-width: 52px; overflow: hidden; text-overflow: ellipsis; }
    .opp-badge-content       { gap: 2px; }
    .mini-cards              { display: none; }
    .opp-timer-wrap          { display: none; }
    .opponent-count          { font-size: 0.85rem; }
    /* Карточный веер на маленьком экране — меньше перекрытие */
    #hand-cards .card        { margin-right: -15px; }
    /* Убираем длинные лейблы */
    .zone-label              { display: none; }
    #pile-size-label         { font-size: 0.72rem; }
    #prikup-indicator        { font-size: 0.72rem; padding: 1px 5px; }
    #turn-info               { font-size: 0.78rem; }
}

/* ── Disconnect overlay ─────────────────────────────────────── */
#disconnect-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(0,0,0,.72);
    align-items: center;
    justify-content: center;
}
.disconnect-box {
    background: var(--bg-dark);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 16px;
    padding: 32px 40px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    max-width: 280px;
}
.disconnect-spinner {
    width: 40px; height: 40px;
    border: 3px solid rgba(255,255,255,.15);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: ws-spin .8s linear infinite;
}
@keyframes ws-spin { to { transform: rotate(360deg); } }
.disconnect-title { font-size: 1.05rem; font-weight: 700; color: var(--text-light); }
#disconnect-msg   { font-size: .85rem; color: #81c784; }

/* ── Portrait lock overlay ──────────────────────────────────── */
#portrait-lock {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: #0a1f0f;
    color: #f0e6c8;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    text-align: center;
    padding: 24px;
    font-size: 1.1rem;
}
#portrait-lock span { font-size: 4rem; }

@media (orientation: portrait) and (max-width: 640px) {
    body.in-room #portrait-lock { display: flex; }
}

/* ── Навигационная шапка ─────────────────────────────────── */
.app-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 52px;
    background: var(--bg-dark);
    border-bottom: 1px solid rgba(255,255,255,.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px 0 16px;
    z-index: 160;
    transition: transform .2s;
}
.app-header.hidden { transform: translateY(-100%); }

.header-brand { color: #a5d6a7; font-weight: 700; font-size: 15px; }

.header-nav { display: flex; gap: 2px; }

.nav-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 5px 10px;
    background: none;
    border: none;
    border-radius: 8px;
    color: rgba(255,255,255,.5);
    cursor: pointer;
    font-size: 10px;
    line-height: 1;
    min-width: 52px;
    transition: background .15s, color .15s;
}
.nav-btn .ni { font-size: 17px; line-height: 1; }
.nav-btn:hover { background: rgba(255,255,255,.1); color: #e8f5e9; }
.nav-btn.nav-active { color: #a5d6a7; background: rgba(76,175,80,.15); }
.nav-btn.nav-room-live { color: #81c784; }

/* Пульс — ваш ход, а вы не на игровом экране */
@keyframes nav-pulse {
    0%,100% { background: rgba(255,193,7,.12); color: #ffc107; }
    50%      { background: rgba(255,193,7,.30); color: #ffe082; }
}
.nav-btn.nav-room-turn { animation: nav-pulse 1s ease-in-out infinite; }

/* Зелёная точка на кнопке Комната */
.nav-dot {
    position: absolute;
    top: 4px; right: 6px;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #4caf50;
    display: none;
}
.nav-btn.nav-room-live .nav-dot,
.nav-btn.nav-room-turn .nav-dot { display: block; }

/* Все экраны кроме логина получают отступ под шапку */
body.has-header .screen.active:not(#screen-login) { padding-top: 52px; }
/* Лобби, ожидание и инфо-экран: padding-top из шапки, остальные стороны — 0 */
body.has-header #screen-lobby.active,
body.has-header #screen-waiting.active,
body.has-header #screen-info.active { padding: 52px 0 0; }

/* ── Панель игрока (выезжает вниз из шапки) ──────────────── */
.player-panel {
    position: fixed;
    top: 52px; right: 12px;
    background: var(--bg-dark);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 0 0 10px 10px;
    padding: 14px 18px;
    min-width: 180px;
    z-index: 49;
    box-shadow: 0 4px 16px rgba(0,0,0,.4);
    transition: transform .2s, opacity .2s;
}
.player-panel.hidden { transform: translateY(-16px); opacity: 0; pointer-events: none; }
.player-panel-name { font-weight: 700; color: #c8e6c9; font-size: 15px; margin-bottom: 4px; }
.player-panel-room { font-size: 13px; color: #6aaf6a; }

/* ── Экран: Информация (правила / условия / конф.) ───────── */
#screen-info.active {
    display: flex; flex-direction: column;
    height: 100dvh; overflow: hidden; padding: 0;
}

.info-topbar {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px;
    background: var(--bg-dark);
    border-bottom: 1px solid rgba(255,255,255,.1);
    flex-shrink: 0;
}
.info-back-btn {
    background: none;
    border: none;
    color: #81c784;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 0;
    white-space: nowrap;
}
.info-back-btn:hover { color: #a5d6a7; }
#info-screen-title { color: #c8e6c9; font-size: 14px; font-weight: 600; }

.info-body {
    max-width: 820px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 20px 60px;
    line-height: 1.75;
    font-size: 15px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}
.info-body h2 {
    color: #a5d6a7; font-size: 18px; margin: 32px 0 10px;
    padding-bottom: 6px; border-bottom: 1px solid rgba(255,255,255,.1);
}
.info-body h3 { color: #c8e6c9; font-size: 15px; margin: 18px 0 6px; }
.info-body p { margin-bottom: 10px; }
.info-body ul, .info-body ol { padding-left: 22px; margin-bottom: 12px; }
.info-body li { margin-bottom: 5px; }
.info-body a { color: #81c784; }
.info-body strong { color: #c8e6c9; }
.info-body table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 13px; }
.info-body th, .info-body td { padding: 7px 10px; border: 1px solid rgba(255,255,255,.1); }
.info-body th { background: rgba(255,255,255,.06); color: #a5d6a7; }
.info-body .box-green { background: rgba(76,175,80,.12); border-left: 3px solid #4caf50; padding: 12px 16px; margin: 12px 0; border-radius: 0 4px 4px 0; }
.info-body .box-red   { background: rgba(244,67,54,.10); border-left: 3px solid #f44336; padding: 12px 16px; margin: 12px 0; border-radius: 0 4px 4px 0; }
.info-body .box-blue  { background: rgba(33,150,243,.10); border-left: 3px solid #2196F3; padding: 12px 16px; margin: 12px 0; border-radius: 0 4px 4px 0; }
.info-body .last-updated { color: #6aaf6a; font-size: 13px; margin-bottom: 28px; }
/* Карты в экране правил */
.info-body .cards-demo { display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:12px 14px;background:rgba(0,0,0,.2);border-radius:6px;margin-bottom:8px; }
.info-body .cards-demo .card { width:44px;height:66px;border-radius:5px;background:#fffef0;border:1px solid #c8a900;display:flex;flex-direction:column;justify-content:space-between;padding:3px 4px;font-size:12px;font-weight:700;flex-shrink:0; }
.info-body .cards-demo .card.red { color:#cc0000; }
.info-body .cards-demo .card.black { color:#1a1a1a; }
.info-body .rank-table { font-size:13px; }
.info-body .combo-example { margin: 16px 0; }
.info-body .demo-label { font-size:13px;color:#a5d6a7;margin-bottom:8px;font-weight:600; }
.info-body .demo-valid   { color:#66bb6a;font-weight:600;font-size:13px; }
.info-body .demo-invalid { color:#ef5350;font-weight:600;font-size:13px; }

/* ── Кнопки панели игрока ────────────────────────────────── */
.player-panel-actions { display: flex; gap: 8px; margin-top: 12px; }
.pp-btn {
    flex: 1; padding: 8px 10px; border-radius: 8px; border: none;
    background: rgba(255,255,255,.1); color: var(--text-light);
    font-size: .85rem; cursor: pointer; transition: background .15s;
}
.pp-btn:hover { background: rgba(255,255,255,.18); }
.pp-btn-logout { background: rgba(244,67,54,.15); color: #ef9a9a; }
.pp-btn-logout:hover { background: rgba(244,67,54,.3); }

/* ── Оверлей выбывшего игрока ────────────────────────────── */
.finished-overlay {
    position: fixed; inset: 0; z-index: 300;
    background: rgba(0,0,0,.75);
    display: flex; align-items: center; justify-content: center;
}
.finished-box {
    background: var(--bg-light); border-radius: 18px; padding: 36px 28px;
    text-align: center; max-width: 340px; width: 92%;
    border: 1px solid rgba(255,255,255,.12);
}
.finished-trophy  { font-size: 3.2rem; margin-bottom: 10px; }
.finished-rank-text { font-size: 1.5rem; font-weight: 700; margin-bottom: 6px; color: var(--accent); }
.finished-hint    { color: rgba(255,255,255,.6); font-size: .88rem; margin-bottom: 22px; }
.finished-btns    { display: flex; gap: 10px; justify-content: center; }

/* Стиль выбывшего соперника за столом */
.opponent-badge.opp-finished {
    opacity: .55;
    border-color: rgba(255,255,255,.08);
}
.opp-finish-label {
    font-size: .7rem; color: var(--accent); font-style: italic; margin-top: 2px;
}

/* ── Баннер наблюдателя ──────────────────────────────────── */
.spectator-banner {
    background: rgba(33,150,243,.18); border: 1px solid rgba(33,150,243,.4);
    border-radius: 8px; padding: 8px 14px; text-align: center;
    font-size: .85rem; color: #90CAF9; flex-shrink: 0;
}

/* ── Кнопка "Смотреть" в лобби ───────────────────────────── */
.btn-join-room, .btn-watch-room {
    align-self: stretch;
    flex: 0 0 32%;
    border: none; border-left: 1px solid rgba(255,255,255,.08);
    font-size: .88rem; font-weight: 700; cursor: pointer; white-space: nowrap;
    transition: background .15s, color .15s;
    -webkit-tap-highlight-color: transparent;
    letter-spacing: .02em;
}
.btn-join-room {
    background: rgba(76,175,80,.2); color: #a5d6a7;
}
.btn-join-room:hover,
.room-card:hover .btn-join-room { background: rgba(76,175,80,.4); color: #c8e6c9; }

.btn-watch-room {
    background: rgba(33,150,243,.15); color: #90CAF9;
}
.btn-watch-room:hover { background: rgba(33,150,243,.35); color: #bbdefb; }

/* ── Экран профиля ───────────────────────────────────────── */
#screen-profile.active { display: flex; align-items: flex-start; justify-content: center; padding: 24px 16px; }
.profile-wrap { width: 100%; max-width: 420px; }
.profile-box {
    background: var(--bg-light); border-radius: 16px; padding: 24px;
    box-shadow: 0 8px 32px var(--shadow);
}
.profile-header {
    display: flex; align-items: center; gap: 14px;
}
.profile-header h2 { color: var(--accent); font-size: 1.4rem; }
.profile-result {
    padding: 8px 12px; border-radius: 8px; margin: 8px 0;
    background: rgba(76,175,80,.2); color: #a5d6a7; font-size: .9rem; text-align: center;
}
.profile-token {
    display: flex; align-items: center; gap: 8px;
    margin-top: 20px; padding: 10px 12px;
    background: rgba(0,0,0,.2); border-radius: 8px; font-size: .8rem;
}
.profile-token-label { color: #81c784; }
.profile-token-val { font-family: monospace; color: #c8e6c9; word-break: break-all; font-size: .75rem; }
.profile-note {
    margin-top: 16px; padding: 10px 12px;
    background: rgba(255,255,255,.05); border-radius: 8px;
    font-size: .8rem; color: #81c784; line-height: 1.5;
}

/* ── Правовые ссылки (в login-box и player-panel) ────────── */
.legal-links {
    display: flex; justify-content: center; align-items: center;
    flex-wrap: wrap; gap: 6px;
    margin-top: 20px;
    font-size: .73rem;
    color: rgba(255,255,255,.3);
}
.legal-links a { color: rgba(255,255,255,.4); text-decoration: none; }
.legal-links a:hover { color: #a5d6a7; text-decoration: underline; }
.legal-links span { color: rgba(255,255,255,.2); }
.legal-links-panel {
    margin-top: 10px; padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,.07);
    font-size: .7rem;
}

/* ── Auth tabs ───────────────────────────────────────────── */
.auth-tabs {
    display: flex; gap: 4px; margin-bottom: 20px;
    background: rgba(0,0,0,.2); border-radius: 10px; padding: 4px;
}
.auth-tab {
    flex: 1; padding: 9px 8px; border: none; border-radius: 7px;
    background: none; color: rgba(255,255,255,.5);
    font-size: .88rem; font-weight: 600; cursor: pointer;
    transition: background .15s, color .15s;
}
.auth-tab:hover { color: #c8e6c9; background: rgba(255,255,255,.06); }
.auth-tab.active { background: var(--bg-light); color: var(--accent); }

.auth-pane { animation: fadeIn .18s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.auth-hint {
    font-size: .75rem; color: #81c784; font-weight: 400; margin-left: 4px;
}

.anon-note {
    font-size: .82rem; color: #81c784; line-height: 1.5;
    margin-bottom: 14px; padding: 10px 12px;
    background: rgba(255,255,255,.05); border-radius: 8px;
}

/* Success message */
.success-msg {
    background: rgba(76,175,80,.85); color: white;
    border-radius: 8px; padding: 10px 14px; font-size: .9rem; text-align: center;
}

/* ── Avatar picker ───────────────────────────────────────── */
.avatar-picker {
    display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 0;
}
.avatar-option {
    width: 38px; height: 38px; border-radius: 8px;
    border: 2px solid rgba(255,255,255,.15);
    background: rgba(255,255,255,.07);
    font-size: 1.35rem; cursor: pointer; display: flex;
    align-items: center; justify-content: center;
    transition: border-color .15s, background .15s, transform .1s;
}
.avatar-option:hover { border-color: rgba(255,255,255,.4); background: rgba(255,255,255,.12); transform: scale(1.08); }
.avatar-option.selected { border-color: var(--accent); background: rgba(240,192,64,.2); transform: scale(1.08); }

/* ── Lobby create-room button disabled state ─────────────── */
#btn-create-room:disabled { opacity: .45; cursor: not-allowed; }

/* ── Profile: registered user ────────────────────────────── */
.profile-avatar-row {
    display: flex; align-items: center; gap: 14px; margin-bottom: 14px;
}
.profile-big-avatar {
    font-size: 2.8rem; line-height: 1; flex-shrink: 0;
    width: 56px; height: 56px; display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.08); border-radius: 14px;
}
.profile-reg-username {
    font-size: 1.2rem; font-weight: 700; color: var(--accent);
}
.profile-email-status {
    font-size: .82rem; margin-top: 4px; color: #a5d6a7;
}
.profile-email-status.unconfirmed { color: #ffa726; }
.profile-description-text {
    font-size: .88rem; color: #c8e6c9; line-height: 1.5;
    padding: 10px 12px; background: rgba(255,255,255,.05);
    border-radius: 8px; margin-top: 4px;
}

.forgot-link {
    color: rgba(255,255,255,.5);
    font-size: .82rem;
    text-decoration: none;
    transition: color .15s;
}
.forgot-link:hover { color: var(--accent); text-decoration: underline; }

/* ── Админ-панель ───────────────────────────────────────────── */
.admin-wrap {
    max-width: 1100px; margin: 0 auto; padding: 20px 16px;
}
.admin-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px;
}
.admin-header h2 { color: var(--accent); font-size: 1.4rem; }
.admin-section { margin-bottom: 28px; }
.admin-section h3 {
    font-size: 1rem; font-weight: 600; color: #c8e6c9;
    margin-bottom: 12px; padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,.1);
}
.admin-count { font-size: .85rem; color: #81c784; font-weight: 400; margin-left: 6px; }
.admin-table-wrap { overflow-x: auto; border-radius: 10px; }
.admin-table {
    width: 100%; border-collapse: collapse;
    background: rgba(255,255,255,.04); border-radius: 10px;
    font-size: .88rem;
}
.admin-table th {
    padding: 10px 12px; text-align: left; font-weight: 600;
    color: rgba(255,255,255,.6); font-size: .78rem; text-transform: uppercase;
    border-bottom: 1px solid rgba(255,255,255,.1); white-space: nowrap;
}
.admin-table td {
    padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,.05);
    vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: rgba(255,255,255,.03); }
.admin-table tr.row-blocked td { opacity: .65; }
.admin-empty { text-align: center; color: rgba(255,255,255,.4); padding: 24px !important; }
.admin-date { font-size: .78rem; color: rgba(255,255,255,.5); white-space: nowrap; }
.admin-badge {
    display: inline-block; padding: 2px 8px; border-radius: 20px;
    font-size: .75rem; font-weight: 600;
}
.admin-badge.active  { background: rgba(76,175,80,.2);  color: #81c784; }
.admin-badge.blocked { background: rgba(198,40,40,.25); color: #ef9a9a; }
.admin-badge.admin   { background: rgba(240,192,64,.2); color: var(--accent); }
.btn-danger  { background: #c0392b; color: #fff; }
.btn-danger:hover  { background: #a93226; }
.btn-success { background: #27ae60; color: #fff; }
.btn-success:hover { background: #1e8449; }
.btn-sm { padding: 5px 12px; font-size: .8rem; }

/* ── Боты ────────────────────────────────────────────────────── */
.bot-controls {
    display: flex; flex-wrap: wrap; gap: 12px;
    align-items: flex-end; margin-bottom: 4px;
}
.bot-add-group { display: flex; flex-direction: column; gap: 6px; }
.bot-role-label { font-size: .8rem; color: #a5d6a7; }
.bot-add-row { display: flex; gap: 6px; align-items: center; }
.bot-count-input {
    width: 58px; padding: 5px 8px; border-radius: 6px;
    border: 1px solid rgba(255,255,255,.2); background: rgba(0,0,0,.25);
    color: var(--text-light); font-size: .9rem; text-align: center;
}
.bot-prompt-textarea {
    width: 100%; box-sizing: border-box;
    background: rgba(0,0,0,.25); color: var(--text-light);
    border: 1px solid rgba(255,255,255,.2); border-radius: 8px;
    padding: 10px; font-size: .88rem; resize: vertical; font-family: inherit;
}

/* ── Список игроков в лобби (collapsible panel) ─────────────── */
.lobby-players-panel {
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,.1);
}
.lobby-players-toggle {
    width: 100%; display: flex; align-items: center; gap: 8px;
    padding: 9px 14px; background: none; border: none;
    cursor: pointer; color: var(--text-light); font-size: .84rem;
    text-align: left;
}
.lobby-players-toggle:hover { background: rgba(255,255,255,.05); }
.lobby-players-toggle-icon {
    font-size: .65rem; display: inline-block;
    transition: transform .2s; flex-shrink: 0;
}
.lobby-players-toggle-icon.open { transform: rotate(90deg); }
.lobby-players-count {
    margin-left: auto;
    background: rgba(255,255,255,.15); border-radius: 10px;
    padding: 1px 8px; font-size: .74rem; font-weight: 700;
}
.lobby-players-body {
    display: none; overflow-y: auto; max-height: 180px;
    background: rgba(0,0,0,.12);
}
.lobby-players-body.open { display: block; }
.lobby-player-row {
    padding: 7px 14px 7px 28px;
    font-size: .84rem; color: #c8e6c9;
    border-bottom: 1px solid rgba(255,255,255,.04);
}
.lobby-player-row:last-child { border-bottom: none; }

/* ── Игровой лог в чате ─────────────────────────────────────── */
.chat-log {
    font-size: .78rem;
    color: rgba(255,255,255,.55);
    font-style: italic;
    padding: 1px 4px;
    border-left: 2px solid rgba(255,255,255,.15);
    margin: 1px 0;
}
.chat-log .msg-time { color: rgba(255,255,255,.3); }

/* ── Sound dropdown ─────────────────────────────────────────── */
.sound-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
}
.sound-btn { font-size: 16px; padding: 4px 7px; }
.sound-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #1e3a24;
    border: 1px solid rgba(165,214,167,.25);
    border-radius: 8px;
    padding: 10px 12px;
    min-width: 160px;
    z-index: 200;
    box-shadow: 0 4px 16px rgba(0,0,0,.5);
}
.sound-panel.hidden { display: none; }

/* ── Переключатель языков ────────────────────────────────────── */
/* ── Language dropdown ─────────────────────────────────── */
.lang-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
}
.lang-dropdown-login {
    justify-content: center;
    margin-bottom: 12px;
    margin-left: 0;
}
.lang-trigger {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 3px 5px;
    border-radius: 5px;
    opacity: 0.75;
    transition: opacity .15s, background .15s;
    line-height: 1;
}
.lang-trigger:hover { opacity: 1; background: rgba(255,255,255,.12); }
.lang-flag-img {
    width: 22px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
    display: block;
}
.lang-arrow { font-size: 9px; color: #a5d6a7; line-height: 1; }
.lang-dropdown-menu {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    background: #1b3d2a;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 8px;
    box-shadow: 0 6px 22px rgba(0,0,0,.55);
    z-index: 9999;
    min-width: 138px;
    padding: 4px 0;
}
.lang-dropdown-menu.hidden { display: none; }
.lang-option {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 7px 13px;
    background: none;
    border: none;
    cursor: pointer;
    color: #e8f5e9;
    font-size: 13px;
    text-align: left;
    white-space: nowrap;
    transition: background .1s;
}
.lang-option:hover { background: rgba(255,255,255,.1); }
.lang-option.active { background: rgba(255,255,255,.07); font-weight: 600; }
.lang-option img {
    width: 20px;
    height: 14px;
    object-fit: cover;
    border-radius: 2px;
    flex-shrink: 0;
}

/* ── Кик из комнаты ──────────────────────────────────────────── */
.btn-kick {
    margin-left: 8px; padding: 1px 7px; border-radius: 4px;
    border: none; background: rgba(192,57,43,.7); color: #fff;
    font-size: .75rem; cursor: pointer; vertical-align: middle;
    line-height: 1.4;
}
.btn-kick:hover { background: #c0392b; }
