/* ============================================================
   BrainBuzz Game Styles — Shared Template
   /css/gamestyles.css
   
   Used by all games in maths/ (and future folders).
   Load AFTER brainbuzz.css, BEFORE the per-game CSS file.

   Each game CSS file must declare these variables in :root:
     --primary-color       Main accent (button, highlights)
     --primary-hover       Darker shade for hover states
     --primary-light       Transparent tint (rgba, 0.10–0.15)
     --primary-shadow      Box-shadow tint (rgba, 0.25–0.35)
     --btn-text-color      Text on solid primary buttons (#fff or dark)
   ============================================================ */


/* ===== VIEW SWITCHING ===== */

.gs-view { display: none; }
.gs-view.active { display: block; }


/* ===== PAGE LAYOUT =====
   Wrapper: <div class="container px-5 gs-page">
   This is identical to the navbar — container + px-5 — so left/right
   edges align exactly with the logo and nav links.
   No custom max-width here; Bootstrap's container handles it.
=============================== */

.gs-page {
    padding-top: 1.5rem;
    padding-bottom: 3rem;
    min-height: 60vh;
}

/* ===== FULL-SCREEN FLASH OVERLAY ===== */

.gs-flash-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.08s ease;
}

.gs-flash-overlay.show {
    opacity: 1;
}

.gs-flash-overlay.correct {
    background: rgba(108, 226, 136, 0.95);
}

.gs-flash-overlay.wrong {
    background: rgba(220, 53, 70, 0.95);
}

.gs-flash-icon {
    font-size: clamp(80px, 15vw, 140px);
    line-height: 1;
    font-weight: 700;
}

.gs-flash-overlay.correct .gs-flash-icon,
.gs-flash-overlay.wrong .gs-flash-icon {
    color: #fff;
    position: relative;
    z-index: 1;
}

.gs-flash-word {
    font-size: clamp(22px, 4vw, 36px);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.gs-flash-overlay.correct .gs-flash-word,
.gs-flash-overlay.wrong .gs-flash-word {
    color: #fff;
    position: relative;
    z-index: 1;
}


/* ===== GAME HEADER ===== */

/* Full-width hero strip — sits outside the container */
.gs-hero {
    background: linear-gradient(135deg, var(--hero-gradient-start) 0%, var(--hero-gradient-end) 100%);
    width: 100%;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

/* Inner content aligns with navbar via container px-5 */
.gs-header {
    padding: 3.5rem 0 3rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
    min-height: 280px;
}

.gs-header-text {
    flex: 1;
}

.gs-header-image {
    flex: 0 0 45%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.gs-hero-img {
    width: 100%;
    max-width: 520px;
    height: auto;
    object-fit: contain;
    display: block;
    border: 3px solid var(--primary-color);
    border-radius: 18px;
    background: #fff;
    padding: 1.25rem;
    box-shadow: 0 8px 30px var(--primary-shadow);
}

.gs-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary-color);
    background: rgba(255,255,255,0.6);
    border: 1.5px solid var(--primary-color);
    border-radius: 2rem;
    padding: 0.3rem 0.9rem;
    margin-bottom: 1rem;
}

.gs-title {
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 800;
    color: #1a1a2e;
    letter-spacing: -1px;
    line-height: 1.1;
    margin: 0 0 0.75rem;
}

.gs-desc {
    font-size: 1.1rem;
    color: #495057;
    margin: 0 0 1.75rem;
    line-height: 1.6;
    max-width: 520px;
}

/* How to play — solid primary button */
.gs-how-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 0.75rem;
    padding: 0.65rem 1.5rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    text-decoration: none;
    box-shadow: 0 4px 14px var(--primary-shadow);
}

.gs-how-btn:hover {
    background: var(--primary-hover, var(--primary-color));
    border-color: var(--primary-hover, var(--primary-color));
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-shadow);
}


/* ===== SECTION LABEL ===== */

.gs-section-label {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #adb5bd;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}


/* ===== SETTINGS WIZARD LAYOUT ===== */

/* Outer row: col-4 nav + col-8 content */
.gs-settings-row {
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 0;
    align-items: start;
    margin-top: 0.5rem;
    border: 1px solid #e9ecef;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}

/* LEFT: vertical step nav */
.gs-settings-nav {
    border-right: 1px solid #e9ecef;
    padding: 1.5rem 0;
    background: #fafafa;
}

.gs-settings-nav-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #adb5bd;
    padding: 0 1.5rem;
    margin-bottom: 0.75rem;
}

.gs-wizard-step {
    display: block;
    padding: 1rem 1.5rem;
    cursor: default;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
    opacity: 0.4;
}

.gs-wizard-step.accessible {
    opacity: 1;
    cursor: pointer;
}

.gs-wizard-step.accessible:hover {
    background: rgba(0,0,0,0.03);
}

.gs-wizard-step.active {
    opacity: 1;
    border-left-color: var(--primary-color);
    background: var(--primary-light);
}

.gs-wizard-step-dot { display: none; }

.gs-wizard-step-label {
    font-size: 15px;
    font-weight: 600;
    color: #495057;
    line-height: 1;
}

.gs-wizard-step.active .gs-wizard-step-label {
    color: var(--primary-color);
}

.gs-wizard-step-sub { display: none; }

.gs-wizard-step.done .gs-wizard-step-label {
    color: #28a745;
}

/* RIGHT: sliding content pane */
.gs-settings-main {
    overflow: hidden;
    position: relative;
}

.gs-wizard-panels {
    display: flex;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gs-wizard-panel {
    min-width: 100%;
    padding: 2.25rem 2rem;
    box-sizing: border-box;
}

.gs-wizard-panel-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 0.3rem;
}

.gs-wizard-panel-desc {
    font-size: 15px;
    color: #adb5bd;
    margin-bottom: 1.5rem;
}

/* Nav buttons at bottom of right col */
.gs-wizard-nav {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid #f1f3f5;
}

.gs-wizard-prev,
.gs-wizard-next {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 14px;
    font-weight: 600;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    background: #fff;
    color: #495057;
    cursor: pointer;
    transition: all 0.15s ease;
    width: 100%;
}

.gs-wizard-prev:hover,
.gs-wizard-next:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.gs-wizard-prev:disabled,
.gs-wizard-next:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

.gs-wizard-next {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--btn-text-color, #fff);
}

.gs-wizard-next:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: var(--btn-text-color, #fff);
}

.gs-wizard-step-count {
    font-size: 13px;
    color: #adb5bd;
    text-align: center;
}

/* Summary panel inside wizard */
.gs-summary-rows {
    margin-bottom: 1.5rem;
}

.gs-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.65rem 0;
    border-bottom: 1px solid #f1f3f5;
    font-size: 14px;
}

.gs-summary-row:last-child {
    border-bottom: none;
}

.gs-summary-label {
    color: #6c757d;
    font-weight: 500;
}

.gs-summary-value {
    color: var(--primary-color);
    font-weight: 700;
}

/* Settings card inside a wizard panel */
.gs-settings-card {
    padding: 0;
    margin-bottom: 1rem;
}


/* Quick-select preset buttons */
.gs-quick-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.gs-quick-btn {
    font-size: 14px;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    background: #f8f9fa;
    color: #495057;
    cursor: pointer;
    transition: all 0.15s ease;
}

.gs-quick-btn:hover,
.gs-quick-btn.active {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}


/* Times-table grid */
.gs-tables-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.gs-table-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.1rem 0.75rem;
    border-radius: 12px;
    border: 2px solid #e9ecef;
    background: #fff;
    cursor: pointer;
    transition: all 0.18s ease;
    user-select: none;
    min-height: 80px;
}

.gs-table-pill:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
    transform: translateY(-2px);
}

.gs-table-pill.selected {
    background: var(--primary-light);
    border: 2.5px solid var(--primary-color);
}

.gs-table-num {
    font-size: 26px;
    font-weight: 700;
    color: #212529;
    line-height: 1;
}

.gs-table-pill.selected .gs-table-num { color: var(--primary-color); }

.gs-table-sub {
    font-size: 12px;
    color: #adb5bd;
    margin-top: 4px;
    font-weight: 500;
}

.gs-table-pill.selected .gs-table-sub { color: var(--primary-color); }


/* Selection summary line */
.gs-sel-summary {
    font-size: 15px;
    color: #6c757d;
    min-height: 18px;
    margin-top: 0.5rem;
}

.gs-sel-summary strong {
    color: var(--primary-color);
    font-weight: 600;
}


/* Generic option pills (mode, difficulty, count) */
.gs-option-grid {
    display: grid;
    gap: 0.75rem;
}

.gs-option-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.gs-option-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.gs-option-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.gs-option-grid.auto   { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }

.gs-option-pill {
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 14px;
    padding: 1.5rem 1.25rem;
    cursor: pointer;
    transition: all 0.18s ease;
    text-align: center;
}

.gs-option-pill:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
    transform: translateY(-2px);
}

.gs-option-pill.selected {
    border: 2.5px solid var(--primary-color);
    background: var(--primary-light);
}

.gs-option-pill-number {
    font-size: 40px;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 0.6rem;
    letter-spacing: -1px;
}

.gs-option-pill-title {
    font-size: 16px;
    font-weight: 700;
    color: #212529;
    margin-bottom: 0.75rem;
}

.gs-option-pill-desc {
    font-size: 13px;
    color: #6c757d;
    line-height: 1.7;
}

.gs-option-pill-desc li,
.gs-option-pill-desc p {
    margin: 0;
    list-style: none;
    padding: 0;
}


/* Start button */
.gs-start-btn {
    width: 100%;
    padding: 1.1rem;
    border-radius: 12px;
    border: none;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 1.25rem;
    letter-spacing: -0.2px;
    transition: all 0.18s ease;
}

.gs-start-btn:not(:disabled) {
    background: var(--primary-color);
    color: var(--btn-text-color, #fff);
    box-shadow: 0 4px 14px var(--primary-shadow);
}

.gs-start-btn:not(:disabled):hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px var(--primary-shadow);
}

.gs-start-btn:disabled {
    background: #f1f3f5;
    color: #adb5bd;
    cursor: not-allowed;
    border: 1px solid #e9ecef;
}




/* ===== STAT ROW (GAME VIEW) ===== */

.gs-stat-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.gs-stat-pill {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1.25rem 0.75rem;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.gs-stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #adb5bd;
    font-weight: 600;
}

.gs-stat-value {
    font-size: 40px;
    font-weight: 700;
    color: #212529;
    line-height: 1.1;
    margin-top: 4px;
}

.gs-stat-value.gs-timer-low {
    color: #dc3545;
}


/* ===== GAME AREA (no card — full page) ===== */

.gs-game-card {
    padding: 1rem 0;
    text-align: center;
}


/* Pre-start panel inside game card */
.gs-pre-start {
    text-align: center;
    padding: 5rem 0 3rem;
}

.gs-pre-start-title {
    font-size: 32px;
    font-weight: 700;
    color: #212529;
    margin-bottom: 0.5rem;
}

.gs-pre-start-sub {
    font-size: 17px;
    color: #6c757d;
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.gs-play-btn {
    background: var(--primary-color);
    color: var(--btn-text-color, #fff);
    border: none;
    border-radius: 12px;
    padding: 1.1rem 3.5rem;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px var(--primary-shadow);
    transition: all 0.18s ease;
}

.gs-play-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px var(--primary-shadow);
}


/* Active game area */
.gs-active-game { display: none; padding-top: 0.5rem; }

/* Question display — monospace for maths */
.gs-question {
    text-align: center;
    font-size: clamp(44px, 10vw, 80px);
    font-weight: 700;
    font-family: 'Courier New', Consolas, monospace;
    color: #212529;
    letter-spacing: -1px;
    margin-bottom: 1.25rem;
    line-height: 1.2;
    padding-top: 1rem;
}

.gs-question-missing {
    color: var(--primary-color);
}

/* Input + submit row */
.gs-answer-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    max-width: 500px;
    margin: 0 auto;
}

.gs-feedback-icon {
    font-size: 28px;
    font-weight: 700;
    min-height: 36px;
    text-align: center;
    transition: all 0.2s ease;
}

.gs-answer-input {
    width: 100%;
    font-size: 40px;
    font-weight: 700;
    text-align: center;
    border-radius: 14px;
    border: 2px solid #dee2e6;
    padding: 1.1rem 1rem;
    font-family: 'Courier New', Consolas, monospace;
    color: #212529;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    -moz-appearance: textfield;
}

.gs-answer-input::-webkit-outer-spin-button,
.gs-answer-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.gs-answer-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--primary-shadow);
}

.gs-answer-input.input-correct {
    border-color: #28a745;
    background: rgba(40,167,69,0.06);
}

.gs-answer-input.input-wrong {
    border-color: #dc3545;
    background: rgba(220,53,69,0.06);
}

.gs-submit-btn {
    width: 100%;
    background: var(--primary-color);
    color: var(--btn-text-color, #fff);
    border: none;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
    box-shadow: 0 3px 10px var(--primary-shadow);
}

.gs-submit-btn:disabled {
    background: #f1f3f5;
    color: #adb5bd;
    cursor: not-allowed;
    box-shadow: none;
    border: 1px solid #e9ecef;
}

.gs-submit-btn:not(:disabled):hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

/* Change-settings link above game card */
.gs-game-meta {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.65rem;
}

.gs-change-link {
    font-size: 12px;
    color: #adb5bd;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s;
}

.gs-change-link:hover { color: #495057; }


/* ===== RESULTS CARD ===== */

.gs-results-card {
    padding: 3rem 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
    text-align: center;
}

.gs-results-left {
    /* left column: trophy, headline, msg, big number, stats */
}

.gs-results-right {
    /* right column: buttons, vertically centred */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0;
}

.gs-results-trophy {
    font-size: 72px;
    line-height: 1;
    margin-bottom: 1rem;
}

.gs-results-headline {
    font-size: 36px;
    font-weight: 700;
    color: #1a1a2e;
    letter-spacing: -0.5px;
    margin-bottom: 0.25rem;
}

.gs-results-msg {
    font-size: 18px;
    color: #6c757d;
    margin-bottom: 2.5rem;
}

/* Big accuracy number */
.gs-results-big {
    font-size: 100px;
    font-weight: 800;
    letter-spacing: -3px;
    color: var(--primary-color);
    line-height: 1;
}

.gs-results-big-label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #adb5bd;
    font-weight: 600;
    margin-top: 0.35rem;
    margin-bottom: 2rem;
}

/* Correct / answered stats */
.gs-results-stats {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    margin-bottom: 2.5rem;
}

.gs-result-stat {
    text-align: center;
}

.gs-result-stat-val {
    font-size: 44px;
    font-weight: 700;
    color: #212529;
    line-height: 1;
}

.gs-result-stat-label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #adb5bd;
    font-weight: 600;
    margin-top: 0.3rem;
}

/* Three action buttons */
.gs-result-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.gs-result-actions button {
    width: 100%;
    max-width: 420px;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
}

.gs-btn-again {
    background: var(--primary-color);
    color: var(--btn-text-color, #fff);
    border: none;
    box-shadow: 0 3px 10px var(--primary-shadow);
}

.gs-btn-again:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.gs-btn-review {
    background: #fff;
    color: #495057;
    border: 1px solid #dee2e6;
}

.gs-btn-review:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.gs-btn-change {
    background: #fff;
    color: #adb5bd;
    border: 1px solid #e9ecef;
    font-size: 16px;
}

.gs-btn-change:hover {
    border-color: #adb5bd;
    color: #495057;
}


/* ===== REVIEW OFFCANVAS ===== */

.gs-review-offcanvas {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 420px;
    max-width: 100vw;
    background: #fff;
    border-left: 1px solid #e9ecef;
    box-shadow: -4px 0 24px rgba(0,0,0,0.10);
    z-index: 1055;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.gs-review-offcanvas.open {
    transform: translateX(0);
}

.gs-review-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 1054;
}

.gs-review-backdrop.open {
    display: block;
}

/* Offcanvas header */
.gs-oc-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.gs-oc-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
}

.gs-oc-subtitle {
    font-size: 12px;
    color: #adb5bd;
    margin-top: 1px;
}

.gs-oc-x {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: #adb5bd;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s;
}

.gs-oc-x:hover { color: #495057; }

/* Scrollable question list */
.gs-oc-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.5rem;
}

.gs-oc-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f3f5;
}

.gs-oc-item:last-child {
    border-bottom: none;
}

.gs-oc-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #f1f3f5;
    font-size: 11px;
    font-weight: 700;
    color: #adb5bd;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

.gs-oc-icon {
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 2px;
}

.gs-oc-icon.correct-r { color: #28a745; }
.gs-oc-icon.wrong-r   { color: #dc3545; }

.gs-oc-q {
    font-size: 15px;
    font-family: 'Courier New', Consolas, monospace;
    font-weight: 700;
    color: #212529;
}

.gs-oc-ans {
    font-size: 12px;
    margin-top: 2px;
    font-weight: 500;
    color: #6c757d;
}

.gs-oc-ans:first-of-type {
    color: #dc3545; /* user's wrong answer */
}

.gs-oc-ans:last-of-type {
    color: #28a745; /* correct answer */
}

.gs-oc-item.correct-r .gs-oc-q { color: #212529; }
.gs-oc-item.wrong-r   .gs-oc-q { color: #dc3545; }

/* Sticky close button at bottom */
.gs-oc-footer {
    flex-shrink: 0;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e9ecef;
    background: #fff;
}

.gs-oc-close-btn {
    width: 100%;
    padding: 0.85rem;
    border-radius: 10px;
    border: 1px solid #dee2e6;
    background: #f8f9fa;
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    cursor: pointer;
    transition: all 0.18s ease;
}

.gs-oc-close-btn:hover {
    background: #fff;
    border-color: #adb5bd;
    color: #212529;
}


/* ===== HOW TO PLAY MODAL ===== */

.gs-how-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1050;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.gs-how-overlay.open {
    display: flex;
}

.gs-how-modal {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e9ecef;
    width: 100%;
    max-width: 480px;
    padding: 1.75rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.gs-how-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.gs-how-title {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a2e;
}

.gs-how-close {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: #adb5bd;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s;
}

.gs-how-close:hover { color: #495057; }

.gs-how-step {
    display: flex;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.gs-how-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary-color);
    font-size: 12px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

.gs-how-step-title {
    font-size: 14px;
    font-weight: 700;
    color: #212529;
    margin-bottom: 0.2rem;
}

.gs-how-step-body {
    font-size: 13px;
    color: #6c757d;
    line-height: 1.55;
}

/* Example equation box inside modal */
.gs-how-example {
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    padding: 1rem;
    text-align: center;
    margin-top: 1.25rem;
}

.gs-how-eq {
    font-size: 24px;
    font-weight: 800;
    font-family: 'Courier New', Consolas, monospace;
    color: #212529;
}

.gs-how-eq-miss {
    color: var(--primary-color);
}

.gs-how-eq-label {
    font-size: 12px;
    color: #6c757d;
    margin-top: 0.35rem;
}


/* ===== SHARED ANIMATIONS ===== */

@keyframes gs-pulse-correct {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.04); }
}

@keyframes gs-shake {
    0%, 100% { transform: translateX(0); }
    25%       { transform: translateX(-8px); }
    75%       { transform: translateX(8px); }
}

@keyframes gs-timer-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.55; }
}

.gs-timer-pulse { animation: gs-timer-pulse 1s infinite; }


/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {
    /* Hero: stack on mobile, hide image */
    .gs-header { min-height: auto; gap: 1.5rem; flex-direction: column; padding: 2rem 0; }
    .gs-header-image { flex: none; width: 100%; justify-content: center; }
    .gs-hero-img { max-width: 100%; }
    .gs-title { font-size: 2.2rem; }
    .gs-desc { font-size: 1rem; }

    /* Results: collapse to single column on tablet/mobile */
    .gs-results-card {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    /* Settings wizard: stack nav above panels on mobile */
    .gs-settings-row {
        grid-template-columns: 1fr;
    }
    .gs-settings-nav {
        border-right: none;
        border-bottom: 1px solid #e9ecef;
        padding: 1rem 0;
        display: flex;
        overflow-x: auto;
        gap: 0;
    }
    .gs-wizard-step {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.3rem;
        padding: 0.5rem 0.75rem;
        border-left: none;
        border-bottom: 3px solid transparent;
        white-space: nowrap;
    }
    .gs-wizard-step.active {
        border-left-color: transparent;
        border-bottom-color: var(--primary-color);
    }
    .gs-wizard-step-sub { display: none; }
    .gs-settings-nav-title { display: none; }
}

@media (max-width: 640px) {
    .gs-tables-grid  { grid-template-columns: repeat(3, 1fr); }
    .gs-stat-value   { font-size: 32px; }
    .gs-results-big  { font-size: 80px; }
    .gs-result-stat-val { font-size: 36px; }
}

@media (max-width: 520px) {
    .gs-tables-grid  { grid-template-columns: repeat(3, 1fr); }
    .gs-stat-row     { gap: 0.5rem; }
    .gs-stat-value   { font-size: 28px; }
    .gs-stat-pill    { padding: 0.9rem 0.5rem; }
    .gs-results-big  { font-size: 72px; }
    .gs-result-stat-val { font-size: 32px; }
    .gs-option-grid.cols-3,
    .gs-option-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 360px) {
    .gs-tables-grid  { grid-template-columns: repeat(2, 1fr); }
    .gs-stat-value   { font-size: 24px; }
}

/* ===== GAME RESUME MODAL =====
   Add this block to /css/gamestyles.css
   (append after the HOW TO PLAY MODAL section)
   ================================================ */

.gs-resume-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.50);
    z-index: 1060;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.gs-resume-overlay.open {
    display: flex;
}

.gs-resume-modal {
    background: #fff;
    border-radius: 20px;
    border: 1px solid #e9ecef;
    width: 100%;
    max-width: 420px;
    padding: 2.25rem 2rem 2rem;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.18);
    text-align: center;
}

.gs-resume-icon {
    font-size: 52px;
    line-height: 1;
    margin-bottom: 1rem;
}

.gs-resume-title {
    font-size: 22px;
    font-weight: 800;
    color: #1a1a2e;
    letter-spacing: -0.3px;
    margin: 0 0 0.4rem;
}

.gs-resume-summary {
    font-size: 14px;
    color: #6c757d;
    margin: 0 0 1.75rem;
    line-height: 1.5;
}

.gs-resume-actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.gs-resume-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.9rem 1.25rem;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    border: none;
    line-height: 1;
}

.gs-resume-btn-icon {
    font-size: 13px;
    opacity: 0.75;
}

/* Primary — Continue */
.gs-resume-btn-primary {
    background: var(--primary-color);
    color: var(--btn-text-color, #fff);
    box-shadow: 0 4px 14px var(--primary-shadow);
}

.gs-resume-btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-shadow);
}

/* Secondary — Restart with last settings */
.gs-resume-btn-secondary {
    background: #fff;
    color: #495057;
    border: 1.5px solid #dee2e6;
}

.gs-resume-btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Ghost — Change settings */
.gs-resume-btn-ghost {
    background: transparent;
    color: #adb5bd;
    border: 1.5px solid #e9ecef;
    font-size: 14px;
}

.gs-resume-btn-ghost:hover {
    border-color: #adb5bd;
    color: #495057;
}

@media (max-width: 480px) {
    .gs-resume-modal {
        padding: 1.75rem 1.25rem 1.5rem;
    }
    .gs-resume-title {
        font-size: 20px;
    }
}