/* ============================================================
   二人麻雀 - Two-Player Mahjong  style.css
   ============================================================ */

:root {
  --felt-1: #2f7d55;
  --felt-2: #17563a;
  --felt-3: #08301f;
  --gold: #e8c46a;
  --gold-dim: #b99a4e;
  --ivory-1: #fdfaf0;
  --ivory-2: #f0e9d5;
  --ivory-edge: #cfc5a8;
  --tile-side: #d9cfae;
  --tile-side-2: #b9ad8a;
  --back-1: #2f6f4e;
  --back-2: #1d4d36;
  --red: #c01c28;
  --ui-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;

  /* JS が上書きする牌サイズ */
  --tw: 26px;  --th: 35px;   /* 手牌 */
  --pw: 20px;  --ph: 27px;   /* 河 */
  --mw: 17px;  --mh: 23px;   /* 副露 */
  --dw: 15px;  --dh: 20px;   /* ドラ表示 */
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overscroll-behavior: none;
}

body {
  font-family: var(--ui-font);
  background:
    radial-gradient(ellipse 120% 90% at 50% -10%, var(--felt-1) 0%, var(--felt-2) 55%, var(--felt-3) 100%);
  background-color: var(--felt-3);
  background-attachment: fixed;
  color: #eef4ef;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

#app {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - var(--sgh-top, 0px) - var(--ad-space, 0px));
  max-width: 720px;
  margin: 0 auto;
  /* 上のセーフエリアは共通ヘッダー（--sgh-top）が、広告があるときの下のセーフエリアは --ad-space が
     すでに取っているので、二重に空けない（ヘッダーが無いときだけ自分で空ける） */
  padding: max(0px, calc(env(safe-area-inset-top, 0px) - var(--sgh-top, 0px))) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
html.has-ad-banner #app { padding-bottom: 0; }

.hidden { display: none !important; }

/* 検証用（?noanim）: すべてのトランジションを無効化 */
.noanim * { transition: none !important; animation: none !important; }

/* ============ ヘッダー ============ */

#topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 3px;
  flex: 0 0 auto;
}

#logo {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--gold);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
}

#info-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 auto;
  flex-wrap: wrap;
  justify-content: center;
}

.chip {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 2px 8px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

#kyoku-chip { color: var(--gold); border-color: rgba(232, 196, 106, 0.4); }

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

.icon-btn {
  width: 33px;
  height: 33px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 15px;
  font-family: var(--ui-font);
  cursor: pointer;
  transition: background 0.15s;
}
.icon-btn:active { background: rgba(255, 255, 255, 0.2); }

/* ============ 卓 ============ */

#table {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0 6px;
  overflow: hidden;
}

.seat { flex: 0 0 auto; }

.seat-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 1px 2px;
  font-size: 11px;
}

.wind {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
  flex: 0 0 auto;
}
.wind.oya {
  background: var(--gold);
  border-color: var(--gold);
  color: #3d2f0a;
}

.pname { font-weight: 700; color: rgba(255, 255, 255, 0.75); }

.pts {
  font-weight: 800;
  font-size: 13px;
  color: #fff;
  font-variant-numeric: tabular-nums;
  margin-left: auto;
}

.riichi-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #ffdf8a;
  background: rgba(200, 40, 40, 0.55);
  border: 1px solid rgba(255, 200, 120, 0.6);
  border-radius: 6px;
  padding: 1px 6px;
  animation: riichiGlow 1.6s ease-in-out infinite;
}
.riichi-badge.still { animation: none; }
@keyframes riichiGlow {
  0%, 100% { box-shadow: 0 0 0 rgba(255, 200, 120, 0); }
  50% { box-shadow: 0 0 8px rgba(255, 200, 120, 0.75); }
}

#furiten-mark {
  font-size: 9px;
  font-weight: 800;
  color: #ffd0d0;
  background: rgba(160, 30, 30, 0.6);
  border: 1px solid rgba(255, 140, 140, 0.5);
  border-radius: 6px;
  padding: 1px 6px;
}

.seat.active .pname { color: var(--gold); }

/* 手牌・副露の行 */
.hand {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 1px;
  min-height: var(--th);
}

.melds {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  min-height: 0;
  flex-wrap: wrap;
  padding: 0 2px;
}

.meld { display: flex; align-items: flex-end; gap: 1px; }

.gap { width: calc(var(--tw) * 0.38); flex: 0 0 auto; }

/* ============ 牌 ============ */

.t {
  --w: var(--tw);
  --h: var(--th);
  position: relative;
  width: var(--w);
  height: var(--h);
  flex: 0 0 auto;
  border-radius: 3px;
  background: linear-gradient(160deg, var(--ivory-1) 0%, var(--ivory-2) 100%);
  border: 1px solid var(--ivory-edge);
  box-shadow: 0 1px 0 var(--tile-side-2), 0 2px 3px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.t > svg { display: block; width: 100%; height: 100%; pointer-events: none; }

.t.back {
  background: linear-gradient(160deg, var(--back-1) 0%, var(--back-2) 100%);
  border-color: #123526;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.1), 0 1px 0 var(--tile-side-2), 0 2px 3px rgba(0, 0, 0, 0.35);
}

.pond .t { --w: var(--pw); --h: var(--ph); border-radius: 2px; }
.melds .t { --w: var(--mw); --h: var(--mh); border-radius: 2px; }
.t.mini { --w: var(--dw); --h: var(--dh); border-radius: 2px; }

/* 横向きの牌（リーチ宣言牌・鳴いた牌） */
.t.rot { width: var(--h); height: var(--w); }
.t.rot > svg {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--w);
  height: var(--h);
  transform: translate(-50%, -50%) rotate(90deg);
}

.t.pick { cursor: pointer; }

.t.sel {
  transform: translateY(-9px);
  box-shadow: 0 0 0 2px var(--gold), 0 6px 8px rgba(0, 0, 0, 0.45);
  z-index: 3;
}

.t.dim { opacity: 0.34; cursor: default; }

.t.drawn { box-shadow: 0 0 0 1px rgba(232, 196, 106, 0.85), 0 2px 4px rgba(0, 0, 0, 0.4); }

/* 直前の打牌は枠線だけで示す。河は描画のたびに作り直すので、
   ここにアニメーションを付けると再生され続けてチカチカしてしまう */
.pond .t.last {
  outline: 2px solid var(--gold);
  outline-offset: -1px;
}

.t.shake { animation: shake 0.3s ease; }
@keyframes shake {
  0%, 100% { margin-left: 0; }
  25% { margin-left: -4px; }
  75% { margin-left: 4px; }
}

.meld.kakan { position: relative; }
.meld.kakan::after {
  content: "+";
  position: absolute;
  top: -3px;
  left: -2px;
  font-size: 8px;
  font-weight: 800;
  color: var(--gold);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

/* ============ 中央（ドラ・河） ============ */

#mid {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  position: relative;
  padding: 2px 0;
}

#dora-box {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  padding: 2px 8px;
}

.mini-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.6);
}

#dora-tiles { display: flex; gap: 2px; }

/* 河は左詰めで9列ずつ折り返す（実際の卓と同じ並び） */
.pond {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  justify-content: flex-start;
  gap: 1px;
  width: calc((var(--pw) + 1px) * 9);
  min-height: var(--ph);
  flex: 0 0 auto;
}

#mid::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 196, 106, 0.22), transparent);
  pointer-events: none;
}

#flash {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--gold);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85), 0 0 18px rgba(232, 196, 106, 0.55);
  pointer-events: none;
  z-index: 10;
  white-space: nowrap;
}
#flash.anim { animation: flashPop 1.1s ease-out forwards; }
@keyframes flashPop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
  30% { transform: translate(-50%, -50%) scale(1); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -60%) scale(1); }
}

/* ============ 操作バー ============ */

#actions {
  flex: 0 0 auto;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 5px 8px;
  flex-wrap: wrap;
}

.act {
  border: none;
  border-radius: 11px;
  padding: 10px 18px;
  font-family: var(--ui-font);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.1s, filter 0.15s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
}
.act:active { transform: translateY(1px); }

.act-ron {
  background: linear-gradient(180deg, #ff9b6b, #d63c2c);
  animation: actPulse 1.3s ease-in-out infinite;
}
.act-riichi { background: linear-gradient(180deg, #f3d98a, var(--gold-dim)); color: #4a3a10; text-shadow: none; }
.act-pon { background: linear-gradient(180deg, #7fd0ff, #2c86d0); }
.act-kan { background: linear-gradient(180deg, #c69bff, #7a45cf); }
.act-pass {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

@keyframes actPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.2); }
}

.act-hint {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
}

/* ============ トースト ============ */

#toast {
  position: fixed;
  /* フッター固定バナー広告に隠れないよう持ち上げる（広告なしのときは 0px） */
  bottom: calc(env(safe-area-inset-bottom) + 84px + var(--ad-space, 0px));
  left: 50%;
  transform: translateX(-50%);
  background: rgba(16, 24, 19, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 11px;
  z-index: 2100;
  max-width: calc(100vw - 32px);
  text-align: center;
  line-height: 1.5;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

/* ============ モーダル ============ */

.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 14, 9, 0.68);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  padding: 14px;
}

.modal-box {
  width: 100%;
  max-width: 430px;
  max-height: calc((100dvh - var(--sgh-top, 0px) - var(--ad-space, 0px)) - 40px);
  overflow-y: auto;
  background: linear-gradient(165deg, #1c3a2a, #10231a);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

.modal-box-small { max-width: 330px; }

.modal-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--gold);
  text-align: center;
  margin-bottom: 12px;
  letter-spacing: 0.1em;
}
.modal-title.win { color: #ffd76a; }
.modal-title.lose { color: #9fb8aa; }

.modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.btn {
  border: none;
  border-radius: 11px;
  padding: 12px;
  font-family: var(--ui-font);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.1s;
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: linear-gradient(180deg, #f3d98a, var(--gold-dim)); color: #4a3a10; }
.btn-sub {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
}

.confirm-text {
  text-align: center;
  font-size: 13px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.85);
}

/* ---- 設定 ---- */

.menu-section {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.menu-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.menu-label { font-size: 13px; font-weight: 700; }

.menu-note {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  margin: -3px 0 9px;
  line-height: 1.6;
}

.seg {
  display: flex;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 9px;
  overflow: hidden;
  flex: 0 0 auto;
}

.seg-btn {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  font-family: var(--ui-font);
  font-size: 12px;
  font-weight: 700;
  padding: 7px 11px;
  cursor: pointer;
}
.seg-btn.on { background: var(--gold); color: #3a2d0c; }

.menu-subtitle {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 8px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.sg-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 9px;
  padding: 7px 3px;
}

.sg-value {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.sg-label { font-size: 10px; color: rgba(255, 255, 255, 0.55); margin-top: 2px; }

/* ---- 結果 ---- */

.res-who {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 10px;
}

.hand-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 12px;
}

.hs-group { display: flex; gap: 1px; }

.hs-win { position: relative; padding-left: 6px; }
.hs-win::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 10%;
  bottom: 10%;
  width: 1px;
  background: rgba(232, 196, 106, 0.6);
}

.mt {
  width: 22px;
  height: 30px;
  border-radius: 2px;
  background: linear-gradient(160deg, var(--ivory-1), var(--ivory-2));
  border: 1px solid var(--ivory-edge);
  overflow: hidden;
  flex: 0 0 auto;
}
.mt > svg { display: block; width: 100%; height: 100%; }
.mt.back { background: linear-gradient(160deg, var(--back-1), var(--back-2)); border-color: #123526; }
.mt.win { box-shadow: 0 0 0 2px var(--gold); }
.mt.called { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.55); }

.yaku-list {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 10px;
}

.yaku-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  line-height: 1.9;
  color: rgba(255, 255, 255, 0.9);
}
.yaku-row.dora { color: var(--gold); }
.yaku-row.yakuman { color: #ff9b6b; font-weight: 800; }

.res-sum {
  text-align: center;
  font-size: 14px;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 4px;
}

.res-pts {
  text-align: center;
  font-size: 24px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  margin: 2px 0 6px;
}
.res-pts.plus { color: #7ee0a8; }
.res-pts.minus { color: #ff9b9b; }

.res-note {
  text-align: center;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.7;
}

.dora-reveal { margin-top: 10px; }

.dr-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.6);
}
.dr-row > span { width: 62px; flex: 0 0 auto; }

.ryu-row { margin: 8px 0 4px; }
.ryu-name { font-size: 12px; font-weight: 700; color: rgba(255, 255, 255, 0.7); }
.ryu-name.tenpai { color: var(--gold); }

.score-line {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sl-item {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 9px;
  padding: 6px 2px;
}
.sl-name { font-size: 10px; color: rgba(255, 255, 255, 0.55); }
.sl-val { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }

.win-title {
  text-align: center;
  font-size: 21px;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 14px;
  animation: winPop 0.5s ease;
}
.win-title.lose { color: #9fb8aa; }
@keyframes winPop {
  0% { transform: scale(0.6); opacity: 0; }
  70% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}

.end-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.end-table td {
  padding: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.end-table td:first-child { text-align: left; color: rgba(255, 255, 255, 0.75); }
.end-table tr:first-child td { color: var(--gold); font-weight: 800; }
.end-table .plus { color: #7ee0a8; }
.end-table .minus { color: #ff9b9b; }

/* ---- 遊び方 ---- */

.help-body p {
  font-size: 12px;
  line-height: 1.85;
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: 9px;
}
.help-body h3 {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin: 14px 0 6px;
}
.help-body b { color: var(--gold); }

.yaku-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}
.yaku-table th {
  text-align: left;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 700;
  padding: 4px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.yaku-table td {
  padding: 3px 6px;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.6;
  vertical-align: top;
}
.yaku-table td:first-child { color: rgba(255, 255, 255, 0.92); }
.yaku-table td:last-child { white-space: nowrap; }

/* ============ フッター ============ */

#footer {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 3px 12px 5px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.45);
}

/* 右の著作表記（もう一方のサイトへのリンクつき）が 1 行に収まらない幅では、右側だけを 2 行に折る（左のタイトルは折らない） */
#footer > div:first-child { flex: none; white-space: nowrap; }
#footer > div:last-child { text-align: right; }

#footer a { color: rgba(255, 255, 255, 0.65); text-decoration: none; }
#footer a:active, #footer a:hover { color: var(--gold); }

/* ============ 画面が狭いとき ============ */

@media (max-width: 360px) {
  #logo { font-size: 13px; }
  .chip { font-size: 10px; padding: 1px 6px; }
  .act { padding: 9px 13px; font-size: 13px; }
}

@media (max-height: 560px) {
  #topbar { padding: 3px 10px 1px; }
  #actions { min-height: 42px; padding: 3px 8px; }
  .act { padding: 8px 14px; }
  #footer { display: none; }
}

/* ==========================================================================
   フッター固定バナー広告（スマホ表示時のみ / 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; }
}
