:root {
    --card-width: min(70px, 9vw);
    --card-height: min(105px, 13.5vw);
    --card-radius: min(8px, 1vw);
    --overlap-offset: min(25px, 3vw);
    
    --spade-club: #0f172a;
    --heart-diamond: #ef4444;
}

/* Hands & Cards Layout */
.hand-container {
    display: flex;
    flex-direction: column;
    gap: 1.5vh;
}
.hand-row, .row {
    display: flex;
    justify-content: center;
    gap: 5px;
    min-height: var(--card-height);
}

.card-stack {
    width: var(--card-width);
    height: var(--card-height);
    position: relative;
}

/* Base Card Style */
.card {
    position: absolute;
    width: var(--card-width);
    height: var(--card-height);
    border-radius: var(--card-radius);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: min(6px, 1vw);
    font-weight: 800;
    font-size: min(18px, 3.5vw);
    background-color: white;
    border: 1px solid #cbd5e1;
    user-select: none;
    transition: all 0.3s ease;
    cursor: default;
}

.card.face-down {
    background: repeating-linear-gradient(45deg, #1e293b, #1e293b 8px, #334155 8px, #334155 16px);
    border: 1px solid #fff;
    color: transparent;
}
.card.face-down * { display: none; }

.card.face-up.red { color: var(--heart-diamond); }
.card.face-up.black { color: var(--spade-club); }

.card-value { line-height: 1; pointer-events: none; }
.card-suit { font-size: min(20px, 4vw); align-self: flex-end; line-height: 1; pointer-events: none; }
.card-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: min(30px, 6vw);
    opacity: 0.15;
    pointer-events: none;
}

/* Overlapping Logic for Board Cards */
.card-stack .card.face-down { top: 0; left: 0; z-index: 1; }
.card-stack .card.face-up { top: var(--overlap-offset); left: 0; z-index: 2; }
.hand-card { position: relative !important; top: 0 !important; left: 0 !important; }

/* Interactive Cards */
.card.playable {
    cursor: pointer;
}
.card.playable:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 20px rgba(56, 189, 248, 0.4);
    border-color: #38bdf8;
}

.played-card {
    position: absolute;
    z-index: 10;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

/* Animations */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
    100% { transform: translateY(0px); }
}
.koz-suit {
    animation: float 3s ease-in-out infinite;
    line-height: 1;
}
.koz-suit.red { color: var(--heart-diamond); }
.koz-suit.black { color: #f8fafc; }

/* Profile Avatars */
.avatar-option {
    font-size: 32px;
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    background: rgba(255,255,255,0.05);
}
.avatar-option:hover {
    background: rgba(255,255,255,0.1);
    transform: scale(1.1);
}
.avatar-option.selected {
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.2);
}

@media (max-width: 768px) {
    .card {
        transform: scale(0.9);
    }
}