.ava{
    width: 40px;
    border-radius: 20px;
    margin-left: 10px;
}
.money-icon{
    width: 21px;
    height: 21px;
    margin-top: 5px;
}
#header-game{
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* Фиксированная высота: содержимое не дёргает хедер и центрируется по
       вертикали. В игровой сцене пространство дорого — компактнее, чем меню. */
    height: 56px;
    box-sizing: border-box;
    padding-left: 3px;
    padding-right: 5px;
    background-color: rgba(44, 44, 44, 0.6);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-faint);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}
#header-game-left{
    display: flex;
    align-items: center;
    padding-left: 10px;
}
#header-game-right{
    display: flex;
    align-items: center;
    padding-right: 10px;
}
#to-menu-button{
    padding: 4px 8px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(255, 82, 82, 0.5);
    background: rgba(255, 82, 82, 0.1);
    color: #ff5252;
    font-size: 14px;
    font-weight: 600;
    font-family: system-ui;
    cursor: pointer;
}
#to-menu-button:hover{
    background: rgba(255, 82, 82, 0.2);
    border-color: #ff5252;
}
.my-nickname{
    margin-left: 10px;
    font-size: 19px;
    color: var(--text);
    font-family: sans-serif;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}
#my-nickname-game{
    margin-left: 10px;
    font-size: 19px;
    color: var(--text);
    font-family: sans-serif;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}
.my-money{
    margin-left: 10px;
    font-size: 19px;
    color: var(--text);
    font-family: system-ui;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}
#my-money-game{
    margin-left: 10px;
    font-size: 19px;
    color: var(--text);
    font-family: system-ui;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}
.player-block{
    width: 100px;
    height: 100px;
    /* border: 1px dashed gray; */
    display: flex;
    justify-content: center;
    align-items: center;
    /* flex-direction: column; */
}
.player-content{
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
#table{
    display: flex;
    flex-direction: row-reverse;
    justify-content: center;
    margin-top: 12px;
    margin-bottom: 17px;
    perspective: 900px;
    perspective-origin: 50% 0%;
}
#table-block{
    height: 340px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    background-color: #4a5d4a;
    max-width: 700px;
    width: 100%;
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: space-between;
    background-image: repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.04) 0px, rgba(0, 0, 0, 0.04) 1px, transparent 1px, transparent 12px), radial-gradient(ellipse at center, #556b56, #3f4f3f);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), inset 0 0 40px rgba(0, 0, 0, 0.25);
    transform: rotateX(30deg);
}
#table-top{
    display: flex;
    justify-content: space-between;
    /* Отступы для игроков над столом: сверху — от хедера, снизу — от стола.
       Значения подобраны под визуальный центр игрока (аватар + карты + ник):
       зазоры от хедера и до стола получаются равными. */
    margin-top: 24px;
    margin-bottom: 0;
}
#table-game{
    display: flex;
    flex-direction: column;
    margin-top: 10px;
}
#table-bottom{
    display: flex;
    justify-content: space-between;
    /* Отступы для игроков ниже стола: сверху — от стола, снизу — от карт в руке.
       Зеркально верхнему игроку: визуальные зазоры от стола и до руки равны. */
    margin-top: 26px;
    margin-bottom: 32px;
}
#bottom-game{
    /* min-height: 300px; */
    /* border: 1px dashed red; */
    display: flex;
    justify-content: center;
    align-items: flex-start;
}
#game-page{
    display: flex;
    justify-content: center;
    /* background-image: url('../assets/bg1.png'); */
}
#game-scene-container{
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    max-width: 1200px;
    width: 100%;
}
.card-deck{
    width: 50px;
    transform: rotate(90deg);
    margin-left: -15px;
}
.card-2-side{
    width: 50px;
    position: relative;
    z-index: 2;
    /* background-image: url('./assets/card-2-side.png'); */
}
.deck-block{
    display: inline-block;
    background-image: url(../assets/card-2-side.png);
    background-size: cover;
    width: 50px;
    height: 70px;
    position: relative;
    z-index: 2;
    padding-top: 25px;
}
#deck-cards-count{
    text-align: center;
    font-family: monospace;
    font-size: 20px;
    color: var(--text);
}
.deck-cards-count-style{
    background-color: rgba(0, 0, 0, 0.55);
    border-radius: 7px;
}
#deck{
    display: flex;
    min-height: 70px;
}
.card{
    width: 50px;
}
.card-stack .card{
    margin-bottom: -15px; 
    position: relative;
    z-index: 1;
}
.second-card{
    position: relative;
    z-index: 2;
}
.card-stack{
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
#cards-on-table-block{
    padding-top: 10px;
    display: flex;
    padding-left: 5px;
}
.card-stack{
    margin-left: -5px;
}
.cards-in-hands{
    padding-left: 10px;
    min-height: 142px;
}
.card-button img{
    display: inline-block;
    width: 90px;
    border-radius: 6px;
    transition: filter 0.2s ease, box-shadow 0.2s ease;
}
.card-button{
    position: relative;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: inline-block;
    line-height: 0;
}
/* Карта, которой можно сыграть: постоянная зелёная рамка.
   Без position/z-index: карты в обычном DOM-порядке (правая поверх левой),
   ничего не «тонет» и не «всплывает». */
.card-button:not(:disabled) img{
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.55);
}
/* Hover активной карты: только плоская рамка. БЕЗ filter —
   filter создаёт stacking context, и карта всплывает поверх соседних. */
.card-button:not(:disabled):hover img {
    box-shadow: 0 0 0 2px var(--accent-border);
}
.card-button:active img {
    box-shadow: 0 0 0 2px var(--accent);
}
/* Неактивные карты: затемняющий оверлей поверх НЕПРОЗРАЧНОЙ картинки.
   Без filter (он создаёт stacking context) и без opacity (сквозь карту
   просвечивает соседняя) — карта видна, но явно затемнена. */
.card-button.img-inactive::after{
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 6px;
    pointer-events: none;
}
.player-ava{
    display: block;
    width: 100%;
}
.avatar-container {
    position: relative;
    overflow: hidden;
    width: 100px;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}
/* Офлайн: подсветка аватара игрока, чей ход (вместо таймера-оверлея). */
.offline-active-player .avatar-container{
    box-shadow: 0 0 0 3px #ffd54f, 0 0 16px 5px rgba(255, 213, 79, 0.65);
}
.player-nickname{
    margin-top: 5px;
    font-weight: bold;
    color: var(--text);
    font-family: sans-serif;
    font-size: 13px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}
.player-cards{
    padding-left: 18px;
    margin: -10px;
    min-height: 32px;
    position: relative;
    z-index: 2;
    margin-top: -16px;
}
.player-cards img{
    width: 20px;
    margin-left: -18px;
}
.avatar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgb(255 236 143 / 50%);
    /* Это свойство будет менять JS */
    mask: conic-gradient(black 0deg, transparent 0deg);
    -webkit-mask: conic-gradient(black 0deg, transparent 0deg);
    pointer-events: none;  /* чтобы не мешало кликать */
}
#command-take{
    
}
#commands-block button {
    padding: 10px 22px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    font-size: 16px;
    font-weight: 600;
    font-family: system-ui;
    cursor: pointer;
    display: none;
}
.sit-button{
    padding: 10px 24px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--accent-border);
    background: rgba(0, 230, 118, 0.1);
    color: var(--accent-bright);
    font-size: 15px;
    font-weight: 600;
    font-family: system-ui;
    cursor: pointer;
}
.sit-button:hover{
    background: rgba(0, 230, 118, 0.2);
}
#commands-block button:hover {
    background: rgba(0, 230, 118, 0.15);
    border-color: var(--accent);
    color: var(--accent-bright);
}
/* Баннер обрыва соединения на игровом экране (нет сети / сервер недоступен). */
#ws-error-banner{
    display: none;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 8px 14px;
    margin: 6px auto 0;
    max-width: 90%;
    border: 1px solid rgba(255, 179, 0, 0.4);
    border-radius: var(--radius-sm);
    background: rgba(255, 179, 0, 0.1);
    color: #ffb300;
    font-size: 14px;
    position: relative;
    z-index: 20;
}
#ws-error-banner button{
    padding: 4px 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    cursor: pointer;
}
#commands-block{
    /* margin-top: 35px; */
    height: 60px;
    /* Небольшой воздух между кнопками и нижним краем стола. */
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.bubble{
    position: absolute;
    border: 1px solid var(--border-subtle);
    background-color: rgba(30, 30, 30, 0.88);
    color: var(--text);
    width: 110px;
    margin-top: 170px;
    height: 50px;
    border-radius: 15px 15px 15px 15px;
    padding-top: 3px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 90;
}
.bubble button{
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
}

.bubble p{
    font-family: sans-serif;
    font-size: 14px;
}
/* --- меню действий над козырной картой (проездной) --- */
#card-action-menu{
    position: fixed;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    display: none;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 14px;
    background: rgba(20, 20, 30, 0.92);
    border-radius: 12px;
    max-width: 420px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}
#card-action-menu .card-action-title{
    color: #ffd54f;
    font-size: 14px;
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    white-space: nowrap;
}
#card-action-menu button{
    border: none;
    border-radius: 16px;
    padding: 8px 16px;
    font-size: 14px;
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    cursor: pointer;
    background: var(--btn-green-sm);
    color: #ffffff;
    font-weight: 600;
    white-space: nowrap;
}
#card-action-menu button:hover{
    background: var(--btn-green-sm-active);
}
#card-action-menu button:active{
    filter: brightness(0.95);
}