/* =========================================================
 * シール剥がし（seal-hagashi） スタイル
 * ========================================================= */
:root {
  --font-jp: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Hiragino Sans", sans-serif;
  --font-num: "SF Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --c-text: #2b1d14;
  --c-dim: #7d6a5a;
  --c-accent: #e2502a;
  --c-accent-deep: #b4361a;
  --c-gold: #f7c444;
  --c-green: #49b85a;
  --c-red: #d64545;
  --c-panel: rgba(255, 250, 241, 0.97);
  --c-line: rgba(43, 29, 20, 0.14);
  --c-glass: rgba(26, 18, 12, 0.78);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  font-family: var(--font-jp);
  color: var(--c-text);
  background: #17130f;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-text-size-adjust: 100%;
}

.hidden { display: none !important; }
button { font-family: var(--font-jp); }
button:focus-visible, a:focus-visible { outline: 3px solid #7fc4ff; outline-offset: 2px; }

/* ===== レイアウト =====
   共通ヘッダー(--sgh-top)とフッター広告(--ad-space)のぶんだけ内側に収める */
#app {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--sgh-top, 0px);
  bottom: var(--ad-space, 0px);
  display: flex;
  flex-direction: column;
}

/* ===== 上部バー =====
   タイトルだけの帯は縦幅を圧迫するので隠す（画面には出さず、スクリーンリーダー向けにだけ残す）。
   h1（ゲームタイトル）と、共通ヘッダーのメニューが click() で押す元ボタンは DOM に残す。
   position: absolute でフローから外れるので、#stage（flex: 1）が共通ヘッダーの直下から全部を使う */
#topbar {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
#logo {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #ffe9b0;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
#topbar-buttons { display: flex; gap: 6px; flex: none; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

/* ===== ステージ ===== */
#stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #17130f;
}
#game-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: pointer;
}
/* 周辺減光 */
#stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(14, 7, 3, 0.5) 100%);
  z-index: 1;
}

/* 限界をこえているあいだ、ふちが赤く脈打つ */
#stage::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  box-shadow: inset 0 0 70px 18px rgba(230, 40, 30, 0.75);
  transition: opacity 0.12s;
}
body.danger #stage::before { opacity: 1; animation: danger-pulse 0.22s ease-in-out infinite alternate; }
@keyframes danger-pulse { from { opacity: 0.55; } to { opacity: 1; } }

/* ===== 上の表示（何枚目・タイム・合計） ===== */
#hud {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 10;
  padding: 6px 8px 0;
  padding-left: calc(8px + env(safe-area-inset-left, 0px));
  padding-right: calc(8px + env(safe-area-inset-right, 0px));
  pointer-events: none;
}
#hud-row {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 620px;
  margin: 0 auto;
  padding: 6px 12px;
  border-radius: 12px;
  background: var(--c-glass);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}
#hud-stage { flex: none; padding: 2px 8px; border-radius: 999px; background: var(--c-accent); font-family: var(--font-num); font-size: 12px; }
#hud-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #ffe9b0; }
#hud-time { flex: none; font-family: var(--font-num); color: #d9e6ff; }
#hud-score-wrap { flex: none; font-size: 11px; color: rgba(255, 255, 255, 0.75); }
#hud-score { font-family: var(--font-num); font-size: 15px; color: var(--c-gold); }

/* ===== 下の表示（ひとこと・張りゲージ） ===== */
#panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  padding: 0 10px 10px;
  padding-left: calc(10px + env(safe-area-inset-left, 0px));
  padding-right: calc(10px + env(safe-area-inset-right, 0px));
  pointer-events: none;
}
#instr {
  max-width: 620px;
  min-height: 2.5em;
  margin: 0 auto 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9), 0 0 10px rgba(0, 0, 0, 0.6);
}
#gauge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 620px;
  margin: 0 auto;
  padding: 8px 12px;
  border-radius: 14px;
  background: var(--c-glass);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}
.gauge-lab { flex: none; font-size: 11px; font-weight: 900; color: rgba(255, 255, 255, 0.85); }
.gauge-lab-r { color: #ff8f80; }
#gauge {
  position: relative;
  flex: 1;
  height: 18px;
  border-radius: 999px;
  overflow: hidden;
  /* 0〜0.62 緑 / 〜1.0 黄 / 〜1.5 赤（全体が 1.5） */
  background: linear-gradient(90deg, rgba(73, 184, 90, 0.28) 0 41.3%, rgba(247, 196, 68, 0.3) 41.3% 66.7%, rgba(214, 69, 69, 0.36) 66.7% 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}
#gauge-fill {
  position: absolute;
  inset: 0;
  transform-origin: 0 50%;
  transform: scaleX(0);
  border-radius: 999px;
  background: var(--c-green);
  will-change: transform;
}
#gauge.zone-yellow #gauge-fill { background: var(--c-gold); }
#gauge.zone-red #gauge-fill { background: #ff4b3a; }
.gauge-mark { position: absolute; left: 66.7%; top: 0; bottom: 0; width: 2px; background: #fff; opacity: 0.85; }

/* ===== ひとこと（破れた・ステージ名） ===== */
#banner {
  position: absolute;
  left: 50%;
  top: 24%;
  z-index: 12;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(20, 14, 10, 0.82);
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 8px) scale(0.92);
  transition: opacity 0.18s, transform 0.18s;
  pointer-events: none;
}
#banner.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
#banner.bad { background: rgba(190, 36, 28, 0.94); font-size: 20px; }
#banner.name { color: #ffe9b0; }

/* ===== 1 枚ごとの結果 ===== */
#card {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 20;
  width: min(330px, calc(100% - 32px));
  padding: 16px 16px 14px;
  border-radius: 18px;
  background: var(--c-panel);
  color: var(--c-text);
  text-align: center;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.55);
  transform: translate(-50%, -50%);
  animation: card-in 0.28s cubic-bezier(0.2, 1.3, 0.4, 1);
}
@keyframes card-in { from { opacity: 0; transform: translate(-50%, -44%) scale(0.9); } }
#card-title { margin: 0; font-size: 24px; font-weight: 900; color: var(--c-accent-deep); }
#card.perfect #card-title { color: #d98a00; text-shadow: 0 0 14px rgba(247, 196, 68, 0.6); }
#card.bad #card-title { color: #777; }
#card-sub { margin: 2px 0 8px; font-size: 12.5px; font-weight: 700; color: var(--c-dim); }
#card-rows { list-style: none; margin: 0; padding: 0; text-align: left; }
#card-rows li { display: flex; align-items: baseline; gap: 8px; padding: 6px 4px; border-top: 1px solid var(--c-line); font-size: 13.5px; }
.cr-l { flex: none; width: 4.6em; font-weight: 900; }
.cr-m { flex: 1; color: var(--c-dim); font-size: 12.5px; }
.cr-p { font-family: var(--font-num); font-size: 15px; }
#card-total { margin: 4px 0 10px; padding-top: 6px; border-top: 1px solid var(--c-line); font-family: var(--font-num); font-size: 38px; font-weight: 900; line-height: 1.1; color: var(--c-accent-deep); }
#card .btn { width: 100%; }

#fade { position: absolute; inset: 0; z-index: 25; background: #17130f; opacity: 0; pointer-events: none; transition: opacity 0.26s; }
#fade.on { opacity: 1; }

/* ===== 読み込み中 ===== */
#screen-loading { background: #17130f; }
.loading-panel { text-align: center; color: #f5e6d3; font-size: 14px; }
.loading-seal {
  width: 54px;
  height: 36px;
  margin: 0 auto 14px;
  border-radius: 5px;
  background: linear-gradient(135deg, #fbfaf5 0 62%, #d9d5c8 62% 66%, #f0c9a0 66%);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
  animation: seal-wob 1s ease-in-out infinite;
}
@keyframes seal-wob { 50% { transform: rotate(-6deg) translateY(-5px); } }

/* ===== 画面オーバーレイ共通 ===== */
.screen {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}


/* ===== タイトル画面（シールが見えるように、上に寄せる） ===== */
#screen-title { align-items: flex-start; background: linear-gradient(180deg, rgba(16, 9, 5, 0.86) 0, rgba(16, 9, 5, 0.6) 46%, rgba(16, 9, 5, 0) 74%); }
.title-panel { width: min(430px, 100%); margin-top: 1vh; text-align: center; color: #fff; }
.title-en { margin: 0; font-size: 11px; font-weight: 800; letter-spacing: 0.34em; color: #ffcf7a; }
.title-ja { margin: 4px 0 2px; font-weight: 900; line-height: 1.05; text-shadow: 0 3px 0 #7a2410, 0 6px 16px rgba(0, 0, 0, 0.6); }
.title-ja .t1 { font-size: clamp(40px, 12vw, 60px); color: #ffe9b0; }
.title-ja .t2 { font-size: clamp(40px, 12vw, 60px); color: #ff8a3c; margin-left: 0.22em; }
.title-catch { margin: 6px 0 4px; font-size: 15px; font-weight: 900; color: #fff3dd; }
.title-desc { margin: 0 auto 8px; max-width: 360px; font-size: 12.5px; line-height: 1.6; color: rgba(255, 240, 220, 0.85); }
#title-best { margin: 0 0 8px; min-height: 1.3em; font-size: 13px; font-weight: 800; color: var(--c-gold); }
.title-buttons { display: flex; flex-direction: column; gap: 8px; align-items: stretch; max-width: 320px; margin: 0 auto; }
.title-sub-buttons { display: flex; gap: 8px; }
.title-sub-buttons .btn { flex: 1; }

/* ===== ボタン ===== */
.btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 14px;
  padding: 12px 18px;
  font-family: var(--font-jp);
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  line-height: 1.25;
}
.btn small { font-size: 11px; font-weight: 700; opacity: 0.88; }
.btn:active { transform: scale(0.97); }
.btn-primary {
  color: #fff;
  font-size: 19px;
  background: linear-gradient(135deg, #f0702e, #c63b16);
  box-shadow: 0 6px 18px rgba(198, 59, 22, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-sub { color: #fff1de; font-size: 14px; padding: 10px 12px; background: rgba(40, 26, 16, 0.72); border: 1px solid rgba(255, 230, 190, 0.26); }
.btn-sub:hover { background: rgba(70, 46, 28, 0.8); }

/* ===== 結果 ===== */
#screen-result { background: rgba(12, 7, 4, 0.72); }
.result-panel {
  width: min(430px, 100%);
  margin: auto;
  padding: 16px 16px 14px;
  border-radius: 18px;
  background: var(--c-panel);
  color: var(--c-text);
  text-align: center;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.55);
}
.result-eyebrow { margin: 0; font-size: 12px; font-weight: 800; color: var(--c-dim); letter-spacing: 0.1em; }
.result-rank { margin: 4px 0 0; font-size: 30px; font-weight: 900; color: var(--c-accent-deep); }
.result-rank.rank-4 { color: #d98a00; text-shadow: 0 0 14px rgba(247, 196, 68, 0.6); }
.result-rank.rank-0 { color: #777; }
.result-score-row { margin: 0; font-family: var(--font-num); }
#result-score { font-size: 48px; font-weight: 900; line-height: 1.1; }
.result-unit { margin-left: 4px; font-size: 14px; font-weight: 800; color: var(--c-dim); }
#result-new { margin: 2px 0 0; font-size: 13px; font-weight: 900; color: #d98a00; }
.result-msg { margin: 4px 0 10px; font-size: 13px; font-weight: 700; color: var(--c-dim); }
#result-rows { list-style: none; margin: 0 0 12px; padding: 0; text-align: left; }
#result-rows li { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-top: 1px solid var(--c-line); }
.rr-face { font-size: 22px; line-height: 1; }
.rr-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rr-mid b { font-size: 13.5px; }
.rr-mid small { font-size: 11.5px; color: var(--c-dim); }
.rr-pt { font-family: var(--font-num); font-size: 17px; font-weight: 900; }
.rr-pt.hi { color: #d98a00; }
.rr-pt.lo { color: #8a8078; }
.result-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.result-buttons .btn-primary { flex: 1 1 100%; }
.result-buttons .btn-sub { flex: 1; color: var(--c-text); background: rgba(43, 29, 20, 0.07); border-color: var(--c-line); }
#share-msg { margin: 6px 0 0; min-height: 1em; font-size: 12px; color: var(--c-dim); }

/* ===== 一時停止・エラー ===== */
#screen-paused, #gl-error { background: rgba(10, 7, 5, 0.6); }
#screen-paused { cursor: pointer; }
.paused-panel { padding: 22px 26px; border-radius: 16px; text-align: center; color: #fff; background: rgba(30, 20, 13, 0.88); border: 1px solid rgba(255, 220, 170, 0.15); }
.paused-title { margin: 0 0 6px; font-size: 22px; font-weight: 900; }
.paused-hint { margin: 0; font-size: 13px; line-height: 1.6; color: rgba(255, 235, 210, 0.75); }

/* ===== モーダル（遊び方）。広告より上に出すため body 直下に置く ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2147482800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  padding-top: calc(16px + var(--sgh-top, 0px));
  padding-bottom: calc(16px + var(--ad-space, 0px));
  background: rgba(8, 6, 4, 0.66);
}
.modal-box {
  width: min(520px, 100%);
  max-height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px 18px 16px;
  border-radius: 16px;
  background: var(--c-panel);
  color: var(--c-text);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.5);
  -webkit-user-select: text;
  user-select: text;
}
.modal-title { margin: 0 0 10px; font-size: 19px; text-align: center; }
.howto { margin: 0 0 14px; padding-left: 1.4em; font-size: 13.5px; line-height: 1.7; }
.howto li { margin-bottom: 6px; }
.howto b { color: var(--c-accent-deep); }
.modal-box > .btn { width: 100%; }

/* ===== フッター ===== */
#footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  text-align: center;
  font-size: 11px;
  line-height: 1.6;
  color: rgba(255, 240, 225, 0.75);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  pointer-events: none;
  z-index: 40;
  display: none;
}
#footer a { color: #ffd04a; pointer-events: auto; }
body.on-title #footer { display: block; }

/* ===== PC・タブレット ===== */
@media (min-width: 700px) {
  #instr { font-size: 15px; }
  #hud-row { font-size: 14px; }
  #gauge { height: 22px; }
}
/* ===== 横向きのスマホ（背が低い） ===== */
@media (max-height: 520px) and (orientation: landscape) {
  #instr { min-height: 0; margin-bottom: 4px; font-size: 12px; }
  #panel { padding-bottom: 6px; }
  #gauge-row { padding: 5px 10px; }
  #screen-title { align-items: center; justify-content: flex-end; background: linear-gradient(270deg, rgba(16, 9, 5, 0.9) 0, rgba(16, 9, 5, 0.6) 46%, rgba(16, 9, 5, 0) 70%); }
  .title-panel { width: 330px; margin-top: 0; }
  .title-ja .t1, .title-ja .t2 { font-size: 34px; }
  .title-desc { display: none; }
  body.on-title #footer { text-align: left; left: 12px; }
  #card { padding: 10px 14px; }
  #card-total { font-size: 28px; margin-bottom: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .loading-seal, body.danger #stage::before, #card { animation: none; }
}

/* ===== 全国ランキング（共通モジュール sgr-*） ===== */
.sgr-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  background: rgba(6, 12, 18, 0.66);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.sgr-hidden { display: none !important; }

.sgr-panel {
  width: min(420px, 100%);
  max-height: min(80vh, 640px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--c-panel);
  color: var(--c-text);
  border-radius: 14px;
  padding: 20px 18px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.45);
}

.sgr-title {
  margin: 0;
  font-size: 20px;
  text-align: center;
}

.sgr-tabs {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.sgr-tab {
  border: 1px solid var(--c-line);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: bold;
  font-family: var(--font-jp);
  background: rgba(226, 80, 42, 0.08);
  color: var(--c-text);
  cursor: pointer;
}

.sgr-tab-active {
  background: linear-gradient(135deg, var(--c-accent), var(--c-accent-deep));
  border-color: transparent;
  color: #fff;
}

.sgr-register-msg {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: bold;
  text-align: center;
  color: var(--c-orange);
}

.sgr-form { display: flex; gap: 8px; }

.sgr-name {
  flex: 1;
  min-width: 0;
  font-size: 16px; /* iOSズーム防止のため16px以上 */
  font-family: var(--font-jp);
  padding: 8px 10px;
  border: 2px solid var(--c-line);
  border-radius: 8px;
  background: #fff;
  color: var(--c-text);
  -webkit-user-select: text;
  user-select: text;
}

.sgr-name::placeholder { color: var(--c-dim); }

.sgr-name:focus {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: 0 0 8px rgba(226, 80, 42, 0.3);
}

.sgr-submit {
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 15px;
  font-weight: bold;
  font-family: var(--font-jp);
  background: linear-gradient(135deg, var(--c-accent), var(--c-accent-deep));
  color: #fff;
  cursor: pointer;
}

.sgr-submit:hover { filter: brightness(1.1); }

.sgr-submit:disabled { opacity: 0.5; cursor: default; }

.sgr-error {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--c-red);
}

.sgr-status {
  margin: 0;
  font-size: 13px;
  text-align: center;
  color: var(--c-dim);
}

.sgr-list {
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}

.sgr-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.sgr-row:nth-child(even) { background: rgba(226, 80, 42, 0.07); }

.sgr-row.sgr-row-me {
  background: linear-gradient(135deg, var(--c-accent), var(--c-accent-deep));
  color: #fff;
}

.sgr-rank {
  width: 2em;
  text-align: right;
  font-weight: bold;
  flex-shrink: 0;
}

.sgr-row-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sgr-row-score {
  font-weight: bold;
  font-family: var(--font-num);
  flex-shrink: 0;
}

.sgr-close {
  border: 1px solid var(--c-line);
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
  font-weight: bold;
  font-family: var(--font-jp);
  background: rgba(226, 80, 42, 0.08);
  color: var(--c-text);
  cursor: pointer;
}

.sgr-close:hover { border-color: var(--c-accent); }

.sgr-cta {
  margin: 2px 0 12px;
  text-align: center;
}

.sgr-cta-msg {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: bold;
  color: var(--c-orange);
}

.sgr-cta-btn {
  border: none;
  border-radius: 999px;
  padding: 10px 22px;
  font-size: 15px;
  font-weight: bold;
  font-family: var(--font-jp);
  background: linear-gradient(135deg, #f5a623, #f0741e);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(240, 116, 30, 0.4);
}

.sgr-cta-btn:hover { filter: brightness(1.08); }

.sgr-cta-link {
  border: none;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: bold;
  font-family: var(--font-jp);
  background: rgba(30, 43, 56, 0.08);
  border: 1px solid var(--c-line);
  color: var(--c-text);
  cursor: pointer;
}

/* ==========================================================================
   フッター固定バナー広告（スマホ表示時のみ / js/ad-banner.js が挿入する）
   --ad-h    : 広告そのものの高さ。広告なしのときは 0px
   --ad-space: レイアウトが空けるべき高さ（広告 + セーフエリア）
   ========================================================================== */
:root {
  --ad-h: 0px;
  --ad-space: 0px;
}
html.has-ad-banner {
  --ad-space: calc(var(--ad-h, 0px) + env(safe-area-inset-bottom, 0px));
}

.ad-banner {
  /* height は広告そのものの高さ。セーフエリアぶんの padding は外側に足す */
  box-sizing: content-box;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  /* ランキング・リザルト等の全画面オーバーレイ（2147483000）よりは下に置く */
  z-index: 2147482000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  height: var(--ad-h, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  overflow: hidden;
  background: rgba(14, 16, 20, 0.86);
  /* border ではなく inset shadow にして、枠線ぶん高さがずれないようにする */
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.ad-banner__frame {
  display: block;
  width: 100%;
  height: var(--ad-h, 0px);
  border: 0;
  color-scheme: light;
}

@media print {
  .ad-banner { display: none; }
}
