/* President Card Game - Complete CSS Styles */

/* ===== Modal Options ===== */
.game-specific-options {
    margin-top: 20px;
    padding-top: 15px;
}

.options-divider {
    text-align: center;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.options-divider::before,
.options-divider::after {
    content: '';
    display: inline-block;
    width: 30px;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    vertical-align: middle;
    margin: 0 10px;
}

.toggle-selector,
.points-selector {
    display: flex;
    gap: 8px;
}

.toggle-btn,
.points-btn {
    flex: 1;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-btn:hover,
.points-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.toggle-btn.active,
.points-btn.active {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-color: transparent;
    color: white;
}

/* ===== Game Container ===== */
.president-game {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 80px);
    padding: 15px;
    padding-bottom: 100px;
    /* Space for floating buttons */
    gap: 15px;
}

/* ... existing styles ... */

/* ===== Action Area ===== */
.action-area {
    /* Empty placeholder area to keep layout flow */
    height: 1px;
}

.action-buttons {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 20, 30, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 12px 25px;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
    z-index: 1000;
    display: flex;
    justify-content: center;
    gap: 15px;
    width: auto;
    min-width: 300px;
}

.action-buttons .btn {
    min-width: 120px;
    font-size: 1rem;
    padding: 12px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}

.waiting-turn {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 12px 25px;
    background: rgba(20, 20, 30, 0.85);
    backdrop-filter: blur(12px);
    border-radius: 24px;
    color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
    width: max-content;
}

/* ===== Game Header ===== */
.president-game .game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
}

.round-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.round-label {
    font-weight: 700;
    font-size: 1.2rem;
}

.revolution-badge {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    animation: pulse-glow 1s infinite alternate;
}

@keyframes pulse-glow {
    from {
        box-shadow: 0 0 5px rgba(245, 158, 11, 0.5);
    }

    to {
        box-shadow: 0 0 20px rgba(239, 68, 68, 0.8);
    }
}

/* ===== Other Players Area ===== */
.other-players-area {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    padding: 10px 0;
}

.other-player {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    min-width: 100px;
    transition: all 0.3s ease;
    position: relative;
}

.other-player.current-turn {
    background: rgba(99, 102, 241, 0.2);
    border: 2px solid rgba(99, 102, 241, 0.6);
    transform: scale(1.05);
}

.other-player.finished {
    opacity: 0.6;
}

.player-avatar-container {
    position: relative;
    display: inline-block;
}

.spinner-hourglass {
    position: absolute;
    bottom: -8px;
    right: -8px;
    font-size: 1.4rem;
    animation: hourglass-spin 1.5s ease-in-out infinite;
    filter: drop-shadow(0 0 6px rgba(255, 193, 7, 0.8));
}

@keyframes hourglass-spin {

    0%,
    100% {
        transform: rotate(0deg);
    }

    50% {
        transform: rotate(180deg);
    }
}

.other-player .player-avatar {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    border: 3px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
}

.other-player .player-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.other-player .player-name {
    margin-top: 8px;
    font-weight: 600;
    font-size: 0.95rem;
}

.other-player .player-role {
    font-size: 1.5rem;
    margin-top: 4px;
}

.other-player .card-count {
    margin-top: 6px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.other-player .player-cards-back {
    display: flex;
    margin-top: 8px;
}

.card-back {
    width: 35px;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* ===== Play Area ===== */
.play-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    padding: 20px;
    background: radial-gradient(circle at center, #1b4d3e 0%, #0f2e23 100%);
    border-radius: 24px;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.5), 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.current-pile {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 120px;
}

.pile-card {
    width: 90px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
}

.pile-card img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.pile-cards-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.pile-play-group {
    display: flex;
    justify-content: center;
}

.pile-player-tag {
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.6);
    padding: 6px 14px;
    border-radius: 20px;
    backdrop-filter: blur(8px);
}

.pile-player-tag img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.pile-player-tag span {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

/* ===== Variants Block ===== */
.variants-block {
    padding: 12px 20px;
    margin-top: 10px;
}

.variants-title {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.variants-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.variant-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.08);
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.85rem;
    cursor: help;
    transition: background 0.2s ease;
}

.variant-item:hover {
    background: rgba(255, 255, 255, 0.15);
}

.variant-icon {
    font-size: 1rem;
}

.variant-name {
    color: rgba(255, 255, 255, 0.85);
}

/* ===== Fixed Footer (Viewport Anchored) ===== */
.fixed-footer {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 9999 !important;
    background: rgba(15, 15, 25, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 15px 20px;
    padding-bottom: max(15px, env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
}

.fixed-footer.action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.fixed-footer.waiting-turn {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

/* Portal container - fixed to viewport */
#president-fixed-footer {
    position: fixed !important;
    bottom: 20px !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    z-index: 9999 !important;
    pointer-events: auto;
    width: auto;
    max-width: calc(100% - 40px);
}

#president-fixed-footer .fixed-footer {
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    background: rgba(20, 20, 30, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 12px 25px;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.pile-info {
    margin-top: 15px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
}

/* ===== My Hand Area ===== */
.my-hand-area {
    padding: 15px 20px;
}

.hand-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.9);
}

.my-role {
    font-size: 0.9rem;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

.cards-hand {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 0;
}

.hand-card {
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    transform-origin: bottom center;
}

.hand-card img {
    width: 70px;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.hand-card:hover {
    transform: translateY(-15px);
    z-index: 10;
}

.hand-card:hover img {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.hand-card.selected {
    transform: translateY(-25px);
}

.hand-card.selected img {
    box-shadow: 0 0 0 3px #6366f1, 0 10px 25px rgba(99, 102, 241, 0.5);
}

.hand-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.hand-card.disabled:hover {
    transform: none;
}

/* ===== Emoji Card Styles ===== */
.card-emoji {
    font-size: 4rem;
    line-height: 1;
    display: block;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.3));
    transition: all 0.2s ease;
}

.hand-card:hover .card-emoji {
    filter: drop-shadow(0 8px 15px rgba(0, 0, 0, 0.4));
}

.hand-card.selected .card-emoji {
    filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.8)) drop-shadow(0 10px 20px rgba(99, 102, 241, 0.4));
}

.pile-card-emoji {
    font-size: 5rem;
    line-height: 1;
    display: inline-block;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

/* Old Action Area styles removed */

.waiting-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 3px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    overflow: hidden;
}

.waiting-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== Exchange Phase ===== */
.exchange-phase .exchange-header {
    text-align: center;
    padding: 20px;
}

.exchange-phase .exchange-header h2 {
    margin-bottom: 10px;
}

.exchange-phase .selected-info {
    text-align: center;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: 600;
}

/* ===== Vote Phase ===== */
.vote-phase {
    align-items: center;
}

.vote-phase .vote-header {
    text-align: center;
    padding: 25px;
    max-width: 500px;
}

.vote-phase .round-results {
    max-width: 400px;
    width: 100%;
    padding: 20px;
}

.vote-phase .round-results h3 {
    margin-bottom: 15px;
    text-align: center;
}

.result-row {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 10px;
    gap: 12px;
}

.result-row .position {
    font-weight: 700;
    width: 30px;
    font-size: 1.1rem;
}

.result-row .role-emoji {
    font-size: 1.6rem;
}

.result-row .player-name {
    flex: 1;
    font-weight: 600;
}

.result-row .role-name {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}

.vote-phase .vote-status {
    max-width: 300px;
    width: 100%;
    padding: 15px;
}

.vote-phase .vote-status h4 {
    margin-bottom: 10px;
    text-align: center;
}

.vote-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    margin-bottom: 6px;
}

.vote-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.waiting-votes {
    padding: 20px;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
}

/* ===== Revolution Toast ===== */
.revolution-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.7);
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    padding: 25px 50px;
    border-radius: 25px;
    font-size: 1.8rem;
    font-weight: 800;
    color: white;
    z-index: 3000;
    opacity: 0;
    transition: all 0.3s ease;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.revolution-toast.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .other-players-area {
        gap: 10px;
    }

    .other-player {
        padding: 10px 15px;
        min-width: 80px;
    }

    .other-player .player-avatar {
        width: 45px;
        height: 45px;
    }

    .hand-card img {
        width: 55px;
    }

    .pile-card {
        width: 65px;
    }

    /* Fixed positioning with strict left/right anchors for perfect centering */
    .action-buttons,
    .waiting-turn {
        position: fixed !important;
        bottom: 20px !important;
        left: 20px !important;
        right: 20px !important;
        width: auto !important;
        transform: none !important;
        flex-direction: row;
        justify-content: center;
        gap: 15px;
        padding: 12px;
        min-width: 0;
        z-index: 2000;
        /* Ensure on top */
    }

    /* Specific override for variants footer to be more compact */
    .variants-footer {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
    }

    .variants-footer .waiting-info {
        font-size: 0.9rem;
    }

    .variants-footer .variants-icons {
        margin-top: 0 !important;
        letter-spacing: 2px !important;
        white-space: nowrap;
    }

    .action-buttons .btn {
        width: 100%;
        flex: 1;
        padding: 12px 10px;
        font-size: 0.95rem;
        margin: 0;
        max-width: none;
    }
}