/* Pairs (Memory) — kid-friendly big tiles */

.setup-box {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    max-width: 420px;
    margin: 20px auto;
    padding: 20px;
}

.setup-box h2 {
    margin: 0 0 14px;
    color: #333;
}

.setup-group {
    margin-bottom: 16px;
}

.setup-group .group-label {
    font-weight: bold;
    color: #555;
    margin-bottom: 8px;
    font-size: 15px;
}

.choice-row {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.choice-btn {
    flex: 1;
    min-width: 100px;
    padding: 12px 8px;
    border: 3px solid #ddd;
    border-radius: 10px;
    background: #fafafa;
    font-size: 15px;
    font-weight: bold;
    color: #444;
    cursor: pointer;
}

.choice-btn.selected {
    border-color: #2e7d32;
    background: #e8f5e9;
    color: #2e7d32;
}

.big-start-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 10px;
    background: #2e7d32;
    color: white;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 6px;
}

.big-start-btn:active { background: #1b5e20; }

/* Scoreboard */
.score-bar {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 10px auto;
    max-width: 560px;
    flex-wrap: wrap;
}

.player-chip {
    background: white;
    border: 3px solid transparent;
    border-radius: 999px;
    padding: 6px 16px;
    font-size: 16px;
    font-weight: bold;
    color: #555;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.player-chip.active {
    border-color: #f9a825;
    background: #fffde7;
    color: #333;
}

/* Tile grid */
.grid {
    display: grid;
    gap: 8px;
    max-width: 560px;
    margin: 8px auto 20px;
    padding: 0 4px;
}

.tile {
    aspect-ratio: 1;
    perspective: 600px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.tile-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.35s;
}

.tile.flipped .tile-inner { transform: rotateY(180deg); }

.tile-face {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.tile-back-face {
    background: linear-gradient(135deg, #1565c0, #42a5f5);
    box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.5);
}

.tile-back-face::after {
    content: "?";
    color: rgba(255, 255, 255, 0.85);
    font-size: clamp(20px, 6vw, 36px);
    font-weight: bold;
}

.tile-front-face {
    background: white;
    transform: rotateY(180deg);
    box-shadow: inset 0 0 0 3px #e0e0e0;
    font-size: clamp(26px, 8vw, 52px);
    user-select: none;
}

.tile.matched { cursor: default; }

.tile.matched .tile-inner {
    animation: matched-pop 0.5s ease;
}

.tile.matched .tile-front-face {
    background: #e8f5e9;
    box-shadow: inset 0 0 0 3px #66bb6a;
}

@keyframes matched-pop {
    0% { transform: rotateY(180deg) scale(1); }
    50% { transform: rotateY(180deg) scale(1.15); }
    100% { transform: rotateY(180deg) scale(1); }
}

.tile.wrong .tile-front-face {
    background: #ffebee;
    box-shadow: inset 0 0 0 3px #ef9a9a;
}

/* End modal extras */
.end-emoji { font-size: 56px; margin: 6px 0; }

.end-stars { font-size: 40px; letter-spacing: 6px; margin: 6px 0; }

.end-detail { color: #555; font-size: 16px; margin: 8px 0 14px; }

@media (max-width: 700px) {
    .grid { gap: 6px; }
}
