.puzzle-card {
    max-width: 720px;
    margin: 0 auto;
    text-align: left;
}

.puzzle-card h1 {
    margin: 0 0 4px;
}

.subtitle {
    margin: 0 0 16px;
    opacity: 0.8;
    font-size: 14px;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.back-btn {
    padding: 6px 12px;
    border-radius: 8px;
    background: #1f1f1f;
    border: 1px solid #444;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
}

.stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 13px;
    opacity: 0.85;
}

.game-panel {
    margin-top: 8px;
}

.question-text {
    font-size: 22px;
    font-weight: 600;
    margin: 16px 0;
    line-height: 1.4;
}

.sequence-display {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 20px 0;
}

.sequence-item {
    min-width: 52px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #1b1b1b;
    border: 1px solid #444;
    font-size: 20px;
    font-weight: 600;
    text-align: center;
}

.sequence-item.missing {
    border-color: #d51ac3;
    color: #d51ac3;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 16px;
}

.option-btn {
    padding: 14px;
    border-radius: 10px;
    border: 1px solid #444;
    background: #1b1b1b;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    transition: border-color .15s, background .15s, transform .1s;
}

.option-btn:hover:not(:disabled) {
    border-color: #d51ac3;
    background: #252525;
}

.option-btn.correct {
    border-color: #4caf50;
    background: #1a3320;
}

.option-btn.wrong {
    border-color: #e74c3c;
    background: #331a1a;
}

.option-btn:disabled {
    opacity: 0.7;
    cursor: default;
}

.feedback {
    margin-top: 14px;
    min-height: 24px;
    font-size: 15px;
}

.timer-bar {
    height: 6px;
    background: #1b1b1b;
    border-radius: 999px;
    overflow: hidden;
    margin: 12px 0;
}

.timer-fill {
    height: 100%;
    background: linear-gradient(90deg, #6a4df5, #d51ac3);
    transition: width 0.1s linear;
}

.controls {
    margin-top: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.primary-btn,
.secondary-btn {
    padding: 9px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

.primary-btn {
    background: #d51ac3;
    border: none;
    color: #fff;
}

.secondary-btn {
    background: #1f1f1f;
    border: 1px solid #444;
    color: #fff;
}

.hidden {
    display: none !important;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

.result-box {
    margin-top: 16px;
    padding: 16px;
    border-radius: 10px;
    background: #1b1b1b;
    border: 1px solid #333;
}

.result-box p {
    margin: 6px 0;
}

.match-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(64px, 1fr));
    gap: 10px;
    max-width: 360px;
    margin: 16px auto;
}

.match-card {
    aspect-ratio: 1;
    border-radius: 10px;
    border: 2px solid #444;
    background: #1b1b1b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    cursor: pointer;
    user-select: none;
    transition: transform .12s, border-color .12s, background .12s;
}

.match-card.flipped,
.match-card.matched {
    background: #2a1f35;
    border-color: #d51ac3;
}

.match-card.matched {
    opacity: 0.55;
    cursor: default;
    transform: scale(0.96);
}

.match-card .back {
    font-size: 22px;
    opacity: 0.5;
}

@media (max-width: 500px) {
    .match-grid {
        grid-template-columns: repeat(4, minmax(56px, 1fr));
        gap: 8px;
    }
    .match-card {
        font-size: 24px;
    }
}
