        * {
            box-sizing: border-box;
            -webkit-tap-highlight-color: transparent;
        }
        body {
            background-color: #000;
            color: #0f0;
            margin: 0;
            overflow: hidden;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            height: 100dvh; /* Dynamic viewport height for mobile */
            font-family: 'Courier New', Courier, monospace;
            touch-action: none;
            -webkit-touch-callout: none;
            -webkit-user-select: none;
            user-select: none;
            /* Safe area handling for iOS notch */
            padding-top: env(safe-area-inset-top);
            padding-bottom: env(safe-area-inset-bottom);
            padding-left: env(safe-area-inset-left);
            padding-right: env(safe-area-inset-right);
        }
        #game-container {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            display: flex;
            justify-content: center;
            align-items: center;
            background: #000;
            touch-action: none;
        }
        canvas {
            border: 2px solid #0f0;
            background-color: #000;
            image-rendering: pixelated;
            image-rendering: crisp-edges;
            max-width: 100%;
            max-height: 100%;
            touch-action: none;
        }
        #menu-btn {
            position: absolute;
            top: 10px;
            left: 10px;
            font-size: 30px;
            color: #0f0;
            cursor: pointer;
            z-index: 100;
            user-select: none;
            padding: 10px;
            min-width: 44px;
            min-height: 44px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .audio-btn {
            position: absolute;
            right: 10px;
            font-family: 'Courier New', monospace;
            font-size: 16px;
            color: #0f0;
            cursor: pointer;
            user-select: none;
            border: 2px solid #0f0;
            padding: 8px 12px;
            background: #000;
            min-width: 100px;
            min-height: 44px;
            text-align: center;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        #sound-btn { top: 10px; }
        #music-btn { top: 60px; }
        .audio-btn:hover, .audio-btn:active { background: #0f0; color: #000; }
        #menu-overlay {
            display: none;
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.95);
            z-index: 99;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            text-align: center;
            overflow-y: auto;
            padding: 20px;
        }
        #intro-overlay {
            display: none;
            position: absolute;
            top: 0; left: 0; width: 100%; height: 100%;
            background: #000;
            z-index: 200;
            overflow: hidden;
            perspective: 400px;
        }
        #landing-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: #000;
            z-index: 260;
            justify-content: center;
            align-items: center;
            text-align: center;
            padding: 24px;
        }
        .landing-content {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 22px;
            width: 100%;
            max-width: 560px;
        }
        .landing-logo {
            width: min(460px, 74vw);
            height: auto;
            max-width: 100%;
            filter:
                drop-shadow(0 0 10px rgba(0, 255, 85, 0.35))
                drop-shadow(0 0 22px rgba(0, 255, 85, 0.2));
        }
        .landing-welcome {
            min-height: 24px;
            color: #00ff55;
            font-size: clamp(14px, 2.3vw, 20px);
            letter-spacing: 0.5px;
        }
        .landing-cta {
            background: #000;
            color: #00ff55;
            border: 2px solid #00ff55;
            font-family: 'Courier New', monospace;
            font-size: clamp(18px, 2.8vw, 24px);
            font-weight: bold;
            letter-spacing: 1px;
            padding: 14px 38px;
            min-width: 220px;
            min-height: 54px;
            cursor: pointer;
        }
        .landing-cta:hover, .landing-cta:active {
            background: #00ff55;
            color: #000;
        }
        /* Tutorial Overlay Styles */
        #tutorial-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.9);
            z-index: 150;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            font-family: 'Courier New', monospace;
            color: #0f0;
            text-align: center;
            padding: 20px;
        }
        .tutorial-content {
            display: flex;
            flex-direction: row;
            justify-content: space-around;
            align-items: center;
            width: 100%;
            max-width: 600px;
            margin-bottom: 30px;
        }
        .tutorial-zone {
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 20px;
        }
        .tutorial-icon {
            font-size: 48px;
            margin-bottom: 10px;
        }
        .tutorial-label {
            font-size: clamp(18px, 4vw, 24px);
            font-weight: bold;
            margin-bottom: 5px;
        }
        .tutorial-hint {
            font-size: clamp(12px, 3vw, 16px);
            color: #0a0;
        }
        .tutorial-goal {
            font-size: clamp(14px, 3.5vw, 18px);
            color: #ff0;
            margin-bottom: 30px;
            max-width: 80%;
        }
        .tutorial-start-btn {
            font-size: clamp(16px, 4vw, 22px);
            color: #0f0;
            border: 2px solid #0f0;
            padding: 15px 40px;
            cursor: pointer;
            animation: pulse-glow 1.5s ease-in-out infinite;
        }
        .tutorial-start-btn:active {
            background: #0f0;
            color: #000;
        }
        @keyframes pulse-glow {
            0%, 100% { box-shadow: 0 0 5px #0f0; }
            50% { box-shadow: 0 0 20px #0f0, 0 0 30px #0f0; }
        }
        .tutorial-skip {
            position: absolute;
            bottom: 20px;
            right: 20px;
            font-size: 14px;
            color: #666;
        }
        /* Tutorial Title */
        .tutorial-title {
            font-size: clamp(20px, 5vw, 28px);
            color: #0f0;
            margin-bottom: 20px;
            text-shadow: 0 0 10px #0f0;
        }
        /* Tutorial Info Section */
        .tutorial-info {
            display: flex;
            flex-direction: column;
            gap: 10px;
            margin: 20px 0;
            padding: 15px;
            border: 1px solid #0f0;
            max-width: 400px;
            text-align: left;
        }
        .tutorial-info-item {
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: clamp(12px, 3vw, 16px);
        }
        .info-icon {
            font-size: 20px;
            min-width: 30px;
            text-align: center;
        }
        .info-text {
            color: #0f0;
        }
        /* Help Button */
        #help-btn {
            position: absolute;
            top: 10px;
            left: 60px;
            font-size: 24px;
            color: #0f0;
            cursor: pointer;
            z-index: 100;
            user-select: none;
            padding: 10px;
            min-width: 44px;
            min-height: 44px;
            display: flex;
            align-items: center;
            justify-content: center;
            border: 2px solid #0f0;
            font-family: 'Courier New', monospace;
            font-weight: bold;
        }
        #help-btn:hover, #help-btn:active {
            background: #0f0;
            color: #000;
        }
        /* Help Modal */
        #help-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.9);
            z-index: 150;
            justify-content: center;
            align-items: center;
        }
        .help-modal {
            background: #000;
            border: 2px solid #0f0;
            max-width: 500px;
            width: 90%;
            max-height: 80vh;
            overflow-y: auto;
            font-family: 'Courier New', monospace;
            color: #0f0;
        }
        .help-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 15px 20px;
            border-bottom: 1px solid #0f0;
        }
        .help-header h2 {
            margin: 0;
            font-size: 20px;
        }
        .help-close {
            font-size: 28px;
            cursor: pointer;
            padding: 5px 10px;
            min-width: 44px;
            min-height: 44px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .help-close:hover {
            color: #fff;
        }
        .help-content {
            padding: 20px;
        }
        .help-section {
            margin-bottom: 20px;
        }
        .help-section h3 {
            color: #ff0;
            font-size: 14px;
            margin-bottom: 10px;
            border-bottom: 1px solid #333;
            padding-bottom: 5px;
        }
        .help-section ul {
            list-style: none;
            padding: 0;
            margin: 0;
        }
        .help-section li {
            margin: 5px 0;
            font-size: 14px;
        }
        .help-section p {
            margin: 5px 0;
            font-size: 14px;
        }
        .help-footer {
            padding: 15px 20px;
            border-top: 1px solid #0f0;
            text-align: center;
        }
        .help-dismiss-btn {
            background: #000;
            color: #0f0;
            border: 2px solid #0f0;
            padding: 10px 30px;
            font-family: 'Courier New', monospace;
            font-size: 16px;
            cursor: pointer;
            min-height: 44px;
        }
        .help-dismiss-btn:hover, .help-dismiss-btn:active {
            background: #0f0;
            color: #000;
        }
        #name-onboarding-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.92);
            z-index: 160;
            justify-content: center;
            align-items: center;
            padding: 20px;
        }
        .name-modal {
            background: #000;
            border: 2px solid #0f0;
            width: min(520px, 92vw);
            padding: 24px;
            color: #0f0;
            font-family: 'Courier New', monospace;
            text-align: center;
        }
        .name-title {
            font-size: clamp(16px, 3vw, 24px);
            margin-bottom: 18px;
            line-height: 1.4;
        }
        #player-name-input {
            width: 100%;
            background: #000;
            border: 2px solid #0f0;
            color: #0f0;
            font-family: 'Courier New', monospace;
            font-size: 18px;
            padding: 10px 12px;
            text-align: center;
            outline: none;
        }
        #player-name-input:focus {
            box-shadow: 0 0 8px #0f0;
        }
        .name-error {
            min-height: 22px;
            margin-top: 8px;
            color: #ff0;
            font-size: 14px;
        }
        .name-start-btn {
            margin-top: 10px;
            background: #000;
            border: 2px solid #0f0;
            color: #0f0;
            font-family: 'Courier New', monospace;
            font-size: 18px;
            padding: 10px 26px;
            cursor: pointer;
            min-height: 44px;
            min-width: 120px;
        }
        .name-start-btn:hover, .name-start-btn:active {
            background: #0f0;
            color: #000;
        }
        .crawl-container {
            position: absolute;
            top: 0; left: 0; width: 100%; height: 100%;
            transform-origin: 50% 100%;
            transform: rotateX(25deg);
        }
        .crawl-text {
            position: absolute;
            top: 100%; left: 5%; width: 90%;
            color: #0f0;
            font-family: 'Courier New', monospace;
            font-size: clamp(18px, 5vw, 40px);
            text-align: center;
            font-weight: bold;
            animation: crawl 20s linear forwards;
        }
        @keyframes crawl {
            0% { top: 100%; opacity: 1; }
            90% { top: -150%; opacity: 1; }
            100% { top: -150%; opacity: 0; }
        }
        #skip-btn {
            position: absolute;
            bottom: 20px; right: 20px;
            color: #666;
            cursor: pointer;
            z-index: 201;
            font-family: monospace;
            font-size: 18px;
            padding: 15px 20px;
            min-width: 80px;
            min-height: 44px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        #skip-btn:hover, #skip-btn:active { color: #fff; }
        .menu-item {
            font-size: clamp(18px, 4vw, 24px);
            margin: 10px;
            cursor: pointer;
            color: #0f0;
            text-decoration: underline;
            padding: 15px 30px;
            min-width: 200px;
            min-height: 44px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .menu-item:hover, .menu-item:active {
            color: #fff;
            background: rgba(0, 255, 0, 0.1);
        }
        #content-area {
            max-width: 800px;
            width: 90%;
            text-align: left;
            white-space: pre-wrap;
            overflow-y: auto;
            max-height: 60vh;
            padding: 20px;
            border: 1px solid #0f0;
            margin-top: 20px;
            display: none;
            font-size: clamp(12px, 3vw, 16px);
        }
        .devlog-list {
            display: flex;
            flex-direction: column;
            gap: 16px;
        }
        .devlog-entry {
            border: 1px solid #0a0;
            padding: 14px 16px;
            background: rgba(0, 255, 0, 0.04);
        }
        .devlog-meta {
            color: #ff0;
            font-size: 13px;
            margin-bottom: 6px;
            letter-spacing: 0.4px;
        }
        .devlog-entry h3 {
            margin: 0 0 8px;
            font-size: clamp(16px, 3vw, 22px);
            color: #0f0;
        }
        .devlog-entry p {
            margin: 0 0 10px;
            color: #9f9;
            line-height: 1.45;
        }
        .devlog-entry ul {
            margin: 0;
            padding-left: 18px;
            white-space: normal;
        }
        .devlog-entry li {
            margin: 0 0 6px;
            line-height: 1.45;
        }
        #leaderboard-panel {
            width: 90%;
            max-width: 520px;
            border: 1px solid #0f0;
            margin-top: 16px;
            padding: 12px;
            text-align: left;
        }
        .leaderboard-panel-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 10px;
            margin-bottom: 8px;
        }
        .leaderboard-panel-title {
            color: #ff0;
            font-size: 14px;
            font-weight: bold;
        }
        .leaderboard-refresh-btn {
            background: #000;
            border: 1px solid #0f0;
            color: #0f0;
            font-family: 'Courier New', monospace;
            font-size: 12px;
            padding: 5px 10px;
            cursor: pointer;
        }
        .leaderboard-refresh-btn:hover, .leaderboard-refresh-btn:active {
            background: #0f0;
            color: #000;
        }
        .leaderboard-status {
            color: #0a0;
            font-size: 12px;
            margin-bottom: 8px;
            min-height: 16px;
        }
        .leaderboard-list {
            border-top: 1px solid #0a0;
            padding-top: 8px;
            max-height: 210px;
            overflow-y: auto;
        }
        .leaderboard-row {
            display: grid;
            grid-template-columns: 26px 1fr 52px 64px;
            gap: 8px;
            font-size: 13px;
            line-height: 1.5;
            color: #0f0;
        }
        .leaderboard-row-name {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .leaderboard-empty {
            font-size: 13px;
            color: #ff0;
        }
        /* Rotation overlay for portrait mode */
        #rotation-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: #000;
            color: #0f0;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            z-index: 1000;
            font-family: monospace;
            text-align: center;
            padding: 20px;
        }
        .rotate-icon {
            font-size: 64px;
            animation: rotate-hint 2s ease-in-out infinite;
            margin-bottom: 20px;
        }
        @keyframes rotate-hint {
            0%, 100% { transform: rotate(0deg); }
            50% { transform: rotate(90deg); }
        }
        #rotation-overlay p {
            font-size: clamp(16px, 4vw, 24px);
            margin: 10px 0;
        }
        /* Mobile-specific media queries */
        @media (max-width: 600px) {
            .audio-btn {
                font-size: 12px;
                padding: 6px 8px;
                min-width: 80px;
            }
            #music-btn { top: 55px; }
            #leaderboard-panel {
                max-width: 100%;
                padding: 10px;
            }
            .leaderboard-list {
                max-height: 150px;
            }
            .leaderboard-row {
                grid-template-columns: 22px 1fr 44px 54px;
                gap: 6px;
                font-size: 12px;
            }
        }
        @media (max-height: 400px) {
            .audio-btn {
                font-size: 10px;
                padding: 4px 6px;
                min-width: 60px;
                min-height: 36px;
            }
            #sound-btn { top: 5px; }
            #music-btn { top: 42px; }
            #menu-btn {
                font-size: 24px;
                padding: 5px;
            }
        }
