﻿:root {
            --bg-color: #0f172a;
            --text-color: #f8fafc;
            --primary-color: #0ea5e9;
            --enemy-color: #ef4444;
        }

        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.7; }
        }

        html {
            margin: 0;
            padding: 0;
            width: 100%;
            height: 100%;
            overflow: hidden;
            background-color: #000;
        }

        body {
            margin: 0;
            padding: 0;
            width: 100%;
            height: 100%;
            overflow: hidden;
            background-color: var(--bg-color);
            color: var(--text-color);
            font-family: "Yomogi", cursive;
            touch-action: none;
            user-select: none;
            -webkit-user-select: none;
        }

        #game-container {
            position: relative;
            width: 100%;
            max-width: 480px;
            height: 100%;
            max-height: 920px;
            margin: 0 auto;
            overflow: hidden;
        }

        #gameCanvas {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 1;
        }

        #ui-layer {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 10;
            pointer-events: none;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            padding: 20px;
            box-sizing: border-box;
        }

        /* Login Modal & Result Screen */
        .modal {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 100;
            background: rgba(15, 23, 42, 0.95);
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            pointer-events: auto;
        }

        .modal-box {
            background: #1e293b;
            padding: 30px;
            border-radius: 16px;
            text-align: center;
            border: 1px solid #334155;
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
            width: 90%;
            max-width: 600px;
            max-height: 90vh;
            overflow-y: auto;
        }

        .modal-title {
            font-size: 1.5rem;
            font-weight: bold;
            margin-bottom: 20px;
            color: #fff;
        }

        .login-input {
            width: 100%;
            padding: 12px;
            margin-bottom: 20px;
            border-radius: 8px;
            border: 1px solid #475569;
            background: #0f172a;
            color: #fff;
            font-size: 1.1rem;
            text-align: center;
            box-sizing: border-box;
        }

        .action-btn {
            width: 100%;
            padding: 12px;
            border-radius: 8px;
            background: linear-gradient(135deg, #0ea5e9, #2563eb);
            color: #fff;
            border: none;
            font-size: 1.1rem;
            font-weight: bold;
            cursor: pointer;
            box-shadow: 0 4px 6px rgba(14, 165, 233, 0.3);
            margin-top: 10px;
        }

        .action-btn:active {
            transform: scale(0.98);
        }

        .hourly-tab-btn {
            padding: 3px 12px;
            border-radius: 4px;
            border: 1px solid #475569;
            background: #1e293b;
            color: #94a3b8;
            font-size: 0.7rem;
            cursor: pointer;
        }
        .hourly-tab-btn.active {
            background: #3b82f6;
            color: #fff;
            border-color: #3b82f6;
        }

        .score-panel {
            display: flex;
            gap: 20px;
            pointer-events: none;
        }

        .stat-box {
            background: rgba(15, 23, 42, 0.6);
            backdrop-filter: blur(5px);
            padding: 10px 15px;
            border-radius: 8px;
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

        .stat-label {
            font-size: 0.7rem;
            color: #94a3b8;
            text-transform: uppercase;
            white-space: nowrap;
        }

        .stat-value {
            font-size: 1.2rem;
            font-weight: bold;
            color: #fff;
        }

        #timer {
            font-size: 2rem;
            font-weight: 800;
            text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
            flex-shrink: 0;
            margin-left: auto;
            /* Push it to the right if space allows, or just separate it */
        }

        /* Leaderboard */
        #leaderboard {
            position: absolute;
            top: 80px;
            right: 15px;
            background: rgba(15, 23, 42, 0.7);
            padding: 6px 8px;
            border-radius: 8px;
            border: 1px solid rgba(255, 255, 255, 0.1);
            min-width: 120px;
            backdrop-filter: blur(5px);
        }

        .lb-title {
            font-size: 6pt;
            color: #94a3b8;
            margin-bottom: 2px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            opacity: 0.8;
        }

        .lb-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 2px;
            font-size: 6pt;
        }

        .lb-name {
            color: #fff;
            font-size: 6pt;
            flex-grow: 1;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .lb-score {
            color: #0ea5e9;
            font-weight: bold;
            font-size: 6pt;
        }

        #instruction-overlay {
            position: absolute;
            bottom: 100px;
            width: 100%;
            text-align: center;
            opacity: 0.7;
            font-size: 0.9rem;
            pointer-events: none;
            text-shadow: 0 1px 2px #000;
        }

        #kill-feed {
            position: absolute;
            bottom: 130px;
            width: 100%;
            display: flex;
            flex-direction: column-reverse;
            align-items: center;
            pointer-events: none;
            gap: 4px;
            z-index: 20;
            text-shadow: 1px 1px 2px #000;
            font-weight: bold;
            color: #fbbf24;
            font-size: 0.75rem;
        }

        #virtual-joystick-base {
            position: absolute;
            width: 120px;
            height: 120px;
            border-radius: 50%;
            border: 2px solid rgba(255, 255, 255, 0.2);
            display: none;
            pointer-events: none;
            z-index: 5;
        }

        #virtual-joystick-stick {
            position: absolute;
            top: 50%;
            left: 50%;
            width: 50px;
            height: 50px;
            background: rgba(14, 165, 233, 0.5);
            border-radius: 50%;
            transform: translate(-50%, -50%);
        }

        .kill-msg {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: rgba(220, 38, 38, 0.8);
            padding: 20px;
            border-radius: 10px;
            text-align: center;
            display: none;
            pointer-events: none;
        }

        .kill-title {
            font-size: 2rem;
            font-weight: bold;
            margin-bottom: 5px;
        }

        .kill-sub {
            font-size: 1rem;
        }

        /* Result Table */
        .result-table {
            width: 100%;
            text-align: left;
            border-collapse: collapse;
            margin: 15px 0;
            color: #cbd5e1;
        }

        .result-table th {
            border-bottom: 2px solid #475569;
            padding: 5px;
            font-size: 8pt;
            cursor: pointer;
        }

        .result-table th:hover {
            background: #475569;
        }

        .result-table td {
            border-bottom: 1px solid #334155;
            padding: 4px 5px;
            font-size: 8pt;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 80px;
        }

        .rank-1 {
            color: #fbbf24;
            font-weight: bold;
        }

        /* Gold */
        .rank-2 {
            color: #94a3b8;
            font-weight: bold;
        }

        /* Silver */
        .rank-3 {
            color: #b45309;
            font-weight: bold;
        }

        /* Bronze */

        /* Settings Buttons */
        /* 低パフォーマンスモード時: backdrop-filterを無効化 */
        .low-perf .stat-box,
        .low-perf #leaderboard {
            backdrop-filter: none;
            -webkit-backdrop-filter: none;
        }

        .setting-btn {
            padding: 10px 16px;
            border-radius: 8px;
            background: #334155;
            color: #94a3b8;
            border: 2px solid #475569;
            font-size: 0.9rem;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .setting-btn:hover {
            background: #475569;
            color: #fff;
        }

        .setting-btn.active {
            background: linear-gradient(135deg, #0ea5e9, #2563eb);
            color: #fff;
            border-color: #0ea5e9;
            box-shadow: 0 0 10px rgba(14, 165, 233, 0.4);
        }
