@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #2a2a2a;
    font-family: 'Orbitron', monospace;
    color: #00ff00;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.console {
    background: #4a4a4a;
    border: 6px solid #666;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 
        0 0 40px rgba(0, 0, 0, 0.8),
        inset 0 0 15px rgba(0, 0, 0, 0.5);
    max-width: 1000px;
    width: 100%;
    position: relative;
    min-height: 600px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutLeft {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50px);
    }
}

.screen-transition-in {
    animation: fadeIn 0.4s ease-out forwards;
}

.screen-transition-out {
    animation: fadeOut 0.3s ease-in forwards;
}

.creative-transition-in {
    animation: slideInRight 0.5s ease-out forwards;
}

.game-transition-in {
    animation: fadeIn 0.3s ease-out forwards;
}

.console::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 0, 0.05) 2px,
        rgba(0, 255, 0, 0.05) 4px
    );
    pointer-events: none;
    border-radius: 10px;
}

.shared-canvas {
    position: absolute;
    top: 47.5%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #000;
    border: 3px solid #00ff00;
    border-radius: 8px;
    z-index: 5;
    pointer-events: none;
}

#gameCanvas {
    display: block;
    background: #000;
    border-radius: 5px;
}

.game-layout, .creative-layout {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    height: 500px;
    position: relative;
    z-index: 10;
}

.left-panel, .right-panel {
    background: #3a3a3a;
    border: 2px solid #666;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 200px;
    flex-shrink: 0; 
}

.center-panel {
    background: #1a1a1a;
    border: 3px solid #00ff00;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    flex: 1;
    position: static;
    height: 22.5%;
    margin-top: 42%;
}

.panel-section {
    background: #2a2a2a;
    border: 1px solid #555;
    border-radius: 5px;
    padding: 10px;
}

.panel-section h3 {
    color: #ffff00;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 8px;
    text-align: center;
}

.score-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.score-item {
    color: #00ff00;
    font-size: 11px;
    padding: 2px 5px;
    background: #1a1a1a;
    border-radius: 3px;
}

.panel-btn {
    background: #666;
    color: #ffff00;
    border: 2px solid #888;
    border-radius: 5px;
    padding: 8px 12px;
    font-family: 'Orbitron', monospace;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.panel-btn:hover {
    background: #888;
    border-color: #aaa;
    box-shadow: 0 0 10px rgba(255, 255, 0, 0.3);
}

.game-status {
    text-align: center;
    margin-bottom: 10px;
}

.status-top {
    color: #ffff00;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 5px;
}

.status-bottom {
    color: #00ff00;
    font-size: 14px;
    font-weight: bold;
}

.game-canvas-container {
    background: #000;
    border: 2px solid #ff0000;
    border-radius: 5px;
    padding: 5px;
    margin-bottom: 15px;
}

#game {
    display: block;
    background: #000;
    border-radius: 3px;
}

.game-controls-center {
    display: flex;
    gap: 10px;
}

.game-btn {
    background: #00ff00;
    color: #000;
    border: none;
    border-radius: 5px;
    padding: 8px 15px;
    font-family: 'Orbitron', monospace;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.game-btn:hover {
    background: #44ff44;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.creative-menu {
    position: relative;
    z-index: 1;
    padding: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 500px;
}

.creative-container {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border: 3px solid #00ff00;
    border-radius: 15px;
    padding: 30px;
    max-width: 800px;
    width: 100%;
    box-shadow: 
        0 0 30px rgba(0, 255, 0, 0.3),
        inset 0 0 20px rgba(0, 255, 0, 0.1);
}

.creative-title {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #333;
    padding-bottom: 20px;
}

.creative-title h1 {
    color: #00ff00;
    font-size: 28px;
    font-weight: 900;
    margin-bottom: 10px;
    text-shadow: 0 0 15px rgba(0, 255, 0, 0.5);
}

.creative-title p {
    color: #ffff00;
    font-size: 14px;
    font-style: italic;
}

.settings-grid {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-bottom: 30px;
}

.settings-category {
    background: #333;
    border: 2px solid #555;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s ease;
}

.settings-category:hover {
    border-color: #00ff00;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.2);
}

.settings-category h3 {
    color: #ffff00;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-category .icon {
    font-size: 18px;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background: #2a2a2a;
    border-radius: 8px;
    border: 1px solid #444;
}

.setting-info {
    flex: 1;
}

.setting-info label {
    color: #00ff00;
    font-size: 14px;
    font-weight: bold;
    display: block;
    margin-bottom: 3px;
}

.setting-info .description {
    color: #aaa;
    font-size: 11px;
    line-height: 1.3;
}

.setting-control {
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 120px;
}

.setting-control input[type="range"] {
    flex: 1;
    accent-color: #00ff00;
    height: 6px;
}

.value-badge {
    background: #00ff00;
    color: #000;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    min-width: 45px;
    text-align: center;
}

.toggle-row {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.toggle-item {
    flex: 1; 
}

.toggle-item {
    background: #2a2a2a;
    border: 2px solid #444;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.toggle-item:hover {
    border-color: #00ff00;
    background: #333;
}

.toggle-item input[type="checkbox"] {
    display: none;
}

.toggle-item input[type="checkbox"]:checked + label {
    color: #00ff00;
}

.toggle-item input[type="checkbox"]:checked + label .toggle-title {
    color: #00ff00;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
}

.toggle-item label {
    cursor: pointer;
    display: block;
    color: #aaa;
    transition: all 0.3s ease;
}

.toggle-title {
    font-size: 13px;
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

.toggle-desc {
    font-size: 10px;
    color: #777;
    font-style: italic;
}

.creative-actions {
    text-align: center;
    padding-top: 20px;
    border-top: 2px solid #333;
}

.creative-start-btn {
    background: linear-gradient(135deg, #ffff00, #ffaa00);
    color: #000;
    border: 3px solid #ffaa00;
    border-radius: 12px;
    padding: 15px 40px;
    font-family: 'Orbitron', monospace;
    font-size: 16px;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 auto;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.creative-start-btn:hover {
    background: linear-gradient(135deg, #ffff44, #ffcc44);
    border-color: #ffcc00;
    box-shadow: 0 0 25px rgba(255, 255, 0, 0.6);
    transform: translateY(-2px);
}

.creative-start-btn .btn-icon {
    font-size: 18px;
}

.creative-canvas-container {
    background: #000;
    border: 2px solid #00ff00;
    border-radius: 5px;
    padding: 5px;
    margin-bottom: 15px;
}

.creative-bottom {
    width: 100%;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    background: #2a2a2a;
    padding: 8px 12px;
    border-radius: 5px;
    border: 1px solid #555;
}

.setting-row label {
    color: #ffff00;
    font-size: 11px;
    font-weight: bold;
    min-width: 100px;
}

.setting-row input[type="range"] {
    flex: 1;
    margin: 0 10px;
    accent-color: #00ff00;
}

.value-display {
    color: #00ff00;
    font-size: 11px;
    font-weight: bold;
    min-width: 30px;
    text-align: center;
}

.creative-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
}

.toggle-btn {
    background: #666;
    color: #ffff00;
    border: 2px solid #888;
    border-radius: 5px;
    padding: 6px 10px;
    font-family: 'Orbitron', monospace;
    font-size: 9px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.toggle-btn.active {
    background: #00ff00;
    color: #000;
    border-color: #44ff44;
}

.toggle-btn:hover {
    background: #888;
    box-shadow: 0 0 8px rgba(255, 255, 0, 0.3);
}

.timer-display {
    color: #888;
    font-size: 8px;
}

.start-btn {
    background: #ffff00;
    color: #000;
    border: 2px solid #ffaa00;
    border-radius: 5px;
    padding: 10px 15px;
    font-family: 'Orbitron', monospace;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    margin-top: 10px;
}

.start-btn:hover {
    background: #ffff44;
    box-shadow: 0 0 10px rgba(255, 255, 0, 0.5);
}

.settings-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: #2a2a2a;
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #555;
}

.setting-item label {
    color: #ffff00;
    font-size: 10px;
    font-weight: bold;
}

.setting-item input[type="range"] {
    accent-color: #00ff00;
}

.setting-item span {
    color: #00ff00;
    font-size: 9px;
    text-align: center;
}

.setting-item input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: #00ff00;
}

.setting-item small {
    color: #888;
    font-size: 8px;
    display: block;
    margin-top: 2px;
    font-style: italic;
}

.player-score {
    color: #00ff00;
    font-size: 12px;
    font-weight: bold;
    padding: 5px;
    background: #1a1a1a;
    border-radius: 3px;
    margin-bottom: 5px;
    text-align: center;
}

.hidden {
    display: none !important;
}

.console-header {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.console-header {
    position: relative;
}

.console-header h1 {
    color: #00ff00;
    font-size: 24px;
    font-weight: 900;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
    margin-bottom: 5px;
}

.back-btn {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: #666;
    color: #ffff00;
    border: 2px solid #888;
    border-radius: 5px;
    padding: 8px 15px;
    font-family: 'Orbitron', monospace;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.back-btn:hover {
    background: #888;
    border-color: #aaa;
    box-shadow: 0 0 10px rgba(255, 255, 0, 0.3);
}

.menu {
    text-align: center;
    position: relative;
    z-index: 1;
    padding: 30px;
}

.menu h2 {
    color: #ffff00;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 25px;
    text-shadow: 0 0 8px rgba(255, 255, 0, 0.5);
}

.menu-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.menu-btn {
    background: linear-gradient(135deg, #333, #555);
    color: #00ff00;
    border: 2px solid #00ff00;
    border-radius: 8px;
    padding: 15px 40px;
    font-family: 'Orbitron', monospace;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    min-width: 200px;
}

.menu-btn:hover {
    background: linear-gradient(135deg, #00ff00, #44ff44);
    color: #000;
    border-color: #44ff44;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.6);
    transform: translateY(-2px);
}

.menu-btn:active {
    transform: translateY(0);
}

.game-over {
    text-align: center;
    position: relative;
    z-index: 1;
    padding: 40px;
}

.game-over h2 {
    color: #ff0000;
    font-size: 28px;
    font-weight: 900;
    margin-bottom: 20px;
    text-shadow: 0 0 15px rgba(255, 0, 0, 0.7);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.game-over-controls {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 25px;
}

.game-over-controls button {
    background: linear-gradient(135deg, #333, #555);
    color: #ffff00;
    border: 2px solid #ffff00;
    border-radius: 8px;
    padding: 12px 25px;
    font-family: 'Orbitron', monospace;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.game-over-controls button:hover {
    background: linear-gradient(135deg, #ffff00, #ffff44);
    color: #000;
    box-shadow: 0 0 15px rgba(255, 255, 0, 0.6);
}

.final-score {
    background: #2a2a2a;
    border: 2px solid #00ff00;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.final-score h3 {
    color: #00ff00;
    font-size: 24px;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.final-score p {
    color: #cccccc;
    font-size: 14px;
    margin: 8px 0;
}

.new-record {
    color: #ffff00 !important;
    font-size: 18px !important;
    font-weight: bold;
    text-shadow: 0 0 15px rgba(255, 255, 0, 0.8);
    animation: pulse 1.5s ease-in-out infinite alternate;
}

@keyframes pulse {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.05);
    }
}

.console-header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #00ff41;
    padding-bottom: 15px;
}

.console-header h1 {
    font-size: 2.5rem;
    font-weight: 900;
    text-shadow: 0 0 20px #00ff41;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 0 20px #00ff41; }
    to { text-shadow: 0 0 30px #00ff41, 0 0 40px #00ff41; }
}

.menu {
    text-align: center;
    padding: 20px;
}

.menu h2 {
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: #00ccff;
}

.menu-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 300px;
    margin: 0 auto;
}

.menu-btn, .start-btn, button {
    background: linear-gradient(45deg, #001122, #003366);
    border: 2px solid #00ff41;
    color: #00ff41;
    padding: 15px 30px;
    font-family: 'Orbitron', monospace;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    border-radius: 10px;
}

.menu-btn:hover, .start-btn:hover, button:hover {
    background: linear-gradient(45deg, #003366, #0066cc);
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.5);
    transform: translateY(-2px);
}

.menu-btn:active, .start-btn:active, button:active {
    transform: translateY(0);
}

.game-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.game-info {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 500px;
}

.score-panel {
    display: flex;
    gap: 20px;
    font-size: 1rem;
    font-weight: 700;
}

.multiplayer-scores {
    display: flex;
    gap: 20px;
    font-size: 1rem;
    font-weight: 700;
    color: #ff6600;
}

#game {
    border: 3px solid #00ff41;
    background: #001100;
    box-shadow: 0 0 30px rgba(0, 255, 65, 0.3);
    image-rendering: pixelated;
}

.game-controls {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.game-controls button {
    padding: 10px 20px;
    font-size: 1rem;
}

.settings-panel {
    background: rgba(0, 20, 40, 0.8);
    border: 2px solid #00ccff;
    border-radius: 15px;
    padding: 25px;
    margin: 20px 0;
}

.settings-panel h3 {
    color: #00ccff;
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.5rem;
}

.settings-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 25px;
}

.settings-grid > * {
    flex: 1 1 250px;
    min-width: 250px;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-group label {
    color: #00ff95;
    font-weight: 700;
    font-size: 0.9rem;
}

.setting-group input[type="range"] {
    width: 100%;
    height: 25px;
    background: #001122;
    border-radius: 10px;
    outline: none;
    border: 1px solid #00ff41;
}

.setting-group input[type="range"]::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
    background: #00ff41;
    border-radius: 50%;
    cursor: pointer;
    -webkit-appearance: none;
}

.setting-group select {
    background: #001122;
    border: 2px solid #00ff41;
    color: #00ff41;
    padding: 8px;
    border-radius: 5px;
    font-family: 'Orbitron', monospace;
}

.setting-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #00ff41;
}

.setting-group span {
    color: #00ccff;
    font-size: 0.9rem;
}

.game-over {
    text-align: center;
    padding: 40px;
    background: rgba(20, 0, 0, 0.9);
    border: 3px solid #ff0000;
    border-radius: 15px;
    margin: 20px;
}

.game-over h2 {
    color: #ff0000;
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-shadow: 0 0 20px #ff0000;
}

#finalStats {
    color: #ffaa00;
    font-size: 1.2rem;
    margin-bottom: 25px;
    line-height: 1.6;
}

.game-over-controls {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.hidden {
    display: none !important;
}

/* Retro CRT effect */
@keyframes flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.98; }
}

.console {
    animation: flicker 0.15s infinite linear;
}

@media (max-width: 768px) {
    .console {
        margin: 10px;
        padding: 15px;
    }
    
    .console-header h1 {
        font-size: 1.8rem;
    }
    
    .settings-grid {
        flex-direction: column;
    }
    
    .settings-grid > * {
        flex: none;
        min-width: auto;
    }
    
    .game-info {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .score-panel, .multiplayer-scores {
        justify-content: center;
        font-size: 0.9rem;
    }
}
