/* Memory Match Styles */

.memory-board {
    display: grid;
    gap: 10px;
    justify-content: center;
    padding: 20px;
    max-width: 500px;
    margin: 0 auto;
}

.memory-board.grid-4x4 {
    grid-template-columns: repeat(4, 1fr);
}

.memory-board.grid-5x4 {
    grid-template-columns: repeat(5, 1fr);
}

.memory-card {
    aspect-ratio: 1;
    perspective: 600px;
    cursor: pointer;
    min-width: 60px;
    min-height: 60px;
}

.memory-card.matched {
    cursor: default;
}

.memory-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.5s;
    transform-style: preserve-3d;
    border-radius: 10px;
}

.memory-card.flipped .memory-card-inner,
.memory-card.matched .memory-card-inner {
    transform: rotateY(180deg);
}

.memory-card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    user-select: none;
}

.memory-card-back {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 1.8rem;
    border: 2px solid #5a6fd6;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.memory-card-front {
    background: #fff;
    transform: rotateY(180deg);
    border: 2px solid #e0e0e0;
    font-size: 2.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.memory-card.matched .memory-card-front {
    border-color: #4caf50;
    background: #e8f5e9;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
}

.memory-card.matched .memory-card-inner {
    opacity: 0.85;
}

/* Score Display */
.score-display {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin: 10px 0;
    padding: 10px;
}

.player-score {
    padding: 8px 16px;
    border-radius: 8px;
    background: #f0f0f0;
    font-weight: bold;
    font-size: 0.95rem;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.player-score.active {
    border-color: #667eea;
    background: #eef0ff;
    box-shadow: 0 0 8px rgba(102, 126, 234, 0.3);
}

/* Turn Indicator */
.turn-indicator {
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    margin: 10px 0;
    padding: 8px;
    color: #333;
}

/* Game Buttons */
.game-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* Interstitial */
.interstitial-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.interstitial-content {
    text-align: center;
    padding: 40px;
}

.next-player-name {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
    margin: 20px 0;
}

/* Setup Screen */
.setup-screen {
    max-width: 400px;
    margin: 0 auto;
    text-align: center;
}

.setup-option {
    margin: 20px 0;
}

.setup-option label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.setup-option select {
    padding: 8px 16px;
    font-size: 1rem;
    border-radius: 6px;
    border: 1px solid #ccc;
}

.player-inputs {
    margin: 15px 0;
}

.player-inputs .player-input-row {
    margin: 8px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.player-inputs .player-input-row label {
    min-width: 80px;
    text-align: right;
    font-weight: bold;
}

.player-inputs .player-input-row input {
    padding: 6px 12px;
    font-size: 1rem;
    border-radius: 6px;
    border: 1px solid #ccc;
    width: 150px;
}

/* Responsive */
@media (max-width: 480px) {
    .memory-board {
        gap: 6px;
        padding: 10px;
    }

    .memory-card {
        min-width: 50px;
        min-height: 50px;
    }

    .memory-card-face {
        font-size: 1.5rem;
    }

    .memory-card-back {
        font-size: 1.3rem;
    }

    .memory-card-front {
        font-size: 1.8rem;
    }

    .score-display {
        gap: 8px;
    }

    .player-score {
        padding: 6px 10px;
        font-size: 0.85rem;
    }
}

@media (max-width: 360px) {
    .memory-board {
        gap: 4px;
        padding: 5px;
    }

    .memory-card {
        min-width: 40px;
        min-height: 40px;
    }

    .memory-card-face {
        font-size: 1.2rem;
    }

    .memory-card-front {
        font-size: 1.4rem;
    }
}
