:root {
  --bg: #121416;
  --surface: #1b1d20;
  --border: #2c2f33;
  --text: #e6e8ea;
  --muted: #8a9096;
  --primary: #1f6aa5;
  --primary-hover: #2679bb;
  --primary-shadow: #174f7c;
  --disabled: #45474a;
  --disabled-text: #9a9da1;
  --mine: #1d2a35;
  --error: #f2766b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, "Yu Gothic UI", "Meiryo", sans-serif;
  background: var(--bg);
  color: var(--text);
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

header h1 { margin: 0; font-size: 20px; line-height: 0; }

/* サイトのロゴ（images/logo.png。横 2000 × 縦 384 の画像を、高さをそろえて縮めて出す） */
.logo { height: 77px; width: auto; display: block; }

/* 狭い画面では、右側の「接続済み」・音量マークと並ぶよう小さくする */
@media (max-width: 600px) {
  .logo { height: 53px; }
}

.connection { font-size: 13px; color: var(--muted); }

.header-right { display: flex; align-items: center; gap: 16px; }

.volume-controls { display: flex; align-items: center; gap: 16px; }

/* 音量: マークの上にマウスを置くと、下にスライダーを出す */
.volume { position: relative; display: flex; }

.volume-icon { width: 24px; height: 24px; color: var(--muted); cursor: pointer; }
.volume:hover .volume-icon { color: var(--text); }
.volume-speaker { fill: currentColor; }
.volume-line { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.volume-line[hidden] { display: none; }

.volume-popup {
  position: absolute;
  top: 100%;
  right: -8px;
  z-index: 10;
  display: none;
  align-items: center;
  gap: 8px;
  /* マークとの間のすき間（上の 6px は透明）でもマウスが外れないよう、余白を含めて出す */
  padding: 14px 12px 8px;
}
.volume:hover .volume-popup { display: flex; }

.volume-popup::before {
  content: "";
  position: absolute;
  inset: 6px 0 0;
  z-index: -1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.volume-popup input { width: 120px; padding: 0; accent-color: var(--primary-hover); cursor: pointer; }
.volume-value { width: 3em; font-size: 13px; text-align: right; color: var(--muted); }

main { max-width: 840px; margin: 0 auto; padding: 24px 16px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
}

/* ---------------------------------------------------------------- ボタン・入力 */

input {
  font: inherit;
  padding: 8px 10px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
}

button {
  font: inherit;
  font-weight: bold;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  background: var(--primary);
  box-shadow: 0 3px 0 var(--primary-shadow);
  color: #ffffff;
  cursor: pointer;
}

button:hover:not(:disabled) { background: var(--primary-hover); }

button:disabled {
  background: var(--disabled);
  box-shadow: 0 3px 0 #333538;
  color: var(--disabled-text);
  cursor: default;
}

button.secondary {
  background: transparent;
  box-shadow: none;
  color: var(--text);
  border: 1px solid var(--muted);
}

button.secondary:hover { background: var(--border); }

/* 文字だけのボタン（ログアウト・パスコードを送り直す など） */
button.link {
  padding: 0;
  background: none;
  box-shadow: none;
  color: var(--muted);
  font-weight: normal;
  font-size: 13px;
  text-decoration: underline;
}
button.link:hover:not(:disabled) { background: none; color: var(--text); }
button.link:disabled { background: none; box-shadow: none; text-decoration: none; }

/* ---------------------------------------------------------------- 最初の画面（ゲスト / ログイン・登録） */

.login-box { max-width: 420px; margin: 0 auto; }
.login-panel { padding: 24px 20px; }
.login-form { display: flex; flex-direction: column; gap: 10px; }
.login-form[hidden] { display: none; }
.login-note { margin: 0; font-size: 13px; line-height: 1.6; color: var(--muted); }
.login-email { color: var(--text); word-break: break-all; }
.login-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 4px; }

/* ヘッダー: 登録した人としてログインしているときの名前とログアウト */
.account { display: flex; align-items: center; gap: 10px; font-size: 14px; white-space: nowrap; }
.account[hidden] { display: none; }

/* 狭い画面では、ログアウト・音量マークが収まるよう、名前と「接続済み」を出さない（切れたときはエラーの文で分かる） */
@media (max-width: 600px) {
  .header-right { gap: 10px; }
  .account-name, .connection { display: none; }
}

/* ---------------------------------------------------------------- ロビー */

/* タブ（ログインの「ゲストで遊ぶ」「ログイン / 登録」と、ロビーの「対戦に参加」「対戦を作成」。選んでいるタブは上に青い線） */
.tabs { display: flex; gap: 4px; margin-bottom: -1px; }

.tabs .tab {
  padding: 10px 20px;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
}

.tabs .tab:hover:not(:disabled) { background: transparent; color: var(--text); }

.tabs .tab.active {
  position: relative;
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
  box-shadow: inset 0 3px 0 var(--primary-hover);
}

.tabs .tab.active:hover { background: var(--surface); }

.tabs ~ .lobby { border-top-left-radius: 0; }

/* ロビーの「対戦に参加」「対戦を作成」は文字を大きくする */
.lobby-tabs .tab { padding: 12px 26px; font-size: 19px; }

@media (max-width: 600px) {
  .lobby-tabs .tab { padding: 10px 16px; font-size: 17px; }
}

.lobby.create-panel { padding: 32px 20px; }

.lobby {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 20px;
}

/* 列: ホスト / ゲーム / 制限時間 / 予測ライン / ボタン */
.lobby-head,
.room-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px 96px minmax(0, 1fr) 72px;
  align-items: center;
  gap: 12px;
}

.lobby-head {
  padding: 16px 0;
  font-size: 18px;
  font-weight: bold;
  border-bottom: 1px solid var(--border);
}

.room-list { list-style: none; margin: 0; padding: 0; }

.room-row { padding: 14px 0; border-bottom: 1px solid var(--border); }

.room-row:last-child { border-bottom: none; }

.room-row.mine { background: var(--mine); margin: 0 -20px; padding: 14px 20px; }

.room-row.full .host,
.room-row.full .game-type,
.room-row.full .rule { opacity: 0.55; }

.host { display: flex; align-items: center; gap: 12px; min-width: 0; }

.avatar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border);
  font-weight: bold;
  color: #ffffff;
}

.host-name,
.rule {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.host-name { font-weight: bold; }

.rule { color: var(--muted); }

.game-type { font-weight: bold; white-space: nowrap; }

.room-row button { width: 100%; padding: 6px 0; font-size: 14px; }

.lobby-empty { margin: 0; padding: 24px 0; color: var(--muted); text-align: center; }

/* 対戦の設定（1 つ 1 行）を縦に並べ、一番下に「対戦を作成する」 */
.create-options { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; width: max-content; margin: 0 auto; }

.create-options button { align-self: stretch; margin-top: 8px; }

.option { display: flex; align-items: center; gap: 8px; min-height: 36px; cursor: pointer; }

.option input[type="checkbox"] { width: 18px; height: 18px; margin: 0; accent-color: var(--primary-hover); cursor: pointer; }

.option select {
  font: inherit;
  padding: 6px 8px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.option select:disabled { opacity: 0.4; }

/* 種目（8 ボール / 9 ボール）の選択: 画像のボタン。ラジオボタン自体は見えなくして、画像を押すと選ばれる */
.game-type-buttons { gap: 16px; margin-bottom: 4px; }

.game-type-button { position: relative; display: block; cursor: pointer; border-radius: 38px; }

.game-type-button input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.game-type-button img {
  display: block;
  /* 横 300px。狭い画面では 2 つが横に並ぶように縮める */
  width: min(300px, calc(50vw - 40px));
  height: auto;
  user-select: none;
  /* 選んでいない方: セピア色にして暗くする */
  filter: sepia(0.9) saturate(0.5) brightness(0.6);
  transition: filter 0.15s, transform 0.15s;
}

.game-type-button:hover img { filter: sepia(0.6) saturate(0.7) brightness(0.8); }

.game-type-button input:checked + img { filter: none; transform: scale(1.04); }

/* キーボードで選ぶときの目印 */
.game-type-button:has(input:focus-visible) { outline: 2px solid var(--primary-hover); outline-offset: 3px; }


/* 9 ボールのプッシュアウト */
.push-out { justify-content: center; margin-top: 4px; min-height: 0; font-size: 14px; }

.push-out[hidden] { display: none; }

.pass-back { margin-top: 6px; padding: 6px 12px; font-size: 13px; }

/* 狭い画面では制限時間と予測ラインの列を省く（ホストの名前が隠れないように） */
@media (max-width: 600px) {
  .lobby-head,
  .room-row { grid-template-columns: minmax(0, 1fr) 84px 72px; }
  .col-time,
  .col-line,
  .rule { display: none; }
}

/* ---------------------------------------------------------------- 対戦画面 */

/* 対戦中は台を大きく見せるため、main の幅を広げる */
main:has(#game-screen:not([hidden])) { max-width: 1200px; }

/* 対戦画面では、ページの上の帯（ロゴ・接続・音量）は出さず、対戦画面の上の段にまとめる */
body:has(#game-screen:not([hidden])) > header { display: none; }

/* 上の段: 左からロゴ・メッセージ・音量・退出ボタン */
.game-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.game-bar .logo { flex: none; }

.game-actions { display: flex; gap: 8px; }

.game-volume { display: flex; }

/* メッセージ（打つ番・残り時間・ファウル）は、ロゴと音量の間の真ん中に出す */
.turn-box { flex: 1; min-width: 0; text-align: center; }

.turn { margin: 0; font-weight: bold; color: var(--muted); }

.foul { margin: 4px 0 0; font-size: 13px; font-weight: bold; color: #ff6b5e; }

/* ファウルではない知らせ（プッシュアウト） */
.foul.notice { color: #8fc7ff; }

.turn.mine { color: #ffb52e; }

.timer { margin: 4px 0 0; font-size: 20px; font-weight: bold; font-variant-numeric: tabular-nums; }

/* 残り 5 秒以下 */
.timer.low { color: #ff6b5e; }

button.danger { background: #a83228; box-shadow: 0 3px 0 #7a231c; }

button.danger:hover { background: #bd3a2f; }

.table-canvas { display: block; width: 100%; }

/* 対戦の結果は台の真ん中に重ねる */
.table-wrap { position: relative; }

.result {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  min-width: 280px;
  max-width: calc(100% - 32px);
  padding: 24px 28px;
  border-radius: 12px;
  background: rgba(18, 20, 22, 0.88);
  border: 1px solid var(--border);
  text-align: center;
}

.result h3 { margin: 0 0 8px; font-size: 24px; }

.result h3.win { color: #ffb52e; }

.result p { margin: 0 0 18px; color: var(--muted); }

/* 「続ける」の残り時間（押さないと退出する） */
.result p.rematch-timer { margin: -8px 0 14px; color: var(--text); }
.result p.rematch-timer[hidden] { display: none; }

/* 「はい」「いいえ」を横に並べる */
.rematch-buttons { display: flex; justify-content: center; gap: 12px; }
.rematch-buttons[hidden] { display: none; }
.rematch-buttons button { min-width: 96px; }
/* 退出の確認（「本当に退出しますか？」）: 題の下にすぐボタンを並べる */
.leave-buttons { margin-top: 18px; }

/* 台の上の帯: 左に 2 人を縦に並べ（自分が上）、その右に手球を突く位置を選ぶ白球 */
.scoreboard {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 32px;
  margin-bottom: 12px;
}

/* 2 人の行で、アイコン・名前・球の列の位置をそろえる（表のように並べる） */
.seats {
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: center;
  gap: 8px 10px;
  min-width: 0;
}

.seat { display: contents; }

.seat .avatar { width: 44px; height: 44px; font-size: 18px; }

/* 打つ番の人のアイコンをオレンジの輪で囲む */
.seat.active .avatar { border-color: #f07d1a; box-shadow: 0 0 0 3px rgba(240, 125, 26, 0.35); }

.seat-info { display: flex; flex-direction: column; min-width: 0; }

.seat-name { font-size: 22px; line-height: 1.2; font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 勝利数（9 ボールは続けてのファウルの回数も） */
.seat-group { font-size: 16px; color: var(--muted); white-space: nowrap; }

.seat-group.warning { color: #ff6b5e; font-weight: bold; }

.ball-row { display: flex; gap: 3px; }

.mini-ball {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  box-shadow: inset -3px -3px 6px rgba(0, 0, 0, 0.35), 0 0 4px rgba(255, 255, 255, 0.25);
}

.mini-ball span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 29px;
  height: 29px;
  border-radius: 50%;
  background: #f7f5ef;
  color: #111111;
  font-size: 19px;
  font-weight: bold;
}

/* 手球を突く位置を選ぶ白球（2 人の右） */
.spin-picker {
  flex: none;
  width: 119px;
  height: 119px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

/* 打つ番でないときはグレーにして、押せないことを見せる */
.spin-picker.disabled { cursor: default; filter: grayscale(1) brightness(0.55); }

/* 空の枠（グループが決まる前、または落とした球） */
.mini-ball.empty { background: #2a3442; box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.6); }

/* 少し狭い画面では、名前が隠れないように球と白球を少し小さくする */
@media (max-width: 1199px) {
  .mini-ball { width: 38px; height: 38px; }
  .mini-ball span { width: 25px; height: 25px; font-size: 17px; }
  .spin-picker { width: 103px; height: 103px; }
}

@media (max-width: 1099px) {
  .mini-ball { width: 33px; height: 33px; }
  .mini-ball span { width: 22px; height: 22px; font-size: 15px; }
  .spin-picker { width: 86px; height: 86px; }
}

/* 狭い画面では球を小さくし、上の段は折り返して並べる */
@media (max-width: 700px) {
  .game-bar { flex-wrap: wrap; gap: 8px 16px; }
  .turn-box { order: 1; flex-basis: 100%; }
  .game-actions { margin-left: auto; }
  .seat-name { font-size: 18px; }
  .seat-group { font-size: 14px; }
  .mini-ball { width: 22px; height: 22px; }
  .mini-ball span { width: 15px; height: 15px; font-size: 11px; }
  .spin-picker { width: 86px; height: 86px; }
}

.error { color: var(--error); }

/* 名前をクリックすると、その人の情報（成績）を小ウィンドウで出す */
.profile-link { cursor: pointer; }
.profile-link:hover { text-decoration: underline; }

.profile-card {
  position: fixed;
  z-index: 50;
  width: 240px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  font-size: 14px;
}

.profile-head { display: flex; align-items: center; gap: 10px; }
.profile-name { flex: 1; min-width: 0; font-weight: bold; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-card .profile-close { font-size: 20px; line-height: 1; padding: 0 2px; color: var(--muted); text-decoration: none; }

.profile-body { margin-top: 10px; }
.profile-note { margin: 0; color: var(--muted); }

.profile-stats {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  margin: 0;
}
.profile-stats dt { color: var(--muted); }
.profile-stats dd { margin: 0; text-align: right; font-weight: bold; }

/* レベルの札（「Lv 12」。ロビーのホストの名前の横・台の上の帯の勝利数の前） */
.level-badge {
  flex: none;
  display: inline-block;
  margin-right: 6px;
  padding: 0 6px;
  border-radius: 4px;
  background: #3b2f12;
  border: 1px solid #b8892a;
  color: #ffcf5a;
  font-size: 0.8em;
  font-weight: bold;
  line-height: 1.5;
  vertical-align: 1px;
}

.host .level-badge { margin-left: -4px; }

/* 名前をクリックしたときの小ウィンドウ: 次のレベルまでの棒グラフ */
.profile-level { margin-bottom: 10px; }
.level-bar { height: 8px; border-radius: 4px; background: var(--bg); border: 1px solid var(--border); overflow: hidden; }
.level-bar-fill { height: 100%; background: linear-gradient(90deg, #b8892a, #ffcf5a); }
.level-bar-label { margin-top: 4px; font-size: 12px; color: var(--muted); text-align: right; }

/* 勝ってもらったポイント（結果の下） */
.result .result-reward { margin: -8px 0 16px; }
.result .result-reward[hidden] { display: none; }
.result p.reward-points { margin: 0; font-size: 22px; font-weight: bold; color: #ffcf5a; }
.result p.reward-detail { margin: 2px 0 0; font-size: 13px; }
.result p.reward-level-up { margin: 6px 0 0; font-size: 18px; font-weight: bold; color: #7fe08a; }

/* 自分の情報の下の「アカウントを削除」 */
.profile-card .profile-delete { display: block; margin: 12px 0 0 auto; padding: 0; font-size: 13px; color: var(--error); }
.profile-card .profile-delete:hover:not(:disabled) { color: #ff9a90; }

/* ページの下のリンク（プライバシーポリシー）。対戦画面では出さない */
.site-footer { padding: 24px 16px 32px; text-align: center; font-size: 13px; }
body:has(#game-screen:not([hidden])) .site-footer { display: none; }
.site-footer a,
.login-note a,
.doc a { color: var(--muted); }
.site-footer a:hover,
.login-note a:hover,
.doc a:hover { color: var(--text); }

/* プライバシーポリシーなどの文章のページ */
.doc { line-height: 1.8; font-size: 15px; }
.doc h2 { margin: 8px 0 16px; font-size: 24px; }
.doc h3 { margin: 28px 0 8px; font-size: 17px; }
.doc p, .doc ul { margin: 0 0 12px; }
.doc ul { padding-left: 1.4em; }
.doc li { margin-bottom: 6px; }
.doc strong { color: var(--text); }
.doc .placeholder { color: #ffcf5a; font-weight: bold; }
.doc .doc-date { margin-top: 28px; color: var(--muted); font-size: 13px; }
.doc a:link, .doc a:visited { text-decoration: underline; }

/* ---------------------------------------------------------------- タッチの操作（スマホ・タブレット） */

/* 台と、その右のタッチの操作を横に並べる */
.table-row { display: flex; gap: 10px; justify-content: center; }
.table-row .table-wrap { flex: 1; min-width: 0; }

/* 台と手球を突く位置の白球を指で触っている間は、画面をスクロールさせない */
.table-canvas,
.spin-picker { touch-action: none; }

/* 右の操作（↺・強さのつまみ・↻）は、指で操作する機器（スマホ・タブレット）だけに出す */
.touch-controls { display: none; }

@media (pointer: coarse) {
  .touch-controls {
    display: flex;
    flex: none;
    flex-direction: column;
    gap: 8px;
    width: 56px;
    user-select: none;
    -webkit-user-select: none;
  }
}

/* 打てないとき（打つ番でない・球が動いている）は薄くして、触っても何もしない */
.touch-controls.disabled { opacity: 0.35; pointer-events: none; }

.touch-aim { flex: none; height: 44px; padding: 0; font-size: 22px; line-height: 1; touch-action: none; }

/* 強さのつまみ: 下へ引くほど強い。引いた分だけオレンジ（最大は紫）に塗る */
.power-track {
  position: relative;
  flex: 1;
  min-height: 120px;
  border-radius: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  touch-action: none;
}

.power-fill { position: absolute; left: 0; right: 0; top: 0; height: 0; background: linear-gradient(#f07d1a, #ffb52e); }
.power-fill.max { background: linear-gradient(#7b3fe4, #b07cff); }

.power-knob {
  position: absolute;
  top: 4px;
  left: 4px;
  right: 4px;
  height: 46px;
  border-radius: 23px;
  background: #e6e8ea;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

.power-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  text-align: center;
  font-size: 12px;
  font-weight: bold;
  color: var(--text);
  pointer-events: none;
}

/* 背の低い画面（スマホの横向き）: ロゴを出さず、台が画面の高さに収まる大きさにする（台の縦横の比は 2910:1640） */
@media (pointer: coarse) and (max-height: 500px) {
  body:has(#game-screen:not([hidden])) main { padding-top: 8px; padding-bottom: 8px; }
  .game-bar { margin-bottom: 6px; }
  .game-bar .logo { display: none; }
  .table-row .table-wrap { flex: 0 1 auto; width: min(100%, calc((100dvh - 16px) * 2910 / 1640)); }
}

/* 回線が切れて、つなぎ直しを待っている人（台の上の帯） */
.seat-away { font-weight: bold; color: #ff6b5e; }

/* ---------------------------------------------------------------- バージョンのボタンと更新情報 */

/* 設定の歯車（音量のマークと同じ大きさ・色。まだ見ていない新しい版があると右上に青い点） */
.settings-button {
  position: relative;
  display: flex;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: none;
  box-shadow: none;
  cursor: pointer;
}
.settings-button:hover:not(:disabled),
.settings-button[aria-expanded="true"] { color: var(--text); background: transparent; }
.settings-icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.settings-button[aria-expanded="true"] .settings-icon { transform: rotate(30deg); }
.settings-icon { transition: transform 0.2s; }
.settings-dot { display: none; width: 8px; height: 8px; border-radius: 50%; background: #3d9bff; }
.settings-button .settings-dot { position: absolute; top: -1px; right: -2px; box-shadow: 0 0 0 2px var(--bg); }
.settings-button.unseen .settings-dot,
.settings-link.unseen .settings-dot { display: inline-block; }

/* 押すと出る設定の小ウィンドウ（設定の面と、更新情報の面を切り替える） */
.settings-panel {
  position: fixed;
  z-index: 50;
  width: min(340px, calc(100vw - 16px));
  max-height: min(480px, calc(100vh - 100px));
  overflow-y: auto;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  font-size: 13px;
  line-height: 1.6;
}
.settings-panel[hidden] { display: none; }
.settings-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.settings-title { flex: 1; font-size: 15px; font-weight: bold; }
.settings-panel .settings-close,
.settings-panel .settings-back { font-size: 20px; line-height: 1; padding: 0 2px; color: var(--muted); text-decoration: none; }
.settings-panel .settings-back { font-size: 24px; margin-top: -3px; }
.settings-list { display: flex; flex-direction: column; }
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  padding: 0 4px;
  font-size: 14px;
  color: var(--text);
}
.settings-row + .settings-row { border-top: 1px solid var(--border); }
.settings-select {
  font: inherit;
  padding: 3px 6px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
}
/* 「更新情報 ›」の行（押すと更新情報の面へ） */
.settings-link {
  width: 100%;
  font: inherit;
  font-size: 14px;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
}
.settings-link:hover:not(:disabled) { background: var(--bg); }
.settings-link-label { display: inline-flex; align-items: center; gap: 6px; }
.settings-arrow { font-size: 20px; line-height: 1; color: var(--muted); }
.settings-value { color: var(--muted); font-variant-numeric: tabular-nums; }

.whats-new-release { padding: 8px 0; }
.whats-new-release + .whats-new-release { border-top: 1px solid var(--border); }
.whats-new-release-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.whats-new-tag { padding: 0 7px; border-radius: 4px; background: var(--bg); border: 1px solid var(--border); font-weight: bold; font-size: 12px; }
.whats-new-tag.latest { background: #1d2a35; border-color: #2c5a80; color: #8fc7ff; }
.whats-new-date { color: var(--muted); font-size: 12px; }
.whats-new-label { margin-left: auto; padding: 0 6px; border-radius: 4px; background: #3d9bff; color: #ffffff; font-size: 11px; font-weight: bold; }
.whats-new-release ul { margin: 0; padding-left: 1.3em; }
.whats-new-release li { margin: 2px 0; }
.whats-new-older { margin-top: 4px; border-top: 1px solid var(--border); padding-top: 8px; }
.whats-new-older summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.whats-new-older summary:hover { color: var(--text); }

