:root {
    --bg-color: #1a1a1a;
    --table-color: #1b5e20;
    --table-outline: #2e7d32;
    --card-white: #ffffff;
    --card-shadow: rgba(0, 0, 0, 0.3);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.1);
    --accent-color: #ffca28;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: white;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#main-wrapper {
    width: 95vw;
    height: 95vh;
    max-width: 1200px;
    max-height: 900px;
    display: flex;
    flex-direction: column;
    background: #000;
    border: 10px solid #333;
    border-radius: 20px;
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.8);
    position: relative;
    overflow: hidden;
}

#game-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    background: radial-gradient(circle, var(--table-color) 0%, #0d3b0d 100%);
    perspective: 1000px;
}

.table {
    width: 90%;
    height: 85%;
    max-width: 1000px;
    max-height: 800px;
    position: relative;
    border: 15px solid #3e2723;
    border-radius: 200px;
    box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.5), 0 20px 50px rgba(0, 0, 0, 0.8);
}

.player-area {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.player-bottom {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.player-top {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.player-left {
    left: 40px;
    top: 50%;
    transform: translateY(-50%) rotate(90deg);
}

.player-right {
    right: 40px;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
}

.hand {
    display: flex;
    height: 120px;
    min-width: 100px;
    justify-content: center;
    padding-left: 40px;
    /* Offset for negative margin */
}

.card {
    width: 70px;
    height: 100px;
    background: var(--card-white);
    border-radius: 8px;
    color: black;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 8px;
    font-weight: bold;
    font-size: 1.2rem;
    position: relative;
    box-shadow: 2px 2px 5px var(--card-shadow);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    margin-left: -40px;
    border: 1px solid #ddd;
    background-size: cover;
}

.card:hover {
    transform: translateY(-15px);
    z-index: 100;
}

.card.selected {
    transform: translateY(-25px);
    box-shadow: 0 0 15px var(--accent-color);
}

.card.back {
    background: linear-gradient(135deg, #b71c1c 25%, #d32f2f 25%, #d32f2f 50%, #b71c1c 50%, #b71c1c 75%, #d32f2f 75%, #d32f2f 100%);
    background-size: 10px 10px;
    border: 4px solid white;
}

.center-area {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.played-card {
    position: absolute;
    width: 70px;
    height: 100px;
    background: white;
    border-radius: 8px;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    color: black;
    transition: all 0.5s ease-out;
}

/* Glassmorphism UI */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#passing-overlay {
    background: transparent;
    backdrop-filter: none;
    pointer-events: none;
    align-items: flex-start;
    padding-top: 100px;
}

#passing-overlay .modal {
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.8);
}

.modal {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.37);
}

button {
    background: var(--accent-color);
    border: none;
    padding: 12px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 30px;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    margin-top: 20px;
}

button:hover {
    transform: scale(1.05);
    background: #ffd54f;
}

.status-bar {
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.card-red {
    color: #d32f2f;
}

.card-black {
    color: #212121;
}

.passing-hint {
    color: var(--accent-color);
    font-weight: bold;
    margin-bottom: 20px;
}

.suit-icon {
    font-size: 1.5rem;
}

.score-board {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--glass-bg);
    padding: 15px;
    border-radius: 10px;
    font-size: 0.8rem;
}

.score-row {
    display: flex;
    justify-content: space-between;
    width: 150px;
    margin-bottom: 5px;
}