        body {
            margin: 0;
            overflow: hidden;
            background: #222;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }

        canvas {
            display: block;
            background: #111424;
        }

        #gameCanvas {
            touch-action: none;
            /* Prevents default mobile swipe-to-scroll behaviors */
            user-select: none;
            -webkit-user-select: none;
        }

        /* --- Selection Screen Layout Overlay --- */
        #selectionScreen {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            background: rgba(10, 12, 22, 0.95);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 100;
        }

        .selection-container {
            background: #171b30;
            padding: 30px;
            border-radius: 12px;
            border: 2px solid #00d2d3;
            box-shadow: 0 0 20px rgba(0, 210, 211, 0.3);
            text-align: center;
            max-width: 600px;
            width: 90%;
            max-height: 85vh;
            display: flex;
            flex-direction: column;
        }

        .selection-container h2 {
            color: #fff;
            margin-top: 0;
            margin-bottom: 20px;
            letter-spacing: 2px;
            text-shadow: 0 0 10px rgba(0, 210, 211, 0.5);
        }

        /* --- Responsive Hangar Grid --- */
        .ship-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 10px;
            overflow-y: auto;
            padding: 10px;
            margin-bottom: 25px;
            background: #0f1222;
            border-radius: 8px;
            border: 1px solid #232946;
            max-height: 45vh;
        }

        /* Custom scrollbar behavior for hangar */
        #shipGrid::-webkit-scrollbar {
            width: 6px;
        }

        #shipGrid::-webkit-scrollbar-thumb {
            background: #00d2d3;
            border-radius: 3px;
        }

        .ship-item {
            background: #1d233d;
            border: 2px solid transparent;
            border-radius: 6px;
            padding: 10px;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 60px;
        }

        .ship-item:hover {
            background: #283057;
            border-color: #54a0ff;
        }

        .ship-item.selected {
            background: #112a47;
            border-color: #00d2d3;
            box-shadow: 0 0 10px rgba(0, 210, 211, 0.4);
        }

        .ship-item img {
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
        }

        /* --- Control Buttons --- */
        #startButton {
            background: #00d2d3;
            color: #0f1222;
            border: none;
            padding: 12px 35px;
            font-size: 16px;
            font-weight: bold;
            letter-spacing: 1px;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.2s ease;
            align-self: center;
        }

        #startButton:hover:not(:disabled) {
            background: #00b3b3;
            box-shadow: 0 0 15px rgba(0, 210, 211, 0.6);
            transform: scale(1.05);
        }

        #startButton:disabled {
            background: #444;
            color: #888;
            cursor: not-allowed;
        }

        /* ==========================================================================
   SPECIFIC 480PX MOBILE MEDIA QUERY (Screens 480px and narrower)
   ========================================================================== */
        @media screen and (max-width: 480px) {
            .selection-container {
                padding: 15px;
                /* Shaves off extra container padding to maximize room */
                width: 95%;
                /* Uses more of the screen width */
            }

            .selection-container h2 {
                font-size: 1.2rem;
                /* Scales down title slightly */
                margin-bottom: 12px;
            }

            #shipGrid {
                grid-template-columns: repeat(3, 1fr);
                /* Holds clean, comfortable 3 columns */
                gap: 8px;
                /* Tighter spacing */
                padding: 6px;
                margin-bottom: 15px;
                max-height: 40vh;
                /* Adjusts height safely so start button never runs away */
            }

            .ship-item {
                height: 50px;
                /* Makes grid cells slightly more shallow to fit more on screen */
                padding: 6px;
            }

            #startButton {
                padding: 10px 25px;
                /* Compact padding for easy thumb tapping */
                font-size: 14px;
            }
        }

        /* ==========================================================================
   TABLET RESPONSIVE MEDIA QUERY (Screens wider than 600px)
   ========================================================================== */
        @media screen and (min-width: 601px) {
            #shipGrid {
                grid-template-columns: repeat(4, 1fr);
                /* Expands out into 4 clean grid columns */
                gap: 15px;
                max-height: 55vh;
            }

            .ship-item {
                height: 70px;
            }
        }

        /* ==========================================================================
   DESKTOP RESPONSIVE MEDIA QUERY (Screens wider than 1025px)
   ========================================================================== */
        @media screen and (min-width: 1025px) {
            #shipGrid {
                max-height: none;
                /* No scaling limits required on giant display setups */
                gap: 20px;
            }
        }