body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background: #1b1b1b;
    color: #fff;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    text-align: center;
    padding: 1rem;
}

main {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    gap: 1rem;
}

.table {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.card-container {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 1rem;
}

.deck {
    width: 80px;
    height: 120px;
    margin: 1rem;
    position: relative;
}

.deck::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('svg/card-back.svg') center/contain no-repeat;
    border-radius: 8px;
}

.card {
    width: 80px;
    height: 120px;
    perspective: 600px;
    position: relative;
}

.card .inner {
    position: absolute;
    inset: 0;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

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

.card.dealing {
    transition: transform 0.5s ease;
}

.card .front,
.card .back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border-radius: 8px;
}

.card .front {
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card .back {
    transform: rotateY(180deg);
    background: url('svg/card-back.svg') center/contain no-repeat;
}

.controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

button {
    padding: 0.5rem 1rem;
    font-size: 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#hit {
    background: #27ae60;
    color: #fff;
}

#stand {
    background: #e67e22;
    color: #fff;
}

#new-game {
    background: #2980b9;
    color: #fff;
}

.message {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    min-height: 1.2rem;
}

@media (max-width: 600px) {
    .card {
        width: 50px;
        height: 75px;
    }
}

.hearts text,
.diamonds text {
    fill: #e74c3c;
}

.clubs text,
.spades text {
    fill: #000;
}
