/* ===== VERSION style.css ===== */
/* ===== ВСЕГДА СМОТРИ ВЕРСИЮ ФАЙЛА, НАЗВАНИЕ ФАЙЛА МОЖЕТ НЕ МЕНЯТЬСЯ, А ВЕРСИЯ РАЗНАЯ ===== */
/* ===== Dyrak - v250626-2051 ===== */


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

body {

    margin: 0;
    padding: 0;

    overflow: hidden;

    touch-action: none;

    overscroll-behavior: none;

    position: relative;

    width: 100%;
    min-height: 100vh;
    
    font-family: Arial, Helvetica, sans-serif;
    background: #0d4f2c;
    color: #ffffff;
}
#navBackground {

    position: fixed;

    left: 0;
    right: 0;
    bottom: 0;

    background: #163d25;

    pointer-events: none;

    z-index: -1;
}
#gameBottomBackground {

    position: fixed;

    left: 0;
    right: 0;
    bottom: 0;

    background: #ececec;

    pointer-events: none;

    display: none;
    
    z-index: -1;
}

html {

    overflow: hidden;

    touch-action: none;

    overscroll-behavior: none;

    width: 100%;
    min-height: 100vh;
}
#dragLayer {

    position: fixed;

    inset: 0;

    pointer-events: none;

    z-index: 99999;
}
#dealLayer {

    position: absolute;

    inset: 0;

    pointer-events: none;

    overflow: visible;

    z-index: 99998;
}

.hidden {
    display: none !important;
}

#app {

    width: 390px;

    margin: 0 auto;

    position: relative;

    transform-origin: top center;
}

/* ---------------------- */
/* ЛОББИ */
/* ---------------------- */

#lobby {

    display: flex;

    justify-content: center;

    align-items: center;

    height: 100%;

    padding: 0 20px;
}

.panel {
    width: 100%;
    max-width: 500px;
    background: #163d25;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,.3);
}

.panel h1 {
    text-align: center;
    margin-bottom: 25px;
}

.field {
    margin-bottom: 15px;
}

.field input,
.join-room input {
    width: 100%;
    height: 48px;
    border: none;
    border-radius: 10px;
    padding: 0 15px;
    font-size: 16px;
}

.buttons {
    margin-bottom: 15px;
}

button {
    cursor: pointer;
    border: none;
    border-radius: 10px;
    transition: .2s;
}

button:hover {
    transform: translateY(-1px);
}

#createRoomBtn,
#joinRoomBtn,
#readyBtn,
#attackBtn,
#defendBtn,
#throwBtn,
#takeBtn,
#beatBtn {
    background: #2b8cff;
    color: white;
    font-weight: bold;
}

#createRoomBtn {
    width: 100%;
    height: 50px;
}

.join-room {
    display: flex;
    gap: 10px;
}

.join-room input {
    flex: 1;
}

#joinRoomBtn {
    width: 140px;
}

/* ---------------------- */
/* КОМНАТА */
/* ---------------------- */

#roomScreen {
    padding: 20px;
}

.room-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    background: #163d25;
    padding: 15px;
    border-radius: 12px;
}

.players-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.player-row {
    background: #163d25;
    padding: 15px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
}

.player-ready {
    color: #65ff86;
}

.player-not-ready {
    color: #ff7676;
}

#readyBtn {
    margin-top: 20px;
    width: 100%;
    height: 50px;
}

/* ---------------------- */
/* ИГРА */
/* ---------------------- */

#gameScreen {
    min-height: 844px;
    display: flex;
    flex-direction: column;
}

#topBar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #163d25;
    padding: 12px 20px;
    font-size: 16px;
}

#currentPlayer {
    font-weight: bold;
    color: #ffe066;
}

#opponents {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 20px;
    flex-wrap: wrap;
}

.opponent {
    background: rgba(255,255,255,.08);
    border-radius: 12px;
    padding: 12px;
    min-width: 120px;
    text-align: center;
}

.opponent-name {
    font-size: 14px;
    margin-bottom: 8px;
}

.opponent-cards {
    font-size: 13px;
    opacity: .8;
}

#tableArea {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
}

#attackZone {
    min-height: 240px;
    width: 100%;
    max-width: 1000px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.table-pair {

    position: relative;

    width: 130px;

    height: 170px;

    border: 2px dashed transparent;

    border-radius: 16px;

    transition: .15s;
}

.attack-card {

    position: absolute;

    left: 20px;

    top: 0px;

    z-index: 1;

    transform:
        rotate(var(--angle));
}

.defense-card {

    position: absolute;

    left: 45px;

    top: -110px;

    z-index: 2;

    transform:
        rotate(var(--angle));
        
    box-shadow:
        0 8px 18px rgba(0,0,0,.35);
}

.table-pair.drag-over {

    border-color: #2b8cff;

    background: rgba(
        43,
        140,
        255,
        .12
    );
}

.card {
    width: 90px;
    height: 126px;
    border-radius: 10px;
    background: white;
    color: black;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    position: relative;
    cursor: pointer;
    user-select: none;
    transform-origin: bottom center;
    transition:
        transform .15s ease,
        box-shadow .15s ease;
    box-shadow: -1px 1px 6px rgb(0 0 0 / 62%);
}
.card-image {

    width: 100%;

    height: 100%;

    object-fit: contain;

    pointer-events: none;

    border-radius: 10px;
}

.card.red {
    color: #d10000;
}

.card.selected {
    transform: translateY(-15px);
    border: 3px solid #2b8cff;
}

.dragging-card {

    transform:
        scale(1.15)
        !important;

    box-shadow:
        0 18px 35px rgba(
            0,
            0,
            0,
            .45
        ) !important;

    transition:
        none !important;
}

.card-back {
    width: 85px;
    height: 120px;
    border-radius: 10px;
    background: linear-gradient(
        135deg,
        #14315c,
        #2b8cff
    );
}

#controls {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px;
}

#controls button {
    min-width: 120px;
    height: 46px;
    padding: 0 15px;
}

#playerHand {

    position: fixed;

    left: 50%;

    bottom: 75px;

    transform: translateX(-50%);

    width: 100%;

    height: 180px;

    overflow: visible;

    background: transparent;

    z-index: 4000;

    pointer-events: none;
}

#playerHand .card {

    position: absolute;

}

#playerHand .card:hover {
    transform: translateY(-12px);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #2b8cff;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 12px;
}

.attacker-badge {
    background: #ff9f1c;
}

.defender-badge {
    background: #e63946;
}

.turn-badge {
    background: #65ff86;
    color: black;
}

/* ---------------------- */
/* MOBILE */
/* ---------------------- */

@media (max-width: 768px) {

    #topBar {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .card-back {
        width: 65px;
        height: 95px;
    }

    #controls button {
        width: calc(50% - 10px);
    }

    #playerHand {
        justify-content: center;
    }

    .opponent {
        min-width: 95px;
    }
}
.rooms-title {
    margin-top: 20px;
    margin-bottom: 10px;
    font-weight: bold;
    font-size: 18px;
}

#roomsContainer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.room-card {
    background: #1c5631;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.room-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.room-code {
    font-size: 18px;
    font-weight: bold;
}

.room-players {
    opacity: .8;
    font-size: 14px;
}

.room-join-btn {
    background: #2b8cff;
    color: white;
    border: none;
    border-radius: 10px;
    height: 40px;
    padding: 0 20px;
    cursor: pointer;
}
* {

    user-select: none;

    -webkit-user-select: none;

    -moz-user-select: none;

    -ms-user-select: none;

    -webkit-tap-highlight-color: transparent;
}
html,
body {

    overscroll-behavior: none;
}
/* ---------------------- */
/* MAIN SCREEN */
/* ---------------------- */

#mainScreen {

    width: 100%;
    max-width: 600px;

    min-height: 844px;

    display: flex;
    flex-direction: column;
}

.tab-content {

    flex: 1;

    padding: 20px 20px 90px 20px;
}

.bottom-nav-wrapper {

    position: absolute;

    left: 0;
    right: 0;
    bottom: 0;

    height: 70px;

    background: #163d25;

    border-top: 1px solid rgba(
        255,
        255,
        255,
        .08
    );

    z-index: 9999;
}

.bottom-nav {

    width: 390px;

    height: 70px;

    margin: 0 auto;

    display: flex;
}

.bottom-nav button {

    flex: 1;

    display: flex;

    flex-direction: column;

    justify-content: center;

    align-items: center;

    gap: 4px;

    border: none;

    background: transparent;

    color: rgba(
        255,
        255,
        255,
        .75
    );

    font-size: 12px;

    font-weight: 600;

    transition: .2s;
}

.bottom-nav button.active {

    color: white;

    background: rgba(
        43,
        140,
        255,
        .18
    );
}

.bottom-nav-wrapper.hidden {

    display: none !important;
}

.bottom-nav button.active {

    color: white;

    background: rgba(
        43,
        140,
        255,
        .18
    );
}

.bottom-nav button.active::before {

    content: "";

    position: absolute;

    top: 0;

    width: 40px;

    height: 3px;

    background: #2b8cff;

    border-radius: 999px;
}


.profile-card {

    background: #1c5631;

    border-radius: 14px;

    padding: 20px;

    display: flex;

    flex-direction: column;

    gap: 10px;
}

.auth-link {

    margin-top: 15px;
}

.auth-link button {

    width: 100%;

    height: 46px;
}

#loginBtn,
#telegramLoginBtn,
#vkLoginBtn,
#registerBtn,
#logoutBtn {

    width: 100%;

    height: 50px;

    background: #2b8cff;

    color: white;

    font-weight: bold;
}

.coming-soon {

    opacity: .7;

    text-align: center;

    padding: 40px 0;
}
.nav-icon {

    width: 42px;

    height: 42px;

    display: block;

    margin-bottom: 2px;
}

.bottom-nav button {

    display: flex;

    flex-direction: column;

    justify-content: center;

    align-items: center;

    gap: 2px;
}

.bottom-nav button span {

    font-size: 11px;

    line-height: 1;
}
.create-room-block {

    padding: 20px;
}

.create-label {

    margin-top: 20px;

    margin-bottom: 10px;

    font-size: 18px;

    font-weight: 700;
}

.bet-value {

    font-size: 28px;

    font-weight: 700;

    margin-bottom: 15px;
}

#betSlider {

    width: 100%;
}

.mode-row {

    margin-top: 10px;
}

.create-room-submit {

    width: 100%;

    margin-top: 30px;

    height: 50px;

    font-size: 18px;
}

.pin-modal {

    position: fixed;

    inset: 0;

    background: rgba(
        0,
        0,
        0,
        .7
    );

    display: flex;

    justify-content: center;

    align-items: center;

    z-index: 99999;
}

.pin-window {

    width: 320px;

    background: #163d25;

    border-radius: 16px;

    padding: 20px;
}

.pin-title {

    text-align: center;

    font-size: 20px;

    font-weight: bold;

    margin-bottom: 20px;
}

.pin-display {

    height: 60px;

    background: #0f2d1b;

    border-radius: 12px;

    display: flex;

    justify-content: center;

    align-items: center;

    font-size: 30px;

    letter-spacing: 10px;

    margin-bottom: 20px;
}

.pin-grid {

    display: grid;

    grid-template-columns: repeat(
        3,
        1fr
    );

    gap: 10px;
}

.pin-grid button {

    height: 60px;

    font-size: 22px;

    font-weight: bold;
}

#pinCancelBtn {

    width: 100%;

    height: 50px;

    margin-top: 15px;
}
#joinPinCancelBtn {

    width: 100%;

    height: 50px;

    margin-top: 15px;
}

/* ===== WAITING ROOM ===== */

#waitingPlayers {

    position: absolute;

    inset: 0;

    pointer-events: none;
}

.player-slot {

    position: absolute;

    text-align: center;
}

.player-avatar {

    position: relative;

    width: 78px;

    height: 78px;

    border-radius: 18px;

    background: rgba(
        255,
        255,
        255,
        .25
    );

    display: flex;

    justify-content: center;

    align-items: center;

    font-size: 34px;

    color: white;

    overflow: hidden;
    
    z-index: 5;
}

.player-name {

    position: absolute;

    left: 0;

    right: 0;

    bottom: 0;

    height: 15px;

    background: rgba(
        0,
        0,
        0,
        .45
    );

    color: white;

    font-size: 6px;

    font-weight: 700;

    line-height: 13px;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;

    padding: 0 4px;

    text-align: center;
    
    z-index: 6;
}

.ready-mark {

    position: absolute;

    top: -10px;

    right: -10px;

    width: 32px;

    height: 32px;

    border-radius: 50%;

    background: #48d862;

    color: white;

    display: flex;

    justify-content: center;

    align-items: center;

    font-weight: bold;

    font-size: 20px;
}

.top-center {

    top: 80px;

    left: 50%;

    transform: translateX(-50%);
}

.left-top {

    top: 120px;

    left: 40px;
}

.right-top {

    top: 120px;

    right: 40px;
}



/* ===== BOTTOM PANEL ===== */

#gameBottomPanel {

    position: fixed;

    left: 0;

    right: 0;

    bottom: 0;

    width: 100%;

    height: 95px;

    background: #ececec;

    border-top-left-radius: 24px;

    border-top-right-radius: 24px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding: 12px 18px;

    z-index: 5000;
}

#bottomAction {

    width: 120px;
}

#bottomReadyBtn {

    width: 150px;

    height: 64px;

    border-radius: 18px;

    background: #f2f2f2;

    color: #ff5577;

    font-size: 26px;

    font-weight: 700;

    border: none;
}
#bottomTakeBtn {

    width: 150px;

    height: 64px;

    border-radius: 18px;

    background: #f2f2f2;

    color: #ff5577;

    font-size: 26px;

    font-weight: 700;

    border: none;
}
#bottomBeatBtn {

    width: 150px;

    height: 64px;

    border-radius: 18px;

    background: #f2f2f2;

    color: #ff5577;

    font-size: 26px;

    font-weight: 700;

    border: none;
}



#bottomProfile {

    display: flex;

    flex-direction: column;

    align-items: center;

    gap: 6px;
}

#bottomAvatarWrap {

    position: relative;

    width: 58px;

    height: 58px;
}

.player-avatar-wrap {

    position: relative;

    width: 78px;

    height: 78px;
}

.turn-timer {

    position: absolute;

    inset: -6px;

    border-radius: 24px;

    z-index: 1;

    pointer-events: none;

    animation:
        timerBlink .8s infinite;

    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);

    -webkit-mask-composite: xor;

    mask-composite: exclude;

    padding: 4px;
}

.player-avatar {

    position: relative;

    z-index: 2;
}

#bottomAvatar {

    position: relative;

    z-index: 2;
}

@keyframes timerBlink {

    0% {
        opacity: 1;
    }

    50% {
        opacity: .45;
    }

    100% {
        opacity: 1;
    }
}

#bottomAvatar {

    width: 58px;

    height: 58px;

    border-radius: 16px;

    background: #cfcfcf;

    display: flex;

    justify-content: center;

    align-items: center;

    font-size: 34px;
}

#bottomNickname {

    color: #333;

    font-size: 14px;

    font-weight: 600;
}

#bottomCurrency {

    display: flex;

    flex-direction: column;

    gap: 8px;

    color: #333;

    font-weight: 700;

    min-width: 90px;

    text-align: right;
}
.player-cards {

    margin-top: 6px;

    font-size: 18px;

    letter-spacing: -4px;

    color: white;
}
.player-cards {

    position: relative;
    
    left: 50%;
    
    transform: translateX(-45%);

    height: 55px;

    margin-top: -38px;

    z-index: -1;
}

.mini-back {

    position: absolute;

    bottom: 0;

    width: 28px;

    height: 40px;

    transform-origin:
        center top;

    object-fit: cover;

    border-radius: 3px;

    box-shadow:
        0 1px 3px rgba(
            0,
            0,
            0,
            .4
        );
}

/* ===== CREATE ROOM SEGMENTS ===== */

.segmented-control {

    display: flex;

    gap: 8px;

    margin-top: 10px;
}

.segment-btn {

    flex: 1;

    height: 52px;

    border-radius: 14px;

    background: #2b2b2b;

    color: rgba(
        255,
        255,
        255,
        .75
    );

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 16px;

    font-weight: 700;

    cursor: pointer;

    transition: .15s;
}

.segment-btn.active {

    background: white;

    color: #111;
}
#readyMessage {

    position: absolute;

    left: 50%;

    top: 50%;

    transform:
        translate(-50%, -50%);

    font-size: 32px;

    font-weight: 700;

    color: white;

    text-shadow:
        0 2px 8px rgba(
            0,
            0,
            0,
            .6
        );

    z-index: 6000;

    pointer-events: none;
}
#systemMessage {

    position: fixed;

    left: 50%;

    top: 50%;

    transform:
        translate(
            -50%,
            -50%
        );

    background:
        rgba(
            0,
            0,
            0,
            .85
        );

    color: white;

    padding:
        18px 26px;

    border-radius:
        14px;

    font-size:
        20px;

    font-weight:
        700;

    text-align:
        center;

    z-index:
        99999;

    pointer-events:
        none;

    max-width:
        80%;
}
#preloader {

    position: fixed;

    inset: 0;

    background: #111;

    z-index: 999999;

    display: flex;

    flex-direction: column;

    justify-content: center;

    align-items: center;
}

#preloaderTitle {

    font-size: 36px;

    font-weight: bold;

    color: white;
}

#preloaderText {

    margin-top: 20px;

    color: #bbb;

    font-size: 18px;
}

#preloader.hidden {

    display: none;
}

/* колода */

#deckArea {

    position: absolute;

    left: -70px;

    top: 320px;

    width: 80px;

    height: 120px;

    z-index: 3000;
}

#deckCountView {

    position: absolute;

    left: 50px;

    top: -26px;

    font-size: 13px;

    font-weight: 700;

    color: white;

    text-shadow:
        0 2px 4px rgba(0,0,0,.7);
}

.trump-card-view {

    position: absolute;

    left: 26px;

    top: 5px;

    width: 70px;

    height: 98px;

    transform: rotate(90deg);

    z-index: 1;

    border-radius: 8px;
}

.deck-stack {

    position: absolute;

    left: 0;

    top: 0;

    width: 70px;

    height: 98px;

    border-radius: 8px;

    z-index: 2;

    transform: rotate(8deg);
}