/* Uno Game Styles */
#uno-game-area {
    display: flex;
    flex-direction: column;
    width: 100vw !important;
    /* Force full width */
    max-width: none !important;
    /* Remove container limit */
    padding: 0 !important;
    /* Remove container padding */
    height: 100vh;
    overflow: hidden;
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
    font-family: 'Outfit', sans-serif;
    position: fixed;
    /* Ensure it overlays everything */
    top: 0;
    left: 0;
    z-index: 50;
    /* Above normal content */
}

#uno-game-area header {
    display: none !important;
    /* Force hide to clear space */
}

#uno-board {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
    overflow: hidden;
}

/* Center Pile */
/* Center Pile - Fixed Position Center */
.center-pile {
    position: absolute;
    top: 40%;
    /* Moved up to clear player hand */
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 1rem;
    z-index: 5;
    pointer-events: none;
    /* Allow clicking through if needed, but piles have pointer-events auto */
}

/* Pile Interaction Fix */
.deck-pile,
.discard-pile {
    pointer-events: auto;
}

.deck-pile,
.discard-pile {
    width: 90px;
    height: 135px;
    border-radius: 10px;
    position: relative;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s;
}

.deck-pile {
    background: url('https://www.transparenttextures.com/patterns/cubes.png'), linear-gradient(135deg, #333, #000);
    border: 2px solid #555;
    cursor: pointer;
}

.deck-pile:hover {
    /* Only hover effect if it's your turn? handled via logic mostly */
    transform: scale(1.05);
}

.deck-pile.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.deck-pile.active {
    box-shadow: 0 0 25px rgba(34, 197, 94, 0.6), 0 10px 20px rgba(0, 0, 0, 0.5);
    border-color: #22c55e;
    animation: deckPulse 1.5s infinite;
}

@keyframes deckPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* "KART Ã‡EK" Label on Deck */
.deck-label {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #f59e0b;
    font-weight: bold;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
    pointer-events: none;
}


/* Player Areas */
.player-area {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.5s ease;
}

.player-score {
    background: rgba(15, 23, 42, 0.9);
    color: white;
    padding: 0.8rem 1.2rem;
    border-radius: 16px;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    text-align: center;
    min-width: 120px;
}

.p-info {
    font-weight: bold;
    margin-bottom: 4px;
    display: block;
}

.p-count {
    color: #cbd5e1;
    font-size: 0.9rem;
}

.player-bottom .player-score {
    position: absolute;
    top: -60px;
    /* Float above hand */
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
}

.current-turn {
    box-shadow: 0 0 15px rgba(255, 255, 0, 0.5);
    border-color: rgba(255, 255, 0, 0.8);
}

/* Positioning */
/* Positioning - Pushing deeper to edges */
.player-bottom {
    bottom: 0px;
    left: 0;
    width: 100%;
    height: auto;
    background: rgba(0, 0, 0, 0.4);
    /* subtle background for hand dock */
    padding-bottom: 2rem;
    padding-top: 1rem;
    z-index: 20;
    /* High z-index for user interaction */
    backdrop-filter: blur(5px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Opponent Areas - Compact Badges Only */
.player-top {
    top: 20px;
    transform: none;
    /* No rotation for text readability */
}

.player-left {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    align-items: flex-start;
}

.player-right {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    align-items: flex-end;
}

/* Turn Status Display */
#turn-status-display {
    position: absolute;
    top: 60px;
    /* Below color indicator */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.8);
    padding: 0.5rem 1.5rem;
    border-radius: 30px;
    color: white;
    font-size: 1.1rem;
    font-weight: bold;
    z-index: 40;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    transition: all 0.3s ease;
}

#turn-status-display.my-turn-active {
    background: rgba(34, 197, 94, 0.9);
    /* Green for me */
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.4);
    transform: translateX(-50%) scale(1.1);
}

/* Hand Styles */
.hand {
    display: flex;
    justify-content: center;
    gap: -40px;
    /* Overlap cards */
    min-height: 180px;
}

.player-bottom .hand {
    justify-content: center;
    /* Center on PC */
    gap: 0;
    padding: 0 20px;
    padding-bottom: 10px;
    flex-wrap: nowrap;
}

/* Ensure cards don't shrink */
.player-bottom .hand .uno-card {
    flex-shrink: 0;
    margin-right: -25px;
    /* Reduced overlap for better visibility */
}

.player-bottom .hand .uno-card:last-child {
    margin-right: 0;
}

.player-bottom .hand .uno-card:hover {
    margin-right: 10px;
    /* Even more space when hovering */
    margin-left: 10px;
    z-index: 100;
    transform: translateY(-15px) scale(1.1);
}

/* Mobile: Enable horizontal scroll */
@media (max-width: 768px) {
    .player-bottom .hand {
        justify-content: flex-start;
        /* Align left to scroll */
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        width: 100%;
    }

    .player-bottom .hand::-webkit-scrollbar {
        display: none;
    }
}

/* Draw Card Hint */
.draw-hint {
    position: absolute;
    bottom: -40px;
    /* Below the deck */
    left: 50%;
    transform: translateX(-50%);
    background: #f59e0b;
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    animation: bounceHint 1s infinite;
    pointer-events: none;
    z-index: 20;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

@keyframes bounceHint {

    0%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    50% {
        transform: translateX(-50%) translateY(5px);
    }
}

/* Unocards */
/* Unocards - Resized smaller to fit better */
.uno-card {
    width: 80px;
    /* Reduced from 100 */
    height: 120px;
    /* Reduced from 150 */
    border-radius: 8px;
    background: white;
    position: relative;
    box-shadow: -2px 2px 8px rgba(0, 0, 0, 0.4);
    border: 3px solid white;
    transition: transform 0.2s, margin 0.2s, box-shadow 0.3s;
    user-select: none;
    cursor: default;
    overflow: hidden;
    flex-shrink: 0;
    /* Prevent squishing */
}

/* Update Pile Sizes to Match Cards */
.deck-pile,
.discard-pile {
    width: 90px;
    height: 135px;
}

/* Playable Card Effect - Special Glow */
.uno-card.playable {
    cursor: pointer;
    box-shadow: 0 0 15px #22c55e, 0 0 30px #22c55e;
    /* Green glow for "Go" */
    border-color: #4ade80;
    transform: translateY(-20px) scale(1.05);
    animation: pulsePlayable 1.5s infinite;
    z-index: 100;
}

@keyframes pulsePlayable {
    0% {
        transform: translateY(-20px) scale(1.05);
        box-shadow: 0 0 15px #22c55e;
    }

    50% {
        transform: translateY(-25px) scale(1.1);
        box-shadow: 0 0 25px #4ade80;
    }

    100% {
        transform: translateY(-20px) scale(1.05);
        box-shadow: 0 0 15px #22c55e;
    }
}

/* Hover on playable for even more effect */
.uno-card.playable:hover {
    transform: translateY(-40px) scale(1.2) !important;
    /* Override animation transform */
    z-index: 200;
    box-shadow: 0 0 40px #fff;
}

/* Non-playable cards should be dim if it's my turn? Optional. */
.my-turn .uno-card:not(.playable) {
    opacity: 0.7;
    filter: grayscale(0.5);
}

/* Card Colors */
.card-red {
    background: #ef4444;
}

.card-blue {
    background: #3b82f6;
}

.card-green {
    background: #22c55e;
}

.card-yellow {
    background: #eab308;
}

.card-wild {
    background: conic-gradient(#ef4444, #3b82f6, #22c55e, #eab308);
}

/* Card Face Design */
.card-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 90%;
    background: white;
    border-radius: 50% / 10%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
}

.card-value {
    position: absolute;
    font-weight: 900;
    color: white;
    text-shadow: 2px 2px 0 #000;
    font-size: 1.5rem;
    z-index: 2;
}

.card-value.top-left {
    top: 5px;
    left: 8px;
}

.card-value.bottom-right {
    bottom: 5px;
    right: 8px;
    transform: rotate(180deg);
}

.card-center-icon {
    position: absolute;
    font-size: 3rem;
    color: white;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
    z-index: 2;
}

/* Bot Cards (Back) */
.card-back {
    background: linear-gradient(135deg, #111, #333);
    border: 2px solid #666;
}

.card-back::after {
    content: "EB";
    color: #f59e0b;
    font-weight: 900;
    font-size: 1.5rem;
    transform: rotate(-45deg);
    display: block;
    position: absolute;
    top: 40%;
    left: 20%;
}

/* Modal for Color Selection */
#color-picker-modal {
    position: absolute;
    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: 1000;
}

.color-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    background: white;
    padding: 1rem;
    border-radius: 1rem;
}

.color-btn {
    width: 80px;
    height: 80px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
}

.color-btn:hover {
    transform: scale(1.1);
}

.btn-red {
    background: #ef4444;
}

.btn-blue {
    background: #3b82f6;
}

.btn-green {
    background: #22c55e;
}

.btn-yellow {
    background: #eab308;
}

/* Status Notifications */
#uno-notification {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 2rem;
    border-radius: 20px;
    font-size: 2rem;
    font-weight: bold;
    z-index: 2000;
    pointer-events: none;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Setup Modal additions */
.player-count-selector {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.count-btn {
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 10px;
    cursor: pointer;
}

.count-btn.selected {
    background: var(--primary-color, #4f46e5);
    border-color: transparent;
}

/* Current Color Indicator */
.current-color-indicator {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    transition: background 0.5s;
    z-index: 5;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
    color: white;
    text-transform: uppercase;
    font-weight: bold;
}

/* Lobby Styles */
.lobby-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: white;
}

.room-code-display {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem 2rem;
    border-radius: 10px;
    font-size: 2rem;
    font-family: monospace;
    letter-spacing: 5px;
    border: 1px dashed rgba(255, 255, 255, 0.3);
}

.player-list {
    width: 100%;
    max-width: 400px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 1rem;
}

.player-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.player-item.ready {
    color: #4ade80;
}

/* =========================================
   KARANLIK TEMA - KART OYUNU
   ========================================= */
[data-theme="dark"] #uno-game-area {
    background: radial-gradient(circle at center, #0a0a0a 0%, #000000 100%);
}

[data-theme="dark"] .player-score {
    background: rgba(0, 0, 0, 0.9);
    border-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .player-bottom {
    background: rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] #turn-status-display {
    background: rgba(0, 0, 0, 0.9);
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] #color-picker-modal {
    background: rgba(0, 0, 0, 0.9);
}

[data-theme="dark"] .color-options {
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] #uno-notification {
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .room-code-display {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .player-list {
    background: rgba(0, 0, 0, 0.5);
}

/* VS / Uno Menu Tabs - Restore Missing Styles */
.vs-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    gap: 1rem;
}

.vs-tab {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.vs-tab.active {
    color: #fff;
    border-bottom-color: #3b82f6;
}

.vs-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.vs-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.room-code-input {
    width: 100%;
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1.2rem;
    text-align: center;
    letter-spacing: 2px;
}