/* Fleet Edge Node Mark2 - Styles */

/* ========== THEME SYSTEM ========== */
:root {
    /* Shared colors */
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --danger-color: #dc2626;
    --danger-hover: #b91c1c;
    --success-color: #16a34a;
    --success-hover: #15803d;
    --warning-color: #ea580c;
}

/* Dark Theme (Default) */
[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #3a3a3a;
    --text-primary: #e5e5e5;
    --text-secondary: #a3a3a3;
    --text-muted: #6b7280;
    --border-color: #404040;
    --shadow: rgba(0, 0, 0, 0.3);
}

/* Light Theme */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --text-primary: #111827;
    --text-secondary: #374151;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --shadow: rgba(0, 0, 0, 0.1);
}

/* ========== SCROLLBAR STYLES ========== */
/* Webkit browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 6px;
    border: 2px solid var(--bg-secondary);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #4a4a4a;
}

[data-theme="light"] ::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 6px;
    border: 2px solid var(--bg-secondary);
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: #d1d5db;
}

/* Firefox */
[data-theme="dark"] * {
    scrollbar-width: thin;
    scrollbar-color: var(--bg-tertiary) var(--bg-secondary);
}

[data-theme="light"] * {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) var(--bg-secondary);
}

/* ========== RESET & BASE ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ========== MAIN CONTAINER ========== */
.main-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 1rem;
    overflow: hidden;
}

/* ========== GRID LAYOUT (2x2) ========== */
.grid-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: auto 1fr auto;
    gap: 1rem;
    flex: 1;
    margin-bottom: 1rem;
    min-height: 0;
}

.grid-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px var(--shadow);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.grid-item h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.grid-item h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

/* Game Status (Top Left - Compact) */
.game-status {
    grid-column: 1;
    grid-row: 1;
    overflow: hidden;
}

.status-text {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Hunter Mission Info in Game Status */
.hunter-mission-info {
    margin-top: 1rem;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
    padding: 1rem;
}

.hunter-mission-info h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.hunter-mission-info h3 span#hunterTarget {
    color: var(--primary-color);
    font-weight: 700;
}

.hunter-mission-info p#hunterDeadline {
    color: var(--warning-color);
    font-weight: 600;
    font-size: 1.05rem;
    margin: 0.5rem 0 0 0;
}

/* Leaderboard (Top Right - Tall) */
.leaderboard {
    grid-column: 2;
    grid-row: 1 / 3;
}

.leaderboard-content {
    flex: 1;
    overflow-y: auto;
}

/* Leaderboard Entries */
.leaderboard-entry {
    margin-bottom: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    overflow: hidden;
}

.leaderboard-main-row {
    display: grid;
    grid-template-columns: 2.5rem 1fr 3rem 2rem;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.leaderboard-main-row:hover {
    background: var(--bg-primary);
}

.leaderboard-rank {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--primary-color);
}

.leaderboard-username {
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.leaderboard-score {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--success-color);
    text-align: right;
}

.leaderboard-expand-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.2s ease, transform 0.2s ease;
}

.leaderboard-expand-btn:hover {
    color: var(--primary-color);
    transform: scale(1.2);
}

/* Challenges Accordion */
.leaderboard-challenges {
    padding: 0.75rem;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
}

.challenge-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.25rem;
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.challenge-name {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.challenge-score {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.no-challenges {
    padding: 0.75rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-style: italic;
}

/* Narrator (Bottom Left - Large) */
.narrator {
    grid-column: 1;
    grid-row: 2 / 4;
    min-height: 0;
    max-height: 100%;
}

.narrator-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    max-height: 100%;
}

/* Narrative Entries */
.narrative-entry {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: var(--bg-tertiary);
    border-left: 3px solid var(--primary-color);
    border-radius: 4px;
    font-size: 0.9375rem;
    line-height: 1.5;
    animation: slideInFromLeft 0.3s ease-out;
}

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

.narrative-timestamp {
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 500;
}

.narrative-message {
    color: var(--text-primary);
    font-weight: 400;
}

/* Edge Node (Bottom Right - Compact) */
.edge-node {
    grid-column: 2;
    grid-row: 3;
    overflow-y: auto;
}

/* Placeholder Text */
.placeholder-text {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    padding: 2rem;
}

/* ========== STATUS BAR ========== */
.status-bar {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.status-indicator {
    font-size: 1rem;
}

/* ========== NODE INFO ========== */
.node-info {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.info-row:last-child {
    border-bottom: none;
}

.info-row .label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.info-row .value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
    word-break: break-all;
    max-width: 60%;
}

/* ========== REGISTRATION SECTION ========== */
.registration-section {
    margin-bottom: 1rem;
}

.qr-scanner-container {
    margin-bottom: 1rem;
}

#qrReader {
    width: 100%;
    max-width: 100%;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

/* ========== FORMS ========== */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.875rem;
}

.form-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.status-message {
    padding: 0.75rem;
    border-radius: 8px;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 0.75rem;
}

/* ========== BUTTONS ========== */
.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    margin-bottom: 0.75rem;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
}

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

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-secondary);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: var(--success-hover);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: var(--danger-hover);
}

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

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

/* ========== HUNTER SECTION ========== */
.hunter-section {
    border-radius: 8px;
    padding: 0;
    margin-bottom: 1rem;
}

.hunter-section h3 {
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.hunter-info {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 1rem;
    backdrop-filter: blur(10px);
}

.hunter-info .info-row {
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.hunter-info .info-row .label,
.hunter-info .info-row .value {
    color: white;
}

.photo-capture {
    margin: 0;
}

.photo-capture .btn-primary {
    background: var(--primary-color);
    color: white;
}

.photo-capture .btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
}

.photo-preview {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    backdrop-filter: blur(10px);
}

.photo-preview img {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 1rem;
    background: rgba(0, 0, 0, 0.2);
}

.upload-status {
    padding: 0.75rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    margin-top: 0.75rem;
}

.upload-status:empty {
    display: none;
}

.upload-status.uploading {
    background: rgba(234, 179, 8, 0.2);
    color: #fef08a;
}

.upload-status.success {
    background: rgba(22, 163, 74, 0.2);
    color: #bbf7d0;
}

.upload-status.error {
    background: rgba(220, 38, 38, 0.2);
    color: #fecaca;
}

/* ========== DEBUG CONSOLE ========== */
.debug-console {
    margin-top: 1rem;
}

.debug-toggle {
    width: 100%;
    background: var(--bg-secondary);
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s;
}

.debug-toggle:hover {
    background: var(--bg-tertiary);
}

#debugToggleIcon {
    transition: transform 0.2s;
    display: inline-block;
}

#debugToggleIcon.expanded {
    transform: rotate(90deg);
}

.debug-content {
    margin-top: 0.75rem;
    animation: slideDown 0.2s ease-out;
}

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

.debug-log {
    background: #0a0a0a;
    color: #00ff41;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.75rem;
    padding: 1rem;
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
    line-height: 1.5;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-color);
}

.debug-log .log-entry {
    margin-bottom: 0.25rem;
    padding: 0.125rem;
}

.debug-log .log-empty {
    color: #6b7280;
    font-style: italic;
}

/* ========== FOOTER ========== */
footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 8px;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-left {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.footer-small {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.footer-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 0.875rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.footer-btn:hover {
    background: var(--bg-secondary);
}

.theme-toggle {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 1.25rem;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background: var(--bg-secondary);
}

/* ========== MODAL ========== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    max-width: 600px;
    max-height: 85vh;
    margin: 5vh auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 32px var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideIn 0.3s ease-out;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 2rem;
    line-height: 1;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}

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

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    color: var(--text-primary);
    line-height: 1.6;
}

.modal-body h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: var(--text-primary);
}

.modal-body h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem 0;
    color: var(--text-primary);
}

.modal-body p {
    margin: 0 0 1rem 0;
    color: var(--text-secondary);
}

.modal-body ol,
.modal-body ul {
    margin: 0.5rem 0 1rem 1.5rem;
    color: var(--text-secondary);
}

.modal-body li {
    margin: 0.5rem 0;
}

.modal-body strong {
    color: var(--text-primary);
    font-weight: 600;
}

.modal-footer-text {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 1.5rem;
}

/* Diagram Modal Specific Styles */
.modal-diagram {
    max-width: 90vw;
    max-height: 90vh;
}

.modal-body-diagram {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
}

.diagram-image {
    width: 100%;
    height: auto;
    max-width: 100%;
    display: block;
}

/* Narrator Image in Rules Modal */
.narrator-image {
    float: right;
    width: 200px;
    height: auto;
    margin: 0 0 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow);
}

/* ========== RESPONSIVE ========== */

/* Tablet and below - Stack to single column */
@media (max-width: 1024px) {
    .grid-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto;
    }

    .game-status {
        grid-column: 1;
        grid-row: 1;
    }

    .narrator {
        grid-column: 1;
        grid-row: 2;
        min-height: 300px;
    }

    .leaderboard {
        grid-column: 1;
        grid-row: 3;
        min-height: 300px;
    }

    .edge-node {
        grid-column: 1;
        grid-row: 4;
    }
}

/* Mobile - Optimize for small screens */
@media (max-width: 640px) {
    body {
        font-size: 16px;
    }

    .main-container {
        padding: 0.5rem;
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }

    .grid-layout {
        gap: 0.75rem;
    }

    .grid-item {
        padding: 1rem;
        border-radius: 8px;
        display: flex;
        flex-direction: column;
    }

    .grid-item h2 {
        font-size: 1.375rem;
        margin-bottom: 0.75rem;
        padding-bottom: 0.5rem;
        flex-shrink: 0;
    }

    .grid-item h3 {
        font-size: 1.125rem;
    }

    /* Fixed heights with scrollable content on mobile */
    .game-status {
        height: auto;
        min-height: auto;
    }

    .narrator {
        height: 350px;
        min-height: 350px;
        max-height: 350px;
    }

    .leaderboard {
        height: 400px;
        min-height: 400px;
        max-height: 400px;
    }

    .edge-node {
        min-height: auto;
    }

    /* Ensure content areas scroll */
    .narrator-content,
    .leaderboard-content {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        min-height: 0;
    }

    /* Status bar */
    .status-bar {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }

    .status-text {
        font-size: 1.125rem;
    }

    /* Hunter Mission Info */
    .hunter-mission-info {
        padding: 1rem;
    }

    .hunter-mission-info h3 {
        font-size: 1.25rem;
    }

    .hunter-mission-info p {
        font-size: 1.125rem;
    }

    /* Node info */
    .node-info {
        padding: 1rem;
    }

    .info-row {
        padding: 0.5rem 0;
    }

    .info-row .label,
    .info-row .value {
        font-size: 1rem;
    }

    /* Buttons - Make touch-friendly and larger */
    .btn {
        padding: 1rem 1.25rem;
        font-size: 1.125rem;
        min-height: 48px;
    }

    .btn-small {
        padding: 0.75rem 1rem;
        font-size: 1rem;
        min-height: 44px;
    }

    /* Leaderboard entries */
    .leaderboard-rank {
        font-size: 1.25rem;
    }

    .leaderboard-username {
        font-size: 1.125rem;
    }

    .leaderboard-score {
        font-size: 1.25rem;
    }

    .leaderboard-expand-btn {
        font-size: 1.125rem;
    }

    .challenge-item {
        font-size: 1rem;
        padding: 0.5rem 0.75rem;
    }

    /* Narrator entries */
    .narrative-entry {
        padding: 1rem;
        font-size: 1rem;
    }

    .narrative-timestamp {
        font-size: 0.875rem;
    }

    .narrative-text {
        font-size: 1.0625rem;
        line-height: 1.5;
    }

    /* QR Scanner */
    #qrReader {
        border-radius: 6px;
    }

    /* Form elements */
    .form-group label {
        font-size: 1rem;
    }

    .form-group input[type="checkbox"] {
        width: 24px;
        height: 24px;
    }

    /* Hunter section */
    .hunter-section {
        padding: 0;
        margin-bottom: 0.5rem;
    }

    .hunter-info {
        padding: 0.75rem;
    }

    .photo-preview img {
        max-height: 250px;
    }

    /* Debug console */
    .debug-console {
        margin-top: 0.5rem;
    }

    .debug-toggle {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }

    .debug-log {
        font-size: 0.875rem;
        padding: 1rem;
        max-height: 250px;
    }

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

    .footer-content {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }

    .footer-left {
        font-size: 1rem;
    }

    .footer-small {
        font-size: 0.875rem;
    }

    .theme-toggle {
        padding: 0.625rem 0.75rem;
        font-size: 1.375rem;
    }

    /* Placeholder text */
    .placeholder-text {
        padding: 1.5rem 1rem;
        font-size: 1rem;
    }

    /* Modal */
    .modal-content {
        max-width: calc(100% - 2rem);
        max-height: 90vh;
        margin: 5vh 1rem;
    }

    .modal-header {
        padding: 1.25rem;
    }

    .modal-header h2 {
        font-size: 1.5rem;
    }

    .modal-body {
        padding: 1.25rem;
        font-size: 1rem;
    }

    .modal-body h3 {
        font-size: 1.375rem;
    }

    .modal-body h4 {
        font-size: 1.125rem;
    }

    /* Smaller narrator image on mobile */
    .narrator-image {
        width: 120px;
        margin: 0 0 0.75rem 1rem;
    }

    .footer-btn {
        font-size: 1rem;
        padding: 0.75rem 1rem;
        min-height: 44px;
    }
}

/* Extra small mobile - Further optimizations */
@media (max-width: 375px) {
    .main-container {
        padding: 0.375rem;
    }

    .grid-item {
        padding: 0.75rem;
    }

    .grid-item h2 {
        font-size: 1rem;
    }

    .status-bar {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }

    .btn {
        padding: 0.625rem 0.875rem;
        font-size: 0.8125rem;
    }
}
