/* Global */
body {
    font-family: Arial, sans-serif;
    background: #f7f7f7;
    margin: 0;
    padding: 0;
    text-align: center;
}

/* Header */
.header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 20px;
    background: white;
    border-bottom: 2px solid #eee;
}

.header-left {
    margin-right: 20px;
}

.logo {
    height: 80px;
}

.header-right .tagline {
    font-size: 1.4rem;
    font-weight: 500;
    color: #444;
}

/* Title */
.puzzle-title {
    margin-top: 20px;
    font-size: 2rem;
    color: #333;
}

/* Stats Bar */
.stats {
    margin-top: 20px;
    font-size: 1.2rem;
    color: #333;
    display: flex;
    justify-content: center;
    gap: 30px;
}

/* Grid */
.grid {
    width: 340px;
    margin: 40px auto;
    display: grid;
    grid-template-columns: repeat(2, 150px);
    grid-gap: 20px;
}

/* Card Container */
.card {
    width: 150px;
    height: 150px;
    perspective: 800px;
    cursor: pointer;
}

/* Inner Flip Wrapper */
.card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.4s ease;
}

/* Flip State */
.card.flipped .card-inner {
    transform: rotateY(180deg);
}

/* Card Faces */
.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* Front Face */
.card-front {
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #555;
    border: 1px solid #ddd;
}

/* Back Face */
.card-back {
    transform: rotateY(180deg);
}

.card-back img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Reset Button */
#resetBtn {
    margin-top: 20px;
    padding: 10px 20px;
    font-size: 1rem;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}

#resetBtn:hover {
    background: #1e40af;
}

/* Status Message */
#status {
    margin-top: 15px;
    font-size: 1.2rem;
    color: #333;
}

/* Popup */
.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
}

.popup.hidden {
    display: none;
}

.popup-content {
    background: white;
    padding: 20px 30px;
    border-radius: 10px;
    max-width: 320px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.popup-content p {
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.popup-content button {
    padding: 8px 16px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

