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

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: #333;
    overflow: hidden;
}

#game-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 画面共通 */
#start-screen, #game-screen, #result-screen {
    text-align: center;
    width: 100%;
    max-width: 900px;
    padding: 20px;
    display: none; /* デフォルトは非表示 */
}

/* GameBaseの画面管理システムに対応 */
#start-screen.active, #game-screen.active, #result-screen.active {
    display: block;
}

.hidden {
    display: none !important;
}

/* スタート画面 */
#start-screen h1 {
    font-size: 48px;
    margin-bottom: 20px;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

#start-screen p {
    font-size: 20px;
    color: white;
    margin-bottom: 30px;
}

.instructions {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 20px;
    margin: 30px auto;
    max-width: 500px;
    text-align: left;
}

.instructions p {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}

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

.instructions li {
    padding: 8px 0;
    font-size: 16px;
}

.primary-btn {
    font-size: 24px;
    padding: 15px 40px;
    background: #FF6B6B;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, background 0.3s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.primary-btn:hover {
    background: #EE5A6F;
    transform: scale(1.05);
}

/* ゲーム画面 */
#status-bar {
    display: flex;
    justify-content: space-around;
    background: rgba(255, 255, 255, 0.9);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: bold;
}

#game-canvas {
    display: block;
    background: #2c3e50;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    margin: 0 auto;
}

#message {
    font-size: 24px;
    font-weight: bold;
    color: white;
    margin-top: 20px;
    min-height: 30px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* 結果画面 */
#result-screen h2 {
    font-size: 42px;
    margin-bottom: 30px;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.result-stats {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 30px;
}

.result-stats p {
    font-size: 28px;
    margin-bottom: 15px;
}

.highlight {
    color: #6a11cb;
    font-weight: bold;
    font-size: 36px;
}

/* モバイル用仮想十字キー */
.mobile-controls {
    display: none;
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
}

.d-pad {
    position: relative;
    width: 180px;
    height: 180px;
}

.d-btn {
    position: absolute;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border: 3px solid rgba(106, 17, 203, 0.8);
    border-radius: 8px;
    font-size: 28px;
    font-weight: bold;
    color: #6a11cb;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.1s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.d-btn:active {
    background: rgba(106, 17, 203, 0.9);
    color: white;
    transform: scale(0.95);
}

.d-up {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.d-down {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.d-left {
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

.d-right {
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    #start-screen h1 {
        font-size: 32px;
    }

    #status-bar {
        font-size: 16px;
        flex-wrap: wrap;
        gap: 10px;
    }

    #game-canvas {
        width: 95vw;
        height: calc(95vw * 0.75);
        max-width: 800px;
        max-height: 600px;
    }

    .result-stats p {
        font-size: 20px;
    }

    .highlight {
        font-size: 28px;
    }

    .mobile-controls {
        display: block;
    }

    .instructions li {
        font-size: 14px;
    }
}
