/* Morse Story Time - Dark Theme Styles */

:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --accent-primary: #f0a500;
    --accent-secondary: #d4940a;
    --accent-glow: rgba(240, 165, 0, 0.3);
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --success: #3fb950;
    --error: #f85149;
    --border: #30363d;
    --shadow: rgba(0, 0, 0, 0.4);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Header */
header {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

header h1 {
    color: var(--accent-primary);
    font-size: 1.5rem;
    letter-spacing: 1px;
}

nav {
    display: flex;
    gap: 0.5rem;
}

.nav-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-btn:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.nav-btn.active {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
    color: var(--bg-primary);
}

.nav-link {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.discord-link {
    border-color: #5865F2;
    color: #5865F2;
}

.discord-link:hover {
    background-color: #5865F2;
    border-color: #5865F2;
    color: white;
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Views */
.view {
    animation: fadeIn 0.3s ease;
}

.view.hidden,
.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn.primary {
    background-color: var(--accent-primary);
    color: var(--bg-primary);
}

.btn.primary:hover {
    background-color: var(--accent-secondary);
    box-shadow: 0 0 20px var(--accent-glow);
}

.btn.secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn.secondary:hover {
    border-color: var(--accent-primary);
}

.btn.large {
    padding: 1rem 2rem;
    font-size: 1.25rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.back-btn {
    background: transparent;
    border: none;
    color: var(--accent-primary);
    cursor: pointer;
    font-size: 1rem;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
}

.back-btn:hover {
    text-decoration: underline;
}

.link-btn {
    color: var(--accent-primary);
    text-decoration: none;
}

.link-btn:hover {
    text-decoration: underline;
}

/* Tutorial Intro */
.tutorial-intro-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    max-width: 600px;
    margin: 2rem auto;
    text-align: center;
}

.tutorial-intro-card h2 {
    color: var(--accent-primary);
    margin-bottom: 1.5rem;
}

.tutorial-guide {
    text-align: left;
    margin-bottom: 1.5rem;
}

.guide-section {
    background-color: var(--bg-tertiary);
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.guide-section h3 {
    margin-bottom: 0.75rem;
    color: var(--accent-primary);
    font-size: 1rem;
}

.guide-section ol,
.guide-section ul {
    margin-left: 1.25rem;
    margin-bottom: 0;
}

.guide-section li {
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
}

.guide-section .note {
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    background-color: var(--bg-secondary);
    border-left: 3px solid var(--accent-primary);
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--accent-primary);
}

.tutorial-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    margin-top: 1.5rem;
}

.button-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* How to Play */
.how-to-play-content {
    max-width: 800px;
    margin: 0 auto;
}

.how-to-play-content h2 {
    color: var(--accent-primary);
    margin-bottom: 2rem;
    text-align: center;
}

.how-to-play-content .section {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.how-to-play-content .section h3 {
    color: var(--accent-primary);
    margin-bottom: 1rem;
}

.how-to-play-content ul,
.how-to-play-content ol {
    margin-left: 1.5rem;
}

.how-to-play-content li {
    margin-bottom: 0.5rem;
}

.morse-reference {
    overflow-x: auto;
}

.morse-chart {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.morse-group h4 {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.morse-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.5rem;
}

.morse-grid span {
    background-color: var(--bg-tertiary);
    padding: 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.how-to-play-content > .btn {
    display: block;
    margin: 2rem auto 0;
}

/* Filter Controls */
.filter-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1rem;
    padding: 1rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-group label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.filter-btn.active {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
    color: var(--bg-primary);
    font-weight: 500;
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Story Selection Grid */
.story-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.story-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.story-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--shadow);
}

.story-card.tutorial {
    border-color: var(--accent-primary);
    background: linear-gradient(135deg, var(--bg-secondary), rgba(240, 165, 0, 0.1));
}

.story-card.completed {
    border-color: var(--success);
}

.story-card .title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.story-card .story-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.story-card .meta-separator {
    color: var(--text-muted);
}

.story-card .difficulty-label {
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.story-card .difficulty-label.tutorial {
    background-color: var(--accent-primary);
    color: var(--bg-primary);
}

.story-card .difficulty-label.easy {
    background-color: var(--success);
    color: var(--bg-primary);
}

.story-card .difficulty-label.medium {
    background-color: #f59e0b;
    color: var(--bg-primary);
}

.story-card .difficulty-label.hard {
    background-color: var(--error);
    color: white;
}

.story-card .difficulty-label.expert {
    background: linear-gradient(135deg, #9333ea, #4f46e5);
    color: white;
    font-weight: 700;
}

.story-card .question-type {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-style: italic;
}

/* Legacy star styles - keeping for reference but no longer used */
.story-card .difficulty {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.story-card .difficulty .star {
    color: var(--accent-primary);
}

.story-card .difficulty .star.empty {
    color: var(--text-muted);
}

.story-card .description {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.story-card .badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.story-card .badge.tutorial-badge {
    background-color: var(--accent-primary);
    color: var(--bg-primary);
}

.story-card .badge.completed-badge {
    background-color: var(--success);
    color: var(--bg-primary);
}

.story-card .badge.classic-badge {
    background-color: #8b5cf6;
    color: #fff;
}

/* Listening View */
.listening-container {
    max-width: 700px;
    margin: 0 auto;
}

.listening-container h2 {
    color: var(--accent-primary);
    text-align: center;
    margin-bottom: 0.5rem;
}

.difficulty-display {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Audio Controls */
.audio-controls {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.speed-control {
    margin-bottom: 1.5rem;
}

.speed-control label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.speed-control input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--bg-tertiary);
    outline: none;
    -webkit-appearance: none;
}

.speed-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    transition: box-shadow 0.2s;
}

.speed-control input[type="range"]::-webkit-slider-thumb:hover {
    box-shadow: 0 0 10px var(--accent-glow);
}

.tone-control {
    margin-bottom: 1.5rem;
}

.tone-control label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.tone-control input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--bg-tertiary);
    outline: none;
    -webkit-appearance: none;
}

.tone-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    transition: box-shadow 0.2s;
}

.tone-control input[type="range"]::-webkit-slider-thumb:hover {
    box-shadow: 0 0 10px var(--accent-glow);
}

.farnsworth-control {
    margin-bottom: 1.5rem;
}

.farnsworth-control label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.farnsworth-control input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--bg-tertiary);
    outline: none;
    -webkit-appearance: none;
}

.farnsworth-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    transition: box-shadow 0.2s;
}

.farnsworth-control input[type="range"]::-webkit-slider-thumb:hover {
    box-shadow: 0 0 10px var(--accent-glow);
}

.farnsworth-hint {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background-color: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: var(--accent-primary);
    width: 0%;
    transition: width 0.1s;
}

#progress-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    min-width: 40px;
}

.playback-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

#play-pause-btn {
    min-width: 80px;
}

#play-pause-btn .pause-icon.hidden,
#play-pause-btn .play-icon.hidden {
    display: none;
}

/* Notes Section */
.notes-section {
    margin-bottom: 1.5rem;
}

.notes-section label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

#notes-field {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
}

#notes-field:focus {
    outline: none;
    border-color: var(--accent-primary);
}

#notes-field::placeholder {
    color: var(--text-muted);
}

/* Quiz Section */
.quiz-section {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.quiz-section h3 {
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
}

.quiz-instructions {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.question-block {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.question-block:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.question-text {
    font-weight: 500;
    margin-bottom: 1rem;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.option-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background-color: var(--bg-tertiary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.option-label:hover {
    background-color: var(--border);
}

.option-label input[type="radio"] {
    accent-color: var(--accent-primary);
    width: 18px;
    height: 18px;
}

/* Text input for hard difficulty */
.text-input-container {
    margin-top: 0.5rem;
}

.text-answer {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
}

.text-answer:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.text-answer::placeholder {
    color: var(--text-muted);
}

#submit-quiz {
    margin-top: 1.5rem;
    width: 100%;
}

/* Results Section */
.results-section {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
}

.results-section h3 {
    color: var(--accent-primary);
    margin-bottom: 1rem;
}

.result-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background-color: var(--bg-tertiary);
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.result-item .icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.result-item.correct .icon {
    color: var(--success);
}

.result-item.incorrect .icon {
    color: var(--error);
}

.result-item .question {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.result-item .answer {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.result-item.incorrect .correct-answer {
    color: var(--success);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.results-actions {
    margin-top: 1.5rem;
    text-align: center;
}

#score-display {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.results-actions .btn {
    margin: 0 0.5rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}

.footer-credits {
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.footer-links {
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

.footer-links a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
}

.footer-separator {
    margin: 0 0.75rem;
    color: var(--text-muted);
}

/* How to Play note style */
.how-to-play-content .note {
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    background-color: var(--bg-tertiary);
    border-left: 3px solid var(--accent-primary);
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--accent-primary);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-content h2 {
    color: var(--accent-primary);
    margin-bottom: 1.5rem;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-section {
    background-color: var(--bg-tertiary);
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.modal-section h3 {
    margin-bottom: 0.75rem;
    color: var(--accent-primary);
    font-size: 1rem;
}

.modal-section ol,
.modal-section ul {
    margin-left: 1.25rem;
    margin-bottom: 0;
}

.modal-section li {
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
}

/* Debug Section */
.debug-toggle {
    text-align: center;
    margin-top: 2rem;
}

.debug-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    opacity: 0.4;
    transition: opacity 0.2s;
    letter-spacing: 2px;
}

.debug-btn:hover {
    opacity: 0.8;
}

.debug-section {
    margin-top: 1rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    animation: fadeIn 0.3s ease;
}

.debug-content h4 {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
    margin-top: 1rem;
}

.debug-content h4:first-child {
    margin-top: 0;
}

#debug-story-text {
    background-color: var(--bg-tertiary);
    padding: 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 300px;
    overflow-y: auto;
    color: var(--text-secondary);
}

.debug-question-item {
    background-color: var(--bg-tertiary);
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 0.75rem;
}

.debug-question-item:last-child {
    margin-bottom: 0;
}

.debug-question-text {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.debug-answer {
    color: var(--success);
    font-size: 0.9rem;
}

.debug-options {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* Responsive - Tablet */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        text-align: center;
    }

    main {
        padding: 1rem;
    }

    .story-grid {
        grid-template-columns: 1fr;
    }

    .morse-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .button-group {
        flex-direction: column;
        width: 100%;
    }

    .button-group .btn {
        width: 100%;
    }

    .results-actions .btn {
        display: block;
        width: 100%;
        margin: 0.5rem 0;
    }
}

/* Responsive - Small Phones */
@media (max-width: 480px) {
    /* Header */
    header {
        padding: 0.75rem 1rem;
    }

    header h1 {
        font-size: 1.25rem;
    }

    nav {
        width: 100%;
        justify-content: center;
        gap: 0.4rem;
    }

    .nav-btn {
        flex: 1 1 45%;
        min-height: 44px;
        text-align: center;
        padding: 0.5rem 0.5rem;
        font-size: 0.85rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Main content */
    main {
        padding: 0.75rem;
    }

    /* Container max-widths */
    .modal-content,
    .tutorial-intro-card,
    .listening-container,
    .how-to-play-content {
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    .tutorial-intro-card {
        padding: 1.25rem;
        margin: 1rem 0;
    }

    /* Filter controls */
    .filter-controls {
        flex-direction: column;
        gap: 1rem;
        padding: 0.75rem;
    }

    .filter-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        width: 100%;
    }

    .filter-buttons {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
    }

    .filter-btn {
        flex: 1 1 auto;
        min-height: 44px;
        font-size: 0.9rem;
        padding: 0.5rem 0.6rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Audio controls */
    .audio-controls {
        padding: 1rem;
    }

    /* Touch-friendly slider thumbs */
    .speed-control input[type="range"]::-webkit-slider-thumb,
    .tone-control input[type="range"]::-webkit-slider-thumb,
    .farnsworth-control input[type="range"]::-webkit-slider-thumb {
        width: 28px;
        height: 28px;
    }

    .playback-buttons {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .playback-buttons .btn {
        min-height: 44px;
    }

    #play-pause-btn {
        min-width: 70px;
    }

    /* Quiz section */
    .quiz-section {
        padding: 1rem;
    }

    .option-label {
        padding: 1rem;
        min-height: 44px;
    }

    .option-label input[type="radio"] {
        width: 22px;
        height: 22px;
    }

    /* Results section */
    .results-section {
        padding: 1rem;
    }

    /* Guide sections */
    .guide-section {
        padding: 0.75rem 1rem;
    }

    .guide-section li {
        font-size: 0.9rem;
    }

    /* Modal */
    .modal {
        padding: 0.5rem;
    }

    .modal-content {
        padding: 1.25rem;
        border-radius: 8px;
    }

    .modal-section {
        padding: 0.75rem 1rem;
    }

    .modal-section li {
        font-size: 0.9rem;
    }

    /* How to play */
    .how-to-play-content .section {
        padding: 1rem;
    }

    /* Story cards */
    .story-card {
        padding: 1.25rem;
    }

    .story-card .story-meta {
        font-size: 0.9rem;
    }

    /* Footer */
    footer {
        padding: 1.5rem 1rem;
    }

    .footer-links {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .footer-separator {
        display: none;
    }

    /* Notes field */
    #notes-field {
        min-height: 100px;
        font-size: 16px; /* Prevents iOS zoom on focus */
    }

    /* Text answers */
    .text-answer {
        font-size: 16px; /* Prevents iOS zoom on focus */
    }

    /* Back button */
    .back-btn {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
}
