* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 1400px;
}

h1 {
    text-align: center;
    color: white;
    font-size: 2.8em;
    margin-bottom: 35px;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    font-weight: 800;
    letter-spacing: 1px;
    animation: fadeInDown 0.6s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.panel {
    background: white;
    border-radius: 20px;
    padding: 35px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.settings-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.settings-section:last-of-type {
    border-bottom: none;
}

h2 {
    color: #2d3748;
    margin-bottom: 25px;
    font-size: 2em;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
}

.panel-header h2 {
    margin-bottom: 25px;
}

.header-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
}

#custom-mode-btn-top {
    padding: 10px 24px;
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102,126,234,0.2);
    letter-spacing: 0.3px;
}

#custom-mode-btn-top:hover {
    background: rgba(102,126,234,0.1);
    border-color: #5a67d8;
    color: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102,126,234,0.3);
}

#custom-mode-btn-top:active {
    transform: translateY(0) scale(0.98);
}

.help-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    font-size: 1.4em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102,126,234,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.help-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102,126,234,0.5);
}

.help-btn:active {
    transform: scale(0.95);
}

.game-panel-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 15px;
}

/* Help Modal */
.help-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.help-modal-content {
    background: white;
    border-radius: 16px;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.help-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 30px;
    border-bottom: 2px solid rgba(102,126,234,0.2);
    background: linear-gradient(135deg, rgba(102,126,234,0.1) 0%, rgba(118,75,162,0.1) 100%);
}

.help-modal-header h3 {
    margin: 0;
    font-size: 1.8em;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.close-help-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid #667eea;
    color: #667eea;
    font-size: 1.5em;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
}

.close-help-btn:hover {
    background: #667eea;
    color: white;
    transform: rotate(90deg);
}

.help-modal-body {
    padding: 30px;
}

.help-section {
    margin-bottom: 28px;
}

.help-section:last-child {
    margin-bottom: 0;
}

.help-section h4 {
    margin: 0 0 12px 0;
    font-size: 1.2em;
    color: #2d3748;
    font-weight: 700;
}

.help-section p {
    margin: 8px 0;
    color: #4a5568;
    line-height: 1.6;
}

.help-section ul {
    margin: 10px 0;
    padding-left: 24px;
    color: #4a5568;
}

.help-section li {
    margin: 8px 0;
    line-height: 1.6;
    font-size: 1.05em;
}

.help-section strong {
    color: #2d3748;
    font-weight: 600;
}

h3 {
    color: #555;
    margin-bottom: 12px;
    font-size: 1.3em;
}

label {
    display: block;
    margin-bottom: 12px;
    color: #555;
    font-size: 1em;
}

input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.2);
    cursor: pointer;
}

input[type="number"],
input[type="text"] {
    width: 100%;
    padding: 10px;
    margin-top: 8px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

input[type="number"]:focus,
input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

.subsettings {
    margin-left: 25px;
    margin-top: 12px;
}

.sub-subsettings {
    margin-left: 25px;
    margin-top: 8px;
}

.generator-container {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.generator-box {
    flex: 1;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}

.generator-box h4 {
    margin-bottom: 12px;
    color: #333;
    font-size: 1.1em;
}

.custom-intervals-box {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
}

.filter-buttons {
    display: flex;
    gap: 15px;
    margin-top: 10px;
    align-items: flex-start;
}

.button-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-labels {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.filter-labels label {
    margin: 0;
    padding: 5px 0;
}

.filter-spacer {
    height: 38px; /* Match button height to align labels */
}

/* Legacy support */
.prime-generator {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.prime-generator h4 {
    margin-bottom: 12px;
    color: #333;
    font-size: 1.1em;
}

textarea {
    width: 100%;
    padding: 10px;
    margin-top: 8px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    font-family: 'Courier New', monospace;
    resize: vertical;
    transition: border-color 0.3s;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
}

.inline-number {
    display: flex;
    align-items: center;
    gap: 8px;
}

.small-number-input {
    width: 80px !important;
    margin-top: 0 !important;
    display: inline-block;
}

.medium-number-input {
    width: 90px !important;
    margin-top: 0 !important;
    display: inline-block;
}

.btn-primary {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 10px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    padding: 10px 20px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.3s;
    margin: 5px;
}

.btn-secondary:hover {
    background: #5a6268;
}

.score-display {
    display: flex;
    justify-content: space-around;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.score-item {
    text-align: center;
}

.score-label {
    display: block;
    color: #666;
    font-size: 0.9em;
    margin-bottom: 5px;
}

#question-count,
#total-score,
#avg-score,
#timer {
    display: block;
    font-size: 1.8em;
    font-weight: bold;
    color: #667eea;
}

.interval-display {
    text-align: center;
    margin: 40px 0;
}

.interval-label {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 10px;
}

.interval-value {
    font-size: 4em;
    font-weight: bold;
    color: #333;
    font-family: 'Courier New', monospace;
}

/* Vertical fraction styling for JI intervals */
.fraction {
    display: inline-flex;
    flex-direction: column;
    vertical-align: middle;
    text-align: center;
}

.fraction .numerator {
    border-bottom: 2px solid #333;
    padding-bottom: 5px;
}

.fraction .denominator {
    padding-top: 5px;
}

/* Hidden interval styling for audio-only mode */
.hidden-interval {
    color: #999;
    font-style: italic;
}

.input-section {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 30px 0;
}

.input-section label {
    margin: 0;
    white-space: nowrap;
    font-weight: bold;
}

#answer-input {
    flex: 1;
    margin-top: 0;
    font-size: 1.2em;
}

.input-section .btn-primary {
    flex: 0 0 auto;
    width: auto;
    margin-top: 0;
    padding: 10px 30px;
}

.continuum-container {
    margin: 30px 0;
}

.continuum-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.9em;
    color: #666;
    font-weight: bold;
}

.continuum {
    position: relative;
    height: 80px;
    margin: 10px 0;
    cursor: pointer;
}

.continuum-track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 16px;
    background: linear-gradient(to right, #e0e0e0, #c0c0c0);
    border-radius: 8px;
    transform: translateY(-50%);
    pointer-events: none;
    transition: height 0.2s;
}

.continuum:hover .continuum-track {
    height: 20px;
}

.edo-notch {
    position: absolute;
    top: 50%;
    width: 3px;
    height: 30px;
    background: #888;
    transform: translate(-50%, -50%);
    z-index: 1;
    pointer-events: none;
}

.continuum-marker {
    position: absolute;
    top: 50%;
    width: 0;
    height: 0;
    transform: translate(-50%, -50%);
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s;
}

.continuum-marker.visible {
    opacity: 1;
}

.correct-marker {
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 16px solid #28a745;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.user-marker {
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 16px solid #dc3545;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.feedback {
    min-height: 60px;
    padding: 15px;
    margin: 20px 0;
    border-radius: 8px;
    text-align: center;
    font-size: 1.1em;
    font-weight: bold;
}

.feedback.correct {
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.feedback.incorrect {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

.game-controls {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

/* Mobile responsiveness */
@media (max-width: 600px) {
    h1 {
        font-size: 2em;
    }

    .panel {
        padding: 20px;
    }

    .interval-value {
        font-size: 3em;
    }

    .score-display {
        flex-direction: column;
        gap: 15px;
    }

    .input-section {
        flex-direction: column;
        align-items: stretch;
    }

    .input-section .btn-primary {
        width: 100%;
    }

    .generator-container {
        flex-direction: column;
    }

    /* Make audio controls more touch-friendly on mobile */
    .audio-controls-compact {
        padding: 12px 15px !important;
    }

    .audio-controls-compact h3 {
        font-size: 1.1em !important;
        margin-bottom: 10px !important;
    }

    .audio-controls-compact label {
        font-size: 0.95em !important;
        margin-bottom: 10px !important;
    }

    .audio-controls-compact select {
        font-size: 0.95em !important;
        padding: 8px !important;
    }

    .audio-controls-compact input[type="checkbox"] {
        transform: scale(1.4);
    }

    .audio-controls-compact input[type="range"] {
        height: 8px !important;
    }

    .audio-controls-compact #replay-interval-btn {
        padding: 10px 16px !important;
        font-size: 0.95em !important;
        margin-top: 10px !important;
    }
}

/* Quick Settings Section */
.quick-settings {
    background: linear-gradient(135deg, rgba(102,126,234,0.1) 0%, rgba(118,75,162,0.1) 100%);
    border: 2px solid rgba(102,126,234,0.3);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mode-selector-row {
    display: flex;
    gap: 30px;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 2px solid rgba(102,126,234,0.2);
}

.display-mode-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.mode-selector-label {
    font-size: 1.05em;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

.mode-selector-buttons {
    display: flex;
    gap: 10px;
}

.mode-selector-btn {
    padding: 10px 24px;
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mode-selector-btn:hover {
    background: rgba(102,126,234,0.1);
    transform: translateY(-1px);
}

.mode-selector-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102,126,234,0.4);
}

.mode-selector-btn:active {
    transform: translateY(0) scale(0.98);
}

.mode-selector-btn-readonly {
    padding: 10px 24px;
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 700;
    cursor: default;
    transition: all 0.25s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.6;
}

.mode-selector-btn-readonly.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102,126,234,0.4);
    opacity: 1;
}

.quick-setting-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1em;
    color: #2d3748;
    font-weight: 500;
    cursor: pointer;
}

.quick-setting-item input[type="checkbox"] {
    transform: scale(1.3);
    cursor: pointer;
}

.quick-setting-item .small-number-input {
    width: 60px !important;
    margin: 0 4px !important;
    padding: 4px 8px;
    display: inline-block;
    font-size: 0.95em;
}

/* Level Selection Styles */
.levels-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 30px;
    padding: 10px;
}

.level-pair {
    padding: 14px;
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(248,249,250,0.95) 100%);
    border: none;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.level-pair::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: height 0.3s ease;
}

/* Color-coded difficulty progression */
.level-pair:nth-child(1)::before { background: linear-gradient(90deg, #00d4ff, #0099ff); }
.level-pair:nth-child(2)::before { background: linear-gradient(90deg, #00b8ff, #0088ff); }
.level-pair:nth-child(3)::before { background: linear-gradient(90deg, #009cff, #0077ff); }
.level-pair:nth-child(4)::before { background: linear-gradient(90deg, #0080ff, #0066ff); }
.level-pair:nth-child(5)::before { background: linear-gradient(90deg, #0066ff, #3355ff); }
.level-pair:nth-child(6)::before { background: linear-gradient(90deg, #3355ff, #6644ff); }
.level-pair:nth-child(7)::before { background: linear-gradient(90deg, #6644ff, #9933ff); }
.level-pair:nth-child(8)::before { background: linear-gradient(90deg, #9933ff, #cc22ff); }
.level-pair:nth-child(9)::before { background: linear-gradient(90deg, #cc22ff, #ff2299); }
.level-pair:nth-child(10)::before { background: linear-gradient(90deg, #ff2299, #ff3366); }
.level-pair:nth-child(11)::before { background: linear-gradient(90deg, #ff3366, #ff5533); }
.level-pair:nth-child(12)::before { background: linear-gradient(90deg, #ff5533, #ff7700); }
.level-pair:nth-child(13)::before { background: linear-gradient(90deg, #ff7700, #ff9900); }
.level-pair:nth-child(14)::before { background: linear-gradient(90deg, #ff9900, #ffbb00); }
.level-pair:nth-child(15)::before { background: linear-gradient(90deg, #ffbb00, #ffdd00); }
.level-pair:nth-child(16)::before { background: linear-gradient(90deg, #ffdd00, #ffee00); }
.level-pair:nth-child(17)::before { background: linear-gradient(90deg, #ffee00, #ffff00); }
.level-pair:nth-child(18)::before { background: linear-gradient(90deg, #ffff00, #ffff33); }
.level-pair:nth-child(19)::before { background: linear-gradient(90deg, #ffff33, #ffff66); }
.level-pair:nth-child(20)::before { background: linear-gradient(90deg, #ffff66, #ffff99); }

.level-pair:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.18);
}

.level-pair:hover::before {
    height: 5px;
}

.pair-title {
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(0,0,0,0.08);
    font-size: 0.95em;
    font-weight: 700;
    color: #2d3748;
    text-align: center;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.level-card {
    position: relative;
    padding: 10px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border: 2px solid rgba(0,0,0,0.06);
    border-radius: 10px;
    transition: all 0.25s ease;
    width: 100%;
    text-align: left;
}

.level-card.level-btn {
    cursor: pointer;
    font-family: inherit;
    background: linear-gradient(135deg, #f0f2ff 0%, #f5f3ff 100%);
}

.level-card.level-btn:hover {
    border-color: rgba(102,126,234,0.4);
    box-shadow: 0 4px 12px rgba(102,126,234,0.15);
    transform: translateX(4px);
    background: linear-gradient(135deg, rgba(102,126,234,0.15) 0%, rgba(118,75,162,0.15) 100%);
}

.level-card.level-btn:active {
    transform: translateX(2px) scale(0.98);
}

.level-card:last-child {
    margin-bottom: 0;
}

.interval-count-tooltip {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85em;
    font-weight: 600;
    white-space: nowrap;
    z-index: 10;
    display: none;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.interval-count-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #764ba2;
}

.level-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.level-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 6px;
    font-size: 0.8em;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(102,126,234,0.3);
}

.level-desc {
    font-size: 0.8em;
    color: #4a5568;
    font-weight: 500;
    flex: 1;
}

.mode-buttons {
    display: flex;
    gap: 6px;
}

.mode-btn {
    flex: 1;
    padding: 8px 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.75em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(102,126,234,0.3);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
}

.mode-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.mode-btn:hover::before {
    left: 100%;
}

.mode-btn:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46a8 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102,126,234,0.4);
}

.mode-btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 6px rgba(102,126,234,0.3);
}

/* Different colors for each mode button */
.mode-btn[data-mode="normal"] {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    box-shadow: 0 2px 8px rgba(66,153,225,0.3);
}

.mode-btn[data-mode="normal"]:hover {
    background: linear-gradient(135deg, #3182ce 0%, #2c5aa0 100%);
    box-shadow: 0 6px 16px rgba(66,153,225,0.4);
}

.mode-btn[data-mode="reverse"] {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    box-shadow: 0 2px 8px rgba(72,187,120,0.3);
}

.mode-btn[data-mode="reverse"]:hover {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
    box-shadow: 0 6px 16px rgba(72,187,120,0.4);
}


#back-to-levels-btn {
    margin-bottom: 20px;
    padding: 8px 18px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.9em;
    cursor: pointer;
}

#back-to-levels-btn:hover {
    background: #5a6268;
}

/* Mobile adjustments for level selection */
@media (max-width: 1200px) {
    .levels-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
}

@media (max-width: 900px) {
    .levels-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .level-pair {
        padding: 12px;
    }

    .pair-title {
        font-size: 0.9em;
    }
}

@media (max-width: 600px) {
    .levels-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 5px;
    }

    .level-pair {
        padding: 16px;
    }

    .pair-title {
        font-size: 0.95em;
        margin-bottom: 12px;
    }

    .level-card {
        padding: 12px;
        margin-bottom: 10px;
    }

    .level-num {
        min-width: 28px;
        height: 28px;
        font-size: 0.85em;
    }

    .level-desc {
        font-size: 0.85em;
    }

    .mode-btn {
        padding: 8px 10px;
        font-size: 0.8em;
    }

    #custom-mode-btn {
        padding: 14px 32px;
        font-size: 1em;
    }

    .quick-settings {
        padding: 15px;
        margin-bottom: 20px;
    }

    .quick-setting-item {
        font-size: 0.9em;
        flex-wrap: wrap;
    }

    .quick-setting-item .small-number-input {
        width: 50px !important;
    }

    .mode-selector-row {
        flex-direction: column;
        gap: 15px;
    }

    .mode-selector-label {
        font-size: 0.95em;
    }

    .mode-selector-btn,
    .mode-selector-btn-readonly {
        padding: 8px 18px;
        font-size: 0.9em;
    }
}
