/* UNO Game Styles */

/* --- Layout & Structure --- */
.game-container {
    padding: 0;
    overflow: hidden; /* Prevent body scroll from cards */
    max-width: 800px;
    height: 95vh;
    display: flex;
    flex-direction: column;
}

.game-screen {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    position: relative;
    width: 100%;
}

/* --- Interstitial / Curtain --- */
.interstitial-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #2c3e50;
    color: white;
    z-index: 900; /* Increased Z-Index to remain above game, but below modal (1000) */
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.interstitial-screen:not(.hidden) {
    display: flex;
}

.icon-huge {
    font-size: 8rem;
    margin: 20px 0;
}

.interstitial-screen h2 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #f1c40f;
}

.interstitial-screen p {
    font-size: 1.2rem;
    margin-bottom: 30px;
}

/* --- Opponents Strip --- */
.opponents-strip {
    display: flex;
    justify-content: space-around;
    padding: 10px;
    background-color: #ecf0f1;
    border-bottom: 1px solid #bdc3c7;
}

.opponent-pill {
    background: white;
    padding: 5px 15px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    opacity: 0.7;
    border: 2px solid transparent;
}

.opponent-pill.active {
    opacity: 1;
    border-color: #f39c12;
    box-shadow: 0 0 10px rgba(243, 156, 18, 0.3);
    font-weight: bold;
}

.card-count-badge {
    background: #34495e;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.8rem;
}

/* --- Play Area --- */
.play-area {
    flex: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    position: relative;
    padding: 20px;
    background-color: #27ae60; /* Classic felt green feel */
    border-radius: 10px;
    margin: 10px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.2);
}

.status-area {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.direction-indicator {
    font-size: 2rem;
    color: rgba(255,255,255,0.5);
    font-weight: bold;
}

.active-color-indicator {
    padding: 5px 10px;
    background: white;
    border-radius: 5px;
    font-weight: bold;
    display: none; /* Hidden unless needed or active */
}

/* --- Cards --- */
.card {
    width: 100px;
    height: 150px;
    border-radius: 10px;
    position: relative;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.2);
    user-select: none;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
    transition: transform 0.2s, margin-top 0.2s;
    border: 4px solid white;
    background-color: #333; /* Default/Back */
    cursor: pointer;
}

/* Small screen adjustments */
@media (max-width: 600px) {
    .card {
        width: 70px;
        height: 105px;
        border-width: 3px;
    }
}

.card:hover {
    transform: translateY(-10px);
    z-index: 10;
}

/* Card inner ellipse design */
.card .inner {
    width: 80%;
    height: 90%;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    transform: rotate(-10deg);
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
}

.card.small-text .inner {
    font-size: 1.5rem; /* For "Skip", "Draw 2" text if not icons */
}

/* Colors */
.card-red { background: #e74c3c; }
.card-blue { background: #3498db; }
.card-green { background: #2ecc71; }
.card-yellow { background: #f1c40f; color: #333; text-shadow: none; }
.card-wild { 
    background: conic-gradient(#e74c3c 0deg 90deg, #3498db 90deg 180deg, #2ecc71 180deg 270deg, #f1c40f 270deg 360deg); 
    border-color: #333;
}
.card-back {
    background: #333;
    border-color: white;
}
.card-back .inner {
    font-size: 1.5rem;
    color: #e74c3c;
    border: none;
    background: none;
}
.card-back .inner::after {
    content: '';
}

/* Dim unplayable cards (optional logic, applied via JS) */
.card.dimmed {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- Player Hand --- */
.hand-container {
    height: 180px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 20px;
    background: rgba(0,0,0,0.05);
    white-space: nowrap;
    display: flex;
    align-items: center;
}

/* Custom scrollbar for hand */
.hand-container::-webkit-scrollbar {
    height: 8px;
}
.hand-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}
.hand-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.player-hand {
    display: flex;
    gap: -30px; /* Overlapping cards effect */
    padding-right: 50px;
}

.player-hand .card {
    margin-right: -40px; /* Overlap */
    transition: margin-right 0.2s, transform 0.2s;
}

.player-hand .card:hover {
    margin-right: 0;
    transform: translateY(-20px) scale(1.1);
    z-index: 100;
}

/* --- Action Bar --- */
.action-bar {
    padding: 15px;
    background: white;
    border-top: 1px solid #ccc;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.game-message {
    text-align: center;
    font-weight: bold;
    min-height: 24px;
    color: #e74c3c;
    margin-bottom: 5px;
}

.uno-btn {
    background-color: #e74c3c; /* Red */
    font-weight: bold;
    font-style: italic;
    border: 3px solid #c0392b;
    box-shadow: 0 4px 0 #c0392b;
    transition: all 0.1s;
    opacity: 0.5; /* Disabled until needed */
}

.uno-btn:active {
    transform: translateY(4px);
    box-shadow: none;
}

.uno-btn.active-uno {
    opacity: 1;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

#sort-btn {
    background-color: #95a5a6;
    font-size: 0.8rem;
    padding: 8px 15px;
}


/* --- Modal --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal:not(.hidden) {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
}

.color-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
}

.color-btn {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s;
}

.color-btn:hover {
    transform: scale(1.1);
}

.btn-red { background: #e74c3c; }
.btn-blue { background: #3498db; }
.btn-green { background: #2ecc71; }
.btn-yellow { background: #f1c40f; }