/*body {
    font-family: 'Arial', sans-serif;
    text-align: center;
    margin: 0;
    padding: 0;
    background-color: #1a472a;
    color: white;
    transition: filter 0.3s ease;
    height: 100%;
}
*/
body {
    font-family: 'Arial', sans-serif;
    text-align: center;
    margin: 0;
    padding: 0;
    background-color: #1a472a;
    color: white;
    transition: filter 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

/*#top-section {
    background-color: #0f2b19;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
*/
#top-section {
   background-color: #0f2b19;
   box-shadow: 0 2px 4px rgba(0,0,0,0.2);
   position: relative;
}


.toggle-button {
    display: block;
    width: 100%;
    padding: 10px;
    background-color: #1a472a;
    color: white;
    border: none;
    border-bottom: 1px solid #2a573a;
    cursor: pointer;
    font-size: 1rem;
    text-align: left;
    z-index: 1000;
}

.toggle-button:hover {
    background-color: #2a573a;
}

#top-bar {
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
    padding: 15px;
}

#top-bar.collapsed {
    max-height: 0;
    padding: 0;
}

#top-bar button {
    padding: 8px 16px;
    border: 2px solid #2a573a;
    border-radius: 8px;
    background: #1a472a;
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

#top-bar button:hover {
    background: #2a573a;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    border: 2px solid #2a573a;
    border-radius: 8px;
    background: #1a472a;
}

/* Player Buttons: Add Press Effect */
.player-controls button {
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    border: 2px solid #2a573a;
    border-radius: 6px;
    background: #1a472a;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.player-controls button:hover {
    background: #2a573a;
}

.player-controls button:active {
    transform: scale(0.9);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

/*#game-section {
    max-width: 800px;
    padding: 5px;
}
*/
#game-section {
    max-width: 1200px;
    padding: 5px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#last-card {
    margin: 5px auto;
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-card {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: #666;
    font-size: 1.2rem;
    margin: 0 auto;
    transition: all 0.3s ease;
}

.placeholder-card:hover {
    border-color: #999;
    background: #f8f8f8;
}

.placeholder-text {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    color: #666;
    font-size: 1.2rem;
    width: 100%;
    text-align: center;
}

.circle.blur {
    filter: blur(3px);
    opacity: 0.7;
    transition: all 0.3s ease;
}

.play-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

#play-button {
    width: 130px;
    height: 130px;
    font-size: 1.5rem;
    background-color: white;
    color: black;
    border: 3px solid #2a573a;
    border-radius: 50%;
    cursor: pointer;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 2px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
    margin: 10px auto;    
    margin-left: 10px; 
    border-color: #ffff00;     
    animation: pulsePause 2s infinite;
}

#play-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

#play-button.started {
    border-color: #008000;     
    animation: pulsePause 2s infinite;
}

#play-button.resume {
    font-size: 1.4rem; /* Smaller font for Resume */
    color: white !important; /* Force white text */
    border-color: #ff6f00; /* Darker orange border */
    animation: pulsePause 2s infinite;
}

@keyframes shake {
    0% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    50% {
        transform: translateX(5px);
    }
    75% {
        transform: translateX(-5px);
    }
    100% {
        transform: translateX(0);
    }
}

.player-button.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes pulsePause {
    0% {
        box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    }
    50% {
        box-shadow: 0 4px 20px rgba(255, 160, 0, 0.4);
    }
    100% {
        box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    }
}


#play-button:active {
    transform: translateY(2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}


/*#player-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px auto;
    padding: 0 10px;
    padding-bottom: 60px;
} */

#player-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    padding: 0 20px 60px;
    max-width: 800px;
    width: 100%;
}

.player {
    width: calc(50% - 10px);
    min-width: 120px;
    max-width: 160px;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    position: relative;
    transition: transform 0.3s ease;
}

/*.player {
    width: 200px;
    min-width: 180px;
    max-width: 220px;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    position: relative;
    transition: transform 0.3s ease;
}
*/
.player:hover {
    transform: translateY(-5px);
}

.player-button {
    width: 100%;
    padding: 12px;
    font-size: 1.1rem;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 8px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.edit-name-button {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.edit-name-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.player-score-line {
    margin-top: 5px;
    font-size: 0.9rem;
    color: #ddd;
    text-align: center;
}

.score-value, .time-value {
    color: #ff8c00;
    font-weight: bold;
    font-size: 1.1rem;
    padding: 2px 6px;
    border-radius: 4px;
    background-color: rgba(255, 140, 0, 0.1);
    display: inline-block;
}

.ranking-badge {
    position: absolute;
    top: -10px;
    left: -10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    border: 2px solid #1a472a;
}

.first-place {
    background: gold;
    color: black;
}

.second-place {
    background: silver;
    color: black;
}

.third-place {
    background: #cd7f32;
    color: black;
}


.stats-line {
    margin: 5px 0;
    font-size: 1rem;
    color: #ddd;
}

.stats-value {
    color: #ff8c00;
    font-weight: bold;
    font-size: 1.1rem;
    padding: 2px 6px;
    border-radius: 4px;
    background-color: rgba(255, 140, 0, 0.1);
    display: inline-block;
    margin-left: 5px;
}

.circle {
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.char {
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

#timer {
    display: inline-block;
    margin: 10px 0;
    color: #ff8c00;
    font-weight: bold;
    font-size: 2rem;
    font-family: monospace;
    background-color: rgba(255, 140, 0, 0.1);
    padding: 5px 15px;
    border-radius: 8px;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 300px;
}

.modal-title {
    color: #1a472a;
    font-size: 1.2rem;
    margin-bottom: 15px;
    font-weight: bold;
}

.modal-input {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #2a573a;
    border-radius: 6px;
    font-size: 1rem;
    margin-bottom: 15px;
    box-sizing: border-box;
}

.modal-input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
}

.modal-button.cancel {
    background-color: #f0f0f0;
    color: #666;
}

.modal-button.save {
    background-color: #4CAF50;
    color: white;
}

.modal-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.modal-button.cancel:hover {
    background-color: #e0e0e0;
}

.modal-button.save:hover {
    background-color: #45a049;
}


.stats-line {
    font-size: 14px;
    margin: 5px 0;
}

#timer {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
    text-align: center;
}


@keyframes flyAndFade {
    0% {
        transform: translate(-50%, -50%) scale(0.2);
        opacity: 0;
    }
    10% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
    20% {
        transform: translate(-50%, -50%) scale(1);
    }
    60% {
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -200%) scale(1.5) rotate(360deg);
        opacity: 0;
    }
}

.celebration-emoji {
    position: fixed;
    left: 50%;
    top: 50%;
    font-size: 60px;
    pointer-events: none;
    z-index: 1000;
    animation: flyAndFade 2s ease-out forwards;
}

@keyframes winnerBlink {
    0% {
        transform: translateY(-5px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.2);
        background: rgba(255, 255, 255, 0.05);
    }
    50% {
        transform: translateY(-5px) scale(1.05);
        box-shadow: 0 8px 24px rgba(255, 215, 0, 0.6);
        background: rgba(255, 215, 0, 0.3);
        border: 2px solid rgba(255, 215, 0, 0.5);
    }
    100% {
        transform: translateY(-5px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.2);
        background: rgba(255, 255, 255, 0.05);
    }
}

.winner-highlight {
    animation: winnerBlink 0.5s ease-in-out 4;
}

.char.highlight {
    color: #ffeb3b !important;
    text-shadow: 0 0 10px rgba(255, 235, 59, 0.8) !important;
    transition: all 0.2s ease;
}

.show-button {
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 16px;
    background-color: #2a573a;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    z-index: 10;
    color: #ffd700;
    font-size: 1.2rem;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.show-button:hover {
    background-color: #3a674a;
}

.help-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.help-modal {
    background: white;
    padding: 20px;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    position: relative;
    color: #333;
}

.help-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
}

/*.language-flags {
    position: absolute;
    top: 3px;
    display: flex;
    gap: 10px;
}*/

.language-flags {
    display: flex;
    gap: 10px;
    margin-left: auto;
    padding: 10px 20px;
}



.flag-button {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 20px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flag-button.active {
    box-shadow: 0 0 0 2px #2196F3;
}

.help-content {
    margin-top: 40px;
}

.demo-circles {
    width: 300px;
    height: 300px;
    position: relative;
    margin: 20px auto;
}

.demo-circle {
    position: absolute;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.demo-circle.outer {
    width: 100%;
    height: 100%;
    background: rgb(0, 0, 0);
}

.demo-circle.middle {
    width: 75%;
    height: 75%;
    background: rgb(255, 0, 0);
    top: 12.5%;
    left: 12.5%;
}

.demo-circle.inner {
    width: 50%;
    height: 50%;
    background: rgb(0, 191, 255);
    top: 25%;
    left: 25%;
}

.demo-circle.highlighted {
    box-shadow: 0 0 15px yellow;
    border: 3px solid yellow;
}


#play-and-stats {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 20px;
    margin: 20px auto;
    width: fit-content;
}


#control-buttons {
    display: block;
    justify-content: center;
    gap: 8px;
    margin: auto;
}

#help-button, #reset-button {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #1a472a;
    border: 2px solid #2a573a;
    padding: 0;
}

#stats {
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
}



#help-button:hover, #reset-button:hover {
    transform: scale(1.1);
    background: #2a573a;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}


.language-selector {
    display: inline-block;
    margin: 0 5px;
}

.language-flags {
    display: flex;
    gap: 8px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.flag-button {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid #2a573a;
    background: #1a472a;
    cursor: pointer;
    font-size: 20px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.flag-button:hover {
    background: #2a573a;
    transform: translateY(-2px);
}

.flag-button.active {
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.hidden {
    display: none;
}

.disable-dbl-tap-zoom {
    touch-action: manipulation;
}

.blur {
    filter: blur(5px); /* Apply a blur of 5px */
}


#footer {
    text-align: center;
    font-size: 14px;
    position: fixed;
    bottom: 0;
    width: 100%;
    background: #1a472a;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
}

.settings-wrapper {
    position: relative;
    width: 100%;
}

.current-flag {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

/*.current-flag {
   position: fixed;
   top: 10px;
   right: 20px;   
   transform: translateY(-50%);
   font-size: 24px;
   z-index: 1001;
   cursor: pointer;
}*/

.current-flag:hover {
   transform: translateY(-50%) scale(1.2);
}


.card-loading {
    width: 300px;
    height: 300px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.shuffling-cards {
    position: relative;
    width: 100px;
    height: 140px;
}

.card {
    position: absolute;
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    animation: shuffle 1.5s infinite;
}

.card:nth-child(1) { animation-delay: 0s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.4s; }

@keyframes shuffle {
    0% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-20px) rotate(-10deg); }
    50% { transform: translateY(0) rotate(0deg); }
    75% { transform: translateY(-20px) rotate(10deg); }
    100% { transform: translateY(0) rotate(0deg); }
}


/* Desktop specific styles */
@media (min-width: 1024px) {
    #last-card {
        margin: 20px auto;
        padding: 30px;
    }
    
    #play-and-stats {
        gap: 40px;
        margin: 30px auto;
    }

    #player-buttons {
       padding: 0 15%;  /* Match the side bands */
    }
    
    .player {
        transition: transform 0.2s ease;
    }
    
    .player:hover {
        transform: translateY(-5px);
    }

    #last-card {
        transform: scale(1.3);
        margin: 40px auto;
    }
    
    /* Adjust spacing for scaled card */
    #game-section {
        margin-top: 20px;
    }

    body::before, body::after {
       content: '';
       position: fixed;
       top: 0;
       bottom: 0;
       width: 15%;
       background: #0f2b19;
       z-index: -1;
   }

   body::before {
       left: 0;
   }

   body::after {
       right: 0;
   }

}


@media (max-width: 375px) {
    #play-and-stats {
        gap: 10px; /* Remove gap on smaller screens */
        margin: 0px;    
    }
    #player-buttons {
        margin: 5px; 
    }
    #last-card {
        min-height: 250px;
        padding: 15px;
        margin: 0px;    
    }
    #game-section {
        padding: 2px; 
    }
    .player {
        padding: 0px; 
    }
    .show-button {
        bottom: -25px;
        font-size: 1rem;
    }
    .modal-overlay {
        top: 10%;
        left: 10%;
        right: 10%;
        bottom: 10%;
    }
}