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

body {
    font-family: 'Arial', sans-serif;
    background-color: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    /* スマホでのスクロール防止 */
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
    touch-action: none; /* すべてのタッチ操作を無効化 */
    -webkit-overflow-scrolling: touch;
}

.game-container {
    width: 100%;
    max-width: 500px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    /* ゲームコンテナ内でのスクロール制御 */
    overflow-y: auto;
    max-height: 100vh;
    touch-action: pan-y; /* 縦方向のスクロールのみ許可（必要に応じて） */
}

.header {
    text-align: center;
    margin-bottom: 20px;
}

.score-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0;
    gap: 20px;
}

.score, .high-score {
    font-size: 1.2rem;
    flex: 1;
    text-align: center;
}

.next-fruit {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px 0;
}

.next-fruit p {
    margin-right: 10px;
}

.game-board {
    width: 100%;
    height: 500px;
    background-color: #f0f0f0;
    border: 2px solid #ddd;
    border-radius: 5px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    touch-action: none; /* すべてのタッチ操作を無効化してスクロールを防止 */
    user-select: none; /* テキスト選択を無効化 */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    /* Webkitブラウザでのタッチ操作制御 */
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

canvas {
    display: block;
    background-color: #f0f0f0;
    touch-action: none; /* すべてのタッチ操作を無効化してスクロールを防止 */
    user-select: none; /* テキスト選択を無効化 */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    /* Webkitブラウザでのタッチ操作制御 */
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

button {
    padding: 10px 20px;
    font-size: 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    background-color: #4CAF50;
    color: white;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #45a049;
}

#reset-btn {
    background-color: #f44336;
}

#reset-btn:hover {
    background-color: #d32f2f;
}

.next-fruit-preview {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
}

.game-over-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 2rem;
    z-index: 100;
    display: none;
}

.game-over-overlay button {
    margin-top: 20px;
    font-size: 1.2rem;
    padding: 10px 20px;
}

/* フルーツの色 */
.fruit-1 { background-color: #FFC0CB; color: black; } /* さくらんぼ - ピンク */
.fruit-2 { background-color: #FF7F50; color: black; } /* ぶどう - オレンジ */
.fruit-3 { background-color: #FFD700; color: black; } /* レモン - 黄色 */
.fruit-4 { background-color: #32CD32; color: black; } /* キウイ - 緑 */
.fruit-5 { background-color: #FF4500; color: black; } /* みかん - オレンジ赤 */
.fruit-6 { background-color: #FF8C00; color: black; } /* りんご - ダークオレンジ */
.fruit-7 { background-color: #FF6347; color: black; } /* もも - トマト色 */
.fruit-8 { background-color: #8B4513; color: white; } /* パイナップル - 茶色 */
.fruit-9 { background-color: #FF0000; color: white; } /* すいか - 赤 */
.fruit-10 { background-color: #800080; color: white; } /* 特大すいか - 紫 */
