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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #0a0a1a 0%, #1a1a3a 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.game-container {
    background: rgba(10, 10, 26, 0.95);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 1200px;
    width: 100%;
    position: relative;
}

.back-home-link {
    display: inline-block;
    margin-bottom: 15px;
    color: #4a9eff;
    text-decoration: none;
    padding: 8px 16px;
    background: rgba(74, 158, 255, 0.1);
    border-radius: 10px;
    font-size: 0.9em;
    transition: background 0.3s ease, transform 0.2s ease;
}

.back-home-link:hover {
    background: rgba(74, 158, 255, 0.2);
    transform: translateX(-3px);
}

.game-notice {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.15) 0%, rgba(103, 232, 249, 0.15) 100%);
    border: 2px solid rgba(20, 184, 166, 0.3);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(20, 184, 166, 0.1);
}

.notice-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notice-icon {
    font-size: 1.5rem;
}

.notice-text {
    flex: 1;
    color: #ffffff;
    font-size: 0.9rem;
    line-height: 1.4;
}

.header {
    text-align: center;
    margin-bottom: 15px;
}

.header h1 {
    font-size: 2rem;
    background: linear-gradient(135deg, #4a9eff 0%, #00d4ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.stats {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 10px;
}

.stat {
    background: rgba(74, 158, 255, 0.1);
    border: 1px solid rgba(74, 158, 255, 0.3);
    border-radius: 8px;
    padding: 8px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 100px;
    font-size: 0.9rem;
}

.stat .label {
    color: #b9f2ff;
    font-weight: 600;
}

.stat span:last-child {
    color: #fff;
    font-weight: bold;
}

.game-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.game-area {
    flex: 1;
    min-width: 0;
    display: flex;
    justify-content: center;
}

#gameCanvas {
    display: block;
    border: 3px solid rgba(74, 158, 255, 0.5);
    border-radius: 10px;
    background: #000011;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    max-width: 100%;
    height: auto;
}

.sidebar {
    width: 280px;
    flex-shrink: 0;
    background: rgba(74, 158, 255, 0.1);
    border: 2px solid rgba(74, 158, 255, 0.3);
    border-radius: 10px;
    padding: 15px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    position: sticky;
    top: 20px;
}

.sidebar-content {
    color: #b9f2ff;
    font-size: 0.9rem;
}

.sidebar-content h3 {
    margin-top: 0;
    font-size: 1.2rem;
    border-bottom: 2px solid rgba(74, 158, 255, 0.3);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.how-to-play-section {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(74, 158, 255, 0.2);
}

.how-to-play-section:last-child {
    border-bottom: none;
}

.how-to-play-section p {
    margin: 8px 0 5px 0;
    color: #b9f2ff;
    font-size: 0.95rem;
    font-weight: 600;
}

.how-to-play-section ul {
    margin: 5px 0;
    padding-left: 18px;
    font-size: 0.85rem;
    line-height: 1.4;
}

.how-to-play-section li {
    margin: 4px 0;
    color: #ffffff;
}

.controls {
    margin-top: 20px;
    text-align: center;
    width: 100%;
}

.control-info {
    margin-bottom: 15px;
    color: #b9f2ff;
}

.control-info p {
    margin: 5px 0;
    font-size: 0.9rem;
}

.button-group {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 30px;
    background: linear-gradient(135deg, #4a9eff 0%, #00d4ff 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 15px rgba(74, 158, 255, 0.4);
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 158, 255, 0.6);
}

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

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.overlay-content {
    background: rgba(10, 10, 26, 0.95);
    border: 3px solid rgba(74, 158, 255, 0.5);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.overlay-content h2 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #4a9eff 0%, #00d4ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
}

.overlay-content p {
    color: #b9f2ff;
    font-size: 1.2rem;
    margin: 10px 0;
}

.overlay-content span {
    color: #fff;
    font-weight: bold;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .game-container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .stats {
        gap: 8px;
    }
    
    .stat {
        padding: 6px 10px;
        font-size: 0.8rem;
        min-width: 80px;
    }
    
    .game-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        position: relative;
        top: 0;
        max-height: none;
        margin-top: 15px;
        order: -1;
    }
    
    .sidebar-content {
        font-size: 0.85rem;
    }
    
    .sidebar-content h3 {
        font-size: 1.1rem;
    }
    
    .how-to-play-section {
        margin-bottom: 12px;
        padding-bottom: 12px;
    }
    
    .how-to-play-section p {
        font-size: 0.9rem;
    }
    
    .how-to-play-section ul {
        font-size: 0.8rem;
    }
    
    #gameCanvas {
        width: 100%;
        height: auto;
    }
    
    .button-group {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
}

/* Splash Screen Styles */
.splash-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0a1a 0%, #1a1a3a 50%, #0a0a2a 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20000;
}

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

.splash-content {
    text-align: center;
    max-width: 600px;
    padding: 40px;
    background: rgba(10, 10, 26, 0.95);
    border: 3px solid rgba(74, 158, 255, 0.5);
    border-radius: 25px;
    box-shadow: 0 0 60px rgba(74, 158, 255, 0.4);
}

.splash-title h1 {
    font-size: 2.8rem;
    background: linear-gradient(135deg, #4a9eff 0%, #00d4ff 50%, #b9f2ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.splash-subtitle {
    font-size: 1.3rem;
    color: #00d4ff;
    margin-bottom: 20px;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.splash-character {
    font-size: 5rem;
    margin: 20px 0;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(5deg); }
}

.splash-description {
    color: #b9f2ff;
    font-size: 1rem;
    line-height: 1.7;
    margin: 20px 0;
}

.splash-description p {
    margin: 10px 0;
}

.splash-features {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 25px 0;
}

.splash-feature {
    background: rgba(74, 158, 255, 0.15);
    border: 2px solid rgba(74, 158, 255, 0.4);
    border-radius: 25px;
    padding: 10px 18px;
    color: #b9f2ff;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.splash-feature:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(74, 158, 255, 0.4);
    border-color: rgba(74, 158, 255, 0.7);
}

.splash-btn {
    margin-top: 25px;
    padding: 16px 45px;
    font-size: 1.2rem;
    background: linear-gradient(135deg, #4a9eff 0%, #00d4ff 100%);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 8px 30px rgba(74, 158, 255, 0.5);
}

.splash-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(74, 158, 255, 0.7);
}

/* Touch Controls */
.touch-controls {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
}

.touch-dpad {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.touch-middle-row {
    display: flex;
    gap: 5px;
}

.touch-btn {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: rgba(74, 158, 255, 0.8);
    border: 3px solid rgba(255, 255, 255, 0.5);
    color: white;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.1s ease;
}

.touch-btn:active, .touch-btn.active {
    transform: scale(0.9);
    background: rgba(74, 158, 255, 1);
}

.touch-fire {
    background: rgba(255, 100, 100, 0.9);
}

.touch-fire:active, .touch-fire.active {
    background: rgba(255, 100, 100, 1);
}

@media (max-width: 768px) {
    .touch-controls {
        display: block;
    }
    
    .splash-content {
        padding: 25px;
        margin: 20px;
        max-width: 90%;
    }

    .splash-title h1 {
        font-size: 2rem;
    }

    .splash-subtitle {
        font-size: 1rem;
    }

    .splash-character {
        font-size: 3.5rem;
    }

    .splash-feature {
        padding: 8px 14px;
        font-size: 0.8rem;
    }

    .splash-btn {
        padding: 14px 35px;
        font-size: 1rem;
    }
}
