/* Ombres - Memory Card Game */

/* Password screen (reuses simon patterns) */
.ombres-password-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    animation: fadeIn 1s ease-out;
}

.ombres-password-hint {
    color: var(--text-secondary);
    font-family: 'IM Fell DW Pica', serif;
    font-size: 1.2rem;
    font-style: italic;
    margin-bottom: 2rem;
}

.ombres-password-form {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.ombres-password-input {
    padding: 12px 24px;
    border: 2px solid var(--sage-green-dark);
    border-radius: 30px;
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--cream-light);
    font-family: 'IM Fell DW Pica', serif;
    font-size: 1.1rem;
    outline: none;
    transition: all 0.3s ease;
    text-align: center;
    width: 180px;
}

.ombres-password-input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.ombres-password-input:focus {
    border-color: var(--sage-green-light);
    background-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 12px rgba(93, 123, 85, 0.3);
}

.ombres-password-button {
    padding: 12px 28px;
    background-color: var(--sage-green-dark);
    color: var(--cream-light);
    border: none;
    border-radius: 30px;
    font-family: 'IM Fell DW Pica', serif;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px var(--shadow-color);
}

.ombres-password-button:hover {
    background-color: var(--sage-green-light);
    color: var(--forest-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-color-dark);
}

.ombres-password-error {
    color: #e07a5f;
    font-family: 'IM Fell DW Pica', serif;
    font-size: 1rem;
    margin-top: 1rem;
    animation: fadeIn 0.3s ease-out;
}

/* Game screen */
.ombres-game-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeIn 1s ease-out;
}

.ombres-subtitle {
    color: var(--text-secondary);
    font-family: 'IM Fell DW Pica', serif;
    font-size: 1.2rem;
    font-style: italic;
    margin-bottom: 1.5rem;
}

.ombres-moves {
    color: var(--text-muted);
    font-family: 'IM Fell DW Pica', serif;
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

/* Card grid */
.ombres-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.8rem;
    width: 100%;
    max-width: 360px;
}

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

.ombres-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease;
    transform-style: preserve-3d;
}

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

.ombres-card-front,
.ombres-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Card back (face down) */
.ombres-card-back {
    background:
        radial-gradient(ellipse at center, rgba(93, 123, 85, 0.2) 0%, transparent 70%),
        rgba(255, 255, 255, 0.05);
    border: 1.5px solid rgba(93, 123, 85, 0.4);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(186, 212, 181, 0.05);
}

.ombres-card-back-icon {
    width: 24px;
    height: 24px;
    opacity: 0.3;
    fill: var(--sage-green-light);
}

/* Card front (face up - the silhouette) */
.ombres-card-front {
    transform: rotateY(180deg);
    background:
        radial-gradient(ellipse at center, rgba(93, 123, 85, 0.12) 0%, transparent 70%),
        rgba(255, 255, 255, 0.08);
    border: 1.5px solid rgba(93, 123, 85, 0.5);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25), inset 0 0 20px rgba(93, 123, 85, 0.05);
}

.ombres-card-icon {
    width: 50%;
    height: 50%;
    fill: var(--text-primary);
    filter: drop-shadow(0 0 6px rgba(252, 225, 165, 0.3));
}

/* Matched cards */
.ombres-card.matched .ombres-card-front {
    border-color: var(--sage-green-light);
    background:
        radial-gradient(ellipse at center, rgba(93, 123, 85, 0.2) 0%, transparent 70%),
        rgba(255, 255, 255, 0.1);
}

.ombres-card.matched .ombres-card-icon {
    fill: var(--sage-green-light);
}

.ombres-card.matched {
    cursor: default;
}

/* Victory screen */
.ombres-victory-screen {
    position: relative;
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ombres-confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.ombres-victory-content {
    text-align: center;
    animation: fadeInScale 0.8s ease-out;
    z-index: 5;
}

.ombres-victory-title {
    font-size: 4rem !important;
}

.ombres-victory-score {
    color: var(--text-secondary);
    font-family: 'IM Fell DW Pica', serif;
    font-size: 1.2rem;
    margin-top: 1rem;
}

/* Mobile */
@media (max-width: 768px) {
    .ombres-password-form {
        flex-direction: column;
    }

    .ombres-grid {
        max-width: 300px;
        gap: 0.6rem;
    }

    .ombres-victory-title {
        font-size: 2.8rem !important;
    }
}

@media (max-width: 480px) {
    .ombres-grid {
        max-width: 260px;
        gap: 0.5rem;
    }

    .ombres-victory-title {
        font-size: 2.2rem !important;
    }
}

/* Touch-friendly */
@media (hover: none) and (pointer: coarse) {
    .ombres-card {
        min-height: 60px;
    }

    .ombres-password-input {
        min-height: 44px;
    }

    .ombres-password-button {
        min-height: 44px;
    }
}
