/* SET YOUR GAME'S COLOR THEME HERE */
:root {
    --primary-color: #FFB238;
    --primary-hover: #E69A22;
    --hero-gradient-start: rgba(255, 178, 56, 0.25);
    --hero-gradient-end: rgba(255, 178, 56, 0.10);
    --section-bg-start: rgba(255, 178, 56, 0.08);
    --section-bg-end: rgba(255, 178, 56, 0.04);
    --primary-shadow: rgba(255, 178, 56, 0.35);
    --feature-shadow: rgba(255, 178, 56, 0.20);
    --focus-shadow: rgba(255, 178, 56, 0.30);
    --mode-shadow: rgba(255, 178, 56, 0.25);
    --btn-shadow: rgba(255, 178, 56, 0.45);
    --summary-bg-start: rgba(255, 178, 56, 0.10);
    --summary-bg-end: rgba(255, 178, 56, 0.05);
    --accordion-icon-filter: invert(74%) sepia(55%) saturate(600%) hue-rotate(345deg) brightness(102%) contrast(101%);
}

/* =============================================
   SEQUENCE DISPLAY
   ============================================= */

.sequence-display {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 2rem 0;
    font-family: 'Courier New', monospace;
}

.seq-term {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.seq-value {
    width: 88px;
    height: 88px;
    border: 3px solid var(--primary-color);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.9rem;
    font-weight: 700;
    color: #212529;
    background: white;
    transition: all 0.3s ease;
}

.seq-value.blank {
    background: #fff8ee;
    border-style: dashed;
    color: #adb5bd;
}

.seq-value.filled {
    background: linear-gradient(135deg, var(--hero-gradient-start), var(--hero-gradient-end));
    border-style: solid;
    color: var(--primary-color);
}

.seq-value.correct-reveal {
    background: rgba(40, 167, 69, 0.12);
    border-color: #28a745;
    color: #28a745;
}

.seq-position {
    font-size: 0.8rem;
    color: #adb5bd;
    font-weight: 600;
}

.seq-separator {
    font-size: 2rem;
    font-weight: 700;
    color: #adb5bd;
    align-self: flex-start;
    margin-top: 0.65rem;
}

.seq-ellipsis {
    font-size: 2rem;
    font-weight: 700;
    color: #adb5bd;
    align-self: flex-start;
    margin-top: 0.65rem;
    letter-spacing: 0.25rem;
}

/* =============================================
   RULE DISPLAY (Box & Ring)
   ============================================= */

.rule-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.rule-part {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.rule-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.rule-box {
    width: 80px;
    height: 72px;
    border: 3px solid var(--primary-color);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
    background: white;
}

.rule-ring {
    width: 72px;
    height: 72px;
    border: 3px solid var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
    background: white;
}

.rule-box.blank,
.rule-ring.blank {
    border-style: dashed;
    color: #adb5bd;
    background: #fff8ee;
}

.rule-connector {
    font-size: 1.5rem;
    font-weight: 700;
    color: #adb5bd;
}

.rule-formula {
    font-size: 1.1rem;
    font-weight: 600;
    color: #495057;
    text-align: center;
    margin-top: 0.5rem;
}

/* Input fields for answers */
.answer-input {
    width: 100px;
    height: 56px;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    border: 3px solid var(--primary-color);
    border-radius: 0.75rem;
    background: #fff8ee;
    transition: all 0.3s ease;
    color: #212529;
}

.answer-input:focus {
    outline: none;
    border-color: var(--primary-hover);
    background: white;
    box-shadow: 0 0 0 3px var(--focus-shadow);
}

.answer-input.correct {
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.answer-input.incorrect {
    border-color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

/* =============================================
   APPLY-A-RULE: Fill sequence from rule
   ============================================= */

.apply-rule-container {
    text-align: center;
}

.rule-given {
    background: linear-gradient(135deg, var(--section-bg-start), var(--section-bg-end));
    border-radius: 1rem;
    padding: 1.25rem 2rem;
    display: inline-block;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: #212529;
    border: 2px solid rgba(255, 178, 56, 0.3);
}

.rule-given .rule-highlight {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.35rem;
}

/* Term input row for Apply a Rule */
.term-inputs {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1.5rem 0;
}

.term-input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.term-input {
    width: 88px;
    height: 88px;
    font-size: 1.9rem;
    font-weight: 700;
    text-align: center;
    border: 3px dashed var(--primary-color);
    border-radius: 0.75rem;
    background: #fff8ee;
    transition: all 0.3s ease;
    color: #212529;
    padding: 0.5rem;
}

.term-input:focus {
    outline: none;
    border-style: solid;
    background: white;
    box-shadow: 0 0 0 3px var(--focus-shadow);
}

.term-input.correct {
    border-color: #28a745;
    border-style: solid;
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.term-input.incorrect {
    border-color: #dc3545;
    border-style: solid;
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.term-input-pos {
    font-size: 0.8rem;
    color: #adb5bd;
    font-weight: 600;
}

/* =============================================
   FIND-A-RULE: Identify box and ring
   ============================================= */

.find-rule-container {
    text-align: center;
}

.rule-inputs {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.25rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.rule-input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.rule-input-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.rule-box-input {
    width: 84px;
    height: 76px;
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    border: 3px dashed var(--primary-color);
    border-radius: 0.5rem;
    background: #fff8ee;
    transition: all 0.3s ease;
    color: #212529;
}

.rule-ring-input {
    width: 76px;
    height: 76px;
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    border: 3px dashed var(--primary-color);
    border-radius: 50%;
    background: #fff8ee;
    transition: all 0.3s ease;
    color: #212529;
}

.rule-box-input:focus,
.rule-ring-input:focus {
    outline: none;
    border-style: solid;
    background: white;
    box-shadow: 0 0 0 3px var(--focus-shadow);
}

.rule-box-input.correct,
.rule-ring-input.correct {
    border-color: #28a745;
    border-style: solid;
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.rule-box-input.incorrect,
.rule-ring-input.incorrect {
    border-color: #dc3545;
    border-style: solid;
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.rule-input-hint {
    font-size: 0.8rem;
    color: #adb5bd;
}

.nth-term-preview {
    font-size: 1rem;
    color: #6c757d;
    margin-top: 0.75rem;
    font-style: italic;
}

.nth-term-preview strong {
    color: var(--primary-color);
    font-style: normal;
}

/* =============================================
   FIND-Nth-TERM: Find rule then specific term
   ============================================= */

.nth-question {
    background: linear-gradient(135deg, var(--section-bg-start), var(--section-bg-end));
    border-radius: 1rem;
    padding: 1.25rem 2rem;
    font-size: 1.15rem;
    font-weight: 600;
    color: #212529;
    margin: 1.5rem 0;
    border: 2px solid rgba(255, 178, 56, 0.3);
    text-align: center;
}

.nth-question .nth-n {
    color: var(--primary-color);
    font-size: 1.35rem;
    font-weight: 700;
}

.two-stage-container {
    display: flex;
    flex-direction: row;
    gap: 1.5rem;
    align-items: flex-start;
}

.two-stage-container .stage-block {
    flex: 1;
}

@media (max-width: 600px) {
    .two-stage-container {
        flex-direction: column;
    }
}

.stage-block {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 1rem;
    padding: 1.5rem;
    transition: border-color 0.3s ease;
}

.stage-block.active-stage {
    border-color: var(--primary-color);
    box-shadow: 0 4px 16px var(--feature-shadow);
}

.stage-block.completed-stage {
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.03);
}

.stage-heading {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.stage-heading.done {
    color: #28a745;
}

/* =============================================
   GAME FEEDBACK
   ============================================= */

.ls-feedback {
    text-align: center;
    font-size: 1.15rem;
    font-weight: 600;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    margin: 1rem 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ls-feedback.show {
    opacity: 1;
}

.ls-feedback.correct {
    background: rgba(40, 167, 69, 0.1);
    color: #2e7d32;
    border: 2px solid #4caf50;
}

.ls-feedback.incorrect {
    background: rgba(220, 53, 69, 0.1);
    color: #c62828;
    border: 2px solid #f44336;
}

.ls-feedback.partial {
    background: rgba(255, 193, 7, 0.1);
    color: #7b5800;
    border: 2px solid #ffc107;
}

/* =============================================
   GAME BUTTONS
   ============================================= */

.game-button {
    padding: 0.9rem 2rem;
    font-size: 1.05rem;
    font-weight: 700;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.game-button.primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px var(--btn-shadow);
}

.game-button.primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--btn-shadow);
}

.game-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.game-button.secondary {
    background: white;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.game-button.secondary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.button-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

/* =============================================
   SETTINGS - MODE PILLS
   ============================================= */

.mode-pills {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.mode-pill {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 1rem;
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-pill:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 16px var(--mode-shadow);
    transform: translateY(-2px);
}

.mode-pill.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, var(--summary-bg-start), var(--summary-bg-end));
    box-shadow: 0 4px 16px var(--mode-shadow);
}

.mode-pill .pill-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.75rem;
}

.mode-pill .pill-title {
    font-size: 1rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 0.5rem;
}

.mode-pill .pill-desc {
    font-size: 0.85rem;
    color: #6c757d;
    margin: 0;
    line-height: 1.4;
}

/* Count pills (questions, duration) */
.count-pills {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.count-pill {
    flex: 1;
    min-width: 60px;
    border: 2px solid #e9ecef;
    border-radius: 0.75rem;
    padding: 1rem 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.count-pill:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--mode-shadow);
}

.count-pill.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, var(--summary-bg-start), var(--summary-bg-end));
    box-shadow: 0 4px 12px var(--mode-shadow);
}

.pill-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
}

.count-label {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* Timing pills */
.timing-pills {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.timing-pill {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 1rem;
    padding: 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.timing-pill:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 16px var(--mode-shadow);
    transform: translateY(-2px);
}

.timing-pill.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, var(--summary-bg-start), var(--summary-bg-end));
    box-shadow: 0 4px 16px var(--mode-shadow);
}

.timing-pill .pill-icon {
    font-size: 1.75rem;
    display: block;
    margin-bottom: 0.5rem;
}

.timing-pill .pill-title {
    font-size: 1rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 0.25rem;
}

.timing-pill .pill-desc {
    font-size: 0.8rem;
    color: #6c757d;
    margin: 0;
}

/* Summary box */
.summary-box {
    background: linear-gradient(135deg, var(--summary-bg-start), var(--summary-bg-end));
    border: 2px solid rgba(255, 178, 56, 0.3);
    border-radius: 1rem;
    padding: 1.5rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(255, 178, 56, 0.15);
    font-size: 0.95rem;
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-label {
    font-weight: 600;
    color: #6c757d;
}

.summary-value {
    font-weight: 700;
    color: var(--primary-color);
}

/* Start button */
.btn-start-quiz {
    display: block;
    width: 100%;
    padding: 1.1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1.5rem;
    box-shadow: 0 4px 16px var(--btn-shadow);
}

.btn-start-quiz:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--btn-shadow);
}

.btn-start-quiz:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.error-message {
    color: #dc3545;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    margin-top: 0.75rem;
    display: none;
}

/* Quick select buttons */
.quick-select-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.btn-quick {
    padding: 0.6rem 1.25rem;
    border: 2px solid #e9ecef;
    border-radius: 2rem;
    background: white;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #495057;
}

.btn-quick:hover,
.btn-quick.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, var(--summary-bg-start), var(--summary-bg-end));
    color: var(--primary-color);
}

/* =============================================
   GAME STATS BAR
   ============================================= */

.game-stats {
    display: flex;
    flex-wrap: nowrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    flex: 1;
    min-width: 0;
    background: white;
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e9ecef;
}

.stat-label {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Mode badge in game */
.mode-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    padding: 0.35rem 1rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

/* Pre-start */
.instructions-box {
    text-align: center;
    padding: 3rem 2rem;
}

.instructions-box h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 1rem;
}

.instructions-box p {
    color: #6c757d;
    margin-bottom: 1.5rem;
}

.btn-play {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    border: none;
    padding: 1rem 3rem;
    border-radius: 0.75rem;
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px var(--btn-shadow);
}

.btn-play:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--btn-shadow);
}

/* Question instruction */
.question-instruction {
    font-size: 1.1rem;
    color: #6c757d;
    text-align: center;
    margin-bottom: 1rem;
}

.question-instruction strong {
    color: #212529;
}

/* =============================================
   RESULTS VIEW
   ============================================= */

.results-trophy {
    font-size: 5rem;
    text-align: center;
    margin-bottom: 1rem;
}

.results-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: #212529;
}

.results-accuracy {
    text-align: center;
    font-size: 4rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0.5rem 0;
}

.results-message {
    text-align: center;
    font-size: 1.15rem;
    color: #6c757d;
    margin-bottom: 1.5rem;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
}

.result-stat {
    background: linear-gradient(135deg, var(--section-bg-start), var(--section-bg-end));
    border-radius: 1rem;
    padding: 1.25rem;
    text-align: center;
    border: 2px solid rgba(255, 178, 56, 0.2);
}

.result-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.result-label {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 600;
    margin-top: 0.25rem;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

/* Flash animations */
@keyframes flash-correct {
    0%, 100% { background-color: transparent; }
    50% { background-color: rgba(40, 167, 69, 0.15); }
}

@keyframes flash-wrong {
    0%, 100% { background-color: transparent; }
    50% { background-color: rgba(220, 53, 69, 0.15); }
}

.content-card.flash-correct {
    animation: flash-correct 0.6s ease;
}

.content-card.flash-wrong {
    animation: flash-wrong 0.6s ease;
}

/* Stepper clickable/locked states */
.step.clickable {
    cursor: pointer;
    transition: all 0.3s ease;
}

.step.clickable:hover {
    transform: scale(1.05);
}

.step.clickable:hover .step-circle {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.step.locked {
    cursor: not-allowed;
    opacity: 0.5;
}

.step.locked:hover {
    transform: none;
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 768px) {
    .mode-pills {
        grid-template-columns: 1fr;
    }

    .seq-value {
        width: 56px;
        height: 56px;
        font-size: 1.35rem;
    }

    .term-input {
        width: 56px;
        height: 56px;
        font-size: 1.35rem;
    }

    .rule-box,
    .rule-ring,
    .rule-box-input,
    .rule-ring-input {
        width: 64px;
        height: 64px;
        font-size: 1.5rem;
    }

    .game-stats {
        flex-wrap: wrap;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        flex-direction: column;
    }

    .count-pills {
        gap: 0.5rem;
    }

    .timing-pills {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .seq-value {
        width: 48px;
        height: 48px;
        font-size: 1.1rem;
    }

    .term-input {
        width: 48px;
        height: 48px;
        font-size: 1.1rem;
    }

    .sequence-display {
        gap: 0.3rem;
    }

    .term-inputs {
        gap: 0.3rem;
    }
}