/* ============================================================
   コエモン図鑑 — スタイル
   ============================================================ */
:root {
  --bg: #10131c;
  --bg2: #171b28;
  --panel: #1d2231;
  --line: #2c3346;
  --fg: #eef1f8;
  --dim: #9aa4bd;
  --acc: #7ee7c7;
  --acc2: #ffd166;
  --danger: #ff7b7b;
  --r: 16px;
}

* { box-sizing: border-box; }

/* hidden 属性は必ず効かせる。
   ブラウザ標準の [hidden]{display:none} は作者スタイルの display に負けるため、
   .modal のように display を指定した要素では hidden が無視されてしまう。 */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1100px 600px at 50% -10%, #232a3d 0%, transparent 60%),
    var(--bg);
  color: var(--fg);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Noto Sans JP",
               system-ui, -apple-system, sans-serif;
  -webkit-text-size-adjust: 100%;
}

#app {
  max-width: 560px;
  margin: 0 auto;
  /* 下タブのぶんだけ空ける（ホームインジケータの高さも足す） */
  padding: 0 16px calc(96px + env(safe-area-inset-bottom, 0px));
}

/* ---------------- ヘッダ ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  padding: 12px 0 8px;
  background: linear-gradient(#10131cf2 70%, #10131c00);
  backdrop-filter: blur(6px);
}
.logo {
  margin: 0;
  font-size: 19px; letter-spacing: .06em;
}
.logo span { color: var(--acc); }

/* ---------------- 下タブ ----------------
 * 上に置くと片手だと親指が届かないので画面下に固定する。
 * iPhone はホームインジケータのぶん下に余白が要るので safe-area を足す。
 */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; gap: 10px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  background: #12161fee;
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
@supports (padding: max(0px)) {
  .tabs { padding-bottom: max(10px, env(safe-area-inset-bottom, 0px)); }
}
/* タップ範囲はセル全体（親指で押しやすいように）。
   色がつくのはアイコンの後ろの小さいピルだけにして、
   選択中の側だけ半分が塗りつぶされて見えるのを避ける。 */
.tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 7px 8px 5px;
  font: inherit; font-size: 12px; font-weight: 700;
  color: var(--dim);
  background: none; border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tab svg {
  width: 22px; height: 22px;
  padding: 4px 18px;
  box-sizing: content-box;
  border-radius: 999px;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
  transition: background .18s, stroke .18s;
}
.tab.is-active { color: var(--acc); }
.tab.is-active svg { background: var(--acc); stroke: #0f1420; }
.tab:focus-visible { outline: 2px solid var(--acc); outline-offset: -2px; border-radius: 12px; }

/* ---------------- ビュー ---------------- */
.view { display: none; padding-top: 14px; }
.view.is-active { display: block; }

.stage { text-align: center; }
.lead { font-size: 16px; line-height: 1.9; color: var(--dim); margin: 26px 0 22px; }
.lead b { color: var(--fg); }
.hint { font-size: 12.5px; color: var(--dim); line-height: 1.7; margin-top: 14px; }
.hint.is-err { color: var(--danger); }

/* ---------------- 異界への入口 ----------------
 * 「別の世界に呼びかける」画面。奥行きのある穴に向かって声を出す形にする。
 * 手前から: 光の粒 / 縁の渦 / 奥の気配 / 暗い井戸（＝ボタン）
 */
.callout {
  font-size: 19px; line-height: 2; color: var(--dim);
  letter-spacing: .04em; margin: 30px 0 6px;
  text-wrap: balance;
}
.callout b {
  color: var(--fg); font-weight: 800;
  text-shadow: 0 0 22px #7ee7c766;
}

/* 入口を画面の中央に据える（上に寄っていると下が間延びして見える） */
#stageIdle {
  display: flex; flex-direction: column; justify-content: center;
  min-height: calc(100dvh - 250px);
}
@supports not (height: 100dvh) {
  #stageIdle { min-height: calc(100vh - 250px); }
}

.portal {
  position: relative;
  width: 260px; height: 260px;
  margin: 20px auto 6px;
  display: grid; place-items: center;
}
.portal canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}

/* 呼びかけるための当たり判定。見た目は持たせない（膜そのものが入口）。 */
.callbtn {
  position: relative; z-index: 2;
  display: inline-flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  width: 168px; height: 168px;
  border: none; border-radius: 50%;
  background: none;
  color: var(--acc); font: inherit; font-size: 14px; font-weight: 700;
  letter-spacing: .22em; text-indent: .22em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .2s ease, opacity .2s;
  text-shadow: 0 0 14px #0a0e16, 0 0 26px #0a0e16;
}
.callbtn:hover { transform: scale(1.04); }
.callbtn:active { transform: scale(.95); opacity: .8; }
.callbtn:disabled { filter: grayscale(1); opacity: .4; cursor: not-allowed; }
.callbtn:focus-visible { outline: 2px solid var(--acc); outline-offset: 6px; border-radius: 50%; }
.micicon {
  width: 34px; height: 34px;
  fill: none; stroke: var(--acc); stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 0 10px #0a0e16) drop-shadow(0 0 16px #7ee7c766);
}

@media (prefers-reduced-motion: reduce) {
  .callbtn { transition: none; }
}

/* ボタン内のマイクアイコン */
.btnmic {
  width: 17px; height: 17px; margin-right: 6px; vertical-align: -3px;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}

/* 録音中 */
.reclabel {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 17px; font-weight: 700; color: var(--acc);
  margin: 18px 0 12px; letter-spacing: .12em;
  animation: blink 1.1s steps(2, jump-none) infinite;
}
.reclabel-mic {
  width: 20px; height: 20px;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}

/* 系統バッジ */
.badge.family { background: #ffffff1f; color: var(--fg); }

/* 声が入らなかったとき */
.novoice { text-align: center; padding: 26px 8px; }
.novoice h2 { font-size: 19px; margin: 0 0 10px; color: var(--acc2); }
.novoice p { font-size: 13.5px; line-height: 1.9; color: var(--dim); margin: 0 0 4px; }
.novoice-lvl { font-size: 11px !important; color: #5d6785 !important; margin-top: 10px !important; font-variant-numeric: tabular-nums; }
@keyframes blink { 50% { opacity: .35; } }

.listen {
  position: relative;
  width: 260px; height: 260px;
  margin: 26px auto 20px;
}
.listen canvas { width: 100%; height: 100%; display: block; }

/* 呼びかけ中の演出（描画は art.js の summon） */
.summon {
  position: relative;
  width: 260px; height: 260px;
  margin: 40px auto 22px;
}
.summon canvas { width: 100%; height: 100%; display: block; }

.summon-step {
  font-size: 14.5px; color: var(--dim); letter-spacing: .06em; min-height: 1.4em;
}
.summon-step.pop { animation: stepPop .35s ease both; }
@keyframes stepPop { from { opacity: 0; transform: translateY(5px); } }

@media (prefers-reduced-motion: reduce) {
  .summon .ring, .summon .core, .summon-step.pop { animation-duration: .01ms; animation-iteration-count: 1; }
}

/* なきごえ / もとのこえ */
.cryrow { display: flex; gap: 8px; margin-top: 13px; }
.crybtn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  flex: 1; padding: 11px 8px;
  font: inherit; font-size: 13.5px; font-weight: 700; letter-spacing: .04em;
  color: var(--fg); background: #ffffff14;
  border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
  transition: .15s;
}
.crybtn:hover { background: #ffffff22; }
.crybtn svg {
  width: 17px; height: 17px;
  fill: none; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.crybtn.is-cry svg { stroke: var(--acc); }
.crybtn.is-raw   { color: var(--dim); }
.crybtn.is-raw svg { stroke: var(--dim); }
.crybtn.is-playing { animation: cryPulse .5s ease; }
@keyframes cryPulse {
  50% { background: #7ee7c733; border-color: var(--acc); }
}

/* 結果 */
.revealtag {
  display: inline-block; margin: 4px 0 14px; padding: 6px 16px;
  font-size: 13px; font-weight: 700; letter-spacing: .08em;
  border-radius: 99px; color: var(--dim); background: var(--panel); border: 1px solid var(--line);
}
.revealtag.is-new {
  color: #24170a; background: var(--acc2); border-color: var(--acc2);
  animation: pop .45s cubic-bezier(.2,1.6,.4,1);
}
@keyframes pop { from { transform: scale(.6); opacity: 0; } }

.actions { display: flex; gap: 10px; margin-top: 16px; }
.btn {
  flex: 1; padding: 14px 10px;
  font: inherit; font-size: 15px; font-weight: 700;
  color: var(--fg); background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; cursor: pointer;
  transition: .15s;
}
.btn:hover { border-color: var(--dim); }
.btn-primary { color: #06231c; background: var(--acc); border-color: var(--acc); }
.btn-ghost { flex: 0 0 auto; background: none; color: var(--dim); }
.btn-sm { padding: 7px 12px; font-size: 12.5px; }

/* ---------------- カード ---------------- */
.card {
  position: relative;
  padding: 16px;
  text-align: left;
  background:
    radial-gradient(120% 90% at 50% 0%, hsl(var(--h) 45% 22%) 0%, var(--bg2) 62%);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  animation: cardin .4s ease both;
}
@keyframes cardin { from { transform: translateY(14px) scale(.97); opacity: 0; } }
.card.r4 { border-color: hsl(var(--h2) 70% 55% / .7); }
.card.r5 { border-color: var(--acc2); box-shadow: 0 0 34px -8px #ffd16655; }

.card-head { display: flex; align-items: flex-start; gap: 10px; }
.card-names { flex: 1; min-width: 0; }
.card-name { font-size: 25px; font-weight: 800; letter-spacing: .04em; line-height: 1.2; }
.card-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.badge {
  padding: 3px 9px; border-radius: 99px;
  font-size: 11.5px; font-weight: 700; color: #0d1119;
}
.badge.mutant { background: var(--acc2); }
.badge.count { background: var(--line); color: var(--fg); }
.card-stars { font-size: 15px; color: var(--acc2); letter-spacing: .06em; white-space: nowrap; padding-top: 4px; }

.card-art { position: relative; width: 100%; overflow: hidden; margin: 6px 0 10px; }
.card-art canvas { display: block; margin: 0 auto; max-width: 100%; }

.stats { display: grid; gap: 6px; }
.stat { display: grid; grid-template-columns: 84px 1fr 34px; align-items: center; gap: 9px; font-size: 12px; }
.stat-k { color: var(--dim); }
.stat-bar { height: 7px; background: #0d1119; border-radius: 99px; overflow: hidden; }
.stat-bar i { display: block; height: 100%; background: linear-gradient(90deg, hsl(var(--h) 70% 45%), hsl(var(--h2) 85% 62%)); }
.stat-v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.stat-bar i.grown { background: linear-gradient(90deg, var(--acc2), #ffe9a8); }
.stat-bar { display: flex; }
.stat-plus { color: var(--acc2); font-size: 9.5px; margin-left: 3px; font-weight: 700; }
.stat.total { margin-top: 3px; padding-top: 7px; border-top: 1px dashed var(--line); }

/* 育成 */
.trainbox { margin-top: 11px; text-align: center; }
.traindone { font-size: 12.5px; color: var(--dim); margin: 0; padding: 10px 0; }
.trainstreak { font-size: 11.5px; color: var(--acc2); margin: 6px 0 0; letter-spacing: .06em; }

/* 呼んだときに伸びた ぶんの表示 */
.growline {
  margin: 0 0 12px; padding: 9px 14px;
  display: inline-block;
  font-size: 13.5px; font-weight: 700; letter-spacing: .04em;
  color: #24170a; background: var(--acc2); border-radius: 99px;
  animation: pop .45s cubic-bezier(.2,1.6,.4,1);
}

.dexgrown {
  /* ×N バッジが右上にいるので、育成マークは右下に置く */
  position: absolute; bottom: 6px; right: 6px;
  padding: 1px 6px; border-radius: 99px;
  font-size: 10px; font-weight: 700; color: #24170a; background: var(--acc2);
}
.stat.total .stat-v { color: var(--acc); }

.flavor {
  margin: 13px 0 0; padding: 11px 12px;
  font-size: 12.5px; line-height: 1.85; color: #cfd6e8;
  background: #0d111980; border-radius: 10px;
}
.sid { margin-top: 9px; font-size: 10.5px; color: #5d6785; letter-spacing: .08em; }

/* 未発見カード */
.card.is-locked { background: linear-gradient(#1a2030, var(--bg2) 70%); }
.card-name.locked { color: #5d6785; letter-spacing: .18em; }
.badge.unknown { background: #2a3145; color: var(--dim); }
.flavor.locked { color: #6c7796; font-style: normal; }
.card.is-locked .card-art canvas { opacity: .7; }
.card.is-locked .stat-v { color: #4a5570; }

/* ---------------- デバッグ ---------------- */
.debug { margin-top: 18px; text-align: left; }
.debug summary { font-size: 12.5px; color: var(--dim); cursor: pointer; padding: 8px 0; }
.debug table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.debug td { padding: 4px 6px; border-bottom: 1px solid #1e2432; color: var(--dim); }
.debug td:last-child { text-align: right; color: var(--fg); font-variant-numeric: tabular-nums; }
.debug table.norm td:last-child { color: var(--acc); }
.debug.diag { text-align: left; margin-top: 16px; }
.debug.diag td { word-break: break-all; vertical-align: top; }
.debug.diag td:first-child { white-space: nowrap; padding-right: 10px; }
.dbg-note { font-size: 11px; color: #6c7796; margin: 10px 0 4px; line-height: 1.6; }
.dbg-warn { font-size: 11.5px; color: var(--danger); margin-top: 8px; }

/* ---------------- 図鑑 ---------------- */
.dexhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
#dexStat { font-size: 13px; color: var(--dim); }
.dexactions { display: flex; gap: 6px; }

.savecard { text-align: left; }
.save-title { font-size: 15px; margin: 0 0 8px; letter-spacing: .04em; }
.save-note { font-size: 11.5px; line-height: 1.8; color: var(--dim); margin: 0 0 10px; }
.qrbox {
  display: grid; place-items: center;
  background: #fff; border-radius: 12px;
  padding: 14px; margin: 4px 0 10px;
}
.qrbox img, .qrbox canvas, .qrbox table { display: block; }
.givenrow { opacity: .55; }
.giventag {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: #0d1119aa; border-radius: 13px;
  font-size: 11px; font-weight: 700; color: var(--acc2);
}
.got-name { font-size: 24px; font-weight: 800; margin: 6px 0 2px; letter-spacing: .04em; }
.got-from { font-size: 12px; color: var(--acc); margin: 0 0 12px; }

.owner { float: right; color: var(--acc); letter-spacing: 0; }
.nameinput {
  width: 100%; box-sizing: border-box;
  font: inherit; font-size: 16px;
  color: var(--fg); background: #0d1119;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; margin-bottom: 4px;
}
.savebox {
  width: 100%; height: 96px; resize: vertical;
  font: inherit; font-size: 11px; line-height: 1.5;
  color: var(--fg); background: #0d1119;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 10px; box-sizing: border-box;
  -webkit-user-select: text; user-select: text;
}

.dexgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 460px) { .dexgrid { grid-template-columns: repeat(4, 1fr); } }

.dexcell {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 4px 9px;
  font: inherit; color: var(--fg); cursor: pointer;
  background: radial-gradient(110% 80% at 50% 10%, hsl(var(--h) 40% 20%), var(--panel) 70%);
  border: 1px solid var(--line); border-radius: 13px;
  transition: transform .12s, border-color .12s;
}
.dexcell:hover { transform: translateY(-3px); border-color: var(--dim); }
.dexcell.r5 { border-color: var(--acc2); }
.dexcell canvas { display: block; width: 100% !important; height: auto !important; }

/* 未発見の枠 */
.dexcell.is-locked {
  background: #151a26;
  border-style: dashed;
  border-color: #2a3145;
}
.dexcell.is-locked:hover { transform: none; border-color: #3a4159; }
.dexcell.is-locked canvas { opacity: .55; }
.dexname.locked { color: #5d6785; letter-spacing: .12em; }

/* 図鑑番号 */
.dexno {
  position: absolute; top: 5px; left: 7px;
  font-size: 9.5px; font-variant-numeric: tabular-nums;
  color: #5d6785; letter-spacing: .04em;
}
.dexcell.is-locked .dexno { color: #4a5570; }

/* 番号が飛んでいるところの区切り。
   1マスぶん使うと行がガタつくので、横いっぱいの細い仕切りにする。 */
.dexgap {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 10px;
  color: #47506f; font-size: 11px; letter-spacing: .3em;
  padding: 2px 0;
}
.dexgap::before, .dexgap::after {
  content: ''; flex: 1; height: 1px; background: #232a3b;
}
.dexname { font-size: 11.5px; font-weight: 700; letter-spacing: .02em;
           max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dexstars { font-size: 9.5px; color: var(--acc2); letter-spacing: .04em; }
.dexcount {
  position: absolute; top: 5px; right: 6px;
  padding: 1px 6px; border-radius: 99px;
  font-size: 10px; font-weight: 700; color: #0d1119; background: var(--dim);
}
.empty { text-align: center; color: var(--dim); font-size: 13.5px; line-height: 2; margin-top: 40px; }

/* ---------------- 徒競走 ---------------- */
.race-lead { font-size: 15px; color: var(--dim); margin: 18px 0 14px; }

/* 種目えらび */
.evgrid { display: grid; gap: 10px; }
.evcell {
  display: grid; grid-template-columns: 46px 1fr; grid-template-rows: auto auto;
  align-items: center; gap: 2px 12px;
  padding: 14px 16px; text-align: left;
  font: inherit; color: var(--fg);
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; cursor: pointer;
  transition: transform .12s, border-color .12s;
  -webkit-tap-highlight-color: transparent;
}
.evcell:hover { transform: translateY(-2px); border-color: var(--dim); }
.evicon { grid-row: 1 / 3; font-size: 30px; text-align: center; }
.evname { font-size: 16px; font-weight: 800; letter-spacing: .04em; }
.evlabel { font-size: 11px; color: var(--acc); letter-spacing: .06em; }
.evdesc { grid-column: 2; font-size: 11.5px; color: var(--dim); margin-top: 3px; }

.backlink {
  display: inline-block; margin: 10px 0 0;
  font: inherit; font-size: 13px; color: var(--dim);
  background: none; border: none; cursor: pointer; padding: 4px 0;
}

.pickgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 460px) { .pickgrid { grid-template-columns: repeat(4, 1fr); } }
.pickcell {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 4px 9px;
  font: inherit; color: var(--fg); cursor: pointer;
  background: radial-gradient(110% 80% at 50% 10%, hsl(var(--h) 40% 20%), var(--panel) 70%);
  border: 1px solid var(--line); border-radius: 13px;
  transition: transform .12s, border-color .12s;
  -webkit-tap-highlight-color: transparent;
}
.pickcell:hover { transform: translateY(-3px); border-color: var(--dim); }
.pickcell canvas { display: block; width: 100% !important; height: auto !important; }
.pickname { font-size: 11.5px; font-weight: 700; max-width: 100%;
            overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pickbest { font-size: 10.5px; color: var(--acc2); font-variant-numeric: tabular-nums; }

.race-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 14px 2px 10px; font-size: 15px; font-weight: 700;
}
.race-dist { font-size: 12px; color: var(--dim); letter-spacing: .1em; }

.trackbox {
  width: 100%; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line);
}
.trackbox canvas { display: block; width: 100%; }

.race-sign {
  margin: 16px 0 4px; font-size: 22px; font-weight: 800; letter-spacing: .14em;
  color: var(--dim); min-height: 1.3em;
}
.race-sign.is-go { color: var(--acc); animation: pop .3s cubic-bezier(.2,1.6,.4,1); }
.race-sign.is-false { color: var(--danger); }

.race-go { width: 100%; margin-top: 8px; font-size: 17px; padding: 18px; }
.race-go:disabled { opacity: .4; }

.race-time {
  font-size: 46px; font-weight: 800; letter-spacing: .02em;
  color: var(--acc); margin: 6px 0 14px;
  font-variant-numeric: tabular-nums;
}
.rdet { display: grid; gap: 7px; text-align: left; margin-bottom: 6px; }
.rdet > div {
  display: grid; grid-template-columns: 74px 62px 1fr; align-items: baseline;
  gap: 8px; font-size: 12px; color: var(--dim);
  padding: 7px 10px; background: #0d111980; border-radius: 8px;
}
.rdet b { color: var(--fg); font-size: 14px; font-variant-numeric: tabular-nums; }
.rdet i { font-style: normal; font-size: 11px; color: #6c7796; }

.rank { margin-top: 20px; text-align: left; }
.rank h3 { font-size: 12px; color: var(--dim); margin: 0 0 8px; letter-spacing: .1em; font-weight: 700; }
.rank > div {
  display: grid; grid-template-columns: 22px 1fr auto; align-items: center;
  gap: 8px; padding: 9px 10px; font-size: 13px;
  border-bottom: 1px solid #1e2432;
}
.rank > div span { color: var(--dim); font-size: 11px; }
.rank > div b { font-variant-numeric: tabular-nums; color: var(--fg); }
.rank > div.me { background: #7ee7c714; border-radius: 8px; font-weight: 700; }
.rank > div.me span { color: var(--acc); }

/* ---------------- モーダル ---------------- */
.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 18px; }
.modal[hidden] { display: none; }
.modal-bg { position: absolute; inset: 0; background: #060810cc; backdrop-filter: blur(3px); }
.modal-body { position: relative; width: 100%; max-width: 400px; max-height: 86vh; overflow: auto; margin-bottom: 26px; }
.modal-body .card-head { padding-right: 36px; }
/* 前後へのめくり */
.modal-nav {
  position: absolute; top: 50%; z-index: 3;
  width: 36px; height: 56px; margin-top: -28px;
  display: grid; place-items: center;
  font: inherit; font-size: 26px; line-height: 1;
  color: var(--fg); background: #0d1119cc;
  border: 1px solid var(--line); border-radius: 10px;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.modal-nav.prev { left: -6px; }
.modal-nav.next { right: -6px; }
.modal-pos {
  position: absolute; left: 0; right: 0; bottom: -22px;
  text-align: center; font-size: 11px; color: var(--dim);
  font-variant-numeric: tabular-nums; letter-spacing: .08em;
}
@keyframes slideL { from { transform: translateX(26px); opacity: 0; } }
@keyframes slideR { from { transform: translateX(-26px); opacity: 0; } }
.slide-in-right { animation: slideL .22s ease both; }
.slide-in-left  { animation: slideR .22s ease both; }

.modal-x {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 32px; height: 32px; border-radius: 50%;
  font: inherit; font-size: 19px; line-height: 1;
  color: var(--fg); background: #0d1119cc; border: 1px solid var(--line); cursor: pointer;
}
