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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    height: 100%;
    overflow: hidden;
}

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

.screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
    padding: 20px;
}

/* タイトル画面 */
#title-screen h1 {
    font-size: 3em;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(94, 129, 244, 0.8);
}

#title-screen p {
    font-size: 1.3em;
    margin-bottom: 30px;
}

.instructions {
    background: rgba(94, 129, 244, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(94, 129, 244, 0.3);
    padding: 20px;
    border-radius: 10px;
    margin-top: 30px;
    max-width: 400px;
}

.instructions h3 {
    font-size: 1.5em;
    margin-bottom: 15px;
    color: #5e81f4;
}

.instructions ul {
    list-style: none;
    text-align: left;
}

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

.instructions li:before {
    content: "→ ";
    color: #5e81f4;
}

/* ボタン */
.btn-primary {
    background: linear-gradient(135deg, #5e81f4 0%, #8b5cf6 100%);
    color: white;
    font-size: 1.5em;
    font-weight: bold;
    padding: 15px 50px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(94, 129, 244, 0.5);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(94, 129, 244, 0.7);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(239, 68, 68, 0.8);
    color: white;
    font-size: 1em;
    font-weight: bold;
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 10px;
}

.btn-secondary:hover {
    background: rgba(239, 68, 68, 1);
}

/* ゲーム画面 */
#game-screen {
    padding: 0;
    justify-content: flex-start;
}

#hud {
    width: 100%;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    font-size: 1.1em;
    flex-wrap: wrap;
    gap: 15px;
}

.hud-item {
    display: flex;
    gap: 8px;
    align-items: center;
}

.gravity-indicator {
    background: rgba(94, 129, 244, 0.3);
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 1.2em;
}

#game-canvas {
    flex: 1;
    background: #0a1128;
    min-height: 0;
}

#controls {
    background: rgba(0, 0, 0, 0.7);
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.controls-row {
    display: flex;
    gap: 10px;
}

.gravity-btn {
    background: linear-gradient(135deg, #5e81f4 0%, #8b5cf6 100%);
    color: white;
    font-size: 1.5em;
    width: 60px;
    height: 60px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 10px rgba(94, 129, 244, 0.5);
}

.gravity-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(94, 129, 244, 0.7);
}

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

/* ステージクリア画面 */
#stage-clear-screen h2,
#game-clear-screen h2 {
    font-size: 2.5em;
    margin-bottom: 30px;
    text-shadow: 0 0 20px rgba(94, 129, 244, 0.8);
}

#stage-result,
#final-result {
    background: rgba(94, 129, 244, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(94, 129, 244, 0.3);
    padding: 30px;
    border-radius: 15px;
    min-width: 300px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 15px 0;
    font-size: 1.3em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.result-item:last-child {
    border-bottom: none;
}

.score-large {
    font-size: 4em;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    margin-bottom: 20px;
}

#result-breakdown {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid rgba(255, 255, 255, 0.3);
}

.result-buttons {
    display: flex;
    gap: 20px;
    margin-top: 30px;
}

/* レスポンシブ */
@media (max-width: 768px) {
    #title-screen h1 {
        font-size: 2em;
    }

    .btn-primary {
        font-size: 1.2em;
        padding: 12px 40px;
    }

    #hud {
        font-size: 0.9em;
    }

    .gravity-btn {
        width: 50px;
        height: 50px;
        font-size: 1.2em;
    }

    .score-large {
        font-size: 3em;
    }
}

@media (max-width: 480px) {
    .gravity-btn {
        width: 45px;
        height: 45px;
        font-size: 1em;
    }
}
