@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700;900&display=swap');

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

body {
    background-color: #050814;
    font-family: 'Orbitron', sans-serif;
    color: #ffffff;
    overflow: hidden;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-container {
    width: 1024px;
    height: 576px;
    position: relative;
    background: radial-gradient(circle at center, #0c1b33 0%, #03060f 100%);
    box-shadow: 0 0 40px rgba(0, 255, 255, 0.2);
    border: 4px solid #00ffff;
    border-radius: 12px;
    overflow: hidden;
}

/* Background Animated Grid */
.bg-grid {
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background-image: 
        linear-gradient(rgba(0, 255, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: gridScroll 20s linear infinite;
    z-index: 0;
    pointer-events: none;
}

@keyframes gridScroll {
    0% { transform: translate(0, 0); }
    100% { transform: translate(40px, 40px); }
}

/* Menu Screens */
.menu-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
    padding: 30px;
}

.menu-screen.active {
    display: flex;
}

/* Main Menu */
.game-title {
    font-size: 5.5rem;
    font-weight: 900;
    color: #00ffff;
    text-shadow: 0 0 20px rgba(0, 255, 255, 0.8), 4px 4px 0px #003366;
    letter-spacing: 4px;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 1.1rem;
    color: #aaccff;
    letter-spacing: 6px;
    margin-bottom: 40px;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 320px;
}

/* GD Buttons */
.gd-btn {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    padding: 14px 28px;
    border: 3px solid #ffffff;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 6px 0 rgba(0,0,0,0.6), inset 0 2px 4px rgba(255,255,255,0.4);
    transition: transform 0.1s ease, filter 0.1s ease;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.5);
    letter-spacing: 2px;
}

.gd-btn:hover {
    filter: brightness(1.15);
    transform: translateY(-2px);
    box-shadow: 0 8px 0 rgba(0,0,0,0.6), inset 0 2px 6px rgba(255,255,255,0.6);
}

.gd-btn:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 rgba(0,0,0,0.6), inset 0 1px 2px rgba(0,0,0,0.4);
}

.gd-btn.green { background: linear-gradient(180deg, #00ff88 0%, #00aa44 100%); color: #fff; }
.gd-btn.blue { background: linear-gradient(180deg, #00bbff 0%, #0055cc 100%); color: #fff; }
.gd-btn.orange { background: linear-gradient(180deg, #ffaa00 0%, #cc5500 100%); color: #fff; }
.gd-btn.purple { background: linear-gradient(180deg, #cc00ff 0%, #6600cc 100%); color: #fff; }
.gd-btn.red { background: linear-gradient(180deg, #ff3333 0%, #aa0000 100%); color: #fff; }

.footer-info {
    position: absolute;
    bottom: 15px;
    font-size: 0.85rem;
    color: #6688aa;
}

/* Level Select Carousel */
h2 {
    font-size: 2.5rem;
    margin-bottom: 25px;
    color: #00ffff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.level-carousel {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    overflow-x: auto;
    max-width: 900px;
    padding: 10px;
}

.level-card {
    background: rgba(10, 25, 50, 0.9);
    border: 3px solid #00ffff;
    border-radius: 12px;
    padding: 25px;
    width: 210px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(0, 255, 255, 0.2);
}

.level-card:hover {
    transform: scale(1.05);
    border-color: #00ff88;
    box-shadow: 0 6px 25px rgba(0, 255, 136, 0.4);
}

.level-card h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: #ffffff;
}

.level-card p {
    font-size: 0.9rem;
    color: #aaccff;
    margin-bottom: 15px;
}

.stars-reward {
    font-size: 0.9rem;
    color: #ffcc00;
}

/* Icon Kit Garage */
.garage-container {
    display: flex;
    gap: 40px;
    background: rgba(5, 15, 30, 0.8);
    border: 2px solid #00ffff;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 25px;
    align-items: center;
}

.preview-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

#icon-preview {
    background: #02040a;
    border: 3px solid #00ffff;
    border-radius: 10px;
}

#player-name-input {
    background: #001122;
    border: 2px solid #00ffff;
    color: #fff;
    padding: 8px 12px;
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    border-radius: 6px;
    text-align: center;
    width: 150px;
}

.customizer-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.option-group label {
    font-size: 0.9rem;
    color: #aaccff;
    display: block;
    margin-bottom: 8px;
}

.color-picker-grid {
    display: flex;
    gap: 10px;
}

.color-swatch {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: transform 0.2s;
}

.color-swatch:hover {
    transform: scale(1.1);
}

.color-swatch.active {
    border-color: #ffffff;
    box-shadow: 0 0 10px #ffffff;
}

/* Online Levels */
.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    width: 600px;
}

#level-search {
    flex: 1;
    background: #001122;
    border: 2px solid #00ffff;
    border-radius: 8px;
    padding: 10px 15px;
    color: #fff;
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
}

.online-list {
    width: 700px;
    max-height: 280px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
    padding-right: 5px;
}

.online-card {
    background: rgba(10, 25, 50, 0.85);
    border: 2px solid #0055cc;
    border-radius: 8px;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.online-info h4 {
    font-size: 1.1rem;
    color: #00ffff;
    margin-bottom: 5px;
}

.online-info p {
    font-size: 0.85rem;
    color: #aaccff;
}

/* Gameplay Screen & HUD */
#game-screen {
    padding: 0;
}

#hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 15px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 5;
    pointer-events: none;
}

#level-title-hud {
    font-size: 1.3rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
    margin-bottom: 8px;
    letter-spacing: 2px;
}

#progress-bar-container {
    width: 400px;
    height: 14px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid #00ffff;
    border-radius: 7px;
    position: relative;
    overflow: hidden;
}

#progress-bar-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #00ff88, #00ffff);
    transition: width 0.1s linear;
}

#progress-percentage {
    position: absolute;
    width: 100%;
    top: 0;
    left: 0;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    line-height: 10px;
    color: #ffffff;
    text-shadow: 1px 1px 1px #000;
}

#attempts-counter {
    position: absolute;
    top: 20px;
    left: 30px;
    font-size: 0.9rem;
    color: #aaccff;
}

#gameCanvas {
    display: block;
    background: linear-gradient(180deg, #020c1b 0%, #051b3a 100%);
}

#game-controls-overlay {
    position: absolute;
    top: 15px;
    right: 25px;
    display: flex;
    gap: 10px;
    z-index: 5;
}

#game-controls-overlay .gd-btn {
    padding: 8px 14px;
    font-size: 1rem;
}

/* Modals */
.modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 5, 12, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: rgba(10, 25, 50, 0.95);
    border: 3px solid #00ffff;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.4);
    min-width: 380px;
}

.modal-content h2 {
    margin-bottom: 5px;
}

.modal-content p {
    color: #aaccff;
    font-size: 1rem;
    margin-bottom: 10px;
}

.complete-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}
