/* =========================================================
 * cup-shuffle（カップシャッフル） スタイル
 * ========================================================= */
:root {
  --font-jp: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", Meiryo, sans-serif;
  --font-num: "SF Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --c-bg: #0d1020;
  --c-text: #f7f1e3;
  --c-dim: #b9b3c9;
  --c-gold: #f2c14e;
  --c-gold-deep: #c98d1c;
  --c-red: #e2434b;
  --c-green: #4fd18b;
  --c-panel: rgba(20, 21, 40, 0.94);
  --c-line: rgba(242, 193, 78, 0.35);
  /* ランキング（sgr-*）は明るいパネルで出す */
  --c-sgr-text: #1f2233;
  --c-sgr-dim: #6b6f85;
  --c-sgr-line: rgba(31, 34, 51, 0.14);
}

* { 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: var(--c-bg);
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-text-size-adjust: 100%;
  -webkit-touch-callout: none;
}

[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ===== レイアウト =====
   共通ヘッダー(--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 と共通ヘッダーが押す元ボタンは DOM に残す（見えなくするだけ） */
#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: 17px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--c-gold);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
}

#topbar-buttons {
  display: flex;
  gap: 6px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  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: 16px;
  line-height: 1;
  cursor: pointer;
}

.icon-btn:active { transform: scale(0.94); }

/* ===== ステージ ===== */
#stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #0b0d1a;
}

#game-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: manipulation;
}

/* ===== コップを選ぶボタン（透明。コップの上に重ねる） ===== */
#cup-picks {
  position: absolute;
  inset: 0;
  z-index: 15;
  pointer-events: none;
}

.cup-pick {
  position: absolute;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  outline: none;
}

.cup-pick:focus-visible {
  box-shadow: 0 0 0 3px var(--c-gold), 0 0 22px rgba(242, 193, 78, 0.55);
}

.cup-pick__no {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  min-width: 24px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: rgba(255, 255, 255, 0.92);
  font-family: var(--font-num);
  font-size: 12px;
  font-weight: bold;
  line-height: 18px;
  text-align: center;
}

/* タッチ端末では番号を出さない（数字キーの手がかりなので） */
@media (hover: none) {
  .cup-pick__no { display: none; }
}

/* ===== HUD ===== */
#hud {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px 0;
  padding-left: calc(12px + env(safe-area-inset-left, 0px));
  padding-right: calc(12px + env(safe-area-inset-right, 0px));
  pointer-events: none;
}

.hud-cell {
  display: flex;
  flex-direction: column;
  min-width: 76px;
  padding: 5px 10px 6px;
  border-radius: 10px;
  background: rgba(8, 9, 20, 0.55);
  border: 1px solid rgba(242, 193, 78, 0.22);
}

.hud-left { align-items: flex-start; }
.hud-right { align-items: flex-end; }

.hud-center {
  align-items: center;
  min-width: 0;
  flex: 0 1 auto;
}

.hud-label {
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 0.16em;
  color: var(--c-dim);
}

.hud-value {
  font-family: var(--font-num);
  font-size: 20px;
  font-weight: bold;
  line-height: 1.15;
  color: var(--c-gold);
  font-variant-numeric: tabular-nums;
}

.hud-value.bump { animation: bump 0.35s ease-out; }

@keyframes bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

.hud-meta {
  font-family: var(--font-num);
  font-size: 16px;
  font-weight: bold;
  line-height: 1.3;
  color: #fff;
  white-space: nowrap;
}

/* ===== 案内の帯 ===== */
.banner {
  position: absolute;
  left: 50%;
  top: 23%;
  z-index: 12;
  margin: 0;
  padding: 7px 20px;
  border-radius: 999px;
  transform: translate(-50%, -50%) scale(0.9);
  background: rgba(8, 9, 20, 0.62);
  border: 1px solid rgba(242, 193, 78, 0.4);
  color: #fff;
  font-size: clamp(16px, 4.6vw, 24px);
  font-weight: 800;
  letter-spacing: 0.06em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.banner.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.banner.good { color: var(--c-green); border-color: rgba(79, 209, 139, 0.6); }
.banner.bad { color: #ff7a82; border-color: rgba(226, 67, 75, 0.6); }
.banner.info { color: var(--c-gold); }

/* ===== 得点のポップ ===== */
#floats {
  position: absolute;
  inset: 0;
  z-index: 13;
  pointer-events: none;
  overflow: hidden;
}

.float {
  position: absolute;
  transform: translate(-50%, -50%);
  font-family: var(--font-num);
  font-size: 22px;
  font-weight: 900;
  color: var(--c-gold);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
  animation: float-up 1.1s ease-out forwards;
}

.float small {
  display: block;
  font-family: var(--font-jp);
  font-size: 12px;
  font-weight: bold;
  color: #fff;
  text-align: center;
}

.float.bad { color: #ff5a64; font-size: 30px; }

@keyframes float-up {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(0.7); }
  15% { opacity: 1; transform: translate(-50%, -60%) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -180%) scale(1); }
}

/* ===== 画面（タイトル・リザルト・一時停止） ===== */
.screen {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  padding-left: calc(16px + env(safe-area-inset-left, 0px));
  padding-right: calc(16px + env(safe-area-inset-right, 0px));
  background: radial-gradient(ellipse at 50% 45%, rgba(10, 12, 26, 0.35), rgba(6, 7, 16, 0.78));
  overflow-y: auto;
}

/* タイトル・リザルトは下のフッター（2行）と重ならないように、そのぶん上へ寄せる */
#screen-title,
#screen-result { padding-bottom: 50px; }

.screen-dim { background: rgba(6, 7, 16, 0.92); }

.panel {
  width: min(400px, 100%);
  margin: auto;
  padding: 22px 20px 20px;
  border-radius: 18px;
  background: var(--c-panel);
  border: 1px solid var(--c-line);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  text-align: center;
}

.title-panel { padding-top: 26px; }

.title-en {
  margin: 0;
  font-family: var(--font-num);
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 0.42em;
  color: var(--c-gold);
}

.title-ja {
  margin: 6px 0 0;
  font-size: clamp(30px, 9vw, 40px);
  font-weight: 900;
  letter-spacing: 0.06em;
  background: linear-gradient(180deg, #fff3c4, #f2c14e 55%, #d08f1a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.35));
}

.title-catch {
  margin: 12px 0 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--c-text);
}

.title-best {
  display: inline-block;
  margin: 14px 0 0;
  padding: 4px 14px;
  border-radius: 999px;
  background: rgba(242, 193, 78, 0.12);
  border: 1px solid rgba(242, 193, 78, 0.3);
  font-size: 13px;
  font-weight: bold;
  color: var(--c-gold);
}

.title-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

.title-sub-buttons {
  display: flex;
  gap: 8px;
}

.title-sub-buttons .btn {
  flex: 1;
  padding: 10px 8px;
  font-size: 14px;
  white-space: nowrap;
}

.title-hint {
  margin: 14px 0 0;
  font-size: 11px;
  color: var(--c-dim);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 12px;
  font-family: var(--font-jp);
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  touch-action: manipulation;
}

.btn:active { transform: scale(0.97); }

.btn:focus-visible {
  outline: 3px solid var(--c-gold);
  outline-offset: 2px;
}

.btn-primary {
  border: 0;
  background: linear-gradient(180deg, #f25b62, #c92f38);
  color: #fff;
  font-size: 17px;
  box-shadow: 0 4px 0 #8c1f26, 0 8px 18px rgba(201, 47, 56, 0.4);
}

.btn-primary:active { box-shadow: 0 2px 0 #8c1f26; transform: translateY(2px); }

.btn-sub {
  border: 1px solid rgba(242, 193, 78, 0.4);
  background: rgba(242, 193, 78, 0.08);
  color: var(--c-text);
}

/* リザルト */
.result-title {
  margin: 0;
  font-family: var(--font-num);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.2em;
  color: #ff7a82;
}

.result-new {
  margin: 8px 0 0;
  font-size: 14px;
  font-weight: bold;
  color: var(--c-gold);
  animation: glow 1.2s ease-in-out infinite alternate;
}

@keyframes glow {
  from { text-shadow: 0 0 4px rgba(242, 193, 78, 0.3); }
  to { text-shadow: 0 0 14px rgba(242, 193, 78, 0.9); }
}

.result-score-row {
  margin: 10px 0 0;
  font-family: var(--font-num);
  color: var(--c-gold);
}

#result-score {
  font-size: 46px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.result-unit {
  margin-left: 4px;
  font-family: var(--font-jp);
  font-size: 16px;
  font-weight: bold;
}

.result-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 14px 0 16px;
}

.rstat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.rstat-label {
  font-size: 11px;
  color: var(--c-dim);
}

.rstat span:last-child {
  font-size: 16px;
  font-weight: bold;
}

.result-buttons {
  display: flex;
  gap: 8px;
}

.result-buttons .btn { flex: 1; }

/* 一時停止 */
.paused-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--c-text);
  font-family: var(--font-jp);
  cursor: pointer;
}

.paused-panel:focus-visible {
  outline: 3px solid var(--c-gold);
  outline-offset: 3px;
}

.paused-title {
  font-size: 22px;
  font-weight: 900;
  color: var(--c-gold);
}

.paused-note {
  font-size: 13px;
  line-height: 1.6;
  color: #ffb3b8;
}

.paused-note:empty { display: none; }

.paused-hint {
  font-size: 13px;
  color: var(--c-dim);
}

/* ===== 遊び方モーダル ===== */
.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(6, 7, 16, 0.72);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.modal-box {
  width: min(460px, 100%);
  max-height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 18px 18px;
  border-radius: 16px;
  background: var(--c-panel);
  border: 1px solid var(--c-line);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  text-align: center;
}

.modal-title {
  margin: 0 0 10px;
  font-size: 19px;
  color: var(--c-gold);
}

.howto {
  margin: 0 0 16px;
  padding: 0 0 0 1.2em;
  text-align: left;
  font-size: 14px;
  line-height: 1.7;
}

.howto li + li { margin-top: 6px; }
.howto b { color: var(--c-gold); }

.modal-box .btn { min-width: 160px; }

/* ===== フッター ===== */
#footer {
  position: absolute;
  left: 0;
  right: 0;
  /* #app 自体が広告の上で終わっているので、ここで --ad-space を足さない（足すと広告の高さぶん浮いてパネルと重なる） */
  bottom: 6px;
  text-align: center;
  font-size: 11px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.78);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  z-index: 31;
}

#footer a {
  color: var(--c-gold);
  pointer-events: auto;
}

body.playing #footer { display: none; }

/* 高さの小さいスマホ（iPhone SE など）: タイトルを1行に収め、パネルを詰める */
@media (max-height: 700px) {
  .title-panel { padding: 18px 16px 16px; }
  .title-ja { font-size: clamp(26px, 8.4vw, 36px); letter-spacing: 0.02em; }
  .title-catch { margin-top: 8px; font-size: 13px; line-height: 1.6; }
  .title-best { margin-top: 10px; }
  .title-buttons { margin-top: 12px; gap: 8px; }
  .title-hint { display: none; }
  .result-panel { padding: 16px 14px 14px; }
  .result-stats { margin: 10px 0 12px; }
}

@media (max-height: 520px) {
  /* フッターは1行にまとめ、パネルはその上に収める */
  #footer { display: flex; justify-content: center; gap: 10px; bottom: 3px; font-size: 10px; line-height: 1.4; }
  #screen-title, #screen-result { padding-top: 8px; padding-bottom: 24px; }
  .result-title { font-size: 18px; }
  .result-new { margin-top: 2px; font-size: 12px; }
  .result-score-row { margin-top: 2px; }
  .rstat { padding: 4px 6px; }
  .result-buttons .btn { min-height: 38px; padding: 6px 12px; }
  .title-catch { display: none; }
  .title-hint { display: none; }
  .panel { padding: 14px 16px; }
  #result-score { font-size: 32px; }
  .result-stats { grid-template-columns: repeat(4, 1fr); margin: 6px 0 8px; gap: 6px; }
  .rstat-label { font-size: 10px; white-space: nowrap; }
  .rstat span:last-child { font-size: 13px; white-space: nowrap; }
  /* 横向きのスマホ: HUD を詰めて、持ち上げたコップと重ならないようにする */
  #hud { padding-top: 4px; }
  .hud-cell { min-width: 60px; padding: 2px 8px 3px; }
  .hud-label { font-size: 9px; }
  .hud-value { font-size: 15px; }
  .hud-meta { font-size: 13px; }
  .banner { top: 17%; padding: 4px 14px; font-size: 15px; }
}

/* ===== 全国ランキング（共通モジュール 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, 7, 16, 0.7);
  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: #fbf8f0;
  color: var(--c-sgr-text);
  border-radius: 14px;
  padding: 20px 18px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.5);
  -webkit-user-select: text;
  user-select: text;
}

.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-sgr-line);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: bold;
  font-family: var(--font-jp);
  background: rgba(201, 47, 56, 0.06);
  color: var(--c-sgr-text);
  cursor: pointer;
}

.sgr-tab-active {
  background: linear-gradient(135deg, #e2434b, #b52a32);
  border-color: transparent;
  color: #fff;
}

.sgr-register-msg {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: bold;
  text-align: center;
  color: #c4620c;
}

.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-sgr-line);
  border-radius: 8px;
  background: #fff;
  color: var(--c-sgr-text);
  -webkit-user-select: text;
  user-select: text;
}

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

.sgr-name:focus {
  outline: none;
  border-color: #e2434b;
  box-shadow: 0 0 8px rgba(226, 67, 75, 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, #e2434b, #b52a32);
  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: #c9252e;
}

.sgr-status {
  margin: 0;
  font-size: 13px;
  text-align: center;
  color: var(--c-sgr-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(201, 47, 56, 0.06); }

.sgr-row.sgr-row-me {
  background: linear-gradient(135deg, #e2434b, #b52a32);
  color: #fff;
}

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

.sgr-rank-top1 { color: #c98d1c; }
.sgr-rank-top2 { color: #8a93a6; }
.sgr-rank-top3 { color: #b0703a; }
.sgr-row-me .sgr-rank { color: #fff; }

.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-sgr-line);
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
  font-weight: bold;
  font-family: var(--font-jp);
  background: rgba(201, 47, 56, 0.06);
  color: var(--c-sgr-text);
  cursor: pointer;
}

.sgr-close:hover { border-color: #e2434b; }

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

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

.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, #f5c24e, #e08a1a);
  color: #2a1a00;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(224, 138, 26, 0.4);
}

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

.sgr-cta-link {
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: bold;
  font-family: var(--font-jp);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.2);
  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; }
}
