/**
 * @author      Mike Fairbrother <mike@fairbrother.me>
 * @copyright   2024-2026 Mike Fairbrother. All rights reserved.
 * @license     PROPRIETARY - No rights to copy, modify, distribute, or reuse
 *              any part of this code without explicit written permission from the author.
 */
/* ============================
   Pattern Detective - styles.css
   Prefix: pd-
   ============================ */

/* ---- Logo & Title ---- */
.pd-logo {
    font-size: 72px;
    line-height: 1;
    margin-bottom: 8px;
    filter: drop-shadow(0 0 20px rgba(255, 217, 61, 0.4));
    animation: pd-magnify 2s ease-in-out infinite;
}
@keyframes pd-magnify {
    0%, 100% { transform: rotate(-8deg) scale(1); }
    50% { transform: rotate(8deg) scale(1.08); }
}

.pd-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 4px;
    background: linear-gradient(135deg, #ffd93d, #ff9f43);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pd-subtitle {
    font-size: 14px;
    color: var(--gp-text-secondary);
    margin-bottom: 16px;
}

.pd-menu-best {
    font-size: 14px;
    color: var(--gp-text-secondary);
    margin-bottom: 20px;
}
.pd-menu-best span {
    color: var(--gp-accent);
    font-weight: 700;
}

/* ---- Difficulty Pills ---- */
.pd-difficulty {
    margin-bottom: 24px;
    width: 100%;
    max-width: 340px;
}
.pd-diff-label {
    font-size: 11px;
    color: var(--gp-text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 8px;
}
.pd-diff-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}
.pd-pill {
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--gp-text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--gp-font-stack);
}
.pd-pill.active {
    background: linear-gradient(135deg, rgba(255, 217, 61, 0.2), rgba(255, 159, 67, 0.2));
    border-color: var(--gp-accent);
    color: var(--gp-accent);
    box-shadow: 0 0 12px rgba(255, 217, 61, 0.15);
}
.pd-pill:active {
    transform: scale(0.95);
}

/* ---- Game Area ---- */
.pd-game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 12px;
    gap: 20px;
}

.pd-prompt {
    font-size: 18px;
    font-weight: 700;
    color: var(--gp-text-primary);
    text-align: center;
    min-height: 28px;
}

/* ---- Sequence Row ---- */
.pd-sequence-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 16px 8px;
    min-height: 80px;
}

/* Individual sequence item box */
.pd-seq-item {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid rgba(255, 255, 255, 0.1);
    font-size: 22px;
    font-weight: 800;
    color: var(--gp-text-primary);
    transition: all 0.3s ease;
    animation: pd-item-in 0.3s ease backwards;
    font-variant-numeric: tabular-nums;
    position: relative;
    overflow: hidden;
}
.pd-seq-item:nth-child(1) { animation-delay: 0.05s; }
.pd-seq-item:nth-child(2) { animation-delay: 0.1s; }
.pd-seq-item:nth-child(3) { animation-delay: 0.15s; }
.pd-seq-item:nth-child(4) { animation-delay: 0.2s; }
.pd-seq-item:nth-child(5) { animation-delay: 0.25s; }
.pd-seq-item:nth-child(6) { animation-delay: 0.3s; }
.pd-seq-item:nth-child(7) { animation-delay: 0.35s; }
.pd-seq-item:nth-child(8) { animation-delay: 0.4s; }

@keyframes pd-item-in {
    from { opacity: 0; transform: scale(0.5) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Mystery/question item */
.pd-seq-item.pd-mystery {
    border-color: var(--gp-accent);
    background: rgba(255, 217, 61, 0.08);
    box-shadow: 0 0 16px rgba(255, 217, 61, 0.2);
    animation: pd-mystery-pulse 1.5s ease-in-out infinite;
    color: var(--gp-accent);
    font-size: 26px;
}
@keyframes pd-mystery-pulse {
    0%, 100% { box-shadow: 0 0 16px rgba(255, 217, 61, 0.2); border-color: var(--gp-accent); }
    50% { box-shadow: 0 0 24px rgba(255, 217, 61, 0.4); border-color: #ffeb8a; }
}

/* ---- Visual Shape Items ---- */
.pd-shape {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    transition: all 0.2s ease;
}
.pd-shape.pd-circle {
    border-radius: 50%;
}
.pd-shape.pd-triangle {
    width: 0;
    height: 0;
    border-left: 16px solid transparent;
    border-right: 16px solid transparent;
    border-bottom: 28px solid currentColor;
    background: none !important;
}
.pd-shape.pd-diamond {
    transform: rotate(45deg);
    width: 24px;
    height: 24px;
}
.pd-shape.pd-star {
    /* star uses text content instead */
    background: none !important;
    font-size: 28px;
    width: auto;
    height: auto;
}

/* Shape sizes for size-variant patterns */
.pd-shape.pd-small {
    width: 18px;
    height: 18px;
}
.pd-shape.pd-medium {
    width: 28px;
    height: 28px;
}
.pd-shape.pd-large {
    width: 38px;
    height: 38px;
}
.pd-shape.pd-triangle.pd-small {
    border-left-width: 9px;
    border-right-width: 9px;
    border-bottom-width: 16px;
    width: 0; height: 0;
}
.pd-shape.pd-triangle.pd-medium {
    border-left-width: 14px;
    border-right-width: 14px;
    border-bottom-width: 24px;
    width: 0; height: 0;
}
.pd-shape.pd-triangle.pd-large {
    border-left-width: 19px;
    border-right-width: 19px;
    border-bottom-width: 33px;
    width: 0; height: 0;
}
.pd-shape.pd-diamond.pd-small {
    width: 14px; height: 14px;
}
.pd-shape.pd-diamond.pd-medium {
    width: 22px; height: 22px;
}
.pd-shape.pd-diamond.pd-large {
    width: 30px; height: 30px;
}

/* ---- Answers Grid ---- */
.pd-answers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
    max-width: 320px;
    padding: 0 8px;
}
.pd-answer-btn {
    padding: 14px 8px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--gp-text-primary);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--gp-font-stack);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    font-variant-numeric: tabular-nums;
}
.pd-answer-btn:active {
    transform: scale(0.95);
}
.pd-answer-btn:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
}
.pd-answer-btn.pd-correct {
    border-color: var(--gp-success);
    background: rgba(46, 213, 115, 0.15);
    color: var(--gp-success);
    animation: pd-correct-pop 0.4s ease;
}
@keyframes pd-correct-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}
.pd-answer-btn.pd-wrong {
    border-color: var(--gp-danger);
    background: rgba(255, 71, 87, 0.15);
    color: var(--gp-danger);
    animation: pd-shake 0.4s ease;
}
@keyframes pd-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}
.pd-answer-btn[disabled] {
    pointer-events: none;
    opacity: 0.5;
}

/* ---- Feedback ---- */
.pd-feedback {
    font-size: 15px;
    font-weight: 700;
    min-height: 24px;
    text-align: center;
    transition: opacity 0.2s ease;
}
.pd-feedback.pd-show {
    animation: pd-fade-in 0.3s ease;
}
@keyframes pd-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---- Game Over Stats ---- */
.pd-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 24px 0;
    width: 100%;
    max-width: 280px;
}
.pd-stat-box {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 16px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.pd-stat-num {
    font-size: 28px;
    font-weight: 800;
    color: var(--gp-accent);
    line-height: 1.1;
}
.pd-stat-lbl {
    font-size: 11px;
    color: var(--gp-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* ---- Help Sections ---- */
.pd-help-section {
    margin-bottom: 16px;
}
.pd-help-section h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--gp-accent);
    margin-bottom: 6px;
}
.pd-help-section p {
    font-size: 13px;
    color: var(--gp-text-secondary);
    line-height: 1.5;
}

/* ---- Pattern Rule Banner ---- */
.pd-rule-banner {
    font-size: 13px;
    color: var(--gp-accent);
    background: rgba(255, 217, 61, 0.08);
    border: 1px solid rgba(255, 217, 61, 0.15);
    border-radius: 10px;
    padding: 6px 14px;
    font-weight: 600;
    text-align: center;
}

/* ---- Streak Indicator ---- */
.pd-streak-fire {
    display: inline-block;
    animation: pd-fire-dance 0.3s ease;
}
@keyframes pd-fire-dance {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* ---- Responsive Adjustments ---- */
@media (max-width: 360px) {
    .pd-seq-item {
        width: 46px;
        height: 46px;
        font-size: 18px;
    }
    .pd-answer-btn {
        font-size: 16px;
        padding: 12px 6px;
        min-height: 48px;
    }
    .pd-sequence-row {
        gap: 6px;
    }
}

@media (max-height: 640px) {
    .pd-game-area {
        gap: 12px;
        padding: 8px 12px;
    }
    .pd-seq-item {
        width: 46px;
        height: 46px;
        font-size: 18px;
    }
}
