/* Стили для игрового окна */
.game-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.game-card-container {
    background: white;
    width: 100%;
    
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    text-align: center;
}

.game-card-body {
    padding-top: 15px;
    padding-left: 15px;
    padding-right: 15px;
    padding-bottom: 15px;
}
.game-progress {
    height: 5px;
    background: #eee;
}
.game-progress-bar {
    height: 100%;
    background: #ff4757;
    transition: width 0.3s;
}
/* Разрываем слишком длинные слова или коды, чтобы не ломать ширину */
.message-text {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-all; /* Это самое важное свойство */
    max-width: 100%;
}

/* Центрируем и ограничиваем карточку игры */
.game-invite-card {
    display: inline-block;
    width: 100%;
    max-width: 240px;
}
/* Адаптивные кнопки свайпа для игры */
.game-swipe-btn {
    width: 60px !important;
    height: 60px !important;
    font-size: 24px !important;
}
/* По умолчанию (для мобильных телефонов) */


.game-card-text {
    font-size: 18px; 
    font-weight: 300;  
    min-height: 60px;
    
}
.modal_game_wr{
    width: 95%;
    text-align: center;
  /*  height: 90vh;*/
    max-width: 1000px;
    overflow-y: scroll;
}
.game_item_card {
    height: 50vh;
    /*min-height: 350px;*/
    background-color: #f8f9fa; 
     overflow: hidden;
   
}
.game_item_card_square {
   /* height: 80vh;*/
    /*min-height: 350px;*/
 
     overflow: hidden;
     width: 65vw;
}
.game_style_card{
    cursor:pointer; 
    transition: transform 0.2s; 
    height: 35vh; 
    min-height: 450px;
     background-color: #f8f9fa;
     border-radius: 1rem;
}

 .game_style_txt {
        font-weight: 300;
        font-size: 24px;
    }
.game_style_progr {
    height: 12px; 
    border-radius: 10px; 
    background-color: #f0f0f0;
}
.game-card-hover {
     transition: transform 0.2s ease, box-shadow 0.2s ease; 
     border: 2px solid transparent !important; }
.game-card-hover:hover { 
    transform: translateY(-4px); 
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.15) !important; 
    border-color: #e83e8c !important; }
.flag_wr{
    height: 50vh;
}

.flag_btn{
    flex-direction: row;
}
.decline_border{
    border-radius: 50rem;
    border: #198754 1px solid;
}
.game_content_wr{
    display: flex;
    justify-content: space-around;
}

.block_center{
    margin: auto 0;
    width: 40vw;
}
.game_survival_wr{
    display: flex;
   
    justify-content: space-around;
}
.survival_block_center{
    margin: 1rem;
    width: 35vw;
}
.flag_img {
    height: 100%;
}

.message-card {
    min-width: 225px;
}
button[id^="game-btn-"],
button[id^="decline-btn-"],
div[id^="game-actions-"],
.declined_span 
{
    width: 180px;
    margin-top: 10px;
}
.declined_span {
    
    border-radius: 50rem;
    padding: 0.5rem;
    font-size: 0.875rem;
}

.chat_input_wr {
    display: flex;
    flex-direction: row;
    width: 100%;
    min-width: 250px;
}
.chat_buttons{
    display: flex;
}
.chat_buttons_wr{
    flex-direction: row;
}
#game-overlay{
    overflow-y: scroll;
}
.audio_line {
    height: 40px !important; 
    max-width: 220px; 
    outline: none;
    width: 200px !important;
}
audio::-webkit-media-controls-panel {
    padding: 1px 1px !important; /* Меняем внутренние отступы (верх/низ 2px, лево/право 10px) */
  
}

/* =========================================
   ИГРА: ШАШКИ (CHECKERS)
   ========================================= */

/* Сама доска */
.checkers-board {
    display: grid;
    grid-template-columns: repeat(8, 1fr); /* 8 колонок */
    width: 100%;
    max-width: 360px; /* Оптимальный размер для телефонов */
    margin: 0 auto;
    border: 6px solid #4a3018; /* Красивая деревянная рамка */
    border-radius: 8px;
    background-color: #f0d9b5; /* Цвет светлых клеток */
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    overflow: hidden;
}

/* Клетка доски */
.checkers-cell {
    width: 100%;
    aspect-ratio: 1 / 1; /* Клетка всегда будет идеально квадратной */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Темные клетки */
.checkers-cell.dark {
    background-color: #b58863;
}

/* Сама шашка */
.checker-piece {
    width: 80%;
    height: 80%;
    border-radius: 50%;
    box-shadow: 0 4px 4px rgba(0,0,0,0.4), inset 0 -4px 6px rgba(0,0,0,0.3); /* Эффект объема */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Эффект при наведении (когда можно сходить) */
.checker-piece:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 8px rgba(0,0,0,0.5), inset 0 -4px 6px rgba(0,0,0,0.3);
}

/* Цвета шашек */
.checker-piece.white {
    background-color: #f8f9fa;
    border: 2px solid #ddd;
}

.checker-piece.black {
    background-color: #212529;
    border: 2px solid #111;
}

/* Дамка (King) */
.checker-piece.king::after {
    content: '♔'; /* Корона для дамки */
    color: #daa520; /* Золотой цвет */
    font-size: 1.5rem;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

/* Подсветка выбранной шашки */
.checker-piece.selected {
    box-shadow: 0 0 0 3px #ffc107, 0 6px 12px rgba(0,0,0,0.5); /* Желтая аура */
    transform: scale(1.1);
}

/* Подсветка возможных ходов */
.checkers-cell.highlight::after {
    content: '';
    width: 30%;
    height: 30%;
    background-color: rgba(40, 167, 69, 0.7); /* Зеленая точка */
    border-radius: 50%;
    position: absolute;
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.9);
}
.blackjack_wr {
    width: 100%; 
    max-width: 450px; 
    background: #2E8B57; 
    border: 4px solid #1e5c3a;
}
.blackjack_h3 {
    font-size: 1.1rem; 
    color: #ffeb3b; 
    min-height: 40px;
}
.durak_card {
    width: 55px; 
    height: 80px; 
    border: 1px solid #ccc; 
    margin: 0 3px; 
     font-weight: bold; 
     font-size: 1.1rem; 
     user-select: none;
}
.durak_card_deck{
    top: 0; 
    left: 35px; 
    width: 55px; 
    height: 80px; 
    background: repeating-linear-gradient(45deg, #007bff, #007bff 5px, #0056b3 5px, #0056b3 10px); 
    border: 1px solid #fff; 
    border-radius: 4px; 
    z-index: 2;
}
.durak_h3{
    font-size: 1.1rem; 
    color: #ffeb3b; 
    min-height: 25px;
}
.durak_block_wr{
    width: 100%; 
    max-width: 600px; 
    height: 95vh; 
    background: #2E8B57; 
    border: 4px solid #1e5c3a;
    overflow-y: scroll;
}
.durak_card_on_table{
    top: 15px; 
    left: 15px; 
    z-index: 2;
}
.durak_table{
    background: rgba(0,0,0,0.2);
    min-height: 200px;
    height: 35vh;
}
.durak_cards_row{
    width: 70px; 
    height: 85px;
}
.durak_bottom_wr{
    display: flex;
    flex-direction: column;
    
    margin: 0;
}
.durak_bottom_btn{
    
    margin-top: auto;
   
   
}
.durak_card_partner{
    width: 55px; 
    height: 80px; 
    border: 1px solid #0056b3; 
    margin: 0 -10px; 
    background: repeating-linear-gradient(45deg, #007bff, #007bff 5px, #0056b3 5px, #0056b3 10px);
}
.durak_win_txt{
    font-size: 1rem !important;

}
.battele_wr{
    width: 100%; 
    max-width: 450px; 
    max-height: 95vh; 
    overflow-y: auto;
}
  /* Анимация трясущейся трубки для большой зеленой кнопки */
    @keyframes ring-shake { 
        0% {transform:rotate(0)} 
        15% {transform:rotate(20deg)} 
        30% {transform:rotate(-15deg)} 
        45% {transform:rotate(10deg)} 
        60% {transform:rotate(-5deg)} 
        100% {transform:rotate(0)} }
    #btn-screen-decline:hover, 
    #btn-screen-accept:hover { 
        transform: scale(1.1); }


/* Для планшетов и ПК (от 992px) */
@media(min-width: 992px) {
    
    .game-card-text {
        font-size: 18px; 
        font-weight: 300;  
        min-height: 60px;
    }
}
@media(max-width:1500px) {
    .durak_card, .durak_card_deck,
    .durak_card_partner{
    width: 50px;
    height: 70px;
    

    }
    .durak_card, .durak_card_deck{
        margin: 0 2px;
    }
}
@media(max-width:900px){
    .game-card-img {
        
        max-height: 55vh;
        object-fit: cover;
    }
    .game_style_card {
    min-height: 426px;;
  max-width: 426px;
    }
   
   
 
}
@media(max-width: 769px) {
    .game-swipe-btn {
    width: 45px !important;
    height: 45px !important;
    font-size: 20px !important;
    }
    .game_item_card {
   /* height: 30vh;*/
    min-height: 350px;
    }
    .game_style_wr {
        display: flex;
        justify-content: center;
    }
    .game_style_txt {
        font-size: 20px;
    }
   .flag_wr {
        min-height: 270px !important;
        height: 40vh;
    } 
    .flag_img {
        max-height: 34vh;
    }
    .flag_btn{
    flex-direction:column;
    }
    .game_content_wr {
        justify-content: center;
        flex-wrap: wrap;
    }
    .game_item_card_square {
    height: auto;
    width: 70vw;
    }
    .block_center  {
     width: 90vw;
    }
    .modal_game_wr{
        height: 90vh;
    }
    .survival_block_center {
    
    width: 75vw;
}
   
}
@media(max-width: 600px) {
   .chat_buttons_wr{
    flex-direction: column;
    }
    .modal_game_wr {
        width: 100%;
    }
 .img_serv{
        max-width: 100% !important;
        max-height: 100% !important;
    }
        .game_item_card_square {
        width: 77vw;
    }
    .durak_card,
    .durak_card_deck,
    .durak_card_partner{
        width: 45px;
        height: 60px;

    }
    .durak_card_deck {
        left: 28px;
    }
    .durak_card{
        margin: 0 1px;
    }
    .durak_h3{
        font-weight: 400 !important;
        font-size: 16px;
    }
   
    
 
}

@media(max-width: 500px){
   
    .game-card-text {
    font-size: 16px;
    }
        .game-swipe-btn {
        width: 37px !important;
        height: 37px !important;
        font-size: 19px !important;
    }
    
    .game_style_card {
           min-height: 300px; 
        }
     .game_style_txt {
        font-size: 18px;
    }

        
}

@media(max-width:400px) {
    .game_style_card {
           min-height: 280px; 
        }
    .game_style_txt {
        font-size: 16px;
    }
    .game_style_progr{
        margin-bottom: 10px !important;
    }
    .game_style_pg {
        margin-top: 0;
    }
        .game-card-text {
        font-size: 15px;
    }
    .modal_game_wr{
       padding-top: 2rem !important;
        padding-left: 0.3rem !important;
        padding-right: 0.3rem !important;
    }
    .blackjack_wr{
        padding: 0.5rem !important;
    }
    .blackjack_h3 span {
    font-size: 17px !important;
    }
    .durak_card,
    .durak_card_deck,
    .durak_card_partner{
        width: 38px;
        height: 50px;

    }
    .durak_card_on_table{
      left: 6px; 
    }
    
     .durak_card_num{
        font-size: 0.8rem;
    }
    .durak_block_wr{
        padding: 0.3rem !important;
    }
    .durak_table{
        height: 35vh;
    }
    .durak_cards_row{
    width: 50px; 
    height: 70px;
    }
        .durak_card_deck {
        left: 20px;
    }
    .durak_bottom_btn {
    bottom: 30px;
    }
    .durak_win_txt{
    font-size: 0.8rem !important;
    
    }
    .battele_wr{
        padding: 0.5rem !important;
    }
    
}
@media(max-width: 390px) {
        .game_style_card {
        min-height: 260px;
    }
    button[id^="game-btn-"],
    button[id^="decline-btn-"],
    div[id^="game-actions-"],
    .declined_span 
{
    width: 160px;
    
}
}