        :root {
            --bg-color: #120e2e;
            --accent-yellow: #ffee55;
            --accent-pink: #ff77aa;
            --accent-blue: #55ccff;
            --accent-green: #66ff88;
            --glass-bg: rgba(255, 255, 255, 0.12);
            --glass-border: rgba(255, 255, 255, 0.2);
            --card-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
        }

        * {
            box-sizing: border-box;
            user-select: none;
            -webkit-user-select: none;
            margin: 0;
            padding: 0;
            font-family: 'Quicksand', 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
            font-weight: 700;
        }

        body {
            background-color: var(--bg-color);
            background-image: radial-gradient(circle at 50% 50%, #201a4e 0%, #0d0a22 100%);
            color: #fff;
            overflow: hidden;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            width: 100vw;
            touch-action: none;
        }

        /* Responsive frame mock for desktop, fullscreen for mobile */
        #app-container {
            position: relative;
            width: 100%;
            height: 100%;
            max-width: 450px;
            max-height: 850px;
            aspect-ratio: 9/16;
            background: #000;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            border-radius: 24px;
            box-shadow: 0 0 40px rgba(255, 119, 170, 0.25), 0 0 80px rgba(85, 204, 255, 0.15);
            border: 4px solid var(--glass-border);
        }

        @media (max-width: 500px) or (max-height: 550px) {
            #app-container {
                max-width: 100vw;
                max-height: 100vh;
                border-radius: 0;
                border: none;
                aspect-ratio: auto;
            }
        }

        #game-canvas {
            display: block;
            width: 100%;
            height: 100%;
            background: linear-gradient(to bottom, #87ceeb, #e0f6ff);
            z-index: 1;
            touch-action: none;
        }

        /* Glassmorphism UI Layout */
        .screen-overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 10;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            padding: 24px;
            background: rgba(18, 14, 46, 0.7);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            transition: opacity 0.4s ease, visibility 0.4s ease;
            opacity: 0;
            visibility: hidden;
        }

        .screen-overlay.active {
            opacity: 1;
            visibility: visible;
        }

        /* HUD top layout overlay during gameplay */
        #game-hud {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            z-index: 5;
            padding: 12px 16px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            pointer-events: none;
            background: linear-gradient(to bottom, rgba(18,14,46,0.6) 0%, rgba(18,14,46,0) 100%);
        }

        .hud-item {
            font-size: 16px;
            color: #fff;
            text-shadow: 2px 2px 0px #000, -1px -1px 0px #000, 1px -1px 0px #000, -1px 1px 0px #000;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .hud-score {
            font-size: 20px;
            color: var(--accent-yellow);
        }

        .hud-shield {
            font-size: 14px;
            color: var(--accent-pink);
            background: rgba(0,0,0,0.4);
            padding: 2px 8px;
            border-radius: 12px;
            border: 1px solid rgba(255,119,170,0.5);
            display: none;
        }

        .hud-shield.active {
            display: inline-block;
        }

        #boss-health-container {
            position: absolute;
            top: 50px;
            left: 5%;
            width: 90%;
            height: 14px;
            background: rgba(0,0,0,0.5);
            border-radius: 7px;
            border: 2px solid #fff;
            overflow: hidden;
            display: none;
            z-index: 5;
            box-shadow: 0 0 10px rgba(0,0,0,0.5);
        }

        #boss-health-bar {
            width: 100%;
            height: 100%;
            background: linear-gradient(to right, var(--accent-pink), #ff4466);
            transition: width 0.1s ease;
        }

        /* Menu Design */
        .pop-card {
            background: var(--glass-bg);
            border: 2px solid var(--glass-border);
            border-radius: 20px;
            padding: 24px;
            width: 100%;
            text-align: center;
            box-shadow: var(--card-shadow);
            transform: scale(0.9);
            transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            max-height: 90%;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
        }

        .screen-overlay.active .pop-card {
            transform: scale(1);
        }

        .logo-container {
            margin-bottom: 20px;
            animation: bounceLogo 2.5s infinite ease-in-out;
        }

        .logo-text {
            font-size: 40px;
            font-weight: 900;
            background: linear-gradient(45deg, var(--accent-yellow), var(--accent-pink), var(--accent-blue));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            filter: drop-shadow(3px 3px 0px rgba(0, 0, 0, 0.8));
            letter-spacing: 2px;
        }

        .subtitle {
            font-size: 14px;
            color: #d1ccff;
            margin-top: 5px;
            text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
        }

        .scrollable-content {
            overflow-y: auto;
            flex-grow: 1;
            margin: 15px 0;
            padding-right: 4px;
        }

        /* Scrollbar custom style */
        .scrollable-content::-webkit-scrollbar {
            width: 6px;
        }
        .scrollable-content::-webkit-scrollbar-track {
            background: rgba(255,255,255,0.05);
            border-radius: 3px;
        }
        .scrollable-content::-webkit-scrollbar-thumb {
            background: rgba(255,255,255,0.2);
            border-radius: 3px;
        }

        /* Stage Grid Buttons */
        .stage-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 10px;
            margin-bottom: 20px;
        }

        .btn-stage {
            aspect-ratio: 1;
            background: rgba(255, 255, 255, 0.08);
            border: 2px solid rgba(255, 255, 255, 0.15);
            border-radius: 12px;
            color: #fff;
            font-size: 16px;
            cursor: pointer;
            display: flex;
            justify-content: center;
            align-items: center;
            transition: all 0.2s ease;
        }

        .btn-stage:hover, .btn-stage:focus {
            background: var(--accent-blue);
            border-color: #fff;
            color: #000;
            transform: scale(1.1);
        }

        .btn-stage.unlocked {
            background: rgba(255, 119, 170, 0.15);
            border-color: var(--accent-pink);
        }

        .btn-stage.cleared {
            background: rgba(102, 255, 136, 0.2);
            border-color: var(--accent-green);
            color: var(--accent-green);
        }

        /* General Bubbly Buttons */
        .btn-bubbly {
            display: inline-block;
            background: linear-gradient(135deg, var(--accent-pink) 0%, #ff4488 100%);
            border: none;
            border-bottom: 4px solid #b32255;
            border-radius: 30px;
            color: #fff;
            padding: 12px 32px;
            font-size: 18px;
            cursor: pointer;
            box-shadow: 0 6px 20px rgba(255, 68, 136, 0.4);
            transition: all 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            width: 100%;
            outline: none;
            text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
        }

        .btn-bubbly:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 24px rgba(255, 68, 136, 0.6);
        }

        .btn-bubbly:active {
            transform: translateY(2px);
            border-bottom-width: 0px;
            margin-top: 4px;
        }

        .btn-secondary {
            background: linear-gradient(135deg, var(--accent-blue) 0%, #2288ff 100%);
            border-bottom-color: #1155cc;
            box-shadow: 0 6px 20px rgba(34, 136, 255, 0.4);
            margin-top: 10px;
        }

        .btn-secondary:hover {
            box-shadow: 0 8px 24px rgba(34, 136, 255, 0.6);
        }

        /* Sound Toggle Control */
        .sound-toggle-btn {
            background: rgba(0, 0, 0, 0.4);
            border: 2px solid var(--glass-border);
            border-radius: 50%;
            width: 44px;
            height: 44px;
            display: flex;
            justify-content: center;
            align-items: center;
            cursor: pointer;
            transition: all 0.2s ease;
            pointer-events: auto;
        }

        .sound-toggle-btn:hover {
            background: rgba(255, 255, 255, 0.15);
            transform: scale(1.1);
        }

        /* Settings grid for title menu */
        .settings-bar {
            display: flex;
            justify-content: space-around;
            align-items: center;
            margin-top: 10px;
            background: rgba(0,0,0,0.2);
            padding: 8px;
            border-radius: 12px;
        }

        /* Tutorial Guide UI */
        .guide-box {
            background: rgba(0,0,0,0.3);
            border-radius: 16px;
            padding: 12px;
            font-size: 13px;
            line-height: 1.5;
            color: #eceaff;
            border: 1px solid rgba(255,255,255,0.08);
            margin-bottom: 12px;
            text-align: left;
        }

        .guide-box p {
            margin-bottom: 6px;
        }
        .guide-box p:last-child {
            margin-bottom: 0;
        }

        .guide-badge {
            display: inline-block;
            padding: 1px 6px;
            border-radius: 6px;
            font-size: 11px;
            margin-right: 5px;
            color: #000;
        }

        .badge-yellow { background: var(--accent-yellow); }
        .badge-blue { background: var(--accent-blue); }
        .badge-white { background: #fff; }
        .badge-pink { background: var(--accent-pink); color: #fff; }

        /* Animation */
        @keyframes bounceLogo {
            0%, 100% { transform: translateY(0) rotate(-1deg); }
            50% { transform: translateY(-10px) rotate(1deg); }
        }

        .gameover-title {
            font-size: 36px;
            color: var(--accent-pink);
            text-shadow: 2px 2px 0px #000;
            margin-bottom: 10px;
        }

        .victory-title {
            font-size: 36px;
            color: var(--accent-green);
            text-shadow: 2px 2px 0px #000;
            margin-bottom: 10px;
        }

        .score-display {
            font-size: 28px;
            color: var(--accent-yellow);
            margin: 15px 0;
            text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
        }

        /* Mobile Swipe Indicator Overlay */
        #mobile-swipe-guide {
            position: absolute;
            bottom: 60px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(0,0,0,0.6);
            padding: 6px 16px;
            border-radius: 20px;
            font-size: 12px;
            color: #fff;
            pointer-events: none;
            opacity: 0.8;
            animation: pulseGuide 2s infinite;
            z-index: 4;
            display: none;
            border: 1px solid rgba(255,255,255,0.1);
        }

        @keyframes pulseGuide {
            0%, 100% { opacity: 0.3; transform: translate(-50%, 0); }
            50% { opacity: 0.9; transform: translate(-50%, -5px); }
        }

        /* Virtual Shoot Button Style */
        #virtual-shoot-btn {
            position: absolute;
            bottom: 30px;
            right: 30px;
            width: 76px;
            height: 76px;
            border-radius: 50%;
            background: radial-gradient(circle, var(--accent-pink) 0%, #ff4488 100%);
            border: 3px solid #fff;
            color: #fff;
            font-size: 15px;
            font-weight: 700;
            display: none;
            justify-content: center;
            align-items: center;
            z-index: 6;
            box-shadow: 0 6px 15px rgba(255, 68, 136, 0.4);
            touch-action: none;
            outline: none;
            text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
        }
        #virtual-shoot-btn:active {
            transform: scale(0.95);
            background: radial-gradient(circle, #ff4488 0%, #cc2255 100%);
        }

        #virtual-bomb-btn {
            position: absolute;
            bottom: 30px;
            right: 120px;
            width: 76px;
            height: 76px;
            border-radius: 50%;
            background: radial-gradient(circle, #888888 0%, #333333 100%);
            border: 3px solid #fff;
            color: #fff;
            font-size: 15px;
            font-weight: 700;
            display: none;
            justify-content: center;
            align-items: center;
            z-index: 6;
            box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
            touch-action: none;
            outline: none;
            text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
        }
        #virtual-bomb-btn:active {
            transform: scale(0.95);
            background: radial-gradient(circle, #555555 0%, #111111 100%);
        }

        /* Achievement Toast Popup */
        #achievement-toast {
            position: absolute;
            top: -90px;
            left: 50%;
            transform: translateX(-50%);
            width: 90%;
            max-width: 380px;
            background: rgba(20, 15, 45, 0.94);
            border: 2px solid var(--accent-yellow);
            border-radius: 16px;
            padding: 10px 14px;
            display: flex;
            align-items: center;
            gap: 12px;
            box-shadow: 0 8px 25px rgba(255, 238, 85, 0.4);
            z-index: 100;
            transition: top 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
        }
        #achievement-toast.show {
            top: 15px;
        }
        .toast-icon {
            font-size: 28px;
        }
        .toast-title {
            font-size: 13px;
            color: var(--accent-yellow);
            font-weight: 700;
        }
        .toast-desc {
            font-size: 11px;
            color: #fff;
        }

        /* Mode Selection & Sub Buttons */
        .btn-mode-container {
            display: flex;
            justify-content: center;
            gap: 8px;
            margin: 8px 0;
        }
        .btn-mode {
            padding: 6px 14px;
            font-size: 12px;
            border-radius: 12px;
            opacity: 0.65;
            transition: all 0.2s ease;
        }
        .btn-mode.active-mode {
            opacity: 1;
            transform: scale(1.04);
            box-shadow: 0 4px 15px rgba(255, 238, 85, 0.4);
            border-color: #fff;
        }

        /* Badges Grid */
        .badge-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 8px;
            margin-top: 10px;
            max-height: 320px;
            overflow-y: auto;
            padding-right: 4px;
        }
        .badge-card {
            background: rgba(255, 255, 255, 0.08);
            border: 2px solid var(--glass-border);
            border-radius: 14px;
            padding: 10px;
            display: flex;
            align-items: center;
            gap: 10px;
            text-align: left;
            transition: transform 0.2s ease;
        }
        .badge-card.unlocked {
            border-color: var(--accent-yellow);
            background: rgba(255, 238, 85, 0.15);
            box-shadow: 0 4px 15px rgba(255, 238, 85, 0.25);
        }
        .badge-card.locked {
            opacity: 0.45;
            filter: grayscale(80%);
        }
        .badge-card .badge-icon {
            font-size: 26px;
        }
        .badge-card .badge-info {
            display: flex;
            flex-direction: column;
        }
        .badge-card .badge-name {
            font-size: 12px;
            color: var(--accent-yellow);
            font-weight: 700;
        }
        .badge-card .badge-desc {
            font-size: 10px;
            color: #ddd;
            margin-top: 2px;
            line-height: 1.2;
        }

        /* Leaderboard Table */
        .leaderboard-table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 8px;
            font-size: 12px;
        }
        .leaderboard-table th {
            color: var(--accent-blue);
            padding: 6px 4px;
            border-bottom: 1px solid var(--glass-border);
            text-align: center;
        }
        .leaderboard-table td {
            padding: 8px 4px;
            border-bottom: 1px solid rgba(255,255,255,0.06);
            text-align: center;
        }
        .rank-1 { color: #ffd700; font-weight: bold; }
        .rank-2 { color: #e0e0e0; font-weight: bold; }
        .rank-3 { color: #cd7f32; font-weight: bold; }
