/* ==========================================================================
   SIMPLE MODAL THEMES
   ==========================================================================

   Themed styling for simple confirmation modals:
   - Confirmation Modal (Green theme)
   - Reboot Modal (Orange theme)
   - Reset/Warning Modal (Red theme)

   Each modal has custom border colors, glows, and button styles
   matching their purpose (confirm=green, warning=orange, danger=red)

   Last Updated: 2025-11-22
   ========================================================================== */

/* ==========================================================================
   BASE SIMPLE MODAL STYLES
   ========================================================================== */

#pauseContent {
    --modal-frame-rgb: 0 255 170;
    --modal-corner-frame-opacity: 0.95;
}

#rebootModalContent {
    --modal-frame-rgb: 255 165 0;
}

#confirmationContent {
    --modal-frame-rgb: 0 255 136;
    --modal-corner-frame-opacity: 0.95;
}

#rebootModalContent,
#confirmationContent,
#pauseContent {
    background-color: rgba(3, 10, 12, 0.94);
    --modal-panel-surface: var(--modal-circuit-vein-layers), linear-gradient(135deg, rgba(5, 16, 14, 0.96), rgba(3, 10, 12, 0.94));
    background-image: var(--modal-panel-surface);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-top: 2px solid rgba(0, 255, 0, 0.5);
    border-radius: var(--radius-xl, 8px);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2), 0 0 4px rgba(255, 255, 255, 0.06) inset;
    width: 90%;
    max-width: 600px;
    min-width: 66vw;
    max-height: 80vh;
    margin: auto;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 66;
    padding: 12px 14px;
    text-align: center;
}

/* Scan lines effect - using shared utility class pattern from modal.css */
/* Note: Add 'scan-line-effect' class to these elements in HTML, or keep this for ID-specific styling */
#rebootModalContent::before,
#confirmationContent::before,
#pauseContent::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.08;
    pointer-events: none;
    z-index: 0;
    background: repeating-linear-gradient(90deg,
            transparent,
            transparent 50px,
            #00cccc 50px,
            #00cccc 51px);
    animation: pauseScanScroll 15s linear infinite;
}

/* reboot/confirmation body copy — canonical size baseline
   MODAL CONSISTENCY NOTE:
   When changing typography in one confirmation/reboot/reset modal,
   verify all sibling modals (tower confirm, reboot, save-reset, pause) still match the shared vibe. */
#rebootModalContent p,
#confirmationContent p {
    color: #aaa;
    margin-bottom: 16px;
    font-size: clamp(13px, calc(0.4rem + 0.55vw), 16px);
    line-height: 1.4;
}

.highlight-cost {
    color: #ffdd00;
    font-weight: bold;
    text-shadow: 0 0 5px #ffdd00;
}

#rebootModalButtons,
#confirmationButtons {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 10px 6px 14px;
    margin-top: 8px;
}

/* Buttons in reboot/confirmation — flex fill, capped width (replaces inline style) */
#rebootModalButtons .confirm-btn,
#confirmationButtons .confirm-btn {
    flex: 1;
    max-width: 200px;
}

.confirm-btn {
    padding: 8px 20px;
    border: 1px solid;
    border-radius: 1em;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    transition: all 0.2s ease;
    text-shadow: 0 0 4px currentColor;
    position: relative;
}

.confirm-btn:active {
    transform: scale(0.98) translateY(1px);
}

/* ==========================================================================
   CONFIRMATION MODAL - Green Theme (Default/Tower Placement)
   ========================================================================== */

#confirmationContent {
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-top: 2px solid rgba(0, 255, 0, 0.5);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2), 0 0 4px rgba(0, 255, 0, 0.08) inset;
}

/* Tower confirmation: modal border uses tower color, balanced glow */
#confirmationContent.tower-confirmation {
    border: 1px solid #ffffff;
    box-shadow: 0 0 14px color-mix(in srgb, var(--tower-color, #0f0) 50%, transparent),
                0 0 5px color-mix(in srgb, var(--tower-color, #0f0) 25%, transparent) inset;
}

#confirmationContent h2 {
    color: #00ff00 !important;
}

/* .pause-indicator removed (consolidated in modal.css) */

/* CONFIRM button - Green with enhanced feedback (default / non-tower) */
#confirmActionBtn {
    color: #00ff00;
    border-color: #00ff00;
    border-width: var(--border-width, 2px);
    background: rgba(0, 255, 0, 0.15);
    box-shadow:
        0 0 15px rgba(0, 255, 0, 0.5),
        0 0 8px rgba(0, 255, 0, 0.3) inset,
        0 0 30px rgba(0, 255, 0, 0.2);
    text-shadow: 0 0 8px rgba(0, 255, 0, 0.8);
    font-weight: 700;
    transition: all 0.3s ease;
}

/* Tower confirmation: Confirm button uses tower color, balanced glow */
#confirmationContent.tower-confirmation #confirmActionBtn {
    color: var(--tower-color, #0f0);
    border-color: color-mix(in srgb, var(--tower-color, #0f0) 80%, #ffffff);
    background: color-mix(in srgb, var(--tower-color, #0f0) 12%, transparent);
    box-shadow: 0 0 8px color-mix(in srgb, var(--tower-color, #0f0) 40%, transparent),
                0 0 3px color-mix(in srgb, var(--tower-color, #0f0) 18%, transparent) inset;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

#confirmationContent.tower-confirmation #confirmActionBtn:hover {
    background: color-mix(in srgb, var(--tower-color, #0f0) 20%, transparent);
    border-color: var(--tower-color, #0f0);
    box-shadow: 0 0 12px color-mix(in srgb, var(--tower-color, #0f0) 50%, transparent),
                0 0 5px color-mix(in srgb, var(--tower-color, #0f0) 22%, transparent) inset;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
    transform: scale(1.05) translateY(-1px);
}

#confirmationContent.tower-confirmation #confirmActionBtn:active {
    background: color-mix(in srgb, var(--tower-color, #0f0) 28%, transparent);
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    transform: scale(1.02) translateY(0);
}

/* Tower confirmation: Cancel is clearly RED (never green like Confirm) */
#confirmationContent.tower-confirmation #cancelActionBtn {
    color: #ff4444 !important;
    border-color: #ff4444 !important;
    background: rgba(255, 60, 60, 0.15) !important;
    box-shadow: 0 0 10px rgba(255, 50, 50, 0.5), 0 0 4px rgba(255, 80, 80, 0.25) inset !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

#confirmationContent.tower-confirmation #cancelActionBtn:hover {
    color: #ff6666 !important;
    border-color: #ff6666 !important;
    background: rgba(255, 80, 80, 0.3) !important;
    box-shadow: 0 0 20px rgba(255, 50, 50, 0.85), 0 0 10px rgba(255, 100, 100, 0.4) inset !important;
    text-shadow: 0 0 8px rgba(255, 100, 100, 0.9), 0 1px 2px rgba(0, 0, 0, 0.8);
    transform: scale(1.05) translateY(-1px);
}

#confirmationContent.tower-confirmation #cancelActionBtn:active {
    color: #fff !important;
    background: rgba(255, 70, 70, 0.5) !important;
    border-color: #ff8888 !important;
    box-shadow: 0 0 16px rgba(255, 50, 50, 0.7) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    transform: scale(1.02) translateY(0);
}

#confirmActionBtn:hover {
    background: rgba(0, 255, 0, 0.3);
    border-color: #00ff88;
    box-shadow:
        0 0 30px rgba(0, 255, 0, 0.9),
        0 0 15px rgba(0, 255, 136, 0.5) inset,
        0 0 50px rgba(0, 255, 0, 0.4);
    text-shadow: 0 0 12px rgba(0, 255, 0, 1);
    transform: scale(1.08) translateY(-2px);
}

#confirmActionBtn:active {
    background: #00ff00;
    color: #000;
    box-shadow:
        0 0 40px rgba(0, 255, 0, 1),
        0 0 20px rgba(0, 255, 136, 0.6) inset,
        0 0 60px rgba(0, 255, 0, 0.5);
    transform: scale(1.02) translateY(0);
}

/* CANCEL button - Red with enhanced feedback */
#cancelActionBtn {
    color: #ff4444;
    border-color: #ff4444;
    border-width: var(--border-width, 2px);
    background: rgba(255, 68, 68, 0.15);
    box-shadow:
        0 0 15px rgba(255, 68, 68, 0.5),
        0 0 8px rgba(255, 68, 68, 0.3) inset,
        0 0 30px rgba(255, 68, 68, 0.2);
    text-shadow: 0 0 8px rgba(255, 68, 68, 0.8);
    font-weight: 700;
    transition: all 0.3s ease;
}

#cancelActionBtn:hover {
    background: rgba(255, 68, 68, 0.3);
    border-color: #ff6666;
    box-shadow:
        0 0 30px rgba(255, 68, 68, 0.9),
        0 0 15px rgba(255, 102, 102, 0.5) inset,
        0 0 50px rgba(255, 68, 68, 0.4);
    text-shadow: 0 0 12px rgba(255, 68, 68, 1);
    transform: scale(1.08) translateY(-2px);
}

#cancelActionBtn:active {
    background: #ff4444;
    color: #fff;
    box-shadow:
        0 0 40px rgba(255, 68, 68, 1),
        0 0 20px rgba(255, 102, 102, 0.6) inset,
        0 0 60px rgba(255, 68, 68, 0.5);
    transform: scale(1.02) translateY(0);
}

/* ==========================================================================
   REBOOT MODAL - Orange Theme
   ========================================================================== */

#rebootModalContent.reboot-content,
#rebootModalContent {
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-top: 2px solid rgba(255, 165, 0, 0.75);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2), 0 0 4px rgba(255, 165, 0, 0.08) inset;
}

#rebootModalContent .modal-header h2 {
    color: #ffa500;
    font-size: clamp(20px, 4vw, 28px);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 0 0 8px rgba(255, 165, 0, 0.5);
}

#confirmationContent .modal-header h2 {
    font-size: clamp(20px, 4vw, 28px);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 3px;
}

#rebootModalContent h3 {
    margin-bottom: 10px;
    color: #ffa500;
}

/* .pause-indicator removed (consolidated in modal.css) */

/* RESTART RUN button - Orange with enhanced feedback */
#restartWaveBtn {
    color: #ffa500;
    border-color: #ffa500;
    border-width: var(--border-width, 2px);
    background: rgba(255, 165, 0, 0.15);
    box-shadow:
        0 0 15px rgba(255, 165, 0, 0.5),
        0 0 8px rgba(255, 165, 0, 0.3) inset,
        0 0 30px rgba(255, 165, 0, 0.2);
    text-shadow: 0 0 8px rgba(255, 165, 0, 0.8);
    font-weight: 700;
    transition: all 0.3s ease;
}

#restartWaveBtn:hover {
    background: rgba(255, 165, 0, 0.3);
    border-color: #ffb733;
    box-shadow:
        0 0 30px rgba(255, 165, 0, 0.9),
        0 0 15px rgba(255, 183, 51, 0.5) inset,
        0 0 50px rgba(255, 165, 0, 0.4);
    text-shadow: 0 0 12px rgba(255, 165, 0, 1);
    transform: scale(1.08) translateY(-2px);
}

#restartWaveBtn:active {
    background: #ffa500;
    color: #000;
    box-shadow:
        0 0 40px rgba(255, 165, 0, 1),
        0 0 20px rgba(255, 183, 51, 0.6) inset,
        0 0 60px rgba(255, 165, 0, 0.5);
    transform: scale(1.02) translateY(0);
}

/* GO HOME button - Cyan with enhanced feedback */
#goHomeBtn {
    color: #00cccc;
    border-color: #00cccc;
    border-width: var(--border-width, 2px);
    background: rgba(0, 204, 204, 0.15);
    box-shadow:
        0 0 15px rgba(0, 204, 204, 0.5),
        0 0 8px rgba(0, 204, 204, 0.3) inset,
        0 0 30px rgba(0, 204, 204, 0.2);
    text-shadow: 0 0 8px rgba(0, 204, 204, 0.8);
    font-weight: 700;
    transition: all 0.3s ease;
}

#goHomeBtn:hover {
    background: rgba(0, 204, 204, 0.3);
    border-color: #00e6e6;
    box-shadow:
        0 0 30px rgba(0, 204, 204, 0.9),
        0 0 15px rgba(0, 230, 230, 0.5) inset,
        0 0 50px rgba(0, 204, 204, 0.4);
    text-shadow: 0 0 12px rgba(0, 204, 204, 1);
    transform: scale(1.08) translateY(-2px);
}

#goHomeBtn:active {
    background: #00cccc;
    color: #000;
    box-shadow:
        0 0 40px rgba(0, 204, 204, 1),
        0 0 20px rgba(0, 230, 230, 0.6) inset,
        0 0 60px rgba(0, 204, 204, 0.5);
    transform: scale(1.02) translateY(0);
}

/* ==========================================================================
   RESET/WARNING MODAL - Red Theme (Save Reset)
   ========================================================================== */

#confirmationContent.save-reset-content {
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-top: 2px solid rgba(255, 69, 0, 0.75);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2), 0 0 4px rgba(255, 69, 0, 0.08) inset;
}

#confirmationContent.save-reset-content h2 {
    color: #ff4500 !important;
    text-shadow: 0 0 8px rgba(255, 69, 0, 0.5);
}

#confirmationContent.save-reset-content h2 span {
    color: #ff0000 !important;
    text-shadow: 0 0 8px rgba(255, 0, 0, 0.6);
}

/* .pause-indicator removed (consolidated in modal.css) */

#confirmationContent.save-reset-content p {
    color: #ffcccc !important;
    text-shadow: 0 0 8px rgba(255, 200, 200, 0.6);
    font-weight: 500;
    font-size: inherit;
}

#confirmationContent.save-reset-content .highlight-cost {
    color: #ff6600 !important;
    text-shadow:
        0 0 10px rgba(255, 102, 0, 0.8),
        0 0 15px rgba(255, 102, 0, 0.6);
    font-weight: bold;
}

/* CONFIRM button - Red filled (destructive action) with enhanced feedback */
#confirmationContent.save-reset-content #confirmActionBtn {
    color: #ff0000;
    border-color: #ff0000;
    border-width: var(--border-width, 2px);
    background: rgba(255, 0, 0, 0.15);
    box-shadow:
        0 0 15px rgba(255, 0, 0, 0.5),
        0 0 8px rgba(255, 0, 0, 0.3) inset,
        0 0 30px rgba(255, 0, 0, 0.2);
    text-shadow: 0 0 8px rgba(255, 0, 0, 0.8);
    font-weight: 700;
    transition: all 0.3s ease;
}

#confirmationContent.save-reset-content #confirmActionBtn:hover {
    background: rgba(255, 0, 0, 0.3);
    border-color: #ff3333;
    box-shadow:
        0 0 30px rgba(255, 0, 0, 0.9),
        0 0 15px rgba(255, 51, 51, 0.5) inset,
        0 0 50px rgba(255, 0, 0, 0.4);
    text-shadow: 0 0 12px rgba(255, 0, 0, 1);
    transform: scale(1.08) translateY(-2px);
}

#confirmationContent.save-reset-content #confirmActionBtn:active {
    background: #ff0000;
    color: #000;
    box-shadow:
        0 0 40px rgba(255, 0, 0, 1),
        0 0 20px rgba(255, 51, 51, 0.6) inset,
        0 0 60px rgba(255, 0, 0, 0.5);
    transform: scale(1.02) translateY(0);
}

/* CANCEL button - Orange (safe action) with enhanced feedback */
#confirmationContent.save-reset-content #cancelActionBtn {
    color: #ffaa00;
    border-color: #ffaa00;
    border-width: var(--border-width, 2px);
    background: rgba(255, 170, 0, 0.15);
    box-shadow:
        0 0 15px rgba(255, 170, 0, 0.5),
        0 0 8px rgba(255, 170, 0, 0.3) inset,
        0 0 30px rgba(255, 170, 0, 0.2);
    text-shadow: 0 0 8px rgba(255, 170, 0, 0.8);
    font-weight: 700;
    transition: all 0.3s ease;
}

#confirmationContent.save-reset-content #cancelActionBtn:hover {
    background: rgba(255, 170, 0, 0.3);
    border-color: #ffbb33;
    box-shadow:
        0 0 30px rgba(255, 170, 0, 0.9),
        0 0 15px rgba(255, 187, 51, 0.5) inset,
        0 0 50px rgba(255, 170, 0, 0.4);
    text-shadow: 0 0 12px rgba(255, 170, 0, 1);
    transform: scale(1.08) translateY(-2px);
}

#confirmationContent.save-reset-content #cancelActionBtn:active {
    background: #ffaa00;
    color: #000;
    box-shadow:
        0 0 40px rgba(255, 170, 0, 1),
        0 0 20px rgba(255, 187, 51, 0.6) inset,
        0 0 60px rgba(255, 170, 0, 0.5);
    transform: scale(1.02) translateY(0);
}

/* ==========================================================================
   SHARED MODAL STYLES - Used by all modals
   ========================================================================== */

/* Shared resource display styling - DRY (used by H.U.B., Signal Log, and How To modals) */
.modal-resource-display,
.modal-units-display,
.modal-energy-display {
    color: var(--modal-resource-color, #ffff00);
    font-size: clamp(11px, 3vw, 12px);
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-shadow: 0 0 4px var(--modal-resource-glow, rgba(255, 255, 0, 0.75));
}

.modal-energy-display {
    color: #9efbff;
    text-shadow: 0 0 4px rgba(0, 221, 255, 0.75);
}

/* Number-only chip (slanted glass, like in-game badges) */
.modal-resource-display .modal-resource-number,
.modal-units-display .modal-units-number,
.modal-energy-display .modal-energy-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.2em;
    padding: 2px 8px;
    border-radius: var(--radius-md, 4px);
    transform: skewX(-8deg);
    color: var(--modal-resource-number-color, #7dff6b);
    border: 1px solid var(--modal-resource-border-color, rgba(160, 255, 120, 0.45));
    background: var(--modal-resource-glass-bg, linear-gradient(135deg, rgba(120, 255, 80, 0.18), rgba(12, 16, 8, 0.86)));
    box-shadow:
        0 0 9px var(--modal-resource-glow, rgba(140, 255, 110, 0.3)),
        inset 0 0 7px var(--modal-resource-glow, rgba(140, 255, 110, 0.12));
    text-shadow: 0 0 7px var(--modal-resource-glow, rgba(120, 255, 90, 0.65));
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.modal-energy-display .modal-energy-number {
    color: #83f8ff;
    border-color: rgba(0, 221, 255, 0.45);
    background: linear-gradient(135deg, rgba(0, 221, 255, 0.18), rgba(8, 16, 22, 0.86));
    box-shadow:
        0 0 9px rgba(0, 221, 255, 0.3),
        inset 0 0 7px rgba(0, 221, 255, 0.12);
    text-shadow: 0 0 7px rgba(0, 221, 255, 0.65);
}

.modal-resource-display .modal-resource-label,
.modal-units-display .modal-units-label,
.modal-energy-display .modal-energy-label {
    color: var(--modal-resource-color, #f2f079);
    letter-spacing: 0.08em;
    font-size: 0.92em;
}

.modal-energy-display .modal-energy-label {
    color: #9efbff;
}

/* Legacy support - apply shared class styling to IDs */
#hubUnitsDisplay,
#hubEnergyDisplay,
#milestonesUnitsDisplay,
#milestonesEnergyDisplay,
#tutorialUnitsDisplay,
#tutorialEnergyDisplay {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ==========================================================================
   PAUSE OVERLAY — mirror confirmation modal hierarchy (title → cyan status → body → buttons)
   ========================================================================== */

#pauseContent.modal-content.settings-modal-content {
    text-align: center;
}

#pauseContent .pause-modal-settings {
    padding-top: 4px;
}

/* Title row: same weight as confirmation modal primary heading, bright green */
#pauseContent .pause-main-title {
    color: #00ff00;
    margin: 0 0 8px;
    font-size: clamp(20px, 4vw, 28px);
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 700;
    line-height: 1.15;
    text-shadow: 0 0 12px rgba(0, 255, 0, 0.55);
}
/* .pause-main-title__text inherits color + shadow from parent — removed redundant rule */

/* Cyan status strip — uses .styled-pause-indicator from modal.css; tighten for pause-only */
#pauseContent .pause-overlay-status.styled-pause-indicator {
    margin-top: 0;
    margin-bottom: 14px;
}

/* Inner content frame — green border “processor” panel */
#pauseContent .pause-body-panel {
    border: 1px solid rgba(0, 255, 0, 0.5);
    border-radius: var(--radius-xl, 8px);
    padding: 16px 18px;
    margin-bottom: 22px;
    background: rgba(0, 24, 12, 0.35);
    box-shadow:
        0 0 14px rgba(0, 255, 0, 0.15),
        inset 0 0 10px rgba(0, 255, 0, 0.07);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#pauseContent .pause-click-resume:hover .pause-body-panel {
    border-color: rgba(0, 255, 136, 0.65);
    box-shadow:
        0 0 18px rgba(0, 255, 100, 0.22),
        inset 0 0 12px rgba(0, 255, 136, 0.1);
}

#pauseContent .pause-instruction-inner {
    margin: 0;
    color: #ccc;
    font-size: clamp(14px, 2.5vw, 17px);
    line-height: 1.55;
    text-align: center;
    cursor: inherit;
}

#pauseContent .pause-click-resume {
    cursor: pointer;
    outline: none;
}

.pause-actions-row {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 4px;
    padding: 10px 6px 14px;
}

/* Override shared #pauseButtons margin from CBDstyles (game over uses the other rule) */
#pauseContent #pauseButtons.pause-actions-row {
    margin: 12px 0 8px;
}

/* Match confirmation modal button chrome (green / red / cyan) */
#pauseContent #pauseButtons .confirm-btn {
    flex: 1;
    min-width: 120px;
    max-width: 200px;
    border-width: var(--border-width, 2px);
    font-weight: 700;
}

#pauseContent #pauseButtons #rebootBtn.pause-btn-reboot {
    color: #00ff00;
    border-color: #00ff00;
    background: rgba(0, 255, 0, 0.15);
    box-shadow:
        0 0 15px rgba(0, 255, 0, 0.5),
        0 0 8px rgba(0, 255, 0, 0.3) inset,
        0 0 30px rgba(0, 255, 0, 0.2);
    text-shadow: 0 0 8px rgba(0, 255, 0, 0.8);
}

#pauseContent #pauseButtons #rebootBtn.pause-btn-reboot:hover {
    background: rgba(0, 255, 0, 0.3);
    border-color: #00ff88;
    box-shadow:
        0 0 30px rgba(0, 255, 0, 0.9),
        0 0 15px rgba(0, 255, 136, 0.5) inset,
        0 0 50px rgba(0, 255, 0, 0.4);
    transform: scale(1.05) translateY(-1px);
}

#pauseContent #pauseButtons #resetBtn.pause-btn-erase {
    color: #ff4444;
    border-color: #ff4444;
    background: rgba(255, 68, 68, 0.15);
    box-shadow:
        0 0 15px rgba(255, 68, 68, 0.5),
        0 0 8px rgba(255, 68, 68, 0.3) inset,
        0 0 30px rgba(255, 68, 68, 0.2);
    text-shadow: 0 0 8px rgba(255, 68, 68, 0.8);
}

#pauseContent #pauseButtons #resetBtn.pause-btn-erase:hover {
    background: rgba(255, 68, 68, 0.3);
    border-color: #ff6666;
    box-shadow:
        0 0 30px rgba(255, 68, 68, 0.9),
        0 0 15px rgba(255, 102, 102, 0.5) inset,
        0 0 50px rgba(255, 68, 68, 0.4);
    transform: scale(1.05) translateY(-1px);
}

#pauseContent #pauseButtons #goHomeBtn.pause-btn-home {
    color: #66ffff;
    border-color: #00cccc;
    background: rgba(0, 204, 204, 0.12);
    box-shadow:
        0 0 14px rgba(0, 204, 204, 0.45),
        0 0 8px rgba(0, 204, 204, 0.25) inset,
        0 0 28px rgba(0, 204, 204, 0.18);
    text-shadow: 0 0 8px rgba(102, 255, 255, 0.75);
}

#pauseContent #pauseButtons #goHomeBtn.pause-btn-home:hover {
    background: rgba(0, 204, 204, 0.22);
    border-color: #66ffff;
    box-shadow:
        0 0 26px rgba(0, 255, 255, 0.65),
        0 0 12px rgba(102, 255, 255, 0.35) inset,
        0 0 45px rgba(0, 204, 204, 0.35);
    transform: scale(1.05) translateY(-1px);
}

/* FIELD MANUAL — reference/info action (amber, distinct from the destructive ones) */
#pauseContent #pauseButtons #pauseHowToBtn.pause-btn-howto {
    color: #ffcf6a;
    border-color: #e0a93f;
    background: rgba(224, 169, 63, 0.12);
    box-shadow:
        0 0 14px rgba(224, 169, 63, 0.45),
        0 0 8px rgba(224, 169, 63, 0.25) inset,
        0 0 28px rgba(224, 169, 63, 0.18);
    text-shadow: 0 0 8px rgba(255, 207, 106, 0.75);
}

#pauseContent #pauseButtons #pauseHowToBtn.pause-btn-howto:hover {
    background: rgba(224, 169, 63, 0.22);
    border-color: #ffcf6a;
    box-shadow:
        0 0 26px rgba(255, 207, 106, 0.65),
        0 0 12px rgba(255, 207, 106, 0.35) inset,
        0 0 45px rgba(224, 169, 63, 0.35);
    transform: scale(1.05) translateY(-1px);
}

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

@media (max-width: 640px) {

    #rebootModalContent,
    #confirmationContent,
    #pauseContent {
        min-width: 86%;
        padding: 5vw;
    }

    .confirm-btn {
        padding: 8px 20px;
        font-size: 12px;
    }

    #rebootModalButtons,
    #confirmationButtons {
        flex-wrap: wrap;
        gap: 15px;
    }

    /* Tighten paragraph spacing on phones (was blocked by inline margin-bottom: 25px) */
    #rebootModalContent p,
    #confirmationContent p {
        margin-bottom: 10px;
        font-size: 14px;
    }

    /* Pause: 2-col grid — FIELD MANUAL full-width, REBOOT | ERASE ALL paired, GO HOME full-width */
    #pauseContent #pauseButtons.pause-actions-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    #pauseContent #pauseButtons #pauseHowToBtn { grid-column: 1 / -1; }
    #pauseContent #pauseButtons #rebootBtn  { grid-column: 1; }
    #pauseContent #pauseButtons #resetBtn   { grid-column: 2; }
    #pauseContent #pauseButtons #goHomeBtn  { grid-column: 1 / -1; }
    #pauseContent #pauseButtons .confirm-btn { min-width: unset; max-width: none; flex: unset; }

    /* Tighter body panel spacing on phones */
    #pauseContent .pause-body-panel {
        padding: 12px 14px;
        margin-bottom: 14px;
    }
    #pauseContent .pause-overlay-status.styled-pause-indicator {
        margin-bottom: 8px;
    }

    /* Shared Resource Display - Mobile */
    .modal-resource-display,
    .modal-units-display,
    .modal-energy-display,
    #hubUnitsDisplay,
    #hubEnergyDisplay,
    #milestonesUnitsDisplay,
    #milestonesEnergyDisplay,
    #tutorialUnitsDisplay,
    #tutorialEnergyDisplay {
        margin-left: 0 !important;
        font-size: clamp(12px, 3.5vw, 12px) !important;
        gap: 6px !important;
    }

    .modal-resource-display .modal-resource-number,
    .modal-units-display .modal-units-number,
    .modal-energy-display .modal-energy-number {
        padding: 2px 9px !important;
    }

    .modal-units-display .modal-units-number {
        background: linear-gradient(135deg, rgba(120, 255, 80, 0.22), rgba(12, 16, 8, 0.9)) !important;
        border: 1px solid rgba(170, 255, 130, 0.5) !important;
        box-shadow:
            0 0 10px rgba(140, 255, 110, 0.35),
            inset 0 0 8px rgba(140, 255, 110, 0.14) !important;
    }

    .modal-energy-display .modal-energy-number {
        background: linear-gradient(135deg, rgba(0, 221, 255, 0.22), rgba(8, 16, 22, 0.9)) !important;
        border: 1px solid rgba(0, 221, 255, 0.5) !important;
        box-shadow:
            0 0 10px rgba(0, 221, 255, 0.35),
            inset 0 0 8px rgba(0, 221, 255, 0.14) !important;
    }

    /* Smaller screens (480px and below) */
    @media (max-width: 480px) {

        #rebootModalContent,
        #confirmationContent,
        #pauseContent {
            width: 95%;
            min-width: unset;
            padding: 4vw;
        }

        .confirm-btn {
            flex: 1;
            min-width: 120px;
        }
    }
}
