.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    touch-action: manipulation;
}

#stats-board {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: #38B48B;
}

.message {
    font-size: 1.3rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
    height: 30px;
    /* Layout stability */
}

.message.win {
    color: #1e90ff;
}

.message.lose {
    color: #ff4757;
}

.card-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.vs {
    font-size: 1.5rem;
    font-weight: bold;
    color: #888;
}

.card {
    width: 100px;
    height: 140px;
    perspective: 1000px;
}

.card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.card.flip .card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    width: 100%;
    height: 100%;
    position: absolute;
    backface-visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    font-size: 3rem;
    font-weight: bold;
    background-color: white;
    border: 2px solid #ccc;
    box-sizing: border-box;
    flex-direction: column;
}

.card-back {
    /* Using back as the "face down" side in logic, though visually it's the front starting point */
    background: repeating-linear-gradient(45deg, #38B48B, #38B48B 10px, #2a8f6d 10px, #2a8f6d 20px);
    border: 3px solid white;
}

.card-front.spade,
.card-front.club {
    color: #222;
}

.card-front.heart,
.card-front.diamond {
    color: #e74c3c;
}

.suit {
    font-size: 1.5rem;
    margin-top: 5px;
}

.controls-area {
    display: flex;
    gap: 20px;
    width: 100%;
    justify-content: center;
}

.choice-btn {
    flex: 1;
    max-width: 140px;
    padding: 15px 0;
    font-size: 1.3rem;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.1s;
    font-weight: bold;
}

.high-btn {
    background-color: #ff4757;
    box-shadow: 0 5px 0 #cc3a46;
}

.high-btn:active {
    transform: translateY(5px);
    box-shadow: none;
}

.low-btn {
    background-color: #1e90ff;
    box-shadow: 0 5px 0 #1873cc;
}

.low-btn:active {
    transform: translateY(5px);
    box-shadow: none;
}

#startBtn {
    margin-top: 20px;
    padding: 12px 30px;
    font-size: 1.3rem;
    background-color: #38B48B;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 0 #2a8f6d;
    font-weight: bold;
}

#startBtn:active {
    transform: translateY(4px);
    box-shadow: none;
}

.controls-hint {
    margin-top: 25px;
    font-size: 0.95rem;
    color: #666;
    text-align: center;
    line-height: 1.5;
}

.back-link {
    display: inline-block;
    color: #666;
    margin-top: 20px;
}