/**
 * Kaiser Card Game - Styles
 */

:root {
    --card-w: 110px;
    --card-h: 160px;
    --wood: #5d4037;
    --felt: #2d5e38;
    --primary: #2d5e38;
    --primary-hover: #3a7a4a;
    --danger: #c62828;
    --danger-light: #ffcccc;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: radial-gradient(circle, #3a6b45 0%, #19331e 100%);
    color: white;
    overflow: hidden;
    user-select: none;
    min-height: 100vh;
}

.hidden { display: none !important; }

/* ========== BUTTONS ========== */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 94, 56, 0.4);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
    border: 2px solid #ddd;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-link {
    background: none;
    border: none;
    color: #888;
    font-size: 14px;
    cursor: pointer;
    padding: 8px;
    text-decoration: underline;
}

.btn-link:hover {
    color: #666;
}

.btn-link.close-link {
    display: block;
    margin-top: 10px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.close-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ========== MODALS ========== */
.modal {
    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;
    padding: 20px;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    color: #333;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
}

/* Start Modal */
.start-content h1 {
    font-size: 36px;
    color: var(--primary);
    margin-bottom: 10px;
}

.rules-summary {
    font-size: 13px;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.name-input-group {
    margin-bottom: 20px;
    text-align: left;
}

.name-input-group label {
    display: block;
    font-size: 12px;
    color: #888;
    margin-bottom: 5px;
}

.name-input-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
}

.name-input-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.stat-item {
    background: #f5f5f5;
    padding: 10px 5px;
    border-radius: 8px;
}

.stat-item .label {
    font-size: 10px;
    color: #888;
    text-transform: uppercase;
}

.stat-item .value {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.start-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

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

/* Lobby Modal */
.lobby-content {
    max-width: 450px;
}

.lobby-subtitle {
    color: #888;
    margin-bottom: 20px;
}

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

.lobby-players {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.lobby-player {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 80px;
    align-items: center;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 8px;
    text-align: left;
    font-size: 13px;
}

.lobby-player.connected {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
}

.player-seat {
    font-weight: bold;
    color: #555;
}

.player-name {
    color: #333;
}

.player-status {
    color: #888;
}

.player-team {
    text-align: right;
    font-size: 11px;
    color: #666;
}

.waiting-msg {
    color: #888;
    font-style: italic;
    margin-bottom: 20px;
}

/* Seat Selection */
.seat-select-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.seat-select-row {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.seat-select-row.middle {
    align-items: center;
}

.table-center {
    width: 80px;
    height: 60px;
    background: var(--felt);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1px;
}

.seat-option {
    width: 100px;
    padding: 12px 10px;
    background: #f5f5f5;
    border: 2px solid #ddd;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.seat-option.available:hover {
    background: #e8f5e9;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.seat-option.taken {
    background: #f0f0f0;
    border-color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.seat-option.selecting {
    pointer-events: none;
    opacity: 0.7;
}

.seat-label {
    font-weight: bold;
    font-size: 14px;
    color: #333;
    margin-bottom: 4px;
}

.seat-team {
    font-size: 11px;
    color: #666;
    margin-bottom: 4px;
}

.seat-status {
    font-size: 11px;
    color: #888;
}

.seat-option.available .seat-status {
    color: var(--primary);
}

.seat-option.taken .seat-status {
    color: #999;
}

/* Rules Modal */
.rules-content {
    max-width: 500px;
    text-align: left;
}

.rules-content h2 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--primary);
}

.rules-section {
    margin-bottom: 20px;
}

.rules-section h3 {
    font-size: 16px;
    color: var(--primary);
    margin-bottom: 8px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.rules-section p {
    font-size: 14px;
    line-height: 1.6;
    color: #444;
    margin-bottom: 8px;
}

.rules-section ul {
    font-size: 14px;
    line-height: 1.8;
    color: #444;
    padding-left: 20px;
}

.special-card {
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
}

.special-card.hearts {
    background: #ffebee;
    color: #c62828;
}

.special-card.spades {
    background: #f5f5f5;
    color: #333;
}

.rules-content .btn-primary {
    margin-top: 20px;
}

/* Bidding Modal */
#bidding-modal {
    background: transparent;
    align-items: flex-start;
    padding-top: 280px; /* Increased to completely clear the North player */
}

.bidding-content {
    max-width: 320px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.bidding-content h2 {
    margin-bottom: 10px;
}

.bidding-content p {
    margin-bottom: 15px;
    color: #666;
}

.bid-controls button {
    margin: 3px;
    padding: 10px 14px;
    cursor: pointer;
    border: 2px solid #ddd;
    background: #f9f9f9;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.2s;
}

.bid-controls button:hover {
    background: #e0e0e0;
}

.bid-controls button.selected {
    background: #333;
    color: white;
    border-color: #333;
}

.bid-numbers {
    margin-bottom: 15px;
}

.bid-suits {
    margin-bottom: 15px;
}

.bid-suits button {
    font-size: 24px;
    width: 50px;
    height: 50px;
}

.bid-suits .suit-H,
.bid-suits .suit-D {
    color: #d00;
}

.bid-suits .suit-C,
.bid-suits .suit-S {
    color: #111;
}

.bid-suits .no-trump {
    font-size: 14px;
    font-weight: bold;
}

.pass-btn {
    width: 100%;
    background: var(--danger-light) !important;
    border-color: #e57373 !important;
    color: var(--danger) !important;
    font-weight: bold;
}

.pass-btn:hover {
    background: #ffb3b3 !important;
}

/* Game Over Modal */
.gameover-content h1 {
    font-size: 28px;
    margin-bottom: 10px;
}

.gameover-content .winner-team-a {
    color: var(--primary);
}

.gameover-content .winner-team-b {
    color: #5e2d38;
}

#final-score-text {
    font-size: 18px;
    color: #666;
    margin-bottom: 20px;
}

.gameover-content .btn-secondary {
    width: 100%;
    margin-top: 10px;
}

/* ========== GAME CONTAINER ========== */
#game-container {
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* Header */
.game-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    z-index: 100;
}

.game-title {
    font-size: 20px;
    font-weight: bold;
}

.game-subtitle {
    font-size: 11px;
    opacity: 0.7;
}

.header-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Score Board */
#score-board {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    background: rgba(0, 0, 0, 0.6);
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 14px;
    width: 90%;
    max-width: 500px;
    justify-content: space-between;
    z-index: 50;
}

.team-box {
    text-align: center;
    min-width: 100px;
}

.team-label {
    font-size: 11px;
    opacity: 0.8;
}

.score-main {
    font-size: 24px;
    font-weight: bold;
    color: gold;
}

.score-sub {
    font-size: 11px;
    opacity: 0.7;
}

.tricks-count {
    font-size: 12px;
    font-weight: bold;
    color: #ffd700;
    margin-top: 2px;
}

.info-box {
    border-left: 1px solid #555;
    border-right: 1px solid #555;
    padding: 0 15px;
    min-width: 100px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#bid-info, #trump-info {
    font-size: 13px;
}

/* Status Message */
#status-msg {
    position: absolute;
    bottom: 130px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 40;
}

/* ========== TABLE ========== */
.table {
    width: 600px;
    height: 600px;
    border-radius: 50%;
    border: 15px solid var(--wood);
    background: rgba(0, 0, 0, 0.15);
    position: relative;
    margin-top: 40px;
}

/* Seats */
.seat {
    position: absolute;
    width: 80px;
    height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.top { top: -50px; left: 50%; transform: translateX(-50%); }
.top .bubble { top: auto; bottom: -30px; } /* North bubble below avatar */
.bottom { bottom: -50px; left: 50%; transform: translateX(-50%); pointer-events: none; }
.left { left: -50px; top: 50%; transform: translateY(-50%); }
.right { right: -50px; top: 50%; transform: translateY(-50%); }

.avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 10px;
    transition: all 0.3s;
    text-align: center;
    line-height: 1.2;
    padding: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.seat.active-turn .avatar {
    border-color: gold;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

/* Disconnected player state */
.seat.disconnected .avatar {
    background: linear-gradient(135deg, #888, #666);
    border-color: #ff9800;
    box-shadow: 0 0 10px rgba(255, 152, 0, 0.5);
    animation: pulse-disconnect 2s infinite;
}

@keyframes pulse-disconnect {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.lobby-player.disconnected {
    background: #fff3e0;
    border: 1px solid #ffcc80;
}

.lobby-player.disconnected .player-status {
    color: #ff9800;
    font-weight: bold;
}

/* Penalty card highlight */
.card.special-penalty {
    background: linear-gradient(135deg, #fff 0%, #e0e0e0 100%);
    border: 2px solid #333;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
}

.bubble {
    position: absolute;
    top: -30px;
    background: white;
    color: #333;
    padding: 4px 10px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 12px;
    white-space: nowrap;
    z-index: 20;
    opacity: 0;
    transition: all 0.3s;
    transform: scale(0.8);
}

.bubble.pop-in {
    opacity: 1;
    transform: scale(1);
}

/* Trick Area */
.trick-area {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 180px;
    height: 180px;
}

.card-slot {
    position: absolute;
    width: var(--card-w);
    height: var(--card-h);
}

.card-slot .card {
    transition: opacity 0.3s ease-out;
}

.slot-0 { bottom: 0; left: 50%; transform: translateX(-50%); }
.slot-2 { top: 0; left: 50%; transform: translateX(-50%); }
.slot-1 { left: 0; top: 50%; transform: translateY(-50%) rotate(90deg); }
.slot-3 { right: 0; top: 50%; transform: translateY(-50%) rotate(-90deg); }

/* ========== CARDS ========== */
.card {
    width: var(--card-w);
    height: var(--card-h);
    background: white;
    border-radius: 6px;
    position: relative;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
    display: inline-block;
}

.card .top-corner {
    position: absolute;
    top: 6px;
    left: 6px;
    font-size: 18px;
    font-weight: bold;
}

.card .bot-corner {
    position: absolute;
    bottom: 6px;
    right: 6px;
    font-size: 18px;
    font-weight: bold;
    transform: rotate(180deg);
}

.card .center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 42px;
}

.card.suit-H, .card.suit-D { color: #d00; }
.card.suit-C, .card.suit-S { color: #111; }

.card.special-kaiser.suit-H {
    background: linear-gradient(135deg, #fff 0%, #ffe0e0 100%);
    border: 2px solid #d00;
}

.card.special-kaiser.suit-S {
    background: linear-gradient(135deg, #fff 0%, #e0e0e0 100%);
    border: 2px solid #333;
}

/* Winning card highlight */
.card.winning-card {
    box-shadow: 0 0 15px 5px rgba(255, 215, 0, 0.8), 0 0 30px 10px rgba(255, 215, 0, 0.4);
    border: 2px solid gold;
    z-index: 5;
}

/* Hand */
.my-hand-container {
    position: absolute;
    bottom: 20px;
    width: 100%;
    display: flex;
    justify-content: center;
    pointer-events: auto;
    z-index: 30;
}

.hand {
    display: flex;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
}

.hand .card {
    margin-left: 8px;
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out, opacity 0.2s ease-out;
    cursor: default;
}

.hand .card:first-child { margin-left: 0; }

.hand .card.playable {
    cursor: pointer;
}

.hand .card.playable:hover {
    transform: translateY(-20px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    z-index: 10;
}

/* Animation Layer */
#animation-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 500;
}

.flying-card {
    position: absolute;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.4s ease-out;
    will-change: transform, opacity;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 700px) {
    .table {
        width: 90vw;
        height: 90vw;
        max-width: 400px;
        max-height: 400px;
        border-width: 8px;
        margin-top: 60px;
    }

    :root {
        --card-w: 90px;
        --card-h: 130px;
    }

    .card .center { font-size: 32px; }
    .card .top-corner, .card .bot-corner { font-size: 14px; }

    .trick-area { width: 130px; height: 130px; }

    .seat { width: 60px; height: 60px; }
    .avatar { width: 40px; height: 40px; font-size: 9px; }

    .top { top: -35px; }
    .bottom { bottom: -35px; }
    .left { left: -35px; }
    .right { right: -35px; }

    .hand .card { margin-left: 4px; }

    #score-board {
        font-size: 12px;
        padding: 6px 10px;
    }

    .score-main { font-size: 18px; }

    .my-hand-container {
        bottom: 10px;
    }

    .hand {
        padding: 8px 12px;
        overflow-x: auto;
        max-width: 95vw;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .modal-content {
        padding: 20px;
    }

    .rules-content {
        font-size: 13px;
    }

    .lobby-player {
        grid-template-columns: 1fr 1fr;
        gap: 5px;
    }

    .player-status, .player-team {
        font-size: 11px;
    }
}

/* ========== Phone (< 500px) ========== */
@media (max-width: 500px) {
    html, body {
        height: 100%;
        overflow: hidden;
    }

    :root {
        --card-w: 60px;
        --card-h: 85px;
    }

    .table {
        width: 95vw;
        height: 55vw;
        max-width: 320px;
        max-height: 200px;
        border-width: 6px;
        margin-top: 40px;
    }

    .card .center { font-size: 24px; }
    .card .top-corner, .card .bot-corner { font-size: 11px; }

    .trick-area {
        width: 100px;
        height: 100px;
    }

    .card-slot {
        width: 50px;
        height: 70px;
    }

    .seat { width: 45px; height: 45px; }
    .avatar { width: 32px; height: 32px; font-size: 8px; }

    .top { top: -28px; }
    .bottom { bottom: -28px; }
    .left { left: -28px; }
    .right { right: -28px; }

    .hand .card { margin-left: 2px; }

    /* Fix mobile viewport issues */
    #game-container {
        height: 100%;
        min-height: -webkit-fill-available;
    }

    .my-hand-container {
        position: fixed;
        bottom: 10px;
        left: 0;
        right: 0;
        z-index: 40;
    }

    .hand {
        padding: 6px 8px;
        max-width: 98vw;
        margin: 0 auto;
        -webkit-overflow-scrolling: touch;
    }

    #score-board {
        font-size: 10px;
        padding: 4px 8px;
        top: 5px;
        left: 5px;
    }

    .score-main { font-size: 14px; }

    #status-msg {
        bottom: auto;
        top: 5px;
        right: 5px;
        left: auto;
        transform: none;
        font-size: 11px;
        padding: 4px 10px;
    }

    /* Bidding modal - top sheet so cards stay visible */
    #bidding-modal {
        align-items: flex-start;
        padding-top: 10px;
    }

    #bidding-modal .modal-content {
        position: relative;
        width: 95%;
        max-width: 100%;
        border-radius: 12px;
        padding: 12px;
        max-height: 50vh;
        overflow-y: auto;
    }

    #bidding-modal h2 {
        font-size: 14px;
        margin-bottom: 6px;
    }

    #bidding-modal p {
        font-size: 12px;
        margin-bottom: 8px;
    }

    .bid-numbers {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
        margin-bottom: 10px;
    }

    .bid-numbers button {
        min-width: 44px;
        min-height: 44px;
        font-size: 16px;
        padding: 8px;
    }

    .bid-suits {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 6px;
        margin-bottom: 10px;
    }

    .bid-suits button {
        min-width: 44px;
        min-height: 44px;
        font-size: 20px;
        padding: 8px;
    }

    .pass-btn {
        width: 100%;
        min-height: 44px;
        font-size: 16px;
    }

    /* Game over modal */
    #gameover-modal .modal-content {
        width: 90vw;
        padding: 20px;
    }

    #gameover-modal h1 {
        font-size: 20px;
    }

    /* Lobby adjustments */
    .lobby-container {
        padding: 10px;
    }

    .lobby-header h1 {
        font-size: 20px;
    }

    .lobby-actions {
        flex-direction: column;
        gap: 8px;
    }

    .lobby-actions button {
        width: 100%;
        min-height: 44px;
    }

    .room-card {
        padding: 10px;
    }

    /* Emote picker */
    #emote-picker {
        bottom: 10px;
        right: 10px;
    }

    .emote-toggle {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .emote-menu {
        grid-template-columns: repeat(4, 1fr);
    }

    .emote-btn {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
}

/* ========== Emote Picker ========== */
#emote-picker {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
}

.emote-toggle {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.3);
    font-size: 22px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emote-toggle:hover {
    background: rgba(0, 0, 0, 0.85);
    transform: scale(1.1);
}

.emote-menu {
    position: absolute;
    bottom: 55px;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    border-radius: 12px;
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.emote-menu.hidden {
    display: none;
}

.emote-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    font-size: 22px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.15s;
}

.emote-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.15);
}

/* Player emote bubbles near seats */
.player-emote {
    position: absolute;
    font-size: 32px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 14px;
    padding: 6px 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    z-index: 50;
}

.player-emote.visible {
    opacity: 1;
    transform: scale(1);
}

/* ========== Pause Overlay ========== */
.pause-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: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.pause-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.pause-content {
    text-align: center;
    color: white;
    animation: pulse-pause 2s infinite ease-in-out;
}

.pause-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.pause-title {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 10px;
}

.pause-message {
    font-size: 18px;
    opacity: 0.8;
}

#pause-player-name {
    font-weight: bold;
    color: #ffd700;
}

@keyframes pulse-pause {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.02); opacity: 0.9; }
}

/* Away player state */
.seat.away .avatar {
    background: linear-gradient(135deg, #999, #777);
    border-color: #ff5722;
    box-shadow: 0 0 15px rgba(255, 87, 34, 0.5);
    animation: pulse-away 1.5s infinite;
}

@keyframes pulse-away {
    0%, 100% { opacity: 1; box-shadow: 0 0 15px rgba(255, 87, 34, 0.5); }
    50% { opacity: 0.7; box-shadow: 0 0 25px rgba(255, 87, 34, 0.7); }
}

.lobby-player.away {
    background: #fff8e1;
    border: 1px solid #ffcc80;
}

.lobby-player.away .player-status {
    color: #ff5722;
    font-weight: bold;
}
