
h1 {
    margin-top: 20px;
    font-size: 2em;
}

#gameContainer {
    width: 832px;
    /*border: 0px solid #ddd;
    border-radius: 15px;*/
    margin: 0 auto;
    /*padding-bottom: 15px;*/
    position: relative;
    font-family: Arial, sans-serif !important;
    /* background-color: #fefefe; */
    /* box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); */
}

#themeSelectorContainer {
    display: flex; /* フレックスボックスを使用 */
    justify-content: center; /* 水平方向に中央揃え */
    align-items: center; /* 垂直方向に中央揃え */
    height: 100%; /* 必要に応じて高さを指定 */
}

#sentenceContainer {
    margin: 20px 0;
    min-height: 154px; /* 3段分の高さを確保 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* はみ出しを防止 */
    position: relative; /* 必要に応じてレイアウト調整 */
}

#sentenceTextContainer {
    text-align:left;
}

.sentence-line {
    font-size: 1.5em; /* 問題文の大きさ */
    font-weight: normal;
    color: #333;
    text-align: left; /* 左揃えに設定 */
    margin: 5px 0;
    overflow: hidden; /* コンテナを超える部分を非表示 */
    white-space: nowrap; /* テキストを1行に収める */
    width: 600px; /* 固定幅 */
    display: block; /* ブロック要素として扱う */
    position: relative; /* スクロールを制御する基点にする */
}


.title-text {
    font-size: 1.2em;
    font-weight: 400;
    color: #444;
    margin: 5px 0;
    text-align: center;
    font-family: 'Arial', sans-serif !important;
}

#titleJapaneseText {
    font-size: 1em;
    font-weight: normal;
}

#titleHiraganaText {
    font-size: 1.8em;
    font-weight: 700;
    color: #e74b3c;
}

#japaneseText {
    font-size: 1.6em;
    font-weight: 700;
    color: #333;
}

#hiraganaText {
    font-size: 1.3em;
    font-weight: normal;
    margin-top: -10px;
    margin-bottom: 20px;
    color: #333;
}

#romajiText {
    font-size: 1.6em;
    font-weight: 400;
    margin-top: 1.6em;
    margin-bottom: 0.5;
    color: #333;
}

#countdownContainer {
    display: none; /* 初期状態は非表示 */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 2; /* 他の要素より前面に表示 */
    padding: 20px 30px;
    border-radius: 10px;
}

#countdownText {
    font-size: 100px;
    font-weight: 600;
    color: #e74b3c;
}

.next-char-error {
    color: #ad002d; /* ミスタイプ時の色 */
}

#keyboardContainer {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px 0 16px;
}

.keyboard-row {
    display: flex;
    justify-content: flex-start;
    margin: 1px 0;
}

.key {
    padding: 10px;
    margin: 2px;
    font-family: 'Arial', 'Helvetica', sans-serif;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    border-radius: 5px;
    border: 1px solid #999;
    color: #333;
    background-color: #ffffff;
    cursor: pointer;
    width: 46px;
}

.key[data-key="shift"], .key[data-key="tab"], .key[data-key="caps"], .key[data-key="ctrl"], .key[data-key="alt"] {
    width: 80px;
}

.key.space-key {
    width: 240px;
}

.key[data-key="\\"] {
    font-family: monospace;
}

.key.active {
    background-color: orange; /* 押下時の色 */
}

.next-key {
    background-color: orange !important; /* ガイドの目立つ色 */
    color: black;
}

.key.key-error {
    background-color: #971313 !important;
    color: black;
}


#scoreContainer {
    display: none;
    margin: 20px 0;
    text-align: center;
}

.score-container h2,
.score-container h3 {
    margin: 20px auto 0px; /* 上下のスペースが必要なら適宜設定 */
    display: block; /* 必要に応じて */
    text-align: center;
}

#startButton {
    padding: 10px 20px;
    font-size: 1em;
    background-color: #9b003f;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#startButton:hover {
    background-color: #b60045;
}

.gray {
    color: gray;
}

.blue {
    color: blue;
}

.black {
    color: black;
}


/* 幽体離脱エフェクト */
.clone {
    position: absolute;
    font-size: 1.6em;
    font-weight: 400;
    color: #333;
    pointer-events: none;
    white-space: nowrap;
    transition: transform 2s ease-out, opacity 2s ease-out;
    transform: translate(0%, -20%);
}

.clone.fade-out {
    transform: translateY(-50px); /* 上に移動 */
    opacity: 0; /* フェードアウト */
    transition: transform 2s ease-out, opacity 2s ease-out;
}

.mistype-fadeout {
    color: red; /* 赤色に変更 */
}



#progressBarContainer {
    width: 610px; /* 固定幅 */
    margin: 0 auto; /* 中央揃え */
    display: flex;
    justify-content: center; /* 子要素の中央揃え */
    margin-bottom: 10px; /* ソフトキーボードとの間隔 */
}

#progressBar {
    height: 4px; /* バーの太さ */
    background-color: gray;
    border-radius: 4px;
    transition: width 1s linear; /* 滑らかな減少 */
}


/* ポップアップバナー画像 */
#gameResultPopup .image-container {
    text-align: center; /* 中央寄せ */
    margin: 16px auto 0px; /* 上下にマージンを設定 */
    width: 296px; /* コンテナの幅に合わせる */
}

#gameResultPopup .image-container img {
    max-width: 100%; /* 幅をポップアップ内に収める */
    height: auto; /* アスペクト比を維持 */
    display: block; /* 余計な余白を排除 */
    margin: 0 auto; /* 中央寄せ */
}

/* ポップアップ全体 */
.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6); /* 背景を半透明の黒に */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.popup-content {
    background: white; /* 背景を白に */
    color: #333;
    font-family: 'Arial', sans-serif !important;
    text-align: center;
    padding: 0 20px 20px;
    border-radius: 10px;
    width: 350px; /* 表示幅の調整 */
    max-width: 90%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* シャドウ効果 */
}

.popup-content {
    margin-bottom: 0.8em;
}

.popup-content h2 {
    margin-top: 1em;
    font-weight: bold;
    display: inline-block;
}

.popup-content .coffee {
    position: relative;
    top: 2px;
    width: 26px;
    height: 26px;
/*    filter: invert(17%) sepia(49%) saturate(420%) hue-rotate(331deg) brightness(93%) contrast(84%); */
}

#selectTheme {
    font-size: 0.9em;
    font-weight: 300;
    margin-top: 0.5em;
    margin-bottom: 0.2em;
}

/* ポップアップの非表示 */
.popup.hidden {
    display: none;
}

/* 閉じるボタンを下に配置 */
.button-container {
    display: flex;
    justify-content: center; /* ボタンを中央揃え */
    align-items: center; /* 縦方向の位置を揃える */
    gap: 10px; /* ボタン間の余白 */
    margin-top: 15px;
}


/* 閉じるボタン */
#closePopupButton {
    margin-top: 0px;
    padding: 10px 20px;
    background-color: #4ca1dd;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

/* 閉じるボタンのホバー時 */
#closePopupButton:hover {
    background-color: #0056b3;
}

/* Bluesky共有ボタン */
#blueskyShareButton {
    margin-top: 0px;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    background-color: #e6e6e6;
    color: #007bff;
    border: none;
    border-radius: 5px;
    margin-left: 10px;
    display: inline-flex;
    align-items: center;
}

#blueskyShareButton svg {
    margin-right: 8px;
}

#blueskyShareButton:hover {
    background-color: #d1d0d0;
}


/* ポップアップ内スコア表 */
.popup-content table {
  margin: 0 auto;
  border-radius: 10px;
  -webkit-border-radius: 4px;
  -moz-border-radius: 10px;
  border: 0.5px solid #999;
  border-spacing: 0;
  overflow: hidden;
  width: 300px;
}
.popup-content td, th {
  border-bottom: 1px solid #999;
  padding: 8px 10px;
}
.popup-content th {
  font-weight: normal;
  font-size: 0.8em;
  background: #EFEFEF;
  text-align: left;
}
.popup-content table tbody tr:last-child th,
.popup-content table tbody tr:last-child td {
  border-bottom: none;
}
.popup-content th {
  width: 190px; 
  color: #333;
}
.popup-content td {
  width: 110px; 
}
/*
.popup-content th + th, td {
  border-left: 1px solid #666;
}
*/
.popup-content td.highlight {
  font-weight: bold;
  color: #027fff; 
  text-align: right; /
}
.popup-content table tr:first-of-type th {
  text-align: center;
  font-weight: bold;
  font-size: 1.1em;
  color: #333;
}
.popup-content table tr:first-of-type th {
  text-align: center;
}

#toggleContainer {
    width: 610px;
    height: 2em;
    background-color: white;
    border: 1px solid gray;
    border-radius: 6px;
    padding: 10px;
    margin: 0 auto 8px; /* 横位置を中央に */
    display: flex;
    justify-content: center;
    align-items: center;
}

#toggleContainer label {
    margin-right: 3px;
    font-size: 0.8em;
    color: #333;
}

#cloneToggle, #soundToggle, #nextKeyGuideToggle {
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin-right: 2em;
}


/* テーマ選択 */
#themeSelector {
    margin-top: 16px;
    padding: 2px 2px 2px 6px;
    width: 250px;
    font-size:0.8em;
    background-color: #fff;
}

#themeSelector:focus {
    outline: none;
}

.themeBox {
    font-size: 1em;
}

.rank-guide {
    width: 800px; /* ランク表と同じ幅 */
    margin: 0 auto 20px; /* 中央揃えで下に余白 */
    text-align: left; /* テキストを左揃え */
    padding: 0px; /* 内側の余白 */
    margin-top: 2em;
    border: none;
    box-sizing: border-box;
    max-width: 100%;
    word-wrap: break-word;
}

.rank-guide h3 {
    font-size: 1.0em; /* 見出しを目立たせる */
    font-weight: bold; /* 太字 */
    color: #ffffff; /* 目立つ色 */
    padding: 4px 0 4px 10px;
    margin-bottom: 10px; /* 下に余白 */
    border-radius: 4px;
    background-color: #9B003F; /* 臙脂色 */
    }

.rank-guide p {
    font-size: 1.0em; /* 通常のテキストサイズ */
    color: #333; /* 落ち着いた色 */
    margin-bottom: 10px; /* テキスト間の余白 */
    padding-left: 10px;
    line-height: 1.6; /* 行間を広げる */
}

/* ランク表のスタイル */
.table-container table {
    border: 1px solid #000; /* 明確な外枠 */
    border-collapse: collapse; /* 枠を結合 */
    width: 100%; /* レイアウトに合わせて調整 */
    margin:0 auto 15px;
 }
  
.table-container th, .table-container td {
    border: 1px solid #000; /* セルの外枠 */
    padding: 8px 16px;
    text-align: left;
}

.table-container table td:first-child,
.table-container table th:first-child {
    font-weight: bold;
}


/* 説明文 */
#instructions {
    margin: 20px auto 30px;
    padding: 0px 20px;
    max-width: 750px;
    border: 5px solid #ddd;
    border-radius: 0px;
    font-family: 'Arial', sans-serif;
}

#instructions h2 {
    font-size: 1.4em;
    font-weight: bold;
    color: #343a40;
    margin-top: 1em;
    margin-bottom: 0.5em;
    text-align: center;
}

#instructions ol {
    margin: 0;
    padding-left: 1.5em;
    color: #495057;
    line-height: 1.8;
}

#instructions ol li {
    margin-bottom: 10px;
    text-indent: 0.3em;
    font-size: 1em;
}

#instructions ol li::marker {
    font-weight: bold;
    font-size: 1.2em;
}

#instructions p {
    margin-top: 15px;
    font-size: 1.2em !important;
    margin-bottom: 0px !important;
    text-align: center;
}

#instructions .small-text {
    font-size: 0.8em !important;
    color: #333;
    margin-top: 0px !important;
    margin-bottom: 2em !important;
    display: block; /* ブロック要素として表示 */
}

#instructions .highlight {
    font-weight: bold;
    color: #007bff;
}

#instructions .current-count {
    font-size: 1.2em;
    font-weight: bold;
    color: #007bff;
}

.game-link {
    display: inline-block;
    margin-left: 10px; /* テキストとの間隔を調整 */
    font-size: 0.7em;
    font-weight: bold;
    color: #007bff;
    text-decoration: none;
    padding: 0px 10px;
    border: 1px solid #007bff;
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s;
}

.game-link:hover {
    background-color: #007bff;
    color: white;
}

#capsLockIndicator {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 8px;
    font-size: 0.8em;
    background-color: #b22d35;
    color: white;
    border-radius: 3px;
    display: none; /* 初期状態は非表示 */
}

/* 画像の親要素を設定 */
img.responsive-image {
    width: 60%; /* PCではフル幅表示 */
    height: auto; /* アスペクト比を維持 */
}

#mobileMessage {
    display: none; /* PCではメッセージを非表示 */
    text-align: center;
    font-size: 1.0em;
    color: #333;
    margin: 20px;
    padding: 10px;
    border: 1px solid #ddd;
    background-color: #f9f9f9;
    border-radius: 5px;
}

/* スマホ向けのスタイル */
@media (max-width: 768px) {
    img.responsive-image {
        width: 100%; /* 親要素の幅に合わせる */
        height: 200px; /* 固定の高さを指定 */
        object-fit: cover; /* 画像を拡大縮小して中央表示 */
        object-position: center; /* 中央寄せ */
    }

    .game-link {
        display: none;
    }

    #gameContainer {
        display: none; /* ゲームコンテナを非表示 */
    }

    #mobileMessage {
        display: block !important; /* メッセージを表示 */
    }
    
    #instructions {
        display: none;
    }

    .table-container {
        overflow-x: auto !important; /* 横スクロールを許可 */
        -webkit-overflow-scrolling: touch; /* スクロールをスムーズに */
    }

    table {
        width: 100%; /* テーブル全体の幅を維持 */
        min-width: 400px; /* 必要に応じて調整 */
    }

    .rank-guide {
        padding: 15px; /* スペースを調整 */
    }

    .rank-guide h3 {
        font-size: 1.2em; /* フォントサイズを縮小 */
    }

    .rank-guide p {
        font-size: 1.0em; /* フォントサイズを縮小 */
    }
}

.scroll-infinity__item--text {
  font-family: Comfortaa,cursive;
  width: calc(500vw / 3);
  font-size: 15rem;
  color: #222;
}
