/* /public/css/uno/game.css */

:root {
    --bg-color: #0f172a;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --uno-red: #ef4444;
    --uno-blue: #3b82f6;
    --uno-green: #22c55e;
    --uno-yellow: #eab308;
    --uno-wild: #8b5cf6;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

.game-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 80px);
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    padding-top: 5rem;
    gap: 1rem;
}

.player-panel {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    position: relative;
}

.my-panel {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    width: auto;
    max-width: 300px;
    padding: 0.75rem 1.25rem;
    z-index: 50;
}

.my-panel .turn-indicator {
    display: none;
}

.player-panel.active {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.15);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.4),
                inset 0 0 20px rgba(59, 130, 246, 0.1);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.3),
                    inset 0 0 15px rgba(59, 130, 246, 0.1);
    }
    50% {
        box-shadow: 0 0 40px rgba(59, 130, 246, 0.6),
                    inset 0 0 25px rgba(59, 130, 246, 0.2);
    }
}

.panel-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.player-avatar {
    font-size: 2.5rem;
    width: 3.5rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.player-panel.active .player-avatar {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
    animation: bounce-subtle 1s ease-in-out infinite;
}

@keyframes bounce-subtle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.player-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.player-panel .player-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.card-count {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.turn-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 2rem;
    opacity: 0.4;
    transition: all 0.3s ease;
}

.player-panel.active .turn-indicator {
    opacity: 1;
    background: rgba(59, 130, 246, 0.3);
}

.turn-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-secondary);
    transition: all 0.3s ease;
}

.player-panel.active .turn-dot {
    background: #3b82f6;
    animation: blink 1.5s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.turn-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.player-panel.active .turn-text {
    color: #3b82f6;
}

.game-board {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 0;
    padding: 1rem 0;
}

.opponent-hand {
    display: flex;
    justify-content: center;
    gap: 5px;
    padding: 1rem 0;
    min-height: 80px;
}

.card-back {
    width: 50px;
    height: 75px;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.table-area {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    padding: 2rem 0;
}

.deck-area, .discard-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.deck-pile {
    width: 100px;
    height: 150px;
    position: relative;
}

.deck-card {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #334155, #1e293b);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    transition: all 0.2s ease;
}

.deck-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 25px -5px rgba(0, 0, 0, 0.6);
    border-color: rgba(255,255,255,0.5);
}

.deck-card:active {
    transform: translateY(-2px) scale(0.98);
    transition: transform 0.1s ease;
}

.deck-text {
    font-weight: bold;
    font-size: 1.2rem;
    color: rgba(255,255,255,0.3);
    transform: rotate(-15deg);
}

.deck-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.discard-pile {
    width: 100px;
    height: 150px;
    position: relative;
}

.current-color {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(30, 41, 59, 0.8);
    border-radius: 2rem;
    border: 1px solid rgba(255,255,255,0.2);
}

.color-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.color-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.3);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.my-hand {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    min-height: 160px;
    gap: 10px;
    flex-wrap: wrap;
    padding: 1rem 0;
}

.uno-card {
    width: 90px;
    height: 135px;
    border-radius: 12px;
    border: 4px solid white;
    box-shadow: 0 6px 12px rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    user-select: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.2s ease;
    cursor: pointer;
    background: white;
}

.uno-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.6);
    z-index: 10;
}

.uno-card.uno-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(60%);
}

.uno-card.uno-disabled:hover {
    transform: none;
    box-shadow: 0 6px 12px rgba(0,0,0,0.4);
}

.uno-red { background: var(--uno-red); }
.uno-blue { background: var(--uno-blue); }
.uno-green { background: var(--uno-green); }
.uno-yellow { background: var(--uno-yellow); }
.uno-wild {
    background: linear-gradient(135deg,
        var(--uno-red) 0%,
        var(--uno-blue) 33%,
        var(--uno-green) 66%,
        var(--uno-yellow) 100%
    );
}

.card-inner {
    width: 85%;
    height: 85%;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.card-val {
    font-size: 2.5rem;
    font-weight: 900;
    color: #1e293b;
}

.flying-card {
    will-change: transform, left, top;
}

.flying-card .uno-card {
    margin: 0;
    box-shadow: 0 15px 35px rgba(0,0,0,0.5);
}

.card-back-style {
    background: linear-gradient(135deg, #334155, #1e293b);
    border: 4px solid white;
    border-radius: 12px;
    width: 100%;
    height: 100%;
    box-shadow: 0 6px 12px rgba(0,0,0,0.4);
}

.card-back-style .card-inner {
    background: linear-gradient(135deg, #1e293b, #0f172a);
}

.my-turn .deck-card {
    animation: deck-pulse 2s ease-in-out infinite;
}

@keyframes deck-pulse {
    0%, 100% {
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
        border-color: rgba(255,255,255,0.3);
    }
    50% {
        box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.5),
                    0 0 20px rgba(59, 130, 246, 0.3);
        border-color: rgba(59, 130, 246, 0.6);
    }
}

.status-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    padding: 2rem 3rem;
    border-radius: 1rem;
    border: 2px solid rgba(255,255,255,0.2);
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    z-index: 100;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.status-toast.show {
    transform: translate(-50%, -50%) scale(1);
}

.color-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(20px);
    padding: 2.5rem;
    border-radius: 1.5rem;
    border: 2px solid rgba(255,255,255,0.2);
    box-shadow: 0 25px 50px rgba(0,0,0,0.8);
    z-index: 1000;
    text-align: center;
}

.color-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.color-btn {
    width: 100px;
    height: 100px;
    border: 4px solid white;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 6px 15px rgba(0,0,0,0.4);
}

.color-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 25px rgba(0,0,0,0.6);
}

.color-btn:active {
    transform: scale(1.05);
}

.waiting-room {
    max-width: 600px;
    margin: 3rem auto;
    padding: 2rem;
    text-align: center;
}

.waiting-room h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(to right, var(--uno-red), var(--uno-yellow));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.waiting-room .player-card {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 1.5rem;
    margin: 1rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.waiting-room .player-name {
    font-size: 1.25rem;
    font-weight: 700;
}

.status-badge {
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.9rem;
    font-weight: 700;
}

.status-ready {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 2px solid #22c55e;
}

.status-waiting {
    background: rgba(234, 179, 8, 0.2);
    color: #eab308;
    border: 2px solid #eab308;
}

.btn-ready {
    margin-top: 2rem;
    padding: 1rem 3rem;
    font-size: 1.2rem;
    border: none;
    border-radius: 3rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 700;
    text-transform: uppercase;
}

.btn-ready.not-ready {
    background: var(--uno-green);
    color: white;
}

.btn-ready.is-ready {
    background: var(--text-secondary);
    color: white;
}

.btn-ready:hover {
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .game-container {
        padding: 0.5rem;
        padding-top: 5rem;
        gap: 0.5rem;
        padding-bottom: 6rem;
    }

    .game-board {
        padding: 0.5rem 0;
    }

    .player-panel {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    .my-panel {
        bottom: 0.5rem;
        left: 0.5rem;
        max-width: 250px;
        padding: 0.5rem 1rem;
    }

    .player-avatar {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.5rem;
    }

    .my-panel .player-avatar {
        width: 2rem;
        height: 2rem;
        font-size: 1.25rem;
    }

    .player-panel .player-name {
        font-size: 1rem;
    }

    .my-panel .player-name {
        font-size: 0.9rem;
    }

    .table-area {
        gap: 1.5rem;
        padding: 1rem 0;
    }

    .deck-pile, .discard-pile {
        width: 70px;
        height: 105px;
    }

    .uno-card {
        width: 70px;
        height: 105px;
    }

    .my-hand {
        gap: 5px;
        min-height: 120px;
        padding: 0.5rem 0;
        margin-bottom: 0.5rem;
    }

    .color-btn {
        width: 80px;
        height: 80px;
    }
}
