/* ============================================================ */
/* 塊魂風ゲーム - スタイルシート */
/* ============================================================ */

/* リセット */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    overflow: hidden;
    font-family: 'Yu Gothic', 'Meiryo', sans-serif;
    background: #f0f0f0;
}

canvas {
    display: block;
}

/* ============================================================ */
/* 難易度選択画面 */
/* ============================================================ */

#difficultySelect {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #e8f4f8 0%, #d4e8f0 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 40px;
}

#difficultySelect h1 {
    font-size: 56px;
    color: #333;
    margin-bottom: 60px;
    font-weight: bold;
    background: white;
    padding: 20px 50px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 3px solid #333;
}

.difficulty-btn {
    margin: 12px;
    padding: 25px 60px;
    font-size: 28px;
    cursor: pointer;
    border: 3px solid #333;
    border-radius: 12px;
    color: #333;
    font-weight: bold;
    transition: all 0.2s;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2);
    min-width: 450px;
    text-align: left;
    background: white;
}

.difficulty-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 0 rgba(0, 0, 0, 0.2);
}

.difficulty-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}

#easyBtn {
    border-left: 10px solid #4caf50;
}

#easyBtn:hover {
    background: #f1f8e9;
}

#normalBtn {
    border-left: 10px solid #ff9800;
}

#normalBtn:hover {
    background: #fff3e0;
}

#hardBtn {
  border-left: 10px solid #f44336;
}

#hardBtn:hover {
    background: #ffebee;
}

.difficulty-info {
    font-size: 18px;
    margin-top: 8px;
    color: #666;
}

/* ============================================================ */
/* ステージ選択画面 */
/* ============================================================ */

#stageSelect {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #fff8e1 0%, #ffe0b2 100%);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 999;
    padding: 40px;
}

#stageSelect h1 {
    font-size: 56px;
    color: #333;
    margin-bottom: 60px;
    font-weight: bold;
    background: white;
    padding: 20px 50px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 3px solid #333;
}

.stage-btn {
    margin: 12px;
    padding: 25px 60px;
    font-size: 26px;
    cursor: pointer;
    border: 3px solid #333;
    border-radius: 12px;
    color: #333;
    font-weight: bold;
    transition: all 0.2s;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2);
    min-width: 450px;
    text-align: left;
    background: white;
}

.stage-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 0 rgba(0, 0, 0, 0.2);
}

.stage-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}

#cityBtn {
    border-left: 10px solid #2196f3;
}

#cityBtn:hover {
    background: #e3f2fd;
}

#parkBtn {
    border-left: 10px solid #8bc34a;
}

#parkBtn:hover {
    background: #f1f8e9;
}

/* ============================================================ */
/* チュートリアル画面 */
/* ============================================================ */

#tutorial {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    color: #333;
}

#tutorial h1 {
    font-size: 48px;
    margin-bottom: 40px;
    color: #0066cc;
    font-weight: bold;
}

#tutorial .tutorial-content {
    font-size: 22px;
    line-height: 2;
    text-align: center;
    max-width: 800px;
}

#tutorial button {
    margin-top: 50px;
    padding: 20px 60px;
    font-size: 24px;
    cursor: pointer;
    background: #0066cc;
    border: 3px solid #004499;
    border-radius: 12px;
    color: white;
    font-weight: bold;
    transition: all 0.2s;
    box-shadow: 0 4px 0 #004499;
}

#tutorial button:hover {
    background: #0055aa;
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #004499;
}

#tutorial button:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #004499;
}

/* ============================================================ */
/* ポーズ画面 */
/* ============================================================ */

#pauseScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 500;
}

#pauseScreen h1 {
    font-size: 64px;
    color: #333;
    margin-bottom: 40px;
    font-weight: bold;
}

#pauseScreen button {
    margin: 15px;
    padding: 18px 45px;
    font-size: 22px;
    cursor: pointer;
    background: white;
    border: 3px solid #333;
    border-radius: 12px;
    color: #333;
    font-weight: bold;
    transition: all 0.2s;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2);
}

#pauseScreen button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.2);
    background: #f0f0f0;
}   

#pauseScreen button:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}

/* ============================================================ */
/* ゲーム中のUI */
/* ============================================================ */

#ui {
    position: absolute;
    top: 20px;
    left: 20px;
    color: #333;
    font-size: 20px;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 20px;
    border-radius: 12px;
    border: 2px solid #333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#ui div {
    margin: 6px 0;
    font-weight: bold;
}

#sizeInfo {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #333;
    font-size: 20px;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 20px;
    border-radius: 12px;
    text-align: right;
    border: 2px solid #333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#sizeInfo div {
    margin: 6px 0;
}

#timer {
    position: absolute;
    top: 180px;
    right: 20px;
    color: #d32f2f;
    font-size: 48px;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 25px;
    border-radius: 12px;
    border: 2px solid #333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#combo {
    position: absolute;
    top: 270px;
    right: 20px;
    color: #ff6f00;
    font-size: 32px;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 20px;
    border-radius: 12px;
    border: 2px solid #333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: none;
}

#minimap {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 200px;
    height: 200px;
    background: white;
    border: 3px solid #333;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#info {
    position: absolute;
    bottom: 20px;
    left: 20px;
    color: #333;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 16px;
    border-radius: 8px;
    border: 2px solid #333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}   

/* ============================================================ */
/* ゲームオーバー画面 */
/* ============================================================ */

#gameOver {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    color: #333;
    padding: 50px;
    border-radius: 20px;
    text-align: center;
    display: none;
    z-index: 200;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    border: 4px solid #333;
}

#gameOver h1 {
    margin: 0 0 20px 0;
    font-size: 56px;
    font-weight: bold;
}

#gameOver button {
    margin: 10px;
    padding: 15px 40px;
    font-size: 22px;
    cursor: pointer;
    background: white;
    border: 3px solid #333;
    border-radius: 12px;
    color: #333;
    font-weight: bold;
    transition: all 0.2s;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2);
}

#gameOver button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.2);
    background: #f0f0f0;
}

#gameOver button:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}

/* ============================================================ */
/* 通知メッセージ */
/* ============================================================ */

#notification {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #333;
    font-size: 48px;
    font-weight: bold;
    background: white;
    padding: 30px 60px;
    border-radius: 20px;
    border: 4px solid #333;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    display: none;
    z-index: 150;
    animation: fadeInOut 2s;
    pointer-events: none;
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1);
    }
}

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

@media (max-width: 768px) {
    #difficultySelect h1,
    #stageSelect h1 {
        font-size: 36px;
        padding: 15px 30px;
    }

    .difficulty-btn,
    .stage-btn {
        font-size: 20px;
        padding: 18px 40px;
        min-width: 300px;
    }

    #ui,
    #sizeInfo {
        font-size: 16px;
        padding: 10px 15px;
    }

    #timer {
        font-size: 36px;
    }

    #gesture-guide {
        font-size: 14px;
        padding: 12px 16px;
    }
}
