html, body,
ul, ol, li,
h1, h2, h3, h4, h5, h6, p,
form, input, div {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'M PLUS 1p', 'ヒラギノ角ゴ Pro W3', 'Hiragino Kaku Gothic Pro W3', 'メイリオ', Meiryo, 'ＭＳ Ｐゴシック', Helvetica, Arial, sans-serif;
}

.title{
    margin-top:10px;
    /* margin-left: -50px; を削除または 0 にする */
    margin-left: 0px; 
    margin-right:0px;
    margin-bottom:0px;
    font-size:50px;
    text-align:center; /* これでテキストは中央に寄ります */
}

/* ========================================= */
/* ★ 設定コンテナの配置（新規追加） ★ */
/* ========================================= */
#settings-container {
    /* 1. 配置方法と水平中央寄せの設定はそのまま残す */
    position: absolute; 
    left: 50%;
    
    /* 2. 垂直方向の位置を調整（例: 35%にすると上に移動） */
    top: 30%; 
    
    /* 3. transform の垂直方向を 0 に修正 */
    /* これにより、要素の中心ではなく、上端が top: 35% の位置に来る */
    transform: translate(-50%, 0); 
    
    /* 4. Flexboxの横並び設定はそのまま残す */
    display: flex;
    justify-content: center; 
    gap: 30px; 
    
    /* 5. margin もそのまま残す */
    margin: 0; 
}

/* ========================================= */
/* ★ 設定項目の詳細スタイル（新規追加） ★ */
/* ========================================= */
.setting-item {
    /* 必要に応じて、各項目を縦に並べるための基本設定 */
    text-align: center;
}

.setting-item label {
    display: block;          /* ラベルを縦に並べる */
    margin-top: 15px;        /* 項目間の縦の間隔 */
    margin-bottom: 5px;      /* ラベルとセレクトボックスの間隔 */
    color: white;            /* 黒板背景上のテキスト色 */
    font-size: 1.1em;
}

#settings-container select {
    text-align:center;
    padding: 5px 10px;
    color: black;            /* 選択肢の文字色 */
    background-color: white; /* 選択肢の背景色 */
    border-radius: 4px;
    font-size: 1.1em;
}

#f-illust1{ 
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;

}

/* スタートボタンの調整（settings-container の中に移動した場合の調整） */
#f-next1 {
    /* 必要に応じて、スタートボタンを下にずらす調整 */
    margin-top: 40px; 
}


    
.main {
  width: 1200px; 
  height:600px; 
  margin-left: auto;
  margin-right: auto;
  position: relative;
  text-align: center;
}



/* ========================================= */
/* ★ 案内文の配置（新規追加） ★ */
/* ========================================= */
#setup-instruction {
    /* 親要素 (#setup-screen) を基準に配置 */
    position: absolute;
    
    /* 水平方向の中央に配置 */
    left: 50%;
    transform: translateX(-50%); 
    
    /* 垂直方向の位置調整 (黒板の上端から少し下げる) */
    top: 15%; /* この値を調整して、目的の位置に移動させてください */
    
    /* 見やすいようにテキストのスタイルを設定 */
    color: white; 
    font-size: 1.5em; /* フォントサイズを調整 */
    font-weight: bold;
    
    /* 既存の p#f-hissan1 よりも上に表示されるように z-index を設定しても良い */
    z-index: 10; 
}

#f-next1 {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -220%;
    width: 40%;
}

#game-screen {
    /* .screen-area の設定により position: absolute; になっています */
    position: absolute; 
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#game-screen .illust { 
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;

}

.top-game-bar {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 5.5% 11%;
    box-sizing: border-box;
    z-index: 100;
}

.main .tama1 {
    /* 以前の絶対位置指定を無効化/上書き */
    position: static !important; /* Flexアイテムとして振る舞う */
    left: auto !important;
    transform: none !important;
    top: auto !important;
    
    /* スタイルは維持 */
    color: white;
    font-size: 2.5em;
    font-weight: bold;
    z-index: 10;
    margin-left:-25%;

}

#question1 {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 27%;
    color: white;
    font-size: 4em;
    font-weight: bold;
    z-index: 10;
}


#question2 {
    position: absolute;
    left: 49%;
    transform: translateX(-50%);
    top: 60%;
    color: white;
    font-size: 4em;
    font-weight: bold;
    z-index: 10;
}

#answer1 {
    position: absolute;
    left: 58%;
    transform: translateX(-50%);
    top: 70%;
    color: black;
    font-size: 4vw;
    font-weight: bold;
    z-index: 10;
    height: 10%;
    width: 5%;
    text-align: center;
}

#answer1_2 {
    position: absolute;
    top: 62%;
    left: 58%;
    transform: translate(-50%, -50%);
    width: 5%;
    height: 10%;
    font-size: 4vw;
    font-weight: bold;
    text-align: center;
}

#answer1_3 {
    position: absolute;
    top: 68.5%;
    left: 58%;
    transform: translate(-50%, -50%);
    width: 7vw;
    height: 0.3vw;
    font-size: 4vw;
    text-align: center;
}

#answer1_4 {
    position: absolute;
    top: 75%;
    left: 67%;
    transform: translate(-50%, -50%);
    width: 6vw;
    height: 6vw;
    font-size: 4vw;
    text-align: center;
}

#answer1_5 {
    position: absolute;
    top: 68.5%;
    left: 52%;
    transform: translate(-50%, -50%);
    width: 4vw;
    height: 0.5vw;
    font-size: 4vw;
    text-align: center;
}

#answer1_6 {
    position: absolute;
    top: 62%;
    left: 67%;
    transform: translate(-50%, -50%);
    width: 6vw;
    height: 6vw;
    font-size: 4vw;
    text-align: center;
}



#timer {
    /* 以前の絶対位置指定を無効化/上書き */
    position: static !important; /* Flexアイテムとして振る舞う */
    margin: 0 !important;       /* マージンをリセット */
    
    /* サイズは維持 (必要に応じて調整) */
    width: 17%;
    height: auto; /* 縦横比を維持 */
    z-Index: 3;
}

#tokuten{
 /* 以前の絶対位置指定を無効化/上書き */
    position: static !important; /* Flexアイテムとして振る舞う */
    margin: 0 !important;       /* マージンをリセット */
    
    /* サイズは維持 (必要に応じて調整) */
    width: 20%;
    height: auto; /* 縦横比を維持 */
    z-Index: 3;
} 




body.fixed { /* iOSは16以降でモーダル表示中に背景より後ろをスクロールさせない */
	overflow: hidden;
}
 
dialog:modal {
    /* border: 1px solid #000;  <-- これを削除または none に変更 */
    max-width: 300%;
    border: none; /* ← 追加 */
    border-radius: 10px;
    padding: 20px;
    background-color: #dcdcdc;
    
    /* 点線枠線 */
    outline: 6px dashed #be8f68;
    outline-offset: -10px;
}
 
dialog::backdrop { /* 背景となる部分のカスタマイズ */
	background: #000;
	opacity: .4;
}

* Webフォントのインポート例 (Google Fonts - Digital/Tech系フォント) */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&display=swap');

#modal{

}


/* モーダルの中身全体のスタイル */
.result-modal-content {
    text-align: center; /* 全て中央揃え */
    padding: 10px;
    width: 300px; /* 必要に応じてサイズ調整 */
    padding-left: 8%;
}


/* 見出しのスタイル */
.result-message {
    font-family: 'Orbitron', sans-serif; /* デジタル感のあるフォント */
    color: #ff9900; /* オレンジ系の色で強調 */
    font-size: 24px;
    margin-bottom: 20px;
}

/* メインスコアエリアのコンテナ */
.main-score-area {
    margin-bottom: 30px;
}

/* 正解率のラベル（小さく上に表示）*/
.main-score-area .label {
    display: block;
    font-size: 14px;
    color: #555;
    margin-bottom: -5px; /* 数字に近づける */
}

/* ★★★ 最も重要なスコアの数字 ★★★ */
.score-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 72px; /* 非常に大きく */
    font-weight: 700;
    color: #ff6600; /* 強いオレンジ色 */
    line-height: 1; /* 行の高さを詰める */
}

/* パーセント記号 */
.unit {
    font-size: 30px;
    color: #ff6600;
    margin-left: -5px; /* 数字に少し重ねる */
}

/* 詳細情報全体のコンテナ */
.details-row {
    display: flex; /* 横並びにする */
    justify-content: space-between; /* 左右に均等に配置 */
    gap: 10px; /* アイテム間の隙間 */
    margin-bottom: 20px;
}

/* 各アイテム (時間/正解数) のスタイル */
.detail-item {
    flex: 1; /* 均等な幅を占める */
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f8f8f8; /* 薄い背景色 */
}

/* ラベル (かかった時間/正解数) のスタイル */
.detail-item .label {
    font-size: 12px;
    color: #777;
    margin: 0 0 5px 0;
}

/* 値 (01:58 や 8/10) のスタイル */
.detail-item .value {
    font-family: 'Orbitron', sans-serif;
    font-size: 20px;
    color: #333;
    font-weight: 700;
    margin: 0;
}

/* モーダルのボタンをまとめるコンテナ */
.modal-buttons {
    display: flex; /* ボタンを横並びにする */
    justify-content: center; /* 中央揃え */
    gap: 15px; /* ボタン間の隙間 */
    margin-top: 25px; /* モーダルコンテンツとの間隔 */
}

/* もう一度挑戦ボタン (既存) */
.retry-button {
    background-color: #0099ff; /* 明るい青 */
    color: white;
    border: none;
    border-radius: 20px;
    padding: 10px 30px;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 0 #0077cc;
    transition: background-color 0.1s;
    outline: none;
}
.retry-button:hover {
    background-color: #0077cc;
}

/* ★新しい「次のステージへ」ボタンのスタイル ★ */
.next-stage-button {
    background-color: #4CAF50; /* 緑色 */
    color: white;
    border: none;
    border-radius: 20px;
    padding: 10px 30px;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 0 #388E3C; /* 立体感を出す */
    transition: background-color 0.1s;
}

.next-stage-button:hover {
    background-color: #388E3C;
}


@media (min-width: 600px) {
  dialog {
    max-width: 50%;
  }
}
