/* === Reset and Base Styles === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', monospace;
    background-color: #1a1a1a;
    color: #ffffff;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

/* === Header === */
.game-header {
    text-align: center;
    padding: 30px 20px;
    margin: 20px auto;
    max-width: 1280px;
    position: relative;
    background-color: #0a0a0a;
    border: 4px solid #ff0000;
    border-radius: 4px;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.4),
                inset 0 0 20px rgba(0, 0, 0, 0.9);
}

/* Pixel art corner accents */
.game-header::before,
.game-header::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background-color: #ff0000;
    box-shadow:
        0 0 0 2px #000,
        0 0 0 4px #ff0000,
        0 0 10px rgba(255, 0, 0, 0.6);
}

.game-header::before {
    top: -2px;
    left: -2px;
}

.game-header::after {
    top: -2px;
    right: -2px;
}

.game-title {
    font-size: 48px;
    font-weight: bold;
    color: #ff0000;
    margin: 0;
    padding-bottom: 15px;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.8),
                 0 0 20px rgba(255, 0, 0, 0.5);
    letter-spacing: 4px;
    position: relative;
}

/* Pixel art divider between title and tagline */
.game-title::after {
    content: '';
    display: block;
    width: 200px;
    height: 4px;
    background:
        linear-gradient(90deg,
            transparent 0%,
            transparent 10%,
            #ff0000 10%,
            #ff0000 20%,
            transparent 20%,
            transparent 30%,
            #ff0000 30%,
            #ff0000 40%,
            transparent 40%,
            transparent 60%,
            #ff0000 60%,
            #ff0000 70%,
            transparent 70%,
            transparent 80%,
            #ff0000 80%,
            #ff0000 90%,
            transparent 90%,
            transparent 100%
        );
    margin: 15px auto 0;
    box-shadow: 0 0 8px rgba(255, 0, 0, 0.5);
}

.game-tagline {
    font-size: 18px;
    font-weight: normal;
    color: #00ffff;
    margin: 15px 0 0 0;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.6);
    letter-spacing: 2px;
}

/* === Game Container === */
#game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    margin: 20px 0;
    background-color: #000000;
    border: 4px solid #ff0000;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.5),
                0 0 40px rgba(255, 0, 0, 0.3),
                inset 0 0 10px rgba(0, 0, 0, 0.8);
}

/* === Canvas Styling === */
#gameCanvas {
    display: block;
    background-color: #000080;
    border: 2px solid #ffffff;
    /* Pixel-perfect rendering */
    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-crisp-edges;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    /* Disable smoothing */
    -ms-interpolation-mode: nearest-neighbor;
}

/* === Footer === */
.game-footer {
    text-align: center;
    padding: 30px 20px;
    margin: 20px auto;
    margin-bottom: 20px;
    max-width: 1280px;
    position: relative;
    background-color: #0a0a0a;
    border: 4px solid #ff0000;
    border-radius: 4px;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.4),
                inset 0 0 20px rgba(0, 0, 0, 0.9);
}

/* Pixel art corner accents for footer */
.game-footer::before,
.game-footer::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background-color: #ff0000;
    box-shadow:
        0 0 0 2px #000,
        0 0 0 4px #ff0000,
        0 0 10px rgba(255, 0, 0, 0.6);
}

.game-footer::before {
    bottom: -2px;
    left: -2px;
}

.game-footer::after {
    bottom: -2px;
    right: -2px;
}

.footer-nav {
    margin-bottom: 15px;
    position: relative;
    padding-bottom: 15px;
}

/* Pixel art divider after navigation */
.footer-nav::after {
    content: '';
    display: block;
    width: 200px;
    height: 4px;
    background:
        linear-gradient(90deg,
            transparent 0%,
            transparent 10%,
            #00ffff 10%,
            #00ffff 20%,
            transparent 20%,
            transparent 30%,
            #00ffff 30%,
            #00ffff 40%,
            transparent 40%,
            transparent 60%,
            #00ffff 60%,
            #00ffff 70%,
            transparent 70%,
            transparent 80%,
            #00ffff 80%,
            #00ffff 90%,
            transparent 90%,
            transparent 100%
        );
    margin: 15px auto 0;
    box-shadow: 0 0 8px rgba(0, 255, 255, 0.5);
}

.footer-link {
    color: #00ffff;
    text-decoration: none;
    font-size: 14px;
    letter-spacing: 1px;
    padding: 8px 12px;
    display: inline-block;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    border-radius: 2px;
}

.footer-link:hover {
    color: #ffffff;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.8);
    border-color: #00ffff;
    background-color: rgba(0, 255, 255, 0.1);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.footer-separator {
    color: #ff0000;
    margin: 0 5px;
    font-size: 14px;
    font-weight: bold;
}

.footer-copyright {
    font-size: 12px;
    color: #888888;
    margin: 15px 0 0 0;
    letter-spacing: 1px;
    text-shadow: 0 0 3px rgba(255, 255, 255, 0.3);
}

/* === Responsive Design === */
@media screen and (max-width: 1400px) {
    #gameCanvas {
        width: 100%;
        height: auto;
        max-width: 1280px;
    }

    #game-container {
        padding: 15px;
        max-width: 95vw;
    }
}

@media screen and (max-width: 768px) {
    #game-container {
        padding: 10px;
        border-width: 2px;
    }

    body {
        padding: 10px;
    }

    .game-title {
        font-size: 36px;
        letter-spacing: 3px;
    }

    .game-title::after {
        width: 150px;
        height: 3px;
    }

    .game-tagline {
        font-size: 16px;
        letter-spacing: 1px;
    }

    .game-header {
        padding: 25px 15px;
        margin: 15px 10px;
        border-width: 3px;
    }

    .game-header::before,
    .game-header::after {
        width: 12px;
        height: 12px;
    }

    .footer-link {
        font-size: 13px;
    }

    .footer-separator {
        margin: 0 8px;
        font-size: 13px;
    }

    .footer-copyright {
        font-size: 11px;
    }

    .game-footer {
        padding: 25px 15px;
        margin: 15px 10px;
        margin-bottom: 15px;
        border-width: 3px;
    }

    .game-footer::before,
    .game-footer::after {
        width: 12px;
        height: 12px;
    }

    .footer-nav::after {
        width: 150px;
        height: 3px;
    }
}

@media screen and (max-width: 480px) {
    #game-container {
        padding: 5px;
        border-radius: 4px;
    }

    .game-title {
        font-size: 28px;
        letter-spacing: 2px;
    }

    .game-title::after {
        width: 120px;
        height: 2px;
    }

    .game-tagline {
        font-size: 14px;
        letter-spacing: 1px;
    }

    .game-header {
        padding: 20px 10px;
        margin: 10px 5px;
        border-width: 2px;
    }

    .game-header::before,
    .game-header::after {
        width: 8px;
        height: 8px;
    }

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

    .footer-separator {
        display: none;
    }

    .footer-link {
        font-size: 12px;
        display: block;
    }

    .footer-copyright {
        font-size: 10px;
    }

    .game-footer {
        padding: 20px 10px;
        margin: 10px 5px;
        margin-bottom: 10px;
        border-width: 2px;
    }

    .game-footer::before,
    .game-footer::after {
        width: 8px;
        height: 8px;
    }

    .footer-nav::after {
        width: 120px;
        height: 2px;
    }
}

/* === Arcade Aesthetic === */
#game-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 1;
}

/* === Loading State === */
#gameCanvas.loading {
    opacity: 0.7;
    filter: blur(2px);
}

/* === Retro Glow Effect === */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 0, 0, 0.5),
                    0 0 40px rgba(255, 0, 0, 0.3),
                    inset 0 0 10px rgba(0, 0, 0, 0.8);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 0, 0, 0.7),
                    0 0 60px rgba(255, 0, 0, 0.5),
                    inset 0 0 10px rgba(0, 0, 0, 0.8);
    }
}

#game-container {
    animation: glow 3s ease-in-out infinite;
}

/* === Page Content Styling === */
.page-content {
    width: 100%;
    max-width: 900px;
    padding: 40px;
    color: #ffffff;
    line-height: 1.6;
}

.content-section {
    margin-bottom: 30px;
}

.section-title {
    font-size: 24px;
    color: #ff0000;
    margin-bottom: 15px;
    text-shadow: 0 0 8px rgba(255, 0, 0, 0.6);
    letter-spacing: 2px;
    border-bottom: 2px solid #ff0000;
    padding-bottom: 8px;
}

.content-text {
    font-size: 16px;
    color: #cccccc;
    margin-bottom: 15px;
    letter-spacing: 0.5px;
}

.content-text strong {
    color: #ffffff;
}

.content-link {
    color: #00ffff;
    text-decoration: none;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.content-link:hover {
    color: #ffffff;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.8);
}

.content-list {
    list-style-type: square;
    margin-left: 30px;
    margin-bottom: 15px;
    color: #cccccc;
}

.content-list li {
    margin-bottom: 8px;
}

.attribution-prominent {
    font-size: 20px;
    color: #00ffff;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.6);
    margin-bottom: 10px;
}

.center-text {
    text-align: center;
    margin-top: 30px;
}

.back-link {
    display: inline-block;
    padding: 12px 24px;
    background-color: #ff0000;
    color: #ffffff;
    text-decoration: none;
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 1px;
    border: 2px solid #ff0000;
    transition: all 0.3s ease;
}

.back-link:hover {
    background-color: #000000;
    border-color: #ffffff;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.8);
}

/* === License Page Specific === */
.license-box {
    background-color: #0a0a0a;
    border: 2px solid #555555;
    border-left: 4px solid #ff0000;
    padding: 20px;
    margin: 20px 0;
    border-radius: 4px;
}

.license-text {
    font-size: 14px;
    color: #aaaaaa;
    margin-bottom: 12px;
    line-height: 1.7;
}

.license-subsection {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #333333;
}

.subsection-title {
    font-size: 20px;
    color: #00ffff;
    margin-bottom: 12px;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
    letter-spacing: 1px;
}

/* === Responsive Page Content === */
@media screen and (max-width: 768px) {
    .page-content {
        padding: 30px 20px;
    }

    .section-title {
        font-size: 20px;
    }

    .content-text {
        font-size: 14px;
    }

    .attribution-prominent {
        font-size: 18px;
    }

    .back-link {
        padding: 10px 20px;
        font-size: 14px;
    }

    .license-box {
        padding: 15px;
    }

    .license-text {
        font-size: 13px;
    }

    .subsection-title {
        font-size: 18px;
    }
}

@media screen and (max-width: 480px) {
    .page-content {
        padding: 20px 15px;
    }

    .section-title {
        font-size: 18px;
        letter-spacing: 1px;
    }

    .content-text {
        font-size: 13px;
    }

    .attribution-prominent {
        font-size: 16px;
    }

    .content-list {
        margin-left: 20px;
    }

    .back-link {
        padding: 8px 16px;
        font-size: 13px;
    }

    .license-box {
        padding: 12px;
    }

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

    .subsection-title {
        font-size: 16px;
    }
}

/* === Settings Panel (issue #151) === */
/* Modal overlay - semi-transparent background */
.settings-overlay {
    display: none; /* Hidden by default, shown via JS */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

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

/* Settings panel container */
.settings-panel {
    background-color: #0a0a0a;
    border: 4px solid #ff0000;
    border-radius: 4px;
    box-shadow:
        0 0 20px rgba(255, 0, 0, 0.6),
        inset 0 0 30px rgba(0, 0, 0, 0.9);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    animation: slideIn 0.3s ease;
    position: relative;
}

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

/* Panel header */
.settings-header {
    background-color: #1a0000;
    padding: 20px;
    border-bottom: 3px solid #ff0000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.settings-title {
    font-size: 32px;
    color: #ff0000;
    margin: 0;
    text-shadow:
        0 0 10px rgba(255, 0, 0, 0.8),
        0 0 20px rgba(255, 0, 0, 0.5);
    letter-spacing: 4px;
}

.settings-close {
    background: none;
    border: 2px solid #ff0000;
    color: #ff0000;
    font-size: 32px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.2s ease;
    font-family: 'Courier New', monospace;
    line-height: 1;
    padding: 0;
}

.settings-close:hover {
    background-color: #ff0000;
    color: #000000;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.8);
    transform: scale(1.1);
}

/* Panel content */
.settings-content {
    padding: 30px;
}

/* Settings group */
.settings-group {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #333333;
}

.settings-group:last-child {
    border-bottom: none;
}

/* Settings label */
.settings-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    color: #00ffff;
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 2px;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
}

.label-text {
    color: #00ffff;
}

.label-value {
    color: #ffff00;
    font-size: 14px;
    text-shadow: 0 0 5px rgba(255, 255, 0, 0.5);
}

.label-note {
    color: #888888;
    font-size: 12px;
    font-style: italic;
    text-shadow: none;
}

/* Slider container */
.slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.slider-label {
    color: #999999;
    font-size: 12px;
    letter-spacing: 1px;
    min-width: 50px;
    text-align: center;
}

/* Range slider */
.settings-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    background: linear-gradient(90deg, #ff0000 0%, #ffff00 100%);
    outline: none;
    border-radius: 4px;
    box-shadow:
        0 0 10px rgba(255, 0, 0, 0.3),
        inset 0 0 5px rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

/* Slider thumb - WebKit */
.settings-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background-color: #ffffff;
    border: 3px solid #ff0000;
    border-radius: 2px;
    cursor: pointer;
    box-shadow:
        0 0 15px rgba(255, 0, 0, 0.8),
        inset 0 0 5px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.settings-slider::-webkit-slider-thumb:hover {
    background-color: #ffff00;
    box-shadow:
        0 0 20px rgba(255, 255, 0, 0.9),
        inset 0 0 5px rgba(0, 0, 0, 0.3);
    transform: scale(1.2);
}

/* Slider thumb - Firefox */
.settings-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background-color: #ffffff;
    border: 3px solid #ff0000;
    border-radius: 2px;
    cursor: pointer;
    box-shadow:
        0 0 15px rgba(255, 0, 0, 0.8),
        inset 0 0 5px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.settings-slider::-moz-range-thumb:hover {
    background-color: #ffff00;
    box-shadow:
        0 0 20px rgba(255, 255, 0, 0.9),
        inset 0 0 5px rgba(0, 0, 0, 0.3);
    transform: scale(1.2);
}

/* Checkbox container */
.checkbox-label {
    cursor: pointer;
}

.checkbox-container {
    position: relative;
    display: inline-block;
}

/* Hide default checkbox */
.settings-checkbox {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

/* Custom checkbox */
.checkbox-custom {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid #ff0000;
    border-radius: 2px;
    background-color: #1a1a1a;
    position: relative;
    box-shadow:
        0 0 10px rgba(255, 0, 0, 0.3),
        inset 0 0 5px rgba(0, 0, 0, 0.5);
    transition: all 0.2s ease;
}

.checkbox-custom::after {
    content: '';
    position: absolute;
    display: none;
    left: 8px;
    top: 3px;
    width: 8px;
    height: 14px;
    border: solid #ffff00;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
    filter: drop-shadow(0 0 5px rgba(255, 255, 0, 0.8));
}

.settings-checkbox:checked ~ .checkbox-custom {
    background-color: #ff0000;
    box-shadow:
        0 0 15px rgba(255, 0, 0, 0.8),
        inset 0 0 10px rgba(0, 0, 0, 0.3);
}

.settings-checkbox:checked ~ .checkbox-custom::after {
    display: block;
}

.checkbox-custom:hover {
    box-shadow:
        0 0 20px rgba(255, 0, 0, 0.6),
        inset 0 0 5px rgba(0, 0, 0, 0.5);
    transform: scale(1.1);
}

/* Toggle button container */
.toggle-container {
    display: flex;
    gap: 10px;
}

.toggle-button {
    flex: 1;
    padding: 12px 20px;
    background-color: #1a1a1a;
    border: 3px solid #666666;
    color: #666666;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 2px;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.2s ease;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);
}

.toggle-button:hover:not(:disabled) {
    border-color: #999999;
    color: #999999;
    box-shadow:
        0 0 10px rgba(153, 153, 153, 0.3),
        inset 0 0 5px rgba(0, 0, 0, 0.5);
}

.toggle-button.active {
    background-color: #00ffff;
    border-color: #00ffff;
    color: #000000;
    box-shadow:
        0 0 15px rgba(0, 255, 255, 0.8),
        inset 0 0 10px rgba(0, 0, 0, 0.2);
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

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

/* Panel footer */
.settings-footer {
    padding: 20px 30px;
    background-color: #1a0000;
    border-top: 3px solid #ff0000;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    position: sticky;
    bottom: 0;
}

/* Settings buttons */
.settings-button {
    flex: 1;
    min-width: 150px;
    padding: 15px 25px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 2px;
    border: 3px solid;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

.button-save {
    background-color: #00ff00;
    border-color: #00ff00;
    color: #000000;
}

.button-save:hover {
    background-color: #00cc00;
    box-shadow:
        0 0 20px rgba(0, 255, 0, 0.8),
        inset 0 0 10px rgba(0, 0, 0, 0.3);
    transform: scale(1.05);
}

.button-cancel {
    background-color: #ff0000;
    border-color: #ff0000;
    color: #ffffff;
}

.button-cancel:hover {
    background-color: #cc0000;
    box-shadow:
        0 0 20px rgba(255, 0, 0, 0.8),
        inset 0 0 10px rgba(0, 0, 0, 0.3);
    transform: scale(1.05);
}

.button-reset {
    background-color: #ffff00;
    border-color: #ffff00;
    color: #000000;
}

.button-reset:hover {
    background-color: #cccc00;
    box-shadow:
        0 0 20px rgba(255, 255, 0, 0.8),
        inset 0 0 10px rgba(0, 0, 0, 0.3);
    transform: scale(1.05);
}

/* Mobile responsive adjustments */
@media screen and (max-width: 768px) {
    .settings-panel {
        max-width: 95%;
        width: 95%;
    }

    .settings-title {
        font-size: 24px;
        letter-spacing: 2px;
    }

    .settings-content {
        padding: 20px;
    }

    .settings-footer {
        padding: 15px 20px;
        flex-direction: column;
    }

    .settings-button {
        min-width: 100%;
    }

    .settings-label {
        font-size: 14px;
    }

    .slider-label {
        font-size: 10px;
        min-width: 40px;
    }
}
