:root {
    /* --- THEME COLORS --- */
    --bg-dark: #21201e;       
    --bg-panel: #262522;      
    --bg-lighter: #3a3834;    
    
    --accent-green: #81b64c;  
    --accent-red: #fa412d;    
    
    --text-white: #ffffff;
    --text-grey: #9e9d9b;
    
    --felt-color: #354e41;    
    --rail-color: #1b1b1b;    
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-white);
    height: 100vh;
    display: grid;
    grid-template-columns: 70px 1fr 350px; /* Left Nav | Table | Right Panel */
    overflow: hidden;
}

body.layout-wide {
    grid-template-columns: 70px 1fr; /* Only 2 columns: Nav + Content */
}

/* =========================================
   1. LEFT NAVIGATION
   ========================================= */
#left-nav {
    background-color: var(--bg-panel);
    display: flex; flex-direction: column; align-items: center;
    padding-top: 10px; border-right: 1px solid #333; z-index: 20;
}
.nav-item {
    width: 100%; padding: 15px 0; text-align: center; color: var(--text-grey);
    cursor: pointer; transition: 0.2s; font-size: 20px; text-decoration: none; display: block;
}
.nav-item:hover { background-color: var(--bg-lighter); color: var(--text-white); }
.nav-item.active { color: white; background: var(--bg-lighter); border-left: 3px solid var(--accent-green); }
.logo { color: var(--accent-green); font-weight: bold; font-size: 24px; margin-bottom: 20px; }

/* --- MORE DROPDOWN STYLES --- */
.dropdown-container {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    left: 70px; /* Push it to the right of the sidebar */
    top: 0;
    background-color: var(--bg-panel);
    border: 1px solid #333;
    border-radius: 0 10px 10px 0;
    width: 180px;
    box-shadow: 5px 0 15px rgba(0,0,0,0.5);
    z-index: 100;
    flex-direction: column;
}

/* Show menu on hover */
.dropdown-container:hover .dropdown-menu {
    display: flex;
}

.dropdown-menu a {
    color: var(--text-grey);
    padding: 15px 20px;
    text-decoration: none;
    text-align: left;
    transition: 0.2s;
    border-bottom: 1px solid #333;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dropdown-menu a:hover {
    background-color: var(--bg-lighter);
    color: white;
}

.dropdown-menu a:last-child {
    border-bottom: none;
}

/* =========================================
   2. MAIN STAGE (GAME TABLE)
   ========================================= */
#main-stage {
    display: flex; justify-content: center; align-items: center;
    position: relative; background-color: var(--bg-dark); overflow: hidden;
}

#poker-table {
    position: relative;
    width: 1100px;            /* Increased size */
    height: 550px;            /* Increased size */
    background: var(--felt-color);
    border: 25px solid var(--rail-color); /* Thicker rail */
    border-radius: 275px;     /* Half of height for oval */
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
    display: flex; justify-content: center; align-items: center;
    transition: transform 0.3s ease;
}

/* LANDING UI (On the Felt) */
#landing-ui {
    position: absolute; z-index: 100;
    text-align: center;
    background: rgba(0,0,0,0.5);
    padding: 40px; border-radius: 30px;
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.table-input {
    background: rgba(255,255,255,0.95);
    border: none; padding: 12px 20px; border-radius: 25px;
    font-size: 16px; width: 240px; text-align: center; outline: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}
.table-input:focus { transform: scale(1.05); transition: 0.2s; }

/* RESPONSIVE SCALING */
@media (max-width: 1600px) { #poker-table { transform: scale(0.9); } }
@media (max-width: 1300px) { #poker-table { transform: scale(0.75); } }
@media (max-width: 1000px) { #poker-table { transform: scale(0.6); } }
@media (max-height: 700px) { #poker-table { transform: scale(0.7); } }

#community-area {
    display: flex; gap: 12px; height: 110px; padding: 15px;
    background: rgba(0,0,0,0.2); border-radius: 60px;
}

#pot-display {
    position: absolute; top: 25%; left: 50%; transform: translate(-50%, -50%);
    font-size: 20px; font-weight: bold; color: #f1c40f;
    background: rgba(0, 0, 0, 0.6); padding: 8px 25px;
    border-radius: 25px; border: 1px solid #f1c40f; z-index: 5;
    box-shadow: 0 0 15px rgba(241, 196, 15, 0.2);
}

/* =========================================
   3. SEATS (SYMMETRICAL 10-PLAYER LAYOUT)
   ========================================= */
.player-seat {
    position: absolute; width: 130px; text-align: center; transition: all 0.5s ease;
}

/* -- BOTTOM ROW (3 Seats) -- */
/* Seat 0 (Hero): Exact Center Bottom */
#seat-0 { bottom: -110px; left: 50%; transform: translateX(-50%); }
/* Seat 1: Bottom Left */
#seat-1 { bottom: -80px; left: 22%; }
/* Seat 9: Bottom Right */
#seat-9 { bottom: -80px; right: 22%; display: block; }

/* -- LEFT CURVE (2 Seats) -- */
/* Seat 2: Left Lower */
#seat-2 { bottom: 80px; left: -120px; }
/* Seat 3: Left Upper */
#seat-3 { top: 80px; left: -120px; }

/* -- TOP ROW (3 Seats) -- */
/* Seat 5: Exact Center Top */
#seat-5 { top: -110px; left: 50%; transform: translateX(-50%); }
/* Seat 4: Top Left */
#seat-4 { top: -80px; left: 22%; }
/* Seat 6: Top Right */
#seat-6 { top: -80px; right: 22%; }

/* -- RIGHT CURVE (2 Seats) -- */
/* Seat 7: Right Upper */
#seat-7 { top: 80px; right: -120px; }
/* Seat 8: Right Lower */
#seat-8 { bottom: 80px; right: -120px; }


/* Avatar Styling */
.avatar-wrapper { position: relative; display: inline-block; padding: 4px; border-radius: 50%; background: #222; }
.avatar-wrapper.active-turn { background: var(--accent-green); box-shadow: 0 0 20px var(--accent-green); }

.avatar {
    width: 65px; height: 65px;
    background: #444; border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    font-size: 24px; color: #ccc; border: 2px solid #333;
}

.player-info {
    background: #111; padding: 6px 10px; border-radius: 8px;
    font-size: 14px; margin-top: 5px; border: 1px solid #333;
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
    position: relative; z-index: 10;
}

.hand-container { margin-top: 5px; height: 55px; display: flex; justify-content: center; gap: 4px; }

/* Empty Seat (Sit Here) */
.empty-seat {
    width: 70px; height: 70px; margin: 0 auto;
    border: 2px dashed #555; border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    cursor: pointer; color: #888; transition: 0.2s;
    background: rgba(0,0,0,0.3); font-size: 13px; font-weight: bold;
    text-transform: uppercase;
}
.empty-seat:hover { 
    border-color: #f1c40f; color: #f1c40f; 
    background: rgba(0,0,0,0.6); transform: scale(1.1);
    box-shadow: 0 0 15px rgba(241, 196, 15, 0.3);
}

/* =========================================
   4. RIGHT PANEL
   ========================================= */
#right-panel { background-color: var(--bg-panel); display: flex; flex-direction: column; border-left: 1px solid #333; z-index: 10; }
.panel-tabs { display: flex; background: #1e1e1e; border-bottom: 1px solid #333; }
.tab { flex: 1; text-align: center; padding: 15px; color: var(--text-grey); cursor: pointer; font-weight: bold; }
.tab.active { color: var(--text-white); border-bottom: 3px solid var(--accent-green); background: var(--bg-panel); }
#game-log { flex: 1; padding: 15px; overflow-y: auto; font-size: 14px; color: var(--text-grey); font-family: monospace; }
#controls-area { padding: 20px; background: #1e1e1e; border-top: 1px solid #333; }
.action-row { display: flex; gap: 10px; margin-bottom: 10px; }

/* =========================================
   5. BUTTONS & CARDS
   ========================================= */
button {
    flex: 1; padding: 15px; border: none; border-radius: 5px;
    font-weight: bold; font-size: 16px; cursor: pointer; color: white; transition: transform 0.1s;
}
button:hover { filter: brightness(1.1); transform: translateY(-2px); }
.btn-primary { background-color: var(--accent-green); }
.btn-secondary { background-color: #3a3834; color: #ccc; }
.btn-danger { background-color: var(--accent-red); }
.btn-big { font-size: 20px; height: 60px; }

.card {
    width: 42px; height: 60px; background: white; border-radius: 5px;
    display: inline-flex; justify-content: center; align-items: center;
    font-size: 22px; color: #333; box-shadow: 1px 1px 5px rgba(0,0,0,0.3);
    font-weight: bold; margin: 0 2px;
}
.card.red { color: #d0021b; }

/* Dealer Button (White Disc) */
.dealer-btn {
    position: absolute;
    top: -10px; 
    right: -10px;
    width: 24px; 
    height: 24px;
    background: radial-gradient(#fff, #eee);
    color: #222;
    border: 1px solid #aaa;
    border-radius: 50%;
    font-weight: bold; 
    font-size: 14px;
    display: flex; 
    justify-content: center; 
    align-items: center;
    z-index: 25;
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
    pointer-events: none;
}

/* Bet Chips (Floating Badge) */
.bet-visual {
    position: absolute;
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid #f1c40f;
    color: #f1c40f;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px; 
    font-weight: bold;
    display: flex; 
    align-items: center; 
    gap: 5px;
    z-index: 20;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    white-space: nowrap;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from { transform: scale(0) translateX(-50%); opacity: 0; }
}

/* Positioning Variants based on Seat Location */
/* Bottom Seats (0, 1, 9) -> Chips appear above */
.bet-top { 
    top: -50px; 
    left: 50%; 
    transform: translateX(-50%); 
}

/* Top Seats (4, 5, 6) -> Chips appear below */
.bet-bottom { 
    bottom: -50px; 
    left: 50%; 
    transform: translateX(-50%); 
}

/* Left Seats (2, 3) -> Chips appear to the right */
.bet-right { 
    top: 50%; 
    right: -70px; 
    transform: translateY(-50%); 
}

/* Right Seats (7, 8) -> Chips appear to the left */
.bet-left { 
    top: 50%; 
    left: -70px; 
    transform: translateY(-50%); 
}

/* =========================================
   6. LESSONS & EXTRAS
   ========================================= */
#lessons-container { flex: 1; height: 100vh; overflow-y: auto; background-color: var(--bg-dark); padding: 40px; box-sizing: border-box; }
.hero-section { text-align: center; margin-bottom: 50px; animation: fadeIn 0.8s ease; }
.hero-section h1 { font-size: 48px; margin-bottom: 10px; color: var(--accent-green); }
.lesson-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; max-width: 1200px; margin: 0 auto; }
.lesson-card { background: var(--bg-panel); border: 1px solid #333; border-radius: 15px; padding: 30px; display: flex; flex-direction: column; align-items: center; text-align: center; transition: transform 0.2s; }
.lesson-card:hover { transform: translateY(-5px); border-color: var(--accent-green); }
.lesson-icon { font-size: 40px; color: var(--accent-green); margin-bottom: 20px; background: rgba(129, 182, 76, 0.1); width: 80px; height: 80px; display: flex; justify-content: center; align-items: center; border-radius: 50%; }
.lesson-info h3 { margin: 0 0 10px 0; color: white; }
.btn-start { background: var(--accent-green); color: white; border: none; padding: 10px 25px; border-radius: 20px; font-weight: bold; }
.btn-locked { background: #444; color: #888; border: none; padding: 10px 25px; border-radius: 20px; font-weight: bold; }
.lesson-card.locked { opacity: 0.6; pointer-events: none; }

/* Hand Rankings */
.lesson-header { text-align: center; margin-bottom: 40px; }
.lesson-header h1 { margin-top: 10px; color: var(--accent-green); }
.btn-back { display: inline-block; color: var(--text-grey); text-decoration: none; font-weight: bold; margin-bottom: 10px; }
.rankings-list { display: flex; flex-direction: column; gap: 15px; max-width: 800px; margin: 0 auto 50px auto; }
.ranking-row { background: var(--bg-panel); border: 1px solid #333; border-radius: 10px; padding: 20px; display: flex; align-items: center; }
.rank-number { font-size: 24px; font-weight: bold; color: var(--text-grey); width: 50px; opacity: 0.5; }
.rank-info { flex: 1; padding: 0 20px; }
.rank-info h3 { margin: 0 0 5px 0; color: white; }
.hand-example { display: flex; gap: 5px; }

/* Betting Basics */
.info-box { background: rgba(0,0,0,0.3); border-radius: 8px; overflow: hidden; margin-top: 20px; }
.info-item { padding: 15px; border-bottom: 1px solid #444; display: flex; flex-direction: column; }
.action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin-top: 20px; }
.action-card { background: #1a1a1a; border-radius: 8px; overflow: hidden; border: 1px solid #333; }
.act-header { padding: 10px; font-weight: bold; text-align: center; color: #2c3e50; text-transform: uppercase; letter-spacing: 1px; }
.act-header.check { background: #95a5a6; color: white; }
.act-header.bet { background: #f1c40f; }
.act-header.call { background: #3498db; color: white; }
.act-header.raise { background: #e67e22; color: white; }
.act-header.fold { background: #e74c3c; color: white; }
.step-list { list-style: none; padding: 0; margin-top: 20px; }
.step-list li { margin-bottom: 15px; padding-left: 20px; border-left: 3px solid var(--accent-green); color: #ddd; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.hidden { display: none !important; }
/* Room Code Display (Top Right) */
#room-info {
    position: absolute; top: 15px; right: 20px;
    background: rgba(0,0,0,0.6); padding: 5px 15px;
    border-radius: 15px; border: 1px solid #444;
    color: #aaa; font-family: monospace; font-size: 14px;
    z-index: 50; display: none; /* Hidden on landing */
}
#room-info span { color: #fff; font-weight: bold; }

/* =========================================
   8. SPECIFIC LESSON STYLES (Rankings & Betting)
   ========================================= */
.lesson-header { text-align: center; margin-bottom: 40px; }
.lesson-header h1 { margin-top: 10px; color: var(--accent-green); font-size: 36px; }
.lesson-header p { font-size: 18px; color: var(--text-grey); }

.btn-back {
    display: inline-block; color: var(--text-grey); text-decoration: none;
    font-weight: bold; margin-bottom: 10px; font-size: 14px; transition: 0.2s;
}
.btn-back:hover { color: white; transform: translateX(-5px); }

.lesson-content { max-width: 800px; margin: 0 auto 100px auto; }

.lesson-section { 
    margin-bottom: 50px; background: var(--bg-panel); padding: 30px; 
    border-radius: 10px; border: 1px solid #333; 
}
.lesson-section h2 { 
    margin-top: 0; color: white; border-bottom: 1px solid #333; 
    padding-bottom: 15px; margin-bottom: 20px; 
}
.lesson-section p { line-height: 1.6; color: #ccc; font-size: 16px; }

/* Hand Rankings Specifics */
.rankings-list {
    display: flex; flex-direction: column; gap: 15px; max-width: 800px; margin: 0 auto 50px auto;
}
.ranking-row {
    background: var(--bg-panel); border: 1px solid #333; border-radius: 10px;
    padding: 20px; display: flex; align-items: center; transition: transform 0.2s;
}
.ranking-row:hover { transform: scale(1.02); border-color: #444; background: #2a2926; }

.rank-number {
    font-size: 24px; font-weight: bold; color: var(--text-grey); width: 50px; text-align: center; opacity: 0.5;
}
.rank-info { flex: 1; padding: 0 20px; }
.rank-info h3 { margin: 0 0 5px 0; color: white; font-size: 20px; }
.rank-info p { margin: 0; color: var(--text-grey); font-size: 14px; }

.hand-example { display: flex; gap: 5px; }
.hand-example .card { flex-shrink: 0; }

/* Betting Basics Specifics */
.info-box { background: rgba(0,0,0,0.3); border-radius: 8px; overflow: hidden; margin-top: 20px; }
.info-item { padding: 15px; border-bottom: 1px solid #444; display: flex; flex-direction: column; }
.info-item:last-child { border-bottom: none; }
.info-item strong { color: var(--accent-green); margin-bottom: 5px; font-size: 18px; }
.info-item span { color: #bbb; }

.action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin-top: 20px; }
.action-card { background: #1a1a1a; border-radius: 8px; overflow: hidden; border: 1px solid #333; }
.act-header { padding: 10px; font-weight: bold; text-align: center; color: #2c3e50; text-transform: uppercase; letter-spacing: 1px; }
.action-card p { padding: 15px; font-size: 14px; margin: 0; color: #aaa; text-align: center; }

/* Action Header Colors */
.act-header.check { background: #95a5a6; color: white; }
.act-header.bet   { background: #f1c40f; }
.act-header.call  { background: #3498db; color: white; }
.act-header.raise { background: #e67e22; color: white; }
.act-header.fold  { background: #e74c3c; color: white; }

.step-list { list-style: none; padding: 0; margin-top: 20px; }
.step-list li { margin-bottom: 15px; padding-left: 20px; border-left: 3px solid var(--accent-green); color: #ddd; }
.step-list strong { color: white; display: block; margin-bottom: 5px; font-size: 18px; }