@media (max-width: 600px) {
    .rectangleContainer {
        margin-top: 8px;
        margin-bottom: 12px;
    }
    .rectangle {
        min-height: 36px;
        font-size: 1.1em;
        padding: 6px 4px;
    }
}
@media (max-width: 600px) {
    .fixedScreen {
        height: 82px;
        padding: 0 20px;
    }
    .title {
        font-size: clamp(2em, 4vw, 2.8em) !important;
        padding: 0;
        margin: 0 auto;
        line-height: 1.1;
        text-align: center;
    }
    .mobileTracker {
        display: none !important;
    }
}
@media (max-width: 1023px) {
    .menuIcon,
    .sideMenu {
        display: none !important;
    }
    .desktopTracker {
        display: flex !important;
        flex-direction: column; /* 縦並びにしてタイトルを下に置く */
        justify-content: center;
        align-items: center; /* 中央寄せ */
        background: none;
        box-shadow: none;
        padding: 0;
        margin: 0 auto 8px auto;
        width: 100vw;
        max-width: 100vw;
        position: static !important;
        z-index: 10;
        overflow-x: hidden; /* 横スクロール不要にする */
        box-sizing: border-box;
    }
    .desktopTracker .trackerNodes {
        display: flex; /* flexにして均等配置 */
        justify-content: space-between; /* 幅に合わせて均等に配置 */
        gap: 0; /* gapは使わず均等配置で収める */
        padding: 0 8px; /* 少し左右余白を持たせる */
        align-items: center;
        background: none;
        position: relative; /* 線を描画するため */
        overflow: visible; /* ポップアップが親で切り取られないようにする */
        width: 100%; /* トラッカー幅に収める */
        box-sizing: border-box;
    }

    /* ノードを線でつなぐ（背景の横線） */
    .desktopTracker .trackerNodes::before {
        content: '';
        position: absolute;
        left: 6vw;
        right: 6vw;
        top: 50%;
        height: 4px; /* 元の細さに戻す */
        background: linear-gradient(90deg, #e6edf9, #d2dff4);
        border-radius: 4px;
        z-index: 1;
    }

    /* mobile title styling is handled by global .mobileTrackerTitle rules later in the file */

    /* Prevent circles from moving upward on press/active */
    .desktopTracker .trackerSlot:active .trackerCircle,
    .desktopTracker .trackerSlot:focus .trackerCircle,
    .desktopTracker .trackerSlot.touching .trackerCircle {
        transform: none !important;
        box-shadow: none !important;
    }

    /* Strong mobile safeguard: prevent any transform on slots/circles during touch/active/hover */
    @media (max-width: 1023px) {
        .desktopTracker .trackerSlot,
        .desktopTracker .trackerCircle,
        .desktopTracker .trackerSlot:active,
        .desktopTracker .trackerCircle:active,
        .desktopTracker .trackerSlot:focus,
        .desktopTracker .trackerCircle:focus {
            transform: none !important;
            transition: none !important;
            box-shadow: none !important;
        }
    }
    .desktopTracker .trackerSlot {
        padding: 0;
        margin: 0;
        background: none;
        border: none;
        min-width: 0; /* 画面内に収めるため縮められるように */
        flex: 1 1 auto; /* 均等に伸縮して配置 */
        flex-direction: column;
        align-items: center;
        justify-content: flex-end;
        box-shadow: none;
    }
    /* ボタンデフォルトスタイルをリセットして丸を綺麗にする */
    .desktopTracker .trackerSlot {
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        background: transparent;
        border: none;
        padding: 0;
        margin: 0;
    }
    .desktopTracker .trackerTitle,
    .desktopTracker .trackerGoalSummary {
        display: none !important;
    }
    /* ホバーは preview（リンクあり） のみ有効にする（色だけ変更、カーソルは変えない） */
    .desktopTracker .trackerSlot {
        cursor: default;
    }
    .desktopTracker .trackerSlot.can-preview .trackerCircle:hover {
        background: #3366cc !important;
        color: #fff !important;
        border-color: #3366cc !important;
        transition: background 0.12s, color 0.12s, border-color 0.12s;
    }

    /* 強めのデスクトップホバースタイル（リンクありノードのみ） */
    @media (min-width: 1024px) {
        .desktopTracker .trackerSlot.can-preview:hover .trackerCircle,
        .desktopTracker .trackerSlot.can-preview:focus-visible .trackerCircle {
            background: #3366cc !important;
            color: #fff !important;
            border-color: #3366cc !important;
            transform: translateY(-6px) scale(1.06) !important;
            box-shadow: 0 10px 26px rgba(51,102,204,0.18) !important;
            transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
        }
        .desktopTracker .trackerSlot:not(.can-preview) .trackerCircle:hover {
            transform: none !important;
            box-shadow: none !important;
            background: inherit !important;
            color: inherit !important;
        }
    }

    /* Debug helper: make mobile tracker title visible border during development (can be removed later) */
    .mobileTrackerTitle {
        outline: none;
    }

    /* debugBadge removed */
    /* 吹き出しポップアップ用スタイル */
    .trackerTitlePopup {
        display: none;
        position: absolute;
        left: 50%;
        top: 120%;
        transform: translateX(-50%);
        background: #fff;
        color: #3366cc;
        font-weight: bold;
        font-size: 1.45em;
        padding: 14px 26px;
        border-radius: 18px;
        box-shadow: 0 8px 22px rgba(51,102,204,0.16);
        white-space: nowrap;
        z-index: 1002;
        border: 1.5px solid #3366cc;
        pointer-events: none;
        opacity: 0;
        cursor: default;
        transition: opacity 0.18s, transform 0.12s;
    }
    .trackerSlot.show-title-popup .trackerTitlePopup {
        display: block !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        cursor: pointer;
        transform: translateX(-50%) translateY(0) !important;
        top: 110% !important;
    }
    /* ゴール（6）のヒント表示を吹き出し内で出す */
    .trackerSlot.show-title-popup .trackerGoalSummary {
        display: block !important;
        position: absolute;
        left: 50%;
        top: 170%;
        transform: translateX(-50%);
        background: #f8f9fa;
        color: #202122;
        font-weight: 600;
        font-size: 1.05em;
        padding: 12px 16px;
        border-radius: 12px;
        box-shadow: 0 6px 16px rgba(0,0,0,0.08);
        z-index: 1001;
        /* 画面幅の約70%に収める */
        width: 70vw;
        max-width: 70vw;
        white-space: normal;
        text-align: center;
    }
    .desktopTracker .trackerSlot {
        position: relative;
        z-index: 2; /* 線の上に表示 */
    }
    /* Fixed-size circles to avoid viewport-driven resizing (devtools / vw issues) */
    .desktopTracker .trackerCircle {
        width: 48px;
        height: 48px;
        font-size: 16px;
        line-height: 48px;
        border-width: 3px;
        border-radius: 50%;
        background: #fff;
        color: #bbb;
        border-color: #bbb;
        margin: 0;
        box-shadow: none;
        font-weight: 400;
        transition: all 0.18s;
        display: inline-block;
        box-sizing: border-box;
        text-align: center;
    }

    /* Slightly larger circles for narrow screens, but still fixed to prevent runaway scaling */
    @media (max-width: 600px) {
        .desktopTracker .trackerCircle {
            width: 56px;
            height: 56px;
            font-size: 18px;
            line-height: 56px;
        }
    }

    /* 強制的に正方形表示にして楕円化を防止 */
    .desktopTracker .trackerCircle {
        display: block;
        box-sizing: border-box;
        text-align: center;
        margin-left: auto;
        margin-right: auto;
    }

    /* 0と6を黒塗り・白字で強調 */
    .desktopTracker .trackerSlot[data-index="0"] .trackerCircle,
    .desktopTracker .trackerSlot[data-index="6"] .trackerCircle {
        background: #000 !important;
        color: #fff !important;
        border-color: #000 !important;
    }
    .desktopTracker .trackerCircle.current {
        border-color: #3366cc;
        color: #3366cc;
        background: #eaf3ff;
        font-weight: 700;
        z-index: 2;
    }
    .desktopTracker .trackerCircle.edge {
        background: #f3f3f3;
        color: #bbb;
        border-color: #bbb;
    }
}
/* --- スマホ用省略版トラッカー --- */
.mobileTracker {
    display: none !important;
    font-size: 1.1em;
    font-weight: bold;
    color: #202122;
    background: #eaf3ff;
    border-radius: 16px;
    padding: 4px 16px;
    margin: 8px auto 0;
    width: fit-content;
    pointer-events: auto !important;
    z-index: 1001;
    position: static !important;
}

@media (max-width: 1023px) {
    .mobileTracker {
        display: none !important;
        position: relative;
        z-index: 1001;
    }
    /* .desktopTrackerは常時表示にするためdisplay:none!importantを削除 */
}
/* body 全体の基本スタイルを Wikipedia に近づける */
body {
    background-color: #f8f9fa;
    /* Wikipediaの記事背景色 (body 全体) */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans JP', sans-serif;
    /* Wikipediaの基本フォント (sans-serif) */
    line-height: 1.6;
    color: #202122;
    /* Wikipediaのテキスト色 (body 全体) */
    margin: 0;
    /* body のデフォルト margin をリセット */
    padding: 0;
    /* body のデフォルト padding をリセット */
    padding-top: 110px; /* .fixedScreenの高さ分の隙間を作成 */
}

.fixedScreen {
    position: fixed; /* 画面に固定 */
    width: 100%;
    top: 0;
    left: 0;
    height: 82px;
    padding: 0 20px;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #F8F9FA;
    z-index: 1000; /* 他の要素より前面に表示 */
    border-bottom: none;
}

.fixedScreen hr {
    display: none;
}

.modeBar {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f8f9fa;
    padding: 10px 0;
    margin-top: 8px;
    border-bottom: 1px solid #eaecf0;
}

.modeBar a {
    margin: 0 15px;
    text-decoration: none;
    color: #202122;
    font-size: 0.9em;
    font-weight: bold;
    font-family: 'Zen Maru Gothic', sans-serif;
    padding: 8px 12px;
    border: 1px solid #a2a9b1;
    background-color: #fff;
    transition: all 0.3s ease;
}

.modeBar a:hover {
    background-color: #202122;
    color: white;
    border: 1px solid #202122;
}

.modeBar a.active {
    background-color: #202122;
    color: white;
    border: 1px solid #202122;
}

.title {
    font-size: clamp(2em, 4vw, 2.8em);
    margin: 0;
    color: black;
    position: static;
    transform: none;
    white-space: nowrap; /* 改行を防ぐ */
    line-height: 1.1;
}

.titleUnderline {
    border-bottom: 2px solid #202122;
    width: 100%;
    position: absolute;
    left: 0;
    bottom: 0;
}

.startBlock {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 56px;
    font-size: 5vh;
    width: 40vw;
    margin: 0 auto;
    font-weight: bold;
    border: 2px solid #202122; /* 外枠の色を追加 */
    background-color: #fff;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.1s ease;
}

.startBlock:hover {
    background-color: #202122;
    color: #f2f8f2;
    cursor: pointer;
}

.startBlock:active {
    transform: translateY(1px);
}

.rectangleContainer {
    position: relative; /* 親要素を相対位置に設定 */
    display: flex;
    justify-content: center;
    margin-bottom: 50px;
    margin-top: 30px; /* 隙間を少し詰める */
    font-weight: bold;
    flex-direction: column; /* 縦並びにする */
}

.rectangle {
    width: min(60vw, 900px);
    min-height: 60px;
    font-size: 1.5em;
    margin: 8px auto; /* 縦並びの間隔を調整し、中央揃え */
    border: 1px solid #a2a9b1;
    background-color: white;
    display: flex;
    justify-content: center;    
    align-items: center;
    font-family: 'Zen Maru Gothic', sans-serif;
    white-space: normal;
    word-wrap: break-word;  /* 長い文字列を折り返す */
    text-align: center;
    padding: 10px;
    position: relative; /* 子要素を絶対位置に設定するため */
}

.rectangle.roulette-stop-flash {
    animation: roulette-stop-flash 280ms ease-out;
}

@keyframes roulette-stop-flash {
    0% {
        border-color: #3366cc;
        background-color: #eaf3ff;
        box-shadow: 0 0 0 0 rgba(51, 102, 204, 0.35);
    }

    65% {
        border-color: #3366cc;
        background-color: #eaf3ff;
        box-shadow: 0 0 0 6px rgba(51, 102, 204, 0.08);
    }

    100% {
        border-color: #a2a9b1;
        background-color: #fff;
        box-shadow: 0 0 0 0 rgba(51, 102, 204, 0);
    }
}

.rectangleLabel {
    font-family: 'Zen Maru Gothic', sans-serif;
    font-size: 1em;
    text-align: center;
    margin-bottom: 2px; /* 距離を詰める */
    color: #54595d;
}

.rectangleLabel.first {
    margin-bottom: 2px; /* 距離を詰める */
}

.rectangleLabel.second {
    margin-top: 10px; /* 隙間を開ける */
    margin-bottom: 2px; /* 距離を詰める */
}

@media (max-width: 600px) {
    .rectangleContainer {
        flex-direction: column; /* 縦並びにする */
    }

    .rectangle {
        width: 85vw; /* 横幅を画面の90%にする */
        height: 6.5vh; /* 縦幅を現状の3分の2にする */
        font-size: 1.5em; /* フォントサイズを調整 */
    }

    .startBlock {
        width: 90vw; /* 横幅を画面いっぱいにする */
    }

    .logo {
        display: none; /* ロゴを非表示にする */
    }
}

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

.buttonContainer.roulette {
    margin-top: 0;
}

.button {
    color: #f2f8f2;
    border: none;
    padding: 10px 20px;
    margin: 0 10px;
    cursor: pointer;
    font-size: 2vh;
}

.button.retry, .button.confirm {
    width: 40vw;
    min-height: 56px;
    color: black;
    font-size: 1.5em;
    font-family: 'Zen Maru Gothic', sans-serif;
    border: 1px solid #a2a9b1;
    background-color: #fff;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.button.confirm.final-stop {
    background-color: #000;
    color: #fff;
    border-color: #000;
}

.button.confirm.primary-action {
    background-color: #000;
    color: #fff;
    border-color: #000;
}

.buttonContainer.roulette.decision-phase .button.retry {
    opacity: 1;
    background-color: #fff;
    color: #000;
    border-color: #a2a9b1;
}

.buttonContainer.roulette.decision-phase .button.retry:hover {
    opacity: 1;
    background-color: #000;
    color: #fff;
    border-color: #000;
}

.button:hover {
    background-color: #202122;
    color: white;
    border-color: #202122;
}

@media (max-width: 600px) {
    .buttonContainer {
        display: flex;
        justify-content: space-between;
    }

    .buttonContainer.roulette {
        justify-content: center;
        /* switch to flex to allow large gaps */
        display: flex;
        gap: 50vw; /* ノード間隔を現在の5倍相当に大きくする */
        padding: 0 6vw;
        align-items: center;
        background: none;
        width: max-content; /* 内容幅に合わせて伸ばす */
        justify-content: center;
    }

    .button.retry, .button.confirm {
        width: 50%; /* 画面を2分割し、隙間を作らない */
        margin: 1; /* 隙間をなくす */
    }
    .buttonContainer.roulette .button.retry,
    .buttonContainer.roulette .button.confirm {
        width: 44vw;
        min-width: 88px; /* 最低幅を確保して間隔が効くようにする */
        margin: 0;
    }

    .buttonContainer.roulette.single-stop .button.confirm {
        width: 72vw;
        max-width: 360px;
    }

    .button:hover {
        background-color: #f2f8f2;;
        color: black;
    }
}

@media (max-width: 600px) {
    .title {
        font-size: 2.5em; /* フォントサイズを調整 */
        white-space: nowrap; /* 改行を防ぐ */
        overflow: hidden;
        overflow-x: auto; /* 横スクロールを有効にする */
        -webkit-overflow-scrolling: touch; /* スムーズスクロールを有効にする */
    }
}

@media (max-width: 600px) {
    body {
        overscroll-behavior: none; /* スワイプしてリロードする動作を無効化 */
    }
    html {
        overscroll-behavior: none; /* スワイプしてリロードする動作を無効化 */
    }
}

@media (max-width: 600px) {
    .button:hover {
        background-color: initial; /* ホバー時の背景色を元に戻す */
        color: initial; /* ホバー時の文字色を元に戻す */
    }
}

/* Mobile button layout overrides to ensure center alignment and reasonable gaps */
@media (max-width: 600px) {
    .buttonContainer {
        justify-content: center !important;
        padding: 0 8px !important;
        box-sizing: border-box;
    }
    .buttonContainer.roulette {
        gap: clamp(8px, 6vw, 20px) !important;
        width: 100% !important;
        padding: 0 8px !important;
        justify-content: center !important;
        flex-wrap: nowrap !important;
        overflow: visible !important;
    }
    .buttonContainer .button {
        flex: 0 0 auto !important;
        width: clamp(88px, 28vw, 220px) !important;
        margin: 0 !important;
    }
}

/* Ensure buttons inside buttonContainer do not use auto margins that push siblings */
@media (max-width: 600px) {
    .buttonContainer .button {
        flex: none !important;
        margin: 0 6px !important;
    }
    .buttonContainer.roulette .button.confirm {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    .buttonContainer.roulette {
        justify-content: center !important;
        gap: 6vw !important;
    }
}

.wikiBlock {
    font-family: sans-serif;
    /* wikiBlock 内も sans-serif に統一 */
    line-height: 1.6;
    color: #333;
    /* wikiBlock 内も #333 に統一 */
    background-color: #f8f9fa;
    /* Wikipediaの記事背景色 (wikiBlock) */
    border: 1px solid #eaecf0;
    /* bodyの背景色と同様の外枠色 */
    padding: 1em;
    /* padding を 1em に */
    margin: 20px auto;
    width: min(80%, 980px);
    overflow-wrap: break-word;
    overflow-x: hidden;
}

.wikiBlock:empty {
    display: none;
}

.wiki-static-text {
    color: #333;
    cursor: default;
    text-decoration: none;
}

.wikiBlock.loaded {
    background-color: #fff;
    /* 記事読み込み後の背景色 (変更なし) */
    border-color: #c8ccd1;
    /* 記事読み込み後の外枠色 */
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

/* 見出しスタイル (h2, h3, h4...) を Wikipedia に近づける */
.wikiBlock h2 {
    font-size: 1.5em;
    border-bottom: 1px solid #a2a9b1;
    /* Wikipedia の h2 下線 */
    padding-bottom: 0.3em;
    margin-top: 1em;
    margin-bottom: 0.5em;
    line-height: 1.2;
    /* 行間を少し狭く */
}

.wikiBlock h3 {
    font-size: 1.3em;
    border-bottom: 1px solid #a2a9b1;
    /* Wikipedia の h3 下線 (必要に応じて) */
    padding-bottom: 0.2em;
    margin-top: 1em;
    margin-bottom: 0.5em;
    line-height: 1.2;
}

.wikiBlock h4 {
    font-size: 1.1em;
    font-weight: bold;
    /* Wikipedia の h4 は bold */
    margin-top: 1em;
    margin-bottom: 0.5em;
}

/* 必要に応じて h5, h6 スタイルも追加 */

.wikiBlock p {
    margin-bottom: 0.8em;
}

.wikiBlock a {
    color: #0645ad;
    /* Wikipedia のリンク色 */
    text-decoration: none;
    border-bottom: 1px solid transparent;
    /* ホバー時のボーダー用 */
}

.wikiBlock a:hover {
    color: #0b0080;
    /* Wikipedia のホバー時リンク色 */
    border-bottom: 1px solid #0645ad;
    /* Wikipedia のホバー時ボーダー */
}

/* リスト (ul, ol) スタイルを Wikipedia に近づける */
.wikiBlock ul,
.wikiBlock ol {
    margin-left: 1.5em;
    /* 左インデント */
    margin-bottom: 0.5em;
    list-style-type: disc;
    /* ul のリストマーカーを disc (●) に */
}

.wikiBlock ol {
    list-style-type: decimal;
    /* ol のリストマーカーを decimal (1, 2, 3...) に */
}

.wikiBlock li {
    margin-bottom: 0.3em;
}

/* テーブル (table.wikitable) スタイルを Wikipedia に近づける (調整) */
.wikiBlock table.wikitable {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid #c8ccd1;
    border-collapse: collapse;
    margin: 1em 0;
    font-size: 0.9em;
    background-color: #f8f9fa;
    /* テーブル背景色を記事背景色に合わせる */
}

.wikiBlock table.wikitable th,
.wikiBlock table.wikitable td {
    border: 1px solid #c8ccd1;
    padding: 0.3em 0.5em;
}

.wikiBlock table.wikitable th {
    background-color: #f2f2f2;
    /* th の背景色を Wikipedia に合わせる */
    font-weight: bold;
    text-align: center;
}

/* 画像 (img) スタイル (調整) */
.wikiBlock img {
    max-width: 100%;
    height: auto;
    border: none;
    vertical-align: middle;
}

/* Wikipediaの代表画像を含む情報ボックスを、本文を圧迫しない形で残す */
.wikiBlock .infobox {
    float: right;
    clear: right;
    width: min(320px, 40%);
    max-width: 100%;
    margin: 0 0 1.25em 1.5em;
    border: 1px solid #c8ccd1;
    border-collapse: collapse;
    background: #f8f9fa;
    font-size: 0.9em;
}

.wikiBlock .infobox th,
.wikiBlock .infobox td {
    padding: 0.35em 0.5em;
    vertical-align: top;
}

.wikiBlock figure,
.wikiBlock .thumb,
.wikiBlock .thumbinner {
    max-width: 100%;
    box-sizing: border-box;
}

.wikiBlock figure,
.wikiBlock .thumb {
    margin: 1.25em auto;
}

.wikiBlock figure img,
.wikiBlock .thumb img,
.wikiBlock .infobox img {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.wikiBlock figcaption,
.wikiBlock .thumbcaption {
    margin-top: 0.4em;
    color: #54595d;
    font-size: 0.86em;
    line-height: 1.45;
}

@media (max-width: 700px) {
    .wikiBlock .infobox {
        float: none;
        width: 100%;
        margin: 1em 0 1.25em;
    }
}

/* 水平線 (hr) スタイル (追加) */
.wikiBlock hr {
    border: 0;
    border-top: 1px solid #a2a9b1;
    /* Wikipedia の hr 色 */
    margin: 1em 0;
}

/* 引用 (blockquote) スタイル (追加) */
.wikiBlock blockquote {
    border: 1px solid #a2a9b1;
    /* 引用符のボーダー */
    background-color: #f8f9fa;
    /* 引用符の背景色 */
    padding: 0.5em 1em;
    margin: 1em 0;
    font-style: italic;
    /* 斜体 */
}

/* 定義リスト (dl, dt, dd) スタイル (追加 - 必要に応じて) */
.wikiBlock dl {
    margin-bottom: 0.5em;
}

.wikiBlock dt {
    font-weight: bold;
    margin-top: 0.5em;
}

.wikiBlock dd {
    margin-bottom: 0.8em;
}

.menuIcon {
    font-size: 3vh;
    cursor: pointer;
    width: 50px;
    height: 44px;
    margin-left: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #a2a9b1;
    background-color: #fff;
}

.sideMenu {
    position: fixed;
    top: 0;
    left: 0;
    width: min(90vw, 340px);
    height: 100%;
    background-color: white; /* 背景色を白に変更 */
    color: black; /* 文字色を黒に変更 */
    padding: 20px;
    box-shadow: 2px 0 12px rgba(0,0,0,0.2);
    z-index: 1001;
    overflow-y: auto;
    border: 1px solid black; /* 外枠を1pxの黒に設定 */
}

@media (min-width: 1024px) {
    .sideMenu {
        width: 420px;
    }
    
}

.sideMenu h2 {
    font-size: 2vh; /* フォントサイズを入れ替え */
    margin-top: 0;
    margin-bottom: 10px; /* 隙間を追加 */
}

.history {
    margin-top: 10px; /* 隙間を詰める */
    font-size: 2vh;
    margin-bottom: 10px; /* 目標記事との間に隙間を追加 */
}

.history div {
    cursor: pointer;
    color: black; /* 文字色を黒に変更 */
    text-decoration: none; /* 下線を削除 */
    background-color: white; /* 背景色を白に変更 */
    min-height: 48px;
    padding: 8px 10px;
    margin-bottom: 10px; /* 隙間を追加 */
    font-size: 2vh; /* フォントサイズを調整 */
    border: 1px solid #a2a9b1;
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history div.active {
    background-color: #ede9d0; /* 現在表示されている記事の背景色 */
}

.history div::before {
    content: attr(data-index) ". "; /* 項番を追加 */
}

.history div:hover {
    background-color: black; /* ホバー時の背景色を黒に変更 */
    color: white; /* ホバー時の文字色を白に変更 */
}

.history div.disabled {
    pointer-events: none; /* クリックを無効にする */
    opacity: 0.5; /* 見た目を薄くする */
}

.closeMenu {
    font-size: 2.5vh; /* フォントサイズを調整 */
    color: black; /* 文字色を黒に変更 */
    cursor: pointer;
    text-align: center; /* テキストを中央揃え */
    margin-bottom: 10px;
    background-color: white; /* 背景色を白に変更 */
    padding: 10px 0; /* 上下のパディングを追加 */
    width: 100%; /* 横幅をハンバーガーメニューと同じにする */
    border: 1px solid #a2a9b1;
}

.closeMenu:hover {
    background-color: black; /* ホバー時の背景色を黒に変更 */
    color: white; /* ホバー時の文字色を白に変更 */
}

.menuHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px; /* 隙間を追加 */
}

.menuHeader h2, .closeMenu {
    font-size: 2.5vh; /* フォントサイズを入れ替え */
    margin: 0;
}

.goalTitle {
    color: black; /* 文字色を黒に変更 */
    text-decoration: none; /* 下線を削除 */
    background-color: white; /* 背景色を白に変更 */
    min-height: 48px;
    padding: 8px 10px;
    margin-bottom: 10px; /* 隙間を追加 */
    font-size: 2vh; /* フォントサイズを調整 */
    border: 1px solid #a2a9b1;
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.goalSummary {
    display: none; /* 初期状態では非表示 */
    font-size: 2vh;
    color: black; /* 文字色を黒に変更 */
    margin-top: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal; /* 折り返しを有効にする */
    max-width: 100%;
    margin-bottom: 100px; /* ホームに戻るとの間に隙間を追加 */
    background-color: white; /* 背景色を白に変更 */
}

.homeLink {
    background-color: white; /* 背景色を白に変更 */
    color: black; /* 文字色を黒に変更 */
    cursor: pointer;
    text-decoration: none; /* 下線を削除 */
    height: 10vh;
    margin-top: 20px;
    padding: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 2vh; /* フォントサイズを調整 */
    font-weight: bold; /* フォントウェイトを調整 */
    border: 1px solid #a2a9b1;
}

.homeLink:hover {
    background-color: black; /* ホバー時の背景色を黒に変更 */
    color: white; /* ホバー時の文字色を白に変更 */
}

.shareLink, .wikiBlockShareLink {
    color: black !important;
    text-decoration: none;
    font-size: 2vh;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.shareLink:hover, .wikiBlockShareLink:hover {
    color: white !important; /* ホバー時の文字色を白に変更 */
}

.shareLogo {
    width: 20px;
    height: 20px;
    margin-right: 10px;
}

.shareButton:hover .shareLogo, .wikiBlockShareLink:hover .shareLogo {
    filter: invert(1); /* ホバー時に色を反転 */
}

.shareButton {
    cursor: pointer; /* クリック可能であることを示す */
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 10vh;
    background-color: white;
    border: 1px solid #a2a9b1;
    text-align: center;
    line-height: 10vh;
    margin-top: 10px;
    color: black;
}

.shareButton:hover {
    background-color: black;
    color: white;
}

.shareButton:hover .shareLink {
    color: white !important; /* マウスホバー時にテキストを白に変更 */
}

.aboutLink {
    display: none;
}

.challengeIntro {
    width: min(80vw, 820px);
    margin: 8px auto 10px;
    padding: 18px 20px;
    box-sizing: border-box;
    border: none;
    background-color: #f8f9fa;
    color: #202122;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.6;
    font-size: 1.42em;
    font-family: 'Zen Maru Gothic', sans-serif;
}

.challengeIntroWord {
    font-size: 1.3em;
}

.challengeIntroText {
    display: inline-block;
    text-align: center;
}

@media (max-width: 600px) {
    .challengeIntro {
        width: 90vw;
        margin-top: 4px;
        margin-bottom: 8px;
        padding: 16px;
        font-size: 1.16em;
    }
}

.challenge .rectangleContainer {
    margin-top: 4px;
    margin-bottom: 8px;
}

.challenge .rectangleContainer.prestart {
    visibility: hidden;
    pointer-events: none;
}

.aboutLink a {
    color: black;
    text-decoration: none;
    font-size: 2vh;
}

.aboutLink a:hover {
    text-decoration: underline;
}

.logo {
    display: none; /* ロゴを非表示にする */
}

.hintBlock {
    background-color: white; /* 背景色を白に変更 */
    color: black; /* 文字色を黒に変更 */
    padding: 3px;
    text-align: center;
    cursor: pointer;
    margin-top: 10px;
    margin-bottom: 10px;
    font-size: 2vh; /* フォントサイズを調整 */
    font-weight: bold; /* フォントウェイトを調整 */
    border: 1px solid #a2a9b1;
}

.hintBlock:hover {
    background-color: black; /* ホバー時の背景色を黒に変更 */
    color: white; /* ホバー時の文字色を白に変更 */
}

.continueButton {
    border: 1px solid #a2a9b1;
    color: black;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    margin-top: 20px;
    font-size: 2vh;
    font-weight: bold;
}

.continueButton:hover {
    background-color: black;
    color: white;
}

.continuedArticle {
    padding: 5px;
    margin-bottom: 10px;
    font-size: 2vh;
    cursor: pointer;
    border: 1px solid #a2a9b1;
}

.continuedArticle:hover {
    background-color: black;
    color: white;
}

.title, .startBlock, .menuIcon, .sideMenu, .homeLink, .hintBlock, .goalTitle, .goalSummary, .shareButton, .shareLink, .continueButton, .continuedArticle {
    font-family: 'Zen Maru Gothic', sans-serif;
    font-weight: normal; /* フォントウェイトを標準に戻す */
}

.progressBar {
    position: absolute; /* fixedからabsoluteに変更 */
    top: 0; /* fixedScreenの最上部に配置 */
    left: 0;
    width: 100%;
    height: 4px;
    background-color: #eaecf0;
    z-index: 1002; /* fixedScreenより前面に表示 */
}

.progressBar .progress {
    height: 100%;
    width: 0;
    background-color: #3366cc;
    transition: width 0.3s ease;
}

.titleContainer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100% - 2px);
    transform: none;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.desktopTracker {
    display: block;
}

@media (min-width: 1024px) {
    body {
        padding-top: 118px;
    }

    .challengeIntro {
        font-size: 2.6em;
    }

    .challenge .challengeIntro {
        font-size: 2.2em;
        line-height: 1.35;
        margin-top: 2px;
        margin-bottom: 4px;
        padding: 10px 16px;
    }

    .challenge .rectangleContainer {
        margin-top: 0;
        margin-bottom: 2px;
    }

    .challenge .rectangleLabel {
        font-size: 0.92em;
        margin-top: 4px;
        margin-bottom: 0;
    }

    .challenge .rectangle {
        min-height: 48px;
        font-size: 1.25em;
        padding: 6px 10px;
        margin: 4px auto;
    }

    .fixedScreen {
        height: 108px;
    }

    .modeBar {
        margin-top: 0;
        padding: 8px 0;
    }

    .rectangleContainer {
        margin-top: 18px;
        margin-bottom: 24px;
    }

    .startBlock {
        margin-top: 0;
    }

    .challenge .startBlock,
    .challenge .buttonContainer,
    .challenge .buttonContainer.roulette {
        transform: translateY(-16px);
    }

    .aboutLink {
        margin-top: 6px;
    }

    .menuIcon,
    .sideMenu {
        display: none !important;
    }

    .desktopTracker.active {
        position: absolute;
        inset: 8px 16px 10px 16px;
        display: block;
    }

    .trackerNodes {
        position: relative;
        display: grid;
        grid-template-columns: repeat(7, minmax(0, 1fr));
        gap: 6px;
        align-items: start;
    }

    .trackerNodes::before {
        content: '';
        position: absolute;
        left: calc((100% / 14));
        right: calc((100% / 14));
        top: 16px;
        border-top: 1px solid #a2a9b1;
        z-index: 0;
    }

    .trackerSlot {
        border: none;
        background: transparent;
        margin: 0;
        padding: 0;
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        position: relative;
        cursor: pointer;
    }

    .trackerSlot:disabled {
        cursor: default;
    }

    .trackerCircle {
        position: relative;
        z-index: 1;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        border: 1px solid #a2a9b1;
        background-color: #fff;
        color: #202122;
        font-size: 14px;
        line-height: 32px;
        text-align: center;
        font-weight: 600;
    }

    .trackerCircle.edge {
        background-color: #202122;
        color: #fff;
        border-color: #202122;
    }

    .trackerCircle.current {
        box-shadow: none;
        border-color: #3366cc;
        background-color: #eaf3ff;
        color: #202122;
    }

    .trackerTitle {
        max-width: 100%;
        min-height: 14px;
        font-size: 11px;
        color: #54595d;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        text-align: center;
        transition: all 0.16s ease;
    }

    .trackerSlot.filled .trackerTitle {
        color: #202122;
        font-weight: 600;
    }

    .trackerSlot.can-preview.overflow-preview:hover .trackerTitle,
    .trackerSlot.can-preview.overflow-preview:focus-visible .trackerTitle {
        position: absolute;
        top: 30px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 3;
        min-width: 110px;
        max-width: 220px;
        padding: 6px 8px;
        border: 1px solid #a2a9b1;
        background-color: #fff;
        color: #202122;
        white-space: normal;
        line-height: 1.25;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    }

    .trackerGoalSummary {
        display: none;
    }

    .trackerSlot.goal-preview.has-goal-summary:hover .trackerGoalSummary,
    .trackerSlot.goal-preview.has-goal-summary:focus-visible .trackerGoalSummary {
        display: block;
        position: absolute;
        top: 32px;
        left: auto;
        right: 0;
        transform: none;
        z-index: 4;
        width: min(28vw, 320px);
        max-height: 140px;
        padding: 8px 10px;
        border: 1px solid #a2a9b1;
        background-color: #fff;
        color: #202122;
        font-size: 12px;
        line-height: 1.35;
        text-align: left;
        overflow: auto;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
}

.loadingBar {
    width: 100%;
    height: 4px;
    margin: 8px 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #eaecf0 25%, #c8ccd1 50%, #eaecf0 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 1s linear infinite;
}

.title .loadingBar {
    width: 80px;
    display: inline-block;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes loading-shimmer {
    from {
        background-position: 200% 0;
    }

    to {
        background-position: -200% 0;
    }
}

.startBlock,
.button,
.menuIcon,
.closeMenu,
.homeLink,
.hintBlock,
.history div,
.shareButton,
.continueButton,
.continuedArticle,
.modeBar a {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.startBlock:focus-visible,
.button:focus-visible,
.menuIcon:focus-visible,
.closeMenu:focus-visible,
.homeLink:focus-visible,
.hintBlock:focus-visible,
.history div:focus-visible,
.shareLink:focus-visible,
.continueButton:focus-visible,
.continuedArticle:focus-visible,
.modeBar a:focus-visible,
.wikiBlock a:focus-visible {
    outline: 2px solid #3366cc;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

.dropdownMenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: white; /* 背景色を白に設定 */
    border: 1px solid black;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1100; /* アンダーラインよりも高い値に設定 */
    min-width: 375px; /* 横幅を現行の2.5倍程度に設定 */
    text-align: center;
    padding: 10px 0; /* 上下の余白を追加 */
}

.dropdownMenu a {
    display: block;
    padding: 10px;
    color: black;
    text-decoration: none;
    font-size: 1em;
}

.dropdownMenu a:hover {
    background-color: black;
    color: white;
}

.titleContainer:hover .dropdownMenu {
    display: block;
}

/* 最終上書き: デスクトップ（幅 >=1024px）でのみホバー効果を必ず適用する */
@media (min-width: 1024px) {
    /* Desktop: only change color for previewable nodes (exclude data-index=6) */
    .desktopTracker .trackerSlot.can-preview:not([data-index="6"]):hover .trackerCircle,
    .desktopTracker .trackerSlot.can-preview:not([data-index="6"]):focus-visible .trackerCircle {
        background: #3366cc !important;
        color: #fff !important;
        border-color: #3366cc !important;
        transition: background 0.12s, color 0.12s, border-color 0.12s;
    }
    /* Ensure non-preview or 6 do not change */
    .desktopTracker .trackerSlot:not(.can-preview):hover .trackerCircle,
    .desktopTracker .trackerSlot[data-index="6"]:hover .trackerCircle {
        background: inherit !important;
        color: inherit !important;
    }
}

/* Final safeguard: force index 6 and non-preview nodes to keep base appearance even if other rules apply */
.desktopTracker .trackerSlot[data-index="6"] .trackerCircle,
.desktopTracker .trackerSlot:not(.can-preview) .trackerCircle {
    background: #fff !important;
    color: #bbb !important;
    border-color: #bbb !important;
}
.desktopTracker .trackerSlot[data-index="6"]:hover .trackerCircle,
.desktopTracker .trackerSlot:not(.can-preview):hover .trackerCircle {
    background: #fff !important;
    color: #bbb !important;
    border-color: #bbb !important;
}

/* Strong mobile overrides to ensure buttons are wide enough and no horizontal scroll occurs */
@media (max-width: 600px) {
    .buttonContainer.roulette {
        gap: 12px !important;
        justify-content: center !important;
        padding: 0 10px !important;
        overflow-x: hidden !important;
    }
    .buttonContainer .button {
        min-width: 140px !important;
        width: clamp(160px, 40vw, 260px) !important;
        box-sizing: border-box !important;
    }
    .buttonContainer.roulette .button.confirm {
        /* ensure confirm doesn't push siblings */
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

/* 最終上書き：challenge ページ上でさらに強制する */
@media (max-width: 600px) {
    body.challenge .buttonContainer .button {
        min-width: 160px !important;
        width: clamp(160px, 42vw, 280px) !important;
    }
}

/* 最終上書き：トラッカー内の丸はマウスカーソルを変更しない（ポインタにしない） */
.desktopTracker .trackerSlot {
    cursor: default !important;
}
.desktopTracker .trackerSlot .trackerCircle {
    cursor: default !important;
}

/* ただし、色が変わる（リンクありでかつ6でない）ノードはポインタを表示する */
.desktopTracker .trackerSlot.can-preview:not([data-index="6"]) .trackerCircle {
    cursor: pointer !important;
}

/* Daily landing: reuse the existing monochrome/blue visual language. */
.dailyInitial .challengeIntro {
    display: none;
}

.dailyTopic,
.modeHeading {
    position: relative;
    width: min(80vw, 820px);
    margin: 8px auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-family: 'Zen Maru Gothic', sans-serif;
    color: #202122;
    font-size: clamp(1.2rem, 2.2vw, 1.65rem);
    line-height: 1.45;
}

.modeHeading {
    padding: 3px 0;
}

.resultModeBadge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 999px;
    background: #3366cc;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.dailyDatePicker {
    position: relative;
    display: inline-flex;
    z-index: 20;
}

.dailyDate {
    position: relative;
    appearance: none;
    padding: 2px 5px 3px;
    border: 0;
    border-bottom: 1px solid transparent;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.dailyDate:hover,
.dailyDate:focus-visible,
.dailyDate[aria-expanded="true"] {
    color: #3366cc;
    border-bottom-color: #3366cc;
    outline: none;
}

.dailyArchive {
    position: absolute;
    top: calc(100% + 9px);
    left: 50%;
    width: min(420px, calc(100vw - 24px));
    max-height: min(480px, 62vh);
    overflow-y: auto;
    transform: translateX(-50%);
    border: 1px solid #a2a9b1;
    background: #fff;
    box-shadow: 0 8px 24px rgba(32, 33, 34, 0.16);
    text-align: left;
    z-index: 1200;
}

.dailyArchiveHeading {
    position: sticky;
    top: 0;
    padding: 11px 14px;
    border-bottom: 1px solid #eaecf0;
    background: #f8f9fa;
    color: #54595d;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    z-index: 20;
}

.dailyArchiveItem {
    width: 100%;
    padding: 10px 14px;
    display: grid;
    grid-template-columns: minmax(92px, auto) 1fr;
    gap: 12px;
    align-items: center;
    border: 0;
    border-bottom: 1px solid #eaecf0;
    background: #fff;
    color: #202122;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.dailyArchiveItem:last-child {
    border-bottom: 0;
}

.dailyArchiveItem time {
    color: #54595d;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.dailyArchivePair {
    min-width: 0;
    font-size: 0.86rem;
    line-height: 1.35;
}

.dailyArchiveItem:hover,
.dailyArchiveItem:focus-visible {
    background: #f1f5ff;
    outline: none;
}

.dailyArchiveItem.selected {
    box-shadow: inset 4px 0 0 #3366cc;
    background: #eaf3ff;
}

.dailyArchiveItem.selected time {
    color: #3366cc;
}

.randomModeButton {
    position: absolute;
    right: 20px;
    width: 68px;
    height: 68px;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 5px;
    border: 1px solid #a2a9b1;
    border-radius: 0;
    background: #fff;
    color: #54595d;
    text-decoration: none;
    cursor: pointer;
    font-family: 'Zen Maru Gothic', sans-serif;
    font-size: 0.72rem;
    line-height: 1.25;
    white-space: nowrap;
    overflow-wrap: normal;
    pointer-events: auto;
    z-index: 20;
    transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.customModeButton {
    position: absolute;
    right: 94px;
    width: 68px;
    height: 68px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 5px;
    border: 1px solid #a2a9b1;
    border-radius: 0;
    background: #fff;
    color: #54595d;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    font-family: 'Zen Maru Gothic', sans-serif;
    font-size: 0.72rem;
    line-height: 1.25;
    white-space: nowrap;
    overflow-wrap: normal;
    pointer-events: auto;
    z-index: 20;
    transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.randomModeButton.nav-left {
    right: 94px;
}

.customModeButton.nav-right {
    right: 20px;
}

.customModeButton:hover,
.customModeButton:focus-visible,
.customModeButton.active {
    color: #fff;
    border-color: #000;
    background: #000;
    outline: none;
}

.customModePanel {
    width: calc(min(60vw, 900px) + 22px);
    min-height: 260px;
    margin: 4px auto 8px;
}

.modeHeading[hidden] {
    display: none;
}

.customArticleField {
    position: relative;
    margin-bottom: 8px;
}

.customArticleField:last-child {
    margin-bottom: 8px;
}

.customArticleField label {
    display: block;
    margin-bottom: 2px;
    font-family: 'Zen Maru Gothic', sans-serif;
    font-weight: bold;
    color: #54595d;
    text-align: center;
}

.customArticleInput {
    width: 100%;
    min-height: 60px;
    box-sizing: border-box;
    padding: 10px 14px;
    border: 1px solid #a2a9b1;
    border-radius: 0;
    background: #fff;
    color: #202122;
    font: 1.1rem 'Noto Sans JP', sans-serif;
    text-align: center;
}

.customArticleInput:focus {
    border-color: #3366cc;
    outline: 2px solid #3366cc;
    outline-offset: 1px;
}

.customSuggestions {
    position: static;
    z-index: 20;
    max-height: 260px;
    margin-top: 2px;
    overflow-y: auto;
    border: 1px solid #a2a9b1;
    background: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.14);
}

.customSuggestions[hidden],
.customModePanel[hidden] {
    display: none;
}

.customSuggestion {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border: 0;
    border-bottom: 1px solid #eaecf0;
    background: #fff;
    color: #202122;
    cursor: pointer;
    font: 1rem 'Noto Sans JP', sans-serif;
    text-align: left;
}

.customSuggestion:last-child {
    border-bottom: 0;
}

.customSuggestion:hover,
.customSuggestion:focus-visible {
    background: #eaf3ff;
    outline: none;
}

.startBlock.is-disabled {
    opacity: 0.48;
    cursor: not-allowed;
    background-color: #f8f9fa;
    color: #72777d;
    pointer-events: none;
}

.startBlock.is-disabled:hover {
    cursor: not-allowed;
    background-color: #f8f9fa;
    color: #72777d;
}

.customActions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.customActions .startBlock {
    margin: 0 auto;
}

.customShareButton {
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(90vw, 240px);
    min-height: 44px;
    box-sizing: border-box;
    border: 1px solid #202122;
    background: #202122;
    color: #fff;
    font-family: 'Zen Maru Gothic', sans-serif;
    text-decoration: none;
}

.customShareButton:hover,
.customShareButton:focus-visible {
    background: #404244;
    outline: 2px solid #3366cc;
    outline-offset: 2px;
}

.customShareButton[hidden] {
    display: none;
}

.randomModeButton:hover,
.randomModeButton:focus-visible {
    color: #fff;
    border-color: #000;
    background: #000;
    outline: none;
}

.randomShortLabel {
    display: none;
}

.resultModeSummary {
    width: min(90%, 680px);
    min-height: 156px;
    margin: 36px auto;
    padding: 14px 18px;
    box-sizing: border-box;
    border: 1px solid #a2a9b1;
    background: linear-gradient(120deg, #f8fafc 0%, #8e9cac 30%, #ffffff 55%, #b9c4cf 78%, #f8fafc 100%);
    background-size: 400% 400%;
    color: #202122;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    font-family: 'Zen Maru Gothic', sans-serif;
    animation: hopsGradient 6s ease-in-out infinite alternate;
}

.resultModeSummary strong {
    font-size: 3.75rem;
}

.resultActions {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 10px;
    width: min(90%, 680px);
    margin: 36px auto 0;
}

.wikiBlock .shareButton,
.kofiButton {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    height: auto;
    margin: 0;
    padding: 14px 28px;
    flex: 1 1 0;
    border: 1px solid #222;
    border-radius: 0;
    background: #fff;
    color: #222;
    font-weight: bold;
    line-height: normal;
    text-decoration: none;
    white-space: nowrap;
    transition: 0.2s;
}

.wikiBlock .shareButton {
    width: auto;
    padding: 0;
}

.wikiBlock .shareLink {
    font-size: inherit;
    width: 100%;
    height: 100%;
    padding: 14px 28px;
    box-sizing: border-box;
}

.wikiBlock .shareButton:hover,
.kofiButton:hover {
    background: #222;
    color: #fff;
}

.wikiBlock .shareButton:hover .shareLink {
    color: #fff !important;
}

.wikiBlock .kofiButton,
.wikiBlock .kofiButton:visited {
    background: #fff;
    border: 1px solid #222;
    color: #222;
    gap: 8px;
}

.wikiBlock .kofiButton:hover {
    background: #222;
    color: #fff;
    border-bottom-color: #222;
}

.kofiSymbol {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.wikiBlock .kofiButton:hover .kofiSymbol {
    filter: invert(1);
}

@keyframes hopsGradient {
    from {
        background-position: 0% 50%;
    }
    to {
        background-position: 100% 50%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .resultModeSummary {
        animation: none;
    }
}

@media (max-width: 600px) {
    .resultActions {
        flex-direction: column;
        align-items: stretch;
    }
}

.resultModeBadge.random {
    background: #54595d;
}

@media (min-width: 1024px) {
    .dailyTopic,
    .modeHeading {
        margin-top: 14px;
        margin-bottom: 22px;
    }

    .dailyInitial .rectangleContainer,
    .randomInitial .rectangleContainer {
        margin-top: 0;
        margin-bottom: 28px;
    }

    .dailyInitial .rectangleLabel.first,
    .randomInitial .rectangleLabel.first {
        margin-bottom: 6px;
    }

    .dailyInitial .rectangleLabel.second,
    .randomInitial .rectangleLabel.second {
        margin-top: 18px;
        margin-bottom: 6px;
    }

    .dailyInitial .rectangle,
    .randomInitial .rectangle {
        margin-top: 0;
        margin-bottom: 0;
    }

    .dailyInitial .startBlock {
        transform: none;
    }

    .customInitial .startBlock {
        transform: none;
    }

    .customModePanel {
        min-height: 204px;
        margin-top: 0;
        margin-bottom: 28px;
    }

    .challenge.randomInitial .buttonContainer.roulette {
        transform: none;
    }
}

@media (max-width: 600px) {
    .dailyTopic,
    .modeHeading {
        width: 90vw;
        margin-top: 14px;
        margin-bottom: 20px;
        font-size: 1.1rem;
    }

    .customModePanel {
        min-height: 257px;
        margin-top: 0;
        margin-bottom: 24px;
    }

    .dailyArchiveItem {
        grid-template-columns: 1fr;
        gap: 3px;
        padding: 10px 12px;
    }

    .dailyInitial .rectangleContainer,
    .randomInitial .rectangleContainer {
        margin-top: 0;
        margin-bottom: 24px;
    }

    .dailyInitial .rectangleLabel.first,
    .randomInitial .rectangleLabel.first {
        margin-bottom: 6px;
    }

    .dailyInitial .rectangleLabel.second,
    .randomInitial .rectangleLabel.second {
        margin-top: 16px;
        margin-bottom: 6px;
    }

    .dailyInitial .rectangle,
    .randomInitial .rectangle {
        margin-top: 0;
        margin-bottom: 0;
    }

    .randomModeButton {
        right: 8px;
        width: 44px;
        height: 44px;
        padding: 4px;
        font-size: 0.5rem;
        line-height: 1;
        letter-spacing: 0.02em;
        white-space: nowrap;
    }

    .customModeButton {
        right: 58px;
        width: 44px;
        height: 44px;
        padding: 4px;
        font-size: 0.5rem;
        line-height: 1;
        letter-spacing: 0.02em;
        white-space: nowrap;
    }

    .randomModeButton.nav-left {
        right: 58px;
    }

    .customModeButton.nav-right {
        right: 8px;
    }

    .customModePanel {
        width: calc(85vw + 22px);
        margin-top: 4px;
        margin-bottom: 8px;
    }

    .customArticleField {
        margin-bottom: 4px;
    }

    .customArticleField label {
        margin-bottom: 0;
        font-size: 0.92em;
    }

    .customArticleInput {
        min-height: 48px;
        font-size: 1rem;
    }

    .randomLongLabel {
        display: none;
    }

    .randomShortLabel {
        display: inline;
    }

    .resultModeSummary {
        gap: 9px;
        padding: 12px;
    }
}

/* ルーレットの進行ボタンはDailyと同じ白黒に統一する */
.button.confirm.final-stop,
.button.confirm.primary-action,
.button.confirm.final-stop:hover,
.button.confirm.primary-action:hover {
    background-color: #000;
    color: #fff;
    border-color: #000;
}

/* Ensure mobileTrackerTitle is usable when moved outside .desktopTracker
   (renderDesktopTracker moves the element before .wikiBlock). Keep it
   above the article content and allow JS to show/hide it. */
.mobileTrackerTitle {
    display: none; /* JS controls visibility via .show() / .hide() */
    position: relative;
    margin-top: 24px;
    margin-bottom: -36px; /* overlap the following article */
    width: calc(100% - 40px);
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    background: #fff;
    color: #202122;
    border-radius: 10px;
    padding: 10px 12px;
    border: 1px solid #a2a9b1;
    text-align: left;
    font-weight: 600;
    z-index: 11010; /* above most page content but below debug badge */
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
    white-space: normal; /* allow wrapping */
    overflow: visible; /* allow child to expand the block */
    text-overflow: unset;
    box-sizing: border-box;
}
.mobileTrackerTitle.clickable { cursor: pointer; color: #3366cc; }

/* Floating variant: overlay the viewport under the fixed header */
@media (max-width: 1023px) {
    .mobileTrackerTitle.floating {
        position: fixed !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        top: calc(var(--fixed-header-height, 82px) + 8px) !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        width: calc(100% - 40px) !important;
        z-index: 12000 !important;
        box-shadow: 0 6px 20px rgba(0,0,0,0.12) !important;
        white-space: normal !important;
        max-height: none !important;
    }
}

/* Number badge and title inside the mobile title block */
.mobileTrackerTitle .num {
    display: inline-flex;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    margin-right: 10px;
    flex: 0 0 36px;
    font-size: 16px;
}
.mobileTrackerTitle .num.edge { background: #000; }
.mobileTrackerTitle .num.blue { background: #3366cc; }
.mobileTrackerTitle .num.edge { color: #fff !important; background: #000 !important; }
.mobileTrackerTitle .num.blue { color: #fff !important; background: #3366cc !important; }

.mobileTrackerTitle .mobileGoalSummary {
    margin-top: 8px;
    background: #f8f9fa;
    color: #202122;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid #d6dbe1;
    font-size: 0.95em;
    line-height: 1.4;
    text-align: left;
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: break-word;
}
.mobileTrackerTitle .titleText {
    display: inline-block;
    vertical-align: middle;
    max-width: calc(100% - 56px);
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    color: inherit;
}
