:root {
    --bg-dark: #100e12;
    --table-green: #143821;
    --table-border: #422616;
    --gold: #f5c531;
    --gold-hover: #ffd95c;
    --crimson: #b82323;
    --crimson-hover: #e02f2f;
    --wood: #26160b;
    --card-bg: #fafafa;
    --text-light: #ececec;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Roboto Condensed', sans-serif;
    user-select: none;
}

html {
    height: 100%;
    height: -webkit-fill-available;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    height: 100vh;
    height: 100dvh;
    height: -webkit-fill-available;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    justify-content: center;
    align-items: stretch;
    padding-top: env(safe-area-inset-top, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
}

/* ЭКРАНЫ */
.screen {
    display: none !important;
    width: 100%;
    min-height: 100%;
    height: 100%;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.screen.active {
    display: flex !important;
    flex-direction: column;
}

/* ЛОББИ СТАРТОВЫЙ ЭКРАН */
#lobbyScreen {
    background: radial-gradient(circle at center, #26171d 0%, #120b0e 60%, #050405 100%);
    position: relative;
    padding: 10px 14px 20px;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}
#lobbyScreen.active {
    display: flex !important;
}

/* ВЕРХНЯЯ СЛУЖЕБНАЯ ПАНЕЛЬ */
.lobby-top-bar {
    width: 100%;
    max-width: 860px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 4px 10px;
    z-index: 10;
}

.profile-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(22, 12, 16, 0.92);
    border: 1px solid #542f1f;
    border-radius: 30px;
    padding: 4px 14px 4px 5px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.6);
}

.avatar-badge {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: radial-gradient(circle, #e0a31b 0%, #694005 100%);
    border: 2px solid var(--gold);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.7);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    outline: none;
}
.avatar-badge:active {
    transform: scale(0.92);
}

.nickname-field-box {
    display: flex;
    flex-direction: column;
    text-align: left;
}
.nick-label {
    font-size: 9px;
    color: var(--gold);
    font-weight: 800;
    letter-spacing: 1px;
}
.nickname-field-box input {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    padding: 1px 0;
    outline: none;
    width: 110px;
}
.nickname-field-box input:focus {
    color: var(--gold);
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-top-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(30, 16, 21, 0.85);
    border: 1px solid #542f1f;
    color: var(--gold);
    font-size: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    transition: all 0.2s ease;
}
.btn-top-icon:hover {
    background: #381e28;
    border-color: var(--gold);
    transform: scale(1.05);
}

/* ГЛАВНЫЙ КОНТЕЙНЕР ЛОББИ */
.lobby-container {
    width: 100%;
    max-width: 860px;
    margin: auto 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
    z-index: 5;
}

.lobby-col-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    max-width: 440px;
}

.skull-badge-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 36px;
    margin-bottom: 2px;
}
.gun-left {
    transform: scaleX(-1);
    font-size: 26px;
}
.gun-right {
    font-size: 26px;
}
.skull-center {
    font-size: 42px;
    filter: drop-shadow(0 0 15px rgba(224, 47, 47, 0.6));
    animation: skull-breath 2.5s infinite alternate ease-in-out;
}
@keyframes skull-breath {
    0% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(224, 47, 47, 0.4)); }
    100% { transform: scale(1.06); filter: drop-shadow(0 0 25px rgba(245, 197, 49, 0.8)); }
}

.game-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(30px, 8vw, 42px);
    font-weight: 900;
    color: var(--gold);
    letter-spacing: 3px;
    text-shadow: 0 4px 15px rgba(0,0,0,0.9), 0 0 20px rgba(245, 197, 49, 0.3);
    line-height: 1.1;
}

.game-subtitle {
    font-size: 11px;
    color: #ff8585;
    letter-spacing: 2px;
    font-weight: 800;
    margin-top: 4px;
    margin-bottom: 12px;
}

.rules-card-teaser {
    background: rgba(18, 10, 13, 0.75);
    border: 1px solid #47261a;
    border-radius: 10px;
    padding: 8px 14px;
    width: 100%;
    text-align: left;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.8);
    box-sizing: border-box;
}
.teaser-header {
    font-size: 10px;
    color: var(--gold);
    font-weight: 900;
    letter-spacing: 1px;
    margin-bottom: 4px;
}
.teaser-list {
    list-style: none;
    font-size: 12px;
    color: #ccc;
    line-height: 1.4;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.teaser-list b {
    color: #fff;
}

/* ПРАВАЯ КОЛОНКА / КНОПКИ ДЕЙСТВИЙ */
.lobby-col-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 440px;
    box-sizing: border-box;
}

/* БОЛЬШИЕ СОЧНЫЕ ХАЙПОВЫЕ КНОПКИ */
.btn-hero {
    width: 100%;
    padding: 14px 18px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    border: none;
    text-align: left;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7);
    outline: none;
    box-sizing: border-box;
}
.btn-hero:active {
    transform: scale(0.97);
}

.btn-hero-crimson {
    background: linear-gradient(135deg, #c72020 0%, #801212 100%);
    color: #fff;
    border: 2px solid #ff4a4a;
    box-shadow: 0 4px 20px rgba(199, 32, 32, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.btn-hero-crimson:hover {
    background: linear-gradient(135deg, #e02f2f 0%, #9e1919 100%);
    box-shadow: 0 6px 25px rgba(224, 47, 47, 0.7);
}

.btn-hero-gold {
    background: linear-gradient(135deg, #d49f19 0%, #875e05 100%);
    color: #fff;
    border: 2px solid #ffe175;
    box-shadow: 0 4px 20px rgba(212, 159, 25, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.btn-hero-gold:hover {
    background: linear-gradient(135deg, #e6b025 0%, #a6760b 100%);
    box-shadow: 0 6px 25px rgba(230, 176, 37, 0.7);
}

.btn-hero-icon {
    font-size: 32px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
    flex-shrink: 0;
}
.btn-hero-info {
    display: flex;
    flex-direction: column;
}
.btn-hero-title {
    font-family: 'Cinzel', serif;
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 1.5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.7);
    line-height: 1.2;
}
.btn-hero-desc {
    font-size: 11px;
    opacity: 0.9;
    font-weight: 600;
}

/* КАРТОЧКА ВХОДА ПО КОДУ */
.join-card {
    background: rgba(18, 10, 13, 0.95);
    border: 1px solid #542f1f;
    border-radius: 12px;
    padding: 10px 14px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-sizing: border-box;
}
.join-card-label {
    font-size: 10px;
    color: #aaa;
    font-weight: 800;
    letter-spacing: 1px;
    text-align: left;
}
.join-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
}
.join-input-group input {
    flex: 1 1 0%;
    min-width: 0;
    width: auto;
    background: #0d0608;
    border: 1px solid #6b3e2a;
    border-radius: 8px;
    padding: 10px 8px;
    color: #fff;
    font-size: 18px;
    font-weight: 900;
    text-align: center;
    letter-spacing: 4px;
    outline: none;
    box-sizing: border-box;
}
.join-input-group input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 10px rgba(245, 197, 49, 0.3);
}
.btn-join {
    flex: 0 0 auto;
    background: #331f17;
    border: 1px solid #703e28;
    border-radius: 8px;
    color: #ffd95c;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.btn-join:hover {
    background: #4d2d1f;
    color: #fff;
    transform: translateY(-1px);
}
.btn-join:active {
    transform: scale(0.96);
}

/* ЗАЛ ОЖИДАНИЯ */
#waitingScreen {
    background: radial-gradient(circle at center, #23161a 0%, #0a0809 100%);
    display: none;
    justify-content: center;
    align-items: center;
    padding: 14px;
}
#waitingScreen.active {
    display: flex !important;
}

.waiting-card {
    background: rgba(26, 17, 20, 0.96);
    border: 2px solid #542f1f;
    box-shadow: 0 10px 40px rgba(0,0,0,0.85), 0 0 25px rgba(184, 35, 35, 0.25);
    border-radius: 12px;
    padding: 24px 20px;
    width: 95%;
    max-width: 440px;
    text-align: center;
    box-sizing: border-box;
}

/* КНОПКА СКОПИРОВАТЬ КОД */
.btn-copy-code {
    background: #254030;
    color: #a8f0be;
    border: 1px solid #3c6e4f;
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 20px;
    margin: 4px auto 10px;
    cursor: pointer;
    font-weight: 800;
    display: inline-block;
}
.btn-copy-code:hover {
    background: #325741;
}

/* НАСТРОЙКИ СТОЛА В ЗАЛЕ ОЖИДАНИЯ (ВРЕМЯ НА ХОД) */
.room-settings-card {
    background: rgba(18, 10, 13, 0.85);
    border: 1px solid #542f1f;
    border-radius: 10px;
    padding: 10px 14px;
    margin: 8px 0 14px;
    text-align: left;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.6);
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.settings-title {
    font-size: 11px;
    font-weight: 800;
    color: #bbb;
    letter-spacing: 1px;
}

.settings-val-badge {
    background: rgba(245, 197, 49, 0.15);
    border: 1px solid var(--gold);
    color: var(--gold);
    font-size: 13px;
    font-weight: 900;
    padding: 2px 10px;
    border-radius: 12px;
    letter-spacing: 0.5px;
}

.slider-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.time-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #2a161f;
    outline: none;
    accent-color: var(--gold);
    cursor: pointer;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #888;
    font-weight: 700;
}

.guest-settings-notice {
    font-size: 11px;
    color: #777;
    font-style: italic;
    text-align: center;
    padding-top: 4px;
}

/* КНОПКИ */
.btn {
    border: none;
    border-radius: 6px;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-large {
    padding: 15px 24px;
    font-size: 17px;
}

.btn:disabled, .btn-action:disabled {
    opacity: 0.25 !important;
    filter: grayscale(1) brightness(0.6) !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    box-shadow: none !important;
    transform: none !important;
}

.btn-gold {
    background: linear-gradient(180deg, #d4a017 0%, #aa7c11 100%);
    color: #170d00;
    box-shadow: 0 4px 10px rgba(212, 160, 23, 0.3);
}
.btn-gold:hover { background: var(--gold-hover); transform: translateY(-2px); }

.btn-crimson {
    background: linear-gradient(180deg, #b82323 0%, #7d1515 100%);
    color: #fff;
    box-shadow: 0 4px 10px rgba(184, 35, 35, 0.3);
}
.btn-crimson:hover { background: var(--crimson-hover); transform: translateY(-2px); }

.btn-secondary {
    background: #331f17;
    color: #ccc;
}
.btn-secondary:hover { background: #4a2f24; }

.btn-combos {
    background: #254030;
    color: #a8f0be;
    border: 1px solid #3c6e4f;
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 20px;
}
.btn-combos:hover { background: #325741; }

.btn-leave {
    background: #4a1d1d;
    color: #ffa3a3;
    border: 1px solid #732a2a;
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 20px;
}
.btn-leave:hover { background: #6b2626; color: #fff; }



/* ЗАЛ ОЖИДАНИЯ */
.room-code-badge {
    font-size: 30px;
    font-weight: 900;
    color: var(--gold);
    margin: 12px 0;
    letter-spacing: 3px;
}
.players-list-box {
    margin: 18px 0;
    background: rgba(0,0,0,0.45);
    border-radius: 8px;
    padding: 14px;
    text-align: left;
}
.players-list-box h3 {
    font-size: 13px;
    color: #999;
    margin-bottom: 8px;
}
#waitingPlayersList {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
#waitingPlayersList li {
    padding: 8px 12px;
    background: #231418;
    border-radius: 4px;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
}

/* ИГРОВОЙ СТОЛ */
#gameScreen {
    background: radial-gradient(ellipse at center, #0f2618 0%, #060d09 100%);
    display: none;
    flex-direction: column;
    height: 100%;
    min-height: 100%;
    position: relative;
    box-sizing: border-box;
}

#gameScreen.active {
    display: flex !important;
}

.table-header {
    min-height: 44px;
    height: auto;
    background: rgba(8, 18, 12, 0.95);
    border-bottom: 2px solid #1f3b27;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 10px;
    z-index: 10;
    gap: 6px;
    width: 100%;
    box-sizing: border-box;
}
.header-left {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.header-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}
.header-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.room-badge { font-weight: 800; color: #aaa; font-size: 13px; }
.street-pill {
    background: #1b4d2c;
    color: #6ef098;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 1px;
}
.status-banner { font-size: 15px; font-weight: 700; color: var(--gold); }

/* ИНДИКАТОР ХОДА */
.turn-indicator {
    font-size: 13px;
    font-weight: 900;
    color: #72e096;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(0,0,0,0.4);
    border: 1px solid #234d31;
}
.turn-indicator.my-turn {
    background: rgba(245, 197, 49, 0.2);
    border-color: var(--gold);
    color: var(--gold);
    animation: pulse-turn 1.2s infinite alternate;
}
@keyframes pulse-turn {
    0% { transform: scale(1); box-shadow: 0 0 5px rgba(245, 197, 49, 0.3); }
    100% { transform: scale(1.05); box-shadow: 0 0 15px rgba(245, 197, 49, 0.8); }
}

/* БЕЙДЖ И ШКАЛА ТАЙМЕРА ХОДА */
.turn-timer-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(30, 16, 21, 0.9);
    border: 1px solid #703e28;
    border-radius: 12px;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: 900;
    color: var(--gold);
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
    white-space: nowrap;
}

.turn-timer-badge.urgent {
    background: rgba(184, 35, 35, 0.95);
    border-color: #ff4a4a;
    color: #fff;
    animation: timer-badge-pulse 0.6s infinite alternate;
}

@keyframes timer-badge-pulse {
    0% { transform: scale(1); filter: drop-shadow(0 0 2px #ff2222); }
    100% { transform: scale(1.1); filter: drop-shadow(0 0 8px #ff4444); }
}

.turn-timer-bar-wrapper {
    width: 100%;
    height: 3px;
    background: rgba(0, 0, 0, 0.6);
    overflow: hidden;
    position: relative;
    z-index: 9;
}

.turn-timer-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--gold) 0%, #46bd5d 100%);
    transition: width 0.15s linear, background 0.3s;
}

.turn-timer-bar.urgent {
    background: linear-gradient(90deg, #ff4a4a 0%, #b82323 100%);
}

/* ОПОВЕЩЕНИЯ */
.raise-alert-banner {
    display: none;
    background: linear-gradient(90deg, rgba(184, 35, 35, 0.95) 0%, rgba(212, 160, 23, 0.95) 100%);
    color: #fff;
    text-align: center;
    padding: 8px 16px;
    font-weight: 900;
    font-size: 15px;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.6);
    position: absolute;
    top: 52px;
    left: 0;
    right: 0;
    z-index: 20;
    animation: slide-down 0.3s ease;
}
@keyframes slide-down {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

.spectator-banner {
    background: rgba(30, 15, 18, 0.95);
    border-bottom: 2px solid #571f25;
    color: #ffa3a3;
    padding: 6px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 700;
    z-index: 15;
}

/* СУКНО СТОЛА (ПОКЕРНЫЙ ОВАЛ) */
.poker-table {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    position: relative;
    background: radial-gradient(ellipse at center, #1c4a2b 0%, #0e2917 75%, #06140b 100%);
    border: 5px solid #452716;
    border-radius: 35px;
    margin: 6px 10px;
    box-shadow: inset 0 0 35px rgba(0,0,0,0.9), 0 0 25px rgba(0,0,0,0.95);
    touch-action: manipulation;
}

/* Соперники вокруг стола */
.opponents-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 95px;
    padding: 2px 6px;
    flex-wrap: wrap;
}
.opponent-card {
    background: rgba(10, 24, 15, 0.9);
    border: 1px solid #23472f;
    border-radius: 8px;
    padding: 6px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 100px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.6);
    transition: all 0.3s ease;
}
.opponent-card.turn {
    border-color: var(--gold);
    box-shadow: 0 0 16px var(--gold);
    transform: translateY(-2px);
}
.opponent-card.dead {
    opacity: 0.35;
    border-color: #555;
}

/* Подсветка победителя раздачи */
.opponent-card.winner-highlight, .my-player-zone.winner-highlight {
    border-color: #ffd95c !important;
    box-shadow: 0 0 35px rgba(255, 217, 92, 0.9), inset 0 0 15px rgba(255, 217, 92, 0.4) !important;
    animation: winner-pulse 1s infinite alternate ease-in-out;
}
@keyframes winner-pulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.03); }
}

.opponent-name { font-weight: 700; font-size: 13px; margin-bottom: 2px; }
.opponent-bet { font-size: 12px; color: var(--gold); font-weight: 700; margin-bottom: 4px; }

/* Центр стола */
.table-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.pot-container {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid #4a3418;
    border-radius: 30px;
    padding: 4px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.pot-info { display: flex; align-items: center; gap: 6px; }
.pot-icon { font-size: 18px; }
.pot-val { font-size: 22px; font-weight: 900; color: var(--gold); }
.current-bet-info { font-size: 13px; color: #ff8585; border-left: 1px solid #444; padding-left: 10px; font-weight: 700; }

/* КАРТЫ */
.cards-row {
    display: flex;
    gap: 6px;
    justify-content: center;
}
.cards-label {
    text-align: center;
    font-size: 10px;
    color: #6a9675;
    margin-bottom: 3px;
    letter-spacing: 1px;
    font-weight: 700;
}
.card {
    width: clamp(52px, 14vw, 68px);
    height: clamp(74px, 20vw, 96px);
    background: var(--card-bg);
    border-radius: 6px;
    color: #111;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 5px;
    font-weight: 900;
    box-shadow: 0 4px 10px rgba(0,0,0,0.65);
    position: relative;
    transition: transform 0.2s ease;
}
.card.red { color: #b81818; }
.card.black { color: #111; }
.card-top { font-size: clamp(12px, 3.2vw, 15px); line-height: 1; font-weight: 900; }
.card-center { font-size: clamp(20px, 5.5vw, 26px); text-align: center; }
.card-bottom { font-size: clamp(12px, 3.2vw, 15px); line-height: 1; text-align: right; font-weight: 900; }

.card.face-down {
    background: #6e1717 repeating-linear-gradient(45deg, #6e1717, #6e1717 6px, #4d1010 6px, #4d1010 12px);
    border: 2px solid #fff;
    color: transparent;
}

/* МОЯ ЗОНА */
.my-player-zone {
    width: 100%;
    max-width: 680px;
    background: rgba(8, 20, 12, 0.96);
    border: 2px solid #254a31;
    border-radius: 12px;
    padding: 8px 14px;
    box-shadow: 0 0 25px rgba(0,0,0,0.8);
    transition: all 0.3s ease;
}
.my-player-zone.my-turn-active {
    border-color: var(--gold);
    box-shadow: 0 0 25px rgba(245, 197, 49, 0.4);
}
.my-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.my-name-status { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15px; }
.status-pill {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 800;
}
.status-pill.alive { background: #1c6130; color: #a3ffbd; }
.status-pill.dead { background: #5c1818; color: #ffa8a8; }
.my-hand-eval { color: var(--gold); font-weight: 700; font-size: 15px; }
.my-bet-badge { font-size: 13px; color: #aaa; font-weight: 700; }

.my-hand-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.cards-and-bullets-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.bullet-slots-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.45);
    padding: 3px 12px;
    border-radius: 20px;
    border: 1px solid #3d2314;
}

.bullet-slots-title {
    font-size: 10px;
    color: var(--gold);
    font-weight: 800;
    letter-spacing: 1px;
}

.bullet-slots {
    display: flex;
    gap: 5px;
    align-items: center;
}

.bullet-slot {
    width: 14px;
    height: 24px;
    background: rgba(12, 8, 10, 0.85);
    border: 1px solid #4a2f20;
    border-radius: 4px 4px 2px 2px;
    position: relative;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.9);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Наполненный латунный патрон */
.bullet-slot.filled {
    background: linear-gradient(180deg, #ffd95c 0%, #d49f19 40%, #805704 85%, #593902 100%);
    border: 1px solid #ffe885;
    box-shadow: 0 0 8px rgba(245, 197, 49, 0.7), inset 0 1px 2px rgba(255, 255, 255, 0.8);
    transform: scale(1.05);
}

.bullet-slot.filled::before {
    content: '';
    position: absolute;
    top: -3px;
    left: 2px;
    right: 2px;
    height: 3px;
    background: #ffcc33;
    border-radius: 3px 3px 0 0;
}

/* Слоты у соперников */
.opp-slots {
    margin: 4px 0;
    display: flex;
    gap: 3px;
}
.opp-slots .bullet-slot {
    width: 9px;
    height: 16px;
    border-radius: 3px 3px 1px 1px;
}
.opp-slots .bullet-slot.filled::before {
    height: 2px;
    top: -2px;
}

/* БАРАБАН РЕВОЛЬВЕРА */
.cylinder-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}
.cylinder {
    width: 56px;
    height: 56px;
    background: radial-gradient(circle, #555 0%, #222 100%);
    border: 3px solid #777;
    border-radius: 50%;
    position: relative;
    box-shadow: inset 0 0 8px #000, 0 4px 8px rgba(0,0,0,0.7);
}
.chamber {
    width: 11px;
    height: 11px;
    background: #111;
    border-radius: 50%;
    position: absolute;
    border: 1px solid #444;
}
.chamber.c1 { top: 4px; left: 20px; }
.chamber.c2 { top: 13px; right: 7px; }
.chamber.c3 { bottom: 13px; right: 7px; }
.chamber.c4 { bottom: 4px; left: 20px; }
.chamber.c5 { bottom: 13px; left: 7px; }
.chamber.c6 { top: 13px; left: 7px; }
.pin {
    width: 9px;
    height: 9px;
    background: #999;
    border-radius: 50%;
    position: absolute;
    top: 21px;
    left: 21px;
}
.cylinder-label { font-size: 9px; color: #888; font-weight: 700; }

/* ПАНЕЛЬ ДЕЙСТВИЙ */
.action-panel {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
}
.btn-action {
    padding: 10px 14px;
    font-size: 13px;
}
.btn-call { background: #237841; color: #fff; }
.btn-call:hover { background: #2d9451; }

.raise-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
    background: rgba(0,0,0,0.35);
    padding: 3px 8px;
    border-radius: 6px;
}
.btn-raise { background: #b07418; color: #fff; }
.btn-raise:hover { background: #d48c1e; }
.raise-group input[type="range"] { width: 95px; accent-color: var(--gold); }

.btn-swap { background: #3c5482; color: #fff; }
.btn-swap:hover { background: #4a68a1; }

.btn-fold { background: #7d1f1f; color: #fff; }
.btn-fold:hover { background: #9e2727; }

/* ЛОГ СОБЫТИЙ */
.game-log-drawer {
    height: 65px;
    background: #060a07;
    border-top: 1px solid #16281b;
    padding: 6px 16px;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.4;
}
.log-title { font-size: 10px; color: #555; text-transform: uppercase; margin-bottom: 2px; }
.log-content { color: #aaa; display: flex; flex-direction: column; gap: 2px; }

/* МОДАЛКА КАЗНИ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(ellipse at center, rgba(12, 18, 14, 0.42) 20%, rgba(3, 5, 4, 0.8) 100%);
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(1.5px);
    -webkit-backdrop-filter: blur(1.5px);
}
.modal-overlay.active { display: flex; }

.execution-card {
    background: #1a0e10;
    border: 3px solid var(--crimson);
    border-radius: 14px;
    padding: 26px 36px;
    text-align: center;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 0 50px rgba(184, 35, 35, 0.7);
    animation: scale-up 0.3s ease;
}
@keyframes scale-up {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.skull-badge { font-size: 40px; margin-bottom: 4px; }
.execution-card h2 { color: var(--gold); font-family: 'Cinzel', serif; font-size: 26px; margin-bottom: 6px; }
.exec-bullets-badge {
    background: #331317;
    color: #ff9191;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 18px;
}
.revolver-animation-box {
    margin: 15px 0;
    display: flex;
    justify-content: center;
}
.big-cylinder {
    width: 90px;
    height: 90px;
    background: radial-gradient(circle, #666 0%, #1a1a1a 100%);
    border: 4px solid #aaa;
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 20px #000;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.big-cylinder.spinning {
    animation: spin-cyl 1.2s infinite linear;
}
@keyframes spin-cyl {
    100% { transform: rotate(360deg); }
}
.big-chamber {
    width: 18px;
    height: 18px;
    background: #111;
    border-radius: 50%;
    position: absolute;
    border: 2px solid #555;
}
.big-chamber.bc1 { top: 6px; left: 32px; }
.big-chamber.bc2 { top: 22px; right: 10px; }
.big-chamber.bc3 { bottom: 22px; right: 10px; }
.big-chamber.bc4 { bottom: 6px; left: 32px; }
.big-chamber.bc5 { bottom: 22px; left: 10px; }
.big-chamber.bc6 { top: 22px; left: 10px; }
.big-pin {
    width: 14px;
    height: 14px;
    background: #bbb;
    border-radius: 50%;
    position: absolute;
    top: 34px;
    left: 34px;
}
.exec-status-msg {
    font-size: 16px;
    font-weight: 700;
    color: #eee;
    margin-top: 10px;
}

/* МОДАЛКА КОНЦА ИГРЫ (РЕВАНШ) */
.game-over-card {
    background: #18120b;
    border: 3px solid var(--gold);
    border-radius: 14px;
    padding: 30px;
    text-align: center;
    max-width: 440px;
    width: 90%;
    box-shadow: 0 0 50px rgba(245, 197, 49, 0.5);
    animation: scale-up 0.3s ease;
}
.crown-icon { font-size: 48px; margin-bottom: 6px; }
.game-over-title {
    font-family: 'Cinzel', serif;
    color: var(--gold);
    font-size: 28px;
    margin-bottom: 12px;
}
.winner-announcement {
    font-size: 18px;
    color: #fff;
    margin-bottom: 8px;
}
.winner-announcement b {
    color: var(--gold);
    font-size: 22px;
}
.game-over-desc {
    font-size: 13px;
    color: #aaa;
    margin-bottom: 24px;
}
.game-over-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* МОДАЛКА ШПАРГАЛКИ КОМБИНАЦИЙ */
.combos-card {
    background: #141f17;
    border: 2px solid #2d6b3f;
    border-radius: 12px;
    padding: 22px;
    max-width: 480px;
    width: 92%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,0.85);
}
.combos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.combos-header h2 { font-family: 'Cinzel', serif; color: var(--gold); font-size: 20px; }
.btn-close-modal {
    background: none;
    border: none;
    color: #888;
    font-size: 20px;
    cursor: pointer;
}
.btn-close-modal:hover { color: #fff; }
.combos-sub { font-size: 12px; color: #8cb898; margin-bottom: 12px; }
.combos-list {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 4px;
}
.combo-item {
    background: rgba(0,0,0,0.45);
    border: 1px solid #22422b;
    border-radius: 8px;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.combo-num {
    background: #1f3b27;
    color: var(--gold);
    font-weight: 900;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 11px;
    flex-shrink: 0;
}
.combo-info {
    display: flex;
    flex-direction: column;
    text-align: left;
    flex: 1;
    min-width: 140px;
}
.combo-info b { font-size: 13px; color: #fff; }
.combo-info small { font-size: 11px; color: #9bbfa5; }

.mini-cards {
    display: flex;
    gap: 3px;
    margin-left: auto;
    flex-shrink: 0;
}
.mc {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    border: 1px solid #888;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 900;
    padding: 2px 4px;
    min-width: 24px;
    height: 26px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.5);
    line-height: 1;
}
.mc.red { color: #d61818; }
.mc.black { color: #161616; }

/* АДАПТИВНОСТЬ ДЛЯ ТЕЛЕФОНОВ / АНДРОИД */
@media (max-width: 768px) {
    .poker-table {
        margin: 4px 6px;
        padding: 6px 8px;
        border-width: 3px;
        border-radius: 20px;
    }
    
    .game-header {
        padding: 4px 8px;
        min-height: 42px;
    }
    .header-left, .header-right {
        gap: 6px;
    }
    .room-badge, .turn-indicator, .status-banner {
        font-size: 11px;
        padding: 2px 6px;
    }
    
    /* Соперники сверху */
    .opponents-container {
        min-height: 70px;
        gap: 6px;
        padding: 2px 4px;
    }
    .opponent-card {
        padding: 4px 6px;
        min-width: 80px;
    }
    .opponent-name {
        font-size: 11px;
    }
    .opponent-card .card {
        width: 28px !important;
        height: 38px !important;
        padding: 2px;
        border-radius: 3px;
    }
    .opponent-card .card .card-top,
    .opponent-card .card .card-bottom {
        font-size: 8px !important;
    }
    .opponent-card .card .card-center {
        font-size: 12px !important;
    }

    /* Общие карты на столе */
    .community-cards-box .card {
        width: clamp(40px, 12vw, 54px);
        height: clamp(58px, 17vw, 78px);
        padding: 3px;
    }
    .cards-label {
        font-size: 9px;
        margin-bottom: 2px;
    }
    .pot-container {
        padding: 2px 12px;
        gap: 8px;
    }
    .pot-val {
        font-size: 18px;
    }
    .current-bet-info {
        font-size: 11px;
        padding-left: 6px;
    }

    /* Зона игрока */
    .my-player-zone {
        padding: 6px 8px;
    }
    .my-info-bar {
        font-size: 12px;
        margin-bottom: 4px;
    }
    .my-name-status {
        font-size: 12px;
        gap: 4px;
    }
    .my-hand-eval {
        font-size: 13px;
    }
    .my-bet-badge {
        font-size: 11px;
    }

    /* Карты игрока - крупные и четкие */
    #myCardsRow .card {
        width: clamp(56px, 16vw, 72px);
        height: clamp(80px, 22vw, 100px);
        padding: 5px;
    }
    #myCardsRow .card .card-top,
    #myCardsRow .card .card-bottom {
        font-size: clamp(13px, 3.8vw, 16px);
    }
    #myCardsRow .card .card-center {
        font-size: clamp(24px, 6.8vw, 30px);
    }

    .bullet-slots-wrapper {
        padding: 2px 8px;
        gap: 5px;
    }
    .bullet-slots-title {
        font-size: 9px;
    }
    .bullet-slot {
        width: 12px;
        height: 20px;
    }

    .cylinder {
        width: 44px;
        height: 44px;
    }
    .chamber {
        width: 9px;
        height: 9px;
    }
    .chamber.c1 { top: 3px; left: 16px; }
    .chamber.c2 { top: 10px; right: 5px; }
    .chamber.c3 { bottom: 10px; right: 5px; }
    .chamber.c4 { bottom: 3px; left: 16px; }
    .chamber.c5 { bottom: 10px; left: 5px; }
    .chamber.c6 { top: 10px; left: 5px; }
    .pin {
        width: 7px;
        height: 7px;
        top: 17px;
        left: 17px;
    }

    /* Кнопки действий: удобная 2х2 сетка под пальцы */
    .action-panel {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        width: 100%;
    }
    .btn-action {
        padding: 10px 8px;
        font-size: 12px;
        width: 100%;
        min-height: 42px;
    }
    .raise-group {
        padding: 2px 6px;
        width: 100%;
    }
    .raise-group .btn-raise {
        width: 100%;
    }
    .raise-group input[type="range"] {
        width: 100%;
    }

    .game-log-drawer {
        height: 28px;
        padding: 4px 10px;
        font-size: 11px;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }
}

/* АДАПТИВНОСТЬ ЛОББИ: ГОРИЗОНТАЛЬНЫЙ РЕЖИМ (LANDSCAPE) */
@media (orientation: landscape) and (max-height: 550px), (min-width: 720px) and (max-height: 600px) {
    #lobbyScreen {
        padding: 6px 14px 10px;
        justify-content: flex-start;
    }
    .lobby-top-bar {
        padding: 2px 4px 6px;
    }
    .lobby-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
        align-items: center;
        max-width: 820px;
        margin: auto;
    }
    .lobby-col-hero {
        max-width: 100%;
        gap: 4px;
    }
    .lobby-col-actions {
        max-width: 100%;
        gap: 8px;
    }
    .btn-hero {
        padding: 8px 14px;
        gap: 10px;
    }
    .btn-hero-icon {
        font-size: 24px;
    }
    .btn-hero-title {
        font-size: 15px;
    }
    .btn-hero-desc {
        font-size: 10px;
    }
    .rules-card-teaser {
        padding: 6px 10px;
    }
    .teaser-list {
        font-size: 11px;
    }
    .skull-badge-hero {
        font-size: 24px;
    }
    .skull-center {
        font-size: 28px;
    }
    .game-title {
        font-size: 26px;
    }
    .game-subtitle {
        margin-bottom: 4px;
        font-size: 10px;
    }
}

/* АДАПТИВНОСТЬ СТОЛА В ГОРИЗОНТАЛЬНОМ РЕЖИМЕ (LANDSCAPE) */
@media (orientation: landscape) and (max-height: 520px) {
    .table-header {
        height: 36px;
        padding: 2px 8px;
    }
    .poker-table {
        margin: 2px 4px;
        padding: 2px 6px;
        border-width: 2px;
        border-radius: 16px;
    }
    .opponents-container {
        min-height: 55px;
        padding: 0;
        gap: 4px;
    }
    .opponent-card {
        padding: 2px 6px;
        min-width: 70px;
    }
    .opponent-card .card {
        width: 22px !important;
        height: 32px !important;
    }
    .table-center {
        gap: 2px;
    }
    .community-cards-box .card {
        width: clamp(34px, 7vw, 44px) !important;
        height: clamp(48px, 10vw, 62px) !important;
    }
    .pot-container {
        padding: 1px 8px;
    }
    .pot-val {
        font-size: 16px;
    }
    .my-player-zone {
        padding: 3px 6px;
    }
    .my-info-bar {
        margin-bottom: 2px;
    }
    #myCardsRow .card {
        width: clamp(44px, 8vw, 56px) !important;
        height: clamp(62px, 12vw, 78px) !important;
    }
    .cylinder {
        width: 36px;
        height: 36px;
    }
    .bullet-slots-wrapper {
        padding: 1px 6px;
    }
    .bullet-slot {
        width: 10px;
        height: 16px;
    }
    .action-panel {
        gap: 4px;
    }
    .btn-action {
        padding: 6px 4px;
        font-size: 11px;
        min-height: 34px;
    }
    .game-log-drawer {
        height: 24px;
        padding: 2px 8px;
        font-size: 10px;
    }
}

/* Поддержка графических ассетов (аватары и карты) */
.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.card-custom-image {
    padding: 0 !important;
    overflow: hidden;
    background: transparent !important;
}

.card-img-content {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
    display: block;
}

