body {
    background: radial-gradient(
            ellipse at center,
            rgb(55, 110, 55) 0%,
            rgb(10, 50, 10) 100%
    );
    margin: 0;
    font-family: Roboto, Helvetica, Arial, sans-serif;
    height: 100vh;
    overflow: hidden;
    position:relative;
}
body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image: radial-gradient(rgba(55, 110, 55, 0.5) 10%, transparent 10%),
    radial-gradient(rgba(55, 110, 55, 0.5) 10%, transparent 10%);
    background-position: 0 0, 50px 50px;
    background-size: 100px 100px;
    opacity: var(--before-opacity, 1);
    transition: opacity 0.5s ease;
}

body.game-started::before {
    opacity: 0.2;
}

@font-face {
    font-family: 'Sedgwick Ave Display';
    src: url('/assets/fonts/SedgwickAveDisplay-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

#form { background: rgba(0, 0, 0, 0.15); padding: 0.25rem; position: fixed; bottom: 0; left: 0; right: 0; display: flex; height: 3rem; box-sizing: border-box; backdrop-filter: blur(10px); }
#nicknameForm { padding: 0.25rem; display: flex; height: 3rem; box-sizing: border-box; backdrop-filter: blur(10px); }
#tournamentForm, #bots { justify-content: space-between; border-bottom: 1px solid #191919; padding: 0.25rem; display: flex; height: 3rem; box-sizing: border-box; backdrop-filter: blur(10px); }
#input, #nicknameInput, #tournamentInput { border: none; padding: 0 1rem; flex-grow: 1; border-radius: 2rem; margin: 0.25rem; }
#input:focus, #nicknameInput:focus { outline: none; }
#tournamentInput { width:30px; }
#bots { display: flex;justify-content: space-between;align-items: center; }
#bots button, #bots span { min-height: 2rem; align-self: center; }
#bots span { align-items: center; display: flex; font-weight:700; }
#addBot {
    pointer-events: none;
    opacity: 0.5;
}

#addBot.active {
    pointer-events: auto;
    opacity: 1;
}
#tournamentStart button:hover {
    background-color:#007e08!important;
}
#tournamentStart button:hover i {
    transform: scale(1.2);
}

.transparent-button {
    background-color: transparent;
    border: none;
    padding: 0;
    outline: none;
    cursor: pointer;
}
.transparent-button i {
    font-size:2em;
}

.transparent-button:hover i {
    --fa-primary-color: #1c8000!important;
    --fa-secondary-color: #ffffff!important;
}

.minikortti-hr {
    display: block;
    width: 220px;
    height: 3px;
    background: linear-gradient(45deg, rgba(6, 44, 0, 0.8), rgba(10, 80, 10, 0.8), rgba(6, 44, 0, 0.8));
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(6, 44, 0, 0.4);
    margin: 5px 0;
}


#form > button, #tournamentStart button, #bots button { background: #333; border: none; padding: 0 1rem; margin: 0.25rem; border-radius: 3px; outline: none; color: #fff; cursor:pointer; }
#player1-score {
    position: fixed;
    bottom: 12%;
    right: 10px;
    width: 38px;
    height: 41px;
    background-image: url(/assets/img/beer.png);
    background-size: cover;
    background-position: center;
    font-weight: bold;
    padding: 20px 0 0 10px;
    text-align: center;
    z-index:10;
    transition: transform 0.5s, opacity 0.5s;
    cursor:help;
}



#player2-score {
    position: fixed;
    top: 8%;
    right: 10px;
    width: 38px;
    height: 41px;
    background-image: url(/assets/img/beer.png);
    background-size: cover;
    background-position: center;
    font-weight: bold;
    padding: 20px 0 0 10px;
    text-align: center;
    z-index:10;

}
#player3-score {
    position: fixed;
    top: 40%;
    right: 10px;
    width: 38px;
    height: 41px;
    background-image: url(/assets/img/beer.png);
    background-size: cover;
    background-position: center;
    font-weight: bold;
    padding: 20px 0 0 10px;
    z-index:10;
    transition: transform 0.5s, opacity 0.5s;
    cursor:help;
    text-align: center;
}
#player4-score {
    position: fixed;
    top: 40%;
    left: 10px;
    width: 38px;
    height: 41px;
    background-image: url(/assets/img/beer.png);
    background-size: cover;
    background-position: center;
    font-weight: bold;
    padding: 20px 0 0 10px;
    text-align: center;
    z-index:10;
    transition: transform 0.5s, opacity 0.5s;
    cursor:help;
}

#player1-score:hover {
    animation: beer-shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
}

#player2-score.pulse {
    animation: pulseAnimPlayer2 1s forwards;
}

#player1-score.pulse {
    animation: pulseAnimPlayer1 1s forwards;
}

@keyframes pulseAnimation {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0.7;
    }
}

.online-icon {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: radial-gradient(circle, #ff4747, #b30000);
    border-radius: 50%;
    animation: pulseAnimation 1.5s infinite;
    margin-right: 3px;
    vertical-align: middle;
}


#modalDiv {
    display: none; /* Piilotettu oletuksena */
    justify-content: center;
    align-items: center;
    flex-direction: row; /* Vierekkäin */
    flex-wrap: wrap; /* Mahdollistaa rivinvaihdon, jos elementit eivät mahdu vierekkäin */
    height: 100vh;
    width: 100vw;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 999;
}

.table-container {
    position: relative;
    width: 65vw;
    max-width: 520px;
    height: calc(65vw * 0.5675);
    max-height: 295.25px;
    background: url('/assets/img/table.png') no-repeat center;
    background-size: cover;
    cursor: pointer;
    transition: transform 0.3s ease;
    margin: -15px 20px 20px 20px;
}

.table-container.disabled {
    opacity: 0.8; /* Tai jokin muu arvo joka saa sen näyttämään "haalistuneelta" */
    pointer-events: none; /* Estää klikkauksen */
}

.table-container.disabled .player-count {
    background-color: rgba(200, 0, 0, 0.8); /* Säädä tarvittaessa punaisen sävyä */
}


.table-container:hover {
    transform: scale(1.4);
}

.info-container {
    position: absolute;
    bottom: 33%; /* Siirtää containerin pohjaa 50% korkeudelle */
    left: 50%; /* Siirtää containerin vasenta reunaa 50% leveydelle */
    transform: translate(-50%, 50%); /* Keskittää horisontaalisesti ja vertikaalisesti */
    display: flex; /* Jotta elementit asettuvat vierekkäin */
    border: 1px solid rgba(0, 0, 0, 0.3); /* Kehys */
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3); /* Varjostus */
    border-radius: 5px; /* Pyöristetty border */
    background-color: rgba(255, 255, 255, 0.7); /* Taustaväri */
    width:55%;
    justify-content: space-between;
}

.player-count {
    background-color: rgba(0, 50, 0, 0.8);
    padding: 5px 10px;
    border-radius: 5px 0 0 5px; /* Pyöristetty vasen reuna */
    color: #ffffff;
    font-size: 0.9em;
}

.player-info {
    padding: 5px 10px;
    border-radius: 0 5px 5px 0; /* Pyöristetty oikea reuna */
}

.player-names {
    position: absolute;
    bottom: calc(100% + 10px); /* Sijoittaa nimiä `.info-container`-elementin yläpuolelle */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    gap: 10px;
}

.game-type-box {
    background-color: rgba(255, 255, 255, 0.8);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9em;
    margin-left: 5px; /* lisättiin jotta se sijoittuu oikealle .player-info elementin jälkeen */
    display: flex;    /* lisättiin jotta ikonit ja teksti asettuvat vierekkäin */
    align-items: center; /* keskittää sisällön pystysuunnassa */
}

.player-box {
    background-color: rgba(0, 0, 0, 0.7);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 5px;
    color: #FFF; /* Vaalea tekstiväri */
}

.played-cards {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: grid;
    grid-template-columns: repeat(6, minmax(50px, 1fr));
    gap: 5px;
    max-width: calc(100% - 40px);
    overflow: hidden;
}

.card-info {
    position: relative;
    width: 100%;
    max-width: 50px;
}

.player-name-on-card {
    position: absolute;
    bottom: 2px;
    left: 0;
    right: 0;
    padding: 1px 2px;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    text-align: center;
    font-size: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-info img {
    width: 100%;
    height: auto;
}

.score-badge {
    display: inline-block;
    padding: 1px 3px;
    background-color: gold;
    color: #333;
    border-radius: 3px;
    font-size: 12px;
    margin-left: 3px;
    vertical-align: middle;
}

@keyframes playerScoreUpdate {
    0% {
        transform: scale(1);
        background-color: #FF0000;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        background-color: #333;
    }
}

.player-box.score-updated {
    animation: playerScoreUpdate 0.5s;
}

.active-turn {
    background-color: rgba(0, 77, 0, 0.8);
}


.fade-out-card {
    animation: fadeOutEffect 1s forwards;
    position: absolute;
    left: 0;
}

@keyframes fadeOutEffect {
    from { opacity: 1; }
    to   { opacity: 0; }
}


.new-game-table {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    width: 28vw;
    max-width: 210px;
    height: calc(28vw * 0.5675);
    max-height: 119px;
    background: url('/assets/img/table.png') no-repeat center;
    background-size: cover;
    cursor: pointer;
    transition: transform 0.3s ease;
    z-index: 1000;
}

.new-game-table:hover {
    transform: translateX(-50%) scale(1.1);
}


.new-game-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color:#fff;
    background-color: rgba(0, 50, 0, 0.8);
    padding: 5px 10px;
    border: 1px solid rgba(0, 0, 0, 0.3); /* Kehys */
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3); /* Varjostus */
    border-radius: 5px; /* Pyöristetty border */
}



#messages {
    list-style-type: none;
    padding: 0;
    margin: 0;
    position: absolute;
    bottom: 50px;
    width: 100%;
}
#messages > li { padding: 0.5rem 1rem; color:#fff; }
#opponentCursor {
    width: 24px;
    height: 24px;
    background-image: url('/assets/img/grabi.png');
    background-size: cover;
    opacity: 0.3;
    position: absolute;
    pointer-events: none;
}
#opponentCursor.hidden {
    display: none;
}
#chatContainer {
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
    width: 100%;
}

#cards {
    position: fixed;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    justify-content: center;
}

#cardsPlayed {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index:2;
    text-align:center;
    width:100%;
}

#cards, #cardsOpponent {
    display: flex;
    gap: 5px;
}

.card:not(:last-child) {
    margin-right: -10px;
}

#cardsOpponent {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
}

.opponent.top {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.opponent.right {
    position: absolute;
    top: 85%;
    right: 0;
    transform: translateY(-50%) rotate(90deg);
    transform-origin: top right;
}

.opponent.left {
    position: absolute;
    top: 85%;
    left: 0;
    transform: translateY(-50%) rotate(-90deg);
    transform-origin: top left;
}

.opponent.top .card-back,
.opponent.right .card-back,
.opponent.left .card-back {
    margin: 5px;
}

#cardsOpponentPlayed {
    position: fixed;
    top: 35%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index:2;
    display: flex;
    justify-content: center;
    width:100%;
}

#cardsOpponentPlayed .card {
    float: left;
    margin-right: 5px; /* lisätään hieman väliä korttien väliin */
}

#cardsOpponent .card-back.opponent-hover {
    transform: translateY(10px);
    transition: transform 0.2s ease;
}

#cards, .opponent-cards {
    display: flex;
    gap: 5px;
}

.card {
    width: 94px;
    height: 140px;
    background-color: transparent;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 5px;
    text-align: center;
    font-size: 38px;
    display: inline-block;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
    line-height: 90px;
    opacity: 0.7;
    transition: transform 0.2s ease, opacity 0.3s;
    transform: translateX(0); /* Oletussijainti */
    z-index: 1;
}



#cards .card, #cardsOpponent .card {
    margin: 0 2px;
}

.card.dragging {
    z-index: 10;
}

.card:not(:last-child) {
    margin-right: -5px;
}

.card-back {
    width: 94px;
    height: 140px;
    background-color: #1b1b1b; /* tumma tausta */
    border-radius: 5px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
    display: inline-block;
    background-image: linear-gradient(45deg, #333 25%, transparent 25%, transparent 50%, #333 50%, #333 75%, transparent 75%, transparent);
    background-size: 10px 10px;
    border: 1px solid #333;
}

.card-container {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s;
    text-align:center;
}

.card-xl:hover .card-container {
    transform: rotateY(180deg);
}

.card-xl {
    perspective: 1000px;
    width: 195px;
    height: 300px;
    text-align: center;
    font-size: 114px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    line-height: 300px;
    opacity: 1;
    transition: transform 0.2s ease, opacity 0.3s;
    transform: translateX(0);
    position: relative;
    margin: 0 10px;
    cursor:pointer;
}

#gameIcons {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding-top:30px;
    position:relative;
    z-index:1000;
}

.gameIcon {
    background: linear-gradient(#037c57, #04d495);
    border-radius: 50%;
    width: 156px;
    height: 156px;
    position: absolute;
    top: calc(1/3 * 270px - 78px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 30px;
}

.gameImage {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    user-select: none;
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: white;
    border-radius: 16px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    backface-visibility: hidden;
    transition: transform 0.5s;
    text-align:center;
}

.front {
    z-index: 3;
}

.back {
    transform: rotateY(180deg);
    background-color: white;
    border-radius: 16px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    z-index:2;
}

h2 {
    font-size:24px;
    text-transform: uppercase;
    color:#26282b;
    line-height:1.2;
    user-select: none;
}

h3 {
    font-size: 20px;
    text-align: center;
    margin-top: 220px;
    margin-bottom: 10px;
    font-weight:700;
    text-transform: uppercase;
    color:#26282b;
    line-height:1.2;
    user-select: none;
}
h4 {
    font-size:34px;
    line-height:1.2;
    color:#000000;
    padding:0;
    margin:0;
    user-select: none;
}

.back h2 {
    margin-top:40px;
    border-bottom:3px solid #006700;
    text-align:center;
    padding-bottom:10px;
}
.back h3 {
    margin-top:5px;
    font-size:14px;
    line-height:1.5;
    padding:0 10px;
}

.card-xl:first-child {
    transform: rotate(-4deg) translateX(10px);
}

.card-xl:last-child {
    transform: rotate(4deg) translateX(-10px);
}

.card-xl:first-child:hover {
    z-index: 10;
    transform: rotate(-4deg) translateX(10px) translateY(-40px);
}

.card-xl:last-child:hover {
    transform: rotate(4deg) translateX(-10px) translateY(-40px);
}

.card.active {
    opacity:1;
}
.coming {
    line-height:1.2;
    margin:0;
    padding:0;
    font-size:12px;
}

.card.active:hover {
    transform: translateY(-10px);
    cursor:pointer;
    opacity: 1;
}

.card.selected-for-trade {
    transform: translateY(-20px); /* sama kuin hover-efektissä, mutta nyt pysyvä kortin ollessa valittu */
    opacity: 1; /* tekee valitusta kortista vähemmän läpinäkyvän */
    z-index: 2; /* nostaa valitun kortin muiden yläpuolelle, jos kortit ovat päällekkäin */
}

.card.played {
    opacity: 1;
}

.card.played:hover {
    transform: none;
    cursor: default;
}

.card[class*="♠"] {
    color: #000;

}

.card[class*="♣"] {
    color: #000;
}

.card[class*="♦"] {
    color: #ff0000;
}

.card[class*="♥"] {
    color: #ff0000;

}

#tradeButton {
    position: fixed; /* Kiinteä sijainti */
    bottom: 35%; /* Sijainti näytön alareunasta */
    left: 50%; /* Keskitetty sijainti */
    transform: translateX(-50%); /* Tarkka keskitys */
    background-color: green; /* Nappulan väri */
    color: white; /* Tekstin väri */
    padding: 10px 20px; /* Sisäinen tyhjä tila */
    border: none; /* Ei reunaa */
    border-radius: 5px; /* Pyöristetyt kulmat */
    font-size: larger; /* Suurempi fonttikoko */
    cursor: pointer; /* Kursorin tyyli */
}

#tradeButton:hover {
    background-color: darkgreen; /* Väri kun hiiri on päällä */
}

#tradeButton:disabled {
    background-color: grey; /* Väri kun nappi ei ole käytettävissä */
    cursor: not-allowed; /* Kursorin tyyli kun nappi ei ole käytettävissä */
}

/*#joinGame {
    display: none;
    background-color: #073107;
    color: #fff;
    padding: 20px 40px;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease;

    position: fixed;
    top: 80%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#joinGame:hover {
    background-color: #25a125;
}

#joinGame span {
    display: inline-block;
    animation: bounce 0.5s ease infinite;
}*/



#onlineIndicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: #4CAF50;
    border-radius: 50%;
    margin-right: 5px;
    animation: pulse 1s infinite;
}

#onlineUsers {
    position: fixed;
    top: 10px;
    right: 57px;
    background: rgba(255, 255, 255, 0.8);
    padding: 2px 5px;
    border-radius: 5px;
    font-size:12px;
    z-index:10;
}

#settings {
    position: fixed;
    top: 10px;
    right: 30px;
    background: rgba(255, 255, 255, 0.8);
    padding: 2px 5px;
    border-radius: 5px;
    font-size:12px;
    z-index:10;
    cursor:pointer;
}

#leave {
    position: fixed;
    top: 10px;
    right: 5px;
    padding: 2px 7px;
    border-radius: 5px;
    font-size:14px;
    cursor:pointer;
    color:#fff;
    z-index:1001;
}

#room {
    position: fixed;
    top: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.8);
    padding: 2px 5px;
    border-radius: 5px;
    font-size:12px;
    z-index:10;
    display:none;
}

.countdown-timer {
    font-family: 'Sedgwick Ave Display', sans-serif;
    color: rgba(132, 206, 143, 0.3);
    text-shadow: 2px 2px 4px rgba(24, 68, 24, 0.25), -2px -2px 4px rgba(24, 68, 24, 0.25);
    font-size: 3em; /* tai suurempi, riippuen tarpeestasi */

    /* Asettelu keskelle ja yläpuolelle. */
    position: absolute;
    top: 40%; /* tai mikä tahansa prosenttiosuus/px-arvo, joka nostaa sen halutulle korkeudelle */
    left: 50%;
    transform: translateX(-50%);

    /* Varmistetaan, että se on muiden elementtien yläpuolella. */
    z-index: 100; /* Arvo riippuen muiden elementtien z-indekseistä, pitäisi olla suurempi kuin muut */
}


#tournamentStart {
    position: fixed;
    top: 40px;
    right: 10px;
    background: rgba(255, 255, 255, 0.8);
    padding: 2px 5px;
    border-radius: 5px;
    font-size:12px;
    z-index:10;
}


@keyframes tipsy {
    0% {
        transform: translateX(-50%) translateY(-50%) rotate(0deg);
    }
    100% {
        transform: translateX(-50%) translateY(-50%) rotate(360deg);
    }
}

#waitingMessageMid {
    position:relative;
    top:55%;
}

#waitingMessageMid a {
    color: #fffbf1;
    text-shadow: 0 20px 25px #2e2e31, 0 40px 60px #2e2e31;
    font-size: 50px;
    font-weight: bold;
    text-decoration: none;
    letter-spacing: -3px;
    margin: 0;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translateX(-50%) translateY(-50%);
    pointer-events: none;
}

#waitingMessageMid a:before,
#waitingMessageMid a:after {
    pointer-events: all;
    content: '';
    padding: .9em .4em;
    position: absolute;
    left: 50%;
    width: 100%;
    top: 50%;
    display: block;
    border: 15px solid #004D00;
    transform: translateX(-50%) translateY(-50%) rotate(0deg);
    transform-origin: 50% 50%;
    animation: 10s infinite alternate ease-in-out tipsy;
}
#waitingMessageMid a:before {
    border-color: #004D00 #004D00 rgba(0, 0, 0, 0) rgba(0, 0, 0, 0);
    z-index: -1;
}
#waitingMessageMid a:after {
    border-color: rgba(0, 0, 0, 0) rgba(0, 0, 0, 0) #004D00 #004D00;
    box-shadow: 25px 25px 25px rgba(46, 46, 49, .8);
}

.turnaus-bg{
    background-color:#b38621!important;
}


.moving-card-from-bottom {
    z-index: 2;
    animation: moveCardFromBottom 0.5s forwards;
    margin-top:10vh;
    position:absolute;
}

.moving-card-from-top {
    position: absolute;
    margin-left: -30px;
    z-index: 1;
    animation: moveCardFromTop 1s forwards;
}

.shake-card {
    animation: shake 0.6s both;
}


.dealing-to-player,
.dealing-to-opponent {
    animation-duration: 0.5s;
    animation-fill-mode: forwards;
}

.dealing-to-player {
    animation: dealingToPlayerAnimation 0.5s forwards;
}

.dealing-to-opponent {
    animation-name: moveFromCenterToOpponent;
}

.dealing-to-player,
.dealing-to-opponent {
    animation-duration: 0.5s;
    animation-fill-mode: forwards;
}

.nick {
    background-color: #053f05;
    padding: 5px 8px;
    border-radius: 4px;
}

.bot-style {
    background-color: #3b3d6c7d!important;
    padding: 5px 8px;
    border-radius: 4px;
}


.minikortti:hover {
    transform: scale(3);
}

.minikortti {
    display:inline-block;
    padding: 4px 3px;
    font-size:20px;
    background-color: white;
    border-radius: 3px;
    text-align: center;
    width:35px;
    transition: transform 0.3s ease;
    transform-origin: left center;
    cursor:none;
}
.beer-hover {
    animation: beer-shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
}
.text-red {
    color: #ff0000!important;
}

.text-black {
    color: #000!important;
}

.fade-out {
    animation: fadeOut 4s forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}


.nick-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: top 0.3s ease, opacity 0.3s ease;
    z-index:10;
    opacity: 0;
    animation: fadeIn 0.5s forwards 0.3s;
}

.nick-wrapper-mid {
    top: 60%;
    opacity: 0.5;
}

.center-wrapper {
    position: absolute;
    top: 25%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: top 0.3s ease, opacity 0.3s ease;

}

.center-wrapper-mid {
    top: 45%;
    opacity: 0.5;
}

.center-wrapper-mid .pomps span {
    animation: fadeInUp 0.7s forwards, pompsSoft 2s 0.7s infinite;
    animation-delay: calc(.1s * var(--i));
}


.pomps {
    position: relative;
    -webkit-box-reflect: below -20px linear-gradient(transparent, rgba(0,0,0,0.2));
}

.pomps span {
    font-size: 6rem;
    font-weight:500;
    font-family: 'Sedgwick Ave Display', sans-serif;
    position: relative;
    display: inline-block;
    color: rgba(55, 110, 55, 1);
    text-shadow: 2px 2px 4px rgba(24, 68, 24, 0.25), -2px -2px 4px rgba(24, 68, 24, 0.25);
    animation: fadeInUp 0.7s forwards, pomps 1s 0.7s infinite;
    animation-delay: calc(.1s * var(--i));
    transition: opacity 0.3s ease, top 0.3s ease;
    transform: translate(-50%, -50%);
    opacity:0;
}

.pomps span.io {
    color: rgba(255, 255, 255, 0.2);
    font-family: Roboto, Helvetica, Arial, sans-serif;
    font-size:3rem;
    text-transform: lowercase;
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(-10px);
        color: rgba(55, 110, 55, 1);  /* Alkuperäinen väri */
    }
    50% {
        opacity: 0.9;
        color: rgb(144, 196, 144);  /* Vaalea välihetken väri */
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        color: rgba(55, 110, 55, 1);  /* Alkuperäinen väri palautetaan */
    }
}

@keyframes pomps {
    0%, 40%, 100% {
        transform: translateY(0);
    }
    20% {
        transform: translateY(-20px);
    }
}

@keyframes pompsSoft {
    0%, 40%, 100% {
        transform: translateY(0);
    }
    20% {
        transform: translateY(-10px); /* Pomppu on pienempi */
    }
}

.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    display: none;
}

.confetti-container.active {
    display: block;
}

.confetti {
    position: absolute;
    top: -10px;
    width: 10px;
    height: 10px;
    opacity: 0.7;
    animation: fall 3s linear both, fadeOut2 3s linear both;
}

.confetti-beer {
    position: absolute;
    top: -100px;
    width: 30px;
    height: 30px;
    background-image: url('/assets/img/beer.png');
    background-size: cover;
    animation: beerFall 3s linear both, spin 2s infinite linear both, fadeOut2 3s linear both;
}

.confetti:nth-child(odd) {
    background-color: #FF5733;
}

.confetti:nth-child(even) {
    background-color: #33FF57;
    animation-delay: 0.5s;
}

.confetti:nth-child(3n) {
    background-color: #3357FF;
    animation-delay: 1s;
}

.confetti:nth-child(4n) {
    background-color: #FFFF33;
    animation-delay: 1.5s;
}

.confetti:nth-child(5n) {
    background-color: #FF33FF;
    animation-delay: 2s;
}

.countdown {
    position: fixed;
    top: 35%;
    left: 50%;
    width: 500px;
    height: 400px;
    transform-style: preserve-3d;
    perspective: 1000px;
    transform: translate(-50%, -50%);
}

.countdown:before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 10px;
    background: #000;
    border-radius: 50%;
    filter: blur(14px);
    animation: shadow 1s linear infinite;
}

.countdown .number {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: rotateY(270deg);
    animation: animate 10s linear infinite;
}

.countdown .number:nth-child(1) {
    animation-delay: 0s;
}

.countdown .number:nth-child(2) {
    animation-delay: 1s;
}

.countdown .number:nth-child(3) {
    animation-delay: 2s;
}

.countdown .number.game-start {
    animation: none;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: none;
}

.countdown .number.game-start h2 {
    font-size: 0.8em;
    animation: zoomInText 1s forwards 3s;
    opacity: 0;
}

.countdown .number h2 {
    margin: 0;
    padding: 0;
    font-size: 15em;
    color: #fff;
}

@keyframes zoomInText {
    0% {
        font-size: 1em;
        opacity: 0;
    }
    100% {
        font-size: 5em;
        opacity: 1;
    }
}

@keyframes animate {
    0% {
        transform: rotateY(90deg);
    }

    10%, 100% {
        transform: rotateY(-90deg);
    }
}

@keyframes shadow {
    0%, 100% {
        transform: scale(0.5);
    }
    50% {
        transform: scale(1);
    }
}


@keyframes dealingToPlayerAnimation {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pulseAnimPlayer1 {
    50% {
        top: 50%;
        right: calc(50% - 19px);
        transform: scale(10);
        opacity: 1;
    }
    100% {
        top: 8%;
        right: 10px;
        transform: scale(1);
        opacity: 0;
    }
}

@keyframes pulseAnimPlayer2 {
    50% {
        bottom: 50%;
        right: calc(50% - 19px);
        transform: scale(10);
        opacity: 1;
    }
    100% {
        bottom: 12%;
        right: 10px;
        transform: scale(1);
        opacity: 0;
    }
}

@keyframes beer-shake {
    10%, 90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%, 80% {
        transform: translate3d(2px, 0, 0);
    }

    30%, 50%, 70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%, 60% {
        transform: translate3d(4px, 0, 0);
    }
}


@keyframes moveCardFromBottom {
    from {
        transform: translateY(45%);
    }
    to {
        transform: translateY(0);
    }
}
@keyframes moveCardFromTop {
    from {
        top: 0;
        left: 50%;
    }
    to {
        top: 45%;
        left: 50%;
    }
}
@keyframes shake {
    10%, 90% {
        transform: translate3d(-1px, 0, 0);
    }
    20%, 80% {
        transform: translate3d(2px, 0, 0);
    }
    30%, 50%, 70% {
        transform: translate3d(-3px, 0, 0);
    }
    40%, 60% {
        transform: translate3d(3px, 0, 0);
    }
}
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-2px);
    }
    60% {
        transform: translateY(-1px);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}
@keyframes beerFall {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(110vh);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes spinReverse {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(-360deg);
    }
}


@keyframes fall {
    0% {
        transform: translateY(0) translateX(0);
    }
    100% {
        transform: translateY(110vh) translateX(50vw);
    }
}

@keyframes fallReverse {
    0% {
        transform: translateY(0) translateX(0);
    }
    100% {
        transform: translateY(110vh) translateX(-50vw);
    }
}
@keyframes fadeOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

@keyframes fadeOut2 {
    0% {
        opacity: 0.7;
    }
    100% {
        opacity: 0;
    }
}

@keyframes moveFromCenterToPlayer {
    from { transform: translate(0, 0); }
    to { transform: translate(calc(100% - 20px), calc(100% - 20px)); }
}

@keyframes moveFromCenterToOpponent {
    from { transform: translate(0, 0); }
    to { transform: translate(calc(100% - 20px), -20px); }
}

@media (max-width: 768px) {
    .table-container {
        width: 60vw; /* 80% näytön leveydestä */
        height: calc(60vw * 0.5675); /* Säilytetään alkuperäinen kuvasuhde */
    }

    .new-game-table {
        width: 50vw; /* 70% näytön leveydestä */
        height: calc(50vw * 0.5675); /* Säilytetään alkuperäinen kuvasuhde */
    }
    .card {
        width: 53px;
        height: 78px;
        font-size: 18px;
        line-height: 55px;
    }
    .card-back {
        width: 53px;
        height: 78px;
    }

    .pomps span {
        font-size: 1.4rem;
        top: 25%;
    }

    .pomps span.io {
        font-size: 1.4rem;
    }

    .center-wrapper-mid {
        top: 45%;
    }

    .card-xl {
        width: 150px;  /* Pienennetään kortin kokoa */
        height: 230px;
        font-size: 80px;  /* Pienennetään fonttikokoa */
        line-height: 230px;
        margin: 0 5px;  /* Vähennetään marginaalia */
    }

    #gameIcons {
        margin-top: 15px;  /* Pienennetään marginaalia */
    }

    .gameIcon {
        width: 120px;  /* Pienennetään ikonin kokoa */
        height: 120px;
        top: calc(1/3 * 210px - 60px);  /* Päivitetään sijainti */
    }

    .gameImage {
        width: 110px;  /* Pienennetään kuvan kokoa */
        height: 110px;
    }

    h2 {
        font-size: 18px;  /* Pienennetään fonttikokoa */
    }

    h3 {
        font-size: 16px;  /* Pienennetään fonttikokoa */
        margin-top: 170px;  /* Päivitetään marginaali */
    }

    h4 {
        font-size: 26px;  /* Pienennetään fonttikokoa */
    }

    .back h2 {
        margin-top: 30px;  /* Päivitetään marginaali */
    }

    .back h3 {
        font-size: 12px;  /* Pienennetään fonttikokoa */
    }

    #nicknameForm {
        margin-top:210px;
    }

    #player1-score {
        bottom: 25%;
    }

    #player2-score {
        top: 25%;

    }

    #messages {
        font-size:0.8em;
        bottom:160px;
    }

}

@media (min-width: 1600px) {
    .card {
        width: 141px;
        height: 210px;
        font-size: 58px;
        line-height: 140px;
    }

    .card-back {
        width: 141px;
        height: 210px;
    }

}

@media (min-width: 600px) {
    .player-name-on-card {
        font-size: 10px;
    }
}
@media (min-width: 900px) {
    .player-name-on-card {
        font-size: 12px;
    }
}


[data-card-index="0"] { animation-delay: 0s; }
[data-card-index="1"] { animation-delay: 0.1s; }
[data-card-index="2"] { animation-delay: 0.2s; }
[data-card-index="3"] { animation-delay: 0.3s; }
[data-card-index="4"] { animation-delay: 0.4s; }
[data-card-index="5"] { animation-delay: 0.5s; }
[data-card-index="6"] { animation-delay: 0.6s; }
[data-card-index="7"] { animation-delay: 0.7s; }
[data-card-index="8"] { animation-delay: 0.8s; }
[data-card-index="9"] { animation-delay: 0.9s; }