/* ============================================
   COUP ONLINE - Enhanced Styles
   ============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg-dark: #0f0f1a;
    --bg-card: #1a1a2e;
    --bg-panel: rgba(255,255,255,0.03);
    --table-green: #0d5c2e;
    --table-border: #8b4513;
    --gold: #ffd700;
    --gold-dark: #b8860b;
    --red: #e94560;
    --red-dark: #c23a51;
    --blue: #3498db;
    --green: #27ae60;
    --text: #e0e0e0;
    --text-dim: #888;
    --border: rgba(255,255,255,0.1);
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-card) 50%, #16213e 100%);
    min-height: 100vh;
    color: var(--text);
}

.screen { min-height: 100vh; }
.hidden { display: none !important; }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    transition: all 0.2s;
    letter-spacing: 0.5px;
}
.btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.4); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn-primary { background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%); color: white; }
.btn-secondary { background: var(--bg-panel); color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: linear-gradient(135deg, #dc3545 0%, #c82333 100%); color: white; }
.btn-small { padding: 6px 12px; font-size: 11px; }
.btn-large { padding: 16px 32px; font-size: 16px; }
.btn-text { background: none; color: var(--text-dim); text-decoration: underline; padding: 8px; }
.btn-icon { padding: 8px 12px; font-size: 16px; }
.btn-cancel { margin-top: 15px; }

.btn-action {
    background: linear-gradient(135deg, #2d2d44 0%, var(--bg-card) 100%);
    color: var(--text);
    border: 1px solid var(--border);
    width: 100%;
    padding: 10px 12px;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-transform: none;
}
.btn-action:hover:not(:disabled) { border-color: var(--gold); }
.btn-action.btn-character { border-left: 3px solid var(--gold); }
.action-name { font-weight: 600; }
.action-desc { color: var(--gold); font-size: 11px; }

/* ============================================
   CONNECT SCREEN
   ============================================ */
#connect-screen { display: flex; justify-content: center; align-items: center; padding: 20px; }
.connect-container { text-align: center; max-width: 450px; width: 100%; }
.connect-container h1 { 
    font-size: 72px; 
    color: var(--red); 
    text-shadow: 0 0 30px rgba(233,69,96,0.5); 
    letter-spacing: 20px; 
    margin-bottom: 5px; 
}
.subtitle { color: var(--text-dim); font-style: italic; margin-bottom: 25px; }

.connect-cards-preview { display: flex; justify-content: center; gap: 8px; margin-bottom: 25px; }
.preview-card { 
    width: 60px; height: 84px; 
    border-radius: 6px; overflow: hidden; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.4);
    animation: cardFloat 3s ease-in-out infinite;
    animation-delay: calc(var(--delay) * 0.15s);
}
.preview-card img { width: 100%; height: 100%; object-fit: cover; }
@keyframes cardFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

.connect-form { background: var(--bg-panel); padding: 25px; border-radius: 16px; border: 1px solid rgba(233,69,96,0.2); }
.form-group { margin-bottom: 15px; text-align: left; }
.form-group label { display: block; margin-bottom: 6px; color: #ccd6f6; font-size: 13px; }
.form-group input, .join-section input { 
    width: 100%; padding: 12px; 
    border: 1px solid var(--border); 
    border-radius: 8px; 
    background: rgba(15,15,26,0.8); 
    color: var(--text); font-size: 16px; 
}
.form-group input:focus, .join-section input:focus { outline: none; border-color: var(--red); }

.connect-options { display: flex; flex-direction: column; gap: 12px; }
.divider { text-align: center; color: #666; position: relative; margin: 5px 0; }
.divider span { background: var(--bg-card); padding: 0 12px; position: relative; z-index: 1; font-size: 12px; }
.divider::before { content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: #333; }
.join-section { display: flex; gap: 10px; }
.join-section input { flex: 1; text-align: center; letter-spacing: 4px; text-transform: uppercase; }

.connect-links { margin-top: 15px; display: flex; justify-content: center; gap: 20px; }

.create-room-section { width: 100%; }
.password-option { margin-bottom: 10px; }
.password-toggle { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    cursor: pointer; 
    font-size: 13px; 
    color: var(--text-dim);
    margin-bottom: 8px;
}
.password-toggle input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--gold); }
#create-password, #room-password { 
    width: 100%; 
    padding: 10px; 
    border: 1px solid var(--gold); 
    border-radius: 6px; 
    background: rgba(255,215,0,0.1); 
    color: var(--text); 
    font-size: 14px; 
    margin-bottom: 8px;
}
.password-section { margin-top: 8px; }

.error-message { 
    margin-top: 15px; padding: 10px; 
    background: rgba(220,53,69,0.2); 
    border: 1px solid rgba(220,53,69,0.5); 
    border-radius: 8px; color: #dc3545; 
}

/* ============================================
   LOBBY
   ============================================ */
.lobby-container { max-width: 600px; margin: 0 auto; padding: 40px 20px; }
.lobby-header { text-align: center; margin-bottom: 30px; }
.lobby-header h2 { color: var(--red); font-size: 28px; margin-bottom: 8px; }
#room-code-display { color: var(--gold); letter-spacing: 8px; font-size: 32px; }
.share-text { color: var(--text-dim); font-size: 14px; }

.lobby-main { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 25px; }

.players-lobby, .lobby-settings { 
    background: var(--bg-panel); 
    border-radius: 12px; 
    padding: 20px; 
    border: 1px solid var(--border); 
}
.players-lobby h3, .lobby-settings h3 { 
    color: var(--red); margin-bottom: 15px; 
    font-size: 13px; text-transform: uppercase; letter-spacing: 1px; 
}

.lobby-player { 
    display: flex; align-items: center; gap: 10px; 
    padding: 10px; background: rgba(0,0,0,0.3); 
    border-radius: 8px; margin-bottom: 8px; 
}
.lobby-player.is-me { border: 1px solid var(--green); }
.lobby-player.is-bot { border: 1px solid var(--blue); opacity: 0.85; }
.player-number { 
    width: 26px; height: 26px; 
    background: var(--red); border-radius: 50%; 
    display: flex; align-items: center; justify-content: center; 
    font-weight: bold; font-size: 12px; 
}
.player-name { flex: 1; font-size: 14px; }
.host-badge { background: var(--gold); color: #000; padding: 2px 6px; border-radius: 4px; font-size: 9px; font-weight: bold; }
.you-badge { background: var(--green); color: #fff; padding: 2px 6px; border-radius: 4px; font-size: 9px; font-weight: bold; }
.remove-bot-btn { 
    background: none; border: none; color: #dc3545; 
    cursor: pointer; font-size: 18px; padding: 0 5px; 
}

.add-bot-section { display: flex; gap: 8px; margin-top: 12px; }
.add-bot-section select { 
    flex: 1; padding: 8px; border-radius: 6px; 
    background: rgba(0,0,0,0.3); color: var(--text); 
    border: 1px solid var(--border); 
}

.setting-item { 
    display: flex; align-items: center; gap: 10px; 
    padding: 8px 0; cursor: pointer; font-size: 14px; 
}
.setting-item input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--red); }
#tournament-games-setting { margin-left: 28px; margin-top: 5px; }
#tournament-games-setting select { 
    padding: 5px; background: rgba(0,0,0,0.3); 
    color: var(--text); border: 1px solid var(--border); border-radius: 4px; 
}

.lobby-buttons { display: flex; gap: 15px; justify-content: center; margin-bottom: 15px; }
.waiting-text { color: var(--text-dim); font-style: italic; text-align: center; }

/* ============================================
   GAME SCREEN
   ============================================ */
#game-screen { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

.game-header { 
    display: flex; justify-content: space-between; align-items: center; 
    padding: 8px 20px; background: rgba(0,0,0,0.4); 
    border-bottom: 1px solid rgba(233,69,96,0.2); 
}
.header-left { display: flex; align-items: center; gap: 15px; }
.header-left h2 { color: var(--red); letter-spacing: 6px; font-size: 18px; }
.room-info { color: var(--text-dim); font-size: 12px; }
.header-center { flex: 1; text-align: center; }
#status-text { color: var(--gold); font-size: 14px; font-weight: 500; }
.header-right { display: flex; align-items: center; gap: 10px; }
.tournament-info { font-size: 11px; color: var(--gold); background: rgba(255,215,0,0.1); padding: 4px 10px; border-radius: 4px; }

.timer-bar { 
    width: 200px; height: 4px; 
    background: rgba(255,255,255,0.1); 
    border-radius: 2px; margin: 6px auto 0; 
}
.timer-fill { 
    height: 100%; background: var(--green); 
    border-radius: 2px; transition: width 1s linear; 
}
.timer-fill.timer-warning { background: var(--red); }

.game-main { display: flex; flex: 1; overflow: hidden; }

/* ============================================
   SIDE PANELS
   ============================================ */
.side-panel { 
    width: 240px; background: rgba(0,0,0,0.3); 
    padding: 12px; display: flex; flex-direction: column; gap: 12px; 
    overflow-y: auto; 
}
.side-panel h3 { 
    color: var(--red); font-size: 10px; 
    text-transform: uppercase; letter-spacing: 2px; 
    margin-bottom: 8px; padding-bottom: 5px; 
    border-bottom: 1px solid rgba(233,69,96,0.3); 
}

.your-hand-section, .actions-section, .emotes-section, .log-section, .chat-section, .spectators-section {
    background: var(--bg-panel);
    border-radius: 10px;
    padding: 12px;
    border: 1px solid var(--border);
}

#your-cards { display: flex; gap: 8px; margin-bottom: 10px; justify-content: center; }
.hand-card { 
    width: 70px; height: 98px; 
    border-radius: 6px; overflow: hidden; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    position: relative;
}
.hand-card img { width: 100%; height: 100%; object-fit: cover; }
.hand-card .card-name { 
    position: absolute; bottom: 0; left: 0; right: 0; 
    background: rgba(0,0,0,0.7); color: white; 
    font-size: 9px; text-align: center; padding: 2px; 
}

.your-coins { 
    display: flex; align-items: center; justify-content: center; gap: 10px; 
    padding: 8px; background: linear-gradient(135deg, rgba(255,215,0,0.1) 0%, rgba(184,134,11,0.1) 100%); 
    border-radius: 6px; border: 1px solid rgba(255,215,0,0.3); 
}
.coin-stack { display: flex; }
.coin-stack .coin { 
    width: 16px; height: 16px; 
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%); 
    border-radius: 50%; margin-left: -4px; border: 1px solid #8b6914; 
}
.coin-stack .coin:first-child { margin-left: 0; }
#coin-count { font-size: 22px; font-weight: bold; color: var(--gold); }

.actions-section { flex: 1; }
#action-buttons { display: flex; flex-direction: column; gap: 5px; }
.action-divider { height: 1px; background: var(--border); margin: 5px 0; }
.must-coup-warning { 
    background: rgba(220,53,69,0.2); border: 1px solid rgba(220,53,69,0.5); 
    border-radius: 6px; padding: 6px; text-align: center; 
    color: #dc3545; font-size: 11px; margin-top: 8px; 
}

.emotes-section { min-height: auto; }
#emote-buttons { display: flex; flex-wrap: wrap; gap: 5px; }
.emote-btn { 
    font-size: 20px; padding: 5px 8px; 
    background: rgba(255,255,255,0.05); border: 1px solid var(--border); 
    border-radius: 6px; cursor: pointer; transition: transform 0.1s; 
}
.emote-btn:hover { transform: scale(1.2); }

.log-section { flex: 1; min-height: 100px; }
#event-log { max-height: 180px; overflow-y: auto; font-size: 11px; line-height: 1.4; }
.log-entry { padding: 4px 6px; border-radius: 3px; margin-bottom: 2px; }
.log-turn { color: var(--text-dim); font-weight: 500; background: rgba(255,255,255,0.03); }
.log-challenge { color: #f39c12; border-left: 2px solid #f39c12; }
.log-block { color: var(--blue); border-left: 2px solid var(--blue); }
.log-result { color: var(--green); }
.log-reveal { color: #e74c3c; }
.log-elimination { color: #dc3545; font-weight: 600; background: rgba(220,53,69,0.1); }
.log-winner { color: var(--gold); font-weight: 600; background: rgba(255,215,0,0.1); }
.log-achievement { color: #9b59b6; }
.log-emote { color: var(--text-dim); font-size: 10px; }

.spectators-section { min-height: auto; }
#spectator-list { font-size: 11px; color: var(--text-dim); }

.pending-spectators-list { margin-top: 8px; }
.pending-label { color: var(--gold); font-size: 10px; display: block; margin-bottom: 5px; }
.pending-spectator-item { 
    display: flex; 
    align-items: center; 
    gap: 6px; 
    padding: 4px 6px; 
    background: rgba(255,215,0,0.1); 
    border-radius: 4px; 
    margin-bottom: 4px;
    font-size: 11px;
}
.pending-spectator-item span { flex: 1; }
.btn-approve-small, .btn-reject-small {
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-approve-small { background: var(--green); color: white; }
.btn-reject-small { background: #e74c3c; color: white; }
.btn-approve-small:hover { background: #2ecc71; }
.btn-reject-small:hover { background: #c0392b; }
.spectator-name { color: var(--text); }

.pending-spectators-list {
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px solid var(--border);
}

.pending-label {
    color: var(--gold);
    font-weight: 500;
}

.pending-spectator {
    color: var(--text-dim);
    font-style: italic;
}

.chat-section { max-height: 180px; }
#chat-messages { max-height: 100px; overflow-y: auto; font-size: 11px; margin-bottom: 8px; }
.chat-message { padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.chat-input { display: flex; gap: 5px; }
.chat-input input { 
    flex: 1; padding: 6px 8px; 
    border: 1px solid var(--border); border-radius: 4px; 
    background: rgba(0,0,0,0.3); color: var(--text); font-size: 11px; 
}

.spectator-text, .eliminated-text { color: var(--text-dim); font-style: italic; text-align: center; padding: 10px; }

/* ============================================
   TABLE
   ============================================ */
.table-area { flex: 1; display: flex; justify-content: center; align-items: center; padding: 15px; position: relative; }
.poker-table { position: relative; width: 100%; max-width: 550px; aspect-ratio: 1.4; }
.table-surface { 
    position: absolute; top: 50%; left: 50%; 
    transform: translate(-50%, -50%); 
    width: 80%; height: 65%; 
    background: linear-gradient(135deg, #0a4d25 0%, var(--table-green) 50%, #0a4d25 100%); 
    border-radius: 50%; 
    border: 10px solid var(--table-border); 
    box-shadow: inset 0 0 40px rgba(0,0,0,0.5), 0 8px 30px rgba(0,0,0,0.6); 
    display: flex; justify-content: center; align-items: center; 
}

.deck-pile { position: relative; display: flex; flex-direction: column; align-items: center; }
.deck-pile span { color: rgba(255,255,255,0.4); font-size: 10px; margin-top: 65px; }
.deck-card { 
    width: 38px; height: 53px; 
    background: linear-gradient(135deg, #2d2d44 0%, var(--bg-card) 100%); 
    border: 1px solid #444; border-radius: 4px; 
    position: absolute; 
}
.deck-card:nth-child(1) { transform: rotate(-4deg); }
.deck-card:nth-child(2) { transform: rotate(0deg) translate(2px, -2px); }
.deck-card:nth-child(3) { transform: rotate(4deg) translate(4px, -4px); }

/* ============================================
   PLAYER SEATS
   ============================================ */
#table-seats { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
.player-seat { 
    position: absolute; pointer-events: auto; 
    display: flex; flex-direction: column; align-items: center; 
    transform: translate(-50%, -50%); transition: all 0.3s; 
}
.player-seat.active .seat-info { box-shadow: 0 0 20px rgba(233,69,96,0.7); border-color: var(--red); }
.player-seat.eliminated { opacity: 0.35; }
.player-seat.is-me .seat-info { border-color: var(--green); }

.seat-cards { display: flex; gap: 3px; margin-bottom: 5px; }
.seat-card { 
    width: 32px; height: 45px; 
    border-radius: 4px; overflow: hidden; 
    box-shadow: 0 2px 6px rgba(0,0,0,0.4); 
}
.seat-card img { width: 100%; height: 100%; object-fit: cover; }
.seat-card.face-down { 
    background: linear-gradient(135deg, #2d2d44 0%, var(--bg-card) 100%); 
    border: 1px solid #444; 
}
.seat-card.revealed { filter: grayscale(70%) brightness(0.5); }

.seat-info { 
    background: rgba(0,0,0,0.9); border-radius: 8px; 
    padding: 6px 10px; text-align: center; 
    border: 2px solid var(--border); min-width: 90px; 
}
.seat-name { font-weight: 600; font-size: 11px; margin-bottom: 3px; }
.bot-badge { font-size: 8px; background: var(--blue); color: white; padding: 1px 4px; border-radius: 3px; margin-left: 4px; }
.you-badge-small { font-size: 8px; background: var(--green); color: white; padding: 1px 4px; border-radius: 3px; margin-left: 4px; }
.seat-coins { display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 12px; color: var(--gold); }
.coin-icon-small { 
    width: 12px; height: 12px; 
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%); 
    border-radius: 50%; 
}

.seat-claims { display: flex; gap: 2px; justify-content: center; margin-top: 4px; }
.claim-icon { width: 18px; height: 25px; border-radius: 2px; border: 1px solid var(--gold); }

/* ============================================
   FLOATING EMOTES
   ============================================ */
#floating-emotes { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 100; }
.floating-emote { 
    position: absolute; font-size: 40px; 
    animation: floatUp 2s ease-out forwards; 
    pointer-events: none; 
}
@keyframes floatUp {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-80px) scale(1.5); }
}

/* ============================================
   MODALS
   ============================================ */
.modal-overlay { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(0,0,0,0.85); 
    display: flex; justify-content: center; align-items: center; 
    z-index: 1000; 
}
.modal-content { 
    background: linear-gradient(135deg, var(--bg-card) 0%, #16213e 100%); 
    border: 2px solid var(--red); border-radius: 16px; 
    padding: 25px; max-width: 500px; width: 90%; 
    text-align: center; position: relative; max-height: 85vh; overflow-y: auto; 
}
.modal-content h2 { color: var(--red); margin-bottom: 20px; }
.modal-content h3 { color: var(--gold); margin-bottom: 12px; font-size: 18px; }
.modal-content p { color: #ccd6f6; margin-bottom: 15px; }
.close-btn { 
    position: absolute; top: 12px; right: 15px; 
    background: none; border: none; color: var(--text-dim); 
    font-size: 26px; cursor: pointer; 
}
.close-btn:hover { color: var(--text); }

.response-modal-content { max-width: 400px; }
.response-buttons { display: flex; flex-direction: column; gap: 10px; }
.block-buttons { gap: 8px; }

.target-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 15px; }
.target-btn { 
    background: var(--bg-panel); border: 2px solid var(--border); 
    padding: 12px; border-radius: 8px; cursor: pointer; 
    color: var(--text); transition: all 0.2s; 
}
.target-btn:hover { border-color: var(--red); background: rgba(233,69,96,0.1); }
.target-name { font-weight: 600; font-size: 14px; display: block; }
.target-stats { font-size: 11px; color: var(--text-dim); margin-top: 4px; display: block; }

.card-selection-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 15px 0; }
.card-select-option { 
    width: 70px; cursor: pointer; transition: all 0.2s; 
    border: 3px solid transparent; border-radius: 8px; padding: 5px; 
    background: rgba(255,255,255,0.05); 
}
.card-select-option:hover { transform: scale(1.05); }
.card-select-option.selected { border-color: var(--green); background: rgba(39,174,96,0.2); }
.card-select-option img { width: 100%; height: 85px; object-fit: cover; border-radius: 4px; }
.card-select-option span { display: block; font-size: 10px; margin-top: 4px; }
.exchange-info { font-size: 14px; margin-bottom: 10px; }

/* ============================================
   RULES MODAL
   ============================================ */
.rules-content { max-width: 650px; text-align: left; }
.rules-tabs { display: flex; gap: 10px; margin-bottom: 20px; justify-content: center; }
.rules-tab { 
    padding: 8px 16px; background: var(--bg-panel); border: 1px solid var(--border); 
    border-radius: 6px; cursor: pointer; color: var(--text-dim); font-size: 13px; 
}
.rules-tab.active { background: var(--red); color: white; border-color: var(--red); }

.rules-tab-content h4 { color: var(--gold); margin: 15px 0 8px; }
.rules-tab-content p, .rules-tab-content li { color: #ccd6f6; line-height: 1.6; font-size: 13px; }
.rules-tab-content ul { margin-left: 20px; }

.rules-cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.rules-card-item { 
    display: flex; gap: 10px; background: rgba(0,0,0,0.3); 
    padding: 10px; border-radius: 8px; align-items: center; 
}
.rules-card-item img { width: 45px; height: 63px; border-radius: 4px; object-fit: cover; }
.rules-card-info { display: flex; flex-direction: column; gap: 2px; }
.rules-card-info strong { color: var(--text); font-size: 13px; }
.rules-card-info span { color: var(--text-dim); font-size: 11px; }

/* ============================================
   LEADERBOARD & STATS
   ============================================ */
.leaderboard-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.leaderboard-table th, .leaderboard-table td { padding: 10px; text-align: left; border-bottom: 1px solid var(--border); }
.leaderboard-table th { color: var(--gold); font-size: 12px; }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-top: 15px; }
.stat-item { text-align: center; padding: 15px; background: var(--bg-panel); border-radius: 8px; }
.stat-value { display: block; font-size: 28px; font-weight: bold; color: var(--gold); }
.stat-label { display: block; font-size: 11px; color: var(--text-dim); margin-top: 5px; }

/* ============================================
   WINNER MODAL
   ============================================ */
.winner-content { text-align: center; padding: 20px; }
.winner-crown { font-size: 80px; animation: bounce 1s infinite; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-15px); } }
.winner-content h1 { font-size: 36px; color: var(--gold); margin: 15px 0; text-shadow: 0 0 20px rgba(255,215,0,0.5); }

#winner-achievements { margin: 20px 0; }
#winner-achievements h3 { color: var(--text-dim); font-size: 14px; margin-bottom: 10px; }
.achievement { 
    display: inline-block; background: rgba(155,89,182,0.2); 
    border: 1px solid rgba(155,89,182,0.5); 
    padding: 6px 12px; border-radius: 20px; margin: 4px; font-size: 13px; 
}

#tournament-standings { margin: 20px 0; text-align: left; padding: 15px; background: var(--bg-panel); border-radius: 8px; }
#tournament-standings h3 { color: var(--gold); margin-bottom: 10px; font-size: 14px; }
.standing { padding: 5px 0; }

.winner-buttons { margin-top: 25px; display: flex; gap: 15px; justify-content: center; }

/* ============================================
   LIAR ANIMATION
   ============================================ */
.liar-overlay { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(220,53,69,0.3); 
    display: flex; justify-content: center; align-items: center; 
    z-index: 2000; animation: flashRed 0.3s ease-in-out 3; 
}
.liar-text { 
    font-size: 100px; font-weight: bold; color: white; 
    text-shadow: 0 0 50px rgba(220,53,69,1); 
    animation: scaleIn 0.3s ease-out; 
}
@keyframes flashRed { 0%, 100% { background: rgba(220,53,69,0.1); } 50% { background: rgba(220,53,69,0.4); } }
@keyframes scaleIn { 0% { transform: scale(0.5); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
::-webkit-scrollbar-thumb { background: #533483; border-radius: 3px; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
    .game-main { flex-direction: column; }
    .side-panel { width: 100%; flex-direction: row; flex-wrap: wrap; padding: 8px; gap: 8px; max-height: none; }
    .left-panel { order: 2; }
    .table-area { order: 1; min-height: 300px; flex: none; }
    .right-panel { order: 3; }
    .your-hand-section, .actions-section, .emotes-section { flex: 1; min-width: 150px; }
    .log-section, .chat-section { flex: 1; min-width: 200px; }
    #action-buttons { flex-direction: row; flex-wrap: wrap; }
    .btn-action { width: auto; flex: 1; min-width: 90px; font-size: 10px; padding: 8px; }
    .lobby-main { grid-template-columns: 1fr; }
}

@media (max-width: 500px) {
    .connect-container h1 { font-size: 48px; letter-spacing: 10px; }
    .preview-card { width: 45px; height: 63px; }
    .target-grid { grid-template-columns: 1fr; }
}

/* ============================================
   THEMES
   ============================================ */
.theme-selector {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-toggle-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    border: 2px solid var(--border);
    cursor: pointer;
    font-size: 20px;
    transition: transform 0.2s;
}
.theme-toggle-btn:hover { transform: scale(1.1); }

.theme-options {
    display: flex;
    gap: 5px;
    background: rgba(0,0,0,0.8);
    padding: 8px;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.theme-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    background: rgba(255,255,255,0.1);
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}
.theme-btn:hover { transform: scale(1.15); }
.theme-btn.active { border-color: var(--gold); box-shadow: 0 0 10px var(--gold); }

.sound-toggle {
    position: fixed;
    bottom: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    border: 2px solid var(--border);
    cursor: pointer;
    font-size: 18px;
    z-index: 500;
    transition: transform 0.2s;
}
.sound-toggle:hover { transform: scale(1.1); }
.sound-toggle.muted { opacity: 0.5; }

/* Theme: Midnight */
body.theme-midnight {
    --bg-dark: #0a0a14;
    --bg-card: #12121f;
    --table-green: #1a1a3a;
    --table-border: #4a4a8a;
    --red: #6366f1;
    --red-dark: #4f46e5;
    --gold: #a5b4fc;
}
body.theme-midnight .table-surface {
    background: linear-gradient(135deg, #0f0f2a 0%, #1a1a3a 50%, #0f0f2a 100%);
    border-color: #4a4a8a;
}

/* Theme: Royal */
body.theme-royal {
    --bg-dark: #1a0a1a;
    --bg-card: #2d1a2d;
    --table-green: #3d1a3d;
    --table-border: #9d4edd;
    --red: #c77dff;
    --red-dark: #9d4edd;
    --gold: #ffd700;
}
body.theme-royal .table-surface {
    background: linear-gradient(135deg, #2d0a2d 0%, #4a1a4a 50%, #2d0a2d 100%);
    border-color: #9d4edd;
}

/* Theme: Neon */
body.theme-neon {
    --bg-dark: #0a0a0a;
    --bg-card: #1a1a1a;
    --table-green: #0d1a0d;
    --table-border: #00ff88;
    --red: #ff006e;
    --red-dark: #d1004f;
    --gold: #00ff88;
}
body.theme-neon .table-surface {
    background: linear-gradient(135deg, #0a1a0a 0%, #0d2a0d 50%, #0a1a0a 100%);
    border-color: #00ff88;
    box-shadow: inset 0 0 40px rgba(0,255,136,0.2), 0 0 30px rgba(0,255,136,0.3);
}
body.theme-neon .player-seat.active .seat-info {
    box-shadow: 0 0 25px rgba(255,0,110,0.8);
}

/* Theme: Nature */
body.theme-nature {
    --bg-dark: #1a2e1a;
    --bg-card: #2d4a2d;
    --table-green: #2d5a2d;
    --table-border: #8b5a2b;
    --red: #dc8850;
    --red-dark: #c4723a;
    --gold: #f4d03f;
}
body.theme-nature .table-surface {
    background: linear-gradient(135deg, #1a4a1a 0%, #2d6a2d 50%, #1a4a1a 100%);
    border-color: #8b5a2b;
}

/* ============================================
   PENDING SPECTATOR OVERLAY
   ============================================ */
.pending-spectator-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

.pending-content {
    text-align: center;
    color: var(--text);
}

.pending-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top-color: var(--gold);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.pending-content h2 {
    color: var(--gold);
    margin-bottom: 10px;
}

.pending-content p {
    color: var(--text-dim);
    margin-bottom: 20px;
}

/* ============================================
   SPECTATOR REQUEST NOTIFICATIONS (HOST)
   ============================================ */
.spectator-requests {
    position: fixed;
    top: 60px;
    right: 10px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 280px;
}

.spectator-request-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, #1a2744 100%);
    border: 2px solid var(--gold);
    border-radius: 12px;
    padding: 15px;
    animation: slideIn 0.3s ease-out;
    box-shadow: 0 5px 20px rgba(0,0,0,0.4);
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.spectator-request-card h4 {
    color: var(--gold);
    margin-bottom: 5px;
    font-size: 13px;
}

.spectator-request-card p {
    color: var(--text);
    margin-bottom: 12px;
    font-size: 14px;
}

.spectator-request-card .request-name {
    font-weight: bold;
    color: var(--text);
}

.spectator-request-buttons {
    display: flex;
    gap: 10px;
}

.spectator-request-buttons .btn {
    flex: 1;
    padding: 8px;
    font-size: 12px;
}

.btn-approve {
    background: linear-gradient(135deg, var(--green) 0%, #1e8449 100%);
    color: white;
    border: none;
}

.btn-reject {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
}

/* ============================================
   CONFETTI CANVAS
   ============================================ */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* ============================================
   CARD REVEAL ANIMATION
   ============================================ */
.card-reveal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.reveal-card-container {
    text-align: center;
}

.reveal-card {
    width: 150px;
    height: 210px;
    perspective: 1000px;
    margin: 0 auto 20px;
}

.reveal-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    animation: cardFlip 1s ease-in-out forwards;
}

@keyframes cardFlip {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(180deg); }
}

.reveal-card-front, .reveal-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.reveal-card-front {
    background: linear-gradient(135deg, #2d2d44 0%, var(--bg-card) 100%);
    border: 2px solid #444;
}

.reveal-card-back {
    transform: rotateY(180deg);
    overflow: hidden;
}

.reveal-card-back img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.reveal-player-name {
    font-size: 24px;
    color: var(--gold);
    font-weight: bold;
    animation: fadeInUp 0.5s ease-out 0.5s both;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   ENHANCED ANIMATIONS
   ============================================ */
/* Coin animation */
@keyframes coinBounce {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-10px) rotate(90deg); }
    50% { transform: translateY(0) rotate(180deg); }
    75% { transform: translateY(-5px) rotate(270deg); }
}

.coin-animate {
    animation: coinBounce 0.6s ease-in-out;
}

/* Steal animation */
@keyframes stealShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.steal-animate {
    animation: stealShake 0.3s ease-in-out 3;
}

/* Assassination animation */
@keyframes assassinPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220,53,69,0.7); }
    50% { box-shadow: 0 0 30px 15px rgba(220,53,69,0); }
}

.assassin-animate {
    animation: assassinPulse 0.5s ease-out 2;
}

/* Challenge animation */
@keyframes challengeFlash {
    0%, 50%, 100% { background: rgba(243,156,18,0.1); }
    25%, 75% { background: rgba(243,156,18,0.4); }
}

.challenge-animate {
    animation: challengeFlash 0.5s ease-in-out 2;
}

/* Block animation */
@keyframes blockShield {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

.block-animate::after {
    content: '🛡️';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 60px;
    animation: blockShield 0.5s ease-out;
    pointer-events: none;
}

/* Winner glow */
.winner-glow {
    animation: winnerPulse 1s ease-in-out infinite;
}

@keyframes winnerPulse {
    0%, 100% { box-shadow: 0 0 20px var(--gold); }
    50% { box-shadow: 0 0 40px var(--gold), 0 0 60px var(--gold); }
}

/* Card dealt animation */
@keyframes dealCard {
    0% { transform: translate(-50%, -50%) scale(0) rotate(-180deg); opacity: 0; }
    100% { transform: translate(0, 0) scale(1) rotate(0deg); opacity: 1; }
}

.deal-animate {
    animation: dealCard 0.5s ease-out forwards;
}

/* Elimination animation */
@keyframes eliminateShake {
    0%, 100% { transform: translateX(0) rotate(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px) rotate(-1deg); }
    20%, 40%, 60%, 80% { transform: translateX(5px) rotate(1deg); }
}

.eliminate-animate {
    animation: eliminateShake 0.5s ease-in-out;
}

/* Turn indicator pulse */
.turn-pulse {
    animation: turnPulse 1.5s ease-in-out infinite;
}

@keyframes turnPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.02); }
}

/* Floating coins animation */
@keyframes floatCoin {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(-60px) scale(0.5); opacity: 0; }
}

.floating-coin {
    position: absolute;
    font-size: 24px;
    animation: floatCoin 1s ease-out forwards;
    pointer-events: none;
}

/* Action button hover glow */
.btn-action:not(:disabled):hover {
    box-shadow: 0 0 15px rgba(255,215,0,0.3);
}

/* Card hover effect */
.hand-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.hand-card:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 12px 25px rgba(0,0,0,0.5);
}

/* Seat card hover */
.seat-card {
    transition: transform 0.2s;
}

.player-seat:not(.eliminated) .seat-card:hover {
    transform: scale(1.1);
    z-index: 10;
}

/* Response modal entrance */
.response-modal-content {
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Winner modal special effects */
.winner-content {
    animation: winnerEntrance 0.8s ease-out;
}

@keyframes winnerEntrance {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* ============================================
   SPECTATOR APPROVAL UI
   ============================================ */
.spectator-requests {
    position: fixed;
    top: 60px;
    right: 20px;
    z-index: 600;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 300px;
}

.spectator-request {
    background: rgba(0,0,0,0.9);
    border: 2px solid var(--gold);
    border-radius: 12px;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideInRight 0.3s ease-out;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.request-icon {
    font-size: 24px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.request-text {
    flex: 1;
    font-size: 13px;
    color: var(--text);
}

.request-buttons {
    display: flex;
    gap: 5px;
}

.request-buttons .btn {
    padding: 5px 10px;
    font-size: 14px;
}

/* Pending spectator overlay */
#pending-spectator-overlay .modal-content {
    max-width: 350px;
}

.pending-spinner {
    font-size: 60px;
    animation: pendingSpin 2s ease-in-out infinite;
    margin-bottom: 15px;
}

@keyframes pendingSpin {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.1) rotate(-10deg); }
    75% { transform: scale(1.1) rotate(10deg); }
}

.pending-subtext {
    color: var(--text-dim);
    font-size: 12px;
    margin-top: 10px;
}

/* ============================================
   PROFILE MODAL
   ============================================ */
.profile-content {
    background: var(--panel);
    border: 2px solid var(--gold);
    border-radius: 16px;
    padding: 25px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text);
    font-size: 28px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.modal-close:hover { opacity: 1; }

.profile-section {
    margin-bottom: 25px;
}

.profile-section h3 {
    color: var(--gold);
    margin-bottom: 12px;
    font-size: 16px;
}

.avatar-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 8px;
}

.avatar-option {
    width: 40px;
    height: 40px;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.avatar-option:hover {
    background: rgba(255,215,0,0.1);
    transform: scale(1.1);
}

.avatar-option.selected {
    border-color: var(--gold);
    background: rgba(255,215,0,0.2);
}

.cardback-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.cardback-option {
    padding: 15px 10px;
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    position: relative;
}

.cardback-option:hover {
    border-color: rgba(255,215,0,0.5);
}

.cardback-option.selected {
    border-color: var(--gold);
    background: rgba(255,215,0,0.1);
}

.cardback-option.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.cardback-option.locked::after {
    content: '🔒';
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 14px;
}

.cardback-preview {
    width: 50px;
    height: 70px;
    margin: 0 auto 8px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.2);
}

.cardback-name {
    font-size: 12px;
    color: var(--text);
}

.cardback-condition {
    font-size: 10px;
    color: var(--text-dim);
    margin-top: 4px;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.stat-item {
    background: rgba(255,255,255,0.05);
    padding: 12px;
    border-radius: 8px;
    text-align: center;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: var(--gold);
}

.stat-label {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 4px;
}

/* ============================================
   ELIMINATION ANIMATION
   ============================================ */
.elimination-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(139, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: eliminationFade 2s ease-out forwards;
}

@keyframes eliminationFade {
    0% { opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

.elimination-content {
    text-align: center;
    animation: eliminationShake 0.5s ease-out;
}

@keyframes eliminationShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

.elimination-skull {
    font-size: 100px;
    animation: skullPulse 0.5s ease-out infinite;
}

@keyframes skullPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.elimination-name {
    font-size: 36px;
    color: white;
    margin: 20px 0 10px;
    text-shadow: 2px 2px 4px black;
}

.elimination-text {
    font-size: 48px;
    color: #ff4444;
    font-weight: bold;
    text-shadow: 0 0 20px #ff0000;
    animation: eliminationText 0.5s ease-out;
}

@keyframes eliminationText {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); opacity: 1; }
}

/* ============================================
   WINNER AVATAR & UNLOCKS
   ============================================ */
.winner-avatar {
    font-size: 60px;
    margin: 10px 0;
}

.unlocked-rewards {
    background: linear-gradient(135deg, rgba(255,215,0,0.2), rgba(255,165,0,0.2));
    border: 1px solid var(--gold);
    border-radius: 10px;
    padding: 15px;
    margin: 15px 0;
}

.unlocked-rewards h3 {
    color: var(--gold);
    margin-bottom: 10px;
    font-size: 14px;
}

.unlock-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: rgba(0,0,0,0.2);
    border-radius: 6px;
    margin-top: 8px;
}

.unlock-preview {
    width: 30px;
    height: 42px;
    border-radius: 4px;
    border: 1px solid var(--gold);
}

.unlock-name {
    color: var(--text);
    font-size: 13px;
}

/* ============================================
   PLAYER SEAT AVATAR
   ============================================ */
.player-avatar {
    font-size: 28px;
    margin-bottom: 5px;
}

.player-avatar-small {
    font-size: 20px;
    margin-right: 5px;
}

/* ============================================
   BTN SUCCESS (green)
   ============================================ */
.btn-success {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #218838, #1abc9c);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

/* Share section in lobby */
.share-section {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}
