@import url('https://fonts.googleapis.com/css2?family=Dela+Gothic+One&family=M+PLUS+Rounded+1c:wght@400;700;800&display=swap');
@import url('https://fonts.googleapis.com/css?family=Lato');

:root {
    --pink: oklch(62% 0.20 32);
    --cyan: oklch(58% 0.18 265);
    --yellow: oklch(78% 0.16 72);
    --purple: oklch(60% 0.18 300);
    --green: oklch(70% 0.18 155);
    --bg: #0d0d0d;
    --card: #161616;
    --border: #2c2c2c;
    --text: #e8e4dc;
    --muted: #666;
    --bar-top: 48px;
    --bar-toolbar: 0px;
    --toolbar-h: 46px;
    --bar-bottom: 100px;
    --bar-answer-log: 180px;
    --bar-player-list: 160px;
    /* Light (paper / sunny arcade) */
    --bg-base: #f4ead5;
    --bg-deep: #ead9b4;
    --ink: #1a1a1a;
    --ink-soft: #2b2b2b;
    --halftone: rgba(26, 26, 26, 0.18);
    --paper-noise: rgba(120, 80, 40, 0.06);
    --pop-red: #e63946;
    --pop-blue: #1d4ed8;
    --pop-yellow: #facc15;
    --pop-pink: #ff6b9d;
    --film-strip: #111111;
    --film-hole: #0d0d0d;
    --pixel-1: #e63946;
    --pixel-2: #1d4ed8;
    --pixel-3: #16a34a;
    --pixel-4: #facc15;
    --glow: transparent;
    --panel-border: #1a1a1a;
    --speed-line: rgba(26, 26, 26, 0.55);
    --shadow-offset: 6px 6px 0 var(--ink);
    --main--widht: 1150px;
}

/* ライトモード */
:root.light {
    --pink: oklch(55% 0.20 32);
    --cyan: oklch(46% 0.20 265);
    --yellow: oklch(62% 0.18 72);
    --purple: oklch(52% 0.18 300);
    --green: oklch(55% 0.18 155);
    --bg: #f5f0e8;
    --card: #ffffff;
    --border: #ddd6c8;
    --text: #1a1a1a;
    --muted: #999;
    --film-strip: #e8e0d4;
    --film-hole: #f5f0e8;
}

[data-theme="dark"] {
    /* Dark (arcade at midnight) */
    --bg-base: #0d0d0d;
    --bg-deep: #0a0a0a;
    --ink: #f5f3e7;
    --ink-soft: #d6d2bf;
    --halftone: rgba(255, 255, 255, 0.08);
    --paper-noise: rgba(255, 255, 255, 0.03);
    --pop-red: #ff2e63;
    --pop-blue: #00e0ff;
    --pop-yellow: #fff04d;
    --pop-pink: #ff6ec7;
    --film-strip: #1a1a1a;
    --film-hole: #0d0d0d;
    --pixel-1: #ff2e63;
    --pixel-2: #00e0ff;
    --pixel-3: oklch(72% 0.20 140);
    --pixel-4: #fff04d;
    --glow: 0 0 12px currentColor;
    --panel-border: #f5f3e7;
    --speed-line: rgba(245, 243, 231, 0.6);
    --shadow-offset: 6px 6px 0 var(--pop-pink);
}

*,
*:before,
*:after {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

html {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    font-size: 62.5%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'M PLUS Rounded 1c', sans-serif;
    margin: 0;
    padding: 0;
    transition: background .25s, color .25s;
}

/* グリッド背景 */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.25;
    pointer-events: none;
    z-index: 0;
}

.wrapper {
    max-width: var(--main--widht);
    height: 100vh;
    position: relative;
    margin: 0 auto;
}

/* ========== トップヘッダー ========== */
#top-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: var(--bar-top);
    background: var(--card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 8px;
    z-index: 20;
    box-sizing: border-box;
}

/* 背景デザイン */
.bg-halftone {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: radial-gradient(var(--halftone) 1.6px, transparent 1.8px);
    background-size: 14px 14px;
    background-position: 0 0;
    mask-image: radial-gradient(ellipse at 30% 20%, black 0%, black 40%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at 30% 20%, black 0%, black 40%, transparent 75%);
}

.bg-halftone.bottom-right {
    mask-image: radial-gradient(ellipse at 80% 90%, black 0%, black 35%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at 80% 90%, black 0%, black 35%, transparent 70%);
    background-size: 10px 10px;
    opacity: 0.7;
}

/* ========== ボタン共通 ========== */
.btn,
span.btn,
button.btn {
    font-size: 1.4rem;
    font-weight: 800;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    line-height: 1.5;
    position: relative;
    display: inline-block;
    padding: .8rem 2.4rem;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s;
    text-align: center;
    vertical-align: middle;
    text-decoration: none;
    letter-spacing: .05em;
    border-radius: 4px;
}

/* ========== Settingボタン ========== */
span.btn-flat {
    overflow: hidden;
    position: relative;
    padding: .6rem 1.2rem;
    color: #e8e4dc;
    border-radius: 4px;
    background: var(--card);
    border: 1px solid var(--border);
    display: inline-block;
    font-size: 1.4rem;
}

span.btn-flat span {
    position: relative;
    z-index: 1;
}

span.btn-flat:before {
    position: absolute;
    top: 0;
    left: calc(-100% + 10px);
    width: 100%;
    height: 100%;
    content: '';
    transition: all .4s ease-in-out;
    background: var(--purple);
}

span.btn-flat:after {
    position: absolute;
    top: 0;
    right: calc(-100% + 10px);
    width: 100%;
    height: 100%;
    content: '';
    transition: all .4s ease-in-out;
    background: var(--purple);
}

span.btn-flat:hover:before {
    transform: translateX(50%);
}

span.btn-flat:hover:after {
    transform: translateX(-50%);
}

/* ========== ゲームボタン（次の問題等） ========== */
.btn-game {
    background: var(--cyan);
    color: #000;
    border: none;
    border-radius: 4px;
    box-shadow: 0 3px 14px oklch(58% 0.18 265 / 0.25);
    transition: transform .15s, filter .15s, box-shadow .15s;
}

.btn-game:hover {
    transform: translateY(-2px);
    filter: brightness(1.12);
    box-shadow: 0 6px 22px oklch(58% 0.18 265 / 0.45);
}

.btn-game:active {
    transform: scale(.97);
    filter: brightness(0.95);
    box-shadow: 0 2px 8px oklch(58% 0.18 265 / 0.18);
}

span.btn-border {
    border: 2px solid var(--border);
    background: var(--card);
    color: #ccc;
    border-radius: 4px;
    transition: all .2s;
}

span.btn-border:hover {
    color: #fff;
    border-color: var(--cyan);
    background: oklch(58% 0.18 265 / 0.10);
    box-shadow: none;
}

/* ========== 回答ボタン（回答バー内） ========== */
.btn-answer.btn-gradient {
    font-weight: 800;
    color: #fff;
    border-radius: 4px;
    background: var(--pink);
    box-shadow: none;
    border: none;
    padding: 1.6rem 2rem;
    flex-shrink: 0;
}

.btn-answer.btn-gradient:after {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    content: "";
    transition: opacity .3s;
    border-radius: 4px;
    background: var(--pink);
    opacity: 0;
}

.btn-answer.btn-gradient span {
    position: relative;
    z-index: 1;
}

.btn-answer.btn-gradient:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: none;
}

.btn-answer.btn-gradient:hover:after {
    opacity: 1;
}

/* ========== リプレイボタン ========== */
.btn-replay.btn-gradient {
    display: none;
    color: #000;
    border-radius: 4px;
    background: var(--green);
    box-shadow: none;
    border: none;
    font-weight: 800;
    transition: all .2s;
}

.btn-replay.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: none;
}

/* ========== 再生停止ボタン ========== */
.playStop {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 6px 12px;
    margin-top: 6px;
    margin-left: 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all .2s;
    color: #ccc;
    font-size: 1.3rem;
    font-weight: 700;
    z-index: 10;
    position: relative;
}

.playStop:hover {
    border-color: var(--yellow);
    color: var(--yellow);
    box-shadow: 0 0 12px oklch(78% 0.16 72 / 0.19);
}

.video_play_pause {
    display: inline-block;
    position: relative;
    width: 26px;
    height: 26px;
    border: 3px solid currentColor;
    border-radius: 50%;
    font-size: 200px;
    vertical-align: middle;
    pointer-events: none;
}

.video_play_pause>input {
    display: none;
}

.playStop:not(.stop) .video_play_pause>input+span::before {
    position: absolute;
    top: 50%;
    left: 32%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border: 7px solid transparent;
    border-left: 12px solid currentColor;
    content: "";
}

.playStop.stop .video_play_pause>input+span::before,
.playStop.stop .video_play_pause>input+span::after {
    position: absolute;
    top: 50%;
    transform: translateX(-50%) translateY(-50%);
    width: 3px;
    height: 12px;
    background-color: currentColor;
    content: "";
}

.playStop.stop .video_play_pause>input+span::before {
    left: 35%;
}

.playStop.stop .video_play_pause>input+span::after {
    left: 65%;
}

/* ========== ゲームモードラジオ ========== */
.gamemode-button {
    box-sizing: border-box;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: #666;
    font-size: 1.2rem;
    padding: 5px 10px;
}

.gamemode-button span {
    position: relative;
    padding-left: 24px;
}

.gamemode-button span:hover {
    color: #fff;
}

input[type=radio] {
    display: none;
}

input[type=radio]:checked~label {
    color: var(--cyan);
}

.gamemode-button input[type=radio]+label::before {
    display: block;
    position: absolute;
    content: '';
    border-radius: 100%;
    height: 16px;
    width: 16px;
    top: 0;
    left: 0;
    transition: border-color .2s;
    border: 3px solid #444;
}

.gamemode-button input[type=radio]:checked+label::before {
    border: 3px solid var(--cyan);
}

.gamemode-button input[type=radio]:checked+label::after {
    display: block;
    position: absolute;
    content: '';
    border-radius: 100%;
    height: 6px;
    width: 6px;
    top: 5px;
    left: 5px;
    border: 3px solid var(--cyan);
}

/* ========== 参加者パネル（右側縦並び） ========== */
#player-list {
    position: absolute;
    right: 0;
    top: var(--bar-top);
    width: var(--bar-player-list);
    height: calc(100vh - var(--bar-top) - var(--bar-bottom));
    background: var(--card);
    border-left: 1px solid var(--border);
    padding: 8px 6px;
    box-sizing: border-box;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

#player-list::-webkit-scrollbar {
    width: 4px;
}

#player-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 999px;
}

#player-list>p {
    display: none;
}

#game-tagline {
    display: flex;
    align-items: center;
    gap: 10px;
    position: absolute;
    top: var(--bar-top);
    font-size: 3.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text-muted, #888);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0.7;
}

#question-num {
    position: relative;
    display: none;
    font-size: 1.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--cyan);
    background: oklch(58% 0.18 265 / 0.12);
    border: 1px solid oklch(58% 0.18 265 / 0.30);
    border-radius: 999px;
    padding: 2px 10px;
    white-space: nowrap;
    text-align: center;
    margin-bottom: 6px;
    flex-shrink: 0;
}

#question-num.active {
    display: block;
}

#player-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}

#player-items li {
    padding: 6px 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 1.1rem;
    color: #fff;
    flex-shrink: 0;
    transition: border-color .2s, background .2s;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    width: 100%;
    min-width: unset;
    max-width: unset;
}

/* プレイヤー名省略 */
#player-items li .player-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
    min-width: 0;
}

/* スコア行 */
#player-items li .player-scores {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 3px;
    width: 100%;
}

#player-items li:hover {
    border-color: #3a3a5e;
}

#player-items li.just-correct {
    border-color: var(--green);
    background: oklch(70% 0.18 155 / 0.05);
}

.correct-badge {
    display: inline-block;
    font-size: 1rem;
    font-weight: 800;
    color: var(--green);
    background: oklch(70% 0.18 155 / 0.13);
    border: 1px solid var(--green);
    border-radius: 999px;
    padding: 1px 8px;
}

#player-items .score {
    display: flex;
    gap: 8px;
    font-size: 1.2rem;
}

#player-items .score-correct {
    color: var(--green);
}

#player-items .score-wrong {
    color: var(--pink);
}

/* ========== ホスト操作ツールバー ========== */
#host-toolbar,
#dummy-bar {
    margin-top: var(--bar-top);
    padding: 6px 12px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 9;
    height: var(--bar-toolbar);
    width: calc(100%);
    position: absolute;
}

/* ========== メインコンテナ ========== */
#container {
    display: flex;
    align-items: flex-start;
    position: relative;
    margin-top: var(--bar-top);
    margin-bottom: 30px;
    width: calc(100% - var(--bar-answer-log) - var(--bar-player-list));
    /* height: calc(100% - var(--bar-top) - var(--bar-toolbar) - var(--bar-bottom) - 85px); */
}

#container img {
    position: relative;
}

#container.answer img#sample01 {
    right: 0;
    left: unset;
}

#sample01,
canvas {
    position: relative;
    display: inline-block;
    left: 0;
    top: 5px;
    object-position: bottom;
}

#sample01 {
    z-index: -1;
    opacity: 0;
    width: 100%;
    max-width: 49%;
    max-height: calc(100vh - var(--bar-top) - var(--bar-toolbar) - var(--bar-bottom) - 160px);
}

canvas {
    z-index: 2;
}

#container.answer #sample01 {
    z-index: 3;
    opacity: 1;
}

#sample01 {
    width: 100%;
    max-width: 49%;
    height: calc(100vh - var(--bar-top) - var(--bar-toolbar) - var(--bar-bottom) - 160px);
    object-fit: contain;
    object-position: top;
}

#origin {
    position: absolute;
    visibility: hidden;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* ========== スライダー ========== */
.range-box {
    position: relative;
    display: block;
    width: 687px;
}

#slider {
    -webkit-appearance: none;
    appearance: none;
    width: 700px;
    left: -6px;
    position: relative;
    height: 6px;
    background: var(--cyan);
    border-radius: 999px;
    outline: none;
    cursor: pointer;
}

#slider::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 999px;
    background: var(--border);
}

#slider::-moz-range-track {
    height: 6px;
    border-radius: 999px;
    background: var(--border);
    border: none;
}

#slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--cyan);
    border: 2px solid #fff;
    margin-top: -6px;
    box-shadow: none;
    transition: transform .15s, box-shadow .15s;
}

#slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--cyan);
    border: 2px solid #fff;
    box-shadow: none;
    transition: transform .15s, box-shadow .15s;
}

#slider:hover::-webkit-slider-thumb {
    transform: scale(1.2);
    box-shadow: 0 0 16px var(--cyan)90;
}

#slider:hover::-moz-range-thumb {
    transform: scale(1.2);
    box-shadow: 0 0 16px var(--cyan)90;
}

#slider:disabled {
    opacity: .35;
    cursor: not-allowed;
    filter: grayscale(1);
    pointer-events: none;
}

#slider:disabled::-webkit-slider-thumb {
    background: #555;
    border-color: #333;
    box-shadow: none;
}

#slider:disabled::-moz-range-thumb {
    background: #555;
    border-color: #333;
    box-shadow: none;
}

.answer-border {
    display: none;
    border-right: 3px solid var(--pink);
    position: absolute;
    left: 0;
    z-index: 1;
    height: 20px;
}

.answer+.range-box .answer-border {
    display: block;
}

/* ========== 正解ポイント ========== */
.answer-point {
    display: none;
}

.answer .answer-point {
    display: block;
    z-index: 12;
    font-family: 'Dela Gothic One', sans-serif;
    font-size: 36px;
    top: 72%;
    left: 40%;
    transform: translate(-50%, 0);
    background: var(--yellow);
    color: #000;
    width: 200px;
    text-align: center;
    position: fixed;
    border-radius: 6px;
    box-shadow: 0 0 30px oklch(78% 0.16 72 / 0.38);
    padding: 4px 0;
}

/* ========== 設定パネル ========== */
.textbox {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: #fff;
    padding: 6px 10px;
    font-size: 1.3rem;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    width: 80px;
    margin-left: 8px;
}

iframe {
    width: 100%;
    margin-top: 12px;
    border-radius: 4px;
}

/* ========== 下部: 回答バー（常時表示） ========== */
#answer-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bar-bottom);
    background: var(--card);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 10px;
    z-index: 30;
}

/* answer-modal: 回答バー内のインライン要素に変更 */
#answer-modal {
    display: none;
    position: static;
    transform: none;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    z-index: auto;
    text-align: left;
    box-shadow: none;
    width: auto;
    flex: 1;
    align-items: stretch;
    gap: 8px;
    max-width: 750px;
}

#answer-input {
    flex: 1;
    padding: 8px 14px;
    font-size: 2.4rem;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: #fff;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

#answer-input:focus {
    border-color: var(--pink);
    box-shadow: 0 0 0 3px oklch(62% 0.20 32 / 0.13);
}

#answer-submit {
    padding: 8px 20px;
    font-size: 1.3rem;
    font-weight: 800;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    background: var(--pink);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    box-shadow: none;
    white-space: nowrap;
    flex-shrink: 0;
}

#answer-submit:hover {
    transform: translateY(-1px);
    box-shadow: none;
}

#answer-error {
    color: var(--pink);
    font-size: 1.1rem;
    margin: 0;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ========== モーダル共通（回答中・正解・不正解） ========== */
#answering-modal,
#correct-modal,
#wrong-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--card);
    border-radius: 8px;
    padding: 28px;
    z-index: 200;
    text-align: center;
}

/* ========== 回答中モーダル ========== */
#answering-modal {
    border: 1px solid var(--border);
    padding: 24px 40px;
}

#answering-text {
    color: #aaa;
    font-size: 1.4rem;
    margin: 0;
}

/* ========== 正解モーダル ========== */
#correct-modal {
    border: 1px solid var(--yellow);
    box-shadow: 0 0 50px oklch(78% 0.16 72 / 0.19);
    min-width: 320px;
    position: fixed;
}

#correct-modal .correct-title {
    color: var(--yellow);
    font-family: 'Dela Gothic One', sans-serif;
    font-size: 3.2rem;
    margin: 0 0 8px;
    text-shadow: 0 0 20px oklch(78% 0.16 72 / 0.50);
}

#correct-winner {
    color: #aaa;
    font-size: 1.3rem;
    margin: 0 0 12px;
}

#correct-title {
    color: #fff;
    font-size: 2rem;
    font-weight: 800;
    margin: 0 0 8px;
}

#correct-description {
    color: #888;
    font-size: 1.2rem;
    margin: 0 0 16px;
    line-height: 1.6;
}

#correct-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: #555;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    transition: color .2s;
}

#correct-close:hover {
    color: #fff;
}

#correct-affiliate {
    display: inline-block;
    padding: 10px 24px;
    background: oklch(68% 0.17 55);
    color: #fff;
    border-radius: 5px;
    text-decoration: none;
    font-size: 1.3rem;
    font-weight: 800;
    transition: transform .15s, box-shadow .15s;
    box-shadow: 0 4px 16px oklch(68% 0.17 55 / 0.25);
}

#correct-affiliate:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px oklch(68% 0.17 55 / 0.38);
}

#correct-igdb {
    display: inline-block;
    margin-left: 10px;
    padding: 10px 24px;
    background: #9147ff;
    color: #fff;
    border-radius: 5px;
    text-decoration: none;
    font-size: 1.3rem;
    font-weight: 800;
    transition: transform .15s, box-shadow .15s;
    box-shadow: 0 4px 16px rgba(145, 71, 255, 0.25);
}

#correct-igdb:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(145, 71, 255, 0.38);
}

/* ========== 不正解モーダル ========== */
#wrong-modal {
    border: 1px solid var(--pink);
    box-shadow: 0 0 40px oklch(62% 0.20 32 / 0.19);
    min-width: 320px;
}

#wrong-modal .wrong-title {
    color: var(--pink);
    font-family: 'Dela Gothic One', sans-serif;
    font-size: 3.2rem;
    margin: 0 0 8px;
    text-shadow: 0 0 20px oklch(62% 0.20 32 / 0.38);
}

#wrong-modal .wrong-answer-text {
    color: #fff;
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 8px;
    padding: 8px 16px;
    background: var(--bg);
    border-radius: 4px;
    display: inline-block;
    border: 1px solid var(--border);
}

#wrong-modal .wrong-name {
    color: #888;
    font-size: 1.2rem;
    margin: 0 0 16px;
}

#wrong-countdown {
    font-family: 'Dela Gothic One', sans-serif;
    font-size: 5.6rem;
    color: var(--pink);
    margin: 0 0 16px;
    text-shadow: 0 0 20px oklch(62% 0.20 32 / 0.38);
    line-height: 1;
}

#wrong-bar-wrap {
    width: 100%;
    height: 6px;
    background: var(--card);
    border-radius: 999px;
    overflow: hidden;
}

#wrong-bar {
    height: 100%;
    width: 100%;
    background: var(--pink);
    border-radius: 999px;
}

/* ========== 歯車ボタン ========== */
#open-settings-btn {
    padding: .5rem 1rem;
    font-size: 1.4rem;
}

/* ========== アニメーション ========== */
@keyframes slideIn {
    0% {
        transform: translateX(500px);
        opacity: 0;
    }

    40%,
    80% {
        transform: translateX(0);
        opacity: 1;
    }

    100% {}
}

/* ========== ゲーム設定モーダル ========== */
#game-setup-modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
}

#game-setup-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .75);
    backdrop-filter: blur(4px);
    z-index: 90;
}

#game-setup-panel {
    top: 12%;
    left: 40%;
    transform: translate(-50%);
    position: fixed;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 32px;
    width: 520px;
    max-width: 95vw;
    box-shadow: 0 0 60px oklch(62% 0.20 32 / 0.13), 0 0 100px oklch(58% 0.18 265 / 0.06);
    z-index: 100;
}

.setup-header {
    margin-bottom: 28px;
}

.setup-badge {
    display: inline-block;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: .18em;
    color: var(--yellow);
    border: 1px solid var(--yellow);
    border-radius: 999px;
    padding: 2px 12px;
    margin-bottom: 10px;
}

.setup-title {
    font-family: 'Dela Gothic One', sans-serif;
    font-size: 2.8rem;
    color: var(--pink);
    margin: 0;
}

.setup-section {
    margin-bottom: 24px;
}

.setup-label {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: .12em;
    color: #888;
    text-transform: uppercase;
    margin: 0 0 10px;
}

.setup-options {
    display: flex;
    gap: 10px;
}

.setup-option {
    flex: 1;
    cursor: pointer;
}

.setup-option input[type=radio] {
    display: none;
}

.setup-option-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 10px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 6px;
    transition: all .2s;
    text-align: center;
}

.setup-option-icon {
    font-size: 2.2rem;
    line-height: 1;
}

.setup-option-name {
    font-size: 1.3rem;
    font-weight: 800;
    color: #ccc;
}

.setup-option-desc {
    font-size: 1.1rem;
    color: #555;
    line-height: 1.4;
}

.setup-option input[type=radio]:checked+.setup-option-card {
    border-color: var(--cyan);
    background: oklch(58% 0.18 265 / 0.05);
    box-shadow: inset 0 0 0 2px var(--cyan);
}

.setup-option input[type=radio]:checked+.setup-option-card .setup-option-name {
    color: var(--cyan);
}

.setup-option-card:hover {
    border-color: #3a3a5e;
}

/* ========== 速度設定 ========== */
.speed-settings {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

.speed-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.speed-label {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--cyan);
    width: 100px;
    flex-shrink: 0;
}

.speed-input {
    width: 90px;
    padding: 6px 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 1.3rem;
    text-align: right;
}

.speed-input:focus {
    outline: none;
    border-color: var(--cyan);
}

.speed-unit {
    font-size: 1.2rem;
    color: var(--muted);
}

#win-count-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    transition: opacity .2s;
}

#win-count-wrap.hidden {
    opacity: 0;
    pointer-events: none;
}

.win-count-label {
    font-size: 1.4rem;
    font-weight: 700;
    color: #aaa;
}

#win-count-input {
    width: 64px;
    padding: 6px 10px;
    font-size: 1.6rem;
    font-weight: 800;
    font-family: 'Dela Gothic One', sans-serif;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--yellow);
    text-align: center;
    outline: none;
    transition: border-color .2s;
}

#win-count-input:focus {
    border-color: var(--yellow);
    box-shadow: 0 0 0 3px oklch(78% 0.16 72 / 0.10);
}

/* ========== ゲーム開始ボタン（ツールバー内） ========== */
#game-start-btn {
    padding: .5rem 1.6rem;
    font-size: 1.3rem;
    font-weight: 800;
    font-family: 'Dela Gothic One', sans-serif;
    background: var(--pink);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    letter-spacing: .08em;
    box-shadow: none;
    transition: transform .15s, box-shadow .15s;
    margin-left: auto;
}

#game-start-btn.is-stop {
    background: oklch(52% 0.20 22);
    box-shadow: none;
}

#game-start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px oklch(62% 0.20 32 / 0.38);
}

#game-start-btn:active {
    transform: scale(.97);
}

#game-setup-panel {
    /* 既存のプロパティはそのまま、以下を追加 */
    max-height: 80vh;
    overflow-y: auto;
}

/* スクロールバーデザイン */
#game-setup-panel::-webkit-scrollbar {
    width: 6px;
}

#game-setup-panel::-webkit-scrollbar-track {
    background: transparent;
    margin: 16px 0;
}

#game-setup-panel::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 999px;
    transition: background .2s;
}

#game-setup-panel::-webkit-scrollbar-thumb:hover {
    background: var(--purple);
}

/* Firefox用 */
#game-setup-panel {
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

/* ========== 待機中モーダル（ゲスト） ========== */
#waiting-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(0, 0, 0, .75);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 340px;
    max-width: 440px;
    height: auto;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid var(--border);
    border-radius: 12px;
}

#waiting-modal.active {
    display: flex;
}

.waiting-inner {
    text-align: center;
    padding: 32px 36px;
    width: 100%;
}

.waiting-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--cyan);
    border-radius: 50%;
    animation: spin .8s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.waiting-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 16px;
}

/* ========== 設定サマリー ========== */
#settings-summary {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    text-align: left;
}

.ss-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 5px 0;
    border-bottom: 1px solid var(--border);
    font-size: 1.05rem;
}

.ss-row:last-child {
    border-bottom: none;
}

.ss-label {
    color: var(--muted);
    font-size: .92rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.ss-val {
    color: var(--text);
    font-weight: 800;
    text-align: right;
}

#waiting-player-count {
    font-size: 1.1rem;
    color: #555;
}

/* 勝敗結果 */
#result-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 400;
    align-items: center;
    justify-content: center;
}

#result-modal.active {
    display: flex;
}

#result-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .85);
    backdrop-filter: blur(6px);
}

#result-panel {
    position: relative;
    background: var(--card);
    border: 1px solid var(--yellow);
    border-radius: 8px;
    padding: 36px 40px;
    min-width: 360px;
    z-index: 1;
    text-align: center;
    box-shadow: 0 0 60px oklch(78% 0.16 72 / 0.19);
}

.result-label {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: .18em;
    color: var(--yellow);
    margin: 0 0 8px;
}

.result-title {
    font-family: 'Dela Gothic One', sans-serif;
    font-size: 2.8rem;
    color: #fff;
    margin: 0 0 24px;
}

#result-list {
    list-style: none;
    margin: 0 0 24px;
    padding: 0;
    text-align: left;
}

#result-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    margin-bottom: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 1.4rem;
}

#result-list li.rank-1 {
    border-color: #FFD700;
    background: #FFD70010;
}

#result-list li.rank-2 {
    border-color: #C0C0C0;
    background: #C0C0C010;
}

#result-list li.rank-3 {
    border-color: #CD7F32;
    background: #CD7F3210;
}

.result-rank {
    font-family: 'Dela Gothic One', sans-serif;
    font-size: 1.8rem;
    width: 32px;
    text-align: center;
    color: #555;
}

li.rank-1 .result-rank {
    color: #FFD700;
}

li.rank-2 .result-rank {
    color: #C0C0C0;
}

li.rank-3 .result-rank {
    color: #CD7F32;
}

.result-name {
    flex: 1;
    font-weight: 800;
    color: #fff;
}

.result-scores {
    font-size: 1.2rem;
    display: flex;
    gap: 8px;
}

.result-correct {
    color: var(--green);
}

.result-wrong {
    color: var(--pink);
}

#result-close {
    padding: 12px 32px;
    font-size: 1.5rem;
    font-weight: 800;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    background: var(--yellow);
    color: #000;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: transform .15s;
}

#result-close:hover {
    transform: translateY(-2px);
}

.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    padding: 12px 16px;
    z-index: 10;
    pointer-events: none;
}
.site-footer a {
    font-size: 12px;
    color: #555;
    text-decoration: none;
    transition: color .2s;
    pointer-events: auto;
}
.site-footer a:hover { color: #aaa; }

.help-modal-footer {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    padding: 14px 16px 18px;
    border-top: 1px solid var(--border);
    margin-top: 4px;
}
.help-modal-footer a {
    font-size: 12px;
    color: #555;
    text-decoration: none;
    transition: color .2s;
}
.help-modal-footer a:hover { color: #aaa; }

#setup-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: #555;
    font-size: 18px;
    cursor: pointer;
    transition: color .2s;
}

#setup-close-btn:hover {
    color: #fff;
}

/* ========== チャット吹き出し ========== */
#chat-area {
    bottom: calc(var(--bar-bottom) + 8px);
    right: 16px;
    z-index: 15;
}

/* =========================================================
     吹き出し本体
     ========================================================= */
.balloon {
    top: 55px;
    display: inline-block;
    position: absolute;
    z-index: 5;
    animation: balloonPop .35s cubic-bezier(.34, 1.56, .64, 1) forwards;
}

.balloon__body {
    background: var(--card);
    border: 1px solid var(--border);
    padding: 10px 18px 0;
    margin-bottom: 10px;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    font-weight: 700;
    font-size: 1.3rem;
    line-height: 1.4;
    color: #ddd;
    position: relative;
    z-index: 1;
    white-space: normal;
    overflow-wrap: anywhere;
    max-width: 230px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .04);
}

.balloon__tail {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--card);
    border-left: 1px solid var(--border);
    border-top: 1px solid var(--border);
    transform: rotate(45deg);
    z-index: 0;
}

/* ---------- 形のバリエーション ---------- */
.balloon--round .balloon__body {
    border-radius: 6px;
    padding: 8px 18px 0;
    margin-bottom: 8px;
    max-width: 233px;
    top: -15px;
}

/* ---------- 不正解バリエーション ---------- */
.balloon--wrong .balloon__body,
.balloon.balloon--round.tail-tl .balloon__body {
    background: #1c1010;
    border-color: var(--pink);
    color: #ffaaaa;
    box-shadow: 0 6px 20px rgba(255, 45, 120, .25), inset 0 1px 0 rgba(255, 255, 255, .04);
    animation: wrongShake .4s ease-in-out;
}

.balloon--wrong .balloon__tail,
.balloon.balloon--round.tail-tl .balloon__tail {
    background: #1c1010;
    border-color: var(--pink);
}

.balloon--wrong::after,
.balloon.balloon--round.tail-tl::after {
    content: '✗';
    position: absolute;
    top: -6px;
    right: -8px;
    font-family: 'Dela Gothic One', sans-serif;
    font-size: 1.4rem;
    color: #fff;
    background: var(--pink);
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 12px var(--pink);
    opacity: 0;
    animation: badgePop .4s .15s ease-out forwards;
    z-index: 2;
}

/* ---------- 正解バリエーション ---------- */
.balloon--correct .balloon__body {
    background: #0a1814;
    border-color: var(--green);
    color: var(--green);
    box-shadow: 0 6px 20px rgba(0, 255, 153, .25), inset 0 1px 0 rgba(255, 255, 255, .04);
    animation: correctGlow .8s ease-out;
}

.balloon--correct .balloon__tail {
    background: #0a1814;
    border-color: var(--green);
}

.balloon--correct::after {
    content: '✓';
    position: absolute;
    top: -6px;
    right: -8px;
    font-family: 'Dela Gothic One', sans-serif;
    font-size: 1.4rem;
    color: #000;
    background: var(--green);
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 12px var(--green);
    opacity: 0;
    animation: badgePop .4s .15s ease-out forwards;
    z-index: 2;
}

/* ---------- チャットバリエーション ---------- */
.balloon--chat .balloon__body {
    background: #0a0f18;
    border-color: var(--cyan);
    color: #cceeff;
    box-shadow: 0 6px 20px rgba(0, 245, 255, .2), inset 0 1px 0 rgba(255, 255, 255, .04);
}

.balloon--chat .balloon__tail {
    background: #0a0f18;
    border-color: var(--cyan);
}

/* ---------- しっぽの位置 ---------- */
.tail-tl .balloon__tail {
    left: 25px;
    top: -7px;
    transform: rotate(45deg);
}

/* ---------- フェードアウト ---------- */
.balloon.fadeout {
    animation: balloonOut .4s ease-in forwards;
}

/* ---------- アニメーション ---------- */
@keyframes balloonPop {
    0% {
        opacity: 0;
        transform: scale(.6) translateY(8px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes balloonOut {
    0% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }

    100% {
        opacity: 0;
        transform: scale(.85) translateY(-6px);
    }
}

@keyframes wrongShake {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-4px);
    }

    40% {
        transform: translateX(4px);
    }

    60% {
        transform: translateX(-3px);
    }

    80% {
        transform: translateX(2px);
    }
}

@keyframes correctGlow {
    0% {
        box-shadow: 0 6px 20px rgba(0, 255, 153, .1), inset 0 1px 0 rgba(255, 255, 255, .04);
    }

    50% {
        box-shadow: 0 6px 30px rgba(0, 255, 153, .6), 0 0 60px rgba(0, 255, 153, .3), inset 0 1px 0 rgba(255, 255, 255, .04);
    }

    100% {
        box-shadow: 0 6px 20px rgba(0, 255, 153, .25), inset 0 1px 0 rgba(255, 255, 255, .04);
    }
}

@keyframes badgePop {
    0% {
        opacity: 0;
        transform: scale(2) rotate(-30deg);
    }

    60% {
        opacity: 1;
        transform: scale(1.2) rotate(8deg);
    }

    100% {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

@keyframes bubbleIn {
    from {
        opacity: 0;
        transform: translateX(10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes bubbleOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(10px);
    }
}

/* 誤答ルール */
.hidden {
    display: none !important;
}

#all-answer-options {
    margin-top: 12px;
    padding: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 5px;
}

.win-count-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.win-count-wrap input[type=number] {
    width: 56px;
    padding: 4px 8px;
    font-size: 1.4rem;
    font-weight: 800;
    font-family: 'Dela Gothic One', sans-serif;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--yellow);
    text-align: center;
    outline: none;
}

.win-count-wrap input[type=number]:focus {
    border-color: var(--yellow);
    box-shadow: 0 0 0 3px oklch(78% 0.16 72 / 0.10);
}

/* ========== 設定モーダル タブ ========== */
.tab-bar {
    display: flex;
    gap: 4px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 4px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 1.3rem;
    font-weight: 800;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    background: none;
    border: none;
    border-radius: 7px;
    color: #555;
    cursor: pointer;
    transition: all .2s;
    letter-spacing: .03em;
}

.tab-btn:hover {
    color: #aaa;
}

.tab-btn.active {
    background: var(--card);
    color: #fff;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px #00000040;
}

.tab-content {
    display: block;
}

.tab-content.hidden {
    display: none;
}

/* ========== モード小タブ ========== */
.mode-tab-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
}

.mode-tab-btn {
    padding: 7px 20px;
    font-size: 1.3rem;
    font-weight: 800;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 4px;
    color: #555;
    cursor: pointer;
    transition: all .2s;
}

.mode-tab-btn:hover {
    color: #aaa;
    border-color: #3a3a5e;
}

.mode-tab-btn[data-mode="buzz"].active {
    border-color: var(--pink);
    color: var(--pink);
    background: oklch(62% 0.20 32 / 0.05);
}

.mode-tab-btn[data-mode="chat"].active {
    border-color: var(--cyan);
    color: var(--cyan);
    background: oklch(58% 0.18 265 / 0.05);
}

.mode-tab-content {
    display: block;
}

.mode-tab-content.hidden {
    display: none;
}

/* ========== 準備中 ========== */
#room-id-box {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    flex-shrink: 0;
    cursor: pointer;
}

#room-id-text {
    font-family: 'Dela Gothic One', sans-serif;
    font-size: 1.2rem;
    color: var(--yellow);
    letter-spacing: .12em;
}

#room-id-copy {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: background .2s;
}

#room-id-box:hover {
    border-color: var(--yellow);
    box-shadow: 0 0 8px oklch(78% 0.16 72 / 0.13);
}

#room-id-copy.copied {
    color: var(--green);
}

/* ========== テーマ切り替えボタン ========== */
#theme-toggle-btn {
    width: 32px;
    height: 32px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    transition: border-color .15s, background .25s;
    color: var(--text);
    padding: 0;
}

#theme-toggle-btn:hover {
    border-color: var(--yellow);
}

/* ========== 言語切り替えボタン ========== */
.lang-toggle-btn {
    width: 32px;
    height: 32px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 800;
    flex-shrink: 0;
    transition: border-color .15s, background .25s;
    color: var(--text);
    padding: 0;
}

.lang-toggle-btn:hover {
    border-color: var(--yellow);
}

/* ========== 再生状態インジケーター ========== */
#top-header {
    position: relative;
}

#playback-status {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .05em;
    pointer-events: none;
    transition: color .3s, background .3s, border-color .3s, box-shadow .3s;
}

#playback-status.ps-play {
    color: var(--cyan);
    background: oklch(58% 0.18 265 / 0.1);
    border: 1px solid oklch(58% 0.18 265 / 0.3);
    box-shadow: 0 0 12px oklch(58% 0.18 265 / 0.15);
}

#playback-status.ps-stop {
    color: var(--yellow);
    background: oklch(78% 0.16 72 / 0.08);
    border: 1px solid oklch(78% 0.16 72 / 0.25);
    box-shadow: 0 0 8px oklch(78% 0.16 72 / 0.1);
}

#playback-status .ps-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

#playback-status.ps-play .ps-dot {
    background: var(--cyan);
    animation: psDotPulse 1.4s ease-in-out infinite;
}

#playback-status.ps-stop .ps-dot {
    background: var(--yellow);
    animation: none;
}

@keyframes psDotPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: .4;
        transform: scale(.7);
    }
}

/* ========== 退出ボタン ========== */
#leave-btn {
    height: 32px;
    padding: 0 12px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    flex-shrink: 0;
    transition: border-color .15s, color .15s, background .15s;
    color: var(--muted);
}

#leave-btn:hover {
    border-color: #ff6b6b;
    color: #ff6b6b;
    background: oklch(40% 0.08 15 / 0.15);
}

/* ライトモード時のカード・入力フィールド */
:root.light #player-list,
:root.light #answer-bar,
:root.light #answer-log,
:root.light #game-control-remote {
    border-color: var(--border);
}

:root.light input,
:root.light .card {
    transition: background .25s, color .25s, border-color .25s;
}

/* ========== カウント再生ボタン ========== */
.speed-live {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px 8px;
    margin-top: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.speed-live-title {
    font-size: 1.0rem;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: 2px;
}

.speed-live-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.speed-live-label {
    font-size: 1.1rem;
    color: var(--cyan);
    width: 58px;
    flex-shrink: 0;
}

.speed-live .speed-input {
    width: 72px;
    padding: 3px 6px;
    font-size: 1.2rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    text-align: right;
}

.speed-live .speed-input:focus {
    outline: none;
    border-color: var(--cyan);
}

.speed-sec {
    font-size: 1.0rem;
    color: var(--muted);
    white-space: nowrap;
}

.countdown-play {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    margin-top: 6px;
}

.countdown-play-btn {
    font-size: 1.2rem !important;
    padding: .5rem 1.2rem !important;
}

.countdown-sec-input {
    width: 44px;
    padding: 4px 6px;
    font-size: 1.3rem;
    font-weight: 800;
    font-family: 'Dela Gothic One', sans-serif;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--yellow);
    text-align: center;
    outline: none;
}

.countdown-sec-input:focus {
    border-color: var(--yellow);
    box-shadow: 0 0 0 3px oklch(78% 0.16 72 / 0.10);
}

.countdown-sec-label {
    font-size: 1.3rem;
    color: #888;
    font-weight: 700;
}

/* カウントダウンオーバーレイ */
#countdown-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 250;
    background: rgba(0, 0, 0, .6);
    backdrop-filter: blur(3px);
    align-items: center;
    justify-content: center;
}

#countdown-overlay.active {
    display: flex;
}

#countdown-number {
    font-family: 'Dela Gothic One', sans-serif;
    font-size: 16rem;
    color: var(--cyan);
    text-shadow: 0 0 60px var(--cyan)80, 0 0 120px oklch(58% 0.18 265 / 0.25);
    animation: countPulse .9s ease-in-out infinite;
    line-height: 1;
}

@keyframes countPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.15);
        opacity: .8;
    }
}

/* ========== 再生/停止トースト ========== */
#play-toast {
    position: fixed;
    top: calc(var(--bar-top) + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    padding: 6px 24px;
    border-radius: 999px;
    font-family: 'Dela Gothic One', sans-serif;
    font-size: 1.6rem;
    letter-spacing: .1em;
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: none;
}

#play-toast.show-play {
    color: var(--cyan);
    background: oklch(58% 0.18 265 / 0.08);
    border: 1px solid oklch(58% 0.18 265 / 0.25);
    box-shadow: 0 0 20px oklch(58% 0.18 265 / 0.19);
    animation: toastIn .6s ease-out forwards;
}

#play-toast.show-stop {
    color: var(--yellow);
    background: oklch(78% 0.16 72 / 0.08);
    border: 1px solid oklch(78% 0.16 72 / 0.25);
    box-shadow: 0 0 20px oklch(78% 0.16 72 / 0.19);
    animation: toastIn .6s ease-out forwards;
}

@keyframes toastIn {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px) scale(.9);
    }

    20% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }

    80% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px) scale(.95);
    }
}

/* 画面端フラッシュ */
#edge-flash {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 49;
    opacity: 0;
}

#edge-flash.flash-play {
    animation: edgeFlash .4s ease-out;
    box-shadow: inset 0 0 60px var(--cyan)25;
}

#edge-flash.flash-stop {
    animation: edgeFlash .4s ease-out;
    box-shadow: inset 0 0 60px oklch(78% 0.16 72 / 0.13);
}

@keyframes edgeFlash {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

/* ========== 停止マーカー ========== */
.stop-marker {
    display: block;
    position: absolute;
    top: -8px;
    width: 2px;
    height: 30px;
    background: var(--border);
    border-radius: 2px;
    z-index: 10;
    pointer-events: none;
    transition: background .2s, box-shadow .2s;
}

.stop-marker::after {
    content: attr(data-label);
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--muted);
    white-space: nowrap;
    transition: color .2s;
}

.stop-marker.active {
    width: 3px;
    background: var(--pink);
    box-shadow: 0 0 8px var(--pink);
}

.stop-marker.active::after {
    color: var(--pink);
    text-shadow: 0 0 6px oklch(62% 0.20 32 / 0.38);
}

#marker-50 {
    left: 50%;
}

#marker-75 {
    left: 75%;
}

/* ========== 停止後の設定 ========== */
.stop-pause-settings {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 5px 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 1.2rem;
    color: #888;
}

.stop-pause-settings.hidden {
    display: none;
}

.stop-pause-label {
    font-weight: 800;
    color: #666;
    flex-shrink: 0;
}

.stop-pause-option {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    color: #888;
    transition: color .2s;
}

.stop-pause-option:hover {
    color: #fff;
}

.stop-pause-option input[type=radio] {
    display: none;
}

.stop-pause-option input[type=radio]:checked~span {
    color: var(--cyan);
    font-weight: 800;
}

.stop-pause-sec-wrap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.stop-pause-sec-wrap.hidden {
    display: none !important;
}

#stop-pause-sec {
    width: 40px;
    padding: 2px 4px;
    font-size: 1.2rem;
    font-weight: 800;
    font-family: 'Dela Gothic One', sans-serif;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--yellow);
    text-align: center;
    outline: none;
}

/* ========== 停止ポイント一時停止カウントダウン ========== */
#stop-pause-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 55;
    font-family: 'Dela Gothic One', sans-serif;
    font-size: 4rem;
    color: var(--yellow);
    text-shadow: 0 0 30px oklch(78% 0.16 72 / 0.38);
    background: rgba(0, 0, 0, .5);
    border: 1px solid oklch(78% 0.16 72 / 0.25);
    border-radius: 8px;
    padding: 12px 32px;
    display: none;
    pointer-events: none;
}

#stop-pause-toast.active {
    display: block;
    animation: countPulse .9s ease-in-out infinite;
}

/* ========== 停止チェックボックス ========== */
.stop-check {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding-left: 0;
}

.stop-check input[type=checkbox] {
    display: inline-block;
    width: 14px;
    height: 14px;
    accent-color: var(--pink);
    cursor: pointer;
    margin: 0;
}

.stop-check span {
    position: static;
    padding-left: 0;
}

.stop-check input[type=checkbox]:checked~span {
    color: var(--pink);
    font-weight: 800;
}

/* ========== ホスト変更通知 ========== */
#host-change-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 350;
    background: rgba(0, 0, 0, .7);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

#host-change-modal.active {
    display: flex;
}

.host-change-inner {
    background: var(--card);
    border: 1px solid var(--yellow);
    border-radius: 8px;
    padding: 32px 40px;
    text-align: center;
    box-shadow: 0 0 40px oklch(78% 0.16 72 / 0.19);
}

.host-change-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 12px;
}

.host-change-title {
    font-family: 'Dela Gothic One', sans-serif;
    font-size: 1.8rem;
    color: #fff;
    margin: 0 0 8px;
}

.host-change-sub {
    font-size: 1.2rem;
    color: #888;
    margin: 0 0 20px;
}

#host-change-close {
    padding: 10px 32px;
    font-size: 1.4rem;
    font-weight: 800;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    background: var(--yellow);
    color: #000;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: transform .15s;
}

#host-change-close:hover {
    transform: translateY(-2px);
}

/* ========== 回答ログ ========== */
#answer-log {
    position: absolute;
    top: calc(var(--bar-top) + var(--bar-toolbar));
    right: var(--bar-player-list);
    width: var(--bar-answer-log);
    height: calc(100vh - var(--bar-top) - var(--bar-bottom));
    background: var(--card);
    border-left: 1px solid var(--border);
    z-index: 9;
    display: flex;
    flex-direction: column;
}

.answer-log-header {
    font-size: 1.1rem;
    font-weight: 800;
    color: #666;
    letter-spacing: .1em;
    padding: 10px 12px 8px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

#answer-log-list {
    list-style: none;
    margin: 0;
    padding: 8px;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

#answer-log-list::-webkit-scrollbar {
    width: 4px;
}

#answer-log-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 999px;
}

/* ログフィルター */
#answer-log-list.filter-answer .log-chat {
    display: none;
}

#answer-log-list.filter-chat .log-correct,
#answer-log-list.filter-chat .log-wrong,
#answer-log-list.filter-chat .log-question {
    display: none;
}

#answer-log-list li {
    padding: 6px 8px;
    margin-bottom: 6px;
    border-radius: 4px;
    font-size: 1.1rem;
    animation: bubbleIn .2s ease-out;
}

#answer-log-list li.log-wrong {
    background: oklch(62% 0.20 32 / 0.05);
    border: 1px solid oklch(62% 0.20 32 / 0.19);
}

#answer-log-list li.log-correct {
    background: oklch(70% 0.18 155 / 0.03);
    border: 1px solid oklch(70% 0.18 155 / 0.19);
}

#answer-log-list .log-name {
    font-weight: 800;
    font-size: 1rem;
    margin-bottom: 2px;
}

#answer-log-list .log-wrong .log-name {
    color: var(--pink);
}

#answer-log-list .log-correct .log-name {
    color: var(--green);
}

#answer-log-list .log-answer {
    color: #ccc;
    font-size: 1.1rem;
    word-break: break-all;
}

#answer-log-list .log-correct .log-answer {
    color: var(--green);
}

#answer-log-list li.log-chat {
    background: oklch(60% 0.10 240 / 0.05);
    border: 1px solid oklch(60% 0.10 240 / 0.18);
}

/* 現在の問題ピン表示 */
#log-question-pin {
    display: none;
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--card);
    text-align: center;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: var(--muted);
    padding: 5px 0 4px;
    border-bottom: 1px solid var(--border);
}

#log-question-pin.active {
    display: block;
}

#answer-log-list li.log-question {
    background: none;
    border: none;
    padding: 4px 0 2px;
    margin-bottom: 2px;
    text-align: center;
}

#answer-log-list li.log-question span {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: var(--muted);
}

#answer-log-list .log-msg {
    color: #ccc;
    font-size: 1.1rem;
    word-break: break-all;
}

/* ========== ホスト上部ボタン ========== */
#host-top-btns {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    flex: 1;
}

#host-top-btns .next-btn,
#host-top-btns .btn-replay {
    white-space: nowrap;
    font-size: 1rem !important;
    padding: .35rem 1rem !important;
}

.reset-btn {
    font-size: 1rem !important;
    padding: 6px 12px !important;
    margin-left: 6px;
    opacity: 0.5;
    vertical-align: middle;
}

.reset-btn:hover {
    opacity: 1;
}

.remote-btn {
    font-size: 1.2rem !important;
    padding: .5rem 1rem !important;
    min-width: 40px;
    text-align: center;
}

/* ========== リモコン付箋タブ（常時表示の固定ボタン） ========== */
.rule-tab,
.remote-tab {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 16px;
    font-size: 1rem;
    font-weight: 800;
    color: var(--yellow);
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
    transition: color .2s, border-color .2s, box-shadow .2s, transform .15s;
}

.rule-tab:hover,
.remote-tab:hover {
    color: var(--cyan);
    border-color: var(--cyan);
    box-shadow: 0 4px 18px oklch(58% 0.18 265 / 0.30);
    transform: translateY(-1px);
}

/* ========== ゲーム開始/停止リモコン（中央ポップアップ） ========== */
#game-control-remote {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 80;
    padding: 0;
    transform: translate(-50%, -50%);
    width: 560px;
    max-width: calc(100vw - 40px);
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.start-btn:hover {
    filter: brightness(1.08);
}

.start-btn:active {
    transform: scaleY(0.97);
}

#game-control-remote>span {
    display: block;
    margin: 0;
    padding: 0;
}

/* ゲーム開始/停止ボタン（横長メインカード） */
#game-control-remote #game-start-btn {
    font-family: 'Dela Gothic One', sans-serif;
    font-weight: 400;
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 30px 32px !important;
    font-size: 2.8rem !important;
    border-radius: 8px !important;
    text-align: center;
    letter-spacing: .16em;
    background: var(--pink) !important;
    color: #fff !important;
    border: none;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .45), inset 0 -4px 0 rgba(0, 0, 0, .18);
    text-shadow: none;
    cursor: pointer;
    transition: filter .15s, transform .08s;
}

#game-control-remote #game-start-btn:hover {
    filter: brightness(1.08);
    transform: none;
}

#game-control-remote #game-start-btn:active {
    transform: translateY(2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .4), inset 0 -2px 0 rgba(0, 0, 0, .18);
}

#game-control-remote #game-start-btn.is-stop {
    background: oklch(50% 0.22 22) !important;
}

/* 設定ボタン（分離された小さなカード） */
#game-control-remote #open-settings-btn {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 12px 24px !important;
    font-size: 1.4rem !important;
    font-weight: 800;
    border-radius: 6px !important;
    text-align: center;
    background: var(--card) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
    letter-spacing: .04em;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
}

#game-control-remote #open-settings-btn::before,
#game-control-remote #open-settings-btn::after {
    display: none !important;
}

#game-control-remote #open-settings-btn:hover {
    background: var(--border) !important;
    color: var(--yellow) !important;
    border-color: var(--yellow) !important;
}

/* 閉じるボタン（押しやすい大きさ・外側右上に分離配置） */
#remote-close-btn {
    position: absolute;
    top: -52px;
    right: 0;
    width: 44px;
    height: 44px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 2rem;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color .15s, background .15s, border-color .15s, transform .08s;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .3);
}

#remote-close-btn:hover {
    color: var(--pink);
    border-color: var(--pink);
    background: var(--card);
}

#remote-close-btn:active {
    transform: scale(.95);
}

/* ========== ダミースライダー（ゲスト用） ========== */
#slider-dummy {
    display: none;
    position: relative;
    width: 700px;
    left: -6px;
    height: 6px;
    background: var(--border);
    border-radius: 999px;
    pointer-events: none;
    user-select: none;
}

#slider-dummy-fill {
    height: 100%;
    width: 0%;
    background: var(--cyan);
    border-radius: 999px;
    transition: width 50ms linear;
}

#slider-dummy-thumb {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 18px;
    height: 18px;
    background: var(--cyan);
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: none;
    transform: translate(-50%, -50%);
    transition: left 50ms linear;
}

/* ダミー表示時は本物を隠す */
#slider-dummy.active {
    display: block;
}

#slider-dummy.active~#slider,
/* =========================================================
     LAYER 3 — FILM STRIPS (CINEMA)
     ========================================================= */
.film-strip {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 58px;
    z-index: -1;
    background: var(--film-strip);
    transition: background 0.5s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    padding: 20px 0;
}

.film-strip.left {
    left: 0;
}

.film-strip.right {
    right: 0;
}

.film-hole {
    width: 28px;
    height: 36px;
    background: var(--film-hole);
    border-radius: 4px;
    transition: background 0.5s ease;
    flex-shrink: 0;
}

/* ========== 背景ギャラリー ========== */
#bg-gallery {
    position: fixed;
    inset: 0;
    z-index: 0;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.bg-gallery-col {
    position: relative;
    left: 59px;
    width: 210px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 6px;
    overflow-y: auto;
    scrollbar-width: none;
}

#bg-gallery-right {
    left: unset;
    right: 59px;
}

.bg-gallery-col::-webkit-scrollbar {
    display: none;
}

.bg-gallery-col:first-child {
    align-items: flex-start;
}

.bg-gallery-col:last-child {
    align-items: flex-end;
}

.bg-gallery-item {
    position: relative;
    flex-shrink: 0;
    pointer-events: auto;
}

.bg-gallery-item img {
    width: 210px;
    height: 210px;
    object-fit: cover;
    border-radius: 4px;
    opacity: 0;
    filter: brightness(.35) saturate(.5);
    transition: filter .2s, opacity .2s;
    animation: bgItemIn .8s ease-out forwards;
    display: block;
}

.bg-gallery-item:hover img {
    filter: brightness(.7) saturate(.8);
}

.bg-gallery-item a {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 8px;
    text-decoration: none;
    opacity: 0;
    transition: opacity .2s;
}

.bg-gallery-item:hover a {
    opacity: 1;
}

.bg-gallery-item a span {
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    background: rgba(255, 153, 0, .85);
    padding: 2px 10px;
    border-radius: 6px;
}

@keyframes bgItemIn {
    from {
        opacity: 0;
        transform: scale(1.1);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ========== 全員回答中の回答バー強調 ========== */
#answer-bar.all-answer-active {
    border-top: 2px solid var(--yellow);
    box-shadow: 0 -4px 20px oklch(78% 0.16 72 / 0.19);
    animation: barPulse 1.2s ease-in-out infinite;
}

#answer-bar.all-answer-active .btn-answer {
    animation: btnPulse 1s ease-in-out infinite;
}

#answer-bar.all-answer-active #answer-modal {
    display: flex !important;
}

@keyframes barPulse {

    0%,
    100% {
        border-top-color: var(--yellow);
    }

    50% {
        border-top-color: var(--pink);
    }
}

@keyframes btnPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }
}

/* ========== 全員回答モーダル内プレイヤーリスト ========== */
#all-answer-players {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

#all-answer-players li {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: 700;
    border: 1px solid var(--border);
    background: var(--bg);
    color: #666;
    transition: all .3s;
}

#all-answer-players li.answered {
    border-color: var(--green);
    color: var(--green);
    background: oklch(70% 0.18 155 / 0.05);
}

#all-answer-players li.answered::before {
    content: '✓ ';
}

#all-answer-players li.not-answered::before {
    content: '… ';
}

/* ========== 設定カード チェックボックス対応 ========== */
.setup-option input[type=checkbox] {
    display: none;
}

.setup-option input[type=checkbox]:checked+.setup-option-card {
    border-color: var(--cyan);
    background: oklch(58% 0.18 265 / 0.05);
    box-shadow: inset 0 0 0 2px var(--cyan);
}

.setup-option input[type=checkbox]:checked+.setup-option-card .setup-option-name {
    color: var(--cyan);
}

/* ========== ルールパネル（ドラッグ可能フローティングカード） ========== */
#rules-panel,
#play-settings-panel {
    display: none;
    position: fixed;
    bottom: calc(var(--bar-bottom) + 12px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 20px;
    min-width: 280px;
    box-shadow: 0 4px 28px rgba(0, 0, 0, .5);
    cursor: grab;
    user-select: none;
}

#rules-panel.dragging,
#play-settings-panel.dragging {
    cursor: grabbing;
    box-shadow: 0 8px 40px rgba(0, 0, 0, .65);
}

#rules-panel.active {
    display: block;
}

#play-settings-panel.active {
    display: flex;
    flex-direction: column;
}

.rules-panel-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--cyan);
    margin: 0 0 10px;
    text-align: center;
    letter-spacing: .06em;
}

#rules-tab-btn.active,
#play-settings-tab-btn.active {
    color: var(--yellow);
    border-color: var(--yellow);
    background: oklch(78% 0.16 72 / 0.08);
}

/* ========== 回答バー タブ ========== */
#bar-tabs {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
    align-self: stretch;
    padding: 6px 0;
}

.bar-tab {
    position: relative;
    padding: 0 12px 0 18px;
    min-height: 38px;
    width: 100px;
    font-size: 1.15rem;
    font-weight: 800;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--muted);
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s, transform .08s;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1;
    text-align: left;
    letter-spacing: .04em;
    overflow: hidden;
    flex: 1;
}

/* アクティブ表示用の左カラーバー */
.bar-tab::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: transparent;
    transition: background .15s;
}

.bar-tab:hover {
    color: var(--text);
    background: oklch(0% 0 0 / 0.04);
    border-color: var(--text);
}

:root.light .bar-tab:hover {
    background: oklch(0% 0 0 / 0.04);
}

.bar-tab.active {
    color: var(--text);
    background: var(--card);
    border-color: var(--cyan);
    transform: translateX(2px);
}

.bar-tab.active::before {
    background: var(--cyan);
}

.bar-tab[data-bar="answer"].active {
    border-color: var(--pink);
}

.bar-tab[data-bar="answer"].active::before {
    background: var(--pink);
}

.bar-panel {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

/* ========== チャット入力 ========== */
#chat-input {
    flex: 1;
    padding: 8px 14px;
    font-size: 1.4rem;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: #fff;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

#chat-input:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px oklch(58% 0.18 265 / 0.10);
}

#chat-submit {
    padding: 8px 20px;
    font-size: 1.3rem;
    font-weight: 800;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    background: var(--cyan);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    box-shadow: none;
    white-space: nowrap;
    flex-shrink: 0;
}

#chat-submit:hover {
    transform: translateY(-1px);
    box-shadow: none;
}

/* ========== 得点調整ボタン ========== */
.score-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    padding: 0;
    font-size: 1rem;
    font-weight: 800;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    background: none;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: #666;
    cursor: pointer;
    transition: all .15s;
    line-height: 1;
    pointer-events: auto;
}

.score-btn:hover {
    color: #fff;
    border-color: var(--cyan);
    background: oklch(58% 0.18 265 / 0.10);
}

/* ========== ヘルプボタン ========== */
#help-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--card);
    border: 1px solid var(--border);
    border-color: var(--pop-yellow);
    color: var(--pop-yellow);
    font-family: 'Dela Gothic One', sans-serif;
    font-size: 1.6rem;
    cursor: pointer;
    z-index: 30;
    transition: all .2s;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .4);
}

#help-btn:hover {
    color: var(--cyan);
    border-color: var(--cyan);
    box-shadow: 0 0 20px #00f5ff30;
}

/* ========== ヘルプモーダル ========== */
#help-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .75);
    backdrop-filter: blur(4px);
    z-index: 400;
}

#help-backdrop.active {
    display: block;
}

#help-modal {
    display: none;
    flex-direction: column;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 560px;
    max-width: 90vw;
    max-height: 80vh;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    z-index: 401;
    box-shadow: 0 0 60px rgba(0, 245, 255, .15), 0 0 100px rgba(255, 45, 120, .1);
}

#help-modal.active {
    display: flex;
}

.help-modal-topbar {
    flex-shrink: 0;
    display: flex;
    justify-content: flex-end;
    padding: 14px 16px 0;
}

.help-modal-body {
    overflow-y: auto;
    flex: 1;
    padding: 8px 40px 36px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.help-modal-body::-webkit-scrollbar {
    width: 6px;
}

.help-modal-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 999px;
}

#help-close {
    background: none;
    border: 1px solid var(--border);
    border-radius: 50%;
    color: #888;
    font-size: 22px;
    width: 38px;
    height: 38px;
    line-height: 1;
    cursor: pointer;
    transition: color .2s, border-color .2s;
}

#help-close:hover {
    color: #fff;
    border-color: #fff;
}

.help-header {
    margin-bottom: 24px;
}

.help-badge {
    display: inline-block;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: .18em;
    color: var(--cyan);
    border: 1px solid var(--cyan);
    border-radius: 999px;
    padding: 2px 12px;
    margin-bottom: 10px;
}

.help-title {
    font-family: 'Dela Gothic One', sans-serif;
    font-size: 2.8rem;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.help-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.help-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.help-section h3 {
    font-size: 1.5rem;
    color: var(--yellow);
    margin: 0 0 8px;
    font-weight: 800;
}

.help-section p {
    font-size: 1.6rem;
    color: #ccc;
    margin: 0 0 6px;
    line-height: 1.6;
}

.help-section ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.help-section ul li {
    font-size: 1.3rem;
    color: #ccc;
    padding: 4px 0;
    line-height: 1.5;
}

.help-section ul li b {
    color: var(--cyan);
    margin-right: 6px;
}

.help-flow {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.help-flow img {
    object-fit: cover;
    max-width: 120px;
    max-height: 120px;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.help-flow img.wide-img {
    max-width: 100%;
    max-height: none;
    height: auto;
    display: block;
}

.help-flow.vertical {
    flex-direction: column;
    align-items: flex-start;
}

.help-arrow {
    font-size: 1.4rem;
    color: var(--yellow);
    flex-shrink: 0;
}

.help-tab-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
}

.help-tab-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 6px 12px;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-muted, #888);
    cursor: pointer;
    white-space: nowrap;
    margin-bottom: -1px;
}

.help-tab-btn.active {
    color: var(--yellow);
    border-bottom-color: var(--yellow);
}

.help-tab-content {
    display: none;
}

.help-tab-content.active {
    display: block;
}

/* ========================================================
   ロビーページ (lobby.html)
   ======================================================== */
body.lobby-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

body.lobby-page::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.35;
    pointer-events: none;
}

.lobby-page .glow-tl {
    position: fixed;
    top: -120px;
    left: -120px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, oklch(62% 0.20 32 / 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.lobby-page .glow-br {
    position: fixed;
    bottom: -120px;
    right: -120px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, oklch(58% 0.18 265 / 0.10) 0%, transparent 70%);
    pointer-events: none;
}

.film-strip {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 44px;
    background: var(--card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    padding: 16px 0;
    z-index: 0;
}

.film-strip.right {
    left: unset;
    right: 0;
    border-right: none;
    border-left: 1px solid var(--border);
}

.film-hole {
    width: 22px;
    height: 30px;
    background: var(--bg);
    border-radius: 3px;
}

.side-ad {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
}

.side-ad-right {
    right: 44px;
}

.side-ad-left {
    left: 44px;
}

@media (max-width: 900px) {
    .side-ad {
        display: none;
    }
}

.lobby {
    width: 100%;
    max-width: 440px;
    padding: 24px 20px;
    position: relative;
    z-index: 1;
}

.logo-wrap {
    text-align: center;
    margin-bottom: 36px;
}

.logo-badge {
    display: inline-block;
    background: var(--yellow);
    color: #000;
    font-family: 'Dela Gothic One', sans-serif;
    font-size: 1rem;
    letter-spacing: .22em;
    padding: 3px 14px;
    border-radius: 2px;
    margin-bottom: 14px;
    transform: rotate(-1deg);
}

.lobby-page h1 {
    font-family: 'Dela Gothic One', sans-serif;
    font-size: 4.8rem;
    line-height: 1;
    margin-bottom: 10px;
    color: var(--text);
    letter-spacing: .04em;
}

.lobby-page h1 span {
    color: var(--yellow);
}

.subtitle {
    color: var(--muted);
    font-size: 1.2rem;
    letter-spacing: .08em;
}

/* ========== テスト版表示（本番反映前の一時表示・後で削除） ========== */
#game-test-badge {
    display: inline-block;
    margin: 4px 0 2px;
    background: var(--yellow);
    color: #000;
    font-weight: 800;
    font-size: .95rem;
    letter-spacing: .08em;
    padding: 3px 12px;
    border-radius: 999px;
}

.lobby .card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 22px;
    margin-bottom: 12px;
    position: relative;
}

.lobby .card::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    height: 3px;
    border-radius: 4px 4px 0 0;
}

.card-create::before {
    background: var(--pink);
}

.card-join::before {
    background: var(--cyan);
}

.card-label {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
    margin-bottom: 14px;
    color: var(--muted);
}

.lobby input[type="text"] {
    width: 100%;
    padding: 11px 14px;
    font-size: 1.4rem;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    outline: none;
    margin-bottom: 10px;
    transition: border-color .15s, box-shadow .15s;
}

.lobby input[type="text"]:focus {
    border-color: var(--pink);
    box-shadow: 0 0 0 3px oklch(62% 0.20 32 / 0.14);
}

.card-join input[type="text"]:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px oklch(58% 0.18 265 / 0.14);
}

.lobby input[type="text"]::placeholder {
    color: var(--muted);
}

#theme-toggle {
    position: fixed;
    top: 16px;
    right: 60px;
    z-index: 10;
    width: 36px;
    height: 36px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    transition: border-color .15s, background .15s;
    color: var(--text);
}

#theme-toggle:hover {
    border-color: var(--yellow);
}

#lobby-lang-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 10;
    width: 36px;
    height: 36px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 800;
    transition: border-color .15s, background .15s;
    color: var(--text);
}

#lobby-lang-toggle:hover {
    border-color: var(--yellow);
}

.btn-create {
    width: 100%;
    padding: 13px;
    font-size: 1.4rem;
    font-weight: 800;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    background: var(--pink);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: filter .15s, transform .1s;
    letter-spacing: .06em;
}

.btn-create:hover {
    filter: brightness(1.1);
}

.btn-create:active {
    transform: scale(.98);
}

.input-row {
    display: flex;
    gap: 8px;
    margin-bottom: 0;
}

.input-row input {
    margin-bottom: 0;
    flex: 1;
}

.btn-join {
    padding: 11px 18px;
    font-size: 1.3rem;
    font-weight: 800;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    background: var(--cyan);
    color: #000;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: filter .15s, transform .1s;
    white-space: nowrap;
    letter-spacing: .04em;
}

.btn-join:hover {
    filter: brightness(1.15);
}

.btn-join:active {
    transform: scale(.98);
}

.lobby .error {
    color: var(--pink);
    font-size: 1.2rem;
    margin-top: 8px;
    min-height: 18px;
}

#room-input {
    letter-spacing: .18em;
    font-size: 1.4rem;
}

.deco {
    position: fixed;
    font-family: 'Dela Gothic One', sans-serif;
    opacity: .03;
    pointer-events: none;
    user-select: none;
    color: var(--text);
}

.deco-1 {
    top: 6%;
    left: 8%;
    font-size: 11rem;
    transform: rotate(-12deg);
}

.deco-2 {
    bottom: 8%;
    right: 6%;
    font-size: 8rem;
    transform: rotate(9deg);
}


/* ========================================================
   Adminページ (Admin.html)
   ======================================================== */
body.admin-page {
    padding: 40px 20px;
}

body.admin-page::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: radial-gradient(circle, #ffffff08 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
}

.admin-container {
    max-width: 640px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.admin-header {
    text-align: center;
    margin-bottom: 32px;
}

.header-badge {
    display: inline-block;
    background: var(--yellow);
    color: #000;
    font-family: 'Dela Gothic One', sans-serif;
    font-size: 1.1rem;
    letter-spacing: .2em;
    padding: 4px 14px;
    border-radius: 999px;
    margin-bottom: 12px;
}

.admin-page h1 {
    font-family: 'Dela Gothic One', sans-serif;
    font-size: 2.8rem;
    background: linear-gradient(135deg, var(--pink), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.admin-page .card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 16px;
    position: relative;
}

.admin-page .card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--pink), var(--purple));
    border-radius: 16px 16px 0 0;
}

.field {
    margin-bottom: 14px;
}

.field-label {
    display: block;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: .1em;
    color: var(--muted);
    text-transform: uppercase;
    margin-bottom: 6px;
}

.field-label .required {
    color: var(--pink);
    margin-left: 4px;
}

.admin-page input[type="text"],
.admin-page input[type="number"],
.admin-page textarea,
.admin-page select {
    width: 100%;
    padding: 10px 14px;
    font-size: 1.4rem;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.admin-page input:focus,
.admin-page textarea:focus,
.admin-page select:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px oklch(58% 0.18 265 / 0.18);
}

.admin-page input::placeholder,
.admin-page textarea::placeholder {
    color: var(--muted);
}

.admin-page textarea {
    resize: vertical;
    min-height: 60px;
}

.admin-page select {
    cursor: pointer;
}

.admin-page select option {
    background: var(--bg);
    color: var(--text);
}

.row {
    display: flex;
    gap: 10px;
}

.row .field {
    flex: 1;
}

.asin-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.asin-row .field {
    flex: 1;
    margin-bottom: 0;
}

.btn-check {
    padding: 10px 16px;
    font-size: 1.3rem;
    font-weight: 800;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    background: var(--cyan);
    color: #000;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s, filter .15s;
    box-shadow: 0 4px 16px oklch(58% 0.18 265 / 0.2);
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-check:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.preview {
    margin-top: 12px;
    padding: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    display: none;
}

.preview.active {
    display: block;
}

.preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    display: block;
    margin-bottom: 10px;
}

.preview a {
    display: inline-block;
    padding: 6px 16px;
    background: linear-gradient(135deg, #ff9900, #ff6600);
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 800;
    transition: transform .15s;
}

.preview a:hover {
    transform: translateY(-1px);
}

.toggle-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle {
    position: relative;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.toggle input {
    display: none;
}

.toggle-track {
    position: absolute;
    inset: 0;
    background: var(--border);
    border-radius: 999px;
    transition: background .2s;
}

.toggle input:checked+.toggle-track {
    background: var(--green);
}

.toggle-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s;
}

.toggle input:checked+.toggle-track::after {
    transform: translateX(20px);
}

.toggle-label {
    font-size: 1.4rem;
    color: var(--muted);
    font-weight: 700;
}

.btn-insert {
    width: 100%;
    padding: 16px;
    font-size: 1.6rem;
    font-weight: 800;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    background: linear-gradient(135deg, var(--pink), var(--purple));
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    box-shadow: 0 4px 20px oklch(62% 0.20 32 / 0.25);
    letter-spacing: .05em;
    margin-top: 8px;
}

.btn-insert:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px oklch(62% 0.20 32 / 0.4);
}

.btn-insert:active {
    transform: scale(.97);
}

.btn-insert:disabled {
    opacity: .4;
    cursor: not-allowed;
    transform: none;
}

.result-msg {
    text-align: center;
    margin-top: 12px;
    font-size: 1.4rem;
    font-weight: 700;
    min-height: 24px;
}

.result-msg.success {
    color: var(--green);
}

.result-msg.error {
    color: var(--pink);
}

.insert-log {
    margin-top: 24px;
}

.insert-log h3 {
    font-size: 1.3rem;
    color: var(--muted);
    font-weight: 800;
    letter-spacing: .1em;
    margin-bottom: 8px;
}

.log-list {
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.log-list li {
    padding: 8px 12px;
    margin-bottom: 4px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1.2rem;
    color: var(--muted);
    display: flex;
    justify-content: space-between;
}

.log-list .log-title {
    color: var(--text);
    font-weight: 700;
}

.log-list .log-time {
    color: var(--muted);
}

#setup-confirm-btn.btn-confirm {
    width: 100%;
    padding: 12px 24px;
    font-size: 1.5rem;
    font-weight: 800;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    background: var(--pink);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    letter-spacing: .08em;
    transition: filter .15s, transform .1s;
}

/* ラベル全体が光るタイプ */
.check-wrap {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 7px 11px;
    border-radius: 12px;
    cursor: pointer;
    user-select: none;
    font-size: 9px;
    color: #ccc;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
}

.check-wrap input {
    display: none;
}

/* ホバー時にラベル全体を少し光らせる */
.check-wrap:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}

/* チェックON時：ラベル全体が光る */
.check-wrap:has(input:checked) {
    color: #fff;
    background: rgba(0, 230, 118, 0.08);
    border-color: rgba(0, 230, 118, 0.35);
    box-shadow:
        0 0 18px rgba(0, 230, 118, 0.18),
        inset 0 0 10px rgba(0, 230, 118, 0.05);
}

#setup-confirm-btn.btn-confirm:hover {
    filter: brightness(1.1);
}

#setup-confirm-btn.btn-confirm:active {
    transform: scale(.98);
}

/* ========== 回答入力促進ヒント ========== */
#answer-prompt-hint,
#answer-error,
#close-answer {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    pointer-events: none;
    z-index: 200;
    opacity: 0;
    transition: opacity 0.2s;
}

#answer-prompt-hint.visible,
#answer-error.visible,
#close-answer.visible {
    opacity: 1;
}

.aph-text {
    font-size: 4rem;
    font-weight: 900;
    color: var(--pink);
    text-shadow: 0 0 24px oklch(62% 0.20 32 / 0.8);
    letter-spacing: 0.08em;
    line-height: 1;
}

.aph-arrow {
    font-size: 4.8rem;
    color: var(--pink);
    text-shadow: 0 0 24px oklch(62% 0.20 32 / 0.8);
    animation: aphBounce 0.5s ease-in-out infinite alternate;
    line-height: 1;
}

@keyframes aphBounce {
    from {
        transform: translateY(-6px);
    }

    to {
        transform: translateY(6px);
    }
}

/* ========== ヘッダー右側ユーティリティ群 ========== */
#header-right-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

/* ========== タイトル切り替え（ロビー） ========== */
.title-switcher {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 10px;
}
.title-clip {
    overflow: hidden;
    position: relative;
    min-width: 280px;
    display: flex;
    justify-content: center;
}

.title-arrow {
    background: none;
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 2.4rem;
    line-height: 1;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
    font-family: 'Dela Gothic One', sans-serif;
    padding: 0;
}

.title-arrow:hover {
    color: var(--text);
    border-color: var(--yellow);
    transform: scale(1.1);
}

.title-arrow:active {
    transform: scale(.95);
}

#game-title,
#game-subtitle {
    text-align: center;
}

#game-title {
    margin-bottom: 0;
}

.slide-out-left {
    animation: slideOutLeft .2s ease-in forwards;
}

.slide-out-right {
    animation: slideOutRight .2s ease-in forwards;
}

.slide-in-left {
    animation: slideInLeft .25s ease-out forwards;
}

.slide-in-right {
    animation: slideInRight .25s ease-out forwards;
}

@keyframes slideOutLeft {
    0%   { opacity: 1; transform: translateX(0); }
    100% { opacity: 0; transform: translateX(-40px); }
}

@keyframes slideOutRight {
    0%   { opacity: 1; transform: translateX(0); }
    100% { opacity: 0; transform: translateX(40px); }
}

@keyframes slideInLeft {
    0%   { opacity: 0; transform: translateX(-40px); }
    100% { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    0%   { opacity: 0; transform: translateX(40px); }
    100% { opacity: 1; transform: translateX(0); }
}