body {
    font-family: Arial, sans-serif;
    text-align: left; /* align all text to left */
    background: linear-gradient(135deg, #2b5876, #4e4376);
    color: white;
    margin: 0;
    padding: 20px;
}

/* Fullscreen blur during shuffle - only background */


/* Background video *
/*
#backgroundVideo {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1; /* behind all content */



button {
    padding: 10px 20px;
    border: none;
    background-color: #ff9800;
    color: white;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    margin: 10px;
}

button:hover {
    background-color: #e68900;
}

.hidden {
    display: none;
}

#playersArea {
    display: flex;
    justify-content: center; /* center horizontally */
    align-items: center;     /* center vertically */
    flex-wrap: nowrap;       /* no wrapping */
    gap: 30px;               /* spacing between player boxes */
    overflow-x: auto;        /* horizontal scroll if needed */
    position: absolute;      /* position in the middle of screen */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 10px;
}

.player {
    border: 2px solid white;
    border-radius: 15px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.15);
    width: 160px;          /* default width */
    min-width: 100px;      /* minimum width to prevent overflow */
    transition: transform 0.3s ease, box-shadow 0.3s ease, width 0.3s ease;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
    animation: playerGlow 2s ease-in-out infinite alternate;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Hover effect */
.player:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.7);
}

/* Remove any staggered offsets */
.player:nth-child(odd),
.player:nth-child(even) {
    transform: none;
}

/* Responsive adjustments */
@media (max-width: 1000px) {
    #playersArea {
        gap: 20px;
    }

    .player {
        width: 120px;
        padding: 15px;
    }
}

@media (max-width: 600px) {
    #playersArea {
        flex-wrap: wrap;
        justify-content: center;
    }

    .player {
        width: 100px;
        margin: 10px;
        transform: none;
    }
}

@keyframes playerGlow {
    from { box-shadow: 0 0 10px rgba(255, 255, 255, 0.3); }
    to { box-shadow: 0 0 25px rgba(255, 255, 255, 0.8); }
}

.card {
    width: 80px;
    height: 120px;
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    color: black;
    border: 1px solid #ccc;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 5px;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    font-family: 'Courier New', monospace;
    position: relative;
    padding: 8px;
}

.card::before {
    content: attr(data-value);
    position: absolute;
    top: 2px;
    left: 2px;
    font-size: 64px;       /* much larger size */
    font-weight: bold;
    z-index: 10;
    pointer-events: none;
}

.card::after {
    content: attr(data-value);
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: 64px;       /* much larger size */
    font-weight: bold;
    transform: rotate(180deg);
    z-index: 10;
    pointer-events: none;
}

/* Red suits (♥ ♦) */
.card.red {
    color: red;
}

.card.red::before, .card.red::after {
    color: red;
}

/* Lucky card - removed golden glow */
.card.lucky {
    border: 2px solid black; /* neutral border instead of gold */
    box-shadow: 0 0 5px rgba(0,0,0,0.3); /* subtle shadow */
    animation: none; /* remove glow animation */
}

/* Winner and loser styles */
.player.winner {
    border: 3px solid limegreen;
    box-shadow: 0 0 20px limegreen;
    animation: winnerGlow 1s ease-in-out infinite alternate;
}

.player.loser {
    border: 2px solid red;
    box-shadow: 0 0 15px red;
    animation: loserGlow 1s ease-in-out infinite alternate;
}

@keyframes winnerGlow {
    from { box-shadow: 0 0 20px limegreen; }
    to { box-shadow: 0 0 35px limegreen; }
}

@keyframes loserGlow {
    from { box-shadow: 0 0 15px red; }
    to { box-shadow: 0 0 25px red; }
}
/* Card deal animation */
@keyframes dealCard {
    0% {
        transform: translateY(-50px) rotate(-10deg);
        opacity: 0;
    }
    50% {
        transform: translateY(0px) rotate(5deg);
        opacity: 1;
    }
    100% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
}

/* Card deal animation */
.card.deal {
    animation: dealCard 0.6s ease forwards;
}

/* Smooth zoom out effect for cards */
.card.zoom-out {
    animation: zoomOutCard 0.6s ease forwards;
}

@keyframes zoomOutCard {
    0% {
        transform: scale(1.4) rotate(-5deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(2deg);
        opacity: 0.6;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* ---- Shuffle Animation for Cards ---- */
@keyframes shuffleCards {
    0% {
        transform: translateX(0) rotate(0deg);
    }
    25% {
        transform: translateX(-30px) rotate(-10deg);
    }
    50% {
        transform: translateX(30px) rotate(10deg);
    }
    75% {
        transform: translateX(-15px) rotate(-5deg);
    }
    100% {
        transform: translateX(0) rotate(0deg);
    }
}

/* Apply shuffle animation style */
.card.shuffle {
    animation: shuffleCards 0.4s ease-in-out 3; /* repeat 3 times quickly */
}
/* ---- Truth and Dare Arrow ---- */
.arrow {
    position: absolute;
    width: 40px;
    height: 4px;
    background: yellow;
    transform-origin: left center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.5s;
}
.arrow.show {
    opacity: 1;
    animation: arrowMove 1s forwards;
}
@keyframes arrowMove {
    0% { transform: scaleX(0) rotate(0deg); opacity: 1; }
    100% { transform: scaleX(1) rotate(var(--angle, 0deg)); opacity: 1; }
}
/* ---- Subtle Truth and Dare Card ---- */
.card.truth-dare {
    border: 2px dashed red;
    box-shadow: 0 0 10px red, 0 0 20px red;
    animation: subtleFloatRed 1.2s ease-in-out infinite alternate;
}

/* Red subtle floating animation */
@keyframes subtleFloatRed {
    0% { transform: translateY(0px) rotate(-1deg); box-shadow: 0 0 5px red; }
    25% { transform: translateY(-3px) rotate(1deg); box-shadow: 0 0 10px red; }
    50% { transform: translateY(-5px) rotate(-2deg); box-shadow: 0 0 15px red; }
    75% { transform: translateY(-3px) rotate(1deg); box-shadow: 0 0 10px red; }
    100% { transform: translateY(0px) rotate(-1deg); box-shadow: 0 0 5px red; }
}

/* Glow effect for Truth & Dare arrow */
.arrow {
    box-shadow: 0 0 8px yellow;
    border-radius: 2px;
}

/* Enhanced subtle floating card animation */
/* Removed the yellow subtleFloat keyframes to prevent conflicts */
/* 
@keyframes subtleFloat {
    0% { transform: translateY(0px) rotate(-1deg); box-shadow: 0 0 5px yellow; }
    25% { transform: translateY(-3px) rotate(1deg); box-shadow: 0 0 10px yellow; }
    50% { transform: translateY(-5px) rotate(-2deg); box-shadow: 0 0 15px yellow; }
    75% { transform: translateY(-3px) rotate(1deg); box-shadow: 0 0 10px yellow; }
    100% { transform: translateY(0px) rotate(-1deg); box-shadow: 0 0 5px yellow; }
}
*/

/* Smooth transitions for winner and loser highlights */
.player.winner, .player.loser {
    transition: border 0.5s ease, box-shadow 0.5s ease;
}
/* Winner card subtle floating effect */
.card.winner-card {
    border: 2px dashed yellow;
    box-shadow: 0 0 10px yellow, 0 0 20px yellow;
    animation: subtleFloatYellow 1.2s ease-in-out infinite alternate;
}

/* Yellow subtle floating animation */
@keyframes subtleFloatYellow {
    0% { transform: translateY(0px) rotate(-1deg); box-shadow: 0 0 5px yellow; }
    25% { transform: translateY(-3px) rotate(1deg); box-shadow: 0 0 10px yellow; }
    50% { transform: translateY(-5px) rotate(-2deg); box-shadow: 0 0 15px yellow; }
    75% { transform: translateY(-3px) rotate(1deg); box-shadow: 0 0 10px yellow; }
    100% { transform: translateY(0px) rotate(-1deg); box-shadow: 0 0 5px yellow; }
}

/* Loser card subtle floating effect */
.card.loser-card {
    border: 2px dashed red;
    box-shadow: 0 0 10px red, 0 0 20px red;
    animation: subtleFloatRedCard 1.2s ease-in-out infinite alternate;
}

/* Red subtle floating animation */
@keyframes subtleFloatRedCard {
    0% { transform: translateY(0px) rotate(-1deg); box-shadow: 0 0 5px red; }
    25% { transform: translateY(-3px) rotate(1deg); box-shadow: 0 0 10px red; }
    50% { transform: translateY(-5px) rotate(-2deg); box-shadow: 0 0 15px red; }
    75% { transform: translateY(-3px) rotate(1deg); box-shadow: 0 0 10px red; }
    100% { transform: translateY(0px) rotate(-1deg); box-shadow: 0 0 5px red; }
}
/* ---- Shuffle Button fixed at bottom center ---- */
#shuffleBtn {
    position: fixed;
    bottom: 20px;      /* distance from the bottom of the screen */
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 25px;
    font-size: 18px;
    border: none;
    border-radius: 20px;
    background-color: #ffcc00;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    z-index: 1000;
    transition: transform 0.2s ease;
}

#shuffleBtn:hover {
    transform: translateX(-50%) scale(1.1);
}

/* ---- Fullscreen blur effect during countdown ---- */
body.blur-active::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(10px);
    background: rgba(0, 0, 0, 0.4); /* semi-transparent dark overlay */
    z-index: 1500;
}

#countdown {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 120px;
    font-weight: bold;
    color: #ffcc00;
    text-shadow: 0 0 25px rgba(255, 255, 0, 0.9);
    z-index: 2000; /* Ensure countdown stays above the blur layer */
    animation: countdownScale 1s ease-in-out infinite;
}

@keyframes countdownScale {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1.4); opacity: 0.5; }
}

/* ---- Blur effect during countdown ---- */
/* Blur now handled by fullscreen overlay above */
/* ---- Background Image Section ---- */
#backgroundImage {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.3)),
        url("milad-fakurian-nY14Fs8pxT8.jpg") no-repeat center center fixed;
    background-size: cover;
    z-index: -1; /* behind all content */
}


#startGameBtn {
   
 display: block;           
    margin: 600px  auto 0 auto;    
    padding: 12px 25px;
    font-size: 18px;
    border: none;
    border-radius: 20px;
    background-color: #ffcc00; /* green */
    text-shadow: 0 0 25px rgba(255, 255, 0, 0.9);
    color: rgb(0, 0, 0);
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

#startGameBtn:hover {
    transform: scale(1.1);
}

/* Align specific text sections to left */
#gameTitle{
    text-align: center;
    font-size: 72px;
    font-weight: bold;
    margin-bottom: 20px;
}
#truthDareLabel{
    text-align: right;
    float: right;
    vertical-align: top;
    margin:-50px 20px 0 0; /* moved further up */
    font-size: 18px;
    font-weight: bold;
}
#playerSelectLabel,
#players {
   display: inline-block;
     vertical-align: middle; /* align vertically with the select box */
   text-align: left;
   margin: -50px 20px 0 0; /* adjust spacing to bring label inline with box */
   font-size: 18px;
   font-weight: bold;
   border-radius: 20px;
   padding: 5px;
   background-color: rgb(255, 255, 255);  /* pink background for player box */
   transition: background-color 0.3s ease; /* smooth hover transition */ /* smooth hover transition */
}

#players:hover {
    background-color: #04ff00;    }

.card[data-value^="10"]::before,
.card[data-value^="10"]::after {
    font-size: 50px; /* slightly smaller than other cards */
}

.temp-shuffle-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 10px;
    z-index: 999;
}

.temp-shuffle-container .card {
    width: 80px;
    height: 120px;
    background: linear-gradient(135deg, #ff00cc, #ca0086, #ff0000, #ffb700);
    background-size: 400% 400%;
    border: 2px solid #fff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: white;
    box-shadow: 0 0 15px rgba(255,255,255,0.6);
       animation: shuffleCards 0.4s ease-in-out 3, gradientShift 2s linear infinite;
}

/* Add smooth gradient color shifting effect */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
/* Fullscreen blur during shuffle */
body.shuffle-active::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(10px);
    background: rgba(0, 0, 0, 0.2); /* semi-transparent overlay */
    z-index: 1500;
}

body.blur-active #backgroundImage,
body.blur-active #playersArea,
body.blur-active #gameTitle {
    filter: blur(8px);
    transition: filter 0.3s ease;
}