:root {
    --primary: #c0392b;
    --secondary: #2c3e50;
    --accent: #f1c40f;
    --glass: rgba(255, 255, 255, 0.1);
    --glass-heavy: rgba(255, 255, 255, 0.2);
    --text: #ffffff;
    --table-green: #1b5e20;
    --table-border: #4caf50;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: #0a0a0a;
    color: var(--text);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

#app {
    width: 100%;
    height: 100%;
    position: relative;
}

.screen {
    display: none;
    width: 100%;
    height: 100%;
    flex-direction: column;
    padding: 20px;
    background: radial-gradient(circle at center, #1a1a1a 0%, #000 100%);
}

.screen.active {
    display: flex;
}

/* Landing Screen */
#landing-screen {
    justify-content: center;
    align-items: center;
}

.glass-card {
    background: var(--glass);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 40px;
    border-radius: 24px;
    text-align: center;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 30px;
    letter-spacing: 4px;
    background: linear-gradient(45deg, #f1c40f, #e67e22);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.input-group {
    margin-bottom: 20px;
}

input {
    width: 100%;
    padding: 15px;
    margin: 10px 0;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    font-size: 1rem;
    outline: none;
    transition: border 0.3s;
}

input:focus {
    border-color: var(--accent);
}

button {
    cursor: pointer;
    border: none;
    border-radius: 12px;
    font-weight: bold;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

button:active {
    transform: scale(0.95);
}

.primary-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(45deg, #c0392b, #e74c3c);
    color: white;
    font-size: 1.1rem;
    margin-bottom: 10px;
    box-shadow: 0 4px 15px rgba(192, 57, 43, 0.4);
}

.secondary-btn {
    width: 100%;
    padding: 12px;
    background: var(--glass-heavy);
    color: white;
}

/* Room Screen */
.top-bar {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    font-size: 0.9rem;
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    z-index: 10;
}

#table-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 40px 0;
}

#poker-table {
    width: 85vw;
    height: 85vw;
    max-width: 500px;
    max-height: 500px;
    background: var(--table-green);
    border: 8px solid #2e7d32;
    border-radius: 50%;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.5), 0 10px 30px rgba(0, 0, 0, 0.8);
    position: relative;
}

.table-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

#status-msg {
    font-size: 0.8rem;
    color: var(--accent);
    margin-top: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Players on table */
#players-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.player-token {
    position: absolute;
    width: 70px;
    height: 70px;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.avatar {
    width: 50px;
    height: 50px;
    background: #444;
    border-radius: 50%;
    border: 2px solid white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    position: relative;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.player-token.active .avatar {
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--accent);
}

.player-token.waiting .avatar {
    opacity: 0.5;
}

.player-token.folded .avatar {
    background: #333;
    filter: grayscale(1);
}

.player-token.lost .avatar {
    border-color: #f44336;
}

.status-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    font-size: 16px;
    font-weight: bold;
    color: white;
    z-index: 10;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    background: #e74c3c;
    /* Default red */
    border: 1px solid white;
}

.status-badge.folded {
    background: #e74c3c;
}

.status-badge.lost {
    background: #2c3e50;
    opacity: 0.9;
}

.nickname {
    background: rgba(0, 0, 0, 0.7);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    white-space: nowrap;
}

.chips {
    font-size: 0.6rem;
    color: var(--accent);
}

.status-label {
    position: absolute;
    bottom: -15px;
    font-size: 0.6rem;
    color: var(--accent);
    text-transform: uppercase;
}

/* Controls */
.bottom-bar {
    position: absolute;
    bottom: 20px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.action-btn {
    padding: 12px 15px;
    font-size: 0.9rem;
    min-width: 60px;
    background: var(--glass-heavy);
    color: white;
}

.action-btn.danger {
    background: #c0392b;
}

.action-btn.success {
    background: #27ae60;
}

.action-btn.warning {
    background: #f39c12;
}

.action-btn:disabled {
    opacity: 0.3 !important;
    filter: grayscale(1);
    pointer-events: none;
    transform: none !important;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 100;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.rules-body {
    text-align: left;
    max-height: 60vh;
    overflow-y: auto;
    margin: 20px 0;
    font-size: 0.9rem;
    line-height: 1.6;
}

.rules-body li {
    margin-bottom: 5px;
}

/* Cards */
.hand-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 110;
    justify-content: center;
    align-items: center;
}

.hand-overlay.active {
    display: flex;
}

.hand-container {
    text-align: center;
}

.cards-row {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.card {
    width: 80px;
    height: 120px;
    background: white;
    border-radius: 10px;
    color: black;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 10px;
    font-size: 1.5rem;
    font-weight: bold;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    position: relative;
}

.card .suit {
    font-size: 2rem;
    align-self: center;
}

.card.red {
    color: #d32f2f;
}

/* Animations */
@keyframes deal {
    from {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }

    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.card {
    animation: deal 0.5s ease-out;
}