
/* ============================================================
   BATLINGO - SOLO PRACTICE
   Survival / Practice / Results / Review
   Responsive Desktop & Mobile
============================================================ */


/* ============================================================
   01. HIDDEN STATE
============================================================ */

.solo-settings.hidden,
.practice-options.hidden,
.practice-screen.hidden {
    display: none !important;
}


/* ============================================================
   02. SAFE CONFIG LAYOUT
   Prevent horizontal overflow
============================================================ */

#configScreen {
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
}

#configScreen *,
#configScreen *::before,
#configScreen *::after {
    box-sizing: border-box;
}

#configScreen .solo-settings,
#configScreen .practice-options {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}


/* ============================================================
   03. SOLO MODE SETTINGS
============================================================ */

.solo-settings {
    display: block;

    margin: 16px 0;
    padding: 16px;

    border: 1px solid #334155;
    border-radius: 16px;

    background: rgba(15, 23, 42, 0.94);

    color: #f8fafc;
}

.solo-settings-title {
    margin-bottom: 14px;

    color: #cbd5e1;

    font-size: 12px;
    font-weight: 800;

    letter-spacing: 1.3px;
    text-align: center;
}


/* ============================================================
   04. SURVIVAL / PRACTICE CARDS
============================================================ */

.solo-type-selector {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 12px;

    min-width: 0;
}

.solo-type-btn {
    position: relative;

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    gap: 7px;

    width: 100%;
    min-width: 0;
    min-height: 112px;

    padding: 14px 10px;

    border: 2px solid #334155;
    border-radius: 14px;

    background: #111827;
    color: #f8fafc;

    text-align: center;

    cursor: pointer;

    transition:
        border-color 0.15s ease,
        background-color 0.15s ease,
        box-shadow 0.15s ease;
}

.solo-type-btn:hover {
    border-color: #64748b;
    background: #1e293b;
}

.solo-type-btn.active {
    border-color: #fbbf24;

    background:
        rgba(251, 191, 36, 0.12);

    box-shadow:
        0 0 0 1px rgba(251, 191, 36, 0.12),
        0 0 18px rgba(251, 191, 36, 0.08);
}

.solo-type-btn.active:hover {
    border-color: #fbbf24;
}

.solo-type-btn:focus-visible {
    outline: 2px solid #fbbf24;
    outline-offset: 3px;
}

.solo-type-icon {
    display: block;

    font-size: 30px;
    line-height: 1.2;
}

.solo-type-btn strong {
    color: #f8fafc;

    font-size: 14px;
    font-weight: 900;

    letter-spacing: 0.8px;
}

.solo-type-btn small {
    max-width: 100%;

    color: #94a3b8;

    font-size: 10px;
    font-weight: 600;

    line-height: 1.5;
    overflow-wrap: anywhere;
}

.solo-type-btn.active small {
    color: #e2e8f0;
}


/* ============================================================
   05. MODE DESCRIPTION
============================================================ */

.solo-mode-description {
    margin: 14px 0 0;

    color: #94a3b8;

    font-size: 12px;
    line-height: 1.6;

    text-align: center;
}


/* ============================================================
   06. PRACTICE OPTIONS
============================================================ */

.practice-options {
    display: flex;
    flex-direction: column;

    gap: 12px;

    margin: 16px 0;
    padding: 18px 16px;

    border: 1px solid #334155;
    border-radius: 16px;

    background: rgba(15, 23, 42, 0.94);

    color: #f8fafc;
}


/* ============================================================
   07. PRACTICE HEADINGS
============================================================ */

.practice-setting-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    min-width: 0;
    margin-top: 4px;

    color: #cbd5e1;

    font-size: 12px;
    font-weight: 800;
}

.practice-setting-heading label,
.practice-setting-heading span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.practice-setting-heading strong {
    flex-shrink: 0;

    color: #fbbf24;

    font-size: 20px;
    font-weight: 900;

    font-variant-numeric: tabular-nums;
}


/* ============================================================
   08. NUMBER OF QUESTIONS PRESETS
============================================================ */

.practice-presets {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 9px;

    min-width: 0;
}

.practice-presets button {
    width: 100%;
    min-width: 0;
    min-height: 44px;

    padding: 8px;

    border: 1px solid #475569;
    border-radius: 10px;

    background: #1e293b;
    color: #f8fafc;

    font-size: 14px;
    font-weight: 900;

    cursor: pointer;

    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}

.practice-presets button:hover {
    border-color: #94a3b8;
}

.practice-presets button.active {
    border-color: #fbbf24;

    background:
        rgba(251, 191, 36, 0.12);

    color: #fbbf24;
}

.practice-presets button:focus-visible {
    outline: 2px solid #fbbf24;
    outline-offset: 2px;
}


/* ============================================================
   09. RANGE SLIDERS
============================================================ */

.practice-options input[type="range"] {
    display: block;

    width: 100%;
    max-width: 100%;
    min-width: 0;

    height: 24px;

    margin: 0;
    padding: 0;

    border: 0;
    background: transparent;

    box-sizing: border-box;

    accent-color: #fbbf24;

    cursor: pointer;

    touch-action: pan-y;
}

.practice-options input[type="range"]:focus-visible {
    outline: 2px solid #fbbf24;
    outline-offset: 3px;
    border-radius: 6px;
}

.practice-range-labels {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 10px;

    color: #94a3b8;

    font-size: 10px;
    font-weight: 600;

    letter-spacing: 0.3px;
}

.practice-range-labels span {
    min-width: 0;
}


/* ============================================================
   10. PRACTICE NOTE
============================================================ */

.practice-note {
    margin: 8px 0 0;

    padding: 10px;

    border: 1px solid #334155;
    border-radius: 9px;

    background: rgba(15, 23, 42, 0.6);

    color: #94a3b8;

    font-size: 10px;
    font-weight: 700;

    line-height: 1.6;

    text-align: center;
}


/* ============================================================
   11. PRACTICE GAMEPLAY
   Hide Survival-only elements
============================================================ */

.game-screen.solo-practice-mode .game-header,
.game-screen.solo-practice-mode .combo {
    display: none !important;
}

.game-screen.solo-practice-mode .game-mode-info {
    margin-top: 12px;
}


/* ============================================================
   12. PRACTICE RESULTS / REVIEW SCREEN
============================================================ */

.practice-screen {
    position: fixed;

    inset: 0;

    z-index: 100;

    display: flex;

    align-items: flex-start;
    justify-content: center;

    width: 100%;
    height: 100dvh;

    overflow-x: hidden;
    overflow-y: auto;

    padding:
        max(24px, env(safe-area-inset-top))
        16px
        max(24px, env(safe-area-inset-bottom));

    background: #080d17;

    color: #f8fafc;

    box-sizing: border-box;
}


/* ============================================================
   13. PRACTICE PANEL
============================================================ */

.practice-panel {
    width: 100%;
    max-width: 600px;
    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: 16px;

    margin: 0 auto;
    padding: 24px;

    border: 1px solid #334155;
    border-radius: 20px;

    background: #111827;

    box-sizing: border-box;
}

.practice-panel *,
.practice-panel *::before,
.practice-panel *::after {
    box-sizing: border-box;
}

.practice-result-heading {
    margin: 0;

    color: #f8fafc;

    text-align: center;

    font-size: 24px;
    font-weight: 900;

    letter-spacing: 1px;
}


/* ============================================================
   14. ACCURACY
============================================================ */

.practice-accuracy {
    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    gap: 4px;
}

.practice-accuracy strong {
    color: #22c55e;

    font-size: clamp(42px, 9vw, 60px);
    font-weight: 900;

    line-height: 1.15;

    font-variant-numeric: tabular-nums;
}

.practice-accuracy span {
    color: #94a3b8;

    font-size: 11px;
    font-weight: 700;

    letter-spacing: 2px;
}


/* ============================================================
   15. RESULT STATISTICS
============================================================ */

.practice-stats {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 9px;

    min-width: 0;
}

.practice-stat {
    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    gap: 8px;

    min-width: 0;
    min-height: 90px;

    padding: 12px 5px;

    border: 1px solid #334155;
    border-radius: 12px;

    background: #1e293b;

    color: #f8fafc;

    cursor: pointer;
}

.practice-stat:hover {
    border-color: #64748b;
}

.practice-stat strong {
    font-size: clamp(20px, 4vw, 28px);
    font-weight: 900;

    font-variant-numeric: tabular-nums;
}

.practice-stat span {
    font-size: 10px;
    font-weight: 700;
}

.practice-stat.correct strong {
    color: #22c55e;
}

.practice-stat.wrong strong {
    color: #ef4444;
}

.practice-stat.timeout strong {
    color: #fbbf24;
}

.practice-total {
    margin: 0;

    color: #94a3b8;

    text-align: center;

    font-size: 12px;
    font-weight: 800;
}


/* ============================================================
   16. RESULT BUTTONS
============================================================ */

.practice-panel > .battle-button,
.practice-panel > .secondary-button {
    width: 100%;
    min-height: 48px;
    margin: 0;
}


/* ============================================================
   17. REVIEW HEADER
============================================================ */

.practice-review-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 12px;
}

.practice-review-header h2 {
    flex: 1;

    min-width: 0;
    margin: 0;

    color: #f8fafc;

    font-size: 20px;
    font-weight: 900;

    text-align: center;
}

.practice-review-header button,
.practice-review-navigation button,
.practice-review-filters button {
    min-height: 42px;

    padding: 9px 13px;

    border: 1px solid #334155;
    border-radius: 9px;

    background: #1e293b;
    color: #f8fafc;

    font-size: 12px;
    font-weight: 800;

    cursor: pointer;
}

.practice-review-header button:hover,
.practice-review-navigation button:hover,
.practice-review-filters button:hover {
    border-color: #64748b;
}


/* ============================================================
   18. REVIEW FILTERS
============================================================ */

.practice-review-filters {
    display: flex;
    gap: 10px;
}

.practice-review-filters button {
    flex: 1;
    min-width: 0;
}

.practice-review-filters button.active {
    border-color: #fbbf24;

    background:
        rgba(251, 191, 36, 0.12);

    color: #fbbf24;
}


/* ============================================================
   19. QUESTION GRID
============================================================ */

.practice-review-grid {
    display: grid;

    grid-template-columns:
        repeat(5, minmax(0, 1fr));

    gap: 8px;

    min-width: 0;
}

.practice-review-grid button {
    min-width: 0;
    min-height: 44px;

    padding: 6px 3px;

    border: 1px solid #475569;
    border-radius: 9px;

    background: #1e293b;
    color: #f8fafc;

    font-size: 13px;
    font-weight: 900;

    cursor: pointer;
}

.practice-review-grid button.correct {
    border-color: #22c55e;
}

.practice-review-grid button.wrong {
    border-color: #ef4444;
}

.practice-review-grid button.timeout {
    border-color: #fbbf24;
}

.practice-review-grid button.active {
    outline: 2px solid #e2e8f0;
    outline-offset: 2px;
}

.practice-review-grid button:hover {
    background: #334155;
}


/* ============================================================
   20. QUESTION REVIEW CARD
============================================================ */

.practice-review-card {
    display: flex;
    flex-direction: column;

    gap: 14px;

    min-width: 0;

    padding: 16px;

    border: 1px solid #334155;
    border-radius: 13px;

    background: rgba(15, 23, 42, 0.5);
}

#practiceReviewNumber {
    color: #94a3b8;

    font-size: 12px;
    font-weight: 900;

    letter-spacing: 0.6px;
}

#practiceReviewQuestion {
    color: #f8fafc;

    font-size: clamp(22px, 5vw, 32px);
    font-weight: 800;

    line-height: 1.4;

    text-align: center;

    overflow-wrap: anywhere;
}

#practiceReviewReading {
    color: #fbbf24;

    font-size: 15px;
    text-align: center;
}

#practiceReviewAnswers {
    display: grid;
    gap: 9px;
}

.practice-review-answer {
    min-width: 0;

    padding: 13px;

    border: 1px solid #334155;
    border-radius: 10px;

    background: #1e293b;

    color: #f8fafc;

    font-size: 14px;
    line-height: 1.5;

    overflow-wrap: anywhere;
}

.practice-review-answer.correct {
    border-color: #22c55e;

    background:
        rgba(34, 197, 94, 0.13);
}

.practice-review-answer.wrong {
    border-color: #ef4444;

    background:
        rgba(239, 68, 68, 0.13);
}

#practiceReviewExplanation {
    color: #cbd5e1;

    font-size: 13px;
    line-height: 1.7;

    overflow-wrap: anywhere;
}


/* ============================================================
   21. REVIEW NAVIGATION
============================================================ */

.practice-review-navigation {
    display: flex;
    justify-content: space-between;

    gap: 10px;
}

.practice-review-navigation button {
    flex: 1;
    min-width: 0;
}

.practice-review-navigation button:disabled {
    opacity: 0.4;
    cursor: default;
}


/* ============================================================
   22. MOBILE
============================================================ */

@media (max-width: 600px) {

    .solo-settings,
    .practice-options {
        margin: 12px 0;
        padding: 13px;
    }

    .solo-type-selector {
        gap: 8px;
    }

    .solo-type-btn {
        min-height: 98px;
        padding: 11px 6px;
    }

    .solo-type-icon {
        font-size: 26px;
    }

    .solo-type-btn strong {
        font-size: 12px;
    }

    .solo-type-btn small {
        font-size: 9px;
    }

    .practice-options {
        gap: 11px;
    }

    .practice-setting-heading {
        font-size: 11px;
    }

    .practice-setting-heading strong {
        font-size: 18px;
    }

    .practice-presets button {
        min-height: 42px;
    }

    .practice-screen {
        padding:
            max(12px, env(safe-area-inset-top))
            10px
            max(16px, env(safe-area-inset-bottom));
    }

    .practice-panel {
        gap: 14px;
        padding: 16px;
        border-radius: 15px;
    }

    .practice-result-heading {
        font-size: 20px;
    }

    .practice-stat {
        min-height: 78px;
    }

    .practice-stat strong {
        font-size: 23px;
    }

    .practice-stat span {
        font-size: 9px;
    }

    .practice-review-grid {
        gap: 6px;
    }

    .practice-review-card {
        padding: 12px;
    }

    #practiceReviewQuestion {
        font-size: clamp(21px, 6vw, 28px);
    }
}


/* ============================================================
   23. SMALL MOBILE
============================================================ */

@media (max-width: 360px) {

    .solo-type-btn {
        min-height: 92px;
    }

    .solo-type-btn strong {
        font-size: 11px;
    }

    .practice-review-header h2 {
        font-size: 17px;
    }

    .practice-review-grid button {
        min-height: 40px;
        font-size: 11px;
    }
}


/* ============================================================
   24. REDUCED MOTION
============================================================ */

@media (prefers-reduced-motion: reduce) {

    .solo-type-btn,
    .practice-presets button {
        transition: none;
    }
}
