* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    background:
        radial-gradient(circle at 20% 20%, rgba(255,255,255,0.06), rgba(255,255,255,0) 18%),
        radial-gradient(circle at 80% 30%, rgba(255,255,255,0.05), rgba(255,255,255,0) 16%),
        linear-gradient(180deg, #0b6a31 0%, #075124 100%);
    color: white;
    height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hidden {
    display: none !important;
}

/* Setup Screen */
#setup-screen, #game-over-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 20px;
    text-align: center;
    z-index: 100;
}

#setup-screen h1, #game-over-screen h1 {
    margin-bottom: 20px;
    color: #ffd700;
    text-shadow: 2px 2px 4px #000;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 24px;
}

.brand-lockup-icon,
.game-over-icon {
    width: 92px;
    height: 92px;
    border-radius: 22px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.brand-lockup-text {
    text-align: left;
}

.brand-lockup-text h1 {
    margin-bottom: 8px !important;
}

.brand-lockup-text p {
    color: rgba(255, 240, 194, 0.9);
    font-size: 1rem;
    letter-spacing: 0.02em;
}

.setup-controls {
    margin-bottom: 30px;
    background: #111;
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #ffd700;
}

.setup-controls label {
    font-size: 1.2rem;
    margin-right: 10px;
}

.setup-controls select {
    font-size: 1.2rem;
    padding: 5px;
    margin-right: 20px;
    border-radius: 5px;
}

button {
    font-size: 1.2rem;
    padding: 10px 20px;
    background-color: #ffd700;
    color: #000;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}

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

button:disabled {
    background-color: #666;
    color: #333;
    cursor: not-allowed;
}

.instructions {
    max-width: 600px;
    text-align: left;
    background: rgba(0, 0, 0, 0.6);
    padding: 20px;
    border-radius: 10px;
    line-height: 1.5;
}

.instructions h2 {
    text-align: center;
    margin-bottom: 15px;
    color: #ffd700;
}

.instructions ul {
    margin-top: 10px;
    margin-left: 20px;
}

.instructions li {
    margin-bottom: 5px;
}

.stats-panel {
    width: min(620px, 100%);
    margin: 0 0 24px;
    padding: 18px;
    border-radius: 18px;
    background: rgba(8, 28, 15, 0.72);
    border: 1px solid rgba(237, 197, 96, 0.28);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.stats-panel.compact {
    width: min(420px, 100%);
    margin: 0 0 18px;
}

.stats-panel h2 {
    margin-bottom: 12px;
    color: #ffd876;
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 74px;
    padding: 10px 8px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255,255,255,0.08);
}

.stat-card strong {
    color: #fff1ae;
    font-size: 1.15rem;
}

.stat-card span {
    color: rgba(255,255,255,0.72);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Game Screen */
#game-screen {
    width: 100%;
    height: 100%;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

#game-table {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    width: 100%;
    min-height: 0;
}

#game-table::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at center, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0) 32%),
        radial-gradient(circle at center, rgba(0,0,0,0) 55%, rgba(0,0,0,0.2) 100%);
}

#game-brand-badge {
    position: absolute;
    left: 18px;
    top: 16px;
    z-index: 25;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 22px;
    background: rgba(7, 32, 17, 0.78);
    border: 1px solid rgba(233, 198, 105, 0.45);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}

.game-brand-badge-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    flex: 0 0 auto;
}

.game-brand-badge-text {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.game-brand-badge-text strong {
    color: #ffe39b;
    font-size: 1.15rem;
}

.game-brand-badge-text span {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

#safe-celebration {
    position: absolute;
    inset: 0;
    z-index: 32;
    pointer-events: none;
}

.safe-celebration-burst {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 320px;
    height: 320px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background:
        radial-gradient(circle, rgba(255, 227, 122, 0.55) 0%, rgba(255, 227, 122, 0.12) 45%, rgba(255, 227, 122, 0) 72%),
        conic-gradient(from 0deg, rgba(255, 236, 154, 0.85), rgba(255, 236, 154, 0) 22%, rgba(255, 236, 154, 0.75) 32%, rgba(255, 236, 154, 0) 46%, rgba(255, 236, 154, 0.8) 58%, rgba(255, 236, 154, 0) 72%, rgba(255, 236, 154, 0.8) 86%, rgba(255, 236, 154, 0) 100%);
    filter: blur(0.2px);
    opacity: 0;
}

.safe-celebration-badge {
    position: absolute;
    left: 50%;
    top: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 220px;
    padding: 18px 26px;
    transform: translate(-50%, -50%) scale(0.75);
    border-radius: 26px;
    background: rgba(18, 44, 20, 0.9);
    border: 2px solid rgba(255, 232, 149, 0.85);
    box-shadow: 0 18px 32px rgba(0, 0, 0, 0.28);
    opacity: 0;
}

.safe-celebration-label {
    color: #fff0a6;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 0.1em;
}

.safe-celebration-name {
    color: rgba(255, 255, 255, 0.88);
    font-size: 1rem;
    font-weight: 700;
}

#safe-celebration.show .safe-celebration-burst {
    animation: safeBurst 1.35s ease-out forwards;
}

#safe-celebration.show .safe-celebration-badge {
    animation: safeBadge 1.35s ease-out forwards;
}

#donkey-loss-animation {
    position: relative;
    width: 190px;
    height: 210px;
    margin: 6px auto 18px;
}

.donkey-loss-card {
    position: absolute;
    left: 50%;
    top: 0;
    width: 130px;
    height: 182px;
    transform: translateX(-50%);
    border-radius: 18px;
    border: 3px solid #dfc17c;
    background: linear-gradient(180deg, #fff8e8 0%, #efe6c7 100%);
    color: #111;
    font-size: 3.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28);
}

.donkey-loss-shadow {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 120px;
    height: 22px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.28);
    filter: blur(10px);
}

#donkey-loss-animation.show .donkey-loss-card {
    animation: donkeyCardDrop 1.2s cubic-bezier(.22,.89,.28,1.15) forwards, donkeyCardShake 1.6s ease-in-out 1.2s 1;
}

#donkey-loss-animation.show .donkey-loss-shadow {
    animation: donkeyShadowPulse 1.2s ease-out forwards;
}

#app-version {
    position: fixed;
    left: 10px;
    bottom: 10px;
    z-index: 10050;
    padding: 4px 8px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(0, 0, 0, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    letter-spacing: 0.04em;
    pointer-events: none;
}

/* Opponents Area */
#opponents-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.3);
    min-height: 150px;
    flex-wrap: nowrap;
    overflow: visible;
}

.opponent {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 10px;
    min-width: 100px;
    transition: transform 0.3s;
}

.opponent.active {
    box-shadow: 0 0 15px #ffd700;
    border: 2px solid #ffd700;
    transform: scale(1.05);
}

.opponent.safe {
    opacity: 0.5;
}

.opponent-name {
    font-weight: bold;
    margin-bottom: 10px;
    position: relative;
    display: inline-block;
    padding-right: 25px; /* Space for the badge */
}

.opponent-card-count {
    position: absolute;
    top: -8px;
    right: 0;
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
    border: 2px solid white;
}

.opponent-cards {
    position: relative;
    height: 96px;
    width: 76px;
    overflow: visible;
}

.opponent-cards .card-back {
    left: 50%;
    transform: translateX(-50%);
}

/* Pile Stock Info */
#pile-stock {
    position: absolute;
    left: 20px;
    top: calc(50% - 150px);
    background: rgba(0, 0, 0, 0.7);
    padding: 10px;
    border-radius: 8px;
    font-size: 1rem;
    color: #fff;
    border: 1px solid #666;
    z-index: 6;
}

#pile-stock div {
    margin-bottom: 5px;
}

/* Discard Area */
#discard-area {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-30%);
    width: 120px;
    height: 160px;
    z-index: 5;
    pointer-events: none; /* Discard pile is just visual */
}

#discard-area .card, #discard-area .card-back {
    position: absolute;
    top: 0;
    left: 0;
    margin: 0;
    box-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

/* Center Area (Play area) */
#center-area {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 72px 18px 76px;
}

#status-message {
    position: absolute;
    top: 20px; /* Top right position so it doesn't hide center pile */
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    padding: 15px 30px;
    border-radius: 15px;
    font-size: 2rem;
    font-weight: bold;
    color: #ffd700;
    text-align: center;
    z-index: 20;
    border: 2px solid #ffd700;
    box-shadow: 0 4px 10px rgba(0,0,0,0.8);
    text-shadow: 2px 2px 4px #000;
}

#center-pile {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    width: min(1240px, calc(100% - 40px));
    min-height: 188px;
    margin-top: 8px;
    padding: 14px 18px 28px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 18px;
    box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.22);
}

#center-pile.resolution-pending {
    border-color: rgba(255, 223, 121, 0.48);
    box-shadow:
        inset 0 0 18px rgba(0, 0, 0, 0.22),
        0 0 0 1px rgba(255, 223, 121, 0.12),
        0 0 28px rgba(255, 223, 121, 0.14);
}

.game-over-icon {
    margin-bottom: 18px;
}

.final-standings {
    width: min(420px, 100%);
    margin: 18px 0 22px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(8, 28, 15, 0.78);
    border: 1px solid rgba(237, 197, 96, 0.35);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

.final-standing-row {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.88);
}

.final-standing-row + .final-standing-row {
    margin-top: 8px;
}

.final-standing-row.winner {
    background: rgba(241, 206, 111, 0.16);
    border: 1px solid rgba(241, 206, 111, 0.5);
}

.final-standing-row.you {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.final-standing-row.donkey {
    background: rgba(163, 40, 28, 0.18);
    border: 1px solid rgba(219, 102, 84, 0.45);
}

.final-standing-position {
    color: #ffe39b;
    font-weight: 800;
    text-align: left;
}

.final-standing-name {
    font-weight: 700;
    text-align: left;
}

.final-standing-result {
    font-size: 0.88rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.72);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.played-card {
    position: relative;
    flex: 0 0 auto;
    box-shadow: 3px 3px 6px rgba(0,0,0,0.6);
    margin: 0 !important;
    transform: rotate(var(--card-tilt, 0deg));
    transform-origin: center center;
}

.played-card-label {
    position: absolute;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.1;
    bottom: -28px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0,0,0,0.45);
}

#continue-btn {
    position: absolute;
    right: 18px;
    bottom: 12px;
    z-index: 10000;
    padding: 15px 30px;
    font-size: 1.5rem;
    background-color: #e74c3c;
    color: white;
    border: 4px solid #c0392b;
    box-shadow: 0 8px 16px rgba(0,0,0,0.8);
    border-radius: 15px;
    animation: pulse 1.5s infinite;
    cursor: pointer;
}

#continue-btn:hover {
    background-color: #c0392b;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes safeBurst {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.35) rotate(-20deg); }
    30% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.15) rotate(24deg); }
}

@keyframes safeBadge {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.72) translateY(10px); }
    18% { opacity: 1; transform: translate(-50%, -50%) scale(1.06) translateY(0); }
    68% { opacity: 1; transform: translate(-50%, -50%) scale(1) translateY(0); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0.96) translateY(-8px); }
}

@keyframes donkeyCardDrop {
    0% { transform: translateX(-50%) translateY(-56px) rotate(-18deg) scale(0.92); opacity: 0; }
    60% { transform: translateX(-50%) translateY(6px) rotate(8deg) scale(1.02); opacity: 1; }
    100% { transform: translateX(-50%) translateY(0) rotate(0deg) scale(1); opacity: 1; }
}

@keyframes donkeyCardShake {
    0%, 100% { transform: translateX(-50%) rotate(0deg); }
    20% { transform: translateX(-50%) rotate(-5deg); }
    40% { transform: translateX(-50%) rotate(4deg); }
    60% { transform: translateX(-50%) rotate(-3deg); }
    80% { transform: translateX(-50%) rotate(2deg); }
}

@keyframes donkeyShadowPulse {
    0% { opacity: 0; transform: translateX(-50%) scale(0.6); }
    60% { opacity: 1; transform: translateX(-50%) scale(1.1); }
    100% { opacity: 0.85; transform: translateX(-50%) scale(1); }
}

/* Player Area */
#player-area {
    height: 228px;
    min-height: 228px;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 10px 16px;
}

.player-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 800px;
    margin-bottom: 10px;
    font-size: 1.2rem;
    font-weight: bold;
}

#borrow-btn {
    padding: 5px 10px;
    font-size: 0.9rem;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    transition: transform 0.2s;
}

#borrow-btn:active {
    transform: scale(0.95);
}

#borrow-btn.hidden {
    display: none;
}

#player-area.active {
    box-shadow: inset 0 0 20px #ffd700;
}

#player-hand {
    display: flex;
    flex-wrap: nowrap; /* Prevent wrapping */
    justify-content: center;
    align-items: flex-end;
    width: 100%;
    max-width: 1000px;
    overflow: visible;
    padding-bottom: 24px; /* Room for hover effect */
    height: 172px; /* Base height for cards */
}

/* Card Styling */
/*
  Original card width: ~71px, height: 96px.
  Scaling by 1.5x gives width: ~106.5px (round to 106px), height: 144px.
  Sprite sheet size: 923x384. Scaled 1.5x = 1384.5x576. Let's use 1384px x 576px.
*/
.card {
    width: 106px;
    height: 144px;
    border-radius: 5px;
    background-image: url('cards.png');
    background-size: 1384px 576px;
    box-shadow: 1px 1px 3px rgba(0,0,0,0.3);
    position: relative;
    transition: transform 0.2s, top 0.2s;
    cursor: pointer;
    /* margin-left is now set dynamically in JS based on hand size */
}

/* Keep center pile cards slightly overlapped or adjust margin */
.card:hover {
    transform: translateY(-10px);
    z-index: 10;
}

.card.playable:hover {
    transform: translateY(-15px);
    box-shadow: 0 0 10px #ffd700;
    z-index: 10;
}

.card.disabled {
    filter: brightness(0.6);
    cursor: not-allowed;
}

.card.disabled:hover {
    transform: none;
}

.card-back {
    width: 106px;
    height: 144px;
    background-image: url('card-back.png');
    background-size: cover;
    border-radius: 5px;
    box-shadow: 1px 1px 3px rgba(0,0,0,0.3);
    position: absolute;
}

/* Orientation Warning */
#orientation-warning {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    color: #fff;
    z-index: 10000;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
}

#orientation-warning h1 {
    color: #ffd700;
    margin-bottom: 20px;
}

#orientation-warning p {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

/* Require Landscape on Mobile */
@media screen and (max-width: 900px) and (orientation: portrait) {
    #orientation-warning {
        display: flex;
    }
    #setup-screen, #game-screen, #game-over-screen {
        display: none !important;
    }
}

/* Mobile Responsiveness (Targeting Mobile Landscape Mode) */
@media screen and (max-height: 500px), screen and (max-width: 950px) {
    body {
        overflow-y: auto;
    }

    #setup-screen,
    #game-over-screen {
        justify-content: flex-start;
        height: auto;
        min-height: 100dvh;
        overflow-y: auto;
        padding: 18px 14px 28px;
    }

    #game-screen,
    #game-table {
        height: 100dvh;
    }

    #status-message {
        font-size: 1rem;
        padding: 6px 12px;
        top: 8px;
        right: 8px;
        width: auto;
        max-width: min(48vw, 240px);
        line-height: 1.1;
    }

    .brand-lockup {
        gap: 12px;
        margin-bottom: 18px;
    }

    .brand-lockup-icon,
    .game-over-icon {
        width: 64px;
        height: 64px;
        border-radius: 16px;
    }

    .brand-lockup-text p {
        font-size: 0.85rem;
    }

    .stats-panel {
        padding: 10px;
        margin-bottom: 12px;
        border-radius: 12px;
    }

    .stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .stat-card {
        min-height: 58px;
        padding: 8px 6px;
        border-radius: 10px;
    }

    .stat-card strong {
        font-size: 0.92rem;
    }

    .stat-card span {
        font-size: 0.58rem;
    }

    .final-standings {
        padding: 10px;
        border-radius: 14px;
        margin: 12px 0 16px;
    }

    .final-standing-row {
        grid-template-columns: 44px 1fr auto;
        gap: 8px;
        padding: 8px 10px;
        border-radius: 10px;
    }

    .final-standing-position,
    .final-standing-name,
    .final-standing-result {
        font-size: 0.72rem;
    }

    #game-brand-badge {
        left: 8px;
        top: 8px;
        padding: 5px 7px;
        gap: 6px;
        border-radius: 12px;
        max-width: 124px;
    }

    .game-brand-badge-icon {
        width: 28px;
        height: 28px;
        border-radius: 7px;
    }

    .game-brand-badge-text strong {
        font-size: 0.68rem;
    }

    .game-brand-badge-text span {
        font-size: 0.48rem;
        letter-spacing: 0.05em;
    }

    .safe-celebration-burst {
        width: 200px;
        height: 200px;
    }

    .safe-celebration-badge {
        min-width: 160px;
        padding: 12px 16px;
        border-radius: 18px;
    }

    .safe-celebration-label {
        font-size: 1.35rem;
    }

    .safe-celebration-name {
        font-size: 0.8rem;
    }

    #donkey-loss-animation {
        width: 132px;
        height: 150px;
        margin-bottom: 10px;
    }

    .donkey-loss-card {
        width: 92px;
        height: 128px;
        border-radius: 14px;
        font-size: 2.35rem;
    }

    #app-version {
        left: 8px;
        bottom: 8px;
        font-size: 0.62rem;
        padding: 3px 6px;
    }

    #continue-btn {
        right: 10px;
        bottom: 8px;
        font-size: 0.9rem;
        padding: 8px 12px;
        z-index: 10000;
        max-width: min(38vw, 180px);
        white-space: nowrap;
    }

    #player-area {
        height: 108px;
        min-height: 108px;
        padding: 2px;
    }

    .player-info {
        font-size: 0.78rem;
        margin-bottom: 2px;
    }

    #player-hand {
        height: 82px;
        padding-bottom: 4px;
    }

    #player-hand .card {
        transform: scale(0.56);
        transform-origin: bottom center;
        margin-top: -52px;
    }

    #player-hand .card:hover {
        transform: scale(0.62) translateY(-6px);
    }

    #player-hand .card.playable:hover {
        transform: scale(0.62) translateY(-10px);
    }

    #opponents-container {
        min-height: 68px;
        padding: 3px 5px;
        gap: 4px;
    }

    .opponent {
        min-width: 52px;
        padding: 3px;
    }

    .opponent-name {
        font-size: 0.68rem;
        padding-right: 17px;
    }

    .opponent-card-count {
        width: 18px;
        height: 18px;
        font-size: 0.62rem;
        top: -8px;
    }

    .opponent-cards {
        height: 40px;
        width: 32px;
    }

    .opponent-cards .card-back {
        transform: translateX(-50%) scale(0.38);
        transform-origin: top center;
    }

    #center-pile {
        width: 100%;
        max-width: calc(100% - 20px);
        min-height: 94px;
        gap: 3px;
        padding: 6px 6px 18px;
        margin-top: 0;
    }

    #center-area {
        padding: 38px 6px 64px;
    }

    #center-area .played-card {
        transform: scale(0.46) rotate(var(--card-tilt, 0deg));
        transform-origin: center center;
    }

    .played-card-label {
        font-size: 0.8rem;
        padding: 4px 7px;
        bottom: -24px;
        transform: translateX(-50%) scale(1.9);
        transform-origin: top center;
    }

    #pile-stock {
        left: 5px;
        top: calc(50% - 100px);
        font-size: 0.8rem;
        padding: 5px;
    }

    #discard-area {
        left: 5px;
        transform: scale(0.5) translateY(-30%);
        transform-origin: left center;
    }

    .setup-controls label, .setup-controls select, button {
        font-size: 1rem;
    }
}
