/* typing_game_style.css */

/* WordPressの管理バーのみ非表示 */
body.logged-in { margin-top: 0 !important; padding-top: 0 !important; }
#wpadminbar { display: none !important; }

/* ゲームの共通スタイル */
.hidden { display: none !important; }
#typing-game-container .start-screen.hidden,
#typing-game-container .game-screen.hidden,
#typing-game-container .result-screen.hidden {
    display: none !important;
}

body { font-family: 'M PLUS Rounded 1c', sans-serif; box-sizing: border-box !important; }

#typing-game-container { 
    background-color: #ffffff;
    padding: 1rem; /* 全体のパディングを少し詰める */
    border-radius: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    width: 100% !important; 
    max-width: 750px !important; 
    height: auto !important; 
    text-align: center;
    border: 10px solid #16a34a; /* ★修正: 緑色の枠に変更 */
    position: relative !important; 
    z-index: 10 !important;
    display: flex !important; 
    flex-direction: column !important; 
    align-items: center !important; 
    justify-content: center !important; 
    box-sizing: border-box !important;
    margin: 2rem auto !important; 
}

/* 各画面共通 */
.start-screen, .game-screen, .result-screen {
    width: 100%; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; 
    background-color: #f0fdf4; border-radius: 1rem; padding: 1.5rem; /* 薄い緑 */
}
.start-screen { justify-content: center; }
.game-screen, .result-screen { justify-content: flex-start; border: 3px solid #16a34a; position: relative; }

/* スタート画面 */
.game-title { 
    display: none; /* タイトルを非表示にする */
}
.level-selection { 
    display: flex; flex-direction: column; align-items: center; width: 100%; 
    gap: 0.8em; /* ボタン間の隙間を少し詰める */
}
.level-button { display: flex; justify-content: space-between; align-items: center; width: 100%; max-width: 600px; padding: 0.8em 1.2rem; /* ボタンの高さを少し詰める */ font-size: 1.1rem; font-weight: 700; color: #14532d; background-color: #dcfce7; border: 2px solid #86efac; border-radius: 0.5rem; cursor: pointer; transition: all 0.2s ease; }
.level-button:hover { background-color: #bbf7d0; }
.level-name { flex-grow: 1; text-align: left; }
.best-score-inline { font-weight: bold; color: #14532d; background-color: rgba(255,255,255,0.8); padding: 0.2em 0.6em; border-radius: 0.3rem; border: 1px solid #86efac; }

/* ゲーム画面 */
.restart-ingame-button { position: absolute; top: -45px; left: 10px; background-color: #a0aec0; color: white; padding: 0.3rem 0.8rem; font-size: 0.9rem; border-radius: 0.5rem; border: none; cursor: pointer; }
.game-info-bar { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-bottom: 1rem; padding: 0.5rem 1rem; background-color: #14532d; color: white; border-radius: 0.5rem; font-size: 1.1rem; font-weight: bold; }
.word-display-area { display: flex; flex-direction: column; justify-content: center; align-items: center; width: 100%; min-height: 160px; padding: 1.5rem; margin-bottom: 1.5rem; border: 2px solid #16a34a; border-radius: 0.75rem; background-color: #fff; } 
.current-word-text { font-weight: 700; color: #1f2937; text-align: center; line-height: 1.6; }
.font-level1 { font-size: 2.8rem; }
.font-level2, .font-level3-question, .font-level4-question { font-size: 1.6rem; }
.roma-guide-text { font-size: 1rem; color: #4b5563; margin-top: 0.5rem; }
.options-container { display: flex; flex-direction: column; gap: 0.75rem; width: 100%; max-width: 600px; margin-top: -0.5rem; margin-bottom: 1.5rem; }
.option-button { background-color: #fff; border: 2px solid #a0aec0; border-radius: 0.5rem; padding: 0.75rem; font-size: 1.1rem; color: #374151; }
.input-area { width: 100%; padding: 0.75rem 1rem; font-size: 1.2rem; border: 2px solid #16a34a; border-radius: 0.5rem; margin-bottom: 1.5rem; } 
.feedback { font-size: 1.3rem; font-weight: bold; height: 2.2rem; margin-top: -0.5rem; margin-bottom: 0.5rem; }
.feedback.correct { color: #15803d; }
.feedback.incorrect { color: #be123c; }

/* 結果画面 */
.result-screen h2 { font-size: 2.2rem; font-weight: 800; color: #14532d; margin-bottom: 1rem; }
.final-score-display { font-size: 4rem; font-weight: 800; color: #166534; margin-bottom: 1rem; }
.correct-count-result, .mistake-count-result { font-size: 1.1rem; color: #374151; margin: 0.25rem 0; }
.best-score-container { margin-top: 1.5rem; border: 2px solid #86efac; padding: 1rem; border-radius: 0.75rem; background-color: #dcfce7; width: 100%; max-width: 400px; }
.best-score-container p { margin: 0.25rem 0; }
.best-score-display { font-weight: bold; color: #14532d; }
.best-score-update-message { font-size: 0.9rem; font-weight: bold; color: #14532d; }
.result-buttons { display: flex; flex-direction: row; justify-content: center; gap: 1rem; margin-top: 2rem; width: 100%; }
.game-button { padding: 10px 20px; font-size: 1.1em; border-radius: 8px; cursor: pointer; color: white; border: none; }
.retry-button { background-color: #4CAF50; }
.to-title-button { background-color: #008CBA; }