:root {
    --bg-color: #2c3e50;
    --table-color: #27ae60;
    --card-width: 80px;
    --card-height: 120px;
    --text-color: #ecf0f1;
    --accent-color: #f1c40f;
}

* {
    box-sizing: border-box;
    user-select: none;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    overflow: hidden;
}

#game-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: radial-gradient(circle, #2ecc71 0%, #27ae60 100%);
}

/* Top Area */
#top-area {
    flex: 1;
    display: flex;
    justify-content: space-between;
    padding: 20px;
}

.player-area {
    width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 10px;
}

.player-info {
    text-align: center;
}

.avatar {
    font-size: 40px;
}

.role {
    font-weight: bold;
    color: var(--accent-color);
    min-height: 20px;
}

#table-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

#deck-area {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}

#wild-cards {
    display: flex;
    gap: 5px;
}

.card-small {
    width: 40px;
    height: 60px;
    background: white;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: black;
    font-weight: bold;
}

#message-area {
    font-size: 24px;
    font-weight: bold;
    text-shadow: 1px 1px 2px black;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 20px;
    border-radius: 20px;
}

/* Middle Area */
#middle-area {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.played-cards {
    display: flex;
    height: var(--card-height);
    /* Overlap cards */
}

/* Bottom Area */
#bottom-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding-bottom: 20px;
}

#player-controls {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    font-size: 18px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    background-color: #3498db;
    color: white;
    transition: transform 0.1s;
}

.btn:hover {
    background-color: #2980b9;
    transform: scale(1.05);
}

.btn:active {
    transform: scale(0.95);
}

.hidden {
    display: none !important;
}

#my-hand {
    display: flex;
    justify-content: center;
    height: var(--card-height);
    margin-bottom: 10px;
    /* Negative margin for card overlap */
}

.card {
    width: var(--card-width);
    height: var(--card-height);
    background-color: white;
    border-radius: 8px;
    border: 1px solid #ccc;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* Align to top */
    padding: 5px;
    font-weight: bold;
    font-size: 20px;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s;
    margin-left: -45px;
    /* Tighter overlap */
}

.card:first-child {
    margin-left: 0;
}

.card.selected {
    transform: translateY(-20px);
    border: 2px solid var(--accent-color);
}

.card.red {
    color: #e74c3c;
}

.card.black {
    color: #2c3e50;
}

.card-corner {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
    position: absolute;
    top: 5px;
    left: 5px;
    background: rgba(255, 255, 255, 0.8);
    /* Slight background to ensure readability */
    border-radius: 4px;
}

.card-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 40px;
    opacity: 0.3;
    /* Make center watermark-like so it doesn't distract */
}

/* Bot played cards positioning */
#player-left .played-cards {
    margin-top: 10px;
    transform: scale(0.8);
}

#player-right .played-cards {
    margin-top: 10px;
    transform: scale(0.8);
}

/* Toast Notification */
#toast-container {
    position: fixed;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 24px;
    z-index: 9999;
    display: none;
    pointer-events: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    text-align: center;
    white-space: nowrap;
}

.toast-show {
    display: block !important;
    animation: toastFadeIn 0.3s ease-out;
}

@keyframes toastFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}