/* =============================================================================
   Taiwan Strait Conflict Simulator - Styles
   ============================================================================= */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #1a1a2e;
    color: #eee;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.game-container {
    display: flex;
    gap: 20px;
    background-color: #16213e;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    /* Desktop: stretch to fill viewport height */
    min-height: calc(100vh - 40px);
    align-items: stretch;
}

#gameCanvas {
    border: 2px solid #0f3460;
    border-radius: 5px;
    cursor: crosshair;
}

/* Sidebar */


.panel {
    background-color: #0f3460;
    padding: 10px;
    border-radius: 8px;
}

.panel h3 {
    margin-bottom: 8px;
    color: #e94560;
    border-bottom: 1px solid #e94560;
    padding-bottom: 5px;
    font-size: 12px;
}

/* Buttons */
.control-buttons {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

button {
    padding: 6px 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 11px;
    font-weight: bold;
    transition: all 0.2s;
}

button:hover {
    transform: translateY(-2px);
}

#startBtn {
    background-color: #4CAF50;
    color: white;
}

#pauseBtn {
    background-color: #ff9800;
    color: white;
}

#resetBtn {
    background-color: #f44336;
    color: white;
}

#autoDeployBtn {
    background-color: #9C27B0;
    color: white;
}

/* Radio Groups */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
    font-size: 10px;
}

.radio-group label:hover {
    background-color: rgba(233, 69, 96, 0.2);
}

.radio-group input[type="radio"] {
    cursor: pointer;
    margin: 0;
}

.section-label {
    font-size: 9px;
    color: #aaa;
    margin-bottom: 3px;
    margin-top: 6px;
    text-transform: uppercase;
}

/* Status Dashboard */
.status-dashboard {
    background: linear-gradient(180deg, #0f3460 0%, #0a2540 100%);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #1a4a7a;
}

.version-tag {
    font-size: 9px;
    color: #888;
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 3px;
}

.status-indicator {
    font-size: 10px;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 3px;
    background: #2a5a3a;
    color: #4CAF50;
}

.status-indicator.running {
    background: #5a4a2a;
    color: #ff9800;
}

.status-indicator.paused {
    background: #4a3a2a;
    color: #ffd700;
}

.status-indicator.victory {
    background: #2a5a3a;
    color: #00ff00;
}

.status-indicator.defeat {
    background: #5a2a2a;
    color: #ff4444;
}

/* Force Status */
.force-status {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 10px 0;
    padding: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
}

.force-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.force-label {
    font-size: 9px;
    font-weight: bold;
    text-transform: uppercase;
}

.force-count {
    font-size: 20px;
    font-weight: bold;
    color: #fff;
}

.force-ratio {
    font-size: 9px;
    color: #aaa;
    text-align: center;
    flex: 1;
}

.force-ratio span {
    display: block;
    font-size: 12px;
    font-weight: bold;
    color: #ffd700;
}

/* Cursor Panel */
.cursor-panel {
    padding: 6px 10px;
}

.coord-display {
    font-size: 9px;
    color: #888;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.coord-label {
    color: #666;
}

/* Color classes */
.red-text {
    color: #ff6b6b;
}

.blue-text {
    color: #6bb3ff;
}

.time-text {
    color: #ffd700;
    font-weight: bold;
}

.victory-text {
    color: #00ff00;
    font-weight: bold;
}

/* Help text */
.help-text {
    font-size: 8px;
    color: #888;
    margin-top: 6px;
    line-height: 1.3;
}

.coord-display {
    font-size: 9px;
    color: #aaa;
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px solid #333;
}

/* Unit Categories */
.unit-category {
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px dashed #334;
}

.unit-category-label {
    font-size: 8px;
    color: #7a8;
    margin-bottom: 2px;
    font-weight: bold;
}

.weapon-info {
    font-size: 8px;
    color: #aaa;
    margin-left: 16px;
    font-style: italic;
}

/* Unit Stats Display */
.unit-stats-display {
    font-size: 8px;
    color: #888;
    background: rgba(0, 0, 0, 0.2);
    padding: 5px;
    border-radius: 4px;
    margin-top: 6px;
}

.unit-stats-display .stat-row {
    display: flex;
    justify-content: space-between;
    margin: 1px 0;
}

.unit-stats-display .stat-label {
    color: #aaa;
}

.unit-stats-display .stat-value {
    color: #fff;
    font-weight: bold;
}

/* Transport & Special Abilities */
.transport-indicator {
    font-size: 7px;
    background: #2a4a7a;
    padding: 1px 3px;
    border-radius: 2px;
    margin-left: 3px;
}

.special-ability {
    font-size: 7px;
    color: #7d7;
    margin-left: 16px;
}

/* Time Display */
.time-display {
    background: rgba(0, 0, 0, 0.3);
    padding: 8px;
    border-radius: 5px;
    margin-bottom: 8px;
    text-align: center;
}

.time-display .day {
    font-size: 18px;
    font-weight: bold;
    color: #ffd700;
}

.time-display .hour {
    font-size: 12px;
    color: #aaa;
}

/* Progress Bar */
.progress-bar {
    height: 8px;
    background: #333;
    border-radius: 4px;
    margin-top: 5px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    transition: width 0.3s;
}

.victory-condition {
    font-size: 9px;
    color: #aaa;
    margin-top: 5px;
}

/* Game Options */
.option-group {
    margin: 5px 0;
}

.option-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 10px;
}

.option-checkbox input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.option-description {
    font-size: 8px;
    color: #888;
    margin-left: 20px;
    margin-top: 2px;
}

.option-checkbox:hover span {
    color: #fff;
}

/* =============================================================================
   Sandbox Settings Panel (Freemium)
   ============================================================================= */
.sandbox-panel {
    position: relative;
    border: 1px solid #3a3a5a;
}

.sandbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.sandbox-header h3 {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
    color: #ff9800;
}

.sandbox-badge {
    font-size: 8px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 3px;
    background: #5a2a2a;
    color: #ff4444;
}

.sandbox-badge.unlocked {
    background: #2a5a3a;
    color: #4CAF50;
}

.sandbox-overlay {
    position: absolute;
    top: 40px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 52, 96, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 0 0 8px 8px;
}

.sandbox-overlay.hidden {
    display: none;
}

.sandbox-lock-message {
    text-align: center;
    padding: 15px;
}

.sandbox-lock-message p {
    font-size: 11px;
    color: #aaa;
    margin-bottom: 12px;
}

.unlock-btn {
    background: linear-gradient(135deg, #ff9800, #ff5722);
    color: white;
    padding: 10px 20px;
    font-size: 12px;
    border-radius: 5px;
    margin-bottom: 10px;
    width: 100%;
}

.unlock-btn:hover {
    background: linear-gradient(135deg, #ffb300, #ff7043);
}

.get-code-link {
    display: block;
    font-size: 10px;
    color: #FFDD00;
    text-decoration: none;
    margin-top: 8px;
}

.get-code-link:hover {
    text-decoration: underline;
}

.sandbox-controls {
    opacity: 0.4;
    pointer-events: none;
}

.sandbox-controls.enabled {
    opacity: 1;
    pointer-events: auto;
}

.sandbox-group {
    margin: 8px 0;
}

.sandbox-label {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #ccc;
    margin-bottom: 4px;
}

.sandbox-value {
    color: #ffd700;
    font-weight: bold;
}

.sandbox-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #333;
    outline: none;
    cursor: pointer;
}

.sandbox-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ff9800;
    cursor: pointer;
}

.sandbox-slider:disabled {
    cursor: not-allowed;
}

.sandbox-slider:disabled::-webkit-slider-thumb {
    background: #555;
}

/* =============================================================================
   Game Over Modal
   ============================================================================= */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.visible {
    display: flex;
}

.modal-content {
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #0f3460;
    border-radius: 15px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #0f3460;
}

.modal-header h2 {
    font-size: 24px;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.modal-header.victory h2 {
    color: #4CAF50;
    text-shadow: 0 0 20px rgba(76, 175, 80, 0.5);
}

.modal-header.defeat h2 {
    color: #f44336;
    text-shadow: 0 0 20px rgba(244, 67, 54, 0.5);
}

.modal-header.draw h2 {
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.modal-body {
    padding: 20px;
}

.war-report {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.6;
    color: #ddd;
    white-space: pre-wrap;
    margin-bottom: 15px;
}

.modal-actions {
    display: flex;
    gap: 10px;
}

.modal-btn {
    flex: 1;
    padding: 12px;
    font-size: 12px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-btn.primary {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
}

.modal-btn.primary:hover {
    background: linear-gradient(135deg, #a569c6, #9e54bd);
    transform: translateY(-2px);
}

.modal-btn.secondary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.modal-btn.secondary:hover {
    background: linear-gradient(135deg, #44a8eb, #3990c9);
    transform: translateY(-2px);
}

.modal-footer {
    padding: 15px 20px 20px;
    text-align: center;
    border-top: 1px solid #0f3460;
}

.ad-placeholder {
    width: 300px;
    height: 250px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px dashed #444;
    border-radius: 8px;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-placeholder-text {
    font-size: 11px;
    color: #555;
}

.modal-support {
    margin-top: 10px;
}

.support-link {
    font-size: 11px;
    color: #FFDD00;
    text-decoration: none;
}

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

/* Toast notification */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(76, 175, 80, 0.95);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    z-index: 2000;
    animation: toastSlideUp 0.3s ease-out;
}

.toast.error {
    background: rgba(244, 67, 54, 0.95);
}

@keyframes toastSlideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* =============================================================================
   Site Footer
   ============================================================================= */
.site-footer {
    background: rgba(10, 25, 47, 0.95);
    border-top: 1px solid #1a3a5c;
    padding: 15px 20px;
    text-align: center;
    font-family: 'Courier New', monospace;
}

.site-footer .disclaimer {
    font-size: 10px;
    color: #666;
    margin: 0 0 8px 0;
    letter-spacing: 0.5px;
}

.site-footer .privacy-link {
    color: #555;
    text-decoration: none;
    margin-left: 8px;
}

.site-footer .privacy-link:hover {
    color: #888;
    text-decoration: underline;
}

.site-footer .contact-links {
    font-size: 11px;
}

.site-footer .contact-links a {
    color: #4a9eff;
    text-decoration: none;
    transition: color 0.2s;
}

.site-footer .contact-links a:hover {
    color: #7bb8ff;
    text-decoration: underline;
}

.site-footer .separator {
    color: #444;
    margin: 0 8px;
}

/* =============================================================================
   Tutorial Modal - First-time User Onboarding
   ============================================================================= */

.tutorial-modal {
    max-width: 420px;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.tutorial-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    text-align: center;
    padding: 20px;
}

.tutorial-header h2 {
    color: #00d4ff;
    font-size: 16px;
    letter-spacing: 3px;
    text-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
    animation: transmissionPulse 2s ease-in-out infinite;
}

@keyframes transmissionPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.tutorial-body {
    padding: 20px;
}

.tutorial-welcome {
    text-align: center;
    color: #aaa;
    font-size: 13px;
    margin-bottom: 20px;
    font-style: italic;
}

.tutorial-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.tutorial-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border-left: 3px solid #0f3460;
}

.step-icon {
    font-size: 20px;
    flex-shrink: 0;
    width: 32px;
    text-align: center;
}

.step-content strong {
    display: block;
    color: #fff;
    font-size: 13px;
    margin-bottom: 4px;
}

.step-content p {
    color: #888;
    font-size: 11px;
    line-height: 1.4;
    margin: 0;
}

.tutorial-tip {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 11px;
    color: #bbb;
}

.tip-label {
    color: #ffc107;
    font-weight: bold;
    margin-right: 6px;
}

.tutorial-tip strong {
    color: #fff;
}

.tutorial-footer {
    padding: 15px 20px 20px;
    text-align: center;
    border-top: 1px solid #0f3460;
}

.tutorial-btn {
    width: 100%;
    padding: 14px;
    font-size: 14px;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.tutorial-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #666;
    cursor: pointer;
}

.tutorial-checkbox input[type="checkbox"] {
    accent-color: #3498db;
}

.tutorial-checkbox:hover {
    color: #888;
}

/* =============================================================================
   Interactive Bootcamp Tutorial (Guided Tour System)
   A step-by-step overlay that highlights UI elements and guides users
   ============================================================================= */

/* Overlay: Dims the entire screen */
.bootcamp-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9000;
    pointer-events: all;
}

.bootcamp-overlay.active {
    display: block;
}

/* Message Box: Retro terminal style */
.bootcamp-message {
    display: none;
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 420px;
    background: linear-gradient(180deg, #0a1628 0%, #0d1f35 100%);
    border: 2px solid #00ff41;
    border-radius: 8px;
    box-shadow:
        0 0 30px rgba(0, 255, 65, 0.3),
        inset 0 0 60px rgba(0, 255, 65, 0.05);
    z-index: 9100;
    overflow: hidden;
    animation: bootcampSlideIn 0.3s ease-out;
}

.bootcamp-message.active {
    display: block;
}

/* Position variants for avoiding highlighted elements */
.bootcamp-message.position-top {
    top: 20px;
    bottom: auto;
    transform: translateX(-50%);
}

.bootcamp-message.position-bottom {
    top: auto;
    bottom: 20px;
    transform: translateX(-50%);
}

@keyframes bootcampSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes bootcampSlideInTop {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes bootcampSlideInBottom {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.bootcamp-message.position-top {
    animation: bootcampSlideInTop 0.3s ease-out;
}

.bootcamp-message.position-bottom {
    animation: bootcampSlideInBottom 0.3s ease-out;
}

/* Header */
.bootcamp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: rgba(0, 255, 65, 0.1);
    border-bottom: 1px solid rgba(0, 255, 65, 0.3);
}

.bootcamp-step-indicator {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #00ff41;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
}

.bootcamp-skip-btn {
    background: transparent;
    border: 1px solid #666;
    color: #666;
    padding: 4px 10px;
    font-size: 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.bootcamp-skip-btn:hover {
    border-color: #ff6b6b;
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
}

/* Content */
.bootcamp-content {
    padding: 25px 20px;
    text-align: center;
}

.bootcamp-icon {
    font-size: 48px;
    margin-bottom: 15px;
    animation: bootcampIconPulse 2s ease-in-out infinite;
}

@keyframes bootcampIconPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.bootcamp-title {
    font-family: 'Courier New', monospace;
    font-size: 18px;
    color: #00ff41;
    letter-spacing: 3px;
    margin-bottom: 12px;
    text-shadow: 0 0 15px rgba(0, 255, 65, 0.5);
}

.bootcamp-text {
    font-size: 13px;
    color: #8892b0;
    line-height: 1.6;
    max-width: 340px;
    margin: 0 auto;
}

.bootcamp-text strong {
    color: #00ff41;
}

.bootcamp-text .highlight-blue {
    color: #3498db;
    font-weight: bold;
}

.bootcamp-text .highlight-red {
    color: #e74c3c;
    font-weight: bold;
}

/* Footer */
.bootcamp-footer {
    padding: 15px 20px 20px;
    text-align: center;
}

.bootcamp-action-btn {
    width: 100%;
    padding: 14px 24px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 2px;
    color: #0a1628;
    background: linear-gradient(135deg, #00ff41 0%, #00cc33 100%);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(0, 255, 65, 0.3);
}

.bootcamp-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 65, 0.4);
}

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

/* Hidden button for action-based steps (waiting for user action) */
.bootcamp-action-btn.hidden {
    display: none;
}

/* Waiting state indicator */
.bootcamp-waiting {
    display: none;
    padding: 12px;
    font-size: 11px;
    color: #ffd700;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
    animation: bootcampWaitingPulse 1.5s ease-in-out infinite;
}

.bootcamp-waiting.active {
    display: block;
}

@keyframes bootcampWaitingPulse {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

/* Highlight class: Brings elements above overlay with glow */
.bootcamp-highlight {
    position: relative;
    z-index: 9050 !important;
    box-shadow:
        0 0 0 4px rgba(0, 255, 65, 0.5),
        0 0 20px rgba(0, 255, 65, 0.4),
        0 0 40px rgba(0, 255, 65, 0.2) !important;
    border-radius: 8px;
    animation: bootcampHighlightPulse 2s ease-in-out infinite;
}

@keyframes bootcampHighlightPulse {

    0%,
    100% {
        box-shadow:
            0 0 0 4px rgba(0, 255, 65, 0.5),
            0 0 20px rgba(0, 255, 65, 0.4),
            0 0 40px rgba(0, 255, 65, 0.2);
    }

    50% {
        box-shadow:
            0 0 0 6px rgba(0, 255, 65, 0.7),
            0 0 30px rgba(0, 255, 65, 0.6),
            0 0 60px rgba(0, 255, 65, 0.3);
    }
}

/* Amber highlight variant for warnings/side selection */
.bootcamp-highlight-amber {
    position: relative;
    z-index: 9050 !important;
    box-shadow:
        0 0 0 4px rgba(255, 193, 7, 0.5),
        0 0 20px rgba(255, 193, 7, 0.4),
        0 0 40px rgba(255, 193, 7, 0.2) !important;
    border-radius: 8px;
    animation: bootcampHighlightAmberPulse 2s ease-in-out infinite;
}

@keyframes bootcampHighlightAmberPulse {

    0%,
    100% {
        box-shadow:
            0 0 0 4px rgba(255, 193, 7, 0.5),
            0 0 20px rgba(255, 193, 7, 0.4),
            0 0 40px rgba(255, 193, 7, 0.2);
    }

    50% {
        box-shadow:
            0 0 0 6px rgba(255, 193, 7, 0.7),
            0 0 30px rgba(255, 193, 7, 0.6),
            0 0 60px rgba(255, 193, 7, 0.3);
    }
}

/* Canvas highlight needs special treatment */
#gameCanvas.bootcamp-highlight {
    border-radius: 5px;
}

/* =============================================================================
   Delete Mode Button (Mobile-friendly unit removal)
   ============================================================================= */
.delete-mode-container {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #334;
}

.delete-mode-btn {
    width: 100%;
    padding: 10px;
    font-size: 12px;
    background: #333;
    color: #aaa;
    border: 2px solid #444;
    border-radius: 6px;
    transition: all 0.2s;
}

.delete-mode-btn:hover {
    background: #444;
    color: #fff;
    border-color: #666;
}

.delete-mode-btn.active {
    background: #5a2a2a;
    color: #ff4444;
    border-color: #ff4444;
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.3);
}

.delete-mode-btn.active:hover {
    background: #6a3a3a;
}

/* Tutorial restart button */
.tutorial-btn {
    width: 100%;
    padding: 10px;
    font-size: 12px;
    background: #1a3a2a;
    color: #64ffda;
    border: 2px solid #2a5a4a;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.tutorial-btn:hover {
    background: #2a4a3a;
    color: #7fffea;
    border-color: #64ffda;
}

/* Help text hints - show appropriate hint per device */
.mobile-hint {
    display: none;
}

.desktop-hint {
    display: inline;
}

/* =============================================================================
   Game Options Inline (Inside Unit Editor)
   ============================================================================= */
.game-options-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px;
    margin-bottom: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    border: 1px solid #0f3460;
}

.option-checkbox-inline {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #aaa;
    cursor: pointer;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    transition: all 0.2s;
}

.option-checkbox-inline:hover {
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
}

.option-checkbox-inline input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: #3498db;
}

.option-checkbox-inline input[type="checkbox"]:checked+span {
    color: #7d7;
}

/* =============================================================================
   Zone Containers (Desktop defaults - side by side layout preserved)
   ============================================================================= */
.battlefield-zone {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.command-deck-zone {
    width: 280px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    /* Desktop: fill height via stretch, don't shrink */
    flex-shrink: 0;
}

/* =============================================================================
   CTA Panel (Desktop: Bottom of sidebar) - 2x2 Grid
   ============================================================================= */
.cta-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px;
    margin-top: auto;
    /* Push to bottom */
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid #0f3460;
}

.cta-panel .cta-btn {
    padding: 10px 12px;
    font-size: 12px;
    font-weight: bold;
    border-radius: 6px;
    border: 2px solid;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.cta-panel .share-btn {
    background: linear-gradient(135deg, #1a4a7c 0%, #0f3460 100%);
    border-color: #3498db;
    color: #fff;
}

.cta-panel .share-btn:hover {
    background: linear-gradient(135deg, #2567a0 0%, #1a4a7c 100%);
    box-shadow: 0 0 12px rgba(52, 152, 219, 0.5);
    transform: translateY(-1px);
}

.cta-panel .coffee-btn {
    background: linear-gradient(135deg, #a67c00 0%, #8b6914 100%);
    border-color: #ffc107;
    color: #fff;
}

.cta-panel .coffee-btn:hover {
    background: linear-gradient(135deg, #c99a00 0%, #a67c00 100%);
    box-shadow: 0 0 12px rgba(255, 193, 7, 0.5);
    transform: translateY(-1px);
}

.cta-panel a.threads-btn,
.cta-panel a.threads-btn:visited,
.cta-panel a.threads-btn:link {
    background: linear-gradient(135deg, #333 0%, #1a1a1a 100%);
    border-color: #666;
    color: #fff !important;
}

.cta-panel a.threads-btn:hover {
    background: linear-gradient(135deg, #444 0%, #333 100%);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.cta-panel a.email-btn,
.cta-panel a.email-btn:visited,
.cta-panel a.email-btn:link {
    background: linear-gradient(135deg, #2d5a3d 0%, #1e3d29 100%);
    border-color: #4CAF50;
    color: #fff !important;
}

.cta-panel a.email-btn:hover {
    background: linear-gradient(135deg, #3d7a52 0%, #2d5a3d 100%);
    box-shadow: 0 0 12px rgba(76, 175, 80, 0.5);
    transform: translateY(-1px);
}

/* =============================================================================
   Mobile "Tactical Terminal" Split-Screen Layout (Nintendo DS Style)
   ============================================================================= */
@media (max-width: 768px) {

    /* Lock the viewport - no page scrolling */
    html,
    body {
        height: 100%;
        overflow: hidden;
        padding: 0;
        margin: 0;
    }

    .game-container {
        display: flex;
        flex-direction: column;
        height: 100vh;
        height: 100dvh;
        /* Dynamic viewport height for mobile browsers */
        padding: 0;
        gap: 0;
        border-radius: 0;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    /* =========================================================================
       TOP ZONE: The Battlefield (Maximized for canvas)
       ========================================================================= */
    .battlefield-zone {
        flex: 1 1 auto;
        /* Grow to fill available space */
        min-height: 55%;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        background: #0d1b2a;
    }

    /* Ultra-compact status dashboard - single row layout */
    .battlefield-zone .status-dashboard {
        flex-shrink: 0;
        padding: 4px 8px;
        border-radius: 0;
        background: linear-gradient(180deg, #16213e 0%, #0d1b2a 100%);
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        border-bottom: 1px solid #0f3460;
    }

    .battlefield-zone .dashboard-header {
        display: flex;
        align-items: center;
        gap: 6px;
        margin: 0;
        padding: 0;
        border: none;
    }

    .battlefield-zone .time-display {
        flex: 1;
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 0;
        margin: 0;
        background: none;
    }

    .battlefield-zone .time-display .day {
        font-size: 14px;
        font-weight: bold;
    }

    .battlefield-zone .time-display .hour {
        font-size: 10px;
        color: #888;
    }

    .battlefield-zone .time-display .progress-bar {
        flex: 1;
        height: 4px;
        margin: 0;
        max-width: 80px;
    }

    .battlefield-zone .force-status {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 0;
        margin: 0;
        background: none;
    }

    .battlefield-zone .force-row {
        display: flex;
        align-items: center;
        gap: 3px;
    }

    .battlefield-zone .force-count {
        font-size: 14px;
    }

    .battlefield-zone .force-label {
        font-size: 8px;
    }

    .battlefield-zone .force-ratio {
        font-size: 9px;
        display: none;
        /* Hide ratio on mobile to save space */
    }

    .battlefield-zone .victory-condition {
        display: none;
        /* Hide on mobile - shown in tutorial */
    }

    /* Canvas: MAXIMIZE - Fill all remaining space */
    .battlefield-zone #gameCanvas {
        flex: 1;
        width: 100% !important;
        height: 100% !important;
        min-height: 0;
        object-fit: contain;
        border-radius: 0;
        border: none;
        display: block;
        margin: 0 auto;
    }

    /* =========================================================================
       BOTTOM ZONE: The Command Deck (Compact, Scrollable)
       ========================================================================= */
    .command-deck-zone {
        flex: 0 0 auto;
        width: 100%;
        /* Override desktop fixed width */
        max-width: none;
        max-height: 45%;
        min-height: 120px;
        overflow-y: auto;
        overflow-x: hidden;
        background: #0d1b2a;
        border-top: 2px solid #00ff41;
        box-shadow: 0 -4px 20px rgba(0, 255, 65, 0.2);
        padding: 8px;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    /* Scrollbar styling for command deck */
    .command-deck-zone::-webkit-scrollbar {
        width: 4px;
    }

    .command-deck-zone::-webkit-scrollbar-track {
        background: #0a1628;
    }

    .command-deck-zone::-webkit-scrollbar-thumb {
        background: #00ff41;
        border-radius: 2px;
    }

    /* Panels: Compact for mobile */
    .command-deck-zone .panel {
        padding: 10px;
        margin: 0;
        border-radius: 6px;
    }

    .command-deck-zone .panel h3 {
        font-size: 12px;
        padding-bottom: 6px;
        margin-bottom: 8px;
    }

    /* Control buttons: 2x2 Grid layout */
    .command-deck-zone .control-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .command-deck-zone .control-buttons button {
        min-height: 40px;
        padding: 10px 8px;
        font-size: 11px;
    }

    /* Erase button in control panel - reset styles */
    .command-deck-zone .control-buttons .delete-mode-btn {
        background: #333;
        color: #aaa;
        border: 2px solid #444;
    }

    .command-deck-zone .control-buttons .delete-mode-btn.active {
        background: #5a2a2a;
        color: #ff4444;
        border-color: #ff4444;
        box-shadow: 0 0 10px rgba(255, 68, 68, 0.3);
    }

    /* Auto Deploy spans full width */
    .command-deck-zone #autoDeployBtn {
        grid-column: 1 / -1;
    }

    /* Help text in Control Panel */
    .command-deck-zone .control-buttons+.help-text {
        font-size: 9px;
        color: #666;
        text-align: center;
        padding: 4px 0;
        margin-top: 4px;
    }

    /* Touch-friendly buttons */
    button,
    .action-btn,
    .modal-btn,
    .unlock-btn {
        min-height: 44px;
        padding: 10px 12px;
        font-size: 13px;
    }

    /* Game Options Inline: Compact for mobile */
    .game-options-inline {
        padding: 6px;
        gap: 4px;
        margin-bottom: 8px;
    }

    .option-checkbox-inline {
        font-size: 10px;
        padding: 4px 6px;
    }

    .option-checkbox-inline input[type="checkbox"] {
        width: 12px;
        height: 12px;
    }

    /* =========================================================================
       Unit Editor: 2-Column Grid Layout (Space Saving)
       ========================================================================= */
    .command-deck-zone .radio-group {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 4px;
    }

    .command-deck-zone .radio-group label {
        min-height: 38px;
        padding: 8px 6px;
        font-size: 11px;
        background: rgba(0, 0, 0, 0.2);
        border-radius: 4px;
        margin: 0;
    }

    .command-deck-zone .radio-group input[type="radio"] {
        width: 16px;
        height: 16px;
        margin-right: 4px;
    }

    /* Hide special abilities on mobile to save space */
    .command-deck-zone .special-ability,
    .command-deck-zone .weapon-info {
        display: none;
    }

    /* Transport indicator: smaller */
    .command-deck-zone .transport-indicator {
        font-size: 6px;
        padding: 1px 2px;
    }

    /* Side selector: full width items */
    .command-deck-zone #sideSelector {
        grid-template-columns: 1fr 1fr;
    }

    /* Unit categories: inline grid */
    .command-deck-zone .unit-category {
        margin-top: 4px;
        padding-top: 4px;
    }

    .command-deck-zone .unit-category-label {
        font-size: 9px;
        margin-bottom: 4px;
        grid-column: 1 / -1;
    }

    /* Unit stats: Compact 2-column layout */
    .command-deck-zone .unit-stats-display {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2px 8px;
        font-size: 9px;
        padding: 6px;
    }

    .command-deck-zone .unit-stats-display .stat-row {
        margin: 0;
    }

    /* Section labels */
    .command-deck-zone .section-label {
        font-size: 9px;
        margin-top: 6px;
        margin-bottom: 4px;
        grid-column: 1 / -1;
    }

    /* Delete mode button */
    .command-deck-zone .delete-mode-btn {
        min-height: 40px;
        font-size: 12px;
    }

    /* Help text */
    .command-deck-zone .help-text {
        font-size: 9px;
        padding: 6px;
        margin-top: 6px;
    }

    /* Option checkboxes */
    .command-deck-zone .option-checkbox {
        min-height: 38px;
        font-size: 11px;
    }

    .command-deck-zone .option-checkbox input[type="checkbox"] {
        width: 18px;
        height: 18px;
    }

    .command-deck-zone .option-description {
        font-size: 9px;
        margin-left: 24px;
    }

    /* Sandbox panel */
    .command-deck-zone .sandbox-slider {
        height: 6px;
    }

    .command-deck-zone .sandbox-slider::-webkit-slider-thumb {
        width: 20px;
        height: 20px;
    }

    .command-deck-zone .sandbox-label {
        font-size: 10px;
    }

    /* Cursor panel: Hidden on mobile */
    .command-deck-zone .cursor-panel {
        display: none;
    }

    /* Show mobile hint, hide desktop hint */
    .mobile-hint {
        display: inline;
    }

    .desktop-hint {
        display: none;
    }

    /* =========================================================================
       Modals: Adjusted for split-screen
       ========================================================================= */
    .modal-content {
        width: 95%;
        max-width: none;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-header h2 {
        font-size: 16px;
    }

    .war-report {
        font-size: 9px;
        padding: 10px;
        max-height: 30vh;
        overflow-y: auto;
    }

    .modal-actions {
        flex-direction: column;
        gap: 6px;
    }

    .modal-btn {
        width: 100%;
    }

    /* Tutorial modal */
    .tutorial-modal {
        max-width: none;
        width: 95%;
    }

    .tutorial-step {
        padding: 10px;
    }

    .step-content strong {
        font-size: 12px;
    }

    .step-content p {
        font-size: 10px;
    }

    /* Footer: Visible inside command deck */
    .site-footer {
        display: block;
        padding: 10px;
        background: none;
        border-top: 1px dashed #334;
        font-size: 9px;
    }

    .site-footer .disclaimer {
        font-size: 8px;
        margin-bottom: 4px;
    }

    .site-footer .contact-links {
        font-size: 9px;
    }

    /* Force status on mobile */
    .force-status {
        padding: 6px;
    }

    .force-count {
        font-size: 18px;
    }

    /* =========================================================================
       CTA Panel: 2x2 Grid (Share, Coffee, Threads, Email)
       ========================================================================= */
    .cta-panel {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        padding: 10px 8px;
        margin-top: auto;
        border-top: 1px dashed #334;
        background: rgba(0, 0, 0, 0.2);
        border-radius: 6px;
    }

    .cta-panel .cta-btn {
        min-height: 40px;
        padding: 8px 10px;
        font-size: 11px;
    }

    /* Ensure button colors are applied on mobile (override link defaults) */
    .cta-panel a.threads-btn,
    .cta-panel a.threads-btn:visited,
    .cta-panel a.threads-btn:link {
        background: linear-gradient(135deg, #333 0%, #1a1a1a 100%);
        border-color: #666;
        color: #fff !important;
    }

    .cta-panel a.email-btn,
    .cta-panel a.email-btn:visited,
    .cta-panel a.email-btn:link {
        background: linear-gradient(135deg, #2d5a3d 0%, #1e3d29 100%);
        border-color: #4CAF50;
        color: #fff !important;
    }

}

/* Extra small screens (phones in portrait) */
@media (max-width: 480px) {
    .battlefield-zone {
        min-height: 50%;
        /* Slightly less canvas space on tiny screens */
    }

    .command-deck-zone {
        max-height: 50%;
    }

    .battlefield-zone .time-display .day {
        font-size: 12px;
    }

    .battlefield-zone .force-count {
        font-size: 14px;
    }

    .command-deck-zone .panel h3 {
        font-size: 11px;
    }

    .command-deck-zone .radio-group label {
        font-size: 10px;
        min-height: 34px;
        padding: 6px 4px;
    }

    /* CTA panel: Keep 2x2 grid on tiny screens */
    .cta-panel {
        gap: 4px;
        padding: 8px 6px;
    }

    .cta-panel .cta-btn {
        min-height: 36px;
        padding: 6px 8px;
        font-size: 10px;
    }

    .modal-header h2 {
        font-size: 14px;
        letter-spacing: 1px;
    }

    .tutorial-header h2 {
        font-size: 12px;
        letter-spacing: 1px;
    }

    /* Bootcamp Tutorial: Mobile adjustments */
    .bootcamp-message {
        width: 95%;
        max-width: none;
    }

    .bootcamp-message.position-top {
        top: 10px;
    }

    .bootcamp-message.position-bottom {
        bottom: 10px;
    }

    .bootcamp-content {
        padding: 15px;
    }

    .bootcamp-icon {
        font-size: 36px;
        margin-bottom: 10px;
    }

    .bootcamp-title {
        font-size: 14px;
        letter-spacing: 2px;
    }

    .bootcamp-text {
        font-size: 12px;
    }

    .bootcamp-action-btn {
        padding: 12px 20px;
        font-size: 12px;
    }

    /* On mobile split-screen, position message at bottom to not cover canvas */
    /* On mobile split-screen, position message at top (below dashboard) to clear map center */
    .bootcamp-message.mobile-bottom {
        top: 55px;
        /* Clear the top dashboard (~40px) */
        bottom: auto;
        transform: translateX(-50%);
        width: 92%;
        max-width: none;
    }

    /* COMPACT MODE FOR MOBILE TUTORIAL */
    /* Reduce size to prevent obstructing the map/controls */
    .bootcamp-message {
        padding: 0;
        border-width: 1px;
    }

    .bootcamp-header {
        padding: 6px 10px;
        font-size: 10px;
    }

    .bootcamp-content {
        padding: 10px 12px;
    }

    .bootcamp-icon {
        font-size: 24px;
        /* Smaller icon */
        margin-bottom: 8px;
    }

    .bootcamp-title {
        font-size: 14px;
        margin-bottom: 6px;
    }

    .bootcamp-content p {
        font-size: 12px;
        line-height: 1.4;
        margin-bottom: 10px;
    }

    .bootcamp-action-btn {
        padding: 8px 16px;
        font-size: 11px;
        min-height: 32px;
    }
}