* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #0b0c10;
    color: #c5c6c7;
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.hidden { display: none !important; }

/* --- Modals & Overlays --- */
.overlay-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(11, 12, 16, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 20px;
}

.modal-box {
    background: #1f2833;
    border: 2px solid #66fcf1;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    max-width: 450px;
    width: 100%;
    box-shadow: 0 0 25px rgba(102, 252, 241, 0.25);
}

.modal-box.wide { max-width: 950px; max-height: 90vh; overflow-y: auto; }

.modal-box h1, .modal-box h2 {
    color: #66fcf1;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.modal-box p { color: #c5c6c7; margin-bottom: 20px; }

.modal-box input[type="text"],
.modal-box input[type="email"] {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border-radius: 6px;
    border: 1px solid #45a29e;
    background: #0b0c10;
    color: #fff;
    font-size: 16px;
    text-align: center;
    outline: none;
}

.modal-box input[type="text"]:focus,
.modal-box input[type="email"]:focus {
    border-color: #66fcf1;
    box-shadow: 0 0 8px rgba(102, 252, 241, 0.5);
}

.timer-prompt { font-size: 1.1rem; color: #f39c12; }

/* --- Announcement & Showdown Overlays --- */
.announcement-overlay {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    pointer-events: none;
}

.announcement-box {
    background: rgba(15, 23, 42, 0.95);
    border: 2px solid #38bdf8;
    border-radius: 10px;
    padding: 15px 30px;
    text-align: center;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.5);
    animation: slideDown 0.3s ease-out;
}

.announcement-box.spike { border-color: #f59e0b; box-shadow: 0 0 25px rgba(245, 158, 11, 0.6); }
.announcement-box.elimination { border-color: #ef4444; box-shadow: 0 0 25px rgba(239, 68, 68, 0.6); }

.announcement-box h1 { font-size: 1.4rem; color: #fff; margin-bottom: 5px; }
.announcement-box p { font-size: 0.95rem; color: #cbd5e1; }

@keyframes slideDown {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.showdown-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(11, 12, 16, 0.95);
    border: 3px solid #f1c40f;
    border-radius: 16px;
    padding: 20px;
    z-index: 2000;
    text-align: center;
    box-shadow: 0 0 35px rgba(241, 196, 15, 0.6);
    min-width: 280px;
}

.showdown-overlay h3 { color: #f1c40f; font-size: 1.3rem; margin-bottom: 5px; }
.showdown-hand-title { color: #2ecc71; font-weight: bold; font-size: 1.1rem; margin-bottom: 12px; }

.showdown-cards-container {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 10px 0;
}

.showdown-credits-payout {
    color: #3498db;
    font-weight: bold;
    font-size: 1.1rem;
    margin-top: 8px;
}

/* --- Buttons --- */
.btn {
    background: #45a29e;
    color: #0b0c10;
    border: none;
    padding: 12px 20px;
    font-weight: bold;
    font-size: 13px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-transform: uppercase;
}

.btn:hover:not(:disabled) {
    background: #66fcf1;
    box-shadow: 0 0 12px rgba(102, 252, 241, 0.6);
    transform: translateY(-2px);
}

.btn:disabled { background: #444; color: #888; cursor: not-allowed; border-color: #555; }
.btn-danger { background: #c93b3b; color: #fff; }
.btn-danger:hover:not(:disabled) { background: #ff4d4d; box-shadow: 0 0 12px rgba(255, 77, 77, 0.6); }
.btn-ante { background: #f39c12; color: #000; }
.btn-ante:hover:not(:disabled) { background: #f1c40f; box-shadow: 0 0 12px rgba(241, 196, 15, 0.6); }

.btn-blood { background: #b33939; color: #fff; }
.btn-blood:hover:not(:disabled) { background: #ff5252; box-shadow: 0 0 12px rgba(255, 82, 82, 0.6); }

.btn-sand { background: #cd6133; color: #fff; }
.btn-sand:hover:not(:disabled) { background: #ff793f; box-shadow: 0 0 12px rgba(255, 121, 63, 0.6); }

/* --- Lobby Grid --- */
.lobby-section-title { color: #f39c12; text-align: left; font-size: 16px; border-bottom: 1px solid #333; padding-bottom: 5px; }

.table-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.table-card {
    background: #0b0c10;
    border: 1px solid #45a29e;
    border-radius: 8px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    transition: border-color 0.2s, transform 0.2s;
}

.table-card.table-kessel { border-color: #d000ff; }
.table-card.table-traditional { border-color: #f1c40f; }
.table-card:hover { border-color: #66fcf1; transform: translateY(-3px); }
.table-card h3 { color: #fff; font-size: 16px; }
.table-card p { color: #8892b0; font-size: 13px; }

/* --- Game Surface & Header --- */
#game-screen { display: flex; flex-direction: column; min-height: 100vh; }

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: #1f2833;
    border-bottom: 2px solid #45a29e;
}

.header-left { display: flex; align-items: center; gap: 20px; }
.header-right { display: flex; gap: 12px; }

.info-pill {
    background: #0b0c10;
    border: 1px solid #45a29e;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    color: #c5c6c7;
}

.info-pill strong { color: #66fcf1; }

.sabacc-table {
    width: 90%;
    max-width: 1100px;
    height: 520px;
    margin: 40px auto 20px auto;
    border-radius: 220px;
    border: 14px solid #2c3e50;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.85);
    transition: background-color 0.4s ease, border-color 0.4s ease;
}

/* Corellian & Kessel Table Felt Color Variations */
.felt-nar-shaddaa { background-color: #3a3311; border-color: #d4af37; }
.felt-ord-mantell { background-color: #113a1a; border-color: #27ae60; }
.felt-coruscant   { background-color: #11223a; border-color: #2980b9; }
.felt-bespin      { background-color: #3a1111; border-color: #c0392b; }
.felt-numidian-prime { background-color: #3a2211; border-color: #e67e22; }
.felt-kijimi      { background-color: #2a2a2a; border-color: #bdc3c7; }

.felt-mirogana   { background-color: #2b0033; border-color: #d000ff; }
.felt-tatooine   { background-color: #4a2500; border-color: #ffaa00; }
.felt-myrra      { background-color: #003333; border-color: #00ffff; }
.felt-canto-bight {
    background: radial-gradient(circle, #4a0011 0%, #1a0005 100%);
    border: 8px solid #ffcc00;
}

/* Spectator Lounge */
.spectator-lounge {
    position: absolute;
    top: -33px;
    left: -15px;
    background: rgba(11, 12, 16, 0.85);
    border: 1px solid #45a29e;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.85rem;
    color: #c5c6c7;
    z-index: 10;
}

.spectator-lounge h4 { color: #66fcf1; margin-bottom: 5px; font-size: 0.9rem; }

/* Center Hub */
.center-hub {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    z-index: 5;
}

.card-slot-container { display: flex; gap: 15px; }

.card-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.slot-label { font-size: 11px; text-transform: uppercase; color: #8892b0; letter-spacing: 1px; }

.phase-display { text-align: center; }
#phase-text { font-size: 18px; font-weight: bold; color: #66fcf1; letter-spacing: 2px; }
#round-text { font-size: 13px; color: #8892b0; }

/* --- 6-SIDED TRADITIONAL SABACC CARDS --- */
.sabacc-card {
    width: 44px;
    height: 58px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 12px;
    cursor: pointer;
    user-select: none;
    transition: transform 0.15s, filter 0.15s;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    padding: 2px 4px;
    position: relative;
    border: none;
}

.sabacc-card.face-down {
    background: linear-gradient(135deg, #111, #333);
    border: 1px solid #555;
}

.sabacc-card.empty {
    background: transparent;
    border: 1px dashed #555;
    color: #555;
    justify-content: center;
    clip-path: none;
    border-radius: 6px;
}

.sabacc-card.selected {
    transform: translateY(-8px) scale(1.08);
    box-shadow: 0 0 15px #66fcf1;
}

.card-val { font-size: 16px; margin-top: 2px; }
.card-suit { display: flex; align-items: center; justify-content: center; margin-bottom: 2px; }
.suit-icon { width: 14px; height: 14px; }

/* --- Corellian Table-Specific Card Color Schemes --- */

/* Nar Shaddaa: Light Gold #f39c12 / Dark Amber #784e00 */
.felt-nar-shaddaa .card-positive { background-color: #f39c12; color: #000; }
.felt-nar-shaddaa .card-negative { background-color: #784e00; color: #fff; }

/* Ord Mantell: Light Mint #2ecc71 / Dark Forest #145a32 */
.felt-ord-mantell .card-positive { background-color: #2ecc71; color: #000; }
.felt-ord-mantell .card-negative { background-color: #145a32; color: #fff; }

/* Coruscant: Light Cyan #3498db / Dark Sapphire #1b4f72 */
.felt-coruscant .card-positive { background-color: #3498db; color: #000; }
.felt-coruscant .card-negative { background-color: #1b4f72; color: #fff; }

/* Bespin: Light Rose #e74c3c / Dark Crimson #641e16 */
.felt-bespin .card-positive { background-color: #e74c3c; color: #fff; }
.felt-bespin .card-negative { background-color: #641e16; color: #fff; }

/* Numidian Prime: Light Peach #e67e22 / Dark Rust #7e3d0f */
.felt-numidian-prime .card-positive { background-color: #e67e22; color: #000; }
.felt-numidian-prime .card-negative { background-color: #7e3d0f; color: #fff; }

/* Kijimi: Light Silver #ecf0f1 / Dark Slate #34495e */
.felt-kijimi .card-positive { background-color: #ecf0f1; color: #000; }
.felt-kijimi .card-negative { background-color: #34495e; color: #fff; }

/* Fallback Corellian Card Colors */
.card-positive { background-color: #27ae60; color: #fff; }
.card-negative { background-color: #c0392b; color: #fff; }

/* --- Kessel Rules Card Themes --- */
.card-blood { background-color: #c0392b; color: #fff; }
.card-sand  { background-color: #f1c40f; color: #000; }

/* --- Seats & Player Positioning --- */
.seat-box {
    position: absolute;
    width: 120px;
    background: rgba(31, 40, 51, 0.9);
    border: 2px solid #45a29e;
    border-radius: 10px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
}

.seat-box.active-turn {
    border-color: #66fcf1;
    box-shadow: 0 0 15px #66fcf1;
}

.player-name { font-weight: bold; color: #fff; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100px; }
.player-chips { color: #f39c12; font-weight: bold; }
.player-status { font-size: 9px; text-transform: uppercase; color: #2ecc71; }
.player-status.status-allin { color: #e74c3c; font-weight: bold; }
.player-score { font-size: 10px; color: #3498db; font-weight: bold; }
.player-hand { display: flex; gap: 3px; margin-top: 2px; }

.used-tokens-container {
    display: flex;
    gap: 2px;
    position: absolute;
    top: -12px;
    right: 5px;
    background: #0b0c10;
    border: 1px solid #f39c12;
    border-radius: 8px;
    padding: 1px 4px;
}

/* Corellian 8-Seat Positions */
.seat-0 { bottom: -25px; left: 50%; transform: translateX(-50%); }
.seat-1 { bottom: 20px; left: 15%; }
.seat-2 { top: 50%; left: -35px; transform: translateY(-50%); }
.seat-3 { top: 20px; left: 15%; }
.seat-4 { top: -25px; left: 50%; transform: translateX(-50%); }
.seat-5 { top: 20px; right: 15%; }
.seat-6 { top: 50%; right: -35px; transform: translateY(-50%); }
.seat-7 { bottom: 20px; right: 15%; }

/* Kessel 4-Seat Positions */
.seat-kessel-0 { bottom: -25px; left: 50%; transform: translateX(-50%); }
.seat-kessel-1 { top: 50%; left: -35px; transform: translateY(-50%); }
.seat-kessel-2 { top: -25px; left: 50%; transform: translateX(-50%); }
.seat-kessel-3 { top: 50%; right: -35px; transform: translateY(-50%); }

/* --- Footer Controls & Log --- */
.controls-footer {
    display: flex;
    justify-content: center;
    padding: 15px;
    background: #1f2833;
    border-top: 1px solid #333;
}

.action-group { display: flex; gap: 10px; }

.log-container {
    background: #0b0c10;
    height: 100px;
    border-top: 1px solid #1f2833;
    padding: 10px 20px;
    overflow-y: auto;
	display: flex;
    flex-direction: column-reverse;
}

#game-log { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.log-entry { color: #c5c6c7; }
.log-entry.allin { color: #e74c3c; font-weight: bold; }
.log-entry.info { color: #3498db; }

/* --- Traditional Sabacc & Stasis Card Field Display --- */
.stasis-container {
    margin-top: 5px;
    padding: 3px;
    border: 1px dashed #00ffff;
    background-color: rgba(0, 255, 255, 0.1);
    border-radius: 4px;
    display: flex;
    gap: 4px;
    align-items: center;
}