/* 夜の卓上: 深い藍の盤面に真鍮の縁取り。カードは羊皮紙色で、種族ごとに帯の色を変える */
:root {
  color-scheme: dark;
  --table: #101a24;
  --table-2: #16232f;
  --felt-line: #263849;
  --ink: #e8e1cf;
  --ink-dim: #9aa6b0;
  --brass: #d4a94f;
  --brass-dim: #8f733a;
  --paper: #ece4cf;
  --paper-ink: #22201b;
  --paper-dim: #6b6455;
  --good: #6fcf8e;
  --bad: #ef6a5b;
  --target: #ffcf5a;
  --panel: #0c141c;

  --r-warrior: #6f87a3;
  --r-beast: #b9802f;
  --r-fiend: #9a3048;
  --r-rock: #7f7563;
  --r-spellcaster: #4d62b8;
  --r-insect: #5f8d33;
  --r-pyro: #d8682a;
  --r-aqua: #2f8da3;
  --r-dragon: #b8a46a;
  --r-spell: #7a52b3;

  --f-display: 'Dela Gothic One', 'Zen Kaku Gothic New', 'Hiragino Sans', sans-serif;
  --f-body: 'Zen Kaku Gothic New', 'Hiragino Sans', 'Yu Gothic', 'Meiryo', sans-serif;

  --cw: 104px;
  --ch: 146px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  background: var(--table);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 14px;
  -webkit-user-select: none; user-select: none;
}
/* スマホ: 画面のどこを長押し・引っぱりしても、文字選択や「コピー」メニューが出ないように */
body.touch, body.touch * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.touch input, body.touch textarea { -webkit-user-select: text; user-select: text; }
button { font-family: inherit; }
button:focus-visible, .card:focus-visible { outline: 2px solid var(--target); outline-offset: 2px; }

#app {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: 'top top' 'table panel';
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

/* ---------- 上部バー ---------- */
.topbar {
  grid-area: top;
  display: flex; align-items: center; gap: 16px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--felt-line);
  background: var(--panel);
}
.brand { font-family: var(--f-display); font-size: 18px; color: var(--brass); letter-spacing: 0.04em; }
.brand .ver { font-family: var(--f-body); font-size: 11px; color: var(--ink-dim); margin-left: 10px; letter-spacing: 0.08em; }
.stage { flex: 1; color: var(--ink-dim); font-size: 13px; }
.ghost {
  background: transparent; color: var(--ink); border: 1px solid var(--felt-line);
  padding: 6px 12px; border-radius: 4px; cursor: pointer;
}
.ghost:hover { border-color: var(--brass-dim); }

/* ---------- 盤面 ---------- */
.table {
  grid-area: table;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr);
  background:
    radial-gradient(ellipse at 50% 50%, var(--table-2), var(--table) 70%);
  padding: 10px 16px;
  gap: 6px;
  overflow: auto;
}
.side { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 0; }

.info {
  display: flex; align-items: center; gap: 18px;
  font-size: 12px; color: var(--ink-dim);
}
.info .who { font-weight: 900; color: var(--ink); font-size: 14px; }
.lp {
  position: relative;
  font-family: var(--f-display); font-size: 26px; color: var(--ink);
  font-variant-numeric: tabular-nums; letter-spacing: 0.02em;
  padding: 0 4px;
}
.lp small { font-family: var(--f-body); font-size: 11px; color: var(--brass); margin-right: 6px; font-weight: 700; }
.lp.shake { animation: shake 0.35s; }
.lp.direct-target { color: var(--target); text-shadow: 0 0 12px var(--target); cursor: pointer; }
.counts { display: flex; gap: 12px; font-variant-numeric: tabular-nums; }

.field { display: flex; gap: 12px; }
.slot {
  width: calc(var(--ch) + 4px); height: calc(var(--ch) + 4px);
  border: 1px dashed var(--felt-line); border-radius: 8px;
  display: grid; place-items: center;
}
.hand { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; min-height: 40px; }
.hand-back {
  width: 28px; height: 40px; border-radius: 4px;
  background: repeating-linear-gradient(45deg, var(--brass-dim) 0 3px, #3a2e17 3px 7px);
  border: 1px solid var(--brass-dim);
}

/* ---------- 中央帯 ---------- */
.midline {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: center;
  padding: 8px 12px; border-block: 1px solid var(--felt-line);
  min-height: 56px;
}
.turnbox { display: flex; align-items: baseline; gap: 10px; }
.turnbox .label { font-size: 11px; color: var(--ink-dim); letter-spacing: 0.08em; }
.turnbox .num { font-family: var(--f-display); font-size: 22px; font-variant-numeric: tabular-nums; }
.turnbox .num.warn { color: var(--bad); }
.whose { font-weight: 900; padding: 3px 10px; border-radius: 3px; font-size: 13px; }
.whose.me { background: var(--brass); color: #1a1408; }
.whose.op { background: var(--r-fiend); color: #fff; }
.actionbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; flex: 1; justify-content: center; min-width: 0; }
.hint { color: var(--ink-dim); font-size: 13px; }
.btn {
  border: 1px solid var(--brass); background: transparent; color: var(--brass);
  padding: 7px 14px; border-radius: 4px; font-weight: 700; cursor: pointer; font-size: 13px;
}
.btn:hover:not(:disabled) { background: var(--brass); color: #1a1408; }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn.primary { background: var(--brass); color: #1a1408; }
.btn.primary:hover:not(:disabled) { filter: brightness(1.1); }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn.danger:hover { background: var(--bad); color: #1a0806; }

/* ---------- カード ---------- */
.card {
  --race: var(--r-warrior);
  position: relative;
  width: var(--cw); height: var(--ch);
  background: var(--paper); color: var(--paper-ink);
  border-radius: 6px;
  border: 2px solid var(--race);
  display: flex; flex-direction: column;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  transition: transform 0.2s, box-shadow 0.2s;
}
.card .c-head {
  background: var(--race); color: #fff;
  font-weight: 900; font-size: 11.5px; line-height: 1.25;
  padding: 3px 5px; min-height: 30px;
  display: flex; align-items: center;
}
.card .c-sub { display: flex; justify-content: space-between; font-size: 10px; color: var(--paper-dim); padding: 2px 5px 0; font-weight: 700; }
.card .c-art {
  flex: 0 0 34px; display: grid; place-items: center;
  font-family: var(--f-display); font-size: 22px; color: var(--race);
}
.card .c-text { flex: 1; font-size: 9.5px; line-height: 1.35; padding: 0 5px; color: var(--paper-ink); overflow: hidden; }
.card .c-stats {
  display: flex; justify-content: space-between; padding: 3px 5px 4px;
  font-family: var(--f-display); font-size: 12px; font-variant-numeric: tabular-nums;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
}
.card .c-stats span small { font-family: var(--f-body); font-size: 8.5px; font-weight: 900; margin-right: 2px; color: var(--paper-dim); }
.card .up { color: #1d7a3e; }
.card .down { color: #b2352a; }
.card .dim { opacity: 0.45; }
.card.spell .c-stats { justify-content: center; font-family: var(--f-body); font-size: 10px; font-weight: 900; color: var(--race); }

.card.def { transform: rotate(-90deg); }
.card.def .c-stats .atkv { opacity: 0.45; }
.badge {
  position: absolute; top: 34px; right: 3px;
  font-size: 9px; font-weight: 900; padding: 1px 4px; border-radius: 3px;
  background: var(--paper-ink); color: var(--paper);
}

.hand .card:hover, .field .card.mine:hover { transform: translateY(-6px); }
.field .card.def.mine:hover { transform: rotate(-90deg) translateX(6px); }
.card.selected { box-shadow: 0 0 0 3px var(--brass), 0 0 18px var(--brass); }
.card.ready { box-shadow: 0 0 0 2px var(--good), 0 2px 8px rgba(0, 0, 0, 0.5); }
.card.targetable { box-shadow: 0 0 0 3px var(--target), 0 0 20px var(--target); animation: pulse 1s infinite; }
.card.picked { box-shadow: 0 0 0 3px var(--bad), 0 0 18px var(--bad); }
.card.unplayable { filter: saturate(0.4) brightness(0.8); }

/* カード種族色 */
.race-warrior { --race: var(--r-warrior); }
.race-beast { --race: var(--r-beast); }
.race-fiend { --race: var(--r-fiend); }
.race-rock { --race: var(--r-rock); }
.race-spellcaster { --race: var(--r-spellcaster); }
.race-insect { --race: var(--r-insect); }
.race-pyro { --race: var(--r-pyro); }
.race-aqua { --race: var(--r-aqua); }
.race-dragon { --race: var(--r-dragon); }
.race-spell { --race: var(--r-spell); }

/* ---------- 演出 ---------- */
.appear { animation: appear 0.35s ease-out; }
.card.def.appear { animation: appear-def 0.35s ease-out; }
.lunge-up { animation: lunge-up 0.38s ease-in-out; z-index: 5; }
.lunge-down { animation: lunge-down 0.38s ease-in-out; z-index: 5; }
.card.def.lunge-up, .card.def.lunge-down { animation: none; }
.hit { animation: hit 0.38s; }
.dying { animation: dying 0.4s forwards; }
.float {
  position: absolute; left: 50%; top: -6px; transform: translateX(-50%);
  font-family: var(--f-display); font-size: 22px; pointer-events: none;
  animation: float 0.9s ease-out forwards; white-space: nowrap; z-index: 20;
}
.float.dmg { color: var(--bad); text-shadow: 0 2px 0 #000; }
.float.heal { color: var(--good); text-shadow: 0 2px 0 #000; }
.float.startlp { font-size: 18px; top: -16px; color: #ffe28a; text-shadow: 0 2px 0 #000, 0 0 12px rgba(255, 210, 110, 0.8); animation-duration: 1.4s; }
.float.startlp.dmg { color: #d79bff; text-shadow: 0 2px 0 #000, 0 0 12px rgba(170, 90, 230, 0.8); }
.lp.lp-perm-up { animation: lp-perm-up 1.1s ease-out; }
.lp.lp-perm-down { animation: lp-perm-down 1.1s ease-out; }
@keyframes lp-perm-up { 0% { box-shadow: 0 0 0 0 rgba(255, 220, 120, 0); } 25% { box-shadow: 0 0 0 4px rgba(255, 220, 120, 0.9), 0 0 24px rgba(255, 220, 120, 0.7); } 100% { box-shadow: 0 0 0 0 rgba(255, 220, 120, 0); } }
@keyframes lp-perm-down { 0% { box-shadow: 0 0 0 0 rgba(170, 90, 230, 0); } 25% { box-shadow: 0 0 0 4px rgba(170, 90, 230, 0.9), 0 0 24px rgba(170, 90, 230, 0.7); } 100% { box-shadow: 0 0 0 0 rgba(170, 90, 230, 0); } }

@keyframes appear { from { opacity: 0; transform: scale(1.25); } to { opacity: 1; transform: scale(1); } }
@keyframes appear-def { from { opacity: 0; transform: rotate(-90deg) scale(1.25); } to { opacity: 1; transform: rotate(-90deg) scale(1); } }
@keyframes lunge-up { 50% { transform: translateY(-46px) scale(1.06); } }
@keyframes lunge-down { 50% { transform: translateY(46px) scale(1.06); } }
@keyframes hit { 0%, 100% { filter: none; } 30% { filter: brightness(2) sepia(1) hue-rotate(-40deg) saturate(4); } }
@keyframes dying { to { opacity: 0; transform: scale(0.6) rotate(8deg); filter: grayscale(1); } }
@keyframes float { from { opacity: 1; transform: translate(-50%, 0); } to { opacity: 0; transform: translate(-50%, -38px); } }
@keyframes shake { 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }
@keyframes pulse { 50% { box-shadow: 0 0 0 3px var(--target), 0 0 6px var(--target); } }

/* ---------- 右パネル ---------- */
.panel {
  grid-area: panel;
  background: var(--panel); border-left: 1px solid var(--felt-line);
  display: flex; flex-direction: column; min-height: 0;
}
.detail { padding: 14px 16px; border-bottom: 1px solid var(--felt-line); min-height: 170px; }
.detail .d-name { font-family: var(--f-display); font-size: 17px; margin-bottom: 4px; }
.detail .d-meta { color: var(--ink-dim); font-size: 12px; margin-bottom: 8px; }
.detail .d-stats { font-family: var(--f-display); font-size: 15px; display: flex; gap: 14px; margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.detail .d-text { font-size: 13px; line-height: 1.6; }
.detail .d-empty { color: var(--ink-dim); font-size: 12.5px; line-height: 1.7; }
.detail .d-note { color: var(--ink-dim); font-size: 11.5px; margin-top: 8px; line-height: 1.6; }
.panel-label { font-size: 11px; color: var(--brass); letter-spacing: 0.12em; padding: 10px 16px 6px; font-weight: 700; }
.log-wrap { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.log { list-style: none; margin: 0; padding: 0 16px 12px; overflow-y: auto; flex: 1; font-size: 12px; line-height: 1.6; color: var(--ink-dim); }
.log li.turn { color: var(--brass); font-weight: 700; margin-top: 6px; }
.log li.new { color: var(--ink); }

/* ---------- オーバーレイ ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(5, 9, 13, 0.82);
  display: grid; place-items: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
.modal {
  background: var(--panel); border: 1px solid var(--brass-dim); border-radius: 8px;
  padding: 24px 28px; max-width: 560px; width: 100%; max-height: 100%; overflow-y: auto;
}
.modal h2 { font-family: var(--f-display); font-weight: 400; color: var(--brass); margin: 0 0 12px; font-size: 22px; text-wrap: balance; }
.modal h2.big { font-size: 40px; text-align: center; }
.modal h2.lose { color: var(--bad); }
.modal p, .modal li { line-height: 1.7; font-size: 13.5px; }
.modal ul { padding-left: 1.2em; margin: 6px 0 14px; }
.modal h3 { font-size: 13px; color: var(--brass); letter-spacing: 0.08em; margin: 14px 0 4px; }
.modal .actions { display: flex; justify-content: center; gap: 10px; margin-top: 18px; }
.modal .center { text-align: center; color: var(--ink-dim); }

.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  background: var(--paper); color: var(--paper-ink); font-weight: 700;
  padding: 8px 16px; border-radius: 4px; z-index: 60; font-size: 13px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}

/* ---------- 狭い画面 ---------- */
@media (max-width: 900px) {
  :root { --cw: 84px; --ch: 118px; }
  #app { height: auto; grid-template-columns: minmax(0, 1fr); grid-template-areas: 'top' 'table' 'panel'; }
  .table { overflow: visible; }
  .panel { border-left: 0; border-top: 1px solid var(--felt-line); max-height: 420px; }
  .card .c-text { font-size: 8.5px; }
  .card .c-head { font-size: 10px; min-height: 26px; }
  .card .c-art { flex-basis: 22px; font-size: 16px; }
  .field { gap: 6px; }
  .actionbar { order: 3; flex-basis: 100%; }
}
@media (max-width: 420px) {
  :root { --cw: 72px; --ch: 102px; }
  .card .c-text { display: none; }
  .lp { font-size: 20px; }
  .brand .ver { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition: none !important; }
}

/* ---------- 強化 ---------- */
.overlay.light { background: rgba(5, 9, 13, 0.6); }
.modal.wide { max-width: 760px; }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.choices.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice {
  --tier: var(--ink-dim);
  display: flex; flex-direction: column; gap: 8px; text-align: left;
  background: var(--table-2); color: var(--ink);
  border: 1px solid var(--tier); border-radius: 8px;
  padding: 16px; cursor: pointer; min-height: 150px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.choice:hover { transform: translateY(-4px); box-shadow: 0 0 0 2px var(--tier), 0 8px 20px rgba(0, 0, 0, 0.5); }
.choice.tier-1 { --tier: #8fa3b5; }
.choice.tier-2 { --tier: #6fcf8e; }
.choice.tier-3 { --tier: #e0a23c; }
.choice.big { --tier: var(--brass); background: linear-gradient(170deg, #2a2312, var(--table-2) 60%); min-height: 190px; }
.ch-tier { font-size: 11px; color: var(--tier); letter-spacing: 0.1em; font-weight: 700; }
.ch-name { font-family: var(--f-display); font-size: 20px; color: var(--ink); }
.choice.big .ch-name { color: var(--brass); }
.ch-text { font-size: 13px; line-height: 1.6; color: var(--ink); }
.deckpick { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 12px; }
.pickwrap { cursor: pointer; }
.pickwrap:hover .card { transform: translateY(-6px); box-shadow: 0 0 0 3px var(--brass); }
.bonus { list-style: none; padding: 0; max-height: 240px; overflow-y: auto; }
.bonus li { padding: 4px 0; border-bottom: 1px solid var(--felt-line); font-size: 13px; }
.tierdots { color: var(--brass); font-size: 11px; }

.buffs { border-bottom: 1px solid var(--felt-line); max-height: 34%; overflow-y: auto; flex-shrink: 0; }
.buffs .count { color: var(--ink-dim); font-weight: 400; margin-left: 6px; letter-spacing: 0; }
.bufflist { list-style: none; margin: 0; padding: 0 16px 10px; display: flex; flex-direction: column; gap: 6px; }
.bufflist li { display: flex; flex-direction: column; font-size: 12px; line-height: 1.5; padding-left: 8px; border-left: 2px solid var(--ink-dim); }
.bufflist li.big { border-left-color: var(--brass); }
.bufflist li b { font-size: 12.5px; }
.bufflist li.big b { color: var(--brass); }
.bufflist li span { color: var(--ink-dim); }

@media (max-width: 700px) {
  .choices, .choices.three { grid-template-columns: minmax(0, 1fr); }
  .choice, .choice.big { min-height: 0; }
  .modal { padding: 18px 16px; }
}
.deckpick.reward .pickwrap { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 150px; }
.pick-cap { font-size: 11.5px; color: var(--ink-dim); text-align: center; line-height: 1.5; }
.enemy-label { color: var(--bad); }
.bufflist.enemy li { border-left-color: var(--bad); }
.bufflist.enemy li b { color: var(--ink); }
.pickwrap.on .card { box-shadow: 0 0 0 3px var(--bad), 0 0 16px var(--bad); transform: translateY(-6px); }
.pickwrap.on::after { content: '戻す'; display: block; text-align: center; color: var(--bad); font-size: 12px; font-weight: 900; margin-top: 4px; }
.atk-preview { color: var(--target); font-weight: 700; }

/* ---------- レアリティ ---------- */
.card .c-head { justify-content: space-between; gap: 4px; }
.card .c-nm { min-width: 0; }
.rar { font-family: var(--f-display); font-size: 9px; padding: 1px 4px; border-radius: 3px; background: rgba(0, 0, 0, 0.28); flex-shrink: 0; letter-spacing: 0.04em; }
.card.rar-R .rar { background: #3d6fb3; }
.card.rar-SR .rar { background: #b8862b; color: #1a1408; }
.card.rar-UR .rar { background: linear-gradient(120deg, #e8c25a, #f6ecd0, #c99b2e); color: #1a1408; }
.card.rar-SR { border-color: #c99b2e; }
.card.rar-UR { border-color: #e8c25a; box-shadow: 0 0 0 1px #f6ecd0, 0 0 14px rgba(232, 194, 90, 0.55); }
.card.rar-UR .c-art { background: radial-gradient(circle, rgba(232, 194, 90, 0.28), transparent 70%); }
.card.free { box-shadow: 0 0 0 2px var(--r-spellcaster), 0 0 12px var(--r-spellcaster); }
.badge.taunt { background: var(--r-rock); color: #fff; }

/* ---------- 所持金・ショップ・パック ---------- */
.gold { font-family: var(--f-display); color: var(--brass); font-size: 16px; font-variant-numeric: tabular-nums; }
.modal.shop { max-width: 900px; }
.shop-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.shop-gold { color: var(--ink-dim); }
.shop-gold b { font-family: var(--f-display); font-weight: 400; color: var(--brass); font-size: 22px; }
.shopgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.shopgrid.singles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.shopitem {
  background: var(--table-2); border: 1px solid var(--felt-line); border-radius: 8px;
  padding: 14px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start;
}
.shopitem .btn { margin-top: auto; }
.shopitem.single { align-items: center; }
.shopitem.sold { opacity: 0.4; justify-content: center; align-items: center; }
.si-name { font-family: var(--f-display); font-size: 16px; color: var(--ink); }
.si-desc { font-size: 12.5px; color: var(--ink-dim); line-height: 1.6; }

.packrow { display: flex; gap: 18px; justify-content: center; margin: 18px 0 6px; flex-wrap: wrap; perspective: 900px; }
.packcard { display: flex; flex-direction: column; align-items: center; gap: 6px; width: var(--cw); }
.packcard.back .pc-back {
  width: var(--cw); height: var(--ch); border-radius: 6px; border: 2px solid var(--brass-dim);
  background: repeating-linear-gradient(45deg, var(--brass-dim) 0 4px, #3a2e17 4px 10px);
  display: grid; place-items: center;
}
.packcard.back .pc-back span { font-family: var(--f-display); font-size: 34px; color: var(--paper); text-shadow: 0 2px 0 #000; }
.packcard.open { cursor: pointer; animation: flip 0.55s ease-out both; animation-delay: calc(var(--i) * 0.25s); }
.packcard.open:hover .card { transform: translateY(-6px); box-shadow: 0 0 0 3px var(--brass); }
.packcard.open.rar-SR .pick-cap { color: #e0b04a; font-weight: 900; }
.packcard.open.rar-UR .pick-cap { color: #f6ecd0; font-weight: 900; text-shadow: 0 0 8px #e8c25a; }
.packcard.open.rar-R .pick-cap { color: #7fa6e0; font-weight: 700; }
@keyframes flip { from { transform: rotateY(90deg) scale(0.9); opacity: 0; } to { transform: rotateY(0) scale(1); opacity: 1; } }
.pickwrap.del::after { content: '削除'; }

@media (max-width: 760px) {
  .shopgrid, .shopgrid.singles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- オーバーレイ内のカード説明 ---------- */
.ov-detail {
  margin-top: 12px; min-height: 64px; padding: 10px 14px;
  background: var(--table-2); border: 1px solid var(--felt-line); border-radius: 6px;
  font-size: 13px; line-height: 1.6;
}
.ov-detail .d-empty { color: var(--ink-dim); font-size: 12.5px; }
.od-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin-bottom: 2px; }
.od-head b { font-family: var(--f-display); font-weight: 400; font-size: 15px; }
.od-head span { color: var(--ink-dim); font-size: 12px; }
.od-head .od-stats { color: var(--ink); font-variant-numeric: tabular-nums; }
.deckpick.big { --cw: 120px; --ch: 168px; }
.deckpick.big .card .c-text { font-size: 10.5px; }
.deckpick.big .card .c-head { font-size: 12.5px; }
.modal .deckpick { max-height: 52vh; overflow-y: auto; padding: 8px 4px; }
.ch-scope { margin-left: 8px; padding: 1px 6px; border-radius: 3px; font-size: 10.5px; letter-spacing: 0.04em; }
.ch-scope.perm { background: rgba(212, 169, 79, 0.18); color: var(--brass); }
.ch-scope.battle { background: rgba(111, 207, 142, 0.16); color: var(--good); }
.temp-label { color: var(--good); }
.bufflist li.temp { border-left-color: var(--good); }
.shopgrid.packs { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1000px) { .shopgrid.packs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .shopgrid.packs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.growing { animation: growglow 0.6s; }
@keyframes growglow { 40% { box-shadow: 0 0 0 3px var(--good), 0 0 22px var(--good); } }
.bonus li.ach { color: var(--brass); }

/* ---------- 刻印 ---------- */
.card .c-art { position: relative; }
.c-marks { position: absolute; left: 4px; top: 2px; display: flex; gap: 2px; }
.mk {
  display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%;
  background: #6b1f2e; color: #f6ecd0; font-family: var(--f-display); font-size: 10px; line-height: 1;
  box-shadow: 0 0 0 1px #e8c25a;
}
.mk.big { width: 26px; height: 26px; font-size: 14px; vertical-align: middle; }
.od-mark { font-size: 12.5px; color: var(--brass); margin-top: 4px; display: flex; gap: 6px; align-items: center; }
.pickwrap.eng::after { content: '刻む'; color: var(--brass); }
.progress { display: flex; gap: 5px; align-items: center; }
.pdot { width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--ink-dim); }
.pdot.done { background: var(--ink-dim); }
.pdot.now { border-color: var(--brass); box-shadow: 0 0 0 2px rgba(212, 169, 79, 0.35); }
.pdot.big { border-radius: 2px; transform: rotate(45deg); border-color: var(--brass); }
.pdot.big.done { background: var(--brass); }
@media (max-width: 700px) { .progress { display: none; } }

/* ---------- 敵の行動予告 ---------- */
.intent { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; font-size: 12px; }
.intent.big { justify-content: flex-start; font-size: 13px; margin: 4px 0 8px; }
.it-label { color: var(--bad); font-weight: 900; letter-spacing: 0.06em; margin-right: 4px; }
.it { padding: 2px 8px; border-radius: 3px; background: var(--table-2); border: 1px solid var(--felt-line); color: var(--ink); }
.it small { color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.it-summon { border-color: rgba(239, 106, 91, 0.5); }
.it-spell { border-color: rgba(122, 82, 179, 0.7); }
.it-buff { border-color: rgba(111, 207, 142, 0.5); }
.note-small { font-size: 12px; color: var(--ink-dim); }
.pdot.pool-boss { border-color: var(--bad); }
.rar-chip { display: inline-block; font-family: var(--f-display); font-size: 10px; padding: 0 5px; border-radius: 3px; background: #2a3a4a; color: var(--ink); vertical-align: middle; }
.rar-chip.r-R { background: #3d6fb3; color: #fff; }
.rar-chip.r-SR { background: #b8862b; color: #1a1408; }
.shopgrid.bigrow { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .shopgrid.bigrow { grid-template-columns: minmax(0, 1fr); } }
.tag-res { font-size: 11px; color: var(--brass); font-weight: 900; }
.blood { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.blood input { flex: 1; min-width: 140px; accent-color: var(--bad); }
.blood output { font-variant-numeric: tabular-nums; min-width: 9em; }

/* ---------- スマホ: タップで出る説明 ---------- */
.tapsheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  background: var(--panel); border-top: 2px solid var(--brass-dim);
  padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  max-height: 42vh; overflow-y: auto; font-size: 13px; line-height: 1.6;
  box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.5);
}
.tapsheet .d-name, .tapsheet .od-head b { font-family: var(--f-display); font-size: 15px; font-weight: 400; }
.tapsheet .d-meta, .tapsheet .d-note { color: var(--ink-dim); font-size: 12px; }
.tapsheet .d-stats { display: flex; gap: 12px; font-family: var(--f-display); }
.ts-hint { margin-top: 6px; font-size: 11px; color: var(--brass); }
.od-preview { margin-top: 6px; color: var(--target); font-weight: 700; }
.tapped { outline: 3px solid var(--target); outline-offset: 2px; }
.card.tapped { box-shadow: 0 0 0 3px var(--target), 0 0 16px var(--target); }

/* ---------- スマホの画面配置 ---------- */
@media (max-width: 700px) {
  .topbar { flex-wrap: wrap; gap: 6px 10px; padding: 8px 12px; }
  .brand { font-size: 16px; }
  .brand .ver { display: none; }
  .stage { order: 10; flex-basis: 100%; font-size: 12px; }
  .topbar .gold { margin-left: auto; }
  .topbar .ghost { padding: 5px 9px; font-size: 12px; }
  .table { display: flex; flex-direction: column; gap: 4px; padding: 8px 8px; }
  .side { justify-content: flex-start; gap: 6px; }
  .midline { padding: 6px 4px; gap: 8px 10px; min-height: 0; }
  .turnbox .num { font-size: 18px; }
  .idle-hint { display: none; }
  .info { gap: 10px; flex-wrap: wrap; justify-content: center; }
  .lp { font-size: 22px; }
  .slot { width: calc(var(--ch) * 0.82); height: calc(var(--ch) + 4px); }
  .intent { font-size: 11px; }
  .modal .deckpick { max-height: 44vh; }
  .choice { padding: 12px; }
  .ch-name { font-size: 17px; }
}
.tapsheet.top {
  top: 0; bottom: auto; max-height: 30vh; border-top: 0; border-bottom: 2px solid var(--brass-dim);
  padding-top: calc(8px + env(safe-area-inset-top, 0px)); padding-bottom: 8px; font-size: 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5); opacity: 0.97;
}

/* ---------- スターター / 負の刻印 / 伝説 / 試練 ---------- */
.card.rar-S .rar { background: #5a5f66; color: #e6e2d6; }

.mk.neg { background: #241a2e; color: #c9a6ff; box-shadow: 0 0 0 1px #8a5cc9; }
.od-mark.neg { color: #b994f0; }
.neg-cap { color: #b994f0; font-weight: 700; font-size: 11px; }
.rar-chip.r-L { background: linear-gradient(120deg, #c9483b, #f2b25a, #c9483b); color: #1a0d08; }
.legend-get { margin: 10px 0; padding: 10px 12px; border: 1px solid #f2b25a; border-radius: 8px; background: rgba(242, 178, 90, 0.12); font-size: 13.5px; line-height: 1.6; }
.trial-note { padding: 8px 10px; border-left: 3px solid #f2b25a; background: rgba(242, 178, 90, 0.08); }
.bonus.notes li { color: var(--brass); }

.warn-curse { color: #e0705a; font-weight: 700; }

/* =============================================================
   演出(段階6)
   ============================================================= */
#fxlayer { position: fixed; inset: 0; pointer-events: none; z-index: 80; overflow: hidden; }
.ripple {
  position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%;
  border: 2px solid rgba(232, 194, 90, 0.8); pointer-events: none; animation: ripple 0.65s ease-out forwards;
}
.ripple.big { border-color: #fff; border-width: 3px; animation-duration: 0.8s; }
.slot { position: relative; }
@keyframes ripple { to { transform: scale(6); opacity: 0; } }
.impact {
  position: absolute; width: 90px; height: 90px; margin: -45px 0 0 -45px; border-radius: 50%;
  background: radial-gradient(circle, #fff 0 18%, rgba(255, 230, 150, 0.85) 30%, transparent 65%);
  animation: impact 0.42s ease-out forwards;
}
@keyframes impact { from { transform: scale(0.3); opacity: 1; } to { transform: scale(2); opacity: 0; } }
.flash { position: absolute; inset: 0; animation: flashfade 0.5s ease-out forwards; }
@keyframes flashfade { from { opacity: 1; } to { opacity: 0; } }
.darken { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.7); }
.shard {
  position: absolute; background: var(--paper); border: 2px solid; border-radius: 2px;
  clip-path: polygon(10% 0, 100% 15%, 85% 100%, 0 80%);
}
.shard.fx-purple { background: #b48cff; box-shadow: 0 0 12px #b48cff; }
.spark { position: absolute; border-radius: 50%; box-shadow: 0 0 8px currentColor; }
.pillar {
  position: absolute; width: 140px; height: 160vh; margin-left: -70px; margin-top: -80vh;
  background: linear-gradient(90deg, transparent, rgba(255, 220, 120, 0.75), #fff, rgba(255, 220, 120, 0.75), transparent);
  filter: blur(4px); animation: pillar 1.3s ease-out forwards; transform-origin: center;
}
.pillar.rainbow { width: 200px; margin-left: -100px; background: linear-gradient(90deg, transparent, #ff6b6b, #ffd36b, #fff, #6bffb5, #6bc5ff, #d56bff, transparent); }
@keyframes pillar { 0% { transform: scaleX(0.1); opacity: 0; } 15% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(0.3); opacity: 0; } }
.confetti { position: absolute; top: -20px; width: 8px; height: 13px; border-radius: 2px; }
.banner {
  position: absolute; left: 0; right: 0; top: 42%; display: grid; place-items: center; padding: 14px 0;
  background: linear-gradient(90deg, transparent, rgba(12, 20, 28, 0.94) 20%, rgba(12, 20, 28, 0.94) 80%, transparent);
  border-block: 1px solid var(--brass-dim);
  animation: banner 1.1s cubic-bezier(.2,.8,.2,1) forwards;
}
.banner span { font-family: var(--f-display); font-size: clamp(22px, 5vw, 38px); color: var(--brass); letter-spacing: 0.08em; text-shadow: 0 2px 0 #000; }
.banner small { font-size: 0.55em; color: var(--ink-dim); margin-left: 10px; }
.banner.op span { color: #ff8a7a; }
.banner.last { border-color: var(--bad); }
.banner.last span { color: var(--bad); }
.banner.ur { top: 18%; border-color: #fff; }
.banner.ur span { font-size: clamp(30px, 8vw, 60px); background: linear-gradient(90deg, #ff6b6b, #ffd36b, #6bffb5, #6bc5ff, #d56bff); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; }
@keyframes banner { 0% { transform: translateX(-60%); opacity: 0; } 20%, 75% { transform: translateX(0); opacity: 1; } 100% { transform: translateX(60%); opacity: 0; } }
.castwrap { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); }
.castwrap .card { box-shadow: 0 0 0 3px #b48cff, 0 0 40px #b48cff; }
.beam { position: absolute; height: 6px; margin-top: -3px; transform-origin: 0 50%; background: linear-gradient(90deg, #fff, #b48cff); box-shadow: 0 0 14px #b48cff; border-radius: 3px; animation: flashfade 0.38s ease-out forwards; }
.flyghost { position: absolute; z-index: 90; }
.float.dmg.big { font-size: 30px; }
.float.dmg.huge { font-size: 42px; color: #ff4a3a; animation-duration: 1.2s; }

/* ---- カードの絵 ---- */
.card .c-art .glyph { position: relative; z-index: 1; }
.card .c-art { background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--race) 22%, transparent), transparent 70%); }
.card.has-art .c-art { flex-basis: 58px; padding: 0; overflow: hidden; border-block: 1px solid rgba(0, 0, 0, 0.25); }
.card.has-art .c-art img.art { width: 100%; height: 100%; object-fit: cover; display: block; }
.card.has-art .c-text { font-size: 8.5px; }
@media (max-width: 900px) { .card.has-art .c-art { flex-basis: 40px; } }

/* ---- SR・URの光の反射(ホロ) ---- */
.card.rar-SR::after, .card.rar-UR::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.35) 45%, transparent 60%);
  background-size: 250% 100%; mix-blend-mode: overlay; animation: holo 4.5s linear infinite;
}
.card.rar-UR::after {
  background: linear-gradient(115deg, transparent 20%, rgba(255, 120, 120, 0.4) 35%, rgba(255, 240, 120, 0.45) 45%, rgba(120, 255, 200, 0.45) 55%, rgba(120, 180, 255, 0.4) 65%, transparent 80%);
  background-size: 250% 100%; animation-duration: 3s; mix-blend-mode: color-dodge; opacity: 0.55;
}
@keyframes holo { from { background-position: 120% 0; } to { background-position: -120% 0; } }

/* ---- パック ---- */
.packstage { text-align: center; }
.packbox {
  position: relative; width: 150px; height: 210px; margin: 18px auto 10px; cursor: pointer;
  border-radius: 8px; background: linear-gradient(160deg, #3b2a5e, #1d1433 60%, #0f0a1c);
  border: 2px solid var(--brass); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), inset 0 0 30px rgba(212, 169, 79, 0.25);
  animation: packbob 2.2s ease-in-out infinite; overflow: hidden;
}
.packbox::before { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.25) 45%, transparent 60%); background-size: 250% 100%; animation: holo 3s linear infinite; }
.packbox.kind-premium { background: linear-gradient(160deg, #6a4a12, #2e1f07 60%, #140d02); }
.packbox.kind-damaged { background: linear-gradient(160deg, #3a2343, #1a0f1f 60%); border-color: #8a5cc9; }
.pb-top { position: absolute; left: 0; right: 0; top: 0; height: 30px; background: repeating-linear-gradient(90deg, var(--brass) 0 6px, var(--brass-dim) 6px 12px); border-bottom: 2px dashed #1a1408; transition: transform 0.4s, opacity 0.4s; }
.pb-body { position: absolute; inset: 40px 10px 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.pb-name { font-family: var(--f-display); color: var(--brass); font-size: 17px; line-height: 1.3; }
.pb-sub { color: var(--ink-dim); font-size: 12px; }
.packbox.torn { animation: packshake 0.45s; }
.packbox.torn .pb-top { transform: translate(40px, -40px) rotate(25deg); opacity: 0; }
@keyframes packbob { 50% { transform: translateY(-6px) rotate(-1deg); } }
@keyframes packshake { 20% { transform: rotate(-4deg); } 40% { transform: rotate(4deg) scale(1.04); } 60% { transform: rotate(-3deg); } 100% { transform: scale(1.1); opacity: 0.6; } }
.packcard.back { cursor: pointer; animation: dealin 0.45s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i) * 0.12s); }
.packcard.back .pc-back { position: relative; transition: transform 0.2s; }
.packcard.back:hover .pc-back { transform: translateY(-6px); }
.packcard.back.glow-R .pc-back { box-shadow: 0 0 14px 2px rgba(90, 150, 255, 0.75); }
.packcard.back.glow-SR .pc-back { box-shadow: 0 0 22px 5px rgba(255, 200, 80, 0.9); animation: glowpulse 1.1s ease-in-out infinite; }
.packcard.back.glow-UR .pc-back { animation: urglow 1.2s linear infinite; }
.packcard.back.charging .pc-back { animation: urglow 0.35s linear infinite, charge 1s ease-in forwards; }
@keyframes dealin { from { transform: translateY(-80px) scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes glowpulse { 50% { box-shadow: 0 0 34px 10px rgba(255, 210, 100, 1); } }
@keyframes urglow { 0% { box-shadow: 0 0 26px 8px #ff6b6b; } 25% { box-shadow: 0 0 26px 8px #ffd36b; } 50% { box-shadow: 0 0 26px 8px #6bffb5; } 75% { box-shadow: 0 0 26px 8px #6bc5ff; } 100% { box-shadow: 0 0 26px 8px #d56bff; } }
@keyframes charge { to { transform: scale(1.15) rotate(-3deg); filter: brightness(1.8); } }
.packcard.open { animation: none; }
.packcard.open.just { animation: flip 0.5s ease-out both; }
.packcard.open.just.rar-UR { animation: flipur 0.8s cubic-bezier(.2,.8,.2,1) both; }
@keyframes flipur { from { transform: rotateY(180deg) scale(1.6); opacity: 0; } 60% { transform: rotateY(0) scale(1.25); opacity: 1; } to { transform: none; } }
.pity-wrap { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 22px; margin: 2px 0 10px; }
.pity { display: flex; align-items: center; gap: 10px; justify-content: center; font-size: 12px; color: var(--ink-dim); }
.pity b { min-width: 3.2em; text-align: right; }
.pity-bar { width: 160px; height: 8px; border-radius: 4px; background: var(--table-2); border: 1px solid var(--felt-line); overflow: hidden; }
.pity-bar i { display: block; height: 100%; background: linear-gradient(90deg, #b8862b, #ffe28a); box-shadow: 0 0 8px #ffd36b; }
.pity.p-ur .pity-bar i { background: linear-gradient(90deg, #8a3fd1, #ff7ae0, #7af0ff); box-shadow: 0 0 8px #e07aff; }
.pity b { color: var(--brass); font-variant-numeric: tabular-nums; }

/* ---- 紋章 ---- */
.crest-svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.5)); }
.crest-svg image { filter: brightness(0.22); }
.crestrow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 14px; perspective: 900px; }
.crestpick {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  background: var(--table-2); color: var(--ink); border: 1px solid var(--felt-line); border-radius: 10px; padding: 14px 12px;
  cursor: pointer; transition: transform 0.2s, box-shadow 0.2s, opacity 0.3s;
  transform: rotateY(180deg); opacity: 0.35;
}
.crestpick > *:not(.cp-face) { visibility: hidden; }
.crestpick.up { transform: none; opacity: 1; transition: transform 0.55s cubic-bezier(.2,.8,.2,1), opacity 0.3s, box-shadow 0.2s; }
.crestpick.up > * { visibility: visible; }
@media (hover: hover) { .crestpick.up:hover { transform: translateY(-5px); box-shadow: 0 0 0 2px var(--brass), 0 10px 24px rgba(0, 0, 0, 0.5); } }
.cp-face { width: 96px; height: 104px; }
.crestpick.r-R.up .cp-face { filter: drop-shadow(0 0 10px rgba(200, 220, 255, 0.55)); }
.crestpick.r-SR.up .cp-face { filter: drop-shadow(0 0 16px rgba(255, 210, 100, 0.85)); animation: glowpulse2 1.6s ease-in-out infinite; }
@keyframes glowpulse2 { 50% { filter: drop-shadow(0 0 26px rgba(255, 220, 120, 1)); } }
.crestpick .ch-name { font-size: 18px; color: var(--brass); }
.crestpick.chosen { transform: scale(1.06); box-shadow: 0 0 0 3px var(--brass), 0 0 40px rgba(212, 169, 79, 0.7); }
.crestpick.dropped { opacity: 0.15; transform: scale(0.94); }
.mini-crest { width: 30px; height: 33px; flex-shrink: 0; }
.bufflist li.crestrowli { flex-direction: row; gap: 8px; align-items: flex-start; border-left: 0; padding-left: 0; }
.bl-txt { display: flex; flex-direction: column; min-width: 0; }
.bl-txt b { color: var(--brass); }
.shop-crest { display: inline-block; width: 26px; height: 29px; vertical-align: middle; margin-right: 4px; }
.legend-crest { float: left; width: 54px; height: 60px; margin: 0 10px 4px 0; }
.rar-chip.r-N { background: #8a5a2e; color: #fff; }
@media (max-width: 700px) {
  .crestrow { grid-template-columns: minmax(0, 1fr); }
  .crestpick { flex-direction: row; flex-wrap: wrap; text-align: left; justify-content: flex-start; }
  .cp-face { width: 60px; height: 66px; }
  .crestpick .ch-text { flex-basis: 100%; }
}

/* ---- 敵の肖像 ---- */
.portrait {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background: radial-gradient(circle at 50% 35%, #2a3a4c, #0c141c); border: 2px solid var(--brass-dim);
}
.portrait svg { width: 70%; height: 80%; margin-top: 20%; fill: #05080c; }
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.portrait.pool-strong { border-color: #c06a3a; }
.portrait.pool-boss { border-color: var(--bad); box-shadow: 0 0 12px rgba(239, 106, 91, 0.5); }
.portrait.pool-trialWeak, .portrait.pool-trialStrong { border-color: #f2b25a; }
.portrait.big { width: 96px; height: 128px; border-radius: 10px; }
.vs { display: flex; gap: 16px; align-items: center; margin-bottom: 8px; }
.vs h2 { margin: 0; }
.vs-no { font-size: 12px; color: var(--ink-dim); letter-spacing: 0.1em; }
.modal .vs .portrait.big { animation: vsin 0.5s cubic-bezier(.2,.8,.2,1) both; }
@keyframes vsin { from { transform: translateX(-40px); opacity: 0; } }

/* ---- 設定 ---- */
.set-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.set-vol { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--ink-dim); }
.set-vol input { accent-color: var(--brass); }
.ghost.icon { font-size: 15px; line-height: 1; padding: 6px 9px; }
.packcard .pick-cap { white-space: nowrap; }
@media (max-width: 700px) { .packcard.back .pick-cap { font-size: 10.5px; } }
@media (max-width: 700px) { .portrait.big { width: 72px; height: 96px; } .vs { gap: 12px; } }
.packcard .neg-cap { white-space: normal; display: inline-block; max-width: calc(var(--cw) + 30px); line-height: 1.4; }
/* 絵は拡大せず、枠いっぱいに収めて上寄りで切り取る(引きの構図を残す) */
.card.has-art .c-art img.art { object-position: 50% 28%; transform: none; }
.card.has-art .c-art { flex-basis: 74px; }
.deckpick.big .card.has-art .c-art { flex-basis: 76px; }
@media (max-width: 900px) { .card.has-art .c-art { flex-basis: 52px; } }
@media (max-width: 420px) { .card.has-art .c-art { flex-basis: 46px; } .deckpick.big .card.has-art .c-art { flex-basis: 60px; } }

/* =============================================================
   見た目の作り直し(段階6.1)
   ============================================================= */
/* ---- 決闘台 ---- */
.table {
  background:
    radial-gradient(ellipse 70% 40% at 50% 50%, rgba(212, 169, 79, 0.10), transparent 70%),
    radial-gradient(ellipse 90% 60% at 50% 18%, rgba(154, 48, 72, 0.16), transparent 70%),
    radial-gradient(ellipse 90% 60% at 50% 82%, rgba(77, 98, 184, 0.16), transparent 70%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 48px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 48px),
    linear-gradient(180deg, #121c27, #0d1620 50%, #121c27);
}
.midline { border-block: 1px solid rgba(212, 169, 79, 0.35); background: linear-gradient(90deg, transparent, rgba(212, 169, 79, 0.07), transparent); }
.slot {
  border: 1px solid rgba(212, 169, 79, 0.22); border-radius: 8px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.035), transparent 70%);
  box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.55);
}
.slot::before, .slot::after { content: ''; position: absolute; width: 10px; height: 10px; border-color: rgba(212, 169, 79, 0.55); border-style: solid; pointer-events: none; }
.slot::before { left: 3px; top: 3px; border-width: 1px 0 0 1px; }
.slot::after { right: 3px; bottom: 3px; border-width: 0 1px 1px 0; }
.enemy .slot { border-color: rgba(239, 106, 91, 0.25); }

/* ---- LPの札・山札と墓地 ---- */
.lp { display: inline-flex; align-items: baseline; gap: 2px; padding: 2px 12px 8px; border-radius: 6px; background: rgba(0, 0, 0, 0.32); border: 1px solid rgba(212, 169, 79, 0.35); }
.lpbar { position: absolute; left: 10px; right: 10px; bottom: 3px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.lpbar i { display: block; height: 100%; background: linear-gradient(90deg, #6fcf8e, #d4e66f); transition: width 0.5s; }
.lp.low { border-color: var(--bad); animation: lowpulse 1.2s ease-in-out infinite; }
.lp.low .lpbar i { background: var(--bad); }
.lp.low .v { color: #ff8a7a; }
@keyframes lowpulse { 50% { box-shadow: 0 0 16px rgba(239, 106, 91, 0.6); } }
.counts { align-items: center; }
.pile { display: inline-flex; align-items: center; gap: 5px; font-family: var(--f-display); font-size: 13px; color: var(--ink); }
.pile i { display: inline-block; width: 14px; height: 19px; border-radius: 2px; border: 1px solid var(--brass-dim); }
.pile.deck i { background: repeating-linear-gradient(45deg, var(--brass-dim) 0 2px, #3a2e17 2px 4px); box-shadow: 2px 2px 0 #3a2e17, 3px 3px 0 var(--brass-dim); }
.pile.gy i { background: rgba(255, 255, 255, 0.05); border-style: dashed; }
.pile.gy i.gy-top { background: var(--race); border-style: solid; opacity: 0.6; filter: grayscale(0.5); }

/* ---- カードの枠 ---- */
.card { background: linear-gradient(180deg, #f3ecd8, var(--paper) 40%, #e2d8bd); }
.card::before { content: ''; position: absolute; inset: 2px; border: 1px solid rgba(0, 0, 0, 0.12); border-radius: 4px; pointer-events: none; }
.card .c-head { text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35); background: linear-gradient(180deg, color-mix(in srgb, var(--race) 85%, #fff), var(--race)); }
.card .stars { color: #c9881a; letter-spacing: -1px; font-size: 9px; text-shadow: 0 0 1px rgba(0, 0, 0, 0.3); white-space: nowrap; }
.card .stars em { font-style: normal; color: var(--bad); letter-spacing: 0; margin-left: 4px; font-size: 9px; }
.card .c-art { margin: 0 4px; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18), inset 0 2px 6px rgba(0, 0, 0, 0.15); }
.card .c-stats { background: rgba(0, 0, 0, 0.05); }
.card.rar-R { border-color: #9fb3c9; box-shadow: 0 0 0 1px #dfe8f2 inset, 0 2px 6px rgba(0, 0, 0, 0.45); }
.card.rar-SR { box-shadow: 0 0 0 1px #f1d58a inset, 0 2px 8px rgba(0, 0, 0, 0.5); }
.card.rar-UR { border-width: 2px; border-image: linear-gradient(135deg, #ff6b6b, #ffd36b, #6bffb5, #6bc5ff, #d56bff) 1; }
@media (max-width: 420px) { .card .stars { font-size: 8px; } }

/* ---- 手札を扇形に ---- */
.hand.fan { flex-wrap: nowrap; gap: 0; padding-top: 10px; }
.hand.fan .fanslot { margin: 0 var(--fm, -6px); transform: rotate(calc(var(--k) * var(--rot, 4deg))) translateY(calc(var(--k) * var(--k) * var(--drop, 2.5px))); transform-origin: 50% 120%; transition: transform 0.18s; }
.hand.fan .fanslot:hover { transform: translateY(-18px) scale(1.08); z-index: 10; }
.hand.fan .fanslot .card:hover { transform: none; }
.hand.fan .fanslot:has(.card.selected) { transform: translateY(-16px); z-index: 9; }
@media (max-width: 700px) {
  .hand.fan { flex-wrap: wrap; gap: 4px; }
  .hand.fan .fanslot { margin: 0; transform: none; }
}
#zoomcard { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; background: rgba(0, 0, 0, 0.55); pointer-events: none; }
#zoomcard .card { --cw: 210px; --ch: 294px; transform: none !important; animation: none; }
#zoomcard .card .c-text { display: block; font-size: 13px; }
#zoomcard .card .c-head { font-size: 16px; min-height: 40px; }
#zoomcard .card .c-art { flex-basis: 110px; font-size: 44px; }
#zoomcard .card .c-stats { font-size: 18px; }
#zoomcard .card .stars { font-size: 13px; }

/* ---- 行動予告のアイコン ---- */
.it .ic { font-weight: 400; margin-right: 4px; }
.it-summon .ic { color: #ff8a7a; }
.it-spell .ic { color: #b48cff; }
.it-buff .ic { color: var(--good); }

/* ---- 小強化の札(永続は石板、この戦闘のみは光る札) ---- */
.choice { animation: dealin 0.4s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 0.08s); position: relative; overflow: hidden; }
.choice.sc-perm { background: linear-gradient(170deg, #2b3138, #1b2128 70%); border-width: 2px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), inset 0 -10px 20px rgba(0, 0, 0, 0.35); }
.choice.sc-battle { background: linear-gradient(170deg, #1c2e26, #14211c 70%); }
.choice.sc-battle::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(111, 207, 142, 0.12) 50%, transparent 65%); background-size: 250% 100%; animation: holo 3.5s linear infinite; pointer-events: none; }
.choice.tier-2 { box-shadow: 0 0 12px rgba(111, 207, 142, 0.25); }
.choice.tier-3 { box-shadow: 0 0 18px rgba(224, 162, 60, 0.45); }
.choice.tier-3 .ch-tier { text-shadow: 0 0 8px #e0a23c; }

/* ---- 勝利画面 ---- */
.modal.result .win-title { background: linear-gradient(180deg, #fff3c4, var(--brass) 60%, #8f6a25); -webkit-background-clip: text; background-clip: text; color: transparent; animation: wintitle 0.6s cubic-bezier(.2,.8,.2,1) both; }
@keyframes wintitle { from { transform: scale(2.2); opacity: 0; letter-spacing: 0.5em; } }
.ach-badge { display: inline-block; padding: 1px 8px; margin-right: 8px; border: 2px solid var(--brass); border-radius: 4px; font-family: var(--f-display); font-size: 12px; color: var(--brass); transform: rotate(-4deg); }
.bonus li.stamp { animation: stamp 0.35s cubic-bezier(.2,1.6,.4,1) both; animation-delay: calc(0.6s + var(--i) * 0.25s); }
@keyframes stamp { from { transform: scale(1.8); opacity: 0; } }
.bonus li.total b { font-family: var(--f-display); font-weight: 400; color: var(--brass); font-size: 18px; }
.coin { position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff6c8, #f2c14e 45%, #a77a1d); box-shadow: 0 0 6px rgba(255, 210, 100, 0.8); }

/* ---- ショップ ---- */
.shopitem { transition: transform 0.15s, box-shadow 0.15s; background: linear-gradient(170deg, #1d2a37, var(--table-2)); }
.shopitem:not(.sold):hover { transform: translateY(-3px); box-shadow: 0 0 0 1px var(--brass-dim), 0 8px 18px rgba(0, 0, 0, 0.45); }
.shopitem .btn { position: relative; padding-left: 24px; }
.shopitem .btn::before { content: ''; position: absolute; left: 7px; top: 50%; width: 11px; height: 11px; margin-top: -5.5px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff6c8, #f2c14e 45%, #a77a1d); }
.modal.shop h3 { display: flex; align-items: center; gap: 10px; }
.modal.shop h3::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--brass-dim), transparent); }

/* ---- タイトル ---- */
.overlay.title-ov { background: radial-gradient(ellipse at 50% 35%, #1d2a40, #070b11 75%); }
.title-screen { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; width: 100%; max-width: 640px; }
.tf { position: relative; height: 170px; width: 100%; margin-bottom: 4px; }
.tf-card { position: absolute; left: 50%; top: 10px; transform-origin: 50% 160%; transform: translateX(-50%) rotate(calc(var(--i) * 13deg)); animation: tfin 0.9s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc((var(--i) + 2) * 0.08s); }
.tf-card .card { pointer-events: none; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6); }
@keyframes tfin { from { transform: translateX(-50%) rotate(0) translateY(60px); opacity: 0; } }
.title-logo { display: flex; flex-direction: column; align-items: center; gap: 2px; animation: wintitle 0.8s 0.3s cubic-bezier(.2,.8,.2,1) both; }
.tl-main { font-family: var(--f-display); font-size: clamp(40px, 11vw, 72px); line-height: 1.05; background: linear-gradient(180deg, #fff3c4, #e8c25a 55%, #9a6d1e); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 0 #2a1d06) drop-shadow(0 0 22px rgba(232, 194, 90, 0.45)); }
.tl-sub { font-size: 12px; letter-spacing: 0.6em; color: var(--ink-dim); margin-left: 0.6em; }
.title-tag { color: var(--ink-dim); font-size: 13.5px; margin: 0; }
.title-btns { display: flex; flex-direction: column; gap: 10px; width: min(320px, 100%); margin-top: 6px; }
.btn.big { padding: 12px 16px; font-size: 16px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.btn.big small { font-size: 11px; font-weight: 400; opacity: 0.85; }
.title-sub { display: flex; gap: 10px; justify-content: center; }
@media (max-width: 420px) { .tf { height: 130px; } .tf-card .card { --cw: 72px; --ch: 102px; } }
/* 状態の光はレアリティの枠より優先 */
.card.card.selected { box-shadow: 0 0 0 3px var(--brass), 0 0 18px var(--brass); }
.card.card.ready { box-shadow: 0 0 0 2px var(--good), 0 2px 8px rgba(0, 0, 0, 0.5); }
.card.card.targetable { box-shadow: 0 0 0 3px var(--target), 0 0 20px var(--target); }
.card.card.picked { box-shadow: 0 0 0 3px var(--bad), 0 0 18px var(--bad); }
.card.card.free { box-shadow: 0 0 0 2px var(--r-spellcaster), 0 0 12px var(--r-spellcaster); }
.lp { padding: 0 10px 6px; font-size: 24px; }
.hand.fan { padding-top: 4px; }
.hand.fan .fanslot { transform: rotate(calc(var(--k) * var(--rot, 4deg))) translateY(calc(var(--k) * var(--k) * min(2px, var(--drop, 2px)))); }
.side { gap: 6px; }
@media (max-width: 420px) {
  .card .c-head { font-size: 9px; min-height: 22px; padding: 2px 3px; line-height: 1.15; }
  .card .rar { font-size: 8px; padding: 0 3px; }
  .card .c-sub { font-size: 8px; padding: 1px 3px 0; }
  .card .c-art { flex-basis: 20px; font-size: 14px; margin: 0 3px; }
  .card.has-art .c-art { flex-basis: 40px; }
  .card .c-stats { font-size: 10.5px; padding: 2px 3px 3px; margin-top: auto; }
  .card .c-stats span small { font-size: 7.5px; }
  .card::before { inset: 1px; }
}
.side.enemy { justify-content: flex-end; }
.side.player { justify-content: flex-start; }
@media (max-width: 700px) {
  .hand.fan { flex-wrap: wrap; gap: 4px; }
  .hand.fan .fanslot, .hand.fan .fanslot:hover { margin: 0; transform: none; }
}
/* 星: 広い画面は★を並べ、狭い画面は「★8」 */
.card .stars .st-num { display: none; }
@media (max-width: 900px) {
  .card .stars .st-full { display: none; }
  .card .stars .st-num { display: inline; letter-spacing: 0; }
  /* 攻守は絵の上に重ねてでも必ず見せる */
  .card .c-stats { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; background: rgba(236, 228, 207, 0.94); border-top: 1px solid rgba(0, 0, 0, 0.15); }
  .card .c-text { padding-bottom: 18px; }
}
/* 攻守の数字は折り返さない(桁が増えたら文字を小さく) */
.card .c-stats span { white-space: nowrap; }
@media (max-width: 900px) {
  .card .c-stats { font-size: 11px; gap: 2px; }
  .card .c-stats span small { font-size: 7px; margin-right: 1px; }
  .card .c-stats.long { font-size: 9px; letter-spacing: -0.4px; }
}
@media (max-width: 420px) {
  .card .c-stats.mid { font-size: 10px; letter-spacing: -0.3px; }
  .card .c-stats.long { font-size: 8px; }
}
@media (max-width: 900px) { .hand.fan .fanslot { margin: 0 max(1px, var(--fm, 1px)); } }

/* ---- ドラッグで攻撃 ---- */
#player-side .field .card.ready { touch-action: none; }
#dragline { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 85; }
#dragline line { stroke: rgba(255, 255, 255, 0.55); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 2 10; marker-end: url(#dl-head); }
#dragline marker path { fill: rgba(255, 255, 255, 0.7); }
#dragline.ok line { stroke: var(--bad); stroke-dasharray: none; filter: drop-shadow(0 0 6px var(--bad)); }
#dragline.ok marker path { fill: var(--bad); }
.card.drag-src { box-shadow: 0 0 0 3px var(--bad), 0 0 18px var(--bad) !important; }
.drag-hover { outline: 3px solid var(--bad); outline-offset: 3px; transform: scale(1.06); }
.card.def.drag-hover { transform: rotate(-90deg) scale(1.06); }
#player-side .hand .card { touch-action: none; }
#dropzones { position: fixed; z-index: 84; display: grid; grid-template-rows: 3fr 2fr; gap: 6px; pointer-events: auto; }
.dropzone { display: grid; place-items: center; border: 2px dashed rgba(232, 194, 90, 0.7); border-radius: 10px; background: rgba(232, 194, 90, 0.10); transition: background 0.12s, border-color 0.12s; }
.dropzone span { font-family: var(--f-display); font-size: 15px; color: var(--brass); text-shadow: 0 1px 2px #000; }
.dropzone.def { border-color: rgba(125, 160, 220, 0.7); background: rgba(125, 160, 220, 0.10); }
.dropzone.def span { color: #a9c3ec; }
.dropzone.drag-hover { background: rgba(232, 194, 90, 0.32); border-style: solid; outline: none; transform: none; }
.dropzone.def.drag-hover { background: rgba(125, 160, 220, 0.32); }
#dragghost { position: fixed; z-index: 86; pointer-events: none; transform: translate(-50%, -60%) rotate(-4deg) scale(1.05); opacity: 0.92; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.6)); }
#dragghost.ok { filter: drop-shadow(0 0 14px var(--brass)); }
#dragline.spell line { stroke: #b48cff; }
#dragline.spell.ok line { stroke: #b48cff; filter: drop-shadow(0 0 6px #b48cff); }
#dragline.spell marker path { fill: #b48cff; }

/* ---- スマホ: 中央の欄は高さ固定の1行 ---- */
body.touch .midline { min-height: 0; flex-wrap: nowrap; }
body.touch .midline .actionbar { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 6px; height: 34px; overflow: hidden; flex-wrap: nowrap; }
body.touch .midline .actionbar .hint.one { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; font-size: 12.5px; }
body.touch .midline .actionbar .btn { padding: 4px 10px; white-space: nowrap; }
body.touch .midline .turnbox .label { display: none; }
.mini-cancel { flex-shrink: 0; background: none; border: 1px solid var(--bad); color: var(--bad); border-radius: 4px; font-size: 12px; padding: 3px 8px; font-family: inherit; }
.pos-pop { position: absolute; left: 50%; top: -6px; transform: translate(-50%, -100%); z-index: 20; padding: 4px 10px; font-size: 12px; white-space: nowrap; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5); animation: dealin 0.2s ease-out both; }
#dragtip { position: fixed; z-index: 87; transform: translateX(-50%); max-width: 80vw; padding: 6px 10px; border-radius: 6px; background: rgba(10, 16, 22, 0.94); border: 1px solid var(--bad); color: #ffd9d3; font-size: 12.5px; font-weight: 700; pointer-events: none; text-align: center; }
.btn.pos-pop { top: 8px; transform: translate(-50%, 0); background: var(--brass); color: #1a1408; border-color: #fff3c4; font-weight: 700; }
#dragtip { max-width: calc(100vw - 16px); box-sizing: border-box; white-space: normal; overflow-wrap: anywhere; }
#dragtip { transform: none; }

/* ================= ショップ(よろず札屋) ================= */
.modal.shop { position: relative; padding-top: 30px; overflow-x: hidden; background: radial-gradient(120% 60% at 50% 0%, #2a2216 0%, var(--panel) 60%); }
.shop-awning { position: absolute; left: 0; right: 0; top: 0; height: 22px; background: repeating-linear-gradient(90deg, #a8382f 0 26px, #efe2c4 26px 52px); border-bottom: 3px solid #5a1d17;
  -webkit-mask: radial-gradient(13px 9px at 13px 100%, transparent 98%, #000) 0 0 / 26px 100% repeat-x; mask: radial-gradient(13px 9px at 13px 100%, transparent 98%, #000) 0 0 / 26px 100% repeat-x; }
.shop-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; margin-top: 6px; }
.keeper { width: 72px; height: 72px; border-radius: 50%; overflow: hidden; border: 2px solid var(--brass); background: #2b2318; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5); display: grid; place-items: end center; }
.keeper img { width: 100%; height: 100%; object-fit: cover; }
.keeper-ph { width: 46px; height: 56px; background: radial-gradient(circle at 50% 28%, #c9a46a 0 13px, transparent 14px), radial-gradient(ellipse at 50% 100%, #6b4a2a 0 26px, transparent 27px); position: relative; }
.keeper-ph::before { content: ''; position: absolute; left: 6px; right: 6px; top: 2px; height: 10px; border-radius: 10px 10px 2px 2px; background: #5a3a24; }
.keeper-talk h2 { margin: 0 0 4px; font-size: 22px; }
.bubble { position: relative; margin: 0; padding: 7px 11px; border-radius: 10px; background: var(--paper); color: var(--paper-ink); font-size: 13px; line-height: 1.5; max-width: 46ch; }
.bubble::before { content: ''; position: absolute; left: -7px; top: 12px; border: 7px solid transparent; border-right-color: var(--paper); border-left: 0; }
.shop-gold { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: #1a140a; border: 1px solid var(--brass-dim); font-size: 18px; color: #ffe08a; white-space: nowrap; }
.coin-ic { width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff6c8, #f2c14e 45%, #a77a1d); box-shadow: 0 0 6px rgba(242, 193, 78, 0.6); }
.shop-notice { margin: 12px 0 4px; padding: 7px 12px; border-radius: 6px; background: repeating-linear-gradient(0deg, #e9dfc4 0 22px, #e2d6b7 22px 23px); color: var(--paper-ink); font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4); transform: rotate(-0.4deg); }
.sn-tag { background: #a8382f; color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 3px; }
.sn-rule { color: var(--paper-dim); }

/* パックの棚: 木の板の上にパックが立つ */
.shelf { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 14px; padding: 14px 12px 0; border-radius: 6px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.05)); position: relative; }
.shelf-item { display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; padding-bottom: 8px; min-width: 0; }
.shelf-item::after { content: ''; position: absolute; left: -10px; right: -10px; top: 166px; height: 12px; background: linear-gradient(180deg, #8a5a2e, #5b391a); border-radius: 2px; box-shadow: 0 6px 10px rgba(0, 0, 0, 0.55); z-index: 0; }
.mini-pack { --pc: #3b2a5e; --pc2: #140d24; position: relative; z-index: 1; width: 108px; height: 160px; padding: 0; border-radius: 6px 6px 4px 4px; cursor: pointer; overflow: hidden;
  background: linear-gradient(160deg, var(--pc), var(--pc2) 75%); border: 2px solid rgba(255, 255, 255, 0.18); color: #fff; font: inherit;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; box-shadow: 0 6px 14px rgba(0, 0, 0, 0.55), inset 0 0 18px rgba(255, 255, 255, 0.08);
  transition: transform 0.18s, box-shadow 0.18s; }
.mini-pack::before { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.28) 45%, transparent 60%); background-size: 250% 100%; animation: holo 3.4s linear infinite; pointer-events: none; }
.mini-pack:not(:disabled):hover, .mini-pack:not(:disabled):focus-visible { transform: translateY(-8px) rotate(-2deg); box-shadow: 0 14px 22px rgba(0, 0, 0, 0.6), 0 0 0 2px var(--brass); }
.mini-pack:disabled { cursor: not-allowed; filter: saturate(0.45) brightness(0.7); }
.mp-crimp { position: absolute; left: 0; right: 0; top: 0; height: 14px; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.35) 0 4px, rgba(0, 0, 0, 0.25) 4px 8px); }
.mp-crimp.bottom { top: auto; bottom: 0; height: 10px; }
.mp-name { position: relative; font-family: var(--f-display); font-size: 14px; line-height: 1.25; padding: 0 8px; text-align: center; text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8); text-wrap: balance; }
.mp-sub { position: relative; font-size: 11px; padding: 1px 8px; border-radius: 999px; background: rgba(0, 0, 0, 0.45); }
.mp-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mini-pack.has-art .mp-name, .mini-pack.has-art .mp-sub { margin-top: auto; }
.mini-pack.has-art .mp-sub { margin-bottom: 16px; }
.mini-pack.kind-card { --pc: #4b3a86; --pc2: #191233; }
.mini-pack.kind-premium { --pc: #c99a2e; --pc2: #3a2606; border-color: #ffe08a; }
.mini-pack.kind-spell { --pc: #7a52b3; --pc2: #22123d; }
.mini-pack.kind-low { --pc: #4f9a5c; --pc2: #11301a; }
.mini-pack.kind-high { --pc: #b8443a; --pc2: #3a0f0b; }
.mini-pack.kind-damaged { --pc: #5d4a66; --pc2: #1c1420; border-style: dashed; }
.mini-pack.kind-damaged::after { content: none; }
.mini-pack.kind-buff { --pc: #2c8f8a; --pc2: #0b2a29; border-radius: 40px 40px 10px 10px; }
.mini-pack.kind-warrior { --pc: var(--r-warrior); --pc2: #1b2533; }
.mini-pack.kind-beast { --pc: var(--r-beast); --pc2: #33220b; }
.mini-pack.kind-spellcaster { --pc: var(--r-spellcaster); --pc2: #121a3a; }
.mini-pack.kind-dragon { --pc: var(--r-dragon); --pc2: #332a12; }
.mini-pack.kind-fiend { --pc: var(--r-fiend); --pc2: #2a0b14; }
.mini-pack.kind-rock { --pc: var(--r-rock); --pc2: #25221c; }
.mini-pack.kind-insect { --pc: var(--r-insect); --pc2: #1a2a0d; }
.mini-pack.kind-pyro { --pc: var(--r-pyro); --pc2: #3a170a; }
.mini-pack.kind-aqua { --pc: var(--r-aqua); --pc2: #0b2a33; }
.price-tag, .price-btn { position: relative; z-index: 1; display: inline-block; padding: 3px 12px 3px 18px; font: 700 14px var(--f-body); color: #2a1d06; background: #f4dc93;
  clip-path: polygon(10px 0, 100% 0, 100% 100%, 10px 100%, 0 50%); white-space: nowrap; }
.price-tag::before, .price-btn::before { content: ''; position: absolute; left: 7px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: #5b391a; }
.price-tag.short { background: #8d8470; color: #2a2a2a; }
.price-btn { border: 0; cursor: pointer; transition: transform 0.12s, background 0.12s; }
.price-btn:not(:disabled):hover { background: #ffe9a8; transform: translateY(-2px); }
.price-btn:disabled { background: #6d675b; color: #222; cursor: not-allowed; }
.mp-desc { margin: 4px 0 0; font-size: 11.5px; line-height: 1.45; color: var(--ink-dim); text-align: center; position: relative; z-index: 1; }
.shelf-item.sold .mini-pack { opacity: 0.35; }

/* 刻印台 */
.counter { padding: 10px 12px; border-radius: 6px; background: linear-gradient(180deg, #4a3220, #2e1e12); border-top: 3px solid #7a5432; box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5); }
.engrave-desk { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.engrave-desk p { margin: 2px 0 0; font-size: 12px; color: #d8c8a8; }
.engrave-desk .desk-art { width: 76px; height: 76px; object-fit: contain; margin: -10px 0 -8px -4px; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5)); }
.eng-head { position: relative; aspect-ratio: 3 / 1; max-height: 160px; width: 100%; margin: -4px 0 12px; border-radius: 8px; background-size: cover; background-position: left center; display: flex; align-items: center; justify-content: flex-end; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255, 200, 120, 0.25), 0 4px 14px rgba(0, 0, 0, 0.45); }
.eng-head::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 30%, rgba(20, 10, 4, 0.35) 60%, rgba(20, 10, 4, 0.55)); pointer-events: none; }
.eng-head h2 { position: relative; z-index: 1; margin: 0; padding: 0 6% 0 40%; text-align: center; flex: 1; text-shadow: 0 2px 6px #000, 0 0 14px rgba(0, 0, 0, 0.8); }
.stamp-ic { width: 38px; height: 46px; position: relative; }
.stamp-ic::before { content: ''; position: absolute; left: 13px; top: 0; width: 12px; height: 26px; border-radius: 6px 6px 2px 2px; background: linear-gradient(90deg, #8a5a2e, #c78d52, #8a5a2e); }
.stamp-ic::after { content: ''; position: absolute; left: 3px; bottom: 0; width: 32px; height: 18px; border-radius: 3px; background: linear-gradient(180deg, var(--brass), var(--brass-dim)); }

/* 紋章のショーケース: ガラス棚 */
.showcase { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 12px; border-radius: 8px;
  background: linear-gradient(160deg, rgba(160, 200, 230, 0.10), rgba(255, 255, 255, 0.02) 40%, rgba(160, 200, 230, 0.06)), #0e161e;
  border: 1px solid rgba(200, 225, 245, 0.25); box-shadow: inset 0 0 24px rgba(160, 200, 230, 0.08); }
.case-item { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 10px 8px; border-radius: 6px; background: radial-gradient(circle at 50% 25%, rgba(212, 169, 79, 0.18), transparent 60%), rgba(0, 0, 0, 0.25); min-width: 0; }
.case-item.r-SR, .case-item.r-L { background: radial-gradient(circle at 50% 25%, rgba(255, 200, 80, 0.32), transparent 62%), rgba(0, 0, 0, 0.25); }
.case-crest { width: 64px; height: 64px; display: grid; place-items: center; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6)); }
.case-crest svg { width: 100%; height: 100%; }
.case-name { font-weight: 700; font-size: 13.5px; }
.case-desc { margin: 0; font-size: 12px; line-height: 1.5; color: var(--ink-dim); }
.case-item .price-btn { margin-top: auto; }
.case-item.sold, .rack-slot.sold { opacity: 0.4; justify-content: center; min-height: 80px; }
.case-empty { font-size: 13px; color: var(--ink-dim); }

/* カード単品: 吊り下げラック */
.rack { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 16px 10px 10px; border-radius: 6px; position: relative;
  background: linear-gradient(180deg, #232f3b 0 6px, transparent 6px), rgba(0, 0, 0, 0.18); }
.rack-slot { display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; min-width: 0; }
.rack-slot::before { content: ''; position: absolute; top: -12px; left: 50%; width: 2px; height: 12px; background: #8899aa; }
.rack-slot .tag-res { z-index: 2; }

@media (max-width: 760px) {
  .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .showcase { grid-template-columns: minmax(0, 1fr); }
  .rack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shop-head { grid-template-columns: auto minmax(0, 1fr); }
  .shop-gold { grid-column: 1 / -1; justify-self: end; }
  .keeper { width: 56px; height: 56px; }
}

/* ================= 隠しボス・大会・三位一体 ================= */
.limit-break { text-align: center; font-size: 16px; margin: 8px 0; }
.lb-num { display: inline-block; font-weight: 900; padding: 0 6px; }
.lb-num.cracking { animation: lbshake 0.12s linear infinite; color: #ff8a7a; text-shadow: 0 0 8px #f33; }
.lb-num.broken { font-family: var(--f-display); color: var(--bad); font-size: 22px; animation: lbin 0.5s cubic-bezier(.2,1.6,.4,1); }
@keyframes lbshake { 25% { transform: translate(-2px, 1px) rotate(-2deg); } 75% { transform: translate(2px, -1px) rotate(2deg); } }
@keyframes lbin { from { transform: scale(2.4); opacity: 0; } }
.pdot.pool-hidden { border-color: #b03030; background: #300; box-shadow: 0 0 8px #f33; }
.modal.story { text-align: center; }
.modal.story .card { margin: 10px auto; }
.hidden-clear { color: #ffd9a0; line-height: 1.8; }
.lp.neg, .lpnum.neg { color: #b48cff !important; }
.trinity { position: fixed; inset: 0; z-index: 120; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; animation: trifade 0.6s ease-out; cursor: pointer; padding: 16px; }
.trinity.out { opacity: 0; transition: opacity 0.4s; }
@keyframes trifade { from { background: #fff; } }
.tri-stage { position: relative; width: min(420px, 90vw); height: min(300px, 64vw); }
.tri-img { width: 100%; height: 100%; object-fit: contain; animation: triIn 0.9s ease-out both; }
.tri-card { position: absolute; transform-origin: center; }
.tri-card .card { margin: 0; }
.tri-card.mount { left: 50%; bottom: 0; transform: translateX(-50%) rotate(90deg) scale(1.05); animation: triMount 0.8s 0.2s cubic-bezier(.2,1.4,.4,1) both; }
.tri-card.rider { left: 50%; bottom: 34%; transform: translateX(-70%) rotate(-6deg) scale(0.8); animation: triRider 0.8s 0.6s cubic-bezier(.2,1.4,.4,1) both; z-index: 2; }
.tri-card.weapon { left: 50%; bottom: 52%; transform: translateX(10%) rotate(-58deg) scale(0.62); animation: triWeapon 0.8s 1s cubic-bezier(.2,1.4,.4,1) both; z-index: 3; filter: drop-shadow(0 0 10px #cfe8ff); }
@keyframes triMount { from { opacity: 0; transform: translateX(-50%) rotate(90deg) scale(0.3); } }
@keyframes triRider { from { opacity: 0; transform: translate(-70%, -80px) rotate(-6deg) scale(0.8); } }
@keyframes triWeapon { from { opacity: 0; transform: translateX(10%) rotate(300deg) scale(0.2); } }
@keyframes triIn { from { opacity: 0; transform: scale(0.8); } }
.tri-cap { margin: 0; text-align: center; color: #e8f2ff; display: flex; flex-direction: column; gap: 4px; }
.tri-cap span { color: #8aa; font-size: 14px; animation: triIn 0.4s 1.2s both; }
.tri-cap b { font-family: var(--f-display); font-size: 22px; animation: triIn 0.4s 1.8s both; }
.tri-cap small { color: #9ab; animation: triIn 0.4s 2.2s both; line-height: 1.6; }
.lp.neg .v { color: #b48cff; } .lp.neg { border-color: #8a5cc9; }

/* 小強化: 「永続」は控えめな青い光(「すぐに効果」の緑と見分けられるように) */
.choice.sc-perm { border-color: rgba(110, 160, 230, 0.55); background: linear-gradient(170deg, #1c2636, #151c28 70%); }
.choice.sc-perm::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 35%, rgba(120, 175, 255, 0.13) 50%, transparent 65%); background-size: 250% 100%; animation: holo 3.5s linear infinite; }
.ch-scope.perm { background: rgba(110, 160, 230, 0.18); color: #8fb8f0; }

/* 戦闘準備の画面 */
.modal.intro { max-width: 980px; }
.vs-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0; }
.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; background: rgba(255, 255, 255, 0.07); border: 1px solid var(--felt-line); color: var(--ink); white-space: nowrap; }
.chip.warn { border-color: #f2b25a; color: #ffd08a; }
.chip.gold { border-color: var(--brass); color: var(--brass); }
.chip.dim { color: var(--ink-dim); white-space: normal; }
.modal.intro .blurb { margin: 6px 0; color: var(--ink-dim); font-size: 13.5px; line-height: 1.65; }
.intro-cols { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr); gap: 20px; margin-top: 6px; }
.intro-cols h3 { margin-top: 8px; }
.intro-op ul { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.6; }
.intro-me .deckpick.big { justify-content: flex-start; }
@media (max-width: 760px) { .intro-cols { grid-template-columns: minmax(0, 1fr); gap: 4px; } }
@media (max-width: 420px) {
  .deckpick.big { --cw: 94px; --ch: 136px; gap: 5px; }
  .modal.intro .deckpick { justify-content: center; }
  .deckpick.big .card .c-text { display: block; font-size: 8.5px; }
  .modal.intro .deckpick { max-height: none; overflow: visible; }
}

/* 秘蔵パック */
.packbox.kind-treasure { background: linear-gradient(160deg, #fff3c4, #e0a93a 30%, #8a4fd1 70%, #2a1550); border-color: #fff1b0; box-shadow: 0 0 40px rgba(255, 215, 120, 0.7), 0 10px 30px rgba(0, 0, 0, 0.6); }
.packbox.kind-treasure::before { background: linear-gradient(115deg, transparent 20%, rgba(255, 120, 120, 0.45) 35%, rgba(255, 240, 120, 0.5) 45%, rgba(120, 255, 200, 0.45) 55%, rgba(120, 180, 255, 0.45) 65%, transparent 80%); background-size: 250% 100%; mix-blend-mode: color-dodge; }
.packbox.kind-treasure .pb-name { color: #fff; text-shadow: 0 0 10px #ffd36b, 0 2px 3px #000; }
/* 光らずに来たレアカード */
.packcard.surprise .card { animation: surprise 0.7s cubic-bezier(.2,1.6,.4,1); }
@keyframes surprise { 0% { transform: scale(0.8) rotate(-6deg); } 50% { transform: scale(1.18) rotate(3deg); } 100% { transform: none; } }

/* ===== カード上部の圧縮: 名前だけの見出し、★は絵の上 ===== */
.card .c-head { min-height: 26px; padding: 3px 5px; }
.card .c-nm { display: block; white-space: nowrap; overflow: hidden; text-overflow: clip; } /* 名前は1行。入りきらないときは文字を小さくする(ui.js の fitStats) */
.card .c-art { margin-top: 3px; }
.card .c-stars { position: absolute; left: 2px; top: 2px; z-index: 2; padding: 0 4px; border-radius: 3px; background: rgba(20, 16, 10, 0.62); color: #ffd04d; font-size: 9px; line-height: 1.5; letter-spacing: -1px; text-shadow: none; pointer-events: none; }
.card .c-stars .st-num { letter-spacing: 0; }
.c-marks { left: auto; right: 3px; top: 2px; }
.card.has-art .c-art { flex-basis: 88px; }
.deckpick.big .card.has-art .c-art { flex-basis: 90px; }
@media (max-width: 900px) { .card .c-head { min-height: 22px; } .card.has-art .c-art { flex-basis: 64px; } .card .c-stars { font-size: 8px; } }
@media (max-width: 420px) { .card.has-art .c-art { flex-basis: 56px; } .deckpick.big .card.has-art .c-art { flex-basis: 72px; } }
#zoomcard .card .c-stars { font-size: 13px; }

/* ===== レアリティは枠と加工で見せる(スターターとノーマルは同じ素の紙) ===== */
.card.rar-R { border: 2px solid #a9bfd8; box-shadow: 0 0 0 1px #5f7fa6, inset 0 0 0 1px rgba(255, 255, 255, 0.7), 0 2px 6px rgba(0, 0, 0, 0.45); }
.card.rar-SR { border: 2px solid #d9a93a; box-shadow: 0 0 0 1px #7a5a14, inset 0 0 0 1px #fff0b8, 0 0 10px rgba(217, 169, 58, 0.45), 0 2px 8px rgba(0, 0, 0, 0.5); }
.card.rar-SR .c-head { background: linear-gradient(180deg, color-mix(in srgb, var(--race) 70%, #ffe7a0), var(--race) 70%); }
.card.rar-UR { border: 2px solid transparent; border-image: linear-gradient(135deg, #ff6b6b, #ffd36b, #6bffb5, #6bc5ff, #d56bff) 1; box-shadow: 0 0 14px rgba(255, 220, 140, 0.55), 0 2px 8px rgba(0, 0, 0, 0.5); }
.card.rar-UR .c-head { background: linear-gradient(110deg, color-mix(in srgb, var(--race) 60%, #fff3c4), var(--race) 45%, color-mix(in srgb, var(--race) 70%, #c9b6ff)); }

/* マウスのホイールで、カードの絵と効果文をいっしょにスクロールして全文を読めるようにする(タッチ端末では固定) */
.card .c-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; scrollbar-width: none; }
.card .c-body::-webkit-scrollbar { display: none; }
.card .c-body > .c-art { flex-shrink: 0; }
.card .c-body > .c-text { flex: 1 0 auto; overflow: visible; padding-bottom: 4px; }
body:not(.touch) .card .c-body { overflow-y: auto; }

/* パック: カードを手前に引いて選ぶ */
.packcard.open.pulling { animation: none; z-index: 60; position: relative; cursor: grabbing; }
.packcard.open.pulling .card { transition: none; }
.packcard.open.will-take .card { box-shadow: 0 0 0 3px var(--good), 0 0 24px rgba(111, 207, 142, 0.8); }
.packcard.open { touch-action: none; }

/* レベルが下がっているカードの★ */
.card .c-stars.lv-down { color: #8fd0ff; }

/* ===== 瘴気をまとった敵 ===== */
.portrait.miasma { position: relative; overflow: visible; border-color: #8a4fd1; box-shadow: 0 0 14px rgba(138, 79, 209, 0.8), 0 0 30px rgba(80, 20, 120, 0.6); animation: miasmaPulse 2.4s ease-in-out infinite; }
.portrait.miasma::after { content: ''; position: absolute; inset: -10px; border-radius: inherit; pointer-events: none;
  background: radial-gradient(circle at 30% 70%, rgba(150, 70, 220, 0.45), transparent 45%), radial-gradient(circle at 75% 25%, rgba(90, 200, 120, 0.3), transparent 40%);
  filter: blur(6px); animation: miasmaSwirl 4s linear infinite; }
.portrait.miasma.mi-2 { border-color: #c0306a; box-shadow: 0 0 18px rgba(192, 48, 106, 0.9), 0 0 40px rgba(90, 10, 60, 0.8); }
.portrait.miasma.mi-2::after { background: radial-gradient(circle at 30% 70%, rgba(200, 40, 110, 0.55), transparent 45%), radial-gradient(circle at 75% 25%, rgba(140, 60, 220, 0.45), transparent 40%); }
@keyframes miasmaPulse { 50% { box-shadow: 0 0 22px rgba(138, 79, 209, 1), 0 0 44px rgba(80, 20, 120, 0.8); } }
@keyframes miasmaSwirl { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.modal.miasma-modal { background: radial-gradient(120% 70% at 30% 0%, rgba(110, 40, 160, 0.35), transparent 60%), var(--panel); border-color: #8a4fd1; }
.modal.miasma-modal.mi-2 { background: radial-gradient(120% 70% at 30% 0%, rgba(170, 30, 90, 0.4), transparent 60%), var(--panel); border-color: #c0306a; }
.modal.miasma-modal h2 { color: #d9b8ff; }
.modal.miasma-modal.mi-2 h2 { color: #ffb0cf; }
.miasma-reward { margin: 10px 0; padding: 8px 12px; border-left: 3px solid #b48cff; background: rgba(180, 140, 255, 0.1); font-size: 13.5px; }
.btn.danger { background: linear-gradient(180deg, #9a4fd6, #6a2aa0); border-color: #b48cff; color: #fff; }
.legend-get.miasma-get { border-color: #b48cff; background: rgba(180, 140, 255, 0.12); }

/* 初期手札・初期LP・勝利ゴールド(いつでも見られる小さな表示) */
.runstats { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 8px 16px 2px; font-size: 11.5px; color: var(--ink-dim); }
.runstats b { color: var(--ink); font-weight: 700; }
.pickwrap.eng.mir::after { content: '複製'; }

/* ショップの単品: 2割引の札 */
.tag-res.tag-sale { background: #c0392b; color: #fff; padding: 1px 8px; border-radius: 3px; }
.rack-slot > .tag-res { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); z-index: 3; }

/* 竜闘気: 竜になったあなた(情報欄に小さく並ぶ。場の枠は使わない) */
.avatar-slot { --cw: 64px; --ch: 90px; width: var(--cw); height: var(--ch); position: relative; flex: none; }
.avatar-slot .card { box-shadow: 0 0 0 2px var(--r-dragon), 0 0 18px rgba(255, 226, 138, 0.55); }
.aura-meter { position: relative; display: inline-flex; align-items: baseline; gap: 3px; padding: 2px 8px 5px; border: 1px solid var(--brass-dim); border-radius: 999px; font-variant-numeric: tabular-nums; color: var(--ink); overflow: hidden; }
.aura-meter small { color: var(--r-dragon); font-weight: 700; margin-right: 3px; }
.aura-meter i { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--r-dragon); }
.avatar-slot .card .c-text, .avatar-slot .card .stars { display: none; }
.avatar-slot .card .c-nm { font-size: 10px; }
.avatar-slot .card .c-stats { font-size: 8px; }

/* 枠が画面からはみ出したら、場を左右にスクロールできるようにする
   (中央寄せのままだと左端が切れて見えなくなる。はみ出したときだけ .scroll が付く) */
.field.scroll {
  max-width: 100%;
  overflow-x: auto; overflow-y: hidden;
  justify-content: flex-start;
  padding: 4px 2px 6px; scrollbar-width: thin;
  -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
}
.field .slot { flex: none; }

/* デッキ一覧: カードと「紋章と強化」の切り替え */
.deck-tabs { display: flex; justify-content: center; gap: 8px; margin: 4px 0 12px; }
.deck-tabs .btn.on { background: var(--brass); color: #1b1408; border-color: var(--brass); }
.deck-buffs { max-width: 640px; margin: 0 auto; text-align: left; }
.deck-buffs .bufflist li { font-size: 13px; }
.deck-buffs .bufflist li b { font-size: 14px; }

/* =====================================================================
   スマホ(幅700px以下): 戦闘画面を1画面に収める
   ・ページはスクロールしない(盤面の大きさは ui.js の fitBoard が画面の高さに合わせる)
   ・ログ・紋章・カード詳細は、右下のボタンで開く引き出しに入れる
   ・手札は重ねて並べる
   ===================================================================== */
.panel-btn, #peek { display: none; }
@media (max-width: 700px) {
  html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
  #app {
    height: 100vh; height: 100dvh;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: 'top' 'table';
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .topbar { flex-wrap: nowrap; gap: 8px; padding: 4px 10px; padding-top: max(4px, env(safe-area-inset-top, 0px)); }
  .brand { font-size: 13px; white-space: nowrap; }
  .stage { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .topbar .ghost { padding: 3px 7px; font-size: 11.5px; white-space: nowrap; }
  .topbar .gold { font-size: 12px; white-space: nowrap; }
  .table { overflow: hidden; padding: 2px 6px 4px; gap: 2px; grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr); }
  .side { gap: 3px; justify-content: space-evenly; }
  .side.enemy { justify-content: flex-end; }
  .side.player { justify-content: flex-start; }
  .info { gap: 10px; font-size: 11px; }
  .info .who { font-size: 12px; }
  .lp { font-size: 19px; }
  .portrait:not(.big) { width: 28px; height: 28px; }
  .intent { font-size: 10.5px; gap: 4px; }
  .midline { min-height: 0; padding: 3px 6px; gap: 6px 10px; }
  .turnbox .num { font-size: 17px; }
  .turnbox .label { font-size: 10px; }
  .whose { font-size: 11.5px; padding: 2px 8px; }
  .midline .btn { padding: 6px 12px; font-size: 13px; }
  .slot { width: calc(var(--ch) + 2px); height: calc(var(--ch) + 2px); }
  /* 手札: 1列で重ねる(重なり具合は ui.js が --hov で決める) */
  .hand.fan, .hand.fan:not(.x) { flex-wrap: nowrap; gap: 0; padding-top: 6px; justify-content: center; max-width: 100%; }
  .hand.fan .fanslot { margin: 0; transform: none; flex: none; }
  .hand.fan .fanslot + .fanslot { margin-left: var(--hov, 2px); }
  .hand.fan .fanslot:has(.card.selected), .hand.fan .fanslot:has(.card.tapped) { transform: translateY(-10px); z-index: 9; }

  /* 「ログ・紋章」ボタン(自分の情報欄の右端)と引き出し(カード詳細・紋章と強化・ログ) */
  .panel-btn {
    display: inline-grid; place-items: center; flex: none;
    min-width: 34px; height: 30px; padding: 0 8px; border-radius: 15px;
    background: var(--panel); color: var(--brass); border: 1px solid var(--brass-dim);
    font-size: 10.5px; font-weight: 700; line-height: 1.1; cursor: pointer;
  }
  body.panel-open .panel-btn { background: var(--brass); color: #1b1408; }
  .panel {
    position: fixed; z-index: 75; left: 0; right: 0; bottom: 0;
    max-height: 72vh; max-height: 72dvh; overflow-y: auto;
    border-left: 0; border-top: 1px solid var(--brass-dim); border-radius: 12px 12px 0 0;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.6);
    transform: translateY(105%); transition: transform 0.22s ease-out; visibility: hidden;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 52px);
  }
  body.panel-open .panel { transform: none; visibility: visible; }
  /* 引き出しにはカードの説明を出さない(紋章とログだけ。その分を縦に長く使う) */
  .panel { height: 86vh; height: 86dvh; max-height: none; overflow: hidden; }
  .panel .detail { display: none; }
  .panel .buffs { max-height: 46%; }
  .panel .log-wrap { min-height: 0; }

  /* 盤面のカードを触ったときの説明(タップの邪魔をしないよう、触っても反応しない) */
  #peek {
    display: block; position: fixed; z-index: 74; left: 8px; right: 8px;
    max-height: 34vh; overflow: hidden; pointer-events: none;
    background: rgba(17, 22, 29, 0.96); border: 1px solid var(--brass-dim); border-radius: 10px;
    padding: 8px 12px; font-size: 12px; line-height: 1.55; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    opacity: 0; transition: opacity 0.15s;
  }
  #peek.on { opacity: 1; }
  #peek.top { top: calc(env(safe-area-inset-top, 0px) + 6px); }
  #peek.bottom { bottom: calc(env(safe-area-inset-bottom, 0px) + 6px); }
  #peek .d-empty, #peek .d-hint { display: none; }

  /* 戦闘前の準備: 開始ボタンはいつも画面の下に見えるように */
  .overlay:has(.modal.intro) { padding: 6px; padding-top: max(6px, env(safe-area-inset-top, 0px)); padding-bottom: max(6px, env(safe-area-inset-bottom, 0px)); }
  .modal.intro { display: flex; flex-direction: column; max-height: 100%; padding: 12px 12px 10px; overflow: hidden; }
  .modal.intro .intro-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
  .modal.intro .actions { flex: none; margin-top: 8px; flex-wrap: wrap; gap: 6px; }
  .modal.intro .actions .btn { padding: 8px 12px; font-size: 13px; }
  .modal.intro .vs { gap: 10px; align-items: center; }
  .modal.intro .portrait.big { width: 52px; height: 68px; }
  .modal.intro h2 { font-size: 18px; margin: 0 0 4px; }
  .modal.intro .vs-no { font-size: 11px; }
  .modal.intro .chips { gap: 4px; }
  .modal.intro .chip { font-size: 11px; padding: 2px 8px; }
  .modal.intro .blurb { font-size: 12px; line-height: 1.5; margin: 6px 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .modal.intro .trial-note { font-size: 11.5px; line-height: 1.5; margin: 4px 0; padding: 6px 10px; }
  .modal.intro h3 { margin: 8px 0 2px; font-size: 12px; }
  .modal.intro .intent.big { margin: 2px 0 4px; font-size: 11.5px; }
  .modal.intro ul, .modal.intro li { font-size: 12px; line-height: 1.5; margin: 2px 0; }
  .modal.intro .deckpick.big { gap: 4px; }
  .modal.intro .deckpick.big .card { --cw: 60px; --ch: 86px; }
  .modal.intro .deckpick.big .card .c-text { display: none; }
  .modal.intro .deckpick.big .card.has-art .c-art { flex-basis: 40px; }
  .modal.intro .ov-detail { min-height: 0; font-size: 11.5px; padding: 6px 10px; margin-top: 6px; }
  .modal.intro .note-small { font-size: 11px; margin: 4px 0; }
}
@media (max-width: 700px) {
  /* 盤面の余った高さは、上下に均等に配る */
  .table { justify-content: space-evenly; }
  .side, .side.enemy, .side.player { justify-content: center; }
  .turnbox, .whose, .midline .btn { white-space: nowrap; }
  .midline .actionbar { min-width: 0; overflow: hidden; }
  .midline .hint { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
  /* 戦闘前の準備をさらに詰める */
  .modal.intro .blurb { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 11.5px; line-height: 1.5; margin: 4px 0; cursor: pointer; }
  .modal.intro .blurb.open { display: block; -webkit-line-clamp: unset; }
  .modal.intro .portrait.big { width: 44px; height: 58px; }
  .modal.intro .intent.big { display: flex; flex-wrap: wrap; gap: 4px; }
  .modal.intro .actions [data-act="help"] { display: none; }
  .modal.intro .deckpick.big { flex-wrap: nowrap; justify-content: center; }
  .modal.intro .deckpick.big .card { --cw: min(60px, calc((100vw - 64px) / 5)); --ch: calc(var(--cw) * 1.42); }
  .modal.intro .deckpick.big .card .c-stars { font-size: 7px; }
}
@media (max-width: 700px) {
  #peek.detail { min-height: 0; border-bottom: 1px solid var(--brass-dim); padding: 8px 12px; }
  #peek .d-name { font-size: 14px; margin-bottom: 2px; }
  #peek .d-meta { font-size: 11px; margin-bottom: 4px; }
  #peek .d-stats { font-size: 13px; margin-bottom: 4px; }
  #peek .d-text { font-size: 12px; line-height: 1.5; }
  #peek .d-note { font-size: 10.5px; margin-top: 4px; }
  .card.spell .c-stats { background: #ece4cf; }
}

/* ---- パックの絵(届いた絵があるとき) ---- */
.packbox.has-art { width: 160px; height: 240px; background: #111; border: 0; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.65); }
.packbox.has-art::before { z-index: 1; opacity: 0.7; }
.pb-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: clip-path 0.4s; }
/* 開け口: 絵の上端を切り取ったものが、裂けて飛んでいく */
.packbox.has-art .pb-top { z-index: 2; height: 15%; border: 0; background: var(--pack-art) top / 100% auto no-repeat; }
.packbox.has-art.torn .pb-art { clip-path: inset(15% 0 0 0); }
.packbox.has-art .pb-body { z-index: 2; inset: auto 0 0; padding: 22px 8px 10px; gap: 2px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.85)); }
.packbox.has-art .pb-name { font-size: 15px; text-shadow: 0 2px 4px #000; }
.packbox.has-art .pb-sub { color: #ddd; }
/* 秘蔵パック: 見た目は普通のパック。開けるときだけ正体を現す */
.packbox.kind-treasure.has-art { box-shadow: 0 12px 30px rgba(0, 0, 0, 0.65); }
.packbox.kind-treasure.has-art::before { mix-blend-mode: normal; background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.25) 45%, transparent 60%); background-size: 250% 100%; }
.packbox.tr-charge { animation: trRumble 0.12s linear infinite; box-shadow: 0 0 30px #ffd36b, 0 0 70px #d56bff, 0 0 120px #6bc5ff; transition: box-shadow 0.4s; }
.packbox.tr-charge .pb-art { filter: brightness(1.4) saturate(1.6) hue-rotate(0deg); animation: trHue 0.9s linear infinite; }
.packbox.tr-burst { box-shadow: 0 0 60px #fff, 0 0 140px #ffd36b, 0 0 220px #d56bff; }
@keyframes trRumble { 0% { transform: translate(0, 0) rotate(0); } 25% { transform: translate(-3px, 1px) rotate(-1.5deg); } 50% { transform: translate(2px, -2px) rotate(1deg); } 75% { transform: translate(-1px, 2px) rotate(-0.5deg); } }
@keyframes trHue { to { filter: brightness(1.4) saturate(1.6) hue-rotate(360deg); } }

/* ---- 三位一体(白銀の伝説竜3体): 融合 → 突進 → 相手のLPへ着弾 ---- */
.trinity.tri-art { display: block; padding: 0; overflow: hidden; background: radial-gradient(circle at 50% 50%, #3a3260 0%, #0d0a1c 55%, #000 100%); transition: background 0.35s; }
.trinity.tri-art.see-board { background: rgba(0, 0, 0, 0); pointer-events: auto; }
.trinity.tri-art.see-board .tri-rays { opacity: 0; }
.tri-rays {
  position: absolute; left: 50%; top: 50%; width: 220vmax; height: 220vmax; margin: -110vmax 0 0 -110vmax;
  background: repeating-conic-gradient(from 0deg, rgba(220, 230, 255, 0.16) 0deg 6deg, transparent 6deg 18deg);
  animation: triSpin 9s linear infinite; transition: opacity 0.3s; pointer-events: none;
  -webkit-mask: radial-gradient(circle, #000 0%, transparent 60%); mask: radial-gradient(circle, #000 0%, transparent 60%);
}
@keyframes triSpin { to { transform: rotate(360deg); } }
.tri-pic {
  position: absolute; left: 50%; top: 50%; width: min(96vw, 1000px); height: auto; max-width: none;
  transform: translate(-50%, -50%); opacity: 0; pointer-events: none;
  filter: drop-shadow(0 0 24px rgba(200, 220, 255, 0.55));
}

/* 棚のパック: 絵があるときは、枠と開け口の飾りを消して、名前は下に小さく */
.mini-pack.has-art { border: 0; background: #111; justify-content: flex-end; gap: 0; }
.mini-pack.has-art .mp-crimp { display: none; }
.mini-pack.has-art .mp-name, .mini-pack.has-art .mp-sub { position: relative; z-index: 1; margin: 0; }
.mini-pack.has-art .mp-name { margin-top: auto; padding: 18px 4px 0; width: 100%; font-size: 12.5px; line-height: 1.25; background: linear-gradient(transparent, rgba(0, 0, 0, 0.82) 40%); text-shadow: 0 1px 3px #000; }
.mini-pack.has-art .mp-sub { width: 100%; padding: 1px 4px 6px; background: rgba(0, 0, 0, 0.82); font-size: 10.5px; }

/* パックの絵は背景が透明。四角い枠や影は付けず、パックの形に沿って影と光を付ける */
.packbox.has-art, .mini-pack.has-art { background: transparent; box-shadow: none; overflow: visible; }
.packbox.has-art::before, .mini-pack.has-art::before { display: none; }
.pb-art, .mp-art { object-fit: contain; filter: drop-shadow(0 10px 12px rgba(0, 0, 0, 0.65)); }
.mini-pack.has-art .mp-name, .mini-pack.has-art .mp-sub, .packbox.has-art .pb-body { margin-left: 6%; margin-right: 6%; width: auto; }
.mini-pack.has-art:not(:disabled):hover, .mini-pack.has-art:not(:disabled):focus-visible { box-shadow: none; }
.mini-pack.has-art:not(:disabled):hover .mp-art, .mini-pack.has-art:not(:disabled):focus-visible .mp-art { filter: drop-shadow(0 0 2px var(--brass)) drop-shadow(0 14px 14px rgba(0, 0, 0, 0.7)); }
.packbox.kind-treasure.has-art, .packbox.has-art.tr-charge, .packbox.has-art.tr-burst { box-shadow: none; }
.packbox.has-art.tr-charge .pb-art { animation: trHueArt 0.9s linear infinite; }
.packbox.has-art.tr-burst .pb-art { filter: brightness(2) drop-shadow(0 0 30px #fff) drop-shadow(0 0 60px #ffd36b); }
@keyframes trHueArt {
  from { filter: brightness(1.4) saturate(1.6) hue-rotate(0deg) drop-shadow(0 0 18px #ffd36b) drop-shadow(0 0 40px #d56bff); }
  to { filter: brightness(1.4) saturate(1.6) hue-rotate(360deg) drop-shadow(0 0 18px #ffd36b) drop-shadow(0 0 40px #d56bff); }
}
.dropzone.off { opacity: 0.45; border-style: dotted; }
.dropzone.off span { font-size: 12px; }
/* 生贄の演出 */
.offer-ghost { pointer-events: none; z-index: 2; }
.offer-spark { background: radial-gradient(circle, #fff 0 30%, #ffe08a 60%, rgba(255, 210, 120, 0) 100%); color: #ffd98a; }
.offer-ring { position: absolute; transform: translate(-50%, -50%) scaleY(0.35); border-radius: 50%; border: 2px solid rgba(255, 226, 150, 0.9); box-shadow: 0 0 18px rgba(255, 220, 140, 0.8), inset 0 0 18px rgba(255, 220, 140, 0.6); animation: offerRing 1s ease-out forwards; pointer-events: none; }
@keyframes offerRing { 0% { opacity: 0; transform: translate(-50%, -50%) scaleY(0.35) scale(0.4) rotate(0deg); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) scaleY(0.35) scale(1.15) rotate(90deg); } }
/* パック: 裏から表へ。表(絵つき)は最初から裏側に用意しておき、回る途中から見える */
.packcard .pc-flip { position: relative; width: var(--cw); height: var(--ch); transform-style: preserve-3d; }
.packcard .pc-flip > .pc-back { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.packcard .pc-front { position: absolute; inset: 0; transform: rotateY(180deg); backface-visibility: hidden; -webkit-backface-visibility: hidden; pointer-events: none; }
.packcard .pc-front .card { width: 100%; height: 100%; margin: 0; }
.packcard.turning .pc-flip { animation: pcturn 0.42s cubic-bezier(.35,.1,.3,1) forwards; }
.packcard.turning-ur .pc-flip { animation: pcturnur 0.62s cubic-bezier(.35,.1,.3,1) forwards; }
.packcard.turning .pc-back { animation: none !important; }
@keyframes pcturn { 0% { transform: rotateY(0); } 50% { transform: translateY(-14px) rotateY(90deg) scale(1.08); } 100% { transform: rotateY(180deg); } }
@keyframes pcturnur { 0% { transform: rotateY(0) scale(1.15); } 50% { transform: translateY(-20px) rotateY(90deg) scale(1.35); } 100% { transform: rotateY(180deg) scale(1.1); } }
/* めくり終わったあとは回さず、軽く弾むだけ */
.packcard.open.just { animation: pcsettle 0.3s ease-out both; }
.packcard.open.just.rar-UR { animation: pcsettleur 0.5s cubic-bezier(.2,1.5,.4,1) both; }
@keyframes pcsettle { 0% { transform: scale(1.04); } 100% { transform: none; } }
@keyframes pcsettleur { 0% { transform: scale(1.1); } 100% { transform: none; } }
/* 気まぐれな加護 */
.bless-row { justify-content: center; }
.bless-card { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bless-cap { font-size: 12px; text-align: center; line-height: 1.5; min-height: 18px; }
.bless-cap .bl-cap { color: var(--brass); font-weight: 700; }
.mk.stamp-fly { position: fixed; z-index: 120; width: 30px; height: 30px; font-size: 16px; pointer-events: none; box-shadow: 0 0 0 2px currentColor, 0 0 18px rgba(255, 220, 140, 0.9); }
/* 破壊耐性のバリア(残り回数ぶん並ぶ) */
.card .c-wards { position: absolute; left: 3px; bottom: 26px; z-index: 3; display: flex; flex-wrap: wrap; gap: 2px; max-width: calc(100% - 6px); pointer-events: auto; }
.card .c-wards .bar { display: block; width: 13px; height: 15px; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.card .c-wards .bar-ward { background: radial-gradient(circle at 40% 35%, #ffffff 0 12%, #9eeaff 30%, #2aa6d8 75%, #0d5d84 100%); filter: drop-shadow(0 0 3px #7fe0ff); animation: barGlow 2.2s ease-in-out infinite; }
.card .c-wards .bar-battle { background: radial-gradient(circle at 40% 35%, #ffffff 0 12%, #ffe9a0 30%, #d9a12a 75%, #7a5510 100%); filter: drop-shadow(0 0 3px #ffd36b); }
.card .c-wards .bar.popped { animation: barPop 0.4s ease-out forwards; }
@keyframes barGlow { 50% { filter: drop-shadow(0 0 6px #bff3ff) brightness(1.2); } }
@keyframes barPop { 0% { transform: scale(1); opacity: 1; } 40% { transform: scale(1.8); opacity: 0.9; filter: brightness(2.5); } 100% { transform: scale(2.4); opacity: 0; } }
@media (max-width: 700px) { .card .c-wards { bottom: 20px; } .card .c-wards .bar { width: 10px; height: 12px; } }
/* ---- ホロの光(直し): 明るい絵の上でも消えないよう普通に重ね、端から端まで通り切ってから少し休む ---- */
.card.rar-SR::after, .card.rar-UR::after { background-size: 300% 100%; background-repeat: no-repeat; animation: holo2 4.5s linear infinite; }
.card.rar-SR::after {
  background-image: linear-gradient(115deg, transparent 38%, rgba(255, 246, 210, 0.22) 46%, rgba(255, 255, 255, 0.38) 50%, rgba(255, 246, 210, 0.22) 54%, transparent 62%);
  mix-blend-mode: normal;
}
.card.rar-UR::after {
  background-image: linear-gradient(115deg, transparent 34%, rgba(255, 110, 110, 0.20) 40%, rgba(255, 236, 120, 0.26) 45%, rgba(255, 255, 255, 0.42) 50%, rgba(120, 255, 200, 0.26) 55%, rgba(120, 170, 255, 0.20) 60%, transparent 66%);
  mix-blend-mode: normal; opacity: 1; animation-duration: 3.2s;
}
@keyframes holo2 { 0% { background-position: 100% 0; } 70% { background-position: 0% 0; } 100% { background-position: 0% 0; } }
.turnbox .fatigue-note { font-size: 10.5px; color: #d9a6ff; margin-left: 6px; font-weight: 700; }
.pile.tappable { cursor: pointer; border-radius: 6px; padding: 1px 4px; margin: -1px -4px; }
.pile.tappable:hover { background: rgba(232, 194, 90, 0.14); }
/* UR: 画面いっぱいにあふれる光 */
.ur-rays { position: fixed; transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none; z-index: 1;
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, 0.0) 0deg 6deg, rgba(255, 220, 140, 0.35) 8deg 10deg, rgba(255, 255, 255, 0) 12deg 18deg, rgba(150, 220, 255, 0.3) 20deg 22deg, rgba(255, 255, 255, 0) 24deg 30deg);
  -webkit-mask: radial-gradient(circle, #000 0, #000 18%, transparent 60%); mask: radial-gradient(circle, #000 0, #000 18%, transparent 60%);
  animation: urRays 2.6s ease-out forwards; mix-blend-mode: screen; }
@keyframes urRays { 0% { opacity: 0; transform: translate(-50%, -50%) rotate(0) scale(0.2); } 15% { opacity: 1; } 70% { opacity: 0.9; } 100% { opacity: 0; transform: translate(-50%, -50%) rotate(70deg) scale(1.1); } }
.ur-ring { position: fixed; width: 40px; height: 40px; transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none; z-index: 2; border-style: solid; border-color: #fff;
  box-shadow: 0 0 30px #ffd36b, 0 0 60px #d56bff, inset 0 0 30px #6bc5ff; animation: urRing 1.1s cubic-bezier(.1,.7,.3,1) forwards; }
@keyframes urRing { 0% { width: 40px; height: 40px; opacity: 1; } 100% { width: var(--to); height: var(--to); opacity: 0; } }
.ur-beam { position: fixed; width: 200vw; height: 90px; transform: translate(-50%, -50%) scaleY(0.1); pointer-events: none; z-index: 1;
  background: linear-gradient(180deg, transparent, rgba(255, 107, 107, 0.6), rgba(255, 211, 107, 0.8), #fff, rgba(107, 255, 181, 0.8), rgba(107, 197, 255, 0.6), transparent);
  animation: urBeam 1.3s ease-out forwards; mix-blend-mode: screen; }
@keyframes urBeam { 0% { opacity: 0; transform: translate(-50%, -50%) scaleY(0.05); } 15% { opacity: 1; transform: translate(-50%, -50%) scaleY(1.4); } 100% { opacity: 0; transform: translate(-50%, -50%) scaleY(0.1); } }
/* SR: めくれたあと、金の光が一度だけ走る */
.packcard.open.sr-shine .card { animation: srShine 0.6s ease-out; }
@keyframes srShine { 0% { box-shadow: 0 0 0 2px #fff3c4, 0 0 30px rgba(255, 210, 100, 0.9); } 100% { box-shadow: 0 0 0 1px #7a5a14, 0 0 10px rgba(217, 169, 58, 0.45); } }
/* スマホ: 画面(戦闘前・パック・デッキなど)の小さいカードは「攻○○ 守○○」を「○○/○○」に丸めて見切れないようにする */
@media (max-width: 700px) {
  #overlay .card .c-stats { justify-content: center; gap: 0; padding-inline: 2px; letter-spacing: -0.2px; }
  #overlay .card .c-stats span small { display: none; }
  #overlay .card .c-stats span + span::before { content: '/'; margin: 0 1px; opacity: 0.6; }
  #overlay .card.spell .c-stats span + span::before { content: none; }
}
/* 攻守が収まらないカードは「○○/○○」の短い書き方にする(PC・スマホ共通。fitStatsが付ける) */
.card .c-stats.compact { justify-content: center; gap: 0; padding-inline: 2px; }
.card .c-stats.compact span small { display: none; }
.card .c-stats.compact span + span::before { content: '/'; margin: 0 1px; opacity: 0.6; }
/* パック: カード下の説明欄は高さを固定(文の長さでボタンが動かないように)。スマホは画面下の説明だけにする */
.packstage .ov-detail { height: 7.2em; min-height: 0; overflow-y: auto; }
body.touch .packstage .ov-detail { display: none; }
#pack-lead { min-height: 3.1em; }
/* パック: さくさくめくる */
.packcard.turning .pc-flip { animation-duration: 0.27s; }
.packcard.turning-ur .pc-flip { animation-duration: 0.56s; }
.packcard.back { animation-duration: 0.32s; animation-delay: calc(var(--i) * 0.07s); }
/* デッキと強化: 旅の進み */
.journey { display: flex; flex-direction: column; gap: 12px; }
.jr-now { margin: 4px 0 0; }
.jr-now b { color: var(--brass); font-size: 1.15em; }
.jr-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.jr-card { background: var(--table-2); border: 1px solid var(--felt-line); border-radius: 8px; padding: 12px 14px; min-width: 0; }
.jr-card .jr-head { display: flex; gap: 12px; align-items: center; }
.jr-card .jr-head .portrait { flex: none; }
.jr-card h3 { margin: 2px 0 6px; font-size: 18px; color: var(--paper); }
.jr-card .jr-label { font-size: 11px; color: var(--brass); letter-spacing: 0.08em; font-weight: 700; }
.jr-card .blurb { font-size: 12.5px; line-height: 1.6; color: var(--ink-dim); margin: 8px 0 0; }
.jr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.jr { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 6px; background: rgba(255, 255, 255, 0.03); font-size: 13px; }
.jr.done { opacity: 0.6; }
.jr.now { background: rgba(232, 194, 90, 0.14); box-shadow: inset 0 0 0 1px var(--brass-dim); }
.jr.boss .jr-name { color: #ef8a7b; font-weight: 700; }
.jr-no { flex: none; width: 4em; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.jr-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jr-crest { flex: none; font-size: 10.5px; color: var(--brass); border: 1px solid var(--brass-dim); border-radius: 9px; padding: 0 6px; }
.jr-state { flex: none; width: 3.5em; text-align: right; font-size: 11.5px; font-weight: 700; }
.jr-state.done { color: var(--good); }
.jr-state.now { color: var(--brass); }
/* スマホ: 単品カードは3枚を1行に */
@media (max-width: 760px) {
  .rack { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding-inline: 4px; }
  .rack-slot .card { max-width: 100%; }
}
/* スマホ: 画面下に説明が出る一覧では、カード下の説明欄を出さない(二重になるので) */
body.touch .modal.no-ovd .ov-detail { display: none; }
/* 悪魔の鏡 */
.mirror-stage h2 { color: #ff7fd0; }
.mir-scene { position: relative; display: flex; justify-content: center; align-items: flex-start; gap: 28px; padding: 26px 0 10px; min-height: 230px; isolation: isolate; }
.mir-glass { position: absolute; left: 50%; top: 8px; width: 210px; height: 250px; transform: translateX(-50%) scale(0.6); opacity: 0; z-index: -1; border-radius: 50% / 46%;
  background: radial-gradient(ellipse at 50% 40%, rgba(255, 120, 220, 0.35), rgba(60, 10, 70, 0.9) 60%, #12020f 100%);
  box-shadow: 0 0 0 6px #2a0a2e, 0 0 0 9px #7a1f6e, 0 0 0 11px #120412, 0 0 40px 10px rgba(201, 75, 255, 0.55), inset 0 0 40px rgba(255, 63, 174, 0.6);
  transition: transform 0.6s cubic-bezier(.2,.8,.2,1), opacity 0.5s; }
.mir-glass::before, .mir-glass::after { content: ''; position: absolute; top: -18px; width: 26px; height: 40px; background: #7a1f6e; clip-path: polygon(50% 0, 100% 100%, 0 100%); filter: drop-shadow(0 0 6px #ff3fae); }
.mir-glass::before { left: 30px; transform: rotate(-20deg); }
.mir-glass::after { right: 30px; transform: rotate(20deg); }
.mir-crack { position: absolute; inset: 20% 30% 30% 25%; opacity: 0; background:
  linear-gradient(60deg, transparent 48%, rgba(255, 200, 240, 0.9) 49%, transparent 51%), linear-gradient(-30deg, transparent 47%, rgba(255, 200, 240, 0.8) 48.5%, transparent 50%), linear-gradient(100deg, transparent 49%, rgba(255, 200, 240, 0.7) 50%, transparent 51%);
  transition: opacity 0.2s; }
.mir-slot { display: flex; flex-direction: column; align-items: center; gap: 8px; transition: transform 0.7s cubic-bezier(.2,.8,.2,1), opacity 0.5s, filter 0.7s; }
.mir-slot .card { --cw: 120px; --ch: 168px; }
.mir-cap { font-size: 12px; min-height: 1.4em; text-align: center; }
.mir-slot.src .mir-cap { color: var(--ink-dim); }
/* 最初は1枚だけ中央に。写しは鏡の奥に隠れている */
.mir-scene:not(.s2):not(.done) .mir-slot.src { transform: translateX(calc(50% + 14px)); }
.mir-scene:not(.s2):not(.done) .mir-slot.copy { transform: translateX(calc(-50% - 14px)) scale(0.85); opacity: 0; filter: brightness(0.3) saturate(2) hue-rotate(260deg); }
.mir-scene.s1 .mir-glass, .mir-scene.done .mir-glass { transform: translateX(-50%) scale(1); opacity: 1; }
.mir-scene.s2 .mir-crack, .mir-scene.done .mir-crack { opacity: 1; }
.mir-scene.s2 .mir-slot.copy .card, .mir-scene.done .mir-slot.copy .card { box-shadow: 0 0 0 2px #c94bff, 0 0 26px rgba(255, 63, 174, 0.75); }
.mir-scene.s2 .mir-slot.copy { animation: mirWobble 0.8s ease-out; }
@keyframes mirWobble { 0% { filter: brightness(0.3) saturate(2) hue-rotate(260deg) blur(2px); } 60% { filter: brightness(1.4) hue-rotate(300deg); } 100% { filter: none; } }
.mir-note { min-height: 1.6em; font-size: 13px; }
@media (max-width: 700px) {
  .mir-scene { gap: 14px; min-height: 190px; }
  .mir-slot .card { --cw: 96px; --ch: 134px; }
  .mir-glass { width: 170px; height: 205px; }
}
.mir-scene { padding-bottom: 26px; }
.mir-note { position: relative; z-index: 1; }
/* スマホ: 盤面は上に詰めて並べ、余った高さは一番下(手札の下)に回す。手札の攻守が画面下のバーに隠れないように */
@media (max-width: 700px) {
  .table { justify-content: flex-start; gap: 6px; padding-top: 6px; }
  .side, .side.enemy, .side.player { flex: none; }
}
@media (max-width: 700px) { .table { padding-top: calc(6px + var(--spare-top, 0px)); } }
/* ショップ: 所持金はスクロールしても常に右上に見えるように */
.gold-sticky { position: sticky; top: 6px; height: 0; z-index: 30; display: flex; justify-content: flex-end; pointer-events: none; }
.gold-sticky .shop-gold { pointer-events: auto; transform: translateY(18px); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6); }
.modal.shop .shop-head { padding-right: 120px; }
@media (max-width: 760px) {
  .gold-sticky .shop-gold { transform: translateY(-14px); font-size: 15px; padding: 4px 10px; }
  .modal.shop .shop-head { padding-right: 0; }
}
/* 刻印の軍勢: 付く刻印を並んだ時点で見せる */
.army-cap { color: #ffd36b; font-size: 11px; font-weight: 700; text-shadow: 0 0 6px rgba(255, 210, 100, 0.6); }
.rack-slot .army-cap { max-width: 100%; text-align: center; line-height: 1.3; }
.rack-slot.army .card, .packcard.open .card:has(.c-marks .mk:not(.neg)) { box-shadow: 0 0 0 2px #ffd36b, 0 0 14px rgba(255, 210, 100, 0.55); }
/* ショップの所持金: 枠が中身に合わせて広がり、塗りも付くように */
.gold-sticky .shop-gold { flex: none; width: max-content; background: #1a140a; border: 1px solid var(--brass-dim); }
.gold-sticky .shop-gold b { white-space: nowrap; line-height: 1.2; }
.gold-sticky { align-items: flex-start; }
.gold-sticky .shop-gold b { font-size: 20px; }
@media (max-width: 760px) { .gold-sticky .shop-gold b { font-size: 17px; } }
/* ショップのパック: 名前の黒い帯をやめて縁取り文字に。買えないパックは、ボタン全体ではなく絵だけを暗くする(スマホで表示が崩れるのを防ぐ) */
.mini-pack.has-art .mp-name, .mini-pack.has-art .mp-sub { background: none; text-shadow: 0 0 3px #000, 0 0 3px #000, 0 1px 2px #000, 0 0 8px rgba(0, 0, 0, 0.9); }
.mini-pack.has-art .mp-sub { border-radius: 0; }
.mini-pack.has-art:disabled { filter: none; }
.mini-pack.has-art:disabled .mp-art { filter: saturate(0.45) brightness(0.6); }
.mini-pack.has-art:disabled .mp-name, .mini-pack.has-art:disabled .mp-sub { opacity: 0.75; }
/* スマホ: カードを長押ししても、文字が選択されたり「コピー」などが出たりしないように */
body.touch .card, body.touch .card *, body.touch #table, body.touch .packcard, body.touch .rack-slot, body.touch .mini-pack, body.touch .crestpick {
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
@media (max-width: 700px) { #table #midline { margin-block: var(--spare-mid, 0px); } }
.packcard.open.pulling { animation: none !important; }
/* スマホ: 「紋章」と「ログ」のボタンを分け、引き出しにはその一方だけを広く出す */
.panel-btns { display: none; }
@media (max-width: 700px) {
  .panel-btns { display: inline-flex; gap: 4px; flex: none; margin-left: auto; }
  .panel-btns .panel-btn { display: inline-grid; min-width: 40px; height: 28px; padding: 0 8px; font-size: 11.5px; }
  body.panel-open .panel-btn { background: var(--panel); color: var(--brass); }
  body.panel-buffs .panel-btn.pb-buffs, body.panel-log .panel-btn.pb-log { background: var(--brass); color: #1b1408; }
  body.panel-buffs .panel .log-wrap { display: none; }
  body.panel-buffs .panel .buffs { max-height: none; flex: 1; border-bottom: 0; }
  body.panel-log .panel .buffs { display: none; }
}
/* 戦闘中のパック: 1枚ずつめくれて現れる */
.packcard.pp-reveal { animation: ppReveal 0.32s cubic-bezier(.3,.7,.3,1) both; animation-delay: calc(0.26s + var(--i) * 0.26s); }
@keyframes ppReveal { 0% { transform: rotateY(90deg) translateY(-12px) scale(1.06); opacity: 0; } 100% { transform: none; opacity: 1; } }
/* 「デッキと強化」: どのタブでも画面の高さを同じにして、タブのボタンの位置がずれないようにする */
.modal.deck-modal { height: 100%; }
/* 魔導の真髄・災いを招く者: 取ったときに何が起きたかを見せる画面 */
.arcane-reveal .ar-h { font-size: 13.5px; color: var(--brass); margin: 14px 0 6px; text-align: center; letter-spacing: 0.04em; }
.ar-hide { visibility: hidden; }
.gift-reveal { max-width: 380px; }
.gift-crest { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 10px; text-align: center; }
.gift-crest .cp-face { width: 120px; height: 132px; display: block; }
.gift-crest .cp-face svg { width: 100%; height: 100%; }
.gift-crest .ch-name { font-size: 18px; font-weight: 700; color: var(--paper); }
.gift-crest .ch-text { font-size: 13px; line-height: 1.6; color: var(--ink-dim); }
.gift-hide { visibility: hidden; }
/* 「デッキと強化」のカード一覧は、画面の下まで使う */
.modal.deck-modal { display: flex; flex-direction: column; }
.modal.deck-modal > * { flex: none; }
.modal.deck-modal > .deckpick { flex: 1 1 auto; min-height: 0; overflow-y: auto; align-content: flex-start; }
.modal.deck-modal > .deckpick, .modal.deck-modal .deckpick { max-height: none; }
@media (max-width: 700px) { .modal.deck-modal > .deckpick { max-height: none; } }
/* 戦闘中のパック: 手前から飛んでくる */
.packbox.pp-arrive { animation: ppArrive 0.5s cubic-bezier(.2,.8,.25,1) both, packbob 2.2s ease-in-out 0.5s infinite; }
@keyframes ppArrive { 0% { transform: translateY(60vh) scale(1.4) rotate(-8deg); opacity: 0; } 75% { transform: translateY(-10px) scale(1.04); opacity: 1; } 100% { transform: none; opacity: 1; } }
.packbox.pp-arrive.torn { animation: packshake 0.45s; }
.modal ul.foe-intro { padding-left: 0; list-style: none; margin: 4px 0 0; }

/* 敵の思考の深さ */
.chip.mind { border-style: dashed; }
.chip.mind-shallow { color: var(--ink-dim); }
.chip.mind-normal { color: #c9d4ff; border-color: #56608a; }
.chip.mind-deep { color: #e7b5ff; border-color: #8a4fb0; }

/* 勝利画面: 戦いを経て成長した */
.growth { margin: 10px auto 4px; padding: 8px 14px 6px; border: 1px solid rgba(120, 220, 150, 0.45); border-radius: 10px; background: linear-gradient(180deg, rgba(60, 160, 90, 0.16), rgba(60, 160, 90, 0.05)); max-width: 440px; }
.growth h3 { margin: 0 0 6px; color: #8fe0a6; text-align: center; letter-spacing: 0.08em; }
.growth ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.growth li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: baseline; font-size: 13.5px; }
.growth .gr-k { color: var(--ink-dim); }
.growth .gr-v b { color: #fff; font-size: 15px; }
.growth .gr-d.minus { color: #ff8a8a; }
.growth .gr-d { color: #8fe0a6; font-weight: 700; min-width: 3.5em; text-align: right; }
.growth .note { margin: 4px 0 0; text-align: center; font-size: 11px; }

/* 効果文の中の参照(カード名・紋章名): マウスオーバー/長押しで中身を表示 */
.ref { color: #ffd98a; text-decoration: underline dotted rgba(255, 217, 138, 0.7); text-underline-offset: 3px; cursor: help; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#refpop { position: fixed; z-index: 9999; display: none; gap: 10px; align-items: flex-start; max-width: min(360px, calc(100vw - 16px)); padding: 10px 12px; border-radius: 10px; background: rgba(14, 18, 26, 0.97); border: 1px solid rgba(255, 217, 138, 0.5); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6); color: var(--ink, #e8e4da); font-size: 12.5px; line-height: 1.55; pointer-events: none; }
#refpop.show { display: flex; }
#refpop .rp-card { flex: none; width: 92px; }
#refpop .rp-card .card { width: 92px; height: auto; transform: none !important; }
#refpop .rp-crest { flex: none; width: 54px; }
#refpop .rp-body { min-width: 0; }
#refpop .rp-body b { display: block; font-size: 14px; color: #fff; }
#refpop .rp-meta { display: block; color: var(--ink-dim, #a9a39a); font-size: 11.5px; margin: 1px 0 4px; }
#refpop p { margin: 0; }

/* 運命の賭け */
.gamble-opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 10px 0; }
.gamble-opt { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 10px; border-radius: 12px; border: 1px solid rgba(255, 215, 120, 0.35); background: linear-gradient(180deg, rgba(60, 40, 90, 0.5), rgba(20, 16, 30, 0.6)); color: inherit; font: inherit; cursor: pointer; animation: gambleUp 0.4s calc(var(--i) * 0.12s) both; transition: transform 0.15s, box-shadow 0.15s; }
.gamble-opt:hover { transform: translateY(-3px); box-shadow: 0 0 18px rgba(255, 210, 110, 0.35); }
.gamble-opt .go-label { font-size: 17px; font-weight: 700; color: #ffe1a0; }
.gamble-opt .go-chance { font-size: 12px; color: var(--ink-dim); }
.gamble-opt .go-prize { font-size: 13.5px; text-align: center; line-height: 1.5; }
.gamble-opt .go-cap { display: block; font-size: 11px; color: var(--ink-dim); letter-spacing: 0.1em; }
.gamble-opt.g-one { border-color: rgba(255, 120, 200, 0.55); background: linear-gradient(180deg, rgba(110, 30, 80, 0.55), rgba(20, 16, 30, 0.6)); }
.wheel-wrap { --wh: min(300px, 74vw); position: relative; width: var(--wh); aspect-ratio: 1; margin: 14px auto 6px; }
@keyframes gambleUp { from { opacity: 0; transform: translateY(14px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes gambleWin { 0% { transform: scale(0.6); opacity: 0; } 60% { transform: scale(1.25); opacity: 1; } 100% { transform: scale(1); } }
.wheel { --wh-a: #2b2340; --wh-b: #3a2f57; --wh-hit: #b8862b; position: absolute; inset: 0; border-radius: 50%; border: 6px solid #d9b25a; box-shadow: 0 0 0 3px #3b2a10, 0 0 30px rgba(255, 200, 90, 0.35), inset 0 0 30px rgba(0, 0, 0, 0.5); }
.wheel .wh-n { position: absolute; left: 50%; top: 50%; width: 2em; text-align: center; font-weight: 800; font-size: clamp(15px, 4.5vw, 22px); line-height: 1; color: #f4ead6; transform: translate(-50%, -50%) rotate(var(--a)) translateY(calc(var(--wh) * -0.36)); }
.wheel .wh-n.u { text-decoration: underline; text-underline-offset: 3px; }
.wheel .wh-n.hit { color: #fff6d8; text-shadow: 0 0 8px #ffd36b; }
.wheel-pin { position: absolute; left: 50%; top: -8px; width: 0; height: 0; margin-left: -13px; border-left: 13px solid transparent; border-right: 13px solid transparent; border-top: 26px solid #ff5d5d; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6)); z-index: 2; }
.gamble-result { text-align: center; font-size: 20px; font-weight: 800; margin: 8px 0 0; }
.gamble-result b { font-size: 30px; margin-right: 6px; }
.gamble-result.win { color: #ffd36b; animation: gambleWin 0.5s both; }
.gamble-result.lose { color: #9aa3b5; }
@media (max-width: 700px) { .gamble-opts { grid-template-columns: 1fr; } .gamble-opt { flex-direction: row; flex-wrap: wrap; justify-content: space-between; text-align: left; } .gamble-opt .go-prize { text-align: left; width: 100%; } }

/* ===== 運命の賭場(カジノ風) ===== */
.gamble-modal.casino { background: radial-gradient(120% 90% at 50% 0%, #3a1830 0%, #1a0d1c 55%, #0e0810 100%); border: 1px solid #c9a14a; box-shadow: 0 0 0 3px #2a1608, 0 0 40px rgba(255, 180, 80, 0.25), inset 0 0 60px rgba(0, 0, 0, 0.6); }
.casino-title { text-align: center; font-size: 26px; letter-spacing: 0.3em; background: linear-gradient(180deg, #fff3c4, #e0a93c 60%, #9a6216); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.7)); margin-bottom: 6px; }
.dealer { display: flex; align-items: flex-end; gap: 12px; margin: 4px 0 12px; }
.dealer .dl-face { flex: none; width: 112px; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; border: 2px solid #c9a14a; box-shadow: 0 0 18px rgba(255, 120, 200, 0.25); background: radial-gradient(circle at 50% 35%, #5a2a4a, #1a0d1c); transition: box-shadow 0.3s, transform 0.3s; }
.dealer .dl-face img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; display: block; }
.dealer .dl-ph { position: relative; display: block; width: 100%; height: 100%; }
.dealer .dl-ph i { position: absolute; left: 22%; right: 22%; top: 18%; bottom: 0; border-radius: 50% 50% 8px 8px; background: radial-gradient(circle at 50% 28%, #2a1424 30%, #12070f 31%); }
.dealer .dl-ph i::before, .dealer .dl-ph i::after { content: ''; position: absolute; top: -10%; width: 22%; height: 26%; background: #2a1424; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.dealer .dl-ph i::before { left: 12%; transform: rotate(-18deg); } .dealer .dl-ph i::after { right: 12%; transform: rotate(18deg); }
.dealer .dl-talk { min-width: 0; flex: 1; }
.dealer .dl-name { display: inline-block; font-size: 11.5px; letter-spacing: 0.1em; color: #e7b5ff; margin: 0 0 3px 10px; }
.dealer .dl-bubble { position: relative; padding: 10px 14px; border-radius: 14px; background: rgba(255, 248, 232, 0.96); color: #2a1424; font-size: 14px; line-height: 1.6; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4); min-height: 3.2em; }
.dealer .dl-bubble::before { content: ''; position: absolute; left: -9px; bottom: 16px; border: 9px solid transparent; border-right-color: rgba(255, 248, 232, 0.96); border-left: 0; }
.dealer .dl-bubble.pop { animation: dlPop 0.28s ease-out; }
@keyframes dlPop { 0% { transform: scale(0.94); opacity: 0.4; } 100% { transform: none; opacity: 1; } }
.dealer.mood-tempt .dl-face { box-shadow: 0 0 26px rgba(255, 80, 170, 0.6); transform: translateY(-3px); }
.dealer.mood-smug .dl-face { box-shadow: 0 0 26px rgba(170, 80, 255, 0.6); }
.dealer.mood-sulk .dl-face { filter: saturate(0.85); box-shadow: 0 0 14px rgba(120, 140, 200, 0.4); }
.casino .gamble-opt { position: relative; background: linear-gradient(180deg, rgba(30, 70, 45, 0.85), rgba(12, 32, 20, 0.9)); border: 1px solid rgba(201, 161, 74, 0.6); }
.casino .gamble-opt.g-one { background: linear-gradient(180deg, rgba(120, 20, 60, 0.9), rgba(40, 8, 24, 0.95)); border-color: #ff6fb0; animation: gambleUp 0.4s calc(var(--i) * 0.12s) both, temptGlow 1.6s ease-in-out 0.6s infinite; }
@keyframes temptGlow { 0%, 100% { box-shadow: 0 0 10px rgba(255, 90, 170, 0.35); } 50% { box-shadow: 0 0 26px rgba(255, 90, 170, 0.8); } }
.casino .go-tempt { position: absolute; top: -10px; left: 50%; transform: translateX(-50%) rotate(-3deg); padding: 2px 10px; border-radius: 999px; background: linear-gradient(90deg, #ff3d8b, #ff9a3c); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; white-space: nowrap; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); }
.casino .go-confirm { display: none; margin-top: 4px; padding: 3px 12px; border-radius: 999px; background: #c9a14a; color: #2a1608; font-size: 12px; font-weight: 800; }
.casino .gamble-opt.armed { outline: 2px solid #c9a14a; }
.casino .gamble-opt.armed .go-confirm { display: inline-block; animation: dlPop 0.25s; }
.casino .bet-line { margin: 0 0 4px; font-size: 13.5px; }
.wheel-stage { position: relative; padding: 18px 0 10px; border-radius: 50%; background: radial-gradient(circle at 50% 50%, #1f5a35 0%, #133d24 55%, transparent 72%); }
.wheel-wrap { --wh: min(280px, 66vw); }
.wheel { --wh-a: #1c1626; --wh-b: #8a1c2c; --wh-hit: #e0a93c; --wh-hit2: #c98a1e; border: 8px solid #c9a14a; box-shadow: 0 0 0 4px #4a2a0c, 0 0 0 7px #c9a14a, 0 0 40px rgba(255, 200, 90, 0.35), inset 0 0 30px rgba(0, 0, 0, 0.55); }
.wheel .wh-n { color: #fff; text-shadow: 0 1px 2px #000; }
.wheel .wh-n.hit { color: #2a1608; text-shadow: 0 0 6px rgba(255, 255, 255, 0.6); }
.wheel .wh-hub { position: absolute; left: 50%; top: 50%; width: 22%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff6d8, #e0a93c 40%, #6a3e0c 100%); box-shadow: 0 0 0 3px #4a2a0c, 0 4px 10px rgba(0, 0, 0, 0.6); }
.wheel-bulbs { position: absolute; inset: -22px; pointer-events: none; }
.wheel-bulbs .bulb { position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -4.5px; border-radius: 50%; background: #ffe9a8; box-shadow: 0 0 6px #ffd36b, 0 0 12px #ffb84a; transform: rotate(var(--a)) translateY(calc(var(--wh) * -0.5 - 13px)); animation: bulb 1.2s calc(var(--k) * 0.05s) infinite; }
.wheel-bulbs .bulb:nth-child(even) { animation-delay: calc(var(--k) * 0.05s + 0.6s); }
@keyframes bulb { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.wheel-stage.spinning .bulb { animation-duration: 0.35s; }
.wheel-stage.won .bulb { background: #fff; box-shadow: 0 0 8px #fff, 0 0 18px #ffd36b; animation-duration: 0.25s; }
.wheel-stage.lost .bulb { animation: none; opacity: 0.35; background: #b06; box-shadow: 0 0 6px #b06; }
.wheel-pin { top: -18px; border-left-width: 15px; border-right-width: 15px; border-top: 30px solid #ff3d5d; margin-left: -15px; z-index: 3; }
.casino .gamble-result.win { font-size: 24px; text-shadow: 0 0 14px rgba(255, 211, 107, 0.8); }
@media (max-width: 700px) {
  .dealer .dl-face { width: 78px; }
  .dealer .dl-bubble { font-size: 12.5px; padding: 8px 10px; }
  .casino-title { font-size: 21px; }
  .casino .gamble-opt { padding-top: 16px; }
}

/* 予約せずに店を出ようとしたときの店主の引き止め */
.res-warn { display: flex; align-items: center; gap: 10px; margin: 12px 0 0; }
.res-warn .rw-face { flex: 0 0 52px; width: 52px; height: 52px; border-radius: 50%; overflow: hidden; border: 2px solid var(--brass); background: #2a1e14; }
.res-warn .rw-face img { width: 100%; height: 100%; object-fit: cover; }
.res-warn .bubble { margin: 0; flex: 1; min-width: 0; padding: 8px 12px; border-radius: 10px; background: #f3ead6; color: #2b1d10; font-size: 13.5px; line-height: 1.55; box-shadow: 0 0 0 2px #e0a33a, 0 0 18px rgba(224, 163, 58, 0.5); }
.res-warn.pop { animation: resPop 0.5s ease-out; }
@keyframes resPop { 0% { transform: scale(0.92); opacity: 0.3; } 60% { transform: scale(1.03); } 100% { transform: none; opacity: 1; } }

/* ---------- 奇妙な魚の恩恵 ---------- */
.modal.boon-stage { position: relative; overflow: hidden; max-width: 860px; width: 100%; min-height: 440px; padding: 0; background: radial-gradient(120% 90% at 85% 40%, #1f4256 0%, #0f2230 45%, #081119 100%); border-color: #3c6a80; }
.boon-stage::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(170deg, rgba(160, 220, 255, 0.04) 0 2px, transparent 2px 22px); pointer-events: none; animation: boonWave 9s linear infinite; }
@keyframes boonWave { from { background-position: 0 0; } to { background-position: 0 220px; } }
.boon-stage .fish-wrap { position: absolute; right: -14%; top: 50%; width: 62%; transform: translateY(-50%); pointer-events: none; animation: fishBob 5.5s ease-in-out infinite; filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.6)); }
.boon-stage .fish-wrap .fish-svg, .boon-stage .fish-wrap .fish-art { display: block; width: 100%; height: auto; }
.boon-stage .fish-wrap::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 60%, rgba(8, 17, 25, 0.85)); }
@keyframes fishBob { 0%, 100% { transform: translateY(-50%) rotate(-1.5deg); } 50% { transform: translateY(-53%) rotate(1deg); } }
.fish-eye { animation: fishBlink 6s infinite; transform-origin: 96px 128px; }
@keyframes fishBlink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }
.boon-main { position: relative; z-index: 1; width: min(560px, 64%); padding: 28px 0 24px 28px; display: flex; flex-direction: column; gap: 14px; }
.boon-who { font-family: var(--f-head, serif); color: #9fd8ef; letter-spacing: 0.2em; font-size: 13px; }
.boon-line { margin: 0; padding: 14px 16px; border-radius: 10px; background: rgba(6, 14, 20, 0.78); border: 1px solid rgba(159, 216, 239, 0.35); color: #e6f4fa; font-size: 15px; line-height: 1.8; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); }
.boon-opts { display: flex; flex-direction: column; gap: 10px; }
.boon-opt { display: flex; align-items: flex-start; gap: 12px; text-align: left; padding: 12px 14px; border-radius: 10px; border: 1px solid rgba(159, 216, 239, 0.35); background: rgba(14, 34, 46, 0.88); color: #e6f4fa; cursor: pointer; font: inherit; transition: transform 0.15s, border-color 0.15s, background 0.15s; }
.boon-opt:hover:not([disabled]) { transform: translateX(4px); border-color: #ffe28a; background: rgba(28, 56, 72, 0.95); }
.boon-opt .bo-ic { flex: 0 0 22px; color: #9fd8ef; font-size: 18px; line-height: 1.2; }
.boon-opt .bo-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.boon-opt .bo-txt b { color: #ffe9a8; font-size: 15px; }
.boon-opt .bo-txt span { font-size: 13px; line-height: 1.6; color: #c9dee8; }
.boon-opt.on { border-color: #ffe28a; box-shadow: 0 0 0 2px rgba(255, 226, 138, 0.5), 0 0 22px rgba(255, 226, 138, 0.35); }
.boon-opt.off { opacity: 0.35; }
.boon-opt[disabled] { cursor: default; }
.boon-main .actions { justify-content: flex-start; margin: 0; }
@media (max-width: 640px) {
  .modal.boon-stage { min-height: 0; }
  .boon-stage .fish-wrap { width: 92%; right: -38%; top: 22%; opacity: 0.5; }
  .boon-main { width: auto; padding: 20px 16px; }
}
.bufflist li.boon b { color: #9fd8ef; }
.bufflist li.boon.used { opacity: 0.5; }
.panel-label.boon-label { color: #9fd8ef; }
.pile.topcard { font-size: 11px; padding: 2px 8px; border-radius: 6px; background: rgba(159, 216, 239, 0.12); border: 1px solid rgba(159, 216, 239, 0.4); white-space: nowrap; max-width: 150px; overflow: hidden; text-overflow: ellipsis; cursor: help; }
.pile.topcard b { color: #e6f4fa; margin-left: 2px; }
.pile.deck.shuffling { animation: deckShuffle 0.45s ease-in-out; }
@keyframes deckShuffle { 0%, 100% { transform: none; } 25% { transform: translateX(-4px) rotate(-6deg); } 50% { transform: translateX(4px) rotate(6deg); } 75% { transform: translateX(-2px) rotate(-3deg); } }
.btn.charm-btn { border-color: #9fd8ef; color: #cfefff; background: rgba(28, 70, 92, 0.6); }
.btn.shuffle-btn { border-color: #6fa8c0; }

/* 条件を満たさなくなった紋章(ショーケース) */
.case-item.unmet .case-crest, .case-item.unmet .case-name, .case-item.unmet .case-desc { opacity: 0.4; filter: grayscale(0.8); }
.case-unmet { margin: 4px 0 0; font-size: 12px; color: #e8a0a0; text-align: center; }

/* 初回の魚の説明: タップで次の台詞へ */
.boon-line.more { cursor: pointer; position: relative; padding-right: 34px; }
.boon-line.more::after { content: '▼'; position: absolute; right: 14px; bottom: 10px; font-size: 11px; color: #9fd8ef; animation: boonNext 1s ease-in-out infinite; }
@keyframes boonNext { 0%, 100% { transform: translateY(0); opacity: 0.6; } 50% { transform: translateY(3px); opacity: 1; } }
.boon-stage.intro .boon-main { justify-content: center; min-height: 300px; }
.boon-opt.gift { border-color: #ffe28a; }

.bonus li.gold-mult { color: #ffe28a; font-weight: 600; }

/* =============================================================
   システムの画像素材(art/sys/)
   ============================================================= */
/* ---- 戦闘の盤面 ---- */
.table {
  background:
    radial-gradient(ellipse 70% 45% at 50% 50%, rgba(212, 169, 79, 0.08), transparent 70%),
    linear-gradient(rgba(6, 12, 16, 0.25), rgba(6, 12, 16, 0.25)),
    url(art/sys/battle_bg.webp?v=2) center / cover no-repeat,
    #0c1a1c;
}
@media (orientation: portrait) {
  .table { background: linear-gradient(rgba(6, 12, 16, 0.25), rgba(6, 12, 16, 0.25)), url(art/sys/battle_bg_sp.webp?v=2) center / cover no-repeat, #0c1a1c; }
}
/* 右の欄・画面の枠: 石の質感 */
.panel { background: linear-gradient(rgba(8, 16, 20, 0.62), rgba(8, 16, 20, 0.62)), url(art/sys/panel_tile.webp?v=1) 0 0 / 384px repeat, var(--panel); }
.modal { background: linear-gradient(rgba(10, 18, 24, 0.7), rgba(10, 18, 24, 0.7)), url(art/sys/panel_tile.webp?v=1) 0 0 / 384px repeat, var(--panel); }

/* ---- 場の置き場 ---- */
.slot { border: 7px solid transparent; border-image: url(art/sys/slot.webp?v=1) 28 / 7px stretch; border-radius: 0; background: radial-gradient(circle, rgba(255, 255, 255, 0.03), transparent 70%); box-shadow: none; }
.slot::before, .slot::after { display: none; }
.enemy .slot { border-color: transparent; }

/* ---- カードの外枠: 白銀の枠を、種族の色(SRは金・URは虹)で染める ---- */
.card { border-color: transparent; }
.card.rar-SR, .card.rar-UR { border-color: transparent; border-image: none; }
.card .c-frame, .card .c-crack { position: absolute; inset: 0; pointer-events: none; }
.card .c-frame { --frame: url(art/sys/frame_monster.webp?v=1); z-index: 3; background: var(--frame) center / 105% 106.5% no-repeat; }
.card.spell .c-frame { --frame: url(art/sys/frame_spell.webp?v=1); }
.card .c-frame::after {
  content: ''; position: absolute; inset: 0;
  background: var(--frame-tint, var(--race));
  -webkit-mask: var(--frame) center / 105% 106.5% no-repeat; mask: var(--frame) center / 105% 106.5% no-repeat;
  mix-blend-mode: multiply; opacity: 0.9;
}
.card.rar-SR { --frame-tint: linear-gradient(160deg, #ffe7a0, #d9a93a 45%, #a8781e); }
.card.rar-UR { --frame-tint: linear-gradient(135deg, #ff8a8a, #ffd36b, #8affc4, #8ad0ff, #e08aff); }
.card .c-crack { z-index: 2; background: url(art/sys/crack.webp?v=1) center / 100% 100% no-repeat; filter: brightness(0.55) saturate(1.6) drop-shadow(0 0 1px rgba(60, 0, 90, 0.9)) drop-shadow(0 0 2px rgba(150, 70, 220, 0.6)); }
.card .badge, .card .c-wards { z-index: 4; }

/* ---- カードの裏面 ---- */
.pile.deck i { background: url(art/sys/card_back.webp?v=1) center / cover; border-color: #8f733a; }
.hand-back { background: url(art/sys/card_back.webp?v=1) center / cover; border: 1px solid #8f733a; }
.packcard.back .pc-back { background: url(art/sys/card_back.webp?v=1) center / 100% 100% no-repeat; border: 0; }
.packcard.back .pc-back span { display: none; }

/* ---- コイン ---- */
.coin-ic, .coin { background: url(art/sys/coin.webp?v=1) center / contain no-repeat; border-radius: 0; box-shadow: none; filter: drop-shadow(0 0 4px rgba(242, 193, 78, 0.55)); }
.coin { width: 20px; height: 20px; margin: -10px 0 0 -10px; }
.topbar .gold { display: inline-flex; align-items: center; gap: 5px; }
.topbar .gold::before { content: ''; width: 18px; height: 18px; flex: none; background: url(art/sys/coin.webp?v=1) center / contain no-repeat; filter: drop-shadow(0 0 3px rgba(242, 193, 78, 0.5)); }

/* ---- ターンの帯: リボン(あなた=青、相手=赤、最終=暗い赤) ---- */
.banner:not(.ur) { background: none; border: 0; }
.banner:not(.ur) span { position: relative; isolation: isolate; display: inline-block; padding: 0.5em 2.8em 0.62em; color: #fff3d0; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.75), 0 0 10px rgba(0, 0, 0, 0.5); white-space: nowrap; }
.banner:not(.ur) span::before { content: ''; position: absolute; inset: 0; z-index: -1; background: url(art/sys/turn_banner.webp?v=1) center / 100% 100% no-repeat; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.55)); }
.banner.me span::before { filter: hue-rotate(205deg) saturate(0.85) brightness(1.15) drop-shadow(0 6px 10px rgba(0, 0, 0, 0.55)); }
.banner.last span::before { filter: brightness(0.75) saturate(1.2) drop-shadow(0 0 14px rgba(239, 106, 91, 0.6)); }
.banner:not(.ur) small { color: #f0e2c0; }
.banner.op span, .banner.last span { color: #fff3d0; }

/* ---- 小強化の札: 永続=石板、この戦闘のみ=光る札 ---- */
.choice.sc-perm, .choice.sc-battle { border: 12px solid transparent; border-radius: 0; background: none; padding: 8px 10px; }
.choice.sc-perm { border-image: url(art/sys/buff_perm.webp?v=2) 40 24 24 24 fill / 14px 9px 9px 9px stretch; }
.choice.sc-battle { border-image: url(art/sys/buff_temp.webp?v=3) 40 24 24 24 fill / 14px 9px 9px 9px stretch; }
.choice.sc-battle::after { inset: 6px; }
/* 枠の形に沿って影と光をつける(四角い影は出さない) */
.choice.sc-perm, .choice.sc-battle { box-shadow: none; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.5)); }
.choice.sc-perm:hover, .choice.sc-battle:hover { box-shadow: none; filter: drop-shadow(0 0 6px var(--tier)) drop-shadow(0 10px 14px rgba(0, 0, 0, 0.55)); }
.choice.tier-2.sc-perm, .choice.tier-2.sc-battle { box-shadow: none; filter: drop-shadow(0 0 6px rgba(111, 207, 142, 0.45)) drop-shadow(0 8px 12px rgba(0, 0, 0, 0.5)); }
.choice.tier-3.sc-perm, .choice.tier-3.sc-battle { box-shadow: none; filter: drop-shadow(0 0 9px rgba(224, 162, 60, 0.75)) drop-shadow(0 8px 12px rgba(0, 0, 0, 0.5)); }

/* ---- ショップ ---- */
.modal.shop { background: linear-gradient(180deg, rgba(18, 12, 6, 0.42) 0, rgba(14, 10, 6, 0.7) 160px, rgba(12, 18, 24, 0.97) 340px, var(--panel) 460px), url(art/sys/shop_bg.webp?v=1) top center / 100% auto no-repeat, var(--panel); }

/* ---- タイトル ---- */
#overlay.title-ov { background: linear-gradient(rgba(4, 8, 16, 0.25), rgba(4, 8, 16, 0.6)), url(art/sys/title_bg.webp?v=1) center / cover no-repeat, #070b14; }
.title-screen .tf { margin-bottom: -70px; position: relative; z-index: 0; }
.title-logo { position: relative; z-index: 1; width: min(84vw, 480px); aspect-ratio: 732 / 512; container-type: inline-size; background: url(art/sys/title_emblem.webp?v=1) center / contain no-repeat; filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.6)); justify-content: center; gap: 0; }
.title-logo .tl-main { position: absolute; left: 0; right: 0; top: 47%; font-size: 10.6cqw; line-height: 1; text-align: center; }
.title-logo .tl-sub { position: absolute; left: 0; right: 0; top: 64%; text-align: center; font-size: 2.6cqw; color: #f3dfa8; letter-spacing: 0.5em; }

/* ---- カードの表面: 金属の枠に負けない、深い色の面と立体的な部品 ---- */
.card {
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background:
    var(--noise),
    radial-gradient(130% 70% at 50% 0%, color-mix(in srgb, var(--race) 55%, transparent), transparent 75%),
    linear-gradient(180deg, color-mix(in srgb, var(--race) 32%, #29242f), #131117 78%);
  color: #f1e7cf;
}
.card::before { inset: 3px; border: 1px solid rgba(255, 255, 255, 0.07); border-radius: 3px; }
/* 名前の帯: 光沢のある金属の札 */
.card .c-head {
  position: relative; margin: 3px 3px 0; border-radius: 2px;
  background:
    linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.22) 48%, transparent 60%),
    linear-gradient(180deg, color-mix(in srgb, var(--race) 50%, #fff) 0%, var(--race) 48%, color-mix(in srgb, var(--race) 70%, #000) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), inset 0 -1px 0 rgba(0, 0, 0, 0.45), 0 1px 2px rgba(0, 0, 0, 0.6);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.85), 0 0 3px rgba(0, 0, 0, 0.6);
  color: #fffaf0;
}
.card.rar-SR .c-head { background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.35) 46%, transparent 62%), linear-gradient(180deg, #fff1c0 0%, color-mix(in srgb, var(--race) 45%, #d9a93a) 45%, color-mix(in srgb, var(--race) 40%, #6e4d10) 100%); }
.card.rar-UR .c-head { background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.4) 46%, transparent 62%), linear-gradient(110deg, color-mix(in srgb, var(--race) 45%, #ffe0a8), color-mix(in srgb, var(--race) 60%, #b9a0ff) 50%, color-mix(in srgb, var(--race) 45%, #a8f0ff)); }
/* 絵の窓: 細い金の縁と内側の影 */
.card .c-art { position: relative; margin: 3px 4px 0; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.9), 0 0 0 2px color-mix(in srgb, var(--race) 45%, #e8c87a), 0 3px 5px rgba(0, 0, 0, 0.55); }
.card .c-art::after { content: ''; position: absolute; inset: 0; border-radius: 2px; box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25); pointer-events: none; z-index: 1; }
.card .c-art .c-stars, .card .c-art .c-marks { z-index: 2; }
/* 絵は本文の欄いっぱいに(効果文はホイールで下に送ると読める。半端に1行だけのぞかせない) */
.card.has-art .c-body > .c-art { flex: 0 0 calc(100% - 3px); }
.card .c-text { color: #e9dfc6; }
/* 攻守: 黒い金属の板に刻んだ数字 */
.card .c-stats {
  margin: 3px 4px 5px; border-radius: 2px; border-top: 0;
  background: linear-gradient(180deg, #2e2a35, #141217);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.85), 0 0 0 2px color-mix(in srgb, var(--race) 35%, #b8995a), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  color: #f6ebcd; text-shadow: 0 1px 0 #000;
}
.card .c-stats span small { color: #b5a685; }
.card .up { color: #7dffa0; }
.card .down { color: #ff8f80; }
.card.spell .c-stats { color: #dcc6ff; }
#zoomcard .card .c-text { color: #efe6cf; }

/* ショップの「予約品」「2割引」の札はカードの枠より手前に */
.rack-slot > .tag-res { z-index: 6; }
/* 魔法カード: 攻守の板がない分、絵を下の枠まで広げる */
.card.spell .c-body { margin-bottom: 5px; }

/* 小強化の札: 永続と一時的で同じ大きさ・同じ影。光らせる演出はやめる */
.choices.three { align-items: stretch; }
.choice.sc-perm, .choice.sc-battle { border-width: 14px 9px 9px 9px; padding: 8px 10px; }
.choice.sc-battle::after, .choice.sc-perm::after { display: none; }
.choice.sc-perm, .choice.sc-battle,
.choice.tier-2.sc-perm, .choice.tier-2.sc-battle,
.choice.tier-3.sc-perm, .choice.tier-3.sc-battle { filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.5)); }
.choice.sc-perm:hover, .choice.sc-battle:hover { filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.6)) brightness(1.08); }
.choice.tier-3 .ch-tier { text-shadow: none; }

/* 竜になった「あなた」の降臨 */
.avatar-slot .card.avatar-arrive { animation: avatarArrive 1.1s cubic-bezier(.2,1.3,.35,1) both; z-index: 30; }
@keyframes avatarArrive {
  0% { transform: translateY(-60px) scale(2.4); opacity: 0; filter: brightness(3) drop-shadow(0 0 30px #ffe28a); }
  35% { opacity: 1; filter: brightness(2) drop-shadow(0 0 40px #ffe28a); }
  70% { transform: scale(0.94); filter: brightness(1.2) drop-shadow(0 0 24px #ffd36b); }
  100% { transform: none; filter: drop-shadow(0 0 10px rgba(255, 210, 110, 0.6)); }
}
.aura-meter.aura-burst { animation: auraBurst 0.9s ease-in both; }
@keyframes auraBurst { 0% { box-shadow: 0 0 0 0 rgba(255, 226, 140, 0); } 80% { box-shadow: 0 0 0 6px rgba(255, 226, 140, 0.8), 0 0 30px #ffe28a; transform: scale(1.15); } 100% { opacity: 0; transform: scale(1.4); } }

/* カードの中の部品(枠・ひび・札など)は、そのカードの中だけで重ねる。
   重なった隣のカードの上に、下のカードの枠が透けて出ないように */
.card { isolation: isolate; }
/* 長押しの拡大表示は、手札や場より必ず手前に */
#zoomcard { z-index: 9000; }
#zoomcard .card .c-text { padding: 6px 12px !important; line-height: 1.55; }
#zoomcard .card .c-head { font-size: 16px !important; padding: 6px 12px !important; }
#zoomcard .card .c-stats { padding: 4px 12px !important; }
#zoomcard .card .c-stats span small { font-size: 12px; }

/* ---------- 奇妙な魚の画面は専用の海の背景(前の画面を見せない) ---------- */
#overlay.boon-ov {
  background:
    radial-gradient(ellipse 60% 40% at 70% 0%, rgba(150, 220, 255, 0.18), transparent 70%),
    repeating-linear-gradient(100deg, rgba(160, 220, 255, 0.05) 0 3px, transparent 3px 60px),
    radial-gradient(ellipse 120% 90% at 60% 30%, #12364a 0%, #0a1f2d 45%, #040b12 100%);
  backdrop-filter: none;
}
#overlay.boon-ov::before { content: ''; position: fixed; inset: 0; pointer-events: none; background: radial-gradient(circle at 20% 80%, rgba(159, 216, 239, 0.12) 0 2px, transparent 3px) 0 0 / 90px 120px, radial-gradient(circle at 70% 30%, rgba(159, 216, 239, 0.1) 0 1.5px, transparent 2.5px) 0 0 / 130px 160px; animation: boonBubbles 14s linear infinite; }
@keyframes boonBubbles { from { background-position: 0 0, 0 0; } to { background-position: 0 -480px, 0 -640px; } }
#overlay.boon-ov .modal.boon-stage { border-color: rgba(120, 190, 220, 0.4); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(159, 216, 239, 0.15); }

/* ---------- 水鏡の目: デッキの山に、いちばん上のカードの絵 ---------- */
.pile.deck.has-top i.deck-top { position: relative; width: 22px; height: 30px; border-radius: 2px; overflow: hidden; background: var(--race); border: 1px solid #9fd8ef; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 0 8px rgba(159, 216, 239, 0.55); }
.pile.deck.has-top i.deck-top img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pile.deck.has-top { cursor: pointer; -webkit-touch-callout: none; }
.deck-top-block { display: flex; gap: 14px; align-items: center; justify-content: center; margin: 4px 0 14px; padding: 10px 12px; border-radius: 10px; background: rgba(20, 52, 66, 0.55); border: 1px solid rgba(159, 216, 239, 0.35); flex-wrap: wrap; }
.deck-top-block .dtb-card .card { --cw: 104px; --ch: 146px; }
.deck-top-block .dtb-side { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; min-width: 0; }
.deck-top-block .dtb-side b { color: #9fd8ef; }
.deck-top-block .dtb-side > span { font-size: 12.5px; color: var(--dim); }
#toppanel { position: fixed; inset: 0; z-index: 9000; display: grid; place-items: center; background: rgba(0, 0, 0, 0.6); padding: 16px; }
#toppanel .tp-box { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px; border-radius: 12px; background: var(--panel); border: 1px solid rgba(159, 216, 239, 0.4); max-width: 100%; }
#toppanel .deck-top-block { margin: 0; }
#toppanel .dtb-card .card { --cw: 150px; --ch: 210px; }

#toppanel .tp-box { background: none; border: 0; padding: 0; }

/* 刻印の紋様の絵(白い紋様。負の刻印は紫に染める) */
.mk .mk-ic { width: 84%; height: 84%; object-fit: contain; display: block; pointer-events: none; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.6)); }
.mk.neg .mk-ic { filter: brightness(0.85) sepia(1) hue-rotate(225deg) saturate(2.6) drop-shadow(0 1px 0 rgba(0, 0, 0, 0.6)); }
.mk.stamp-fly .mk-ic { width: 80%; height: 80%; }

/* パックの絵のまわりの透明な所には、背景も影も付けない(絵の形に沿って影をつける) */
.packbox.has-art { background: transparent; box-shadow: none; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.65)); }
.packbox.has-art::before { -webkit-mask: var(--pack-art) center / 100% 100% no-repeat; mask: var(--pack-art) center / 100% 100% no-repeat; }
.packbox.kind-treasure.has-art { box-shadow: none; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.65)) drop-shadow(0 0 6px rgba(255, 220, 140, 0.35)); }
.packbox.kind-treasure.has-art .pb-body { display: none; }

/* ---------- 秘蔵パックの大当たり ---------- */
#jackpot { position: fixed; inset: 0; z-index: 9500; overflow: hidden; pointer-events: auto; background: radial-gradient(circle at 50% 42%, rgba(60, 30, 90, 0.85), rgba(4, 2, 10, 0.97) 70%); opacity: 0; transition: opacity 0.35s; }
#jackpot.on { opacity: 1; }
#jackpot.out { opacity: 0; transition: opacity 0.45s; }
.jp-rays { position: absolute; left: 50%; top: 40%; width: 240vmax; height: 240vmax; margin: -120vmax 0 0 -120vmax; opacity: 0; transition: opacity 0.6s;
  background: repeating-conic-gradient(from 0deg, rgba(255, 90, 90, 0.22) 0 7deg, transparent 7deg 15deg, rgba(255, 230, 107, 0.22) 15deg 22deg, transparent 22deg 30deg, rgba(107, 208, 255, 0.22) 30deg 37deg, transparent 37deg 45deg);
  -webkit-mask: radial-gradient(circle, #000 0%, transparent 55%); mask: radial-gradient(circle, #000 0%, transparent 55%); animation: jpSpin 7s linear infinite; }
#jackpot.burst .jp-rays { opacity: 1; }
@keyframes jpSpin { to { transform: rotate(360deg); } }
/* 虹の光の柱(パックから上へ扇状に) */
.jp-beams { position: absolute; left: 50%; top: 42%; width: 0; height: 0; }
.jp-beams i { position: absolute; left: -18px; bottom: 0; width: 36px; height: 120vh; transform-origin: 50% 100%; transform: rotate(var(--a)) scaleY(0); opacity: 0;
  background: linear-gradient(to top, #fff 0%, var(--c) 18%, color-mix(in srgb, var(--c) 50%, transparent) 60%, transparent 100%); filter: blur(3px); mix-blend-mode: screen; }
#jackpot.burst .jp-beams i { animation: jpBeam 0.7s cubic-bezier(.2,.9,.3,1) var(--d) forwards, jpBeamPulse 1.1s ease-in-out calc(var(--d) + 0.7s) infinite; }
@keyframes jpBeam { from { transform: rotate(var(--a)) scaleY(0); opacity: 0; } to { transform: rotate(var(--a)) scaleY(1); opacity: 0.9; } }
@keyframes jpBeamPulse { 0%, 100% { opacity: 0.9; width: 36px; left: -18px; } 50% { opacity: 0.55; width: 26px; left: -13px; } }
/* パック */
.jp-pack { position: absolute; left: 50%; top: 42%; width: min(34vw, 170px); aspect-ratio: 2 / 3; transform: translate(-50%, -30%) scale(0.9); transition: transform 0.6s cubic-bezier(.2,1.2,.4,1); filter: drop-shadow(0 0 18px rgba(255, 220, 140, 0.8)); }
.jp-pack img { width: 100%; height: 100%; object-fit: contain; display: block; }
.jp-pack.rise { transform: translate(-50%, -55%) scale(1.15); animation: jpShake 0.09s linear infinite; }
@keyframes jpShake { 0% { translate: 0 0; } 25% { translate: calc(var(--shake, 2px) * -1) calc(var(--shake, 2px) * 0.5); } 50% { translate: var(--shake, 2px) calc(var(--shake, 2px) * -0.6); } 75% { translate: calc(var(--shake, 2px) * -0.4) var(--shake, 2px); } }
.jp-pack.pop { animation: jpPop 0.5s ease-out forwards; }
@keyframes jpPop { 0% { transform: translate(-50%, -55%) scale(1.15); opacity: 1; filter: brightness(3) drop-shadow(0 0 40px #fff); } 100% { transform: translate(-50%, -55%) scale(1.9); opacity: 0; filter: brightness(4) drop-shadow(0 0 60px #fff); } }
/* 金貨と宝石の噴水 */
.jp-coins { position: absolute; left: 50%; top: 42%; width: 0; height: 0; }
.jp-coins i { position: absolute; left: -11px; top: -11px; width: 22px; height: 22px; animation: jpFountain 1.6s cubic-bezier(.2,.6,.4,1) forwards; }
.jp-coins i.coin { background: url(art/sys/coin.webp?v=1) center / contain no-repeat; filter: drop-shadow(0 0 4px rgba(255, 210, 100, 0.8)); }
.jp-coins i.gem { width: 14px; height: 14px; left: -7px; top: -7px; background: var(--c); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); box-shadow: 0 0 10px var(--c); filter: brightness(1.3); }
@keyframes jpFountain {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  45% { transform: translate(calc(var(--x) * 0.55), calc(var(--h) * -1)) rotate(calc(var(--r) * 0.5)); opacity: 1; }
  100% { transform: translate(var(--x), 60vh) rotate(var(--r)); opacity: 0.2; }
}
/* 3つのリール */
.jp-reels { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%) scale(0.6); display: flex; gap: clamp(8px, 2.4vw, 22px); opacity: 0; transition: opacity 0.35s, transform 0.5s cubic-bezier(.2,1.3,.4,1); }
#jackpot.reels .jp-reels { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.jp-reel { position: relative; width: clamp(88px, 26vw, 150px); aspect-ratio: 5 / 7; border-radius: 8px; overflow: hidden; background: #120a1e; box-shadow: 0 0 0 3px #b8995a, 0 0 0 5px #3a2a14, 0 10px 24px rgba(0, 0, 0, 0.7); }
.jp-strip { position: absolute; inset: 0; background: center / cover no-repeat; filter: blur(1.5px) brightness(0.85); }
.jp-strip.tick { animation: jpTick 0.07s linear; }
@keyframes jpTick { from { background-position: 50% -80px; } to { background-position: 50% 50%; } }
.jp-reel::after { content: ''; position: absolute; inset: 0; background: linear-gradient(rgba(0, 0, 0, 0.55), transparent 22%, transparent 78%, rgba(0, 0, 0, 0.55)); pointer-events: none; }
.jp-reel.stop .jp-strip { filter: none; animation: jpLand 0.45s cubic-bezier(.2,1.6,.4,1); }
@keyframes jpLand { from { transform: translateY(-18%) scale(1.1); } to { transform: none; } }
.jp-reel.stop.r-SR { box-shadow: 0 0 0 3px #ffe28a, 0 0 0 5px #8a6a1e, 0 0 26px rgba(255, 215, 120, 0.8); }
.jp-reel.stop.r-UR { animation: jpUr 1.4s linear infinite; }
@keyframes jpUr {
  0%, 100% { box-shadow: 0 0 0 3px #fff, 0 0 30px #ff7bd5, 0 0 60px #6bd0ff; }
  33% { box-shadow: 0 0 0 3px #fff, 0 0 30px #ffe66b, 0 0 60px #ff7bd5; }
  66% { box-shadow: 0 0 0 3px #fff, 0 0 30px #6bff9e, 0 0 60px #9b7bff; }
}
.jp-win { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 4px 6px; text-align: center; font-size: 12px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px #000; background: linear-gradient(transparent, rgba(0, 0, 0, 0.85)); opacity: 0; }
.jp-reel.stop .jp-win { opacity: 1; transition: opacity 0.3s 0.15s; }
#jackpot.done .jp-reel.stop { transform: translateY(-4px); transition: transform 0.3s; }

/* ---------- 奇妙な魚(絵) ---------- */
.boon-stage .fish-wrap.art::after { display: none; }
.boon-stage.reveal .fish-wrap.enter { animation: fishEnter 2.2s cubic-bezier(.2,.7,.3,1) both, fishBob 5.5s ease-in-out 2.2s infinite; }
@keyframes fishEnter {
  0% { transform: translate(70%, -50%) rotate(4deg); opacity: 0; }
  35% { opacity: 1; }
  60% { transform: translate(-4%, -46%) rotate(-3deg); }
  80% { transform: translate(2%, -52%) rotate(2deg); }
  100% { transform: translateY(-50%) rotate(-1.5deg); }
}

/* ---------- 手配書(今回のラスボス) ---------- */
.modal.wanted-modal { max-width: 420px; width: 100%; background: radial-gradient(120% 90% at 50% 20%, #3a2a1c, #1a120c 70%); border-color: #6b5236; }
.wanted-msg { color: #e8d9b8; margin: 12px 0 4px; font-size: 14px; }
.wanted { position: relative; width: 300px; max-width: 100%; margin: 6px auto 0; --pad: 22px; --head: 92px; }
.wp-paper {
  position: relative; padding: var(--pad); border-radius: 3px; color: #3b2412;
  background:
    radial-gradient(130% 90% at 50% 40%, transparent 55%, rgba(110, 66, 24, 0.45) 100%),
    repeating-linear-gradient(92deg, rgba(120, 80, 40, 0.06) 0 2px, transparent 2px 7px),
    linear-gradient(170deg, #ead7ad, #d9bf8a 55%, #c9a66b);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.55), inset 0 0 0 2px rgba(90, 55, 20, 0.35), inset 0 0 0 7px rgba(234, 215, 173, 0.6), inset 0 0 0 9px rgba(90, 55, 20, 0.4);
  clip-path: polygon(0 2%, 4% 0, 30% 1%, 55% 0, 80% 1.2%, 100% 0, 99% 30%, 100% 62%, 99% 100%, 70% 99%, 42% 100%, 12% 99%, 0 100%, 1% 64%, 0 33%);
  transform-origin: 30% 10%;
}
.wp-pin { position: absolute; top: 9px; width: 11px; height: 11px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #f2d27a, #8a5a14 70%); box-shadow: 0 2px 3px rgba(0, 0, 0, 0.5); }
.wp-pin.l { left: 12px; } .wp-pin.r { right: 12px; }
.wp-title { height: 54px; display: flex; align-items: center; justify-content: center; font-family: var(--f-head, serif); font-size: 36px; font-weight: 900; letter-spacing: 0.32em; padding-left: 0.32em; color: #4a1f0c; text-shadow: 0 1px 0 rgba(255, 240, 200, 0.6); }
.wp-sub { height: 38px; display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 13px; font-weight: 700; letter-spacing: 0.3em; color: #6b3a14; }
.wp-sub::before, .wp-sub::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, #6b3a14, transparent); }
.wp-window { aspect-ratio: 700 / 550; border: 2px solid rgba(74, 31, 12, 0.7); background: radial-gradient(80% 80% at 50% 40%, #f3e5c2, #dcc28e); box-shadow: inset 0 0 18px rgba(110, 66, 24, 0.45); }
.wp-name { margin-top: 12px; text-align: center; font-family: var(--f-head, serif); font-size: 24px; font-weight: 900; letter-spacing: 0.2em; color: #4a1f0c; }
.wp-foot { margin-top: 4px; text-align: center; font-size: 12px; letter-spacing: 0.15em; color: #7a4a20; }
/* シルエットは紙とは別の層(紙が風で飛んでも残る)。窓の位置にぴったり重ねる */
.wp-sil { position: absolute; left: var(--pad); right: var(--pad); top: calc(var(--pad) + var(--head)); aspect-ratio: 700 / 550; pointer-events: none; transform-origin: 50% 50%; }
.wp-sil img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.ws-crop { position: relative; width: 100%; height: 100%; overflow: hidden; }
.ws-crop img { position: absolute; left: 0; top: 0; }
.ws-head { width: 100%; height: 100%; display: flex; align-items: flex-end; justify-content: center; overflow: hidden; }
.ws-head img { width: 78%; }
.wanted .wp-sil { filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.6)); }

/* 旅の進みの小さい手配書 */
.portrait.wanted-mini { background: linear-gradient(170deg, #ead7ad, #c9a66b); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.portrait.wanted-mini .ws-crop { width: 100%; height: auto; aspect-ratio: 700 / 550; }
.portrait.wanted-mini .ws-crop img { width: 100%; }
.portrait.wanted-mini .ws-head { height: auto; }
.portrait.wanted-mini .ws-head img { width: 100%; }

/* ---------- 正体が明かされる演出 ---------- */
#overlay.reveal-ov { background: radial-gradient(120% 100% at 50% 30%, #1b3446, #0a141d 60%, #04080c); }
.reveal-stage { position: relative; width: 100%; min-height: min(92vh, 720px); display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; }
.reveal-stage .rv-defs { position: absolute; }
.rv-center { position: relative; z-index: 1; }
.rv-center .wanted { transform: scale(1.15); }
.rv-cap { position: relative; z-index: 1; margin: 34px 0 0; color: #cfe6f2; letter-spacing: 0.12em; font-size: 15px; transition: opacity 0.6s; }
.rv-cap.gone { opacity: 0; }
.rv-color { position: absolute; z-index: 2; opacity: 0; pointer-events: none; user-select: none; filter: drop-shadow(0 16px 40px rgba(0, 0, 0, 0.6)); transition: opacity 0.5s; }
.rv-color.on { opacity: 1; }
.reveal-stage.splash::after { content: ''; position: absolute; left: -10%; right: -10%; bottom: -40px; height: 46%; background: radial-gradient(60% 70% at 50% 100%, rgba(255, 210, 245, 0.55), rgba(210, 80, 190, 0.25) 50%, transparent 75%); animation: rvSplash 1.2s ease-out forwards; pointer-events: none; }
@keyframes rvSplash { 0% { opacity: 0; transform: scaleY(0.3); } 25% { opacity: 1; transform: scaleY(1.1); } 100% { opacity: 0; transform: scaleY(0.8); } }
@media (prefers-reduced-motion: reduce) { .boon-stage.reveal .fish-wrap.enter { animation: none; } }

/* お守りの小さなアイコン */
.charm-icons { display: inline-flex; gap: 6px; align-items: center; margin-right: 6px; }
.charm-ic { position: relative; width: 38px; height: 38px; padding: 3px; border-radius: 50%; border: 1px solid rgba(159, 216, 239, 0.55); background: radial-gradient(circle at 40% 35%, #23465a, #0d1c26); cursor: pointer; box-shadow: 0 0 0 2px rgba(8, 17, 25, 0.6), 0 0 10px rgba(159, 216, 239, 0.25); transition: transform 0.12s, box-shadow 0.12s; }
.charm-ic svg { display: block; width: 100%; height: 100%; }
.charm-ic:hover { transform: translateY(-2px) scale(1.06); box-shadow: 0 0 0 2px rgba(8, 17, 25, 0.6), 0 0 16px rgba(159, 216, 239, 0.6); }
.charm-ic:focus-visible { outline: 2px solid #9fd8ef; outline-offset: 2px; }
.charm-ic .ci-n { position: absolute; right: -6px; bottom: -4px; font-size: 10px; line-height: 1; padding: 2px 4px; border-radius: 8px; background: #e8c36a; color: #2a1a06; font-weight: 800; }
.bo-charm { display: inline-block; width: 26px; height: 26px; vertical-align: middle; }
.bo-charm svg { width: 100%; height: 100%; display: block; }
.boon-opt .bo-txt b small { font-weight: 400; font-size: 11px; margin-left: 6px; opacity: 0.8; }
.pickwrap.scl.on .card { box-shadow: 0 0 0 3px #9fd8ef, 0 0 16px #9fd8ef; }
.pickwrap.scl.on::after { content: '変える'; color: #9fd8ef; }
[data-act="end"].queued { box-shadow: 0 0 0 2px #fff6, 0 0 14px rgba(212, 169, 79, 0.9); animation: endQueued 0.9s ease-in-out infinite alternate; }
@keyframes endQueued { from { filter: brightness(1); } to { filter: brightness(1.25); } }
.card.taunt-flash { animation: tauntFlash 0.32s ease-in-out 4 alternate; z-index: 5; }
@keyframes tauntFlash { from { box-shadow: 0 0 0 2px rgba(255, 90, 60, 0.4), 0 0 8px rgba(255, 90, 60, 0.3); transform: scale(1); } to { box-shadow: 0 0 0 4px #ff5a3c, 0 0 28px #ff5a3c; transform: scale(1.08); } }
.cap-block { position: relative; }
.cap-block::after { content: ''; position: absolute; inset: -10px -14px; border-radius: 14px; pointer-events: none; border: 2px solid rgba(190, 230, 255, 0.95); background: radial-gradient(closest-side, rgba(160, 210, 255, 0.35), rgba(160, 210, 255, 0.05)); box-shadow: 0 0 24px rgba(160, 210, 255, 0.9), inset 0 0 18px rgba(200, 182, 255, 0.6); animation: capBlock 1.1s ease-out forwards; }
@keyframes capBlock { 0% { opacity: 0; transform: scale(0.7); } 20% { opacity: 1; transform: scale(1.06); } 60% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.12); } }

/* ---------- 奇妙な魚の画面: 魚の体の色(紫・桃色・金)に合わせた背景と泡 ---------- */
#overlay.boon-ov {
  background:
    radial-gradient(ellipse 60% 40% at 70% 0%, rgba(255, 120, 220, 0.16), transparent 70%),
    repeating-linear-gradient(100deg, rgba(255, 170, 230, 0.05) 0 3px, transparent 3px 60px),
    radial-gradient(ellipse 120% 90% at 60% 30%, #3a1446 0%, #210b2c 45%, #0c0412 100%);
}
#overlay.boon-ov::before { background: radial-gradient(circle at 20% 80%, rgba(255, 150, 220, 0.16) 0 2px, transparent 3px) 0 0 / 90px 120px, radial-gradient(circle at 70% 30%, rgba(255, 214, 120, 0.12) 0 1.5px, transparent 2.5px) 0 0 / 130px 160px; }
#overlay.boon-ov .modal.boon-stage { border-color: rgba(230, 120, 210, 0.45); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 160, 230, 0.15), 0 0 40px rgba(200, 60, 180, 0.18); }
.modal.boon-stage { background: radial-gradient(120% 90% at 85% 40%, #4a1a54 0%, #2a0f34 45%, #12061a 100%); border-color: #8a3a8f; }
.boon-stage::before { background: repeating-linear-gradient(170deg, rgba(255, 170, 230, 0.05) 0 2px, transparent 2px 22px); }
.boon-who { color: #ff9ee0; }
.boon-line { background: rgba(22, 6, 28, 0.8); border-color: rgba(255, 150, 220, 0.38); color: #fbe9f6; }
.boon-line.more::after { color: #ff9ee0; }
.boon-opt { border-color: rgba(255, 150, 220, 0.35); background: rgba(44, 14, 52, 0.9); color: #fbe9f6; }
.boon-opt:hover:not([disabled]) { background: rgba(70, 24, 80, 0.95); }
.boon-opt .bo-ic { color: #ff9ee0; }
.boon-opt .bo-txt span { color: #ead2e6; }
/* 選択肢の画面: 魚は選択肢の下に、体まるごと */
.modal.boon-stage.offer { display: flex; flex-direction: column; align-items: stretch; min-height: 0; max-width: 680px; }
.boon-stage.offer .boon-main { width: auto; padding: 24px 24px 6px; }
.boon-stage.offer .fish-below { position: relative; display: flex; justify-content: center; padding: 4px 16px 18px; pointer-events: none; }
.boon-stage.offer .fish-below .fish-art, .boon-stage.offer .fish-below .fish-svg { display: block; width: min(100%, 520px); height: auto; max-height: 34vh; object-fit: contain; filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 22px rgba(255, 90, 210, 0.25)); animation: fishSway 5.5s ease-in-out infinite; }
@keyframes fishSway { 0%, 100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-6px) rotate(1deg); } }
@media (max-width: 640px) { .boon-stage.offer .boon-main { padding: 18px 14px 4px; } .boon-stage.offer .fish-below .fish-art { max-height: 26vh; } }
@media (prefers-reduced-motion: reduce) { .boon-stage.offer .fish-below .fish-art { animation: none; } }
/* 正体が明かされる演出の背景も、魚の色に */
#overlay.reveal-ov { background: radial-gradient(120% 100% at 50% 30%, #3a1446, #1a0822 60%, #08030c); }
.rv-cap { color: #f4d6ee; }

/* ---------- カードが変わる・刻印が押される様子 ---------- */
.cardfx-grid { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; padding: 8px 0 4px; }
.cfx { position: relative; perspective: 900px; width: var(--cw-deck, 110px); }
.cfx-face { backface-visibility: hidden; transition: transform 0.55s cubic-bezier(.4,.1,.3,1); }
.cfx-face.to { position: absolute; inset: 0; transform: rotateY(180deg); }
.cfx.flip .cfx-face.from { transform: rotateY(-180deg); }
.cfx.flip .cfx-face.to { transform: rotateY(0deg); }
.cfx.flip .cfx-face.to .card { box-shadow: 0 0 0 2px #ffe28a, 0 0 22px rgba(255, 158, 224, 0.7); }
/* 刻印: 上から判子が押され、カードの絵柄が刻印つきに変わる */
.cfx.k-stamp .cfx-face.to { transform: none; opacity: 0; transition: opacity 0.25s 0.2s; }
.cfx.k-stamp.stamp .cfx-face.to { opacity: 1; }
.cfx-stamp { position: absolute; left: 50%; top: 42%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(60, 12, 30, 0.85); box-shadow: 0 0 0 3px #e06a8a, 0 0 18px rgba(224, 106, 138, 0.8); opacity: 0; transform: translateY(-60px) scale(1.6); pointer-events: none; z-index: 2; }
.cfx-stamp img, .cfx-stamp svg { width: 70%; height: 70%; }
.cfx.stamp .cfx-stamp { animation: cfxStamp 0.9s cubic-bezier(.3,1.4,.5,1) forwards; }
@keyframes cfxStamp { 0% { opacity: 0; transform: translateY(-60px) scale(1.6); } 35% { opacity: 1; transform: translateY(0) scale(0.92); } 50% { transform: scale(1.08); } 75% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.3); } }
.cfx.stamp .card { animation: cfxShake 0.3s 0.3s; }
@keyframes cfxShake { 0%, 100% { transform: none; } 30% { transform: translate(-2px, 2px); } 60% { transform: translate(2px, -1px); } }
.scale-lead .scale-n { color: #ffe28a; }

/* 隠しボス: ターン制限の欄。「7ターン以内」→「なし」で文字の大きさが変わっても、行の高さは変えない */
.limit-break { height: 32px; line-height: 32px; display: flex; align-items: center; justify-content: center; gap: 2px; }
.lb-num, .lb-num.broken { line-height: 1; vertical-align: middle; }
.lb-after { display: inline-block; opacity: 0; transform: translateY(4px); filter: blur(3px); transition: opacity 1.4s ease, transform 1.4s ease, filter 1.4s ease; }
.lb-after.show { opacity: 1; transform: none; filter: none; }
/* 決意の英雄が相手の肖像へ飛んでいく */
.hero-fly { position: fixed; z-index: 9500; pointer-events: none; transform-origin: 50% 50%; }
.hero-fly .card { box-shadow: 0 0 0 2px #ffd36b, 0 10px 30px rgba(0, 0, 0, 0.6); }
.portrait.hero-snap { animation: heroSnap 0.5s ease-out; }
@keyframes heroSnap { 0% { box-shadow: 0 0 0 0 rgba(255, 211, 107, 0.9); } 40% { box-shadow: 0 0 0 6px rgba(255, 211, 107, 0.9), 0 0 30px #ffd36b; } 100% { box-shadow: 0 0 0 0 rgba(255, 211, 107, 0); } }
/* スマホ: 魚の台詞の画面も、魚は文字の下に体まるごと(文字の裏に半分隠さない) */
@media (max-width: 640px) {
  .modal.boon-stage:not(.offer) { display: flex; flex-direction: column; }
  .boon-stage:not(.offer) .boon-main { order: 1; }
  .boon-stage:not(.offer) .fish-wrap { order: 2; position: relative; right: auto; top: auto; width: 100%; max-width: 520px; margin: 0 auto; padding: 0 12px 16px; transform: none; opacity: 1; animation: fishSway 5.5s ease-in-out infinite; }
  .boon-stage:not(.offer) .fish-wrap .fish-art { max-height: 30vh; width: 100%; object-fit: contain; }
  .boon-stage.reveal .fish-wrap.enter { animation: fishEnterSp 1.8s cubic-bezier(.2,.7,.3,1) both, fishSway 5.5s ease-in-out 1.8s infinite; }
  .boon-stage.intro .boon-main { min-height: 0; }
}
@keyframes fishEnterSp { 0% { transform: translateX(80%) rotate(4deg); opacity: 0; } 40% { opacity: 1; } 70% { transform: translateX(-4%) rotate(-2deg); } 100% { transform: none; } }
/* 魚の体は、触角の先の長方形(カードに見える部分)がぎりぎり見えないところで右端を切る */
.boon-stage.offer .fish-below { overflow: hidden; }
.boon-stage.offer .fish-below .fish-art { width: min(129%, 670px); max-width: none; max-height: none; margin-right: -29%; flex: none; }
.boon-stage.offer .fish-below { justify-content: flex-start; padding-left: max(16px, calc(50% - 260px)); }
@media (max-width: 640px) {
  .boon-stage:not(.offer) .fish-wrap { overflow: hidden; padding: 0 0 16px 12px; }
  .boon-stage:not(.offer) .fish-wrap .fish-art { width: 129%; max-width: none; max-height: none; }
  .boon-stage.offer .fish-below { padding-left: 12px; }
  .boon-stage.offer .fish-below .fish-art { width: 129%; }
}
.boon-stage.offer .fish-below { display: block; width: min(100% - 32px, 520px); margin: 0 auto; padding: 4px 0 18px; overflow: hidden; }
.boon-stage.offer .fish-below .fish-art { width: 132%; margin: 0; }
@media (max-width: 640px) {
  .boon-stage.offer .fish-below { width: calc(100% - 24px); padding-left: 0; }
  .boon-stage.offer .fish-below .fish-art, .boon-stage:not(.offer) .fish-wrap .fish-art { width: 132%; }
}

/* ショップで買ったパックを開ける画面: 後ろは店の中(前の戦闘の盤面は見せない) */
#overlay.shop-ov { background: linear-gradient(rgba(10, 8, 6, 0.55), rgba(8, 10, 14, 0.92)), url(art/sys/shop_bg.webp?v=1) top center / cover no-repeat, #0b0d10; backdrop-filter: none; }

/* 選択肢の画面: 魚は上に、ひと回り小さく。体の下3分の1は台詞の枠に重なる(台詞が手前) */
.boon-stage.offer { --fishw: min(100% - 48px, 400px); }
.boon-stage.offer .fish-below { order: 0; width: var(--fishw); margin: 0 auto; padding: 14px 0 0; position: relative; z-index: 0; }
.boon-stage.offer .boon-main { order: 1; position: relative; z-index: 1; padding-top: 0; margin-top: calc(-0.28 * min(100vw - 80px, 400px)); }
.boon-stage.offer .boon-who { text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9); }
@media (max-width: 640px) {
  .boon-stage.offer { --fishw: 78%; }
  .boon-stage.offer .fish-below { width: var(--fishw); padding: 10px 0 0; }
  .boon-stage.offer .boon-main { margin-top: calc(-0.28 * 0.78 * (100vw - 40px)); padding-top: 0; }
}
/* 選択肢の画面の魚(2): もっと小さく、もっと下へ。右側は画面の枠の外にはみ出していて見えない、という見せ方にする
   (魚の箱では切らず、枠(.modal)の端で切る。魚の箱で切ると、光の影が四角く切れて、まわりと色の違う長方形に見えてしまう) */
.boon-stage.offer { --fishw: min(50%, 330px); }
.boon-stage.offer .fish-below { width: var(--fishw); margin: 0 0 0 auto; padding: 18px 0 0; overflow: visible; }
.boon-stage.offer .fish-below .fish-art { width: 132%; max-width: none; filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.5)); }
.boon-stage.offer .boon-main { margin-top: calc(var(--fishw) * -0.4); }
@media (max-width: 640px) {
  .boon-stage.offer { --fishw: 60%; }
  .boon-stage.offer .fish-below { width: var(--fishw); padding: 12px 0 0; }
  .boon-stage.offer .fish-below .fish-art { width: 132%; }
  .boon-stage.offer .boon-main { margin-top: calc(var(--fishw) * -0.4); }
}

/* ===== ラスボス「三剣神」 ===== */
.g-red { --god: #e5533d; --god-soft: rgba(229, 83, 61, 0.28); }
.g-blue { --god: #4f8de6; --god-soft: rgba(79, 141, 230, 0.28); }
.g-yellow { --god: #e8c23a; --god-soft: rgba(232, 194, 58, 0.28); }
.portrait.boss-god { border-color: var(--god); box-shadow: 0 0 12px var(--god-soft), 0 0 2px var(--god); }
.portrait.god-vacant { background: repeating-linear-gradient(135deg, rgba(255,255,255,0.03) 0 6px, transparent 6px 12px), #0b0e13; border-style: dashed; border-color: var(--god); box-shadow: inset 0 0 12px var(--god-soft); }
.gods-lp { display: inline-flex; gap: 4px; align-items: center; }
.gods-lp .gl { position: relative; display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px; border-radius: 999px; font-size: 11px; font-variant-numeric: tabular-nums; color: var(--ink); background: rgba(0,0,0,0.25); border: 1px solid var(--god); opacity: 0.75; }
.gods-lp .gl i { width: 7px; height: 7px; border-radius: 50%; background: var(--god); }
.gods-lp .gl.cur { opacity: 1; background: var(--god-soft); font-weight: 700; }
.gods-lp .gl.down { opacity: 0.35; text-decoration: line-through; }
.it.it-god { border-color: var(--god); background: var(--god-soft); font-weight: 700; }
.chip.god-chip { border-color: var(--god); background: var(--god-soft); }
.gods-intro { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.gods-intro .god-row { display: flex; gap: 10px; align-items: flex-start; padding: 6px 8px; border-radius: 6px; border-left: 3px solid var(--god); background: rgba(0,0,0,0.18); font-size: 12.5px; line-height: 1.5; }
.gods-intro .god-row .portrait { width: 34px; height: 44px; flex: none; }
.modal.duel-modal { background: radial-gradient(120% 70% at 30% 0%, rgba(229, 83, 61, 0.3), transparent 60%), var(--panel); border-color: #e5533d; }
.modal.duel-modal h2 { color: #ffb4a6; font-size: 1.15em; }
.lp.nolp .v { letter-spacing: 0.1em; opacity: 0.7; }
@media (max-width: 700px) { .gods-lp .gl { font-size: 10px; padding: 0 4px; } .gods-lp .gl i { width: 5px; height: 5px; } }

/* ===== ラスボス「瘴気の元凶」: 第1形態の紫の靄 ===== */
#haze { position: fixed; inset: 0; z-index: 40; pointer-events: none; opacity: var(--haze, 0); transition: opacity 1.4s ease; mix-blend-mode: screen; overflow: hidden; }
#haze.clear { transition: opacity 0.35s ease-out; }
#haze i { position: absolute; inset: -30%; background:
  radial-gradient(40% 30% at 20% 70%, rgba(150, 60, 210, 0.75), transparent 70%),
  radial-gradient(35% 28% at 75% 30%, rgba(110, 40, 170, 0.7), transparent 70%),
  radial-gradient(30% 25% at 55% 85%, rgba(190, 80, 220, 0.55), transparent 70%);
  filter: blur(18px); animation: hazeDrift 22s ease-in-out infinite alternate; }
#haze i:nth-child(2) { animation-duration: 31s; animation-direction: alternate-reverse; transform: rotate(40deg); opacity: 0.8; }
#haze i:nth-child(3) { animation-duration: 17s; opacity: 0.6; transform: scale(1.3); }
@keyframes hazeDrift { from { translate: -6% 3%; } to { translate: 6% -4%; } }
@media (prefers-reduced-motion: reduce) { #haze i { animation: none; } }
.it.it-key { border-width: 2px; }
.it .it-what { display: block; font-style: normal; font-size: 0.85em; opacity: 0.9; color: #ffd9a0; margin-top: 1px; }

/* ===== 開発用: 演出を見る ===== */
.btn.dev-btn { border-style: dashed; opacity: 0.85; }
.demo-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin: 10px 0; }
.demo-item { display: grid; gap: 2px; text-align: left; padding: 8px 12px; line-height: 1.35; }
.demo-item small { color: var(--ink-dim); font-size: 0.8em; font-weight: 400; }
#demo-back { position: fixed; right: max(12px, env(safe-area-inset-right, 0px)); bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 5000; border-style: dashed; background: rgba(12, 20, 28, 0.92); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5); }
/* 肖像つきの手配書(正体を知る前の奇妙な魚以外) */
.wanted.pt .wp-window { aspect-ratio: 5 / 6; overflow: hidden; background: #2a1c10; }
.wanted.pt .wp-window img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; filter: sepia(0.18) saturate(0.95); user-select: none; -webkit-user-drag: none; }

/* ===== 実績(5×5のフルアート) ===== */
.modal.trophy-modal { max-width: 560px; width: 100%; }
.tp-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 10px 0 12px; }
.tp-cell { aspect-ratio: 1; padding: 0; border-radius: 6px; border: 1px solid rgba(255, 255, 255, 0.08); background: #000; overflow: hidden; cursor: pointer; position: relative; min-width: 0; }
.tp-cell.none { visibility: hidden; }
.tp-cell.near { background: linear-gradient(160deg, #5b6068, #3b3f46); border-color: rgba(255, 255, 255, 0.18); }
.tp-cell.open { border-color: var(--brass); box-shadow: 0 0 8px rgba(214, 168, 76, 0.35); }
.tp-cell img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tp-cell:hover, .tp-cell:focus-visible { outline: 2px solid var(--brass); outline-offset: 1px; }
.tp-pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.tp-pager .btn { min-width: 48px; }
.tp-big { width: min(100%, 380px); aspect-ratio: 1; margin: 0 auto 12px; border-radius: 10px; overflow: hidden; background: #000; border: 1px solid rgba(255, 255, 255, 0.1); }
.tp-big.near { background: linear-gradient(160deg, #5b6068, #3b3f46); }
.tp-big.open { border-color: var(--brass); box-shadow: 0 0 18px rgba(214, 168, 76, 0.35); }
.tp-big img { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.tp-name { text-align: center; margin: 0 0 6px; }
.tp-cond { margin: 2px 0; }
.tp-reward { margin: 2px 0 10px; color: var(--brass); font-weight: 700; }
.fish-art { height: auto; }

/* ===== 旅の準備(初期デッキと難易度) ===== */
.modal.setup-modal { max-width: 760px; }
.setup-modal h3 { margin: 12px 0 6px; font-size: 14px; color: var(--brass); }
.sd-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.sd-card, .df-row { text-align: left; background: rgba(0, 0, 0, 0.22); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 8px; color: var(--ink); padding: 9px 11px; cursor: pointer; font: inherit; line-height: 1.45; min-width: 0; }
.sd-card { display: grid; gap: 3px; align-content: start; }
.sd-card small, .df-row small { color: var(--ink-dim); font-size: 12px; }
.sd-tag { font-size: 11px; color: var(--brass); }
.sd-card.on, .df-row.on { border-color: var(--brass); background: rgba(214, 168, 76, 0.14); box-shadow: 0 0 0 1px var(--brass) inset; }
.sd-card.todo, .df-row.lock { opacity: 0.5; cursor: default; }
.df-list { display: grid; gap: 6px; }
.df-row { display: grid; grid-template-columns: 44px 64px 1fr; gap: 8px; align-items: center; }
.df-stars { color: #ffd36b; font-weight: 900; font-variant-numeric: tabular-nums; }
.diff-new { color: #ffd36b; font-weight: 700; }
.rs-mode { color: #ffd36b; }
@media (max-width: 560px) { .df-row { grid-template-columns: 40px 1fr; } .df-row small { grid-column: 1 / -1; } }
/* (隠し要素)結界が割れる */
.cap-crack { position: fixed; width: 260px; height: 260px; margin: -130px 0 0 -130px; z-index: 4000; pointer-events: none; filter: drop-shadow(0 0 8px #bfe8ff); animation: capCrack 1.25s ease-out forwards; }
.cap-crack svg { width: 100%; height: 100%; }
@keyframes capCrack { 0% { transform: scale(0.2); opacity: 0; } 12% { transform: scale(1); opacity: 1; } 55% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1.7) rotate(8deg); opacity: 0; } }
.avoid-cost { display: block; font-size: 0.78em; color: #e58b8b; font-weight: 400; margin-top: 2px; }

/* ===================== 実績(横の欄・解除の発表) ===================== */
.modal.trophy-modal.list { max-width: 560px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.tp-side { display: none; }
@media (min-width: 980px) and (hover: hover) {
  .modal.trophy-modal.list { max-width: 940px; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); align-items: start; }
  .tp-side { display: block; min-width: 0; border-left: 1px solid var(--felt-line); padding-left: 18px; min-height: 420px; }
  .tp-side .tp-name { text-align: left; }
}
.tp-hint { color: var(--ink-dim); font-size: 13px; margin-top: 40px; }
.tp-big.sm { width: min(100%, 220px); margin: 0 0 10px; }
.tp-cell.dark { background: #000; }
.tp-cell img.tp-portrait, .tp-big img.tp-portrait { object-fit: cover; object-position: 50% 18%; }
.tp-noart { display: grid; place-items: center; width: 100%; height: 100%; font-family: var(--f-display); font-size: 22px; color: var(--brass); background: radial-gradient(circle, #3a3020, #120e08); }
.tp-big .tp-noart { font-size: 64px; }
.tp-lab { display: inline-block; font-size: 11px; font-weight: 900; color: var(--ink-dim); border: 1px solid var(--felt-line); border-radius: 3px; padding: 0 6px; margin-right: 8px; vertical-align: 1px; }
.tp-cond, .tp-reward { text-align: left; line-height: 1.6; }
.trophy-modal.detail .tp-cond, .trophy-modal.detail .tp-reward, .trophy-modal.fresh .tp-cond, .trophy-modal.fresh .tp-reward { max-width: 440px; margin-inline: auto; }
.tg-card { display: flex; justify-content: center; margin: 8px 0 4px; }
.tg-crest { display: flex; gap: 12px; align-items: center; max-width: 440px; margin: 8px auto 4px; padding: 10px 12px; border: 1px solid var(--felt-line); border-radius: 8px; background: rgba(0, 0, 0, 0.25); text-align: left; }
.tg-crest .tg-ic { flex: 0 0 auto; }
.tg-crest p { margin: 4px 0 0; font-size: 13px; line-height: 1.5; }
.tg-deck { max-width: 440px; margin: 8px auto 4px; padding: 10px 12px; border: 1px solid var(--felt-line); border-radius: 8px; background: rgba(0, 0, 0, 0.25); text-align: left; }
.tg-deck p { margin: 4px 0 0; font-size: 13px; line-height: 1.5; }
.tg-more { max-width: 440px; margin: 6px auto 0; padding-left: 1.2em; text-align: left; font-size: 13px; color: var(--brass); }
.trophy-modal.fresh { max-width: 520px; cursor: pointer; text-align: center; animation: tfIn 0.45s cubic-bezier(.2, .9, .3, 1.2) both; }
.tf-kicker { margin: 0 0 10px; font-family: var(--f-display); color: var(--target); font-size: 18px; letter-spacing: 0.06em; }
.tf-kicker span { margin-left: 10px; font-family: var(--f-body); font-size: 12px; color: var(--ink-dim); }
.trophy-modal.fresh .tp-big { width: min(100%, 300px); }
.tf-tap { margin-top: 10px; }
@keyframes tfIn { from { transform: scale(0.85); opacity: 0; } to { transform: none; opacity: 1; } }

/* ===================== 店主の娘・うわさ話 ===================== */
.keeper-ph.girl { background: radial-gradient(circle at 50% 28%, #f0c9a0 0 13px, transparent 14px), radial-gradient(ellipse at 50% 100%, #c45a7a 0 26px, transparent 27px); }
.keeper-ph.girl::before { left: 4px; right: 4px; top: 0; height: 14px; border-radius: 14px 14px 4px 4px; background: #7a3a1c; }
.girl-tag { margin-left: 10px; font-family: var(--f-body); font-size: 12px; color: #f2a6bd; border: 1px solid rgba(242, 166, 189, 0.5); border-radius: 10px; padding: 1px 8px; vertical-align: 3px; }
.bubble.rumor { border-color: rgba(159, 216, 239, 0.6); font-style: italic; }
.shop-sale { text-align: center; margin: 4px 0 8px; color: #f2a6bd; font-weight: 700; font-size: 13px; }
.pickwrap.sell .pick-cap { color: var(--brass); font-weight: 700; }

/* ===================== 着せ替え ===================== */
.skin-btn { position: fixed; top: max(12px, env(safe-area-inset-top, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); font-size: 13px; padding: 6px 14px; z-index: 2; }
.modal.skin-modal { max-width: 560px; }
.sk-row { display: flex; flex-wrap: wrap; gap: 8px; }
.sk-opt { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 8px; border: 1px solid var(--felt-line); background: var(--table-2); color: var(--ink); cursor: pointer; }
.sk-opt.on { border-color: var(--brass); box-shadow: 0 0 0 1px var(--brass) inset; }
.sk-opt b { font-weight: 700; font-size: 13px; }
.sk-sw { width: 30px; height: 30px; border-radius: 5px; border: 1px solid rgba(255, 255, 255, 0.2); background: radial-gradient(ellipse at 50% 50%, #16232f, #101a24 70%); }
.sk-back .sk-sw { width: 22px; height: 30px; background: repeating-linear-gradient(45deg, var(--brass-dim) 0 2px, #3a2e17 2px 4px); }
.sk-frame .sk-sw { background: var(--paper); box-shadow: inset 0 0 0 3px var(--r-warrior); }
.sk-preview { display: flex; align-items: center; justify-content: center; gap: 28px; margin: 16px 0 4px; padding: 14px; border-radius: 10px; background: radial-gradient(ellipse at 50% 50%, var(--table-2), var(--table) 70%); }
.sk-pile .pile.deck i { width: 28px; height: 38px; }
/* 見本の色 */
.sk-board.sk-v-morph .sk-sw { background: radial-gradient(circle at 30% 30%, #3c1d4f, #10302c 75%); }
.sk-board.sk-v-gods .sk-sw { background: linear-gradient(90deg, #1b2450, #4a1414 50%, #4a3a0c); }
.sk-board.sk-v-miasma .sk-sw { background: radial-gradient(circle, #3a1a4f, #0b0710 75%); }
.sk-board.sk-v-dusk .sk-sw { background: linear-gradient(180deg, #4a2a5a, #c46a3a); }
.sk-back.sk-v-morph .sk-sw { background: repeating-linear-gradient(60deg, #6b2f86 0 3px, #1f5a52 3px 7px); }
.sk-back.sk-v-gods .sk-sw { background: linear-gradient(90deg, #2b3f9a 0 33%, #b8322a 33% 66%, #d8b02a 66%); }
.sk-back.sk-v-miasma .sk-sw { background: radial-gradient(circle at 50% 40%, #9a5ad8, #2a0f3c 55%, #0b0710); }
.sk-back.sk-v-dusk .sk-sw { background: repeating-linear-gradient(0deg, #e08a3a 0 3px, #5a2a5a 3px 6px); }
.sk-frame.sk-v-morph .sk-sw { box-shadow: inset 0 0 0 3px #a04ad0, inset 0 0 0 5px #3fbfa8; }
.sk-frame.sk-v-gods .sk-sw { box-shadow: inset 0 0 0 3px #d8b02a, inset 0 0 0 5px #b8322a; }
.sk-frame.sk-v-miasma .sk-sw { box-shadow: inset 0 0 0 3px #6a2a9a, 0 0 8px #9a5ad8; }
.sk-frame.sk-v-dusk .sk-sw { box-shadow: inset 0 0 0 3px #e08a3a, inset 0 0 0 5px #5a2a5a; }

.tg-crest .tg-ic { width: 56px; height: 62px; display: grid; place-items: center; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.6)); }
.tg-crest .tg-ic svg, .tg-crest .tg-ic img { width: 100%; height: 100%; }
.tg-crest > div { min-width: 0; }

/* ---- 着せ替え: 盤面(戦闘の背景の色を染め替える) ---- */
body[data-sk-board] .table, body[data-sk-board] .sk-preview { background: var(--skb), url(art/sys/battle_bg.webp?v=2) center / cover no-repeat, #0c1a1c; background-blend-mode: color, normal, normal; }
@media (orientation: portrait) { body[data-sk-board] .table { background: var(--skb), url(art/sys/battle_bg_sp.webp?v=2) center / cover no-repeat, #0c1a1c; background-blend-mode: color, normal, normal; } }
body[data-sk-board="morph"] { --skb: linear-gradient(135deg, #7a2f9a, #1f8a7a); }
body[data-sk-board="gods"] { --skb: linear-gradient(90deg, #2b3f9a, #b8322a 50%, #c89a1a); }
body[data-sk-board="miasma"] { --skb: radial-gradient(ellipse at 50% 100%, #8a3ad0, #3a0f5a 70%); }
body[data-sk-board="dusk"] { --skb: linear-gradient(180deg, #5a2a7a, #d0702a 80%); }
/* デッキの裏面(山札・相手の手札・パックの裏) */
body[data-sk-back] .pile.deck i, body[data-sk-back] .hand-back { background: var(--skk), url(art/sys/card_back.webp?v=1) center / cover; background-blend-mode: color, normal; }
body[data-sk-back] .packcard.back .pc-back { background: var(--skk), url(art/sys/card_back.webp?v=1) center / 100% 100% no-repeat; background-blend-mode: color, normal; }
body[data-sk-back="morph"] { --skk: linear-gradient(135deg, #a04ad0, #3fbfa8); }
body[data-sk-back="gods"] { --skk: linear-gradient(90deg, #3a52d0, #d03a2a 50%, #e0b020); }
body[data-sk-back="miasma"] { --skk: radial-gradient(circle at 50% 40%, #b070f0, #4a1a70); }
body[data-sk-back="dusk"] { --skk: linear-gradient(180deg, #7a3a9a, #f08a3a); }
/* カードの枠(枠の染め色を、種族やレアリティの色の代わりに) */
body[data-sk-frame="morph"] .card { --frame-tint: linear-gradient(135deg, #b05ae0, #3fbfa8 50%, #b05ae0); }
body[data-sk-frame="gods"] .card { --frame-tint: linear-gradient(135deg, #3a52d0, #d03a2a 50%, #e8c030); }
body[data-sk-frame="miasma"] .card { --frame-tint: linear-gradient(160deg, #c080ff, #4a1a70 60%, #1a0a28); }
body[data-sk-frame="dusk"] .card { --frame-tint: linear-gradient(180deg, #f0b060, #d0602a 50%, #6a2a7a); }
.title-sub { flex-wrap: wrap; }
.title-sub .btn { white-space: nowrap; }
.sell-offer { display: flex; gap: 16px; align-items: center; margin: 8px 0 12px; padding: 12px 14px; border-radius: 10px; border: 1px solid rgba(242, 166, 189, 0.55); background: linear-gradient(120deg, rgba(196, 90, 122, 0.18), rgba(0, 0, 0, 0.25)); }
.sell-offer .so-card { flex: 0 0 auto; }
.sell-offer .so-body { min-width: 0; }
.sell-offer .so-body > b { color: #f2a6bd; }
.sell-offer p { margin: 6px 0 10px; font-size: 13px; line-height: 1.6; }
.so-price { color: var(--brass); font-size: 16px; }
.so-btns { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 520px) { .sell-offer { flex-direction: column; text-align: center; } .so-btns { justify-content: center; } }

/* ---- 実績の小さな知らせ(ランの途中) ---- */
.tpop { position: fixed; top: max(64px, calc(env(safe-area-inset-top, 0px) + 56px)); left: 50%; z-index: 300; display: flex; align-items: center; gap: 10px; width: min(360px, calc(100vw - 32px)); padding: 8px 16px 8px 8px; border-radius: 10px; border: 1px solid var(--brass); background: linear-gradient(120deg, #2a2312, #0f1720 70%); box-shadow: 0 6px 22px rgba(0, 0, 0, 0.6), 0 0 14px rgba(214, 168, 76, 0.35); pointer-events: none; animation: tpopIn 0.45s cubic-bezier(.2, .9, .3, 1.3) both; transform: translateX(-50%); }
.tpop.out { animation: tpopOut 0.45s ease-in forwards; }
.tpop.has-frame { border: 0; border-radius: 0; box-shadow: none; aspect-ratio: 3 / 1; padding: 0 9% 0 4.5%; background: var(--tpop-frame) center / 100% 100% no-repeat; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.6)); }
.tpop-ic { flex: 0 0 auto; width: 52px; height: 52px; border-radius: 6px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.2); background: #000; }
.tpop.has-frame { --tw: min(380px, calc(100vw - 24px)); width: var(--tw); box-sizing: border-box; padding: 0 calc(var(--tw) * 0.075) 0 calc(var(--tw) * 0.08); }
.tpop.has-frame .tpop-ic { position: absolute; left: 5.5%; top: 16.4%; width: 18.9%; height: 70.7%; border: 0; border-radius: 3px; background: transparent; display: grid; place-items: center; }
.tpop-ic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tpop-ic img.tp-portrait { object-position: 50% 18%; }
.tpop-tx { display: flex; flex-direction: column; min-width: 0; }
.tpop-tx small { color: var(--target); font-size: 11px; font-weight: 900; letter-spacing: 0.08em; }
.tpop-tx b { color: #fff6dc; font-size: 15px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; }
@keyframes tpopIn { from { opacity: 0; transform: translate(-50%, -24px) scale(0.92); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes tpopOut { to { opacity: 0; transform: translate(-50%, -16px); } }

/* ---- 着せ替え: 専用の絵があるとき ---- */
body.ski-board .table, body.ski-board .sk-preview { background: var(--ski-board) center / cover no-repeat, #0c1a1c; }
@media (orientation: portrait) { body.ski-board .table { background: var(--ski-boardSp, var(--ski-board)) center / cover no-repeat, #0c1a1c; } }
body.ski-back .pile.deck i, body.ski-back .hand-back { background: var(--ski-back) center / cover; }
body.ski-back .packcard.back .pc-back { background: var(--ski-back) center / 100% 100% no-repeat; }
body.ski-frame .card .c-frame { --frame: var(--ski-frame); }
body.ski-frame .card.spell .c-frame { --frame: var(--ski-frameSpell, var(--ski-frame)); }
body.ski-frame .card .c-frame::after { opacity: 0; }
.bubble.talk { cursor: pointer; position: relative; padding-right: 26px; }
.bubble .talk-more { position: absolute; right: 9px; bottom: 6px; font-size: 10px; color: var(--brass-dim); animation: talkBob 1s ease-in-out infinite; }
@keyframes talkBob { 50% { transform: translateY(2px); } }
/* PC: 実績の知らせは右上に(画面中央の吹き出しなどにかぶらないように) */
@media (min-width: 900px) {
  .tpop { left: auto; right: 24px; top: 70px; transform: none; animation-name: tpopInR; }
  .tpop.out { animation-name: tpopOutR; }
}
@keyframes tpopInR { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes tpopOutR { to { opacity: 0; transform: translateX(30px); } }
/* 実績の説明: 「解除条件」と「獲得」の中身の書き出しを縦にそろえる(折り返しても左がそろう) */
.tp-cond, .tp-reward { display: grid; grid-template-columns: 5.2em minmax(0, 1fr); column-gap: 8px; align-items: baseline; }
.tp-cond .tp-lab, .tp-reward .tp-lab { margin-right: 0; text-align: center; padding: 0; }

/* ---- 実績の詳しい表示(一覧の上に重ねる) ---- */
.tp-layer { position: fixed; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center; padding: max(12px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); background: rgba(5, 9, 13, 0.7); overflow-y: auto; touch-action: pan-y; }
.tp-layer .modal.trophy-modal.detail { width: min(100%, 520px); max-height: calc(100dvh - 24px); overflow-y: auto; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.7); }
.tp-layer .from-r { animation: tpFromR 0.22s ease-out both; }
.tp-layer .from-l { animation: tpFromL 0.22s ease-out both; }
@keyframes tpFromR { from { opacity: 0.2; transform: translateX(48px); } to { opacity: 1; transform: none; } }
@keyframes tpFromL { from { opacity: 0.2; transform: translateX(-48px); } to { opacity: 1; transform: none; } }
.tp-nav { display: flex; align-items: center; justify-content: space-between; margin: -4px 0 8px; }
.tp-nav .btn { padding: 4px 14px; }
.tp-nav span { color: var(--ink-dim); font-size: 12px; letter-spacing: 0.08em; }
.tp-swipe { margin-top: 8px; }
.tp-cell.cur { outline: 2px solid var(--target); outline-offset: 2px; }
/* 実績達成の知らせ・発表: 絵の代わりに小さなメダル */
.tpop-ic.medal { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 2px solid #f3d27a; background: radial-gradient(circle at 35% 30%, #ffe9a8, #c8962e 60%, #7a5514); color: #fff8dc; font-size: 20px; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); }
.tpop.has-frame .tpop-ic.medal { left: 8.5%; top: 32.4%; width: 12.9%; height: auto; aspect-ratio: 1; border: 2px solid #f3d27a; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffe9a8, #c8962e 60%, #7a5514); }
.trophy-modal.fresh .tp-name { margin-top: 6px; font-size: 26px; }
.tp-layer { background: rgba(5, 9, 13, 0.42); }
.tp-layer .modal.trophy-modal.detail { background: rgba(12, 20, 26, 0.94); }
.tp-layer .tp-big { width: min(62%, 300px); }
/* 正体が明かされる演出: シルエットと同じ箱に重ねる正体の絵・モザイク・窓の地 */
.ws-crop .rv-in { position: absolute; max-width: none; transform: rotate(-90deg); opacity: 0; transition: opacity 0.5s; pointer-events: none; user-select: none; }
.ws-crop .rv-in.on { opacity: 1; }
.ws-crop .rv-in.now { transition: none; }
.ws-crop .rv-mosaic { position: absolute; left: 0; top: 0; pointer-events: none; }
.rv-back { position: absolute; z-index: 0; background: radial-gradient(80% 80% at 50% 40%, #f3e5c2, #dcc28e); pointer-events: none; }
.wanted.holed .wp-window { background: transparent; box-shadow: none; }
.boon-stage.offer .boon-opts:empty { display: none; }
.boon-stage.offer.reveal-sp.enter .fish-below .fish-art { animation: fishEnterSp 1.8s cubic-bezier(.2,.7,.3,1) both, fishSway 5.5s ease-in-out 1.8s infinite; }

/* ---------- 旅の準備(デッキを1つずつ) ---------- */
.modal.setup-modal { max-width: 620px; }
.sd-stage { display: grid; grid-template-columns: 34px 132px minmax(0, 1fr) 34px; gap: 12px; align-items: center; padding: 6px 0 2px; touch-action: pan-y; }
.sd-arrow { height: 64px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.16); background: rgba(0, 0, 0, 0.25); color: var(--brass); font-size: 14px; cursor: pointer; }
.sd-arrow:hover { border-color: var(--brass); }
.sd-vis { position: relative; width: 132px; aspect-ratio: 5 / 7; }
.sd-vis .sd-back, .sd-vis .sd-face { position: absolute; inset: 0; border-radius: 8px; }
.sd-vis .sd-back { background: url(art/sys/card_back.webp?v=1) center / cover, #2a2016; box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45); }
.sd-vis .sd-back.b3 { transform: translate(10px, 8px) rotate(5deg); opacity: 0.85; }
.sd-vis .sd-back.b2 { transform: translate(5px, 4px) rotate(2.5deg); }
.sd-vis .sd-face { overflow: hidden; border: 2px solid var(--brass); background: radial-gradient(circle at 50% 40%, #3a2f1c, #120e08); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55); display: grid; place-items: center; }
.sd-vis .sd-face img { width: 100%; height: 100%; object-fit: cover; }
.sd-vis.lock .sd-face { border-color: rgba(255, 255, 255, 0.2); background: url(art/sys/card_back.webp?v=1) center / cover; filter: grayscale(0.6) brightness(0.7); }
.sd-q { font-family: var(--f-display); font-size: 48px; color: rgba(255, 255, 255, 0.7); }
.sd-desc { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.sd-count { font-size: 11px; color: var(--ink-dim); letter-spacing: 0.1em; }
.sd-name { font-family: var(--f-display); font-size: 19px; color: var(--brass); line-height: 1.25; }
.sd-desc .sd-tag { align-self: flex-start; }
.sd-desc p { margin: 2px 0 0; font-size: 13px; line-height: 1.55; color: var(--ink); }
.sd-dots { display: flex; justify-content: center; gap: 7px; margin: 8px 0 2px; }
.sd-dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, 0.22); }
.sd-dot.on { background: var(--brass); }
.from-r { animation: sdFromR 0.22s ease-out both; }
.from-l { animation: sdFromL 0.22s ease-out both; }
@keyframes sdFromR { from { opacity: 0.2; transform: translateX(26px); } to { opacity: 1; transform: none; } }
@keyframes sdFromL { from { opacity: 0.2; transform: translateX(-26px); } to { opacity: 1; transform: none; } }
.df-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.df-chip { flex: 1 1 0; min-width: 52px; padding: 8px 0; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.16); background: rgba(0, 0, 0, 0.25); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.df-chip.on { border-color: var(--brass); background: rgba(214, 168, 76, 0.18); color: var(--brass); box-shadow: 0 0 0 1px var(--brass) inset; }
.df-chip.lock { opacity: 0.35; cursor: default; }
.df-desc { margin: 8px 0 0; font-size: 13px; line-height: 1.55; color: var(--ink-dim); min-height: 3.1em; }
.df-desc b { color: var(--ink); margin-right: 4px; }
.df-next { font-size: 12px; color: var(--ink-dim); opacity: 0.85; }
.setup-modal .actions { margin-top: 12px; }
@media (max-width: 520px) {
  .sd-stage { grid-template-columns: 26px 104px minmax(0, 1fr) 26px; gap: 8px; }
  .sd-vis { width: 104px; }
  .sd-arrow { height: 52px; font-size: 12px; }
  .sd-name { font-size: 16px; }
  .sd-desc p { font-size: 12px; line-height: 1.5; }
  .setup-modal h3 { margin: 8px 0 4px; }
}

/* ---------- 記録 ---------- */
.modal.hist-modal { max-width: 560px; }
.hist-list { display: grid; gap: 6px; }
.hist-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; text-align: left; padding: 9px 12px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.14); background: rgba(0, 0, 0, 0.22); color: var(--ink); font: inherit; cursor: pointer; }
.hist-row:hover { border-color: var(--brass); }
.hist-row.clear { border-left: 3px solid var(--brass); }
.hist-row.lose { border-left: 3px solid #b0453a; }
.hist-row.quit { border-left: 3px solid rgba(255, 255, 255, 0.25); }
.hr-date { font-size: 12px; color: var(--ink-dim); white-space: nowrap; }
.hr-main { display: flex; flex-direction: column; min-width: 0; }
.hr-main small { color: var(--ink-dim); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.hr-go { color: var(--brass); font-size: 18px; }
.jr-state.lost { color: #ef6a5b; }
.setup-modal .actions { flex-wrap: wrap; }
.setup-modal .actions .btn { white-space: nowrap; }
.sd-vis .sd-back.b3 { transform: translate(6px, 6px) rotate(4deg); }
.sd-vis .sd-back.b2 { transform: translate(3px, 3px) rotate(2deg); }
.sd-stage { column-gap: 16px; }
@media (max-width: 520px) { .sd-stage { column-gap: 12px; } .setup-modal .actions .btn { padding-inline: 12px; } }

/* ---- 起動直後の「タップしてはじめる」(音を鳴らすための最初のタップ) ---- */
.tap-start { position: fixed; inset: 0; z-index: 400; display: flex; align-items: flex-end; justify-content: center; padding-bottom: max(18vh, calc(env(safe-area-inset-bottom, 0px) + 80px)); background: transparent; cursor: pointer; outline: none; transition: opacity 0.35s; }
.tap-start span { color: #ffe9a8; font-family: 'Dela Gothic One', sans-serif; font-size: clamp(18px, 4.6vw, 26px); letter-spacing: 0.12em; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9), 0 0 18px rgba(214, 168, 76, 0.55); animation: tapBlink 1.6s ease-in-out infinite; }
.tap-start.out { opacity: 0; }
@keyframes tapBlink { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .tap-start span { animation: none; } }
.title-screen .btn { transition: opacity 0.4s; }
body.tap-wait .title-screen .btn { opacity: 0; pointer-events: none; }
/* 手配書: 三剣神は脚を切って、膝の上あたりから下を見せない */
.wanted.pt.wb-swordGods .wp-window { aspect-ratio: 576 / 590; }
.wanted.pt.wb-swordGods .wp-window img { object-position: 50% 0; }
/* 手配書の下の余白(以前の「懸賞金」の行のぶん) */
.wanted .wp-name { margin-bottom: 4px; }

/* ---------- 遊び方(3ページ) ---------- */
.modal.help-modal { max-width: 680px; }
.hp-tabs { flex-wrap: wrap; position: sticky; top: -24px; z-index: 2; background: var(--panel); padding: 6px 0; margin-top: 0; }
.hp-body { display: flex; flex-direction: column; gap: 14px; }
.hp-lead { margin: 0; color: var(--ink-dim); font-size: 13px; line-height: 1.7; }
.hp-sec { border: 1px solid rgba(212, 169, 79, 0.22); border-radius: 8px; padding: 10px 14px 12px; background: rgba(255, 255, 255, 0.02); }
.hp-sec h3 { margin: 0 0 8px; font-size: 14px; }
.hp-sec p { margin: 0; font-size: 13px; line-height: 1.7; }
.hp-note { margin-top: 8px !important; color: var(--ink-dim); font-size: 12px !important; }
.hp-list { margin: 0; padding-left: 1.2em; font-size: 13px; line-height: 1.7; display: flex; flex-direction: column; gap: 4px; }
/* 勝ち負け */
.hp-lp { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hp-lpbox { border-radius: 8px; padding: 8px 10px; text-align: center; display: flex; flex-direction: column; gap: 2px; border: 1px solid; }
.hp-lpbox small { font-size: 11px; color: var(--ink-dim); }
.hp-lpbox b { font-family: var(--f-display); font-size: 28px; font-weight: 400; line-height: 1.1; }
.hp-lpbox span { font-size: 13px; font-weight: 900; }
.hp-lpbox.win { border-color: rgba(111, 207, 142, 0.5); background: rgba(111, 207, 142, 0.08); } .hp-lpbox.win span { color: var(--good); }
.hp-lpbox.lose { border-color: rgba(239, 106, 91, 0.5); background: rgba(239, 106, 91, 0.08); } .hp-lpbox.lose span { color: var(--bad); }
/* ターンの流れ */
.hp-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hp-step { display: flex; flex-direction: column; align-items: center; padding: 6px 10px; border-radius: 8px; background: var(--table-2); border: 1px solid var(--felt-line); min-width: 64px; }
.hp-step b { font-size: 13px; }
.hp-step small { font-size: 10px; color: var(--brass); }
.hp-arrow { color: var(--brass-dim); font-size: 18px; }
/* 召喚・魔法・攻撃は順不同: 点線の囲みにまとめ、「好きな順に」の札を付ける */
.hp-free { position: relative; display: flex; flex-wrap: wrap; gap: 6px; padding: 14px 8px 8px; border: 1px dashed var(--brass); border-radius: 10px; background: rgba(212, 169, 79, 0.06); }
@media (max-width: 520px) { .hp-flow { flex-direction: column; align-items: stretch; } .hp-flow .hp-arrow { transform: rotate(90deg); align-self: center; line-height: 1; } .hp-free { justify-content: center; } }
.hp-free-tag { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); padding: 0 8px; font-size: 10px; font-weight: 900; letter-spacing: 0.08em; color: #1b1408; background: var(--brass); border-radius: 8px; white-space: nowrap; }
/* 生贄 */
.hp-trib { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.hp-trib > div { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 8px; background: var(--table-2); border: 1px solid var(--felt-line); }
.hp-stars { color: var(--target); font-size: 13px; letter-spacing: 0.04em; }
.hp-trib b { font-size: 14px; }
/* 戦闘の計算 */
.hp-fight { display: grid; grid-template-columns: auto auto auto minmax(0, 1fr); align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px dashed rgba(255, 255, 255, 0.08); font-size: 13px; }
.hp-fight:last-of-type { border-bottom: 0; }
.hp-mon { display: inline-block; padding: 3px 8px; border-radius: 5px; font-size: 12px; font-weight: 900; white-space: nowrap; }
.hp-mon.atk { background: rgba(239, 106, 91, 0.16); color: #ffb3a8; border: 1px solid rgba(239, 106, 91, 0.45); }
.hp-mon.def { background: rgba(77, 98, 184, 0.2); color: #b8c6ff; border: 1px solid rgba(77, 98, 184, 0.55); }
.hp-mon.none { background: transparent; color: var(--ink-dim); border: 1px dashed var(--felt-line); font-weight: 400; }
.hp-vs { color: var(--brass); }
.hp-res b { color: var(--target); }
@media (max-width: 520px) { .hp-fight { display: flex; flex-wrap: wrap; gap: 4px 8px; } .hp-res { flex-basis: 100%; padding-left: 2px; } }
/* 違い(よくあるルール / このゲーム) */
.hp-cmp { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px 12px; border-radius: 8px; background: rgba(255, 255, 255, 0.02); border: 1px solid rgba(212, 169, 79, 0.18); }
.hp-cmp h4 { margin: 0; font-size: 13px; color: var(--brass); }
.hp-cmp small { display: block; font-size: 10px; letter-spacing: 0.1em; margin-bottom: 2px; }
.hp-cmp-y { font-size: 12px; color: var(--ink-dim); grid-column: 2; }
.hp-cmp-h { grid-column: 2; }
.hp-cmp h4 { grid-row: 1 / span 2; }
.hp-cmp { row-gap: 2px; }
.hp-cmp-y s { text-decoration-color: rgba(154, 166, 176, 0.6); }
.hp-cmp-y small { color: var(--ink-dim); text-decoration: none; display: block; }
.hp-cmp-h { font-size: 13px; line-height: 1.65; }
.hp-cmp-h small { color: var(--target); }
.hp-cmp-h b { color: #fff3d0; }
@media (max-width: 560px) { .hp-cmp { grid-template-columns: 1fr; gap: 4px; } .hp-cmp h4, .hp-cmp-y, .hp-cmp-h { grid-column: 1; grid-row: auto; } }
.hp-slots { display: flex; gap: 6px; margin-top: 6px; }
.hp-slots i { width: 30px; height: 40px; border-radius: 3px; border: 1px solid var(--brass-dim); background: var(--table-2); display: grid; place-items: center; font-style: normal; font-size: 13px; }
.hp-slots i.add { border-style: dashed; color: var(--brass); background: transparent; }
/* 旅の流れ */
.hp-road { list-style: none; margin: 0 0 8px; padding: 0; display: flex; align-items: center; gap: 0; }
.hp-road li { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; }
.hp-road li::before { content: ''; position: absolute; top: 14px; left: -50%; width: 100%; height: 2px; background: var(--brass-dim); z-index: 0; }
.hp-road li:first-child::before { display: none; }
.hp-road b { position: relative; z-index: 1; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--table-2); border: 1px solid var(--brass); font-size: 12px; }
.hp-road li.boss b { width: 34px; height: 34px; margin-top: -3px; background: #5a1620; border-color: var(--bad); color: #ffd5cf; }
.hp-road small { font-size: 10px; color: var(--bad); margin-top: 2px; white-space: nowrap; }
.hp-gets { display: flex; flex-wrap: wrap; gap: 8px; }
.hp-gets span { display: flex; flex-direction: column; padding: 6px 12px; border-radius: 8px; background: var(--table-2); border: 1px solid var(--felt-line); font-weight: 900; font-size: 13px; }
.hp-gets small { font-weight: 400; font-size: 11px; color: var(--ink-dim); }
.hp-shop { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.hp-shop > div { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 8px; background: var(--table-2); border: 1px solid var(--felt-line); }
.hp-shop b { font-size: 13px; color: var(--brass); }
.hp-shop small { font-size: 11px; color: var(--ink-dim); line-height: 1.5; }
.hp-rar { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.hp-rcard { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.hp-cardbox .card { --cw: 86px; --ch: 122px; pointer-events: none; }
.hp-rcard figcaption { display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.hp-rcard figcaption b { font-size: 13px; }
.hp-rcard figcaption small { font-size: 10px; color: var(--ink-dim); }
@media (max-width: 520px) { .hp-cardbox .card { --cw: 58px; --ch: 82px; } }
.hp-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hp-two > div { padding: 8px 10px; border-radius: 8px; background: var(--table-2); border: 1px solid var(--felt-line); }
.hp-two b { color: var(--brass); font-size: 13px; }
.hp-two p { margin-top: 4px; font-size: 12px; }
@media (max-width: 520px) { .hp-two { grid-template-columns: 1fr; } }

/* ---------- 運命の賭場: ミラーボールの光・説教・スポットライト ---------- */
.disco { position: fixed; inset: 0; z-index: 6; pointer-events: none; overflow: hidden; mix-blend-mode: screen; transition: opacity 0.35s; }
.disco.off { opacity: 0; }
.disco-in { position: absolute; left: 50%; top: 0; width: 170vmax; height: 170vmax; margin-left: -85vmax; margin-top: -85vmax; animation: discoSpin 22s linear infinite; }
.disco-in i { position: absolute; left: var(--x); top: var(--y); width: var(--s); height: var(--s); border-radius: 50%; background: radial-gradient(circle, #fff 0 12%, var(--c) 22% 40%, transparent 72%); opacity: 0.8; filter: blur(0.5px); animation: discoTw 1.8s ease-in-out var(--d) infinite alternate; }
.disco-ball { position: absolute; left: 50%; top: -14px; width: 46px; height: 46px; margin-left: -23px; border-radius: 50%; background: repeating-conic-gradient(from 0deg, #f4f0ff 0 12deg, #8a86a8 12deg 24deg), radial-gradient(circle at 35% 30%, #fff, #777); background-blend-mode: multiply; box-shadow: 0 0 18px rgba(255, 255, 255, 0.7), 0 0 50px rgba(255, 120, 220, 0.45); animation: discoBall 2.4s linear infinite; mix-blend-mode: normal; }
@keyframes discoSpin { to { transform: rotate(360deg); } }
@keyframes discoTw { from { opacity: 0.25; transform: scale(0.7); } to { opacity: 0.95; transform: scale(1.2); } }
@keyframes discoBall { to { filter: hue-rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .disco-in, .disco-in i, .disco-ball { animation: none; } }
.dealer .dl-bubble { white-space: pre-line; cursor: default; }
.dealer .dl-bubble.quiet { visibility: hidden; }
.gamble-opts.talking { }
/* 呆れ・そっぽ(専用の絵がまだないときは、悔しい顔を左右反転して暗く) */
.dealer.mood-fedup .dl-face { box-shadow: 0 0 10px rgba(120, 120, 140, 0.4); }
.dealer.mood-away .dl-face { box-shadow: none; }
.dealer.faux-away .dl-face img { transform: scaleX(-1); filter: grayscale(0.55) brightness(0.65); }
/* 「胴元のオススメ」へのスポットライト */
.gamble-opts.spotlit .gamble-opt:not(.spot) { filter: brightness(0.45) saturate(0.6); transition: filter 0.5s; }
.casino .gamble-opt.spot { z-index: 2; box-shadow: 0 0 0 2px #ffe08a, 0 0 40px 10px rgba(255, 230, 150, 0.55), 0 -60px 80px -20px rgba(255, 245, 200, 0.45); animation: spotOn 0.6s ease-out both; }
@keyframes spotOn { from { box-shadow: 0 0 0 0 transparent; } }
.go-sticker { position: absolute; left: var(--x); top: var(--y); z-index: 3; padding: 2px 8px; border-radius: 4px; background: #ffe14d; color: #c0162f; font-size: 11px; font-weight: 900; white-space: nowrap; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.45); transform: translate(-50%, -50%) rotate(var(--r)); animation: stickerOn 0.25s cubic-bezier(.3, 1.6, .5, 1) calc(var(--k) * 0.09s) both; pointer-events: none; }
@keyframes stickerOn { from { opacity: 0; transform: translate(-50%, -50%) rotate(var(--r)) scale(2.2); } to { opacity: 1; transform: translate(-50%, -50%) rotate(var(--r)) scale(1); } }

.dealer.talk { cursor: pointer; }
.dealer.talk .dl-bubble { padding-right: 26px; }
.dealer .dl-bubble .talk-more { position: absolute; right: 10px; bottom: 6px; font-size: 10px; color: #a2577f; animation: talkBob 1s ease-in-out infinite; }
.dealer .dl-talk.silent .dl-name { visibility: hidden; }

/* 敵の紹介文: 改行をそのまま見せる */
.blurb { white-space: pre-line; }
.modal.intro .blurb.open { display: block; -webkit-line-clamp: unset; overflow: visible; }

/* 実績の知らせ: メダルの代わりに文字。解除条件も出す */
.tpop-ic.tpop-lab { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 6px; background: #1a1430; border: 1px solid rgba(255, 215, 120, 0.5); color: #ffd36b; font-size: 12px; font-weight: 900; line-height: 1.25; text-align: center; letter-spacing: 0.08em; }
.tpop.has-frame .tpop-ic.tpop-lab { background: transparent; border: 0; font-size: clamp(11px, 3.6vw, 14px); }
.tpop-cond { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; font-size: 11px; line-height: 1.35; color: #d8cfb8; }
.tpop.has-frame .tpop-tx small { font-size: 10px; }
.tpop.has-frame .tpop-tx b { font-size: 14px; white-space: nowrap; }

/* 敵の肖像の拡大(スマホで長押し) */
.portrait img { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.pt-zoom { position: fixed; inset: 0; z-index: 500; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px)); background: rgba(4, 7, 10, 0.88); animation: ptZoomIn 0.22s ease-out both; }
.pt-zoom img { max-width: min(92vw, 520px); max-height: 80vh; width: auto; height: auto; border-radius: 10px; border: 2px solid var(--brass); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7); -webkit-touch-callout: none; }
.pt-zoom-hint { color: var(--ink-dim); font-size: 12px; }
.pt-zoom.out { opacity: 0; transition: opacity 0.2s; }
@keyframes ptZoomIn { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: none; } }

/* ---------- チュートリアル: 魚の吹き出し(画面の下か上)と、話題の場所の光 ---------- */
#tut-coach { position: fixed; z-index: 450; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 10px); transform: translateX(-50%); width: min(640px, calc(100vw - 16px)); display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: rgba(22, 12, 34, 0.95); border: 1px solid rgba(255, 158, 224, 0.6); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6); animation: tcIn 0.25s ease-out both; }
#tut-coach.top { bottom: auto; top: calc(env(safe-area-inset-top, 0px) + 8px); }
#tut-coach .tc-face { flex: 0 0 56px; width: 56px; height: 56px; border-radius: 50%; overflow: hidden; border: 2px solid #ff9ee0; background: #2a1440; }
#tut-coach .tc-face img { width: 100%; height: 100%; object-fit: cover; }
#tut-coach .tc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
#tut-coach .tc-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
#tut-coach .tc-head b { color: #ff9ee0; font-size: 13px; }
#tut-coach .tc-head small { color: var(--ink-dim); font-size: 11px; }
#tut-coach .tc-text { margin: 0; font-size: 14.5px; line-height: 1.6; color: #fff7e6; }
#tut-coach .tc-btns { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#tut-coach .tc-sub { margin-left: auto; display: flex; gap: 6px; }
#tut-coach .btn.small { padding: 3px 12px; font-size: 12px; min-height: 0; }
#tut-coach .btn.small.ghost { opacity: 0.8; }
@keyframes tcIn { from { opacity: 0; } }
@media (max-width: 700px) {
  #tut-coach { padding: 8px 10px; gap: 8px; }
  #tut-coach .tc-face { flex-basis: 40px; width: 40px; height: 40px; }
  #tut-coach .tc-text { font-size: 13px; line-height: 1.5; }
}
.tut-focus { outline: 3px solid #ff9ee0 !important; outline-offset: 3px; border-radius: 6px; animation: tutPulse 1.1s ease-in-out infinite; }
@keyframes tutPulse { 50% { outline-color: rgba(255, 158, 224, 0.25); box-shadow: 0 0 22px 6px rgba(255, 158, 224, 0.45); } }
@media (prefers-reduced-motion: reduce) { .tut-focus { animation: none; } }
body.tut-on #stage, body.tut-on #progress, body.tut-on .topbar .gold, body.tut-on .topbar [data-act=deck] { visibility: hidden; }
.dev-btn.armed { border-color: var(--bad); color: #ffd5cf; background: rgba(239, 106, 91, 0.18); }
#tut-coach .tc-fish { display: block; width: 100%; height: 100%; background-repeat: no-repeat; background-size: 270% auto; background-position: 3% 22%; }
/* ---------- 開始前: 盤面の上で引き直す ---------- */
.pre-btns { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }
.pre-btns .btn { white-space: nowrap; }
.hand.mull-pick .card { cursor: pointer; }
.fanslot.mull-on .card { transform: translateY(-14px); filter: brightness(0.6) saturate(0.6); outline: 2px solid var(--bad); outline-offset: 2px; }
.fanslot.mull-on::after { content: '戻す'; position: absolute; left: 50%; top: 4px; transform: translateX(-50%); z-index: 5; padding: 1px 8px; border-radius: 8px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 900; pointer-events: none; }
.fanslot { position: relative; }
.pre-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; width: 100%; }
.pre-wrap .pre-hint { flex: 1 1 auto; min-width: 0; color: #ffe7a6; }
@media (max-width: 700px) {
  .pre-wrap { gap: 4px 8px; }
  .pre-wrap .pre-hint { flex-basis: 50%; font-size: 12px; white-space: normal; }
  .pre-wrap .pre-btns { flex-basis: 100%; justify-content: center; }
  .pre-wrap .pre-btns .btn { padding: 5px 10px; font-size: 12.5px; }
}
/* 開始前: いまが「手札の引き直し」の時間だと大きく見せる */
.pre-wrap .pre-title { flex-basis: 100%; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; padding: 6px 8px; border-radius: 10px; background: linear-gradient(90deg, transparent, rgba(212, 169, 79, 0.18), transparent); }
.pre-wrap .pre-title b { font-family: var(--f-display); font-weight: 400; font-size: clamp(20px, 2.4vw, 28px); color: #ffe08a; letter-spacing: 0.08em; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6); }
.pre-wrap .pre-title .pt-left { font-size: 0.55em; color: var(--ink-dim); letter-spacing: 0; margin-left: 6px; }
.pre-wrap .pre-title small { font-size: 12.5px; color: #e9dfc6; }
.hand.mull-pick .fanslot:not(.mull-on) .card { animation: mullGlow 1.6s ease-in-out infinite; }
@keyframes mullGlow { 50% { box-shadow: 0 0 14px 3px rgba(255, 224, 138, 0.55); } }
@media (prefers-reduced-motion: reduce) { .hand.mull-pick .fanslot .card { animation: none; } }
@media (max-width: 700px) { .pre-wrap .pre-title { padding: 4px 6px; } .pre-wrap .pre-title small { font-size: 11px; } }
.mini-go { flex-shrink: 0; white-space: nowrap; font-family: inherit; margin: 0 4px 0 0; padding: 3px 4px; border-radius: 8px; border: 1px solid var(--brass); background: var(--brass); color: #1b1408; font-weight: 900; font-size: 11px; letter-spacing: -0.03em; }
.mini-go:disabled { opacity: 0.4; }

/* 魔王への変身: 肖像のまわりに禍々しい気配 */
.maou-aura { position: fixed; z-index: 9400; width: 0; height: 0; pointer-events: none; }
.maou-aura .glow { position: absolute; left: 0; top: 0; width: calc(var(--sz) * 3.4); height: calc(var(--sz) * 3.4); margin: calc(var(--sz) * -1.7); border-radius: 50%; background: radial-gradient(circle closest-side, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0) 26%, rgba(200, 30, 100, 0.75) 34%, rgba(90, 0, 120, 0.55) 60%, rgba(20, 0, 30, 0) 100%); animation: maouGlow 2.6s ease-in-out forwards; }
.maou-aura .ring { position: absolute; left: 0; top: 0; width: var(--sz); height: var(--sz); margin: calc(var(--sz) * -0.5); border-radius: 50%; border: 3px solid #c2185b; box-shadow: 0 0 18px #7a1fa2, inset 0 0 14px #7a1fa2; opacity: 0; animation: maouRing 1.3s ease-out infinite; }
.maou-aura .ring.r2 { animation-delay: 0.43s; border-color: #7a1fa2; }
.maou-aura .ring.r3 { animation-delay: 0.86s; border-color: #ff4d6d; }
.maou-aura b { position: absolute; left: 0; top: 0; width: 5px; height: calc(var(--sz) * var(--l)); margin-left: -2.5px; transform-origin: 50% 0; transform: rotate(var(--a)) translateY(calc(var(--sz) * 0.55)); background: linear-gradient(to bottom, rgba(255, 77, 109, 0) 0%, rgba(194, 24, 91, 0.9) 35%, rgba(60, 0, 90, 0.8) 70%, rgba(0, 0, 0, 0) 100%); filter: blur(1.5px); opacity: 0; animation: maouSpike 0.9s ease-in-out infinite; animation-delay: var(--d); }
@keyframes maouGlow { 0% { opacity: 0; transform: scale(0.3); } 25% { opacity: 1; transform: scale(0.9); } 80% { opacity: 1; transform: scale(1.15); } 100% { opacity: 0; transform: scale(1.4); } }
@keyframes maouRing { 0% { opacity: 0.95; transform: scale(1.15); } 100% { opacity: 0; transform: scale(3.2); } }
@keyframes maouSpike { 0%, 100% { opacity: 0; transform: rotate(var(--a)) translateY(calc(var(--sz) * 0.55)) scaleY(0.3); } 50% { opacity: 1; transform: rotate(var(--a)) translateY(calc(var(--sz) * 0.55)) scaleY(1); } }
.portrait.maou-rise { position: relative; z-index: 9450; animation: maouRise 2.6s ease-in-out forwards; }
@keyframes maouRise { 0% { transform: scale(1); filter: brightness(0.4) saturate(0.5); box-shadow: 0 0 0 0 #c2185b; } 20% { transform: scale(1.5) rotate(-2deg); filter: brightness(1.2) saturate(1.4); box-shadow: 0 0 0 3px #c2185b; } 30% { transform: scale(1.45) rotate(2deg); } 40% { transform: scale(1.55) rotate(-1deg); } 85% { transform: scale(1.6); filter: brightness(1.3) saturate(1.5); box-shadow: 0 0 0 3px #ff4d6d; } 100% { transform: scale(1); filter: none; box-shadow: 0 0 0 2px #c2185b; } }
.maou-aura::before { content: ""; position: fixed; inset: 0; background: radial-gradient(circle at var(--x) var(--y), rgba(12, 0, 22, 0) 0, rgba(12, 0, 22, 0) calc(var(--sz) * 0.8), rgba(12, 0, 22, 0.55) calc(var(--sz) * 2.4)); animation: maouDim 2.6s ease-in-out forwards; }
@keyframes maouDim { 0%, 100% { opacity: 0; } 20%, 80% { opacity: 1; } }

/* 引き直しのあいだ: 手札と真ん中以外を暗くして、やることを目立たせる */
body.pre-mull .panel, body.pre-mull .topbar { filter: brightness(0.28) saturate(0.6); }
.side > *, .panel, .topbar { transition: filter 0.3s; }
/* 盤面は暗い幕でおおう。LPなどの情報だけ、幕の上に少し暗くして残す */
body.pre-mull .table { position: relative; }
body.pre-mull .table::after { content: ''; position: absolute; inset: 0; z-index: 3; background: rgba(2, 5, 9, 0.78); pointer-events: none; animation: mullVeil 0.3s ease-out; }
@keyframes mullVeil { from { opacity: 0; } }
body.pre-mull .side > :not(.field) { position: relative; z-index: 4; filter: brightness(0.5) saturate(0.6); }
body.pre-mull #player-side > .hand { z-index: 5; filter: none; }
body.pre-mull #midline { position: relative; z-index: 5; }
/* 選んだカード: すぐに青く光って前に出る(マウスを乗せたままでも) */
body.pre-mull .hand.fan .fanslot.mull-on, body.pre-mull .hand.fan .fanslot.mull-on:hover { transform: translateY(-26px) scale(1.04); z-index: 12; transition: transform 0.16s ease-out; }
body.pre-mull .hand .fanslot .card, body.pre-mull .hand .fanslot .card:hover { transform: none; }
body.pre-mull .hand .fanslot.mull-on .card { filter: none; outline: none; box-shadow: 0 0 0 3px #5ab4ff, 0 0 22px 6px rgba(90, 180, 255, 0.8); }
body.pre-mull .hand .fanslot:not(.mull-on) .card.selected { box-shadow: none; }
body.pre-mull .fanslot.mull-on::after { content: '戻す'; white-space: nowrap; top: -12px; padding: 2px 12px; border-radius: 999px; background: #2f86d6; font-size: 12px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); }
/* 何も選んでいないとき: 指のマークが手札をタップしてみせる */
.mull-finger { position: absolute; left: 50%; top: 42%; z-index: 20; width: 46px; height: 58px; pointer-events: none; animation: mfTap 1.3s ease-in-out infinite; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.6)); }
.mull-finger svg { width: 100%; height: 100%; display: block; }
.mull-finger .mf-ring { position: absolute; left: 14px; top: -6px; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; border: 3px solid #ffe08a; opacity: 0; animation: mfRing 1.3s ease-out infinite; }
@keyframes mfTap { 0%, 100% { transform: translate(-8px, 14px) rotate(-8deg); } 45% { transform: translate(-8px, 0) rotate(-8deg) scale(0.92); } 55% { transform: translate(-8px, 0) rotate(-8deg) scale(0.92); } }
@keyframes mfRing { 0%, 40% { opacity: 0; transform: scale(0.4); } 50% { opacity: 1; transform: scale(0.6); } 100% { opacity: 0; transform: scale(2.4); } }
/* 選んだあとは、引き直しのボタンが光って押す場所を示す */
body.pre-mull .pre-btns [data-act=mull-do] { animation: mullGo 1.2s ease-in-out infinite; }
@keyframes mullGo { 50% { box-shadow: 0 0 0 3px #5ab4ff, 0 0 18px 4px rgba(90, 180, 255, 0.8); } }
@media (prefers-reduced-motion: reduce) { .mull-finger, .mull-finger .mf-ring, body.pre-mull .pre-btns [data-act=mull-do] { animation: none; } }

/* 実績: 未解除のマスに、手に入るもの(カード・紋章)の小さな印 */
.tp-cell .tp-gift { position: absolute; top: 4px; right: 4px; bottom: auto; left: auto; height: auto; width: 22%; max-width: 22px; min-width: 12px; pointer-events: none; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8)); }
.tp-cell .tp-gift.card { aspect-ratio: 20 / 26; } .tp-cell .tp-gift.crest { aspect-ratio: 24 / 26; }
.tp-cell .tp-gift svg { display: block; width: 100%; height: 100%; }
.tp-cell.dark .tp-gift { opacity: 0.75; }

/* 公開版: 開発用のボタンと版の表示を出さない */
html.release .dev-btn, html.release .brand .ver { display: none !important; }

/* 実績の拡大表示: 未解除で、カード・紋章が手に入るもの */
.tp-big { position: relative; }
.tp-big .tp-gift-big { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; aspect-ratio: auto; margin: 0; box-sizing: border-box; border: 0; background: none; box-shadow: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px; text-align: center; }
.tp-gift-big .tgb-ic { width: 22%; max-width: 72px; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.7)); }
.tp-gift-big.card .tgb-ic { aspect-ratio: 20 / 26; } .tp-gift-big.crest .tgb-ic { aspect-ratio: 24 / 26; }
.tp-gift-big .tgb-ic svg { display: block; width: 100%; height: 100%; }
.tp-gift-big p { margin: 0; color: #f3e6c4; font-weight: 700; font-size: 15px; line-height: 1.6; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9); }
.tp-big.sm .tp-gift-big { padding: 10px 6px; } .tp-big.sm .tp-gift-big p { font-size: 12px; letter-spacing: -0.02em; }
