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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
    color: #fff;
    overflow: hidden;
    cursor: auto; /* デフォルトはカーソル表示 */
}

.container {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

/* ========== スクリーン共通 ========== */
.screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
}

/* ========== スタート画面 ========== */
#startScreen {
    background: linear-gradient(135deg, #0f3460 0%, #16213e 50%, #0a0a0a 100%);
    padding: 20px;
    z-index: 10;
    cursor: auto;
}

.title-area {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 0.8s ease;
}

.game-title {
    font-size: 4rem;
    font-weight: bold;
    text-shadow: 0 0 20px rgba(0, 255, 0, 0.8),
                 0 0 40px rgba(0, 255, 0, 0.5),
                 0 4px 8px rgba(0, 0, 0, 0.8);
    margin-bottom: 10px;
    letter-spacing: 3px;
}

.game-subtitle {
    font-size: 1.5rem;
    color: #0ff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
    letter-spacing: 2px;
}

.menu-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    margin-bottom: 40px;
}

.btn {
    padding: 18px 45px;
    font-size: 1.5rem;
    font-weight: bold;
    border: 3px solid #0f0;
    background: linear-gradient(135deg, #001a00 0%, #003300 100%);
    color: #0f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5),
                inset 0 0 20px rgba(0, 255, 0, 0.1);
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.8);
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn:hover {
    background: linear-gradient(135deg, #003300 0%, #005500 100%);
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.8),
                inset 0 0 30px rgba(0, 255, 0, 0.2);
    transform: scale(1.05);
}

.btn:active {
    transform: scale(0.95);
}

.btn-icon {
    font-size: 1.8rem;
}

.high-score {
    font-size: 1.5rem;
    padding: 15px 30px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #0ff;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

.high-score .label {
    color: #0ff;
    margin-right: 10px;
}

.high-score .value {
    color: #ff0;
    font-weight: bold;
    font-size: 1.8rem;
    text-shadow: 0 0 10px rgba(255, 255, 0, 0.8);
}

.instructions {
    max-width: 600px;
    background: rgba(0, 0, 0, 0.7);
    padding: 30px;
    border-radius: 12px;
    border: 2px solid rgba(0, 255, 0, 0.3);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.2);
}

.instructions h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: #0f0;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.8);
}

.instructions ul {
    list-style: none;
    padding: 0;
}

.instructions li {
    font-size: 1.2rem;
    margin: 12px 0;
    padding-left: 30px;
    position: relative;
    color: #ccc;
}

.instructions li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: #0f0;
    font-size: 1.5rem;
}

.back-link {
    position: absolute;
    top: 20px;
    left: 20px;
    color: #0ff;
    text-decoration: none;
    font-size: 1.2rem;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #0ff;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.back-link:hover {
    background: rgba(0, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

/* ========== ゲーム画面 ========== */
#gameScreen {
    background: linear-gradient(135deg, #0a3d0a 0%, #1a1a1a 100%);
}

.game-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    z-index: 100;
    pointer-events: none;
}

.hud-left, .hud-right {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.score-display, .time-display, .ammo-display {
    background: rgba(0, 0, 0, 0.8);
    padding: 12px 20px;
    border-radius: 8px;
    border: 2px solid rgba(0, 255, 0, 0.5);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: none !important;
}

.score-display .label, .time-display .label, .ammo-display .label {
    color: #0f0;
    font-weight: bold;
}

.score-display .value, .time-display .value, .ammo-display .value {
    color: #fff;
    font-weight: bold;
    font-size: 1.8rem;
}

.combo-display {
    background: rgba(255, 0, 0, 0.8);
    padding: 10px 20px;
    border-radius: 8px;
    border: 2px solid #ff0;
    box-shadow: 0 0 20px rgba(255, 255, 0, 0.8);
    animation: pulse 0.5s ease-in-out infinite;
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: none !important;
}

.combo-value {
    font-size: 2rem;
    font-weight: bold;
    color: #ff0;
    text-shadow: 0 0 10px rgba(255, 255, 0, 1);
}

.combo-label {
    font-size: 1.2rem;
    color: #fff;
    font-weight: bold;
}

#gameCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* ゲームプレイ中のみカーソルを非表示にしてクロスヘアを表示 */
#gameScreen.playing #gameCanvas {
    cursor: none;
}

#gameScreen.playing .crosshair {
    display: block;
}

/* ========== クロスヘア（照準） ========== */
.crosshair {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    pointer-events: none !important;
    z-index: 1000;
    display: none; /* デフォルトは非表示 */
}

.crosshair-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 4px;
    background: #0f0;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.8),
                0 0 20px rgba(0, 255, 0, 0.5);
}

.crosshair-line {
    position: absolute;
    background: #0f0;
    box-shadow: 0 0 5px rgba(0, 255, 0, 0.8);
}

.crosshair-top {
    width: 2px;
    height: 12px;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.crosshair-bottom {
    width: 2px;
    height: 12px;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.crosshair-left {
    width: 12px;
    height: 2px;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

.crosshair-right {
    width: 12px;
    height: 2px;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

/* ========== リロード表示 ========== */
.reload-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 30px 60px;
    border-radius: 12px;
    border: 3px solid #ff0;
    box-shadow: 0 0 30px rgba(255, 255, 0, 0.8);
    z-index: 500;
    pointer-events: none !important;
}

.reload-text {
    font-size: 2.5rem;
    font-weight: bold;
    color: #ff0;
    text-shadow: 0 0 15px rgba(255, 255, 0, 1);
    animation: pulse 0.5s ease-in-out infinite;
}

/* ========== ヒットマーカー ========== */
.hit-marker {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    pointer-events: none !important;
    z-index: 1001;
    animation: hitFlash 0.2s ease-out;
}

.hit-line {
    position: absolute;
    width: 20px;
    height: 3px;
    background: #ff0;
    box-shadow: 0 0 10px rgba(255, 255, 0, 1);
}

.hit-line-1 {
    top: 5px;
    left: 5px;
    transform: rotate(-45deg);
}

.hit-line-2 {
    top: 5px;
    right: 5px;
    transform: rotate(45deg);
}

.hit-line-3 {
    bottom: 5px;
    left: 5px;
    transform: rotate(45deg);
}

.hit-line-4 {
    bottom: 5px;
    right: 5px;
    transform: rotate(-45deg);
}

/* ========== ゲームオーバー画面 ========== */
#gameOverScreen {
    background: rgba(0, 0, 0, 0.95);
    z-index: 200;
    cursor: auto;
}

.game-over-content {
    text-align: center;
    animation: fadeInUp 0.8s ease;
}

.game-over-title {
    font-size: 4rem;
    color: #f00;
    text-shadow: 0 0 20px rgba(255, 0, 0, 0.8),
                 0 0 40px rgba(255, 0, 0, 0.5);
    margin-bottom: 30px;
    animation: pulse 1s ease-in-out infinite;
}

.final-score-area {
    margin-bottom: 30px;
}

.final-score-area .label {
    font-size: 1.5rem;
    color: #0ff;
    margin-bottom: 10px;
}

.final-score-area .score {
    font-size: 5rem;
    font-weight: bold;
    color: #ff0;
    text-shadow: 0 0 20px rgba(255, 255, 0, 0.8);
}

.new-high-score {
    font-size: 2rem;
    color: #0f0;
    text-shadow: 0 0 20px rgba(0, 255, 0, 0.8);
    animation: bounce 1s ease-in-out infinite;
    margin-bottom: 20px;
}

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

.stat-item {
    background: rgba(0, 0, 0, 0.7);
    padding: 20px 30px;
    border-radius: 8px;
    border: 2px solid rgba(0, 255, 0, 0.5);
}

.stat-label {
    display: block;
    font-size: 1.2rem;
    color: #0ff;
    margin-bottom: 8px;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: #ff0;
}

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

.btn-restart, .btn-menu {
    padding: 15px 35px;
    font-size: 1.3rem;
}

/* ========== アニメーション ========== */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes hitFlash {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.5);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

/* ========== レスポンシブ ========== */

/* PC向け（大画面） */
@media (min-width: 1200px) {
    .game-title {
        font-size: 5rem;
    }

    .game-subtitle {
        font-size: 2rem;
    }

    .btn {
        font-size: 1.8rem;
        padding: 20px 50px;
    }

    .instructions {
        max-width: 800px;
        font-size: 1.3rem;
    }

    .instructions h3 {
        font-size: 2rem;
    }

    .instructions li {
        font-size: 1.3rem;
    }
}

/* タブレット・中画面 */
@media (min-width: 769px) and (max-width: 1199px) {
    .game-title {
        font-size: 3.5rem;
    }

    .instructions {
        max-width: 700px;
    }
}

/* モバイル・小画面 */
@media (max-width: 768px) {
    .game-title {
        font-size: 2.5rem;
    }

    .game-subtitle {
        font-size: 1.2rem;
    }

    .btn {
        font-size: 1.2rem;
        padding: 12px 30px;
    }

    .instructions {
        font-size: 0.9rem;
        padding: 20px;
        max-width: 90%;
    }

    .instructions li {
        font-size: 1rem;
    }

    .game-over-title {
        font-size: 2.5rem;
    }

    .final-score-area .score {
        font-size: 3rem;
    }

    body {
        cursor: auto;
    }

    #gameCanvas {
        cursor: auto;
    }

    .crosshair {
        display: none;
    }

    .stats {
        gap: 15px;
    }

    .stat-item {
        padding: 15px 20px;
    }
}
