/* ==========================================================================
   VENUS VERSUS ONLINE
   コンセプト: 「明けの明星(Venus)の空」。画面の上は宵、下は暁。
   その境目=地平線で、伏せたカードがぶつかる。
   色はロゴのローズ(Venus)とアズール(Versus)、星のゴールド。
   ========================================================================== */

:root {
  /* 金・紺・赤: 相手の陣は深い紺、自分の陣は少し明るい紺。線と飾りは金、いちばん押すボタンは赤
     (トップと入室前 = 案A「王宮」、ルームの中 = 案B「アールデコ」。このファイルの最後のまとまりを参照) */
  --night: #060c22;
  --night-2: #0a1030;
  --night-line: #2a3670;
  --pearl: #0f1b45;
  --paper: #162257;
  --line: #3a488c;
  --ink: #f6f1e4;
  --ink-soft: #c5cbe6;
  --on-night: #f6f1e4;
  --on-night-soft: #b9c0de;
  /* 赤 = 自分の操作(いちばん押してほしいボタン)。青 = その次。金 = 線・飾り・勝利 */
  --rose: #c0162c;
  --rose-deep: #d92a42;
  --red-bright: #ee5a72;
  --azure: #2f5fb8;
  --azure-deep: #3f72d0;
  --blue-bright: #8db0f7;
  --gold: #c9a24b;
  --gold-bright: #f0d48a;
  --gold-pale: #f3e2a9;
  /* デッキ構築のルールの色: カジュアル = オレンジ、限定構築 = 藤 */
  --casual: #f0913a;
  --limited: #a08cf5;
  --gold-deep: #c9a24b;
  --ok: #4fb894;
  --warn: #d9603f;
  /* 第2段階で作り直す画面が使っている名前 */
  --indigo: var(--night-2);
  --dusk: #3d4078;
  --peach: var(--paper);
  --dawn: var(--pearl);
  --pearl-2: var(--paper);

  /* 属性の色は、カードの印刷の色に合わせる(カード画像から測った値) */
  --el-none: #9b9b9b;
  --el-fire: #e55c20;
  --el-thunder: #93b012;
  --el-water: #4990ca;
  --el-light: #e3b93a;
  --el-dark: #8a1e4a;
  --el-god: #b09566;

  --font-body: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans CJK JP", sans-serif;
  /* 見出し: トップは Shippori Mincho、ルームの中は Zen Old Mincho(body[data-screen="room"] で切り替え)。
     数字と英字: トップは Cinzel、ルームの中は Marcellus。ロゴ(トップ)は Playfair Display の斜体 */
  --font-display: "Shippori Mincho", "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif CJK JP", serif;
  --font-num: "Cinzel", "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --num-weight: 700;
  --font-logo: "Playfair Display", "Shippori Mincho", "Hiragino Mincho ProN", serif;
  --font-latin: var(--font-display);

  --sky: linear-gradient(var(--night), var(--night));
  --radius: 4px;
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--pearl);
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3,
p,
ul,
ol {
  margin: 0;
}
ul,
ol {
  padding: 0;
  list-style: none;
}
button,
input {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
}
img {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
}
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}
.latin {
  font-family: var(--font-latin);
  font-style: italic;
  font-weight: 900;
}

/* ---------- 部品 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  min-height: 44px;
  padding: 0.55em 1.25em;
  border: 2px solid transparent;
  border-radius: 10px;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
  transition: background-color 0.15s, transform 0.1s;
}
.btn:active:not(:disabled) {
  transform: translateY(1px);
}
.btn-lg {
  min-height: 52px;
  padding: 0.7em 1.7em;
  font-size: 1.0625rem;
}
.btn-s {
  min-height: 36px;
  padding: 0.3em 0.9em;
  font-size: 0.875rem;
}
.btn-primary {
  background: var(--rose);
  color: #fff;
  box-shadow: 0 3px 0 var(--rose-deep);
}
.btn-primary:hover:not(:disabled) {
  background: var(--rose-deep);
}
.btn-primary:disabled {
  background: #d9cdd0;
  box-shadow: 0 3px 0 #c4b7bb;
  color: #fff;
}
.btn-azure {
  background: var(--azure);
  color: #fff;
  box-shadow: 0 3px 0 var(--azure-deep);
}
.btn-azure:hover {
  background: var(--azure-deep);
}
.btn-ghost {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}
.btn-ghost:hover {
  background: rgba(29, 24, 51, 0.07);
}
.btn-ghost-light {
  background: rgba(255, 255, 255, 0.5);
  border-color: var(--ink);
  color: var(--ink);
}
.btn-ghost-light:hover {
  background: #fff;
}
.btn-link {
  background: none;
  border: 0;
  padding: 0.3em 0.2em;
  color: var(--azure-deep);
  font-size: 0.8125rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn-mini {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25em 0.9em;
}
.btn-mini:hover {
  background: rgba(255, 255, 255, 0.28);
}

.field {
  display: grid;
  gap: 0.3rem;
}
.field-label {
  font-size: 0.8125rem;
  font-weight: 700;
}
.input {
  width: 100%;
  min-height: 48px;
  padding: 0.5em 0.9em;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: #fff;
  font-size: 1.0625rem;
}
.input::placeholder {
  color: #a39cb3;
}
.input-code {
  font-family: var(--font-latin);
  font-style: italic;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.code {
  font-family: var(--font-latin);
  font-style: italic;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.05em 0.6em;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.6;
  white-space: nowrap;
}
/* カード名が入る長めのチップは折り返してよい */
.chip-wide {
  max-width: 13em;
  white-space: normal;
  text-align: center;
  line-height: 1.35;
  padding: 0.15em 0.7em;
  border-radius: 10px;
}
.chip-gold {
  background: var(--gold);
  border-color: var(--gold);
  color: #3d2c05;
}
.chip-rose {
  background: var(--rose);
  border-color: var(--rose);
  color: #fff;
}
.chip-warn {
  background: var(--warn);
  border-color: var(--warn);
  color: #fff;
}

.panel {
  color: var(--ink);
  background: var(--pearl);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: clamp(1.25rem, 4vw, 2.25rem);
}

.elmark {
  display: inline-grid;
  place-items: center;
  width: 1.9em;
  aspect-ratio: 1;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 700;
  color: #fff;
  flex: none;
}
.elmark.el-none {
  background: var(--el-none);
}
.elmark.el-fire {
  background: var(--el-fire);
}
.elmark.el-thunder {
  background: var(--el-thunder);
}
.elmark.el-water {
  background: var(--el-water);
}
.elmark.el-light {
  background: var(--el-light);
}
.elmark.el-dark {
  background: var(--el-dark);
}
.elmark.el-god {
  background: var(--el-god);
  color: #6b4d0a;
  box-shadow: inset 0 0 0 2px var(--gold);
}

.toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}
.toggle input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.toggle-ui {
  flex: none;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: #cfc6cf;
  position: relative;
  transition: background-color 0.15s;
}
.toggle-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s;
}
.toggle input:checked + .toggle-ui {
  background: var(--rose);
}
.toggle input:checked + .toggle-ui::after {
  transform: translateX(20px);
}
.toggle input:focus-visible + .toggle-ui {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}
.toggle-text {
  display: grid;
  line-height: 1.4;
}
.toggle-text small {
  color: var(--ink-soft);
  font-size: 0.8125rem;
}
.toggle-ro {
  cursor: default;
  opacity: 0.75;
}

/* ---------- カード ---------- */
.card {
  --cw: 120px;
  position: relative;
  width: var(--cw);
  aspect-ratio: 600 / 875;
  border-radius: 5.5% / 3.77%;
  background: #0b0b12;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(10, 8, 30, 0.35);
  flex: none;
  user-select: none;
}
.card > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card[data-act] {
  cursor: pointer;
}
.card-fallback {
  display: none;
}
.card.noimg > img {
  display: none;
}
.card.noimg .card-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 1fr auto;
  padding: 8%;
  color: #fff;
  background: linear-gradient(160deg, #2a2f6b, #141a3c);
  container-type: inline-size;
}
.cf-power {
  font-family: var(--font-latin);
  font-style: italic;
  font-weight: 900;
  font-size: 30cqw;
  line-height: 1;
}
.cf-el {
  justify-self: end;
  font-family: var(--font-display);
  font-size: 18cqw;
}
.cf-rar {
  grid-column: 1 / -1;
  align-self: center;
  justify-self: center;
  font-family: var(--font-latin);
  font-style: italic;
  font-size: 22cqw;
  opacity: 0.5;
}
.cf-name {
  grid-column: 1 / -1;
  font-size: 9cqw;
  line-height: 1.3;
}
.card-back {
  background: radial-gradient(circle at 50% 42%, #3f3486 0%, #1c2152 55%, #0f1330 100%);
  box-shadow: inset 0 0 0 5% #0b0e24, 0 2px 6px rgba(10, 8, 30, 0.35);
}
.card-back::before {
  content: "";
  position: absolute;
  inset: 4.5%;
  border: 1.5px solid var(--gold-deep);
  border-radius: 4% / 2.8%;
}
.card-back-mark {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 44%;
  aspect-ratio: 1;
  background: linear-gradient(135deg, #ff9db8, var(--gold) 50%, #8fc3ff);
  clip-path: polygon(50% 0, 57% 43%, 100% 50%, 57% 57%, 50% 100%, 43% 57%, 0 50%, 43% 43%);
}
.tag {
  position: absolute;
  left: 50%;
  bottom: 6%;
  transform: translateX(-50%);
  padding: 0.1em 0.6em;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: max(0.625rem, calc(var(--cw) * 0.1));
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
  pointer-events: none;
}
.tag + .tag {
  bottom: 24%;
}
.tag-new {
  background: var(--rose);
}
.tag-used {
  background: var(--warn);
}
.tag-dual {
  background: var(--azure);
}
.tag-pend {
  background: var(--gold);
  color: #3d2c05;
}
.tag-veil {
  background: rgba(20, 26, 60, 0.9);
}
.card.pick {
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
@media (hover: hover) {
  .card.pick:hover {
    transform: translateY(-6px);
  }
}
.card.pick.sel {
  transform: translateY(-14px);
  box-shadow: 0 0 0 3px var(--gold), 0 14px 22px rgba(10, 8, 30, 0.4);
}

/* カードの説明 */
.cinfo-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.pw {
  font-family: var(--font-latin);
  font-style: italic;
  font-weight: 900;
  font-size: 2.2rem;
  line-height: 1;
  min-width: 1.1ch;
}
.cinfo-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.35;
}
.cinfo-name,
.sc-name,
.opt-label {
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.cinfo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.6rem 0;
  color: var(--ink-soft);
}
.cinfo-text {
  max-width: 62ch;
}
.cinfo-none {
  color: var(--ink-soft);
}
.cinfo-compact .pw {
  font-size: 1.6rem;
}
.cinfo-compact .cinfo-name {
  font-size: 1rem;
}
.cinfo-compact .cinfo-meta {
  display: none;
}
.cinfo-compact .cinfo-text {
  font-size: 0.875rem;
  line-height: 1.55;
  margin-top: 0.25rem;
}

/* ---------- 入室前 ---------- */
.join {
  min-height: 100dvh;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 1.5rem;
  padding: 2rem 1rem;
}
.join-panel {
  width: min(100%, 460px);
  display: grid;
  gap: 0.8rem;
}
.join-panel h1 {
  font-family: var(--font-display);
  font-size: 1.953rem;
  line-height: 1.3;
}
.join-phase {
  font-weight: 700;
  color: var(--rose-deep);
}
.join-note {
  font-size: 0.875rem;
  color: var(--ink-soft);
}
.join-panel form {
  display: grid;
  gap: 1rem;
  margin-top: 0.5rem;
}
.join-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ---------- ルーム共通 ---------- */
.room {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.room > main {
  flex: 1;
}
.room-light {
  background: linear-gradient(180deg, #f9dccf 0, var(--pearl) 260px);
}
.bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.6rem 1.2rem;
  padding: 0.45rem clamp(0.75rem, 3vw, 1.5rem);
  background: var(--night);
  color: #fff;
}
.bar-room {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}
.bar-room .code {
  font-size: 1.15rem;
}
.bar-phase {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.2rem 0.8rem;
  margin-left: auto;
  font-family: var(--font-display);
  font-weight: 700;
}
.bar-pile,
.bar-conn {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.8;
}
.bar-conn {
  color: var(--gold);
  opacity: 1;
}
.bar-nav {
  display: flex;
  gap: 0.2rem;
}
.bar-room,
.bar-nav button,
.btn-mini {
  white-space: nowrap;
}
.bar-nav button,
.bar-menu {
  background: none;
  border: 0;
  border-radius: 8px;
  padding: 0.35em 0.7em;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
}
.bar-nav button:hover {
  background: rgba(255, 255, 255, 0.14);
}
.bar-menu {
  display: none;
  font-size: 1.4rem;
  line-height: 1;
}

.log {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  width: min(92vw, 380px);
  display: flex;
  flex-direction: column;
  background: var(--pearl);
  color: var(--ink);
  box-shadow: -12px 0 30px rgba(20, 16, 50, 0.25);
  transform: translateX(105%);
  transition: transform 0.22s ease;
  visibility: hidden;
}
.log-open .log {
  transform: none;
  visibility: visible;
}
.log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.6rem 0.6rem 1.2rem;
  border-bottom: 1px solid var(--line);
}
.log-head h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
}
.log ol {
  flex: 1;
  overflow-y: auto;
  padding: 0.8rem 1.2rem 2rem;
  font-size: 0.875rem;
  line-height: 1.6;
}
.log li {
  padding: 0.3rem 0;
  border-bottom: 1px dashed var(--line);
}
.log-battle {
  font-weight: 700;
}
.log-round {
  font-weight: 700;
  color: var(--rose-deep);
}
.log-fx {
  color: var(--azure-deep);
  padding-left: 0.8em !important;
}
.log-sys,
.log-info {
  color: var(--ink-soft);
}

/* ---------- 画面幅ごとの調整(上部バー) ---------- */
@media (max-width: 1100px) {
  .bar {
    flex-wrap: wrap;
  }
  .bar-room-label,
  .logo-bar {
    display: none;
  }
  .bar-menu {
    display: block;
  }
  .bar-nav {
    display: none;
    flex-basis: 100%;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .bar-nav.open {
    display: flex;
  }
}


@media (max-width: 760px) {
  /* 狭い画面: 1段目にルーム番号とボタン類、2段目に進行状況 */
  .bar {
    column-gap: 0.55rem;
    row-gap: 0.15rem;
  }
  .bar-tools {
    order: 2;
    margin-left: auto;
  }
  .bar-phase {
    order: 3;
    flex-basis: 100%;
    margin-left: 0;
  }
  .bar-nav {
    order: 4;
  }
  .bar-phase {
    font-size: 0.875rem;
  }
  .snd-btn {
    width: 34px;
    height: 34px;
  }
  /* 相手が2人以上いるスマホ表示では場のカードがごく小さいので、札は省いて枠線で示す */
  .table[data-n="2"] .opps .bfield .tag,
  .table[data-n="3"] .opps .bfield .tag,
  .table[data-n="4"] .opps .bfield .tag {
    display: none;
  }
}

/* ---------- プレイヤーアイコン ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.av {
  --av: 40px;
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--av);
  height: var(--av);
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--peach), var(--dusk));
  box-shadow:
    0 0 0 2px #fff,
    0 2px 6px rgba(20, 16, 50, 0.25);
  vertical-align: middle;
}
.av img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.av-initial {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: calc(var(--av) * 0.45);
  color: #fff;
}
/* CPU はアズールの輪 */
.av-cpu {
  box-shadow:
    0 0 0 2px var(--azure),
    0 2px 6px rgba(20, 16, 50, 0.25);
}
.av-xs {
  --av: 20px;
  box-shadow: 0 0 0 1.5px #fff;
}
.av-xs.av-cpu {
  box-shadow: 0 0 0 1.5px var(--azure);
}
.av-s {
  --av: 28px;
}
.av-m {
  --av: 40px;
}
.av-l {
  --av: 56px;
}
.av-xl {
  --av: 80px;
}
.chip-cpu {
  background: var(--azure);
  border-color: var(--azure);
  color: #fff;
}

/* トップ・入室前: アイコンと名前 */
.who {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: end;
  gap: 0.8rem;
}
.who-av {
  display: grid;
  justify-items: center;
  gap: 0.2rem;
  padding: 0.2rem;
  border: 0;
  border-radius: 14px;
  background: none;
  cursor: pointer;
}
.who-av:hover .av {
  box-shadow:
    0 0 0 3px var(--rose),
    0 2px 6px rgba(20, 16, 50, 0.25);
}
.who-change {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--azure-deep);
}
.entry-acts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
.entry-acts .btn {
  padding-inline: 0.6em;
}
@media (max-width: 380px) {
  .entry-acts {
    grid-template-columns: 1fr;
  }
}

/* ---------- サウンド ---------- */
.bar-tools {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex: none;
}
.snd-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: #fff;
  cursor: pointer;
}
.snd-btn svg {
  width: 22px;
  height: 22px;
}
.snd-btn:hover,
.snd-btn[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.16);
}
.snd-fab {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  z-index: 30;
  background: rgba(20, 26, 60, 0.55);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.snd-fab:hover,
.snd-fab[aria-expanded="true"] {
  background: rgba(20, 26, 60, 0.8);
}
#layer-sound {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  pointer-events: none;
}
#layer-sound.open {
  display: block;
}
.snd-panel {
  position: absolute;
  top: 56px;
  right: 12px;
  width: min(300px, calc(100vw - 24px));
  padding: 0.85rem 1rem 0.8rem;
  border-radius: var(--radius);
  background: var(--pearl);
  color: var(--ink);
  box-shadow: var(--shadow), 0 0 0 1px var(--line);
  pointer-events: auto;
  animation: rise 0.2s ease both;
}
.snd-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}
.snd-head h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
}
.snd-mute {
  padding: 0.2em 0.85em;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
}
.snd-mute.on {
  border-color: var(--rose);
  background: var(--rose);
  color: #fff;
}
.snd-row {
  display: grid;
  grid-template-columns: 4em 1fr 2.2em;
  align-items: center;
  gap: 0.6rem;
  padding: 0.3rem 0;
}
.snd-label {
  font-size: 0.875rem;
  font-weight: 700;
}
.snd-row input[type="range"] {
  width: 100%;
  margin: 0;
  accent-color: var(--rose);
  cursor: pointer;
}
.snd-row input[data-snd="se"] {
  accent-color: var(--azure);
}
.snd-row input:disabled {
  opacity: 0.4;
  cursor: default;
}
.snd-val {
  text-align: right;
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}
.snd-note {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--ink-soft);
}
.snd-now {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.8125rem;
}
.snd-now p {
  line-height: 1.5;
}
.snd-now-label {
  margin-right: 0.4em;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--rose-deep);
}
.snd-now-by {
  display: block;
  font-size: 0.75rem;
  color: var(--ink-soft);
}
.snd-now .btn-link {
  padding-left: 0;
  font-size: 0.75rem;
}

/* ---------- クレジット ---------- */
.modal-credits {
  width: min(100%, 560px);
}
.credits h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 1.3rem 0 0.4rem;
}
.credits-lead {
  color: var(--ink-soft);
}
.credit-list {
  display: grid;
}
.credit {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.2rem 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
}
.credit-what b {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 700;
}
.credit-what span {
  display: block;
  font-size: 0.75rem;
  color: var(--ink-soft);
}
.credit-who {
  font-weight: 700;
}
.credit-who a {
  margin-left: 0.6em;
  font-size: 0.8125rem;
  color: var(--azure-deep);
  text-underline-offset: 3px;
}
.credits-foot {
  margin-top: 1.4rem;
  font-size: 0.75rem;
  color: var(--ink-soft);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001s !important;
    animation-delay: 0s !important;
    transition-duration: 0.001s !important;
  }
}

/* ================================================================
   デザイン「夜と暁」: 共通の部品・トップ・バトル
   ・相手の陣 = 夜藍、自分の陣 = 暁白。境界は V 字。
   ・赤は「自分の操作」、青はその次の操作、金は「勝利」だけに使う。
   ・数字(パワー・バトル番号・手順)は、カードと同じひし形に入れる。
   ロビー・デッキ構築・演出・一覧などは、このファイルの最後のまとまりにある。
   ================================================================ */

.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--night);
}
.sky .star {
  display: none;
}
.room-sky {
  position: relative;
  color: var(--on-night);
}
.room-light {
  background: var(--pearl);
}
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* ---------- ひし形の数字 ---------- */
.dia {
  --s: 44px;
  position: relative;
  display: inline-grid;
  place-items: center;
  width: var(--s);
  height: var(--s);
  flex: none;
}
.dia::before {
  content: "";
  position: absolute;
  inset: 14.6%;
  transform: rotate(45deg);
  background: var(--ink);
}
.dia > b {
  position: relative;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: calc(var(--s) * 0.44);
  line-height: 1;
  color: var(--pearl);
}
/* 英語の勝敗(Win / Lose / Draw)は、ひし形に収まるよう小さく */
.dia-word > b {
  font-size: max(9px, calc(var(--s) * 0.25));
  letter-spacing: 0.02em;
}
.dia-gold::before {
  background: var(--gold);
}
.dia-gold > b {
  color: var(--night);
}

/* ---------- ロゴ(Venus = 赤、Versus = 青) ---------- */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.32em;
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: -0.01em;
  text-decoration: none;
  transform: skewX(-9deg);
}
.logo-venus {
  color: var(--red-bright);
}
.logo-versus {
  color: var(--blue-bright);
}
.logo-bar,
.logo-s {
  font-size: 1.25rem;
}
.logo-s {
  font-size: 1.75rem;
}
.logo-bar .logo-versus::before,
.logo-s .logo-versus::before {
  content: "";
  display: inline-block;
  width: 0.36em;
  height: 0.36em;
  margin-right: 0.32em;
  vertical-align: 0.16em;
  background: var(--gold);
  transform: rotate(45deg);
}
.logo-hero {
  display: block;
  font-size: clamp(3.3rem, 8vw, 5.9rem);
}
.logo-hero .logo-venus,
.logo-hero .logo-versus {
  display: block;
}
.logo-hero .logo-versus {
  position: relative;
  padding-left: 0.62em;
}
.logo-hero .logo-versus::before {
  content: "";
  position: absolute;
  left: 0.14em;
  top: 0.38em;
  width: 0.28em;
  height: 0.28em;
  background: var(--gold);
  transform: rotate(45deg);
}

/* ---------- 部品 ---------- */
.btn {
  border-radius: 4px;
  letter-spacing: 0.04em;
}
.btn-primary,
.btn-azure {
  box-shadow: none;
}
.btn-primary:disabled {
  background: #c8c5d2;
  box-shadow: none;
}
.btn-ghost {
  border-width: 1.5px;
}
.btn-link {
  color: inherit;
}
.btn-mini {
  border-radius: 3px;
  background: none;
  border-color: var(--night-line);
}
.input {
  border-width: 1.5px;
  border-radius: 4px;
}
.input-code,
.code {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 700;
}
.chip {
  border-radius: 3px;
  line-height: 1.5;
}
.chip-wide {
  border-radius: 3px;
}
.panel {
  border-radius: 6px;
}
.pw,
.latin {
  font-family: var(--font-display);
  font-style: normal;
}

/* ---------- カードの裏・選択 ---------- */
.card {
  border-radius: 4.5% / 3.1%;
  box-shadow: 0 1px 0 rgba(18, 20, 45, 0.25), 0 10px 20px -10px rgba(18, 20, 45, 0.6);
}
/* カードの裏面: 本物のカードの裏(黒地に金の飾り枠とロゴ)の画像 */
.card-back {
  background: #000 url("/img/card-back.webp") center / 100% 100% no-repeat;
  box-shadow: inset 0 0 0 1px rgba(207, 168, 90, 0.35), 0 10px 20px -10px rgba(18, 20, 45, 0.6);
}
.card-back::before,
.card-back-mark {
  display: none;
}
.tag {
  border-radius: 3px;
}
.tag {
  background: var(--night);
  color: var(--on-night);
}
.card.pick.sel {
  box-shadow: 0 0 0 3px var(--red-bright), 0 16px 22px -8px rgba(0, 0, 0, 0.6);
}

/* ---------- トップ ---------- */
.home {
  background: var(--pearl);
}
.hero {
  position: relative;
  overflow: hidden;
}
/* 夜の面。切り口に細い金の線を出すため、影を付ける入れ物と、切り抜く面を分けている */
.hero-bg {
  position: absolute;
  inset: 0;
  filter: drop-shadow(1.5px 0 0 var(--gold));
}
.hero-bg i {
  position: absolute;
  inset: 0;
  background: var(--night);
  clip-path: polygon(0 0, 56% 0, 41% 100%, 0 100%);
}
.hero-in {
  position: relative;
  max-width: 1220px;
  margin: 0 auto;
  min-height: min(100dvh, 760px);
  padding: clamp(1.75rem, 4vw, 3rem) clamp(1rem, 4vw, 2.5rem);
  display: grid;
  grid-template-columns: minmax(0, 470px) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: center;
}
.hero-copy {
  color: var(--on-night);
  display: grid;
  gap: 1.3rem;
}
.logo-sub {
  display: block;
  margin-top: 1em;
  padding-left: 1.3em;
  transform: skewX(9deg);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.42em;
  color: var(--on-night-soft);
}
.lead {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.35rem, 3vw, 1.8rem);
  line-height: 1.5;
  letter-spacing: 0.04em;
  margin-top: 1.1rem;
}
.lead-sub {
  margin-top: 0.4rem;
  max-width: 24em;
  font-size: 0.9375rem;
  color: var(--on-night-soft);
}
.entry {
  display: grid;
  gap: 0.85rem;
  max-width: 410px;
}
.who {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
}
.who .field {
  flex: 1;
  min-width: 0;
}
.who-av {
  position: relative;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  display: grid;
  justify-items: center;
  gap: 0.1rem;
}
.who-change {
  font-size: 0.6875rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.hero .field-label,
.hero .who-change {
  color: var(--on-night-soft);
}
.hero .input {
  background: var(--night-2);
  border-color: var(--night-line);
  color: var(--on-night);
}
.hero .input::placeholder {
  color: #7f81a8;
}
.hero .input:focus-visible {
  border-color: var(--on-night);
}
.entry-acts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
.entry-acts .btn {
  padding-left: 0.6em;
  padding-right: 0.6em;
}
.entry-or {
  margin-top: 0.4rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--night-line);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--on-night-soft);
}
.entry-join {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.6rem;
}
.entry-join .btn {
  background: none;
  border: 1.5px solid var(--on-night);
  color: var(--on-night);
}
.entry-note {
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--on-night-soft);
}

/* 公開の瞬間: 伏せた2枚が同時にめくれる */
.duel {
  --dw: clamp(120px, 17vw, 232px);
  position: relative;
  justify-self: center;
  padding-left: clamp(0px, 9vw, 120px);
  display: grid;
  justify-items: center;
  gap: 1.1rem;
  color: var(--ink);
}
.duel::before {
  /* カードのパワー表示と同じ、ひし形の輪郭 */
  content: "";
  position: absolute;
  left: calc(50% + clamp(0px, 4.5vw, 60px));
  top: 44%;
  width: calc(var(--dw) * 1.85);
  aspect-ratio: 1;
  border: 1px solid var(--line);
  transform: translate(-50%, -50%) rotate(45deg);
}
.duel-pair {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: clamp(14px, 3.4vw, 44px);
}
.duel-side {
  display: grid;
  justify-items: center;
  gap: 0.8rem;
}
.duel-side:first-child .dflip {
  transform: rotate(-3deg);
}
.duel-side:last-child {
  margin-top: 1.75rem;
}
.duel-side:last-child .dflip {
  transform: rotate(3deg);
}
.dflip {
  width: var(--dw);
  perspective: 1200px;
}
.dflip-in {
  position: relative;
  transform-style: preserve-3d;
  animation: dflip 0.7s cubic-bezier(0.3, 0.7, 0.2, 1) 0.55s both;
}
.dflip .card {
  --cw: var(--dw);
  backface-visibility: hidden;
}
.dflip-back {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg);
}
@keyframes dflip {
  /* 左から右へめくれる(手前に来る縁が、左から右へ動く) */
  from {
    transform: rotateY(-180deg);
  }
  to {
    transform: rotateY(0);
  }
}
.duel .dia {
  --s: clamp(46px, 5.4vw, 68px);
  animation: dpop 0.3s ease-out 1.2s both;
}
@keyframes dpop {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
}
.duel-cap {
  position: relative;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.0625rem;
}
.duel .btn-link {
  position: relative;
  color: var(--ink-soft);
}

.home-below {
  max-width: 1220px;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4rem) clamp(1rem, 4vw, 2.5rem) 2.5rem;
  display: grid;
  gap: clamp(2.5rem, 6vw, 4rem);
}
.home-below h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: 0.04em;
}
.movie-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem 1rem;
  margin-bottom: 1.1rem;
}
.movie-out {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--ink);
  text-underline-offset: 3px;
}
.movie-text {
  margin: -0.5rem 0 1rem;
  max-width: 40em;
  color: var(--ink-soft);
}
.movie-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  max-width: 960px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--night);
}
.movie-frame iframe,
.movie-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.movie-cover {
  padding: 0;
  background: var(--night);
  cursor: pointer;
}
.movie-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.2s;
}
.movie-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(56px, 8vw, 80px);
  translate: -50% -50%;
  color: var(--rose);
  transition: scale 0.2s;
}
.movie-play svg {
  display: block;
  width: 100%;
  height: auto;
}
.movie-cover:hover img {
  filter: brightness(0.82);
}
.movie-cover:hover .movie-play {
  scale: 1.08;
}
.movie-frame.is-empty {
  aspect-ratio: auto;
  height: clamp(130px, 18vw, 200px);
  display: grid;
  place-items: center;
}
.movie-empty p {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--on-night-soft);
}
.movie-under {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.8rem;
  margin-top: 0.6rem;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}
.flow h2 {
  margin-bottom: 1.3rem;
}
.flow-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
}
.flow-steps li {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.4rem 0.9rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}
.flow-steps h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
}
.flow-steps p {
  grid-column: 1 / -1;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}
.flow-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.8rem;
}
.foot {
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  display: grid;
  justify-items: center;
  gap: 0.2rem;
  font-size: 0.8125rem;
  color: var(--ink-soft);
  text-align: center;
}
.home-part {
  display: contents;
}

/* ---------- 上部バー ---------- */
.bar {
  border-bottom: 1px solid var(--night-line);
  color: var(--on-night);
}
.bar-nav button,
.bar-menu {
  border-radius: 3px;
  color: var(--on-night);
}
.bar-pile,
.bar-conn {
  opacity: 1;
  color: var(--on-night-soft);
}
.bar-conn {
  color: var(--gold);
}

/* ---------- バトル ---------- */
.room-table {
  background: var(--pearl);
}
.table {
  --slot-w: 72px;
  --slot-h: 100px;
  display: flex;
  flex-direction: column;
}
.opps-edge {
  filter: drop-shadow(0 1.5px 0 var(--gold));
}
.opps {
  background: var(--night);
  color: var(--on-night);
  padding: 0.35rem 0 2.85rem;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 34px), 50% 100%, 0 calc(100% - 34px));
}
.pl {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0.6rem clamp(0.75rem, 3vw, 1.5rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.4rem 1.75rem;
}
.opps .pl + .pl {
  border-top: 1px solid var(--night-line);
}
.pl.off .pl-head {
  opacity: 0.55;
}
.pl.out {
  opacity: 0.45;
}
.pl-head {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}
.pl-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  min-width: 0;
}
.pl-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pl-stats {
  gap: 0.35rem 0.9rem;
  color: var(--on-night-soft);
}
.mine .pl-stats {
  color: var(--ink-soft);
}
.chip-cpu {
  opacity: 0.8;
}
/* ラウンド勝利チップは丸(2026年11月20日、くまねこ堂の指定。バトルの勝ち数のひし形と見分けがつくように)。
   まだ = 金の線の丸、取った = 金で塗った丸(左上が明るいコイン) */
.chips {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 1px;
}
.chips i {
  display: block;
  width: 15px;
  height: 15px;
  border: 1.5px solid var(--gold);
  border-radius: 50%;
}
.chips i.on {
  background: radial-gradient(circle at 34% 30%, var(--gold-pale), var(--gold) 55%, #9d7631);
}
.wins {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 700;
}
.wins-label {
  margin-right: 2px;
}
.wins i {
  display: block;
  width: 16px;
  height: 6px;
  border: 1.5px solid currentColor;
  opacity: 0.55;
}
.wins i.on {
  background: currentColor;
  opacity: 1;
}
.handc {
  display: inline-flex;
  gap: 2px;
}
.handc i {
  display: block;
  width: 8px;
  height: 12px;
  border: 1px solid currentColor;
  border-radius: 1px;
  opacity: 0.8;
}
.pl-side {
  justify-self: start;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-width: 0;
}
.fx {
  padding: 0.12em 0.6em;
  border: 1px solid currentColor;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.5;
}
.fx-plus,
.fx-pend {
  color: var(--gold);
}
.fx-minus {
  color: var(--blue-bright);
}
.fx-warn,
.mine .fx-warn {
  background: var(--rose);
  border-color: var(--rose);
  color: #fff;
}

/* 列 = バトル1〜5。いまのバトルの列に、出したカードを置く */
.bfield {
  display: grid;
  grid-template-columns: repeat(5, var(--slot-w));
  gap: 8px;
}
.slot {
  position: relative;
  height: var(--slot-h);
  display: grid;
  place-items: center;
  border: 1px dashed var(--night-line);
  border-radius: 4px;
}
.mine .slot {
  border-color: var(--line);
}
.slot-no {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--night-line);
}
.mine .slot-no {
  color: var(--line);
}
.slot .card {
  --cw: calc(var(--slot-w) - 10px);
}
.slot-win,
.slot-lose,
.slot-pending,
.slot-alone {
  border-color: transparent;
}
.mine .slot-win,
.mine .slot-lose,
.mine .slot-pending,
.mine .slot-alone {
  border-color: transparent;
}
.slot-win .slot-no,
.slot-lose .slot-no,
.slot-pending .slot-no,
.slot-alone .slot-no,
.slot-now .slot-no {
  display: none;
}
.slot-win .card {
  box-shadow: 0 0 0 2px var(--gold), 0 10px 16px -10px rgba(18, 20, 45, 0.6);
}
.slot-lose .card {
  transform: rotate(90deg) scale(0.78);
  filter: saturate(0.45) brightness(0.78);
}
.slot-pending .card {
  box-shadow: 0 0 0 1.5px var(--gold);
  opacity: 0.85;
}
/* レーン戦: 負けたカードも横に倒さず、暗くしない(場にはパワーを足すため)。相手のいなかったカード(slot-alone)は、そのまま */
.slot-ln.slot-lose .card {
  transform: none;
  filter: none;
}
/* 勝ったバトルの印「WIN」(赤の小さな札) */
.slot-mark {
  position: absolute;
  right: -7px;
  bottom: -6px;
  padding: 2px 5px 1px;
  border-radius: 2px;
  background: var(--rose);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 10px;
  line-height: 1.15;
  letter-spacing: 0.03em;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}
.slot-pw {
  position: absolute;
  left: -5px;
  top: -5px;
  min-width: 20px;
  padding: 0 4px;
  border-radius: 3px;
  background: var(--ink);
  color: var(--night);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 0.8125rem;
  line-height: 20px;
  text-align: center;
}
.slot-now {
  border: 1.5px solid var(--on-night-soft);
}
.mine .slot-now {
  border-color: var(--red-bright);
  background: rgba(232, 88, 122, 0.1);
}
.slot-now.has-card,
.mine .slot-now.has-card {
  border-color: transparent;
  background: none;
}
.spot-text {
  padding: 0 2px;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
  color: var(--on-night-soft);
}
.mine .spot-text {
  color: var(--red-bright);
}
.slot .tag {
  font-size: 0.5625rem;
  padding: 0 0.4em;
  bottom: 4%;
}
.card.placed {
  animation: place 0.26s ease-out;
}
@keyframes place {
  from {
    transform: translateY(-10px);
    opacity: 0;
  }
}
.card.veil > img {
  filter: brightness(0.5) saturate(0.6);
}

.horizon {
  position: relative;
  margin-top: -34px;
  padding: 0 1rem 0.3rem;
  display: grid;
  justify-items: center;
  gap: 0.15rem;
  text-align: center;
}
.horizon:empty {
  display: none;
}
.hz-no {
  display: grid;
  justify-items: center;
}
.hz-no .dia {
  --s: 54px;
}
.hz-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: var(--ink-soft);
}
.hz-msg {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1.5;
}
.hz-flags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.2rem;
}
.flag {
  padding: 0.15em 0.7em;
  border-radius: 3px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 700;
}
.flag-rev {
  border-color: var(--rose);
  background: var(--rose);
  color: #fff;
}
.flag-sd {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--night);
}

.mine {
  flex: 1;
  color: var(--ink);
}
.mine .pl {
  padding-top: 0.5rem;
  padding-bottom: 0.2rem;
}
.hand {
  display: flex;
  justify-content: center;
  gap: clamp(6px, 1.6vw, 16px);
  padding: 1.15rem 0.75rem 1.1rem;
}
.hand .card {
  --cw: clamp(62px, 17vw, 132px);
}
.hand.locked .card {
  filter: saturate(0.6) brightness(0.94);
  cursor: default;
}
.notes {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0.3rem clamp(0.75rem, 3vw, 1.5rem) 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.8rem;
  font-size: 0.8125rem;
}
.notes-label {
  font-weight: 700;
  color: var(--ink-soft);
}
.note {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--paper);
}
.note .card {
  --cw: 30px;
}

/* ---------- 下部の操作欄 ---------- */
.dock {
  position: sticky;
  bottom: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
  padding: 0.7rem clamp(0.75rem, 3vw, 2rem) calc(0.7rem + env(safe-area-inset-bottom));
  background: var(--paper);
  border-top: 1px solid var(--line);
  color: var(--ink);
}
.dock:empty {
  display: none;
}
.dock-info {
  flex: 1 1 320px;
  min-width: 0;
}
.dock-hint {
  font-size: 0.875rem;
  color: var(--ink-soft);
}
.dock-acts {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-left: auto;
}
.toggle-inline {
  margin-top: 0.4rem;
}

/* ---------- 画面の大きさに合わせる ---------- */
@media (min-width: 761px) and (max-height: 860px) {
  .table {
    --slot-w: 62px;
    --slot-h: 86px;
  }
  .table[data-n="2"],
  .table[data-n="3"],
  .table[data-n="4"] {
    --slot-w: 52px;
    --slot-h: 72px;
  }
  .table[data-n="3"],
  .table[data-n="4"] {
    --slot-w: 46px;
    --slot-h: 64px;
  }
  .table[data-n="3"] .pl,
  .table[data-n="4"] .pl {
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
  }
  .table[data-n="3"] .pl-head,
  .table[data-n="4"] .pl-head {
    gap: 0.2rem;
  }
  .table[data-n="3"] .hand .card,
  .table[data-n="4"] .hand .card {
    --cw: clamp(62px, 7.4vw, 100px);
  }
  .table[data-n="1"] .hand .card {
    --cw: clamp(62px, 11vw, 138px);
  }
  .table[data-n="3"] .hz-msg,
  .table[data-n="4"] .hz-msg {
    font-size: 1.0625rem;
  }
  .hand .card {
    --cw: clamp(62px, 9.5vw, 116px);
  }
  .hand {
    padding-top: 0.9rem;
    padding-bottom: 0.8rem;
  }
}
@media (max-width: 900px) {
  .hero-bg {
    filter: drop-shadow(0 1.5px 0 var(--gold));
  }
  .hero-bg i {
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 28px), 50% 100%, 0 calc(100% - 28px));
  }
  .hero-in {
    grid-template-columns: 1fr;
    min-height: 0;
    gap: 1.75rem;
    padding-bottom: 4rem;
  }
  /* スマホでは ロゴ → 公開の瞬間 → 入室フォーム の順に並べる */
  .hero-copy {
    display: contents;
  }
  .hero-head {
    order: 1;
    color: var(--on-night);
  }
  .duel {
    order: 2;
    --dw: clamp(110px, 34vw, 170px);
    padding-left: 0;
    color: var(--on-night);
  }
  .duel::before {
    left: 50%;
    border-color: var(--night-line);
  }
  .duel .btn-link {
    color: var(--on-night-soft);
  }
  .entry {
    order: 3;
    max-width: none;
    color: var(--on-night);
  }
  .flow-steps {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}
@media (max-width: 760px) {
  .table {
    --slot-w: min(62px, calc((100vw - 3rem - 24px) / 5));
    --slot-h: calc(var(--slot-w) * 1.4);
  }
  .table[data-n="3"],
  .table[data-n="4"] {
    --slot-w: min(46px, calc((100vw - 3rem - 24px) / 5));
  }
  .pl {
    grid-template-columns: 1fr;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
  }
  .pl-head {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.5rem;
  }
  .pl-stats {
    justify-content: flex-end;
  }
  .bfield {
    justify-content: center;
    gap: 6px;
  }
  .pl-side {
    justify-self: center;
    justify-content: center;
  }
  .pl-side:empty {
    display: none;
  }
  .slot .card {
    --cw: calc(var(--slot-w) - 8px);
  }
  .opps {
    padding-bottom: 2.6rem;
  }
  .hz-msg {
    font-size: 1.0625rem;
  }
  .table[data-n="2"] .opps,
  .table[data-n="3"] .opps,
  .table[data-n="4"] .opps {
    --slot-w: min(34px, calc((100vw - 11.5rem) / 5));
    --slot-h: calc(var(--slot-w) * 1.4);
  }
  .table[data-n="2"] .mine,
  .table[data-n="3"] .mine,
  .table[data-n="4"] .mine {
    --slot-w: min(52px, calc((100vw - 3rem - 24px) / 5));
    --slot-h: calc(var(--slot-w) * 1.4);
  }
  .table[data-n="2"] .opp,
  .table[data-n="3"] .opp,
  .table[data-n="4"] .opp {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.2rem 0.5rem;
    padding: 0.3rem 0.6rem;
  }
  .table:not([data-n="1"]) .opp .pl-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  .table:not([data-n="1"]) .opp .pl-line {
    flex-wrap: nowrap;
    gap: 0.3rem;
  }
  .table:not([data-n="1"]) .opp .pl-name {
    max-width: 5em;
    font-size: 1rem;
  }
  .table:not([data-n="1"]) .opp .wins,
  .table:not([data-n="1"]) .opp .handc,
  .table:not([data-n="1"]) .opp .chip-cpu {
    display: none;
  }
  .table:not([data-n="1"]) .opp .bfield {
    gap: 4px;
  }
  .table:not([data-n="1"]) .opp .slot .card {
    --cw: calc(var(--slot-w) - 6px);
  }
  .table:not([data-n="1"]) .opp .slot-no {
    font-size: 0.875rem;
  }
  .table:not([data-n="1"]) .opp .slot-mark {
    right: -5px;
    bottom: -4px;
    padding: 1px 3px 0;
    font-size: 8px;
  }
  .table:not([data-n="1"]) .opp .spot-text {
    font-size: 0.5625rem;
    line-height: 1.3;
  }
  .table:not([data-n="1"]) .opp .pl-side {
    grid-column: 1 / -1;
    justify-self: start;
  }
  .hand {
    padding-top: 0.9rem;
  }
  .dock {
    padding-top: 0.5rem;
  }
  .dock-acts {
    width: 100%;
    justify-content: flex-end;
  }
  .dock .btn-lg {
    flex: 1;
  }
}
@media (max-width: 1100px) {
  .logo-bar {
    display: none;
  }
}

/* ================================================================
   夜と暁: ルーム内の各画面・演出・一覧(確定版)
   ・ロビー / デッキ構築 / 結果は、どれも同じ骨組み。
       上 = 夜の帯(いまの状況)。下端は V 字で、先端のひし形が「いまどこか」を示す
       中 = 自分の作業場
       下 = 操作欄(いちばん押してほしいボタンは、いつもここ)
     バトル画面の「相手の陣 → 地平線 → 自分の陣 → 操作欄」と同じ並び。
   ・面は塗り分けず、細い線で区切る。金は「勝利」と「境界」だけ。
   ================================================================ */

/* ---------- 部品の追加 ---------- */
/* ひし形の種類: 線だけ(まだ・負け)、赤(自分)、青(CPU)、警告 */
.dia-line::before {
  background: none;
  box-shadow: inset 0 0 0 1.5px var(--ink-soft);
}
.dia-line > b {
  color: var(--ink-soft);
}
.dia-rose::before {
  background: var(--rose);
}
.dia-azure::before {
  background: var(--azure);
}
.dia-warn::before {
  background: var(--warn);
}
.dia-rose > b,
.dia-azure > b,
.dia-warn > b {
  color: #fff;
}
.input {
  border-color: var(--line);
  background: var(--paper);
  color: var(--ink);
}
.input::placeholder {
  color: #7f81a8;
}
.btn-ghost-light {
  background: transparent;
}
.btn-ghost:hover,
.btn-ghost-light:hover {
  background: var(--paper);
}
.btn-primary:disabled {
  background: #3a3d66;
  color: #8f91b3;
}
.toggle-ui {
  background: #4b4e80;
}
.tag-new {
  background: var(--rose);
  color: #fff;
}
.locked .card {
  filter: saturate(0.75);
}
.panel,
.snd-panel {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--pearl);
  color: var(--ink);
}
/* 入室前(招待リンクから来たとき) */
.join-panel {
  border-top: 1.5px solid var(--gold);
}
.join-panel h1 .code {
  font-size: clamp(2.2rem, 10vw, 3rem);
  font-weight: 900;
  letter-spacing: 0.14em;
}
.join-panel .invite-label {
  margin-bottom: -0.7rem;
  color: var(--ink-soft);
}
.join-phase {
  font-size: 0.875rem;
  color: var(--gold);
}
.snd-mute {
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
}
@keyframes rise {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
}
@keyframes slam {
  from {
    transform: scale(2.2);
    opacity: 0;
  }
}

/* ---------- 夜の帯 ---------- */
.nhead-wrap {
  position: relative;
}
.nhead-edge {
  filter: drop-shadow(0 1.5px 0 var(--gold));
}
.nhead {
  padding: clamp(1.1rem, 3vw, 1.9rem) 0 calc(34px + 1.1rem);
  background: var(--night);
  color: var(--on-night);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 34px), 50% 100%, 0 calc(100% - 34px));
}
.nhead-in {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
}
/* 先端のひし形。バトル画面の地平線(バトル番号)と同じ位置・同じ大きさ */
.nhead-tip {
  position: relative;
  margin-top: -34px;
  display: grid;
  justify-items: center;
  gap: 0.15rem;
  pointer-events: none;
}
.nhead-tip .dia {
  --s: 54px;
}
.nhead-tip-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: var(--ink-soft);
}

/* ---------- ロビー ---------- */
.lobby-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: end;
  gap: 1rem 3rem;
}
.invite-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: var(--on-night-soft);
}
.invite h1 {
  line-height: 1.15;
}
.invite .code {
  font-size: clamp(2.5rem, 9vw, 3.8rem);
  font-weight: 900;
  letter-spacing: 0.14em;
}
.invite-side {
  display: grid;
  justify-items: end;
  gap: 0.7rem;
  text-align: right;
}
.invite-side p {
  max-width: 30em;
  font-size: 0.9375rem;
  color: var(--on-night-soft);
  text-wrap: balance;
}
.lobby-body {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.1rem clamp(1rem, 4vw, 2rem) 2.5rem;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  align-items: start;
  gap: 2rem clamp(1.5rem, 3.5vw, 3rem);
}
.lobby h2 {
  display: flex;
  align-items: baseline;
  gap: 0.8em;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: 1.25rem;
}
.lobby h2 small {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-soft);
}

/* 席: 行を線で区切るだけ。席番号のひし形の色が「誰の席か」を示す */
.seat {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  min-height: 66px;
  padding: 0.6rem 0.25rem;
  border-bottom: 1px solid var(--line);
}
.seat-no {
  --s: 34px;
}
.seat-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
}
.seat-tags {
  display: flex;
  gap: 0.3rem;
  margin-right: auto;
}
.seat-empty {
  color: var(--ink-soft);
}
.seat-empty .seat-name {
  margin-right: auto;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1rem;
}
.seat-off .seat-name {
  opacity: 0.5;
}
.seat-av {
  position: relative;
  display: inline-grid;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
}
button.seat-av {
  cursor: pointer;
}
.seat-av-edit {
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  padding: 0 0.45em;
  border-radius: 3px;
  background: var(--rose);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}
.seat-cpu .seat-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.seat-acts,
.seat > .btn-link,
.seat > .btn,
.seat-add {
  margin-left: auto;
}
.seat-acts {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  flex: none;
}
.seat-add {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}
.seat-add-label {
  margin-right: 0.2rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--blue-bright);
}
.btn-cpu,
.seat-level select {
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
}
.btn-cpu {
  min-height: 32px;
  padding: 0.2em 0.9em;
  background: none;
}
.btn-cpu:hover {
  border-color: var(--blue-bright);
  color: var(--blue-bright);
}
.seat-level select {
  min-height: 32px;
  padding: 0.2em 0.5em;
  background: var(--paper);
}

/* ルール */
.rulebox {
  padding-left: clamp(1.25rem, 2.5vw, 2rem);
  border-left: 1px solid var(--line);
}
.rule-row {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}
.rule-row h3 {
  margin-bottom: 0.6rem;
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}
.setpicks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}
.setpick {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.6rem 0.4rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: none;
  color: var(--ink-soft);
  line-height: 1.4;
  text-align: left;
}
.setpick-art {
  display: block;
  width: 40px;
  height: 56px;
  border-radius: 2px;
  overflow: hidden;
  background: var(--night-2);
}
.setpick-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) brightness(0.55);
}
.setpick-body {
  display: grid;
  min-width: 0;
}
.setpick-no {
  font-size: 0.6875rem;
  font-weight: 700;
}
.setpick-no small {
  margin-left: 0.7em;
  font-size: inherit;
  font-weight: 500;
}
.setpick-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.0625rem;
}
.setpick-meta {
  font-size: 0.6875rem;
}
.setpick-mark {
  width: 11px;
  height: 11px;
  margin-right: 0.35rem;
  transform: rotate(45deg);
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.setpick.on {
  border-color: var(--gold);
  background: var(--paper);
  color: var(--ink);
}
.setpick.on .setpick-art img {
  filter: none;
}
.setpick.on .setpick-mark {
  background: var(--gold);
  box-shadow: none;
}
.setpick:disabled {
  cursor: default;
}
.rule-build {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
}
.seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.seg button {
  min-height: 40px;
  padding: 0.45em 1.2em;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font-weight: 700;
}
.seg button.on {
  background: var(--paper);
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--gold);
}
.seg button:disabled {
  cursor: default;
}
.stepper {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.875rem;
  font-weight: 700;
}
.stepper > span:first-child {
  margin-right: 0.3rem;
}
.stepper .dia {
  --s: 46px;
}
.stepper button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: none;
  color: var(--ink);
  font-weight: 700;
  line-height: 1;
}
.stepper button:hover:not(:disabled) {
  border-color: var(--ink-soft);
}
.stepper button:disabled {
  opacity: 0.35;
}
.rule-help {
  margin-top: 0.6rem;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}
.rule-toggles {
  display: grid;
  gap: 0.8rem;
}
.rule-packs {
  padding-top: 0.9rem;
  font-size: 0.875rem;
  color: var(--ink-soft);
}
.rule-packs b {
  margin: 0 0.15em;
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--ink);
}
.rule-packs.bad {
  color: var(--warn);
  font-weight: 700;
}
.start-wait {
  font-size: 0.875rem;
  color: var(--ink-soft);
}
.dock .start-why {
  color: var(--ink);
}

/* ---------- デッキ構築 ---------- */
.build-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 0.9rem 3rem;
}
.build-title h1 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4.4vw, 2.1rem);
  line-height: 1.25;
}
.build-title p {
  max-width: 44ch;
  margin-top: 0.35rem;
  font-size: 0.9375rem;
  color: var(--on-night-soft);
}
/* 各プレイヤーの進み具合。確定したら金 */
.build-status {
  display: grid;
  gap: 0.1rem;
  min-width: 210px;
}
.build-status li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.2rem 0;
  font-size: 0.875rem;
}
.build-status b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.build-status li > span:last-child {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--on-night-soft);
}
.build-status .ok > span:last-child {
  color: var(--gold);
}
.build-status .ok > span:last-child::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 0.55em;
  vertical-align: 0.08em;
  background: var(--gold);
  transform: rotate(45deg);
}
.build-status .off > span:last-child {
  color: var(--warn);
}
.sd-decks {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.7rem 2rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--night-line);
}
.sd-decks h2 {
  grid-column: 1 / -1;
  font-family: var(--font-display);
  font-size: 1rem;
}
.sd-deck b {
  font-size: 0.875rem;
}
.minis {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.3rem;
}
.minis .card {
  --cw: clamp(44px, 10vw, 62px);
}
.build-body {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 1rem clamp(0.75rem, 3vw, 2rem) 2rem;
  display: grid;
  align-content: start;
  gap: 1.5rem;
}
.build-body > :empty {
  display: none;
}
.build-watch {
  padding: 2rem 0;
  color: var(--ink-soft);
}

/* パックを選ぶ */
.packs {
  display: grid;
  justify-items: center;
  gap: 0.9rem;
  padding-bottom: 1.4rem;
  border-bottom: 1px solid var(--line);
}
.packs-lead {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 0.8em;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
}
.packs-lead b {
  padding: 0.1em 0.7em;
  border: 1px solid var(--gold);
  border-radius: 3px;
  color: var(--gold);
  font-family: var(--font-body);
  font-size: 0.8125rem;
}
.pack-choices {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.1rem 1.6rem;
}
.pack {
  display: grid;
  justify-items: center;
  gap: 0.3rem;
  padding: 0.2rem;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}
.pack-art {
  position: relative;
  display: block;
  width: 120px;
  height: 168px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--night-2);
  /* 上端をギザギザにして、パックの封の形にする */
  clip-path: polygon(0 6%, 6% 0, 12% 6%, 18% 0, 24% 6%, 30% 0, 36% 6%, 42% 0, 48% 6%, 54% 0, 60% 6%, 66% 0, 72% 6%, 78% 0, 84% 6%, 90% 0, 96% 6%, 100% 2%, 100% 100%, 0 100%);
  transition: transform 0.18s ease;
}
.pack-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* 光沢と、切り取り線 */
.pack-art::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0) 35%, rgba(255, 255, 255, 0.28) 50%, rgba(255, 255, 255, 0) 65%);
}
.pack-art::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 11%;
  z-index: 1;
  border-top: 1.5px dashed rgba(255, 255, 255, 0.75);
}
.pack:hover:not(:disabled) .pack-art {
  transform: rotate(-3deg) translateY(-4px);
}
.pack-name {
  display: grid;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 1.3;
  text-align: center;
}
.pack-name small {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  color: var(--ink-soft);
}
.pack-left {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink-soft);
}
.pack:disabled {
  cursor: default;
}
.pack:disabled .pack-art {
  filter: grayscale(1) brightness(0.7);
  opacity: 0.5;
}
.pack:disabled .pack-name {
  color: var(--ink-soft);
}
.pack:disabled .pack-left {
  color: var(--warn);
}

/* デッキと控え */
.zone-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 0.4rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--line);
}
.zone-head h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
}
.zone-head h2 small {
  margin-left: 0.7em;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-soft);
}
.cost {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-size: 0.875rem;
  font-weight: 700;
}
/* コストの目盛り: 上限の数だけ小さなひし形を並べ、使った分を塗る */
.cost-meter {
  display: flex;
  gap: 4px;
}
.cost-meter i {
  width: 7px;
  height: 7px;
  transform: rotate(45deg);
  box-shadow: inset 0 0 0 1px #6a6da0;
}
.cost-meter i.on {
  background: var(--ink);
  box-shadow: none;
}
.cost-meter i.over {
  background: var(--warn);
  box-shadow: none;
}
.cost-num {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35em;
  white-space: nowrap;
}
.cost-num b {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.7rem;
  line-height: 1;
}
.cost.bad .cost-num {
  color: var(--warn);
}
.cost-slots {
  display: inline-flex;
}
.cost-slots .dia {
  --s: 32px;
}
/* スマホ: 限定構築+自由枠のひし形6つが見出しと並ぶと画面より広くなるので、折り返す */
@media (max-width: 520px) {
  .cost {
    flex-wrap: wrap;
    gap: 0.35rem 0.8rem;
    min-width: 0;
  }
}
.deck-row,
.reserve-row {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(0.4rem, 1.4vw, 1rem);
  padding-top: 14px;
}
.deck-row li,
.reserve-row li {
  display: grid;
  justify-items: center;
  gap: 0.25rem;
}
.deck-row .card {
  --cw: clamp(58px, 17vw, 150px);
}
.reserve-row .card {
  --cw: clamp(58px, 15vw, 118px);
}
.cap {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink-soft);
}
.problems {
  margin-top: 0.7rem;
  padding: 0.6rem 0.9rem;
  border-left: 2px solid var(--warn);
  background: rgba(217, 96, 63, 0.14);
  color: #f2ab96;
  font-size: 0.875rem;
  font-weight: 700;
}
.zone-empty {
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

/* ---------- 結果 ---------- */
.ended-head .nhead {
  padding-bottom: calc(34px + 1.9rem);
}
.ended-hero {
  display: grid;
  justify-items: center;
  gap: 0.3rem;
  text-align: center;
}
.ended-sub {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--gold);
}
.ended-av {
  margin: 0.5rem 0 0.3rem;
}
.ended-av .av {
  --av: 96px;
  box-shadow: 0 0 0 2px var(--gold), 0 12px 26px -8px rgba(0, 0, 0, 0.7);
}
.ended-hero h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.2rem, 8vw, 3.6rem);
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.ended-hero h1 span {
  display: block;
  font-size: 0.42em;
  font-weight: 700;
  color: var(--on-night-soft);
}
.ended-body {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
  display: grid;
  justify-items: center;
  gap: 1.4rem;
  text-align: center;
}
.ended-you {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
}
.ended-body .scores {
  width: 100%;
}
.ended-acts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
}

/* ---------- 重ねて出す層(演出・選択・モーダル) ---------- */
#layer-show,
#layer-prompt,
#layer-modal {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  padding: clamp(0.5rem, 3vw, 2rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}
/* 中身が画面より高いときも上端が切れないよう、margin:auto で中央に寄せる */
#layer-show > .show,
#layer-prompt > .show,
#layer-modal > .modal {
  margin: auto;
  flex: none;
}
#layer-show {
  z-index: 60;
}
#layer-prompt {
  z-index: 70;
}
#layer-modal {
  z-index: 80;
}
#layer-show.open,
#layer-prompt.open,
#layer-modal.open {
  display: flex;
}
/* 演出の後ろは、ほぼ見えなくする(次の画面の文字が透けて読めてしまわないように) */
.show-backdrop,
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 9, 24, 0.975);
}
.modal-backdrop {
  background: rgba(8, 9, 24, 0.86);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .show-backdrop {
    background: rgba(8, 9, 24, 0.94);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }
}
.show {
  position: relative;
  width: min(100%, 880px);
  display: grid;
  justify-items: center;
  gap: 0.9rem;
  padding: 0.5rem 0;
  color: var(--ink);
  text-align: center;
}
.show-title {
  display: grid;
  justify-items: center;
  gap: 0.1rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.563rem, 5vw, 2.441rem);
  line-height: 1.2;
}
.show-title small {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
}
.show-title .dia {
  --s: 56px;
}
.show-title .hz-label {
  font-family: var(--font-body);
}
.show-result {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.0625rem, 3.4vw, 1.4rem);
  animation: rise 0.4s ease both;
  animation-delay: calc(1.7s + var(--wait, 0s));
}
.show-result b {
  color: var(--gold);
}
.show-sub {
  max-width: 52ch;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}
.show-round .show-result,
.show-sudden .show-result {
  animation-delay: 0.2s;
}

/* ---------- バトルの公開 ---------- */
/* カードの幅(--scw)は人数で決め、1人ぶんの列もその幅にそろえる。
   名前の長さで列の幅が変わらないので、4人でもスマホの画面に収まる */
.show-cards {
  --scw: clamp(96px, 27vw, 200px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(1.4rem, 6vw, 4.5rem);
  width: 100%;
  padding-top: 0.9rem;
}
.show-cards[data-n="3"] {
  --scw: clamp(84px, 25vw, 180px);
  gap: clamp(0.9rem, 3.2vw, 3rem);
}
.show-cards[data-n="4"] {
  --scw: clamp(64px, 19vw, 160px);
  gap: clamp(0.9rem, 3.2vw, 3rem);
}
.sc {
  display: grid;
  justify-items: center;
  gap: 0.4rem;
  flex: none;
  width: var(--scw);
}
/* 勝ったカードの後ろに落ちる V 字(金の細い縁) */
.sc-main {
  --vx: clamp(8px, 2.4vw, 30px);
  position: relative;
  z-index: 0;
  display: grid;
  justify-items: center;
  gap: 0.45rem;
  padding-bottom: 0.9rem;
}
/* 自分のカードは、となりのカードより手前に重ねる(SP・URの特殊演出が重なっても、自分のカードの演出と勝ち負けの旗が上に見える)。
   ふだんは右に並んだカードほど上に描かれるので、右のカードの大きな演出(ディアボリカの翼など)が左のカードを覆ってしまう */
.sc-me .sc-main {
  z-index: 1;
}
.show-cards[data-n="3"] .sc-main,
.show-cards[data-n="4"] .sc-main {
  --vx: clamp(4px, 1.4vw, 22px);
}
.sc-win .sc-main::before,
.sc-win .sc-main::after {
  content: "";
  position: absolute;
  z-index: -1;
  clip-path: polygon(0 0, 100% 0, 100% 72%, 50% 100%, 0 72%);
  animation: vdrop 0.4s ease-out calc(1.5s + var(--wait, 0s)) both;
}
.sc-win .sc-main::before {
  inset: -12px calc(var(--vx) * -1) 0;
  background: var(--gold);
}
.sc-win .sc-main::after {
  inset: -10.5px calc(1.5px - var(--vx)) 2.5px;
  background: var(--paper);
}
@keyframes vdrop {
  from {
    opacity: 0;
    transform: translateY(-18px);
  }
}
.sc-who {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: calc(100% + 1rem);
  padding: 0 0.7em;
  border-radius: 3px;
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 1.6;
  white-space: nowrap;
  overflow: hidden;
}
.sc-who > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}
.show-cards[data-n="3"] .sc-who,
.show-cards[data-n="4"] .sc-who {
  gap: 0.25rem;
  padding: 0 0.35em;
  font-size: 0.8125rem;
}
/* 自分のカードは名前を赤の札にして示す(高さは他と揃える) */
.sc-me .sc-who {
  background: var(--rose);
}
.show-cards .card {
  --cw: var(--scw);
}
.flipper {
  perspective: 1000px;
}
.flip-in {
  position: relative;
  transform-style: preserve-3d;
  animation: flip 0.7s cubic-bezier(0.3, 0.7, 0.2, 1) both;
  animation-delay: calc(var(--open, 0s) + 0.35s + var(--i, 0) * 0.16s + var(--hold, 0s));
}
.flip-in > .card {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.flip-in > .flip-back {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg);
}
@keyframes flip {
  /* 左から右へめくれる(手前に来る縁が、左から右へ動く) */
  from {
    transform: rotateY(-180deg);
  }
  to {
    transform: rotateY(0);
  }
}
.sc-res {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
}
.sc-power {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  line-height: 1.1;
  animation: rise 0.4s ease both;
  animation-delay: calc(1.15s + var(--wait, 0s));
}
.sc-power .dia {
  --s: clamp(40px, 9vw, 60px);
}
.show-cards[data-n="3"] .sc-res,
.show-cards[data-n="4"] .sc-res {
  gap: clamp(0px, 0.6vw, 0.4rem);
}
.show-cards[data-n="3"] .dia,
.show-cards[data-n="4"] .dia {
  --s: clamp(32px, 8vw, 56px);
}
.sc-power .from {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  opacity: 0.65;
  text-decoration: line-through;
}
.sc-power .arrow {
  font-size: 0.6rem;
  opacity: 0.65;
}
.sc-power.changed .dia::before {
  box-shadow: 0 0 0 2px var(--gold);
}
/* 勝敗: 勝ち = 赤の「WIN」、負け = 青の「LOSE」、引き分け = 緑の「DRAW」 */
.sc-out {
  --out: var(--red-bright);
  --out-glow: rgba(232, 88, 122, 0.65);
  line-height: 1;
  animation: slam 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) both;
  animation-delay: calc(1.5s + var(--wait, 0s));
}
.out-lose {
  --out: var(--blue-bright);
  --out-glow: rgba(120, 164, 244, 0.6);
}
.out-draw {
  --out: #5fd68e;
  --out-glow: rgba(95, 214, 142, 0.6);
}
.out-word {
  display: block;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.9rem, 5.6vw, 3.25rem);
  letter-spacing: 0.06em;
  line-height: 1.05;
  color: var(--out);
  text-shadow: 0 0 2px rgba(255, 255, 255, 0.35), 0 0 18px var(--out-glow), 0 3px 0 rgba(6, 7, 20, 0.85);
  white-space: nowrap;
}
.show-cards[data-n="3"] .out-word,
.show-cards[data-n="4"] .out-word {
  font-size: clamp(1.05rem, 4.2vw, 2.3rem);
  letter-spacing: 0.03em;
}
.sc-win .flip-front,
.pack-cards .rare .flip-front {
  animation: glow 0.5s ease both;
  animation-delay: calc(1.5s + var(--wait, 0s));
}
.sc-lose .flip-front > img {
  animation: dim 0.5s ease both;
  animation-delay: calc(1.5s + var(--wait, 0s));
}
.sc-lose .flipper {
  animation: tilt 0.4s ease calc(1.5s + var(--wait, 0s)) both;
}
.sc-lose:nth-child(even) .flipper {
  --tilt: -3deg;
}
@keyframes glow {
  to {
    box-shadow: 0 0 0 2px var(--gold), 0 18px 30px -10px rgba(0, 0, 0, 0.7);
  }
}
@keyframes dim {
  to {
    filter: saturate(0.4) brightness(0.6);
  }
}
@keyframes tilt {
  to {
    transform: rotate(var(--tilt, 3deg));
  }
}
.sc-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem;
  min-height: 0;
}
.sc-name {
  max-width: min(22ch, 100% + 1.5rem);
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--ink-soft);
}
.show-notes {
  width: min(100%, 560px);
  padding: 0.6rem 1rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--paper);
  font-size: 0.875rem;
  line-height: 1.6;
  text-align: left;
  animation: rise 0.4s ease both;
  animation-delay: calc(1.3s + var(--wait, 0s));
}
.show-notes li + li {
  margin-top: 0.25rem;
  padding-top: 0.25rem;
  border-top: 1px dashed var(--line);
}

/* ---------- ラウンド結果・最終結果の一覧 ---------- */
.scores {
  display: grid;
  width: min(100%, 440px);
  border-top: 1px solid var(--line);
}
.scores li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 58px;
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.scores .pl-name {
  margin-right: auto;
}
/* 勝者の行は、上下の線を金にする */
.scores li.win {
  border-bottom-color: var(--gold);
  box-shadow: 0 -1px 0 var(--gold);
}
.scores li.win .pl-name {
  color: var(--gold);
}
.score-wins {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink-soft);
}
.score-wins .dia {
  --s: 38px;
}
/* いま増えたチップ(効果音と同じ 0.75 秒後に入る) */
.chips i.new {
  animation: chipin 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) 0.75s both;
}
@keyframes chipin {
  from {
    transform: scale(2.8);
    opacity: 0;
  }
}

/* ---------- パック開封 ---------- */
.pack-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 1.5rem;
}
.pack-cards li {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 0.6rem;
  width: min(42vw, 260px);
}
.pack-cards .card {
  --cw: var(--pcw);
}
.pack-cards .cinfo {
  width: 100%;
  text-align: left;
}
/* ---------- パック開封: SR・SP はキランと光る、UR は溜めてから豪華に ----------
   --t0 = めくれ始め。めくれるのに 0.7 秒(半分ほどで表が見える)。
   UR は --hold(0.8 秒)だけ溜めてからめくる(効果音も show.js の UR_HOLD で合わせている)。
   その前に、パックが震えて封が破れる演出が --open(1.5 秒)ある(show.js の PACK_OPEN)。 */
.pack-cards li {
  --t0: calc(var(--open, 0s) + 0.35s + var(--i, 0) * 0.16s + var(--hold, 0s));
  --pcw: clamp(110px, 34vw, 220px);
}
.pack-cards .rare .flipper {
  position: relative;
  isolation: isolate;
}
.pack-cards .rare .flip-front {
  animation: glow 0.5s ease both;
  animation-delay: calc(var(--t0) + 0.45s);
}
/* カードの形に切り抜いた、光の層 */
.fx-clip {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  border-radius: 4.5% / 3.1%;
  pointer-events: none;
}
.fx-clip > i {
  position: absolute;
  inset: 0;
  opacity: 0;
}
/* キラン: 斜めの光の帯が1回走る */
.fx-clip > .glint {
  inset: -10% auto -10% -70%;
  width: 45%;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0) 0%, rgba(255, 249, 225, 0.85) 50%, rgba(255, 255, 255, 0) 100%);
  transform: skewX(-18deg);
  mix-blend-mode: screen;
  animation: glint 0.75s cubic-bezier(0.4, 0, 0.2, 1) both;
  animation-delay: calc(var(--t0) + 0.55s);
}
@keyframes glint {
  0% {
    opacity: 0;
    left: -70%;
  }
  12% {
    opacity: 1;
  }
  88% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    left: 125%;
  }
}
/* 4つの光の点の星。カードの角で「キラン」と瞬く */
.fx-stars {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}
.twinkle {
  position: absolute;
  width: calc(var(--pcw, 200px) * 0.36);
  aspect-ratio: 1;
  translate: -50% -50%;
  background: radial-gradient(circle, #fff 0 10%, #fff3cf 18%, rgba(255, 214, 120, 0.95) 30%, rgba(255, 214, 120, 0) 62%);
  clip-path: polygon(50% 0, 55% 45%, 100% 50%, 55% 55%, 50% 100%, 45% 55%, 0 50%, 45% 45%);
  filter: drop-shadow(0 0 4px #fff) drop-shadow(0 0 10px rgba(255, 214, 120, 0.95));
  opacity: 0;
  transform: scale(0);
  animation: twinkle 0.9s ease-out both;
  animation-delay: calc(var(--t0) + 0.75s + var(--d, 0s));
}
.tw1 {
  left: 86%;
  top: 7%;
}
.tw2 {
  left: 12%;
  top: 72%;
  --d: 0.22s;
  width: calc(var(--pcw, 200px) * 0.22);
}
@keyframes twinkle {
  0% {
    opacity: 0;
    transform: scale(0) rotate(0deg);
  }
  35% {
    opacity: 1;
    transform: scale(1.15) rotate(45deg);
  }
  100% {
    opacity: 0;
    transform: scale(0.2) rotate(110deg);
  }
}

/* UR: 溜め → 白い閃光 → 後ろに金の光の筋が回り続け、虹色の光沢が流れ続ける */
.rare-ur .flipper {
  animation: charge var(--hold) ease-in both, urpop 0.55s cubic-bezier(0.2, 1.5, 0.4, 1) both;
  animation-delay: calc(var(--open, 0s) + 0.35s + var(--i, 0) * 0.16s), calc(var(--t0) + 0.3s);
}
@keyframes charge {
  0% {
    transform: none;
    filter: drop-shadow(0 0 0 rgba(207, 168, 90, 0));
  }
  20% {
    transform: translateX(-2px) rotate(-1deg);
  }
  40% {
    transform: translateX(2px) rotate(1deg);
  }
  60% {
    transform: translateX(-3px) rotate(-1.5deg) scale(1.02);
  }
  80% {
    transform: translateX(3px) rotate(1.5deg) scale(1.03);
  }
  100% {
    transform: scale(1.04);
    filter: drop-shadow(0 0 18px rgba(255, 214, 120, 0.95));
  }
}
@keyframes urpop {
  0% {
    transform: scale(1.04);
  }
  45% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}
.rare-ur .flip-front {
  animation: glow-ur 2.4s ease-in-out infinite;
  animation-delay: calc(var(--t0) + 0.45s);
}
@keyframes glow-ur {
  0%,
  100% {
    box-shadow: 0 0 0 2px var(--gold), 0 0 18px 4px rgba(255, 214, 120, 0.55), 0 18px 30px -10px rgba(0, 0, 0, 0.7);
  }
  50% {
    box-shadow: 0 0 0 2px #f3d48c, 0 0 34px 10px rgba(255, 214, 120, 0.8), 0 18px 30px -10px rgba(0, 0, 0, 0.7);
  }
}
.fx-rays {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: -1;
  width: 230%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 216, 128, 0.55) 0deg 6deg, rgba(255, 216, 128, 0) 6deg 18deg);
  -webkit-mask: radial-gradient(circle, #000 18%, rgba(0, 0, 0, 0.55) 38%, transparent 68%);
  mask: radial-gradient(circle, #000 18%, rgba(0, 0, 0, 0.55) 38%, transparent 68%);
  opacity: 0;
  pointer-events: none;
  animation: rays-in 0.6s ease-out both, rays-spin 14s linear infinite;
  animation-delay: calc(var(--t0) + 0.3s), calc(var(--t0) + 0.3s);
}
@keyframes rays-in {
  from {
    opacity: 0;
    scale: 0.4;
  }
  to {
    opacity: 1;
    scale: 1;
  }
}
@keyframes rays-spin {
  to {
    rotate: 360deg;
  }
}
.flash {
  background: radial-gradient(circle at 50% 45%, #fff 0 35%, rgba(255, 244, 214, 0.85) 60%, rgba(255, 244, 214, 0.4));
  animation: flash 0.6s ease-out both;
  animation-delay: calc(var(--t0) + 0.3s);
}
@keyframes flash {
  0% {
    opacity: 0;
  }
  20% {
    opacity: 0.95;
  }
  100% {
    opacity: 0;
  }
}
.rare-ur .fx-clip > .glint {
  animation-delay: calc(var(--t0) + 0.8s);
}
/* 虹色の光沢(ホロ)が、斜めにゆっくり流れ続ける */
.fx-clip > .holo {
  inset: -50%;
  background: linear-gradient(
    115deg,
    rgba(255, 0, 128, 0) 30%,
    rgba(255, 92, 170, 0.35) 38%,
    rgba(255, 214, 92, 0.38) 44%,
    rgba(120, 255, 170, 0.32) 50%,
    rgba(92, 180, 255, 0.38) 56%,
    rgba(186, 120, 255, 0.32) 62%,
    rgba(255, 0, 128, 0) 70%
  );
  mix-blend-mode: color-dodge;
  animation: holo 2.8s ease-in-out infinite;
  animation-delay: calc(var(--t0) + 1.2s);
}
@keyframes holo {
  0% {
    opacity: 0;
    transform: translate(-30%, -30%);
  }
  15% {
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(30%, 30%);
  }
}
.rare-ur .twinkle {
  animation-iteration-count: 3;
  animation-duration: 1.1s;
  animation-delay: calc(var(--t0) + 0.5s + var(--d, 0s));
}
.rare-ur .tw1 {
  left: 88%;
  top: 6%;
}
.rare-ur .tw2 {
  left: 6%;
  top: 30%;
}
.rare-ur .tw3 {
  left: 96%;
  top: 62%;
  --d: 0.35s;
  width: calc(var(--pcw, 200px) * 0.24);
}
.rare-ur .tw4 {
  left: 20%;
  top: 96%;
  --d: 0.5s;
}
.rare-ur .tw5 {
  left: 50%;
  top: -3%;
  --d: 0.65s;
  width: calc(var(--pcw, 200px) * 0.2);
}
.rare-ur .tw6 {
  left: 70%;
  top: 88%;
  --d: 0.8s;
  width: calc(var(--pcw, 200px) * 0.26);
}
/* 光の筋が画面の外にはみ出さないように(clip: スクロールの箱にしないので、下の「控えに加える」を画面の下に貼りつけられる) */
.show-pack {
  overflow: hidden;
  overflow: clip;
}
/* 「控えに加える」などのボタンは、カードが多くて画面より高いときも画面の下に貼りつけて、いつでも押せるように
   (ルームの画面の .btn-primary の position: relative より強く) */
#layer-show .show-pack > .btn {
  position: sticky;
  bottom: max(0.6rem, env(safe-area-inset-bottom));
  z-index: 5;
}
/* レアカード争奪戦の6枚目(自由枠・カジュアルの、コストを問わない1枚): 最後に並べ、金の点線で囲んで上に金の札 */
.pack-cards li.pk-extra {
  position: relative;
  padding: 0.55rem 0.45rem 0.5rem;
  outline: 1px dashed rgba(240, 212, 138, 0.75);
  outline-offset: 0;
  background: linear-gradient(180deg, rgba(201, 162, 75, 0.12), transparent 55%);
}
.pk-tag {
  justify-self: center;
  padding: 0.1em 0.7em;
  background: var(--gold-bright);
  color: var(--night);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: 0.04em;
  white-space: nowrap;
  animation: rise 0.4s ease both;
  animation-delay: calc(var(--open, 0s) + 0.6s);
}
/* スマホで5枚以上(争奪戦の配り直しなど): 3列に小さく並べ、能力の文は省く(カードを押すと拡大して読める)。
   ボタンまでスクロールしなくても届くように */
@media (max-width: 560px) {
  .pack-cards.many {
    gap: 0.9rem 0.5rem;
  }
  .pack-cards.many li {
    width: calc((100% - 1rem) / 3);
    --pcw: min(27vw, 118px);
    gap: 0.35rem;
  }
  .pack-cards.many li.pk-extra {
    padding: 0.4rem 0.25rem;
  }
  /* 名前だけ(パワーと属性はカードの絵に印刷されている) */
  .pack-cards.many .cinfo-text,
  .pack-cards.many .cinfo-name rt,
  .pack-cards.many .pw,
  .pack-cards.many .elmark {
    display: none;
  }
  .pack-cards.many .cinfo-head {
    justify-content: center;
  }
  .pack-cards.many .cinfo-name {
    font-size: 0.75rem;
    line-height: 1.35;
    text-align: center;
  }
}
@media (prefers-reduced-motion: reduce) {
  .fx-rays {
    opacity: 0.6;
  }
  .fx-clip > i,
  .twinkle {
    display: none;
  }
}

/* ---------- 能力の選択 ---------- */
.show-prompt {
  width: min(100%, 720px);
}
.opts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}
.opts li {
  display: grid;
  justify-items: center;
  gap: 0.2rem;
}
.opt {
  border: 1.5px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
}
.opt:hover {
  border-color: var(--ink-soft);
}
.opt.on {
  border-color: var(--gold);
  background: rgba(207, 168, 90, 0.2);
}
.opt-text {
  min-width: 64px;
  min-height: 52px;
  padding: 0.4em 1.1em;
  font-size: 1.125rem;
}
/* 数字を選ぶとき(宣言など)は、ひし形の数字を並べる */
.opt-num,
.opt-num.on {
  min-width: 0;
  min-height: 0;
  padding: 0.15rem;
  border: 0;
  background: none;
}
.opt-num .dia {
  --s: 62px;
}
.opt-num .dia::before {
  background: none;
  box-shadow: inset 0 0 0 1.5px var(--ink-soft);
}
.opt-num .dia > b {
  color: var(--ink);
}
.opt-num:hover .dia::before {
  box-shadow: inset 0 0 0 1.5px var(--ink);
}
.opt-num.on .dia::before {
  background: var(--gold);
  box-shadow: none;
}
.opt-num.on .dia > b {
  color: var(--night);
}
.opt-card {
  display: grid;
  justify-items: center;
  gap: 0.3rem;
  max-width: 190px;
  padding: 0.5rem;
}
.opt-card .card {
  --cw: clamp(84px, 24vw, 150px);
}
.opts-many .opt-card {
  max-width: 132px;
  padding: 0.35rem;
}
.opts-many .opt-card .card {
  --cw: clamp(64px, 19vw, 104px);
}
/* リオの能力: 開封するパックの弾を選ぶ */
.opt-pack {
  display: grid;
  justify-items: center;
  gap: 0.3rem;
  max-width: 150px;
  padding: 0.5rem 0.5rem 0.6rem;
}
.opt-pack .pack-art {
  width: clamp(64px, 18vw, 110px);
  height: auto;
  aspect-ratio: 5 / 7;
}
.opt-pack:hover .pack-art {
  transform: rotate(-3deg) translateY(-3px);
}
.opt-label {
  font-size: 0.8125rem;
  line-height: 1.35;
}
.opts-many .opt-label {
  font-size: 0.6875rem;
}
.opt-sub {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--ink-soft);
}
.show-prompt .btn-link {
  color: var(--ink-soft);
}
/* 「場を見る」と「決定」。選択肢が多くても画面下に残るようにする */
.prompt-acts {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.6rem 0.8rem;
  width: 100%;
  padding: 1.2rem 0 0.5rem;
  /* 選択肢が多くて重なるときだけ下の選択肢を隠す(上端はぼかして背景になじませる) */
  background: linear-gradient(to bottom, rgba(8, 9, 24, 0), rgba(8, 9, 24, 0.94) 45%);
}
.btn-peek {
  border: 1.5px solid var(--ink-soft);
  background: none;
  color: var(--ink);
}
.btn-peek:hover {
  background: var(--paper);
}
/* たたんだ状態: 下に小さなバーだけ。場はそのまま見える */
#layer-prompt.min {
  inset: auto 0 0 0;
  display: block;
  padding: 0 0.75rem calc(0.6rem + env(safe-area-inset-bottom));
  overflow: visible;
  pointer-events: none;
}
.prompt-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1rem;
  width: min(100%, 600px);
  margin: 0 auto;
  padding: 0.6rem 0.7rem 0.6rem 1.1rem;
  border-radius: 4px;
  background: var(--night);
  color: var(--ink);
  box-shadow: 0 0 0 1px var(--gold), 0 12px 30px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  animation: rise 0.2s ease both;
}
.prompt-bar-text {
  display: grid;
  min-width: 0;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.35;
}
.prompt-bar-text small {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--gold);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.prompt-bar .btn {
  flex: none;
}

/* ---------- モーダル ---------- */
.modal {
  position: relative;
  width: min(100%, 780px);
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  padding: clamp(1.25rem, 4vw, 2.25rem);
  border: 1px solid var(--line);
  border-top: 1.5px solid var(--gold);
  border-radius: 4px;
  background: var(--pearl);
  color: var(--ink);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.modal-wide {
  width: min(100%, 1000px);
}
.modal-x {
  position: sticky;
  float: right;
  top: 0;
  z-index: 2;
  width: 38px;
  height: 38px;
  margin: -0.5rem -0.5rem 0 0.5rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  font-size: 1.3rem;
  line-height: 1;
}
.modal-x:hover {
  border-color: var(--ink-soft);
}
.modal-title {
  margin-bottom: 0.9rem;
  font-family: var(--font-display);
  font-size: 1.563rem;
}

/* カードの拡大 */
.zoom {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  align-items: start;
  gap: 1.75rem;
}
.zoom-art {
  aspect-ratio: 600 / 875;
  border-radius: 4.5% / 3.1%;
  overflow: hidden;
  background: var(--night-2);
  box-shadow: 0 18px 30px -12px rgba(0, 0, 0, 0.7);
}
.zoom-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.zoom-art.noimg img {
  display: none;
}
.zoom-side {
  display: grid;
  justify-items: start;
  gap: 1rem;
  padding-top: 0.5rem;
}

/* カード一覧 */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}
.tab {
  padding: 0.35em 0.95em;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: none;
  color: var(--ink-soft);
  font-size: 0.875rem;
  font-weight: 700;
}
.tab-s {
  font-size: 0.75rem;
}
.tab:hover {
  border-color: var(--ink-soft);
}
.tab.on {
  border-color: var(--gold);
  background: var(--paper);
  color: var(--ink);
}
.gallery-count {
  margin: 0.4rem 0 0.8rem;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 0.6rem;
}
.gallery-grid .card {
  width: 100%;
  --cw: 110px;
}

/* 遊び方 */
.modal-rules {
  width: min(100%, 820px);
}
.rules h3 {
  margin: 1.6rem 0 0.6rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: 1.25rem;
}
.rules-lead {
  font-size: 1.0625rem;
}
.rules ul,
.rules-judge,
.rules-flow {
  display: grid;
  gap: 0.45rem;
}
.rules ul li {
  position: relative;
  padding-left: 1.1em;
}
.rules ul li::before {
  content: "";
  position: absolute;
  left: 0.15em;
  top: 0.72em;
  width: 0.42em;
  height: 0.42em;
  background: var(--ink-soft);
  transform: rotate(45deg);
}
/* 番号つきの手順は、ひし形の数字で */
.rules-flow,
.rules-judge {
  counter-reset: n;
}
.rules-flow li,
.rules-judge li {
  counter-increment: n;
  position: relative;
  padding-left: 2.5em;
}
.rules-flow li::before,
.rules-judge li::before {
  content: "";
  position: absolute;
  left: 0.36em;
  top: 0.32em;
  width: 1.12em;
  height: 1.12em;
  background: var(--ink);
  transform: rotate(45deg);
}
.rules-flow li::after,
.rules-judge li::after {
  content: counter(n);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.84rem;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 0.9375rem;
  line-height: 1.76rem;
  text-align: center;
  color: var(--pearl);
}
.rules-flow b {
  display: block;
  font-family: var(--font-display);
}
.rules-cols {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 1.5rem;
  margin-top: 1rem;
}
.rules-cols p + p {
  margin-top: 0.7rem;
}
.elchart {
  display: grid;
  justify-items: center;
  gap: 0.15rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  font-size: 1.05rem;
}
.elrow {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.elarrow {
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink-soft);
}
.elarrow::after {
  content: "▼";
  display: block;
  font-size: 0.6rem;
  text-align: center;
}
.eleven,
.elbeat {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--ink-soft);
}

/* アイコンを選ぶ */
.iconpick h3 {
  margin: 1.2rem 0 0.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: 1rem;
}
.iconpick-lead {
  font-size: 0.875rem;
  color: var(--ink-soft);
}
.iconpick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 0.4rem;
}
.iconpick-item {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  width: 100%;
  padding: 0.6rem 0.25rem 0.5rem;
  border: 1.5px solid transparent;
  border-radius: 4px;
  background: none;
  color: inherit;
  cursor: pointer;
}
.iconpick-item:hover {
  background: var(--paper);
}
.iconpick-item.on {
  border-color: var(--red-bright);
  background: rgba(232, 88, 122, 0.1);
}
.iconpick-name {
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  overflow-wrap: anywhere;
}
.iconpick-empty {
  display: grid;
  justify-items: start;
  gap: 0.8rem;
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border-left: 2px solid var(--warn);
  background: rgba(217, 96, 63, 0.14);
  color: #f2ab96;
  font-size: 0.9375rem;
  font-weight: 500;
}

/* ---------- お知らせ ---------- */
#layer-toast {
  position: fixed;
  left: 50%;
  top: 64px;
  z-index: 100;
  transform: translateX(-50%);
  display: grid;
  gap: 0.5rem;
  width: min(92vw, 460px);
  pointer-events: none;
}
.toast {
  padding: 0.7rem 1.1rem;
  border-radius: 4px;
  background: var(--ink);
  color: var(--night);
  font-size: 0.9375rem;
  font-weight: 700;
  box-shadow: var(--shadow);
  animation: rise 0.25s ease both;
  transition: opacity 0.4s;
}
.toast-error {
  background: var(--warn);
  color: #fff;
}
.toast.out {
  opacity: 0;
}

/* ---------- 画面の大きさに合わせる(ルーム内の各画面・一覧) ---------- */
@media (max-width: 900px) {
  .lobby-body {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
  .rulebox {
    padding-left: 0;
    border-left: 0;
  }
  .zoom {
    grid-template-columns: 1fr;
  }
  .zoom-art {
    width: min(100%, 300px);
    justify-self: center;
  }
  .rules-cols {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  .lobby-head {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 0.8rem;
    text-align: center;
  }
  .invite-side {
    justify-items: center;
    text-align: center;
  }
  /* minmax(0, 1fr): 中の札(争奪戦の成績など)が縮められず、スマホで画面より広くならないように */
  .build-head {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.7rem;
  }
  .build-status {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem 1.1rem;
    min-width: 0;
  }
  .build-status li {
    display: flex;
    gap: 0.4rem;
  }
  /* パックは4つまで横1列に収める */
  .pack-choices {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 96px);
    align-items: start;
    gap: 0.6rem;
    width: 100%;
  }
  .pack {
    width: 100%;
    padding: 0;
  }
  .pack-art {
    width: 100%;
    height: auto;
    aspect-ratio: 120 / 168;
  }
  .pack-name {
    font-size: 0.75rem;
  }
  .cost-meter {
    display: none;
  }
  /* ロビーの操作欄は、始められるときはボタンだけにして、画面を広く使う */
  .dock-info:has(.start-ok) {
    display: none;
  }
  .opt-num .dia {
    --s: 52px;
  }
}
@media (max-width: 520px) {
  .setpicks {
    grid-template-columns: 1fr;
  }
}
/* 高さの低いパソコンの画面: パックを選ぶ段を少し詰めて、デッキが見えやすいようにする */
@media (min-width: 761px) and (max-height: 860px) {
  .nhead {
    padding-top: 1.1rem;
  }
  .pack-art {
    width: 100px;
    height: 140px;
  }
  .packs {
    gap: 0.7rem;
    padding-bottom: 1rem;
  }
}

/* ---------- マウスを乗せたときのカードの拡大(デッキ構築・バトル) ---------- */
.hover-zoom {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 85;
  width: 300px;
  aspect-ratio: 600 / 875;
  border-radius: 4.5% / 3.1%;
  overflow: hidden;
  background: var(--night-2);
  box-shadow: 0 0 0 1px rgba(207, 168, 90, 0.7), 0 24px 48px -12px rgba(0, 0, 0, 0.85);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.hover-zoom.on {
  opacity: 1;
}
.hover-zoom img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@media (hover: none), (pointer: coarse) {
  .hover-zoom {
    display: none;
  }
}

/* ---------- パック開封の演出: 後光の前でパックが震え、封が破れて光があふれ、カードが飛び出す ----------
   0〜0.35秒 パックが降りてくる / 〜0.95秒 震えながら金色に光る / 0.95秒 上の封が破れて飛ぶ
   1.0秒 光があふれ、光の粒が散る / 1.25秒〜 カードが飛び出し、--open(1.5秒)からめくれ始める */
.pk-area {
  position: relative;
  display: grid;
  justify-items: center;
}
.pk-stage {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  animation: pk-stage-out 0.45s ease-in both;
  animation-delay: calc(var(--open) - 0.2s);
}
@keyframes pk-stage-out {
  to {
    opacity: 0;
    visibility: hidden;
  }
}
.pk-stage > * {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
}
.pk-halo {
  width: min(150vw, 980px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 236, 190, 0.55) 0 8%, rgba(255, 214, 120, 0.18) 24%, transparent 52%),
    repeating-conic-gradient(from 0deg, rgba(255, 216, 128, 0.32) 0deg 4deg, rgba(255, 216, 128, 0) 4deg 15deg);
  -webkit-mask: radial-gradient(circle, #000 12%, rgba(0, 0, 0, 0.5) 30%, transparent 56%);
  mask: radial-gradient(circle, #000 12%, rgba(0, 0, 0, 0.5) 30%, transparent 56%);
  opacity: 0;
  animation: pk-halo-in 1s ease-out both, rays-spin 12s linear infinite;
}
@keyframes pk-halo-in {
  0% {
    opacity: 0;
    scale: 0.5;
  }
  60% {
    opacity: 0.7;
  }
  100% {
    opacity: 1;
    scale: 1;
  }
}
.pk-pack {
  position: relative;
  width: clamp(130px, 34vw, 210px);
  aspect-ratio: 5 / 7;
  animation: pk-drop 0.35s cubic-bezier(0.2, 1.3, 0.4, 1) both, pk-shake 0.6s linear both, pk-away 0.45s ease-in both;
  animation-delay: 0s, 0.35s, 1.05s;
}
@keyframes pk-drop {
  from {
    opacity: 0;
    transform: translateY(-30%) scale(0.8) rotate(-4deg);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes pk-shake {
  0% {
    transform: none;
    filter: drop-shadow(0 0 0 rgba(255, 214, 120, 0));
  }
  15% {
    transform: rotate(-2deg);
  }
  30% {
    transform: rotate(2deg);
  }
  45% {
    transform: rotate(-3deg) scale(1.02);
  }
  60% {
    transform: rotate(3deg) scale(1.03);
  }
  75% {
    transform: rotate(-4deg) scale(1.05);
  }
  90% {
    transform: rotate(4deg) scale(1.06);
  }
  100% {
    transform: scale(1.08);
    filter: drop-shadow(0 0 22px rgba(255, 220, 140, 1));
  }
}
@keyframes pk-away {
  from {
    transform: scale(1.08);
    filter: drop-shadow(0 0 22px rgba(255, 220, 140, 1));
  }
  to {
    opacity: 0;
    transform: translateY(35%) scale(0.85);
    filter: drop-shadow(0 0 0 rgba(255, 220, 140, 0));
  }
}
.pk-body,
.pk-top {
  position: absolute;
  inset: 0;
  border-radius: 4px;
  overflow: hidden;
  background: var(--night-2);
}
.pk-body img,
.pk-top img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* 封(上の 12%)と本体を、ギザギザの切り口で分ける */
.pk-body {
  clip-path: polygon(0 14%, 6% 12%, 12% 14%, 18% 12%, 24% 14%, 30% 12%, 36% 14%, 42% 12%, 48% 14%, 54% 12%, 60% 14%, 66% 12%, 72% 14%, 78% 12%, 84% 14%, 90% 12%, 96% 14%, 100% 12%, 100% 100%, 0 100%);
}
.pk-top {
  clip-path: polygon(0 0, 100% 0, 100% 12%, 96% 14%, 90% 12%, 84% 14%, 78% 12%, 72% 14%, 66% 12%, 60% 14%, 54% 12%, 48% 14%, 42% 12%, 36% 14%, 30% 12%, 24% 14%, 18% 12%, 12% 14%, 6% 12%, 0 14%);
  transform-origin: 85% 10%;
  animation: pk-tear 0.55s cubic-bezier(0.3, 0, 0.6, 1) both;
  animation-delay: 0.95s;
}
@keyframes pk-tear {
  from {
    transform: none;
  }
  to {
    opacity: 0;
    transform: translate(28%, -70%) rotate(24deg);
  }
}
/* 封の切り口からあふれる光 */
.pk-burst {
  width: clamp(130px, 34vw, 210px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0 18%, rgba(255, 240, 200, 0.9) 32%, rgba(255, 214, 120, 0.45) 50%, transparent 70%);
  opacity: 0;
  transform: translateY(-60%) scale(0.2);
  animation: pk-burst 0.8s ease-out both;
  animation-delay: 1s;
}
@keyframes pk-burst {
  0% {
    opacity: 0;
    transform: translateY(-60%) scale(0.2);
  }
  25% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-30%) scale(3.2);
  }
}
.pk-sparks {
  width: 0;
  height: 0;
  transform: translateY(-80px);
}
.pk-sparks i {
  position: absolute;
  left: -4px;
  top: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff6dc;
  box-shadow: 0 0 8px 3px rgba(255, 214, 120, 0.9);
  opacity: 0;
  transform: rotate(var(--a)) translateY(0);
  animation: pk-spark 0.9s cubic-bezier(0.1, 0.7, 0.3, 1) both;
  animation-delay: 1.02s;
}
@keyframes pk-spark {
  0% {
    opacity: 0;
    transform: rotate(var(--a)) translateY(0) scale(1.2);
  }
  12% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: rotate(var(--a)) translateY(calc(-170px * var(--r))) scale(0.4);
  }
}
/* カードはパックから飛び出してきて、並んでからめくれる */
.show-pack .pack-cards li {
  animation: pk-card-out 0.6s cubic-bezier(0.2, 1.25, 0.35, 1) both;
  animation-delay: calc(var(--open) - 0.3s + var(--i, 0) * 0.08s);
}
@keyframes pk-card-out {
  from {
    opacity: 0;
    transform: translateY(-14%) scale(0.35);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.show-pack .pack-cards .cinfo,
.show-pack > .btn {
  animation: rise 0.4s ease both;
  animation-delay: calc(var(--open) + 0.9s);
}
.show-pack .show-title {
  animation: rise 0.4s ease both;
  animation-delay: calc(var(--open) - 0.2s);
}
@media (prefers-reduced-motion: reduce) {
  .pk-stage {
    display: none;
  }
}

/* ---------- デッキ構築のルールの色分け(カジュアル = オレンジ、限定構築 = 藤) ---------- */
.seg-rule button {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
}
.seg-rule button::before {
  content: "";
  width: 8px;
  height: 8px;
  transform: rotate(45deg);
  box-shadow: inset 0 0 0 1.5px var(--rc);
}
.seg-casual {
  --rc: var(--casual);
}
.seg-limited {
  --rc: var(--limited);
}
.seg-rule button.on {
  background: color-mix(in srgb, var(--rc) 16%, var(--paper));
  color: var(--ink);
  box-shadow: inset 0 -3px 0 var(--rc);
}
.seg-rule button.on::before {
  background: var(--rc);
}
.rule-casual .rule-help,
.rule-limited .rule-help {
  padding-left: 0.7em;
  border-left: 3px solid var(--casual);
}
.rule-limited .rule-help {
  border-left-color: var(--limited);
}
.rule-casual .stepper .dia::before {
  background: var(--casual);
}
.rule-casual .stepper .dia > b {
  color: var(--night);
}
/* デッキ構築画面の札 */
.rule-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 0.55em;
  margin-bottom: 0.45rem;
  padding: 0.2em 0.75em 0.2em 0.6em;
  border-radius: 3px;
  border: 1px solid var(--rc);
  background: color-mix(in srgb, var(--rc) 18%, transparent);
  color: var(--rc);
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.5;
}
.rule-badge::before {
  content: "";
  align-self: center;
  width: 7px;
  height: 7px;
  transform: rotate(45deg);
  background: var(--rc);
}
.rule-badge small {
  color: var(--on-night-soft);
  font-size: 0.75rem;
  font-weight: 500;
}
.rule-badge.rule-casual {
  --rc: var(--casual);
}
.rule-badge.rule-limited {
  --rc: var(--limited);
}
/* コストの表示もルールの色で(超えた分は、オレンジと見分けられるよう赤) */
.cost-casual .cost-meter i.on {
  background: var(--casual);
}
.cost-casual .cost-meter i.over {
  background: var(--red-bright);
}
.cost-casual.bad .cost-num {
  color: var(--red-bright);
}
.cost-limited .cost-slots .dia:not(.dia-line):not(.dia-warn)::before {
  background: var(--limited);
}
.cost-limited .cost-slots .dia:not(.dia-line):not(.dia-warn) > b {
  color: var(--night);
}

/* ---------- バトルの公開: 能力が働いたカード ----------
   めくれたあと(1.0秒〜、パワーが変わる 1.15秒の直前)に、属性の色の光の輪が広がり、
   カードの縁が光り、上に「能力発動」の札が出る(札はそのまま残る)。 */
.sc[data-el="none"] {
  --fxc: #e6e6f2;
}
.sc[data-el="fire"] {
  --fxc: #ff8a4a;
}
.sc[data-el="thunder"] {
  --fxc: #c8ea4c;
}
.sc[data-el="water"] {
  --fxc: #72c4ff;
}
.sc[data-el="light"] {
  --fxc: #ffd76a;
}
.sc[data-el="dark"] {
  --fxc: #ef62ad;
}
.sc[data-el="god"] {
  --fxc: #f3dca4;
}
.sc-fx .flipper {
  position: relative;
  --fx-t: calc(1s + var(--wait, 0s) + var(--i, 0) * 0.08s);
}
.fx-aura {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: 4.5% / 3.1%;
  pointer-events: none;
  box-shadow: 0 0 0 2px var(--fxc), 0 0 22px 6px var(--fxc);
  opacity: 0;
  animation: fx-aura 1.6s ease-out both;
  animation-delay: var(--fx-t);
}
@keyframes fx-aura {
  0% {
    opacity: 0;
    transform: scale(1.12);
  }
  18% {
    opacity: 1;
    transform: scale(1);
  }
  60% {
    opacity: 0.85;
  }
  100% {
    opacity: 0.45;
  }
}
.fx-ring {
  position: absolute;
  left: 50%;
  top: 46%;
  z-index: 3;
  width: 120%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  pointer-events: none;
  background: repeating-conic-gradient(from 0deg, var(--fxc) 0deg 5deg, transparent 5deg 15deg);
  -webkit-mask: radial-gradient(circle, transparent 54%, #000 56% 62%, transparent 64%);
  mask: radial-gradient(circle, transparent 54%, #000 56% 62%, transparent 64%);
  filter: drop-shadow(0 0 6px var(--fxc));
  opacity: 0;
  animation: fx-ring 0.85s cubic-bezier(0.2, 0.7, 0.3, 1) both;
  animation-delay: var(--fx-t);
}
@keyframes fx-ring {
  0% {
    opacity: 0;
    transform: scale(0.35) rotate(0deg);
  }
  25% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(1.35) rotate(90deg);
  }
}
.fx-badge {
  position: absolute;
  left: 50%;
  top: 3%;
  z-index: 4;
  translate: -50% 0;
  padding: 0.15em 0.7em;
  border-radius: 2px;
  background: linear-gradient(180deg, #2a2350, var(--night));
  box-shadow: 0 0 0 1px var(--fxc), 0 0 12px -2px var(--fxc), 0 4px 10px rgba(0, 0, 0, 0.5);
  color: var(--fxc);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(0.625rem, 1.6vw, 0.8125rem);
  letter-spacing: 0.08em;
  white-space: nowrap;
  pointer-events: none;
  animation: fx-badge 0.45s cubic-bezier(0.2, 1.5, 0.4, 1) both;
  animation-delay: var(--fx-t);
}
@keyframes fx-badge {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.6);
  }
}
.show-cards[data-n="4"] .fx-badge {
  font-size: clamp(0.5625rem, 2.2vw, 0.75rem);
  padding: 0.12em 0.45em;
  letter-spacing: 0.02em;
}
@media (prefers-reduced-motion: reduce) {
  .fx-ring {
    display: none;
  }
}

/* ---------- トップの「公開の瞬間」 ----------
   2枚のカードが左右から場に出され(0〜0.5秒)、同時にめくれる → 金のひし形のパワーが出る。
   光り方はデッキ構築などと同じ(SR以上は常にキラキラ。.card.shiny)。 */
.dflip {
  animation: dplay 0.5s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
.duel-side:first-child .dflip {
  --from-x: -70px;
  --from-r: -14deg;
}
.duel-side:last-child .dflip {
  --from-x: 70px;
  --from-r: 14deg;
}
@keyframes dplay {
  from {
    opacity: 0;
    translate: var(--from-x, 0) 26px;
    rotate: var(--from-r, 0deg);
    scale: 1.08;
  }
  to {
    opacity: 1;
    translate: 0 0;
    rotate: 0deg;
    scale: 1;
  }
}
/* 後ろの大きなひし形の輪郭も金に */
.duel::before {
  border-color: rgba(207, 168, 90, 0.55);
  box-shadow: 0 0 40px -6px rgba(207, 168, 90, 0.35), inset 0 0 40px -6px rgba(207, 168, 90, 0.25);
}

/* 金のひし形(トップのパワーと「1ゲームの流れ」の番号) */
.duel .dia::before,
.flow-steps .dia::before {
  background: linear-gradient(135deg, #fbefc4 0%, #e6c77a 28%, #cfa85a 55%, #9d7631 100%);
  box-shadow: 0 0 0 1px rgba(255, 240, 200, 0.6), 0 0 18px rgba(255, 214, 120, 0.55), inset 0 0 0 2px rgba(255, 255, 255, 0.25);
}
.duel .dia > b,
.flow-steps .dia > b {
  color: var(--night);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}
.duel .dia {
  animation: dpop-lux 0.5s cubic-bezier(0.2, 1.5, 0.4, 1) 1.2s both;
}
@keyframes dpop-lux {
  from {
    opacity: 0;
    transform: scale(0.4) rotate(-45deg);
  }
}
/* ひし形に光がひと筋走る */
.duel .dia::after,
.flow-steps .dia::after {
  content: "";
  position: absolute;
  inset: 14.6%;
  transform: rotate(45deg);
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.75) 50%, transparent 65%) no-repeat;
  background-size: 250% 100%;
  background-position: 120% 0;
  animation: dia-shine 3.2s ease-in-out 1.7s infinite;
  pointer-events: none;
}
.flow-steps .dia::after {
  animation-delay: calc(0.6s + var(--n, 0) * 0.4s);
}
@keyframes dia-shine {
  0% {
    background-position: 120% 0;
  }
  35%,
  100% {
    background-position: -120% 0;
  }
}
.flow-steps li:nth-child(2) {
  --n: 1;
}
.flow-steps li:nth-child(3) {
  --n: 2;
}
.flow-steps li {
  border-top-color: rgba(207, 168, 90, 0.45);
}
@media (prefers-reduced-motion: reduce) {
  .duel .dia::after,
  .flow-steps .dia::after {
    display: none;
  }
}

/* ---------- SR以上(SR・UR・SP)のカードは常にキラキラ ----------
   斜めの光の帯がときどき走り(4.2秒ごと)、角で星が瞬く。UR は光の帯が虹色。
   カードごとに --sd(負の遅れ)でタイミングをずらしている(cards.js)。 */
.card.shiny::before,
.card.shiny::after {
  content: "";
  position: absolute;
  z-index: 1;
  pointer-events: none;
}
.card.shiny::before {
  top: -15%;
  bottom: -15%;
  left: 0;
  width: 42%;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0) 0%, rgba(255, 248, 222, 0.5) 45%, rgba(255, 255, 255, 0.7) 50%, rgba(255, 248, 222, 0.5) 55%, rgba(255, 255, 255, 0) 100%);
  opacity: 0;
  transform: translateX(-230%) skewX(-18deg);
  animation: card-sheen 4.2s ease-in-out infinite;
  animation-delay: var(--sd, 0s);
}
.card.rar-UR::before {
  width: 55%;
  background: linear-gradient(
    100deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 110, 180, 0.32) 25%,
    rgba(255, 226, 120, 0.42) 40%,
    rgba(255, 255, 255, 0.6) 50%,
    rgba(120, 255, 190, 0.38) 60%,
    rgba(110, 180, 255, 0.36) 75%,
    rgba(255, 255, 255, 0) 100%
  );
}
@keyframes card-sheen {
  0% {
    opacity: 0;
    transform: translateX(-230%) skewX(-18deg);
  }
  4% {
    opacity: 1;
  }
  28% {
    opacity: 1;
  }
  32%,
  100% {
    opacity: 0;
    transform: translateX(360%) skewX(-18deg);
  }
}
.card.shiny::after {
  right: 5%;
  top: 4%;
  width: 26%;
  aspect-ratio: 1;
  background: radial-gradient(circle, #fff 0 10%, #fff4d2 18%, rgba(255, 214, 120, 0.9) 30%, rgba(255, 214, 120, 0) 62%);
  clip-path: polygon(50% 0, 55% 45%, 100% 50%, 55% 55%, 50% 100%, 45% 55%, 0 50%, 45% 45%);
  opacity: 0;
  transform: scale(0);
  animation: card-twinkle 4.2s ease-out infinite;
  animation-delay: calc(var(--sd, 0s) + 1.1s);
}
@keyframes card-twinkle {
  0% {
    opacity: 0;
    transform: scale(0) rotate(0deg);
  }
  6% {
    opacity: 1;
    transform: scale(1.1) rotate(40deg);
  }
  16%,
  100% {
    opacity: 0;
    transform: scale(0.15) rotate(100deg);
  }
}
.card.shiny > .tag {
  z-index: 2;
}
@media (prefers-reduced-motion: reduce) {
  .card.shiny::before,
  .card.shiny::after {
    display: none;
  }
}

/* ================================================================
   金・紺・赤の豪華版
   ・トップと入室前 = 案A「王宮」: 紺のビロードに、金の二重線の飾り枠と四隅の飾り。
     ロゴは Playfair Display の斜体、見出しは Shippori Mincho、数字は Cinzel。
   ・ルームの中(ロビー・デッキ構築・バトル・結果)= 案B「アールデコ」: 金の三重線の V 字、
     角を落とした枠とボタン、ひし形のアイコン。見出しは Zen Old Mincho、数字と英字は Marcellus。
   ルームの中だけの指定は body[data-screen="room"] を付けている(それ以外は案Aが基本)。
   色は :root の --night / --pearl / --gold / --gold-bright / --rose で変えられる。
   ================================================================ */
:root {
  /* 四隅の飾り(カードの裏面の飾り枠と同じ形) */
  --corner-tl: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='52' height='52' viewBox='0 0 52 52' fill='none' stroke='%23f0d48a' stroke-width='1.5'%3E%3Cpath d='M3 49V18C3 9 9 3 18 3h31'/%3E%3Cpath d='M10 49V22c0-7 5-12 12-12h27'/%3E%3Cpath d='M19 13l6 6-6 6-6-6z' fill='%23f0d48a' stroke='none'/%3E%3C/svg%3E");
  --corner-tr: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='52' height='52' viewBox='0 0 52 52' fill='none' stroke='%23f0d48a' stroke-width='1.5'%3E%3Cg transform='translate(52 0) scale(-1 1)'%3E%3Cpath d='M3 49V18C3 9 9 3 18 3h31'/%3E%3Cpath d='M10 49V22c0-7 5-12 12-12h27'/%3E%3Cpath d='M19 13l6 6-6 6-6-6z' fill='%23f0d48a' stroke='none'/%3E%3C/g%3E%3C/svg%3E");
  --corner-bl: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='52' height='52' viewBox='0 0 52 52' fill='none' stroke='%23f0d48a' stroke-width='1.5'%3E%3Cg transform='translate(0 52) scale(1 -1)'%3E%3Cpath d='M3 49V18C3 9 9 3 18 3h31'/%3E%3Cpath d='M10 49V22c0-7 5-12 12-12h27'/%3E%3Cpath d='M19 13l6 6-6 6-6-6z' fill='%23f0d48a' stroke='none'/%3E%3C/g%3E%3C/svg%3E");
  --corner-br: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='52' height='52' viewBox='0 0 52 52' fill='none' stroke='%23f0d48a' stroke-width='1.5'%3E%3Cg transform='translate(52 52) scale(-1 -1)'%3E%3Cpath d='M3 49V18C3 9 9 3 18 3h31'/%3E%3Cpath d='M10 49V22c0-7 5-12 12-12h27'/%3E%3Cpath d='M19 13l6 6-6 6-6-6z' fill='%23f0d48a' stroke='none'/%3E%3C/g%3E%3C/svg%3E");
  /* V 字の先端のひし形の両わきに並べる、小さなひし形(アールデコ) */
  --deco-flank: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='196' height='14' viewBox='0 0 196 14'%3E%3Cpath d='M7 2.5l4.500 4.500-4.500 4.500L2.500 7zM189 2.500l4.500 4.500-4.500 4.500-4.500-4.500z' fill='%23c9a24b'/%3E%3Cpath d='M31 0l7 7-7 7-7-7zM165 0l7 7-7 7-7-7z' fill='%23f0d48a'/%3E%3C/svg%3E");
}
body[data-screen="room"] {
  --font-display: "Zen Old Mincho", "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif CJK JP", serif;
  --font-num: "Marcellus", "Zen Old Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --num-weight: 400;
}

/* ---------- 共通の部品(案A が基本) ---------- */
.dia > b {
  font-family: var(--font-num);
  font-weight: var(--num-weight);
  font-size: calc(var(--s) * 0.48);
}
.dia-word > b {
  font-size: max(9px, calc(var(--s) * 0.26));
}
.dia-gold::before {
  background: linear-gradient(135deg, #fbefc4 0%, #e6c77a 28%, var(--gold) 55%, #9d7631 100%);
}
.dia-gold > b {
  color: var(--night-2);
}
.logo {
  transform: none;
  font-family: var(--font-logo);
  font-style: italic;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
}
.btn {
  border-radius: 0;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.08em;
}
.btn-primary {
  border: 1px solid var(--gold-pale);
  background: linear-gradient(180deg, #c22140, #8e1128);
  box-shadow: inset 0 0 0 3px #a8172f, inset 0 0 0 4px rgba(243, 226, 169, 0.7), 0 10px 24px -12px #000;
  color: #fff6dc;
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #d62c4d, #a2152f);
}
.btn-primary:disabled {
  border-color: #6f7396;
  background: #2b3160;
  box-shadow: inset 0 0 0 3px #2b3160, inset 0 0 0 4px rgba(160, 166, 200, 0.4);
  color: #a3a9c8;
}
.btn-azure {
  border: 1px solid var(--gold);
  background: var(--paper);
  box-shadow: none;
  color: var(--gold-pale);
}
.btn-azure:hover {
  background: #1e2d70;
}
.btn-ghost,
.entry-join .btn {
  border: 1px solid var(--gold);
  background: none;
  color: var(--gold-pale);
}
.btn-ghost:hover,
.entry-join .btn:hover {
  background: rgba(201, 162, 75, 0.14);
}
.btn-link {
  color: var(--gold-bright);
}
.input {
  border: 1px solid #5b6aa8;
  border-bottom: 2px solid var(--gold);
  border-radius: 0;
  background: var(--night-2);
  color: var(--ink);
}
.input::placeholder {
  color: #8a93c0;
}
.input:focus-visible {
  border-color: var(--gold-bright);
}
.input-code,
.code {
  font-family: var(--font-num);
  font-style: normal;
  font-weight: var(--num-weight);
}
.field-label {
  font-family: var(--font-display);
  color: var(--gold-bright);
}
:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}

/* ---------- 案A: トップ ---------- */
.home {
  background: var(--night-2) radial-gradient(ellipse 60% 520px at 72% 300px, rgba(214, 178, 92, 0.17), rgba(10, 16, 48, 0)) no-repeat;
}
.home-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  /* 右上のサウンドボタン(44px)に重ならないよう、右だけ余白を広げる */
  padding: 0.9rem calc(clamp(1rem, 4vw, 3rem) + 52px) 0.9rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--gold);
  box-shadow: 0 3px 0 var(--night-2), 0 4px 0 rgba(201, 162, 75, 0.5);
}
.home-bar .logo-s {
  font-size: 1.5rem;
}
.home-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1.6rem;
}
.home-nav button {
  min-height: 44px;
  padding: 0.3em 0.1em;
  border: 0;
  background: none;
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9375rem;
}
.home-nav button:hover {
  color: #fff6dc;
}
.hero-bg {
  display: none;
}
.hero-in {
  gap: clamp(1.75rem, 4.5vw, 3.5rem);
  min-height: 0;
  padding-top: clamp(1.75rem, 4.5vw, 3.25rem);
  padding-bottom: clamp(1.75rem, 3.5vw, 2.5rem);
}
@media (min-width: 901px) {
  .hero-in {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}
.logo-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 0.2em;
  font-size: clamp(3.1rem, 6.6vw, 5.25rem);
}
.logo-hero .logo-venus,
.logo-hero .logo-versus {
  display: inline;
  padding-left: 0;
}
.logo-hero .logo-venus {
  color: #e2526d;
  text-shadow: 0 2px 0 var(--gold-pale), 0 0 28px rgba(226, 82, 109, 0.45);
}
.logo-hero .logo-versus {
  color: #8fb1f5;
  text-shadow: 0 2px 0 var(--gold-pale), 0 0 28px rgba(143, 177, 245, 0.4);
}
.logo-hero .logo-versus::before {
  display: none;
}
.logo-sub {
  flex: 1 0 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 0.7rem;
  padding-left: 0;
  transform: none;
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.06em;
  color: var(--gold-bright);
  text-shadow: none;
}
.logo-sub::before,
.logo-sub::after {
  content: "";
  height: 1px;
  background: var(--gold);
}
.logo-sub::before {
  flex: 0 0 56px;
}
.logo-sub::after {
  flex: 1 1 40px;
}
.lead {
  margin-top: 1.3rem;
  font-weight: 800;
  font-size: clamp(1.5rem, 3.1vw, 2.5rem);
  line-height: 1.35;
  letter-spacing: 0.02em;
}
.lead-sub {
  max-width: none;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--ink-soft);
}
.home .entry {
  max-width: none;
  gap: 1rem;
  padding: 1.5rem 1.6rem;
  background: #101a45;
  border: 1px solid var(--gold);
  box-shadow: inset 0 0 0 5px #101a45, inset 0 0 0 6px rgba(201, 162, 75, 0.55);
}
.hero .input {
  background: var(--night-2);
  border-color: #5b6aa8;
  border-bottom-color: var(--gold);
  color: var(--ink);
}
.hero .field-label,
.hero .who-change {
  color: var(--gold-bright);
}
.entry-acts .btn {
  min-height: 56px;
  font-size: 1.125rem;
}
.entry-or {
  border-top-color: rgba(201, 162, 75, 0.45);
  color: var(--ink-soft);
}
.entry-note {
  color: var(--ink-soft);
}
/* 公開の瞬間: 金の二重線の額に、四隅の飾り */
.duel {
  /* 2枚が額の内側に収まる大きさ */
  --dw: clamp(118px, 13.4vw, 188px);
  justify-self: stretch;
  padding: 2.9rem clamp(1.2rem, 3vw, 2.25rem) 1.7rem;
  border: 1px solid var(--gold);
  background:
    var(--corner-tl) left 14px top 14px / 52px 52px no-repeat,
    var(--corner-tr) right 14px top 14px / 52px 52px no-repeat,
    var(--corner-bl) left 14px bottom 14px / 52px 52px no-repeat,
    var(--corner-br) right 14px bottom 14px / 52px 52px no-repeat,
    #0d163c;
  box-shadow: inset 0 0 0 7px #0d163c, inset 0 0 0 8px var(--gold), 0 30px 60px -30px #000;
}
.duel::before {
  display: none;
}
.duel .dflip-front {
  box-shadow: 0 0 0 2px #e9cf8a, 0 0 30px rgba(233, 207, 138, 0.42), 0 22px 36px -14px #000;
}
.duel .dflip-back {
  box-shadow: 0 0 0 1px var(--gold), 0 22px 36px -14px #000;
}
.duel-cap {
  font-size: 1.0625rem;
}
.duel .btn-link {
  color: var(--gold-bright);
}
.home-below h2 {
  font-weight: 800;
}
.flow h2 {
  display: flex;
  align-items: center;
  gap: 16px;
}
.flow h2::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--gold);
  box-shadow: 0 3px 0 rgba(201, 162, 75, 0.4);
}
.flow-steps li {
  padding-top: 0;
  border-top: 0;
  align-items: start;
  gap: 0.2rem 1.1rem;
}
.flow-steps .dia {
  grid-row: span 2;
}
.flow-steps h3 {
  align-self: end;
  font-weight: 800;
}
.flow-steps p {
  grid-column: 2;
}
.movie-head {
  max-width: 972px;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--gold);
  box-shadow: 0 3px 0 var(--night-2), 0 4px 0 rgba(201, 162, 75, 0.4);
}
.movie-out {
  color: var(--gold-bright);
}
/* 動画やサムネイルが入っても隠れないよう、二重線は外側に引く */
.movie-frame {
  margin: 6px;
  border: 1px solid var(--gold);
  border-radius: 0;
  box-shadow: 0 0 0 5px var(--night), 0 0 0 6px rgba(201, 162, 75, 0.5);
  background: var(--night);
}
.movie-play {
  color: var(--gold-bright);
}
.foot {
  border-top-color: rgba(201, 162, 75, 0.5);
}
.foot-link {
  color: var(--gold-bright);
}

@media (max-width: 1100px) {
  .entry-acts .btn {
    font-size: 1rem;
  }
}
@media (max-width: 900px) {
  .home-bar {
    padding-top: 0.6rem;
    padding-bottom: 0.4rem;
  }
  .home-nav {
    gap: 0 1.3rem;
  }
  .logo-hero {
    font-size: clamp(2.5rem, 12.4vw, 4.25rem);
  }
  .logo-sub {
    font-size: 0.875rem;
  }
  .logo-sub::before {
    flex-basis: 28px;
  }
  .duel {
    --dw: clamp(104px, 33vw, 176px);
    padding: 2.5rem 0.9rem 1.4rem;
    background-size: 40px 40px, 40px 40px, 40px 40px, 40px 40px, auto;
    color: var(--ink);
  }
  .duel .btn-link {
    color: var(--gold-bright);
  }
  .home .entry {
    padding: 1.3rem 1.2rem;
  }
}
@media (max-width: 420px) {
  .lead {
    font-size: clamp(1.25rem, 6.3vw, 1.6rem);
  }
  .entry-acts .btn {
    padding-left: 0.2em;
    padding-right: 0.2em;
    font-size: 0.9375rem;
    letter-spacing: 0.02em;
  }
}

/* ---------- 案A: 入室前・ルームに入れないとき ---------- */
.sky {
  background: var(--night-2) radial-gradient(ellipse 70% 60% at 50% 30%, rgba(214, 178, 92, 0.15), rgba(10, 16, 48, 0));
}
.join .logo-s {
  font-size: 2rem;
}
.panel,
.snd-panel {
  border: 1px solid var(--gold);
  border-radius: 0;
  background: #101a45;
}
.join-panel {
  padding: 1.9rem 1.8rem;
  border-top: 1px solid var(--gold);
  box-shadow: inset 0 0 0 5px #101a45, inset 0 0 0 6px rgba(201, 162, 75, 0.55), 0 30px 60px -30px #000;
}
.join-panel h1 .code {
  font-weight: var(--num-weight);
}
.join-phase {
  color: var(--gold-bright);
}
.who-change {
  color: var(--gold-bright);
}

/* ---------- 重ねて出す層(演出・選択・一覧)。どの画面でも金の二重線の額 ---------- */
.show-backdrop,
.modal-backdrop {
  background: rgba(4, 8, 26, 0.9);
}
.modal {
  border: 1px solid var(--gold);
  border-radius: 0;
  background: #101a45;
  box-shadow: inset 0 0 0 5px #101a45, inset 0 0 0 6px rgba(201, 162, 75, 0.5), 0 30px 80px rgba(0, 0, 0, 0.7);
}
.modal-x {
  border: 1px solid var(--gold);
  border-radius: 0;
  background: var(--night-2);
  color: var(--gold-bright);
}
.modal-x:hover {
  border-color: var(--gold-bright);
}
.modal-title {
  font-weight: 800;
}
.tab {
  border-radius: 0;
}
.tab.on {
  border-color: var(--gold-bright);
  box-shadow: inset 0 -3px 0 var(--gold);
}
.toast {
  border: 1px solid var(--gold);
  border-radius: 0;
  background: var(--night);
  color: var(--ink);
}
.opt {
  border-radius: 0;
}
.opt.on {
  border-color: var(--gold-bright);
  box-shadow: inset 0 0 0 1px var(--gold-bright);
}
.sc-win .sc-main::before {
  background: var(--gold-bright);
}
.snd-fab {
  border: 1px solid var(--gold);
  background: var(--night);
  color: var(--gold-bright);
}

/* ================= 案B: ルームの中(アールデコ) ================= */
body[data-screen="room"] .logo {
  font-family: var(--font-num);
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
body[data-screen="room"] .logo-bar {
  font-size: 1.05rem;
}
body[data-screen="room"] .logo-bar .logo-versus::before {
  background: var(--gold-bright);
}
body[data-screen="room"] .bar {
  background: var(--night);
  border-bottom: 3px double var(--gold);
}
body[data-screen="room"] .bar .code {
  letter-spacing: 0.18em;
}
body[data-screen="room"] .btn {
  font-weight: 900;
}
/* いちばん押すボタン: 角を落とした赤い漆に、金の縁。疑似要素で縁を作る(切り欠きに沿って金が回る) */
body[data-screen="room"] .btn-primary {
  --c: 13px;
  position: relative;
  isolation: isolate;
  border: 0;
  background: var(--gold-bright);
  box-shadow: none;
  clip-path: polygon(var(--c) 0, calc(100% - var(--c)) 0, 100% var(--c), 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, var(--c) 100%, 0 calc(100% - var(--c)), 0 var(--c));
  color: #fff5d9;
  letter-spacing: 0.1em;
}
body[data-screen="room"] .btn-primary::before {
  content: "";
  position: absolute;
  inset: 2px;
  z-index: -1;
  background: var(--rose);
  clip-path: polygon(calc(var(--c) - 1px) 0, calc(100% - var(--c) + 1px) 0, 100% calc(var(--c) - 1px), 100% calc(100% - var(--c) + 1px), calc(100% - var(--c) + 1px) 100%, calc(var(--c) - 1px) 100%, 0 calc(100% - var(--c) + 1px), 0 calc(var(--c) - 1px));
}
body[data-screen="room"] .btn-primary:hover:not(:disabled) {
  background: #fff1c2;
}
body[data-screen="room"] .btn-primary:hover:not(:disabled)::before {
  background: var(--rose-deep);
}
body[data-screen="room"] .btn-primary:focus-visible {
  background: #fff;
}
body[data-screen="room"] .btn-primary:focus-visible::before {
  inset: 4px;
}
body[data-screen="room"] .btn-primary:disabled {
  background: #5e6590;
  color: #a9aecb;
}
body[data-screen="room"] .btn-primary:disabled::before {
  background: #232b5c;
}
body[data-screen="room"] .btn-s.btn-primary {
  --c: 9px;
}
body[data-screen="room"] .btn-ghost {
  font-weight: 700;
  color: var(--gold-bright);
}

/* V 字の境界: 金の三重線(明るい線・金の線・うすい線)。影を重ねて、V 字に沿った平行線にしている */
body[data-screen="room"] .opps-edge,
body[data-screen="room"] .nhead-edge {
  filter: drop-shadow(0 2px 0 var(--gold-bright)) drop-shadow(0 7px 0 var(--pearl)) drop-shadow(0 1px 0 var(--gold)) drop-shadow(0 7px 0 var(--pearl))
    drop-shadow(0 1px 0 #6a5d3f);
}
/* 先端のひし形: 明るい金に、二重の輪。両わきに小さなひし形 */
body[data-screen="room"] .hz-no,
body[data-screen="room"] .nhead-tip {
  background: var(--deco-flank) center 20px / 196px 14px no-repeat;
}
body[data-screen="room"] .hz-no {
  padding: 0 71px;
}
body[data-screen="room"] .hz-no .dia::before,
body[data-screen="room"] .nhead-tip .dia::before {
  background: var(--gold-bright);
  box-shadow: 0 0 0 4px var(--pearl), 0 0 0 5px var(--gold-bright), 0 0 0 9px var(--pearl), 0 0 0 10px var(--gold);
}
body[data-screen="room"] .hz-no .dia > b,
body[data-screen="room"] .nhead-tip .dia > b {
  color: var(--night-2);
}
/* 負け(LOSE)の札は青のまま(成り上がり戦・レアリティ解禁戦・レイドボスバトルの結果) */
body[data-screen="room"] .nhead-tip .dia-azure::before {
  background: var(--azure);
  box-shadow: 0 0 0 4px var(--pearl), 0 0 0 5px var(--blue-bright), 0 0 0 9px var(--pearl), 0 0 0 10px var(--azure);
}
body[data-screen="room"] .nhead-tip .dia-azure > b {
  color: #fff;
}
body[data-screen="room"] .hz-label,
body[data-screen="room"] .nhead-tip-label {
  margin-top: 0.75rem;
  color: var(--gold-bright);
}

/* プレイヤーの行: ひし形のアイコン(相手 = 金、CPU = 青、自分 = 赤の縁) */
body[data-screen="room"] .table .pl-head .av {
  --av: 60px;
  border-radius: 0;
  background: var(--gold);
  box-shadow: none;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
body[data-screen="room"] .table .pl-head .av img {
  inset: 2px;
  width: calc(100% - 4px);
  height: calc(100% - 4px);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
body[data-screen="room"] .table .pl-head .av-cpu {
  background: var(--blue-bright);
}
body[data-screen="room"] .table .mine .pl-head .av {
  background: var(--red-bright);
}
body[data-screen="room"] .pl-name {
  font-weight: 900;
}
body[data-screen="room"] .chips i {
  border-color: var(--gold);
}
body[data-screen="room"] .chips i.on {
  background: radial-gradient(circle at 34% 30%, #fff6d6, var(--gold-bright) 50%, var(--gold));
  border-color: var(--gold-bright);
  box-shadow: 0 0 6px rgba(240, 212, 138, 0.45);
}
/* 勝ち数は小さなひし形で数える */
body[data-screen="room"] .wins {
  gap: 7px;
  font-family: var(--font-num);
  font-weight: 400;
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  color: var(--gold-bright);
}
body[data-screen="room"] .wins i {
  width: 9px;
  height: 9px;
  border: 1px solid #8a93c4;
  transform: rotate(45deg);
  opacity: 1;
}
body[data-screen="room"] .wins i.on {
  border-color: var(--gold-bright);
  background: var(--gold-bright);
}

/* 場の枠: 角を落とした金の細い枠(カードが入っていない枠だけ) */
body[data-screen="room"] .slot {
  border: 0;
  border-radius: 0;
}
body[data-screen="room"] .slot:not(.slot-win, .slot-lose, .slot-pending, .slot-alone, .has-card) {
  --c: 11px;
  --slot-bg: var(--night);
  --slot-line: #7b6a3d;
  background: var(--slot-line);
  clip-path: polygon(var(--c) 0, calc(100% - var(--c)) 0, 100% var(--c), 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, var(--c) 100%, 0 calc(100% - var(--c)), 0 var(--c));
}
body[data-screen="room"] .slot:not(.slot-win, .slot-lose, .slot-pending, .slot-alone, .has-card)::before {
  content: "";
  position: absolute;
  inset: var(--slot-edge, 1px);
  background: var(--slot-bg);
  clip-path: polygon(calc(var(--c) - 0.5px) 0, calc(100% - var(--c) + 0.5px) 0, 100% calc(var(--c) - 0.5px), 100% calc(100% - var(--c) + 0.5px), calc(100% - var(--c) + 0.5px) 100%, calc(var(--c) - 0.5px) 100%, 0 calc(100% - var(--c) + 0.5px), 0 calc(var(--c) - 0.5px));
}
body[data-screen="room"] .slot > .slot-no,
body[data-screen="room"] .slot > .spot-text {
  position: relative;
}
body[data-screen="room"] .mine .slot:not(.slot-win, .slot-lose, .slot-pending, .slot-alone, .has-card) {
  --slot-bg: var(--pearl);
  --slot-line: #8b7741;
}
body[data-screen="room"] .slot-no {
  font-family: var(--font-num);
  font-weight: 400;
  font-size: 1.3rem;
  color: #8690c2;
}
body[data-screen="room"] .mine .slot-no {
  color: #97a0d0;
}
body[data-screen="room"] .slot-now:not(.has-card) {
  --slot-line: var(--on-night-soft);
}
body[data-screen="room"] .mine .slot-now:not(.has-card) {
  --slot-edge: 2px;
  --slot-line: var(--red-bright);
  --slot-bg: #4a1230;
}
body[data-screen="room"] .mine .spot-text {
  font-family: var(--font-display);
  font-weight: 900;
  color: #ffd5dc;
}
body[data-screen="room"] .slot-win .card {
  box-shadow: 0 0 0 1px var(--pearl), 0 0 0 3px var(--gold-bright), 0 10px 16px -10px #000;
}
body[data-screen="room"] .opps .slot-win .card {
  box-shadow: 0 0 0 1px var(--night), 0 0 0 3px var(--gold-bright), 0 10px 16px -10px #000;
}
body[data-screen="room"] .slot-mark {
  right: -9px;
  bottom: -7px;
  padding: 3px 8px 2px;
  border-radius: 0;
  background: var(--rose);
  clip-path: polygon(5px 0, calc(100% - 5px) 0, 100% 5px, 100% calc(100% - 5px), calc(100% - 5px) 100%, 5px 100%, 0 calc(100% - 5px), 0 5px);
  color: #fff5d9;
  font-family: var(--font-num);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.1em;
  box-shadow: none;
}
body[data-screen="room"] .slot-pw {
  border-radius: 0;
  background: var(--gold-bright);
  color: var(--night-2);
  font-family: var(--font-num);
  font-weight: 400;
}
body[data-screen="room"] .hz-msg {
  font-weight: 900;
}
/* 手札は、金の二重線で場と区切る */
body[data-screen="room"] .hand {
  max-width: 1040px;
  margin: 0.5rem auto 0;
  padding-top: 1.4rem;
  border-top: 3px double rgba(201, 162, 75, 0.7);
}
body[data-screen="room"] .card.pick.sel {
  box-shadow: 0 0 0 2px var(--pearl), 0 0 0 5px var(--red-bright), 0 0 0 7px var(--pearl), 0 0 0 8px var(--gold-bright), 0 18px 26px -10px #000;
}
body[data-screen="room"] .dock {
  background: var(--night);
  border-top: 3px double var(--gold);
}
body[data-screen="room"] .flag {
  border-radius: 0;
  border-color: var(--gold);
}

/* ロビー・デッキ構築・結果 */
body[data-screen="room"] .nhead {
  background: var(--night);
}
body[data-screen="room"] .lobby h2,
body[data-screen="room"] .zone-head {
  border-bottom: 3px double rgba(201, 162, 75, 0.7);
}
body[data-screen="room"] .lobby h2,
body[data-screen="room"] .zone-head h2,
body[data-screen="room"] .build-title h1,
body[data-screen="room"] .ended-hero h1 {
  font-weight: 900;
}
body[data-screen="room"] .seat,
body[data-screen="room"] .rule-row {
  border-bottom-color: rgba(201, 162, 75, 0.3);
}
body[data-screen="room"] .rulebox {
  border-left-color: rgba(201, 162, 75, 0.45);
}
body[data-screen="room"] .setpick {
  border-radius: 0;
}
body[data-screen="room"] .setpick.on {
  border-color: var(--gold-bright);
}
body[data-screen="room"] .seg {
  border-color: var(--gold);
  border-radius: 0;
}
body[data-screen="room"] .stepper button {
  border-color: var(--gold);
  border-radius: 0;
  color: var(--gold-bright);
}
body[data-screen="room"] .invite .code {
  letter-spacing: 0.16em;
}
body[data-screen="room"] .rule-badge {
  border-radius: 0;
}
body[data-screen="room"] .scores li {
  border-bottom-color: rgba(201, 162, 75, 0.3);
}
body[data-screen="room"] .modal-title,
body[data-screen="room"] .show-title {
  font-weight: 900;
}

/* ---------- 結果: 勝者の活躍したカード(案B) ----------
   勝ち取った勝利数の多い順に最大3枚。いちばんのカードは MVP として大きく、3枚なら真ん中(表彰台の並び)。
   結果の画面に移ったら、カードが順に下から上がってくる。 */
.feats {
  width: 100%;
  display: grid;
  gap: 1.1rem;
}
.feats-title {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.125rem;
  letter-spacing: 0.08em;
  color: var(--gold-bright);
}
.feats-title::before,
.feats-title::after {
  content: "";
  flex: 1 1 0;
  height: 1px;
  background: var(--gold);
  box-shadow: 0 3px 0 rgba(201, 162, 75, 0.4);
}
/* だれのデッキで活躍したカードか(見出しの上の小さな行。2026年11月20日、くまねこ堂の指定) */
.feats-head {
  display: grid;
  gap: 0.15rem;
}
.feats-owner {
  margin: 0;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--on-night-soft);
  overflow-wrap: anywhere;
}

/* ---------- CPU の名前(2026年11月20日、くまねこ堂の指定) ----------
   CPU の名前はカードのキャラクター名なので、カードの名前と見分けがつくように、名前の前に小さな青い「CPU」(state.js の nameHTML)、
   強さは青い札(cpuLevelChipHTML)。結果画面の勝者と、バトルの公開のカードの上の名前は「人の札」(金の線の枠)にして、
   四角いカードと形でも見分ける。 */
.cpu-pre {
  font-style: normal;
  font-family: var(--font-num);
  font-size: 0.72em;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--blue-bright);
  margin-right: 0.3em;
}
.ended-plate {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 100%;
  margin: 0.7rem 0 0.3rem;
  padding: 0.75rem 1.5rem 0.75rem 0.9rem;
  border: 1px solid var(--gold);
  box-shadow: inset 0 0 0 3px var(--night), inset 0 0 0 4px rgba(201, 162, 75, 0.45);
  background: linear-gradient(180deg, rgba(22, 34, 87, 0.9), rgba(10, 16, 48, 0.9));
  text-align: left;
}
.ended-plate .av {
  --av: 72px;
  flex: none;
  box-shadow: 0 0 0 2px var(--gold);
}
.ended-plate-txt {
  min-width: 0;
}
.ended-hero .ended-plate h1 {
  margin: 0;
  font-size: clamp(1.7rem, 6vw, 2.6rem);
  line-height: 1.15;
}
.ended-hero .ended-plate h1 span {
  display: inline;
  margin-left: 0.35em;
  font-size: 0.5em;
}
.ended-plate h1 .cpu-pre {
  font-size: 0.5em;
  vertical-align: 0.32em;
}
.ended-plate-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0.45rem 0 0;
}
@media (max-width: 420px) {
  .ended-plate {
    gap: 0.7rem;
    padding: 0.6rem 1rem 0.6rem 0.7rem;
  }
  .ended-plate .av {
    --av: 56px;
  }
}
/* バトルの公開: カードの上の名前の札 */
.sc-who.sc-plate {
  border: 1px solid var(--gold);
  border-radius: 0;
  background: rgba(10, 16, 48, 0.92);
  padding: 0 0.55em 0 0.25em;
}
.sc-me .sc-who.sc-plate {
  background: var(--rose);
}
.sc-who > .sc-who-name {
  overflow: hidden;
  text-overflow: ellipsis;
}
.sc-who .chip-lv {
  flex: none;
  overflow: visible;
  font-size: 0.72rem;
  padding: 0.05em 0.4em;
}
/* 3人以上・スマホでは、カードの上が狭いので強さの札は隠す(結果の文には出す) */
.show-cards[data-n="3"] .sc-who .chip-lv,
.show-cards[data-n="4"] .sc-who .chip-lv,
.show-cards[data-n="5"] .sc-who .chip-lv {
  display: none;
}
/* 狭いときは「CPU」も小さく詰める(スマホの2人戦で「ソフィア」くらいの名前まで切れずに入る) */
.show-cards[data-n="3"] .sc-who .cpu-pre,
.show-cards[data-n="4"] .sc-who .cpu-pre,
.show-cards[data-n="5"] .sc-who .cpu-pre {
  font-size: 0.6em;
  letter-spacing: 0;
  margin-right: 0.15em;
}
@media (max-width: 600px) {
  .sc-who .chip-lv {
    display: none;
  }
  .sc-who .cpu-pre {
    font-size: 0.6em;
    letter-spacing: 0;
    margin-right: 0.15em;
  }
}
.show-result .chip-lv {
  margin-left: 0.4em;
  font-family: var(--font-body);
  font-size: 0.62em;
  vertical-align: 0.25em;
}
.feats-row {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(12px, 3.4vw, 26px);
}
.feat {
  --fw: clamp(80px, 21vw, 116px);
  position: relative;
  isolation: isolate;
  width: var(--fw);
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 0.2rem;
  animation: feat-in 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) calc(0.35s + var(--i) * 0.16s) both;
}
.feat-mvp {
  --fw: clamp(106px, 28vw, 156px);
}
.feat .card {
  --cw: var(--fw);
  margin-bottom: 0.45rem;
  box-shadow: 0 0 0 1px var(--gold), 0 16px 28px -14px #000;
}
.feat-mvp .card {
  box-shadow: 0 0 0 2px var(--gold-bright), 0 0 30px rgba(240, 212, 138, 0.38), 0 18px 32px -14px #000;
}
/* MVP の後ろに、金の光 */
.feat-mvp::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 38%;
  width: 190%;
  aspect-ratio: 1;
  translate: -50% -50%;
  background: radial-gradient(closest-side, rgba(240, 212, 138, 0.22), rgba(240, 212, 138, 0));
  pointer-events: none;
  z-index: -1;
}
.feat-badge {
  position: absolute;
  top: -0.7rem;
  left: 50%;
  translate: -50% 0;
  z-index: 2;
  padding: 0.12rem 0.75rem 0.08rem;
  background: var(--rose);
  color: #fff6dc;
  font-family: var(--font-num);
  font-weight: var(--num-weight);
  font-size: 0.8125rem;
  letter-spacing: 0.16em;
  box-shadow: 0 0 0 1px var(--gold-bright), 0 4px 10px -4px #000;
  clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 50%, calc(100% - 6px) 100%, 6px 100%, 0 50%);
}
.feat-wins {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.875rem;
  line-height: 1;
  color: var(--gold-bright);
}
.feat-wins b {
  margin-right: 0.12em;
  font-family: var(--font-num);
  font-weight: var(--num-weight);
  font-size: 1.75rem;
  color: #fff6dc;
}
.feat-mvp .feat-wins b {
  font-size: 2.25rem;
}
.feat-name {
  margin: 0;
  width: 100%;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.feat-tags {
  margin: 0.15rem 0 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem;
}
.feat-tag {
  padding: 0.1rem 0.4rem;
  border: 1px solid rgba(201, 162, 75, 0.6);
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--gold-pale);
  white-space: nowrap;
}
.feat-tag.feat-final {
  border-color: var(--red-bright);
  background: #4a1230;
  color: #ffd5dc;
}
.feat-tag.feat-round {
  border-color: var(--gold-bright);
  background: rgba(201, 162, 75, 0.18);
}
@keyframes feat-in {
  from {
    opacity: 0;
    transform: translateY(26px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .feat {
    animation: none;
  }
}

/* ---------- 音が出るのを待っている間(ブラウザの決まりで、最初に押すまで音が出ない) ----------
   スピーカーのボタンがゆっくり光り、トップなどの右上のボタンには吹き出しで案内を出す。 */
/* 右上の丸いボタン(.snd-fab)は position: fixed のまま。それ以外は吹き出しの基準にする */
.snd-btn.snd-wait:not(.snd-fab) {
  position: relative;
}
.snd-btn.snd-wait::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(240, 212, 138, 0.7);
  animation: snd-wait 1.8s ease-out infinite;
  pointer-events: none;
}
@keyframes snd-wait {
  0% {
    box-shadow: 0 0 0 0 rgba(240, 212, 138, 0.65);
  }
  70%,
  100% {
    box-shadow: 0 0 0 12px rgba(240, 212, 138, 0);
  }
}
.snd-hint {
  position: absolute;
  top: calc(100% + 10px);
  right: -2px;
  padding: 0.45em 0.85em;
  border: 1px solid var(--gold);
  background: #101a45;
  box-shadow: 0 10px 22px -10px #000;
  color: var(--gold-pale);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
  animation: snd-hint 0.5s ease 0.8s both;
}
.snd-hint::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 16px;
  width: 10px;
  height: 10px;
  border-top: 1px solid var(--gold);
  border-left: 1px solid var(--gold);
  background: #101a45;
  transform: rotate(45deg);
}
@keyframes snd-hint {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}
/* スマホでは、下のメニューに重ならないよう、ボタンの左に出す */
@media (max-width: 600px) {
  .snd-hint {
    top: 50%;
    right: calc(100% + 10px);
    translate: 0 -50%;
    padding: 0.4em 0.7em;
    font-size: 0.75rem;
  }
  .snd-hint::before {
    top: calc(50% - 5px);
    right: -6px;
    border: 0;
    border-top: 1px solid var(--gold);
    border-right: 1px solid var(--gold);
  }
}
@media (prefers-reduced-motion: reduce) {
  .snd-btn.snd-wait::after {
    animation: none;
    box-shadow: 0 0 0 3px rgba(240, 212, 138, 0.5);
  }
}

/* ================= SPカードの特殊演出(public/js/cardfx.js) =================
   パック開封とバトルの公開で、カードの表が見えた瞬間(--sp-t)に1回だけ流れる。
   .sp-back はカードの後ろ、.sp-front はカードの上。大きさの単位 --u はカードの幅の 1%。
   テーマ: sleuth(クリス)/ angel(ミナエル&カナエル)/ bloom(春陽)/ fox(葛乃葉)/
           devil(ルージュ&アズール)/ gamble(リオ)/ ragnarok(ラグナロク)/ moon(桜井 月美) */
.sp-host {
  position: relative;
  isolation: isolate;
}
.show-pack .sp-host {
  --spw: var(--pcw);
  --sp-t: calc(var(--t0) + 0.3s);
}
.show-battle .sp-host {
  --spw: var(--scw);
  --sp-t: calc(0.7s + var(--i, 0) * 0.16s);
}
.sp-back,
.sp-front {
  --u: calc(var(--spw, 160px) / 100);
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.sp-back {
  z-index: -1;
}
.sp-front {
  z-index: 4;
}
.sp-back > *,
.sp-front > * {
  position: absolute;
  display: block;
  opacity: 0;
  animation-fill-mode: both;
  animation-timing-function: ease-out;
  animation-delay: calc(var(--sp-t, 0.7s) + var(--d, 0s));
}
@keyframes sp-glow {
  0% {
    opacity: 0;
    scale: 0.5;
  }
  25% {
    opacity: 1;
    scale: 1;
  }
  70% {
    opacity: 0.85;
  }
  100% {
    opacity: 0;
    scale: 1.15;
  }
}

/* ---- クリス: スポットライトの中を虫めがねが横切り、「?」が浮かんで「!」でひらめく ---- */
.sp-sleuth .sp-spot {
  left: 50%;
  top: 48%;
  width: 240%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 246, 214, 0.55), rgba(255, 228, 160, 0.2) 34%, rgba(255, 228, 160, 0) 62%);
  animation-name: sp-glow;
  animation-duration: 1.9s;
}
.sp-sleuth .sp-glass {
  left: 26%;
  top: 26%;
  width: 48%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: calc(var(--u) * 2.6) solid #e9c46a;
  background: radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.7), rgba(210, 236, 255, 0.22) 42%, rgba(255, 255, 255, 0.08) 70%);
  box-shadow: 0 0 calc(var(--u) * 5) rgba(255, 224, 150, 0.8), inset 0 0 calc(var(--u) * 3) rgba(255, 255, 255, 0.6);
  animation-name: sp-glass;
  animation-duration: 1.35s;
  animation-timing-function: cubic-bezier(0.3, 0.7, 0.3, 1);
}
.sp-sleuth .sp-glass::after {
  content: "";
  position: absolute;
  left: 86%;
  top: 86%;
  width: 62%;
  height: 15%;
  border-radius: calc(var(--u) * 2);
  background: linear-gradient(180deg, #8a5a2b, #5a3414);
  box-shadow: 0 0 0 calc(var(--u) * 0.6) #e9c46a;
  transform-origin: 0 50%;
  rotate: 45deg;
}
@keyframes sp-glass {
  0% {
    opacity: 0;
    translate: -80% 90%;
    rotate: -25deg;
  }
  20% {
    opacity: 1;
  }
  65% {
    opacity: 1;
    translate: 6% -4%;
    rotate: 0deg;
  }
  100% {
    opacity: 0;
    translate: 26% -22%;
    rotate: 8deg;
  }
}
.sp-sleuth .sp-q,
.sp-sleuth .sp-bang {
  left: var(--x);
  top: var(--y);
  translate: -50% -50%;
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1;
}
.sp-sleuth .sp-q {
  font-size: calc(var(--u) * 28);
  color: #ffe9a8;
  text-shadow: 0 0 2px #2a1800, 0 0 calc(var(--u) * 3) rgba(255, 200, 90, 0.9), 0 calc(var(--u) * 0.7) 0 #6b4a12;
  animation-name: sp-q;
  animation-duration: 0.95s;
}
@keyframes sp-q {
  0% {
    opacity: 0;
    scale: 0.3;
  }
  30% {
    opacity: 1;
    scale: 1.15;
  }
  55% {
    scale: 1;
  }
  100% {
    opacity: 0;
    translate: -50% -120%;
  }
}
.sp-sleuth .sp-bang {
  --x: 50%;
  --y: 44%;
  --d: 0.85s;
  font-size: calc(var(--u) * 52);
  color: #fff;
  text-shadow: 0 0 calc(var(--u) * 4) #ff5a7a, 0 0 calc(var(--u) * 10) rgba(255, 90, 122, 0.8), 0 calc(var(--u) * 0.8) 0 #8a1030;
  animation-name: sp-bang;
  animation-duration: 1s;
}
@keyframes sp-bang {
  0% {
    opacity: 0;
    scale: 2.4;
  }
  22% {
    opacity: 1;
    scale: 0.9;
  }
  38% {
    scale: 1.06;
  }
  75% {
    opacity: 1;
    scale: 1;
  }
  100% {
    opacity: 0;
  }
}

/* ---- ミナエル&カナエル: 光の柱に、2つの光輪が降りてきて、白い羽根が舞う ---- */
.sp-angel .sp-beam {
  left: 50%;
  top: -40%;
  width: 72%;
  height: 180%;
  translate: -50% 0;
  background: linear-gradient(90deg, rgba(255, 232, 160, 0), rgba(255, 240, 190, 0.9) 50%, rgba(255, 232, 160, 0));
  filter: blur(calc(var(--u) * 1.2));
  animation-name: sp-beam;
  animation-duration: 2s;
}
@keyframes sp-beam {
  0% {
    opacity: 0;
    scale: 0.2 1;
  }
  30% {
    opacity: 1;
    scale: 1 1;
  }
  75% {
    opacity: 0.7;
  }
  100% {
    opacity: 0;
    scale: 1.3 1;
  }
}
.sp-angel .sp-halo {
  top: -9%;
  width: 40%;
  aspect-ratio: 3 / 1;
  border-radius: 50%;
  border: calc(var(--u) * 1.6) solid #ffe7a0;
  box-shadow: 0 0 calc(var(--u) * 4) rgba(255, 226, 140, 0.95), inset 0 0 calc(var(--u) * 2) rgba(255, 226, 140, 0.8);
  animation-name: sp-halo;
  animation-duration: 2.1s;
}
.sp-angel .sp-halo-l {
  left: 9%;
}
.sp-angel .sp-halo-r {
  left: 51%;
  --d: 0.12s;
}
@keyframes sp-halo {
  0% {
    opacity: 0;
    translate: 0 -120%;
  }
  30% {
    opacity: 1;
    translate: 0 0;
  }
  45% {
    translate: 0 -12%;
  }
  60% {
    translate: 0 0;
  }
  85% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
.sp-angel .sp-feather {
  left: var(--x);
  top: -12%;
  width: 9.5%;
  aspect-ratio: 1 / 2.6;
  border-radius: 50% 50% 50% 50% / 70% 70% 30% 30%;
  background: linear-gradient(90deg, #fff 0 45%, #d8d2c2 46% 54%, #fff 55%);
  box-shadow: 0 0 calc(var(--u) * 2) rgba(255, 255, 255, 0.8);
  rotate: var(--r);
  animation-name: sp-feather;
  animation-duration: 2.1s;
  animation-timing-function: linear;
}
@keyframes sp-feather {
  0% {
    opacity: 0;
    translate: 0 0;
  }
  12% {
    opacity: 1;
  }
  35% {
    translate: calc(var(--u) * var(--sw)) calc(var(--u) * var(--f) * 0.33);
  }
  65% {
    translate: calc(var(--u) * var(--sw) * -1) calc(var(--u) * var(--f) * 0.66);
  }
  100% {
    opacity: 0;
    translate: calc(var(--u) * var(--sw) * 0.5) calc(var(--u) * var(--f));
  }
}

/* ---- 日輪・春陽: 後ろに日輪が昇り、桜の花と花びらがはじけるように咲き広がり、横から桜吹雪が吹き抜ける ---- */
.sp-bloom .sp-sun {
  left: 50%;
  top: 42%;
  width: 130%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle, #fff7cf 0 16%, #ffd35e 30%, rgba(255, 150, 60, 0.55) 46%, rgba(255, 120, 60, 0) 64%);
  animation-name: sp-sun;
  animation-duration: 2.2s;
}
@keyframes sp-sun {
  0% {
    opacity: 0;
    translate: -50% -10%;
    scale: 0.4;
  }
  35% {
    opacity: 1;
    translate: -50% -50%;
    scale: 1;
  }
  80% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    translate: -50% -50%;
    scale: 1.12;
  }
}
.sp-bloom .sp-rays {
  left: 50%;
  top: 42%;
  width: 230%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 214, 120, 0.6) 0deg 5deg, rgba(255, 214, 120, 0) 5deg 18deg);
  -webkit-mask: radial-gradient(circle, transparent 16%, #000 28%, transparent 68%);
  mask: radial-gradient(circle, transparent 16%, #000 28%, transparent 68%);
  animation-name: sp-rays;
  animation-duration: 2.4s;
  animation-timing-function: linear;
}
@keyframes sp-rays {
  0% {
    opacity: 0;
    rotate: 0deg;
  }
  25% {
    opacity: 1;
  }
  75% {
    opacity: 0.8;
  }
  100% {
    opacity: 0;
    rotate: 45deg;
  }
}
.sp-bloom {
  --shock: #ffc4dc;
}
.sp-bloom .sp-pinkglow {
  left: 50%;
  top: 44%;
  width: 260%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 190, 220, 0.55), rgba(255, 150, 200, 0.22) 34%, rgba(255, 150, 200, 0) 62%);
  animation-name: sp-glow;
  animation-duration: 2.6s;
}
.sp-bloom .sp-petal {
  left: 46%;
  top: 42%;
  width: calc(9% * var(--s, 1));
  aspect-ratio: 1 / 1.2;
  border-radius: 150% 0 150% 0;
  background: linear-gradient(135deg, #fff0f6, #ff9ec4 70%, #f77aa8);
  box-shadow: 0 0 calc(var(--u) * 2) rgba(255, 170, 200, 0.85);
  animation-name: sp-petal;
  animation-duration: 2.3s;
  animation-timing-function: cubic-bezier(0.15, 0.7, 0.35, 1);
}
@keyframes sp-petal {
  0% {
    opacity: 0;
    transform: rotate(var(--a)) translateY(0) rotate(0deg) scale(0.4);
  }
  15% {
    opacity: 1;
  }
  70% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: rotate(var(--a)) translateY(calc(var(--u) * var(--r) * -1)) rotate(var(--rot)) scale(1);
  }
}

/* 桜の花(5枚の花びら)。くるくる回りながら外へ咲き広がる */
.sp-bloom .sp-sakura {
  left: 50%;
  top: 44%;
  width: calc(17% * var(--s, 1));
  aspect-ratio: 1;
  margin: calc(-8.5% * var(--s, 1)) 0 0 calc(-8.5% * var(--s, 1));
  background:
    radial-gradient(circle at 50% 50%, #fff6b0 0 9%, #ff7fae 10% 15%, transparent 16%),
    radial-gradient(circle at 50% 22%, #ffe6f0 0 19%, transparent 20%),
    radial-gradient(circle at 77% 41%, #ffd2e4 0 19%, transparent 20%),
    radial-gradient(circle at 67% 74%, #ffc2da 0 19%, transparent 20%),
    radial-gradient(circle at 33% 74%, #ffc2da 0 19%, transparent 20%),
    radial-gradient(circle at 23% 41%, #ffd2e4 0 19%, transparent 20%);
  filter: drop-shadow(0 0 calc(var(--u) * 2) rgba(255, 150, 200, 0.9));
  animation-name: sp-sakura;
  animation-duration: 2.4s;
  animation-timing-function: cubic-bezier(0.15, 0.7, 0.35, 1);
}
@keyframes sp-sakura {
  0% {
    opacity: 0;
    transform: rotate(var(--a)) translateY(0) rotate(0deg) scale(0.2);
  }
  14% {
    opacity: 1;
  }
  75% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: rotate(var(--a)) translateY(calc(var(--u) * var(--r) * -1)) rotate(var(--rot)) scale(1);
  }
}
/* 横から吹き抜ける桜吹雪 */
.sp-bloom .sp-gust {
  left: -70%;
  top: var(--y);
  width: calc(7% * var(--s, 1));
  aspect-ratio: 1 / 1.25;
  border-radius: 150% 0 150% 0;
  background: linear-gradient(135deg, #fff2f7, #ffb0cf 65%, #ff86b4);
  box-shadow: 0 0 calc(var(--u) * 1.5) rgba(255, 170, 200, 0.75);
  animation-name: sp-gust;
  animation-duration: 1.9s;
  animation-timing-function: linear;
}
@keyframes sp-gust {
  0% {
    opacity: 0;
    transform: translate(0, 0) rotate(0deg);
  }
  10% {
    opacity: 1;
  }
  35% {
    transform: translate(calc(var(--u) * 80), calc(var(--u) * var(--wave))) rotate(calc(var(--rot) * 0.35));
  }
  65% {
    transform: translate(calc(var(--u) * 160), calc(var(--u) * var(--wave) * -1)) rotate(calc(var(--rot) * 0.65));
  }
  88% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(calc(var(--u) * 240), calc(var(--u) * var(--wave) * 0.5)) rotate(var(--rot));
  }
}

/* ---- 葛乃葉: 葛の葉がつむじ風に舞ってカードのまわりをらせん状に昇り、青い狐火に変わる。最後に紫の九尾の影が扇のように一瞬浮かぶ
   (2026年11月21日、くまねこ堂の指定で、見本の「葛の葉が舞う」の ① らせん と、最後の「A 尾の影」にした)。
   座標はカードの幅 = 100(--u)。葉はカードの下(--y0)から昇る。 ---- */
.sp-fox .kz-defs {
  width: 0;
  height: 0;
}
.sp-fox .kz-aura {
  left: 50%;
  top: 50%;
  width: 250%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(90, 190, 170, 0.32), rgba(50, 80, 180, 0.26) 40%, rgba(20, 20, 80, 0) 66%);
  animation-name: sp-glow;
  animation-duration: 2.8s;
}
/* 葉: 位置と奥行き(kz-swirl)と、出て消える(kz-fade) */
.sp-fox .kz-leaf {
  left: calc(var(--u) * 50);
  top: calc(var(--u) * var(--y0));
  width: calc(var(--u) * 21);
  aspect-ratio: 1;
  margin: calc(var(--u) * -10.5) 0 0 calc(var(--u) * -10.5);
  animation-name: kz-swirl, kz-fade;
  animation-duration: var(--dur), var(--dur);
  animation-timing-function: linear, ease-out;
}
@keyframes kz-fade {
  0% {
    opacity: 0;
  }
  8% {
    opacity: 1;
  }
  86% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
@keyframes kz-swirl {
  0.00% {
    translate: calc(var(--u) * var(--R) * (0.00 * var(--C) + 1.00 * var(--S))) calc(var(--u) * (0.00 + 14 * (1.00 * var(--C) - 0.00 * var(--S))));
    scale: calc(0.82 + 0.26 * (1.00 * var(--C) - 0.00 * var(--S)));
    filter: brightness(calc(0.88 + 0.22 * (1.00 * var(--C) - 0.00 * var(--S))));
  }
  4.17% {
    translate: calc(var(--u) * var(--R) * (0.59 * var(--C) + 0.81 * var(--S))) calc(var(--u) * (-5.62 + 14 * (0.81 * var(--C) - 0.59 * var(--S))));
    scale: calc(0.82 + 0.26 * (0.81 * var(--C) - 0.59 * var(--S)));
    filter: brightness(calc(0.88 + 0.22 * (0.81 * var(--C) - 0.59 * var(--S))));
  }
  8.33% {
    translate: calc(var(--u) * var(--R) * (0.95 * var(--C) + 0.31 * var(--S))) calc(var(--u) * (-11.25 + 14 * (0.31 * var(--C) - 0.95 * var(--S))));
    scale: calc(0.82 + 0.26 * (0.31 * var(--C) - 0.95 * var(--S)));
    filter: brightness(calc(0.88 + 0.22 * (0.31 * var(--C) - 0.95 * var(--S))));
  }
  12.50% {
    translate: calc(var(--u) * var(--R) * (0.95 * var(--C) + -0.31 * var(--S))) calc(var(--u) * (-16.88 + 14 * (-0.31 * var(--C) - 0.95 * var(--S))));
    scale: calc(0.82 + 0.26 * (-0.31 * var(--C) - 0.95 * var(--S)));
    filter: brightness(calc(0.88 + 0.22 * (-0.31 * var(--C) - 0.95 * var(--S))));
  }
  16.67% {
    translate: calc(var(--u) * var(--R) * (0.59 * var(--C) + -0.81 * var(--S))) calc(var(--u) * (-22.50 + 14 * (-0.81 * var(--C) - 0.59 * var(--S))));
    scale: calc(0.82 + 0.26 * (-0.81 * var(--C) - 0.59 * var(--S)));
    filter: brightness(calc(0.88 + 0.22 * (-0.81 * var(--C) - 0.59 * var(--S))));
  }
  20.83% {
    translate: calc(var(--u) * var(--R) * (0.00 * var(--C) + -1.00 * var(--S))) calc(var(--u) * (-28.12 + 14 * (-1.00 * var(--C) - 0.00 * var(--S))));
    scale: calc(0.82 + 0.26 * (-1.00 * var(--C) - 0.00 * var(--S)));
    filter: brightness(calc(0.88 + 0.22 * (-1.00 * var(--C) - 0.00 * var(--S))));
  }
  25.00% {
    translate: calc(var(--u) * var(--R) * (-0.59 * var(--C) + -0.81 * var(--S))) calc(var(--u) * (-33.75 + 14 * (-0.81 * var(--C) - -0.59 * var(--S))));
    scale: calc(0.82 + 0.26 * (-0.81 * var(--C) - -0.59 * var(--S)));
    filter: brightness(calc(0.88 + 0.22 * (-0.81 * var(--C) - -0.59 * var(--S))));
  }
  29.17% {
    translate: calc(var(--u) * var(--R) * (-0.95 * var(--C) + -0.31 * var(--S))) calc(var(--u) * (-39.38 + 14 * (-0.31 * var(--C) - -0.95 * var(--S))));
    scale: calc(0.82 + 0.26 * (-0.31 * var(--C) - -0.95 * var(--S)));
    filter: brightness(calc(0.88 + 0.22 * (-0.31 * var(--C) - -0.95 * var(--S))));
  }
  33.33% {
    translate: calc(var(--u) * var(--R) * (-0.95 * var(--C) + 0.31 * var(--S))) calc(var(--u) * (-45.00 + 14 * (0.31 * var(--C) - -0.95 * var(--S))));
    scale: calc(0.82 + 0.26 * (0.31 * var(--C) - -0.95 * var(--S)));
    filter: brightness(calc(0.88 + 0.22 * (0.31 * var(--C) - -0.95 * var(--S))));
  }
  37.50% {
    translate: calc(var(--u) * var(--R) * (-0.59 * var(--C) + 0.81 * var(--S))) calc(var(--u) * (-50.62 + 14 * (0.81 * var(--C) - -0.59 * var(--S))));
    scale: calc(0.82 + 0.26 * (0.81 * var(--C) - -0.59 * var(--S)));
    filter: brightness(calc(0.88 + 0.22 * (0.81 * var(--C) - -0.59 * var(--S))));
  }
  41.67% {
    translate: calc(var(--u) * var(--R) * (0.00 * var(--C) + 1.00 * var(--S))) calc(var(--u) * (-56.25 + 14 * (1.00 * var(--C) - 0.00 * var(--S))));
    scale: calc(0.82 + 0.26 * (1.00 * var(--C) - 0.00 * var(--S)));
    filter: brightness(calc(0.88 + 0.22 * (1.00 * var(--C) - 0.00 * var(--S))));
  }
  45.83% {
    translate: calc(var(--u) * var(--R) * (0.59 * var(--C) + 0.81 * var(--S))) calc(var(--u) * (-61.88 + 14 * (0.81 * var(--C) - 0.59 * var(--S))));
    scale: calc(0.82 + 0.26 * (0.81 * var(--C) - 0.59 * var(--S)));
    filter: brightness(calc(0.88 + 0.22 * (0.81 * var(--C) - 0.59 * var(--S))));
  }
  50.00% {
    translate: calc(var(--u) * var(--R) * (0.95 * var(--C) + 0.31 * var(--S))) calc(var(--u) * (-67.50 + 14 * (0.31 * var(--C) - 0.95 * var(--S))));
    scale: calc(0.82 + 0.26 * (0.31 * var(--C) - 0.95 * var(--S)));
    filter: brightness(calc(0.88 + 0.22 * (0.31 * var(--C) - 0.95 * var(--S))));
  }
  54.17% {
    translate: calc(var(--u) * var(--R) * (0.95 * var(--C) + -0.31 * var(--S))) calc(var(--u) * (-73.12 + 14 * (-0.31 * var(--C) - 0.95 * var(--S))));
    scale: calc(0.82 + 0.26 * (-0.31 * var(--C) - 0.95 * var(--S)));
    filter: brightness(calc(0.88 + 0.22 * (-0.31 * var(--C) - 0.95 * var(--S))));
  }
  58.33% {
    translate: calc(var(--u) * var(--R) * (0.59 * var(--C) + -0.81 * var(--S))) calc(var(--u) * (-78.75 + 14 * (-0.81 * var(--C) - 0.59 * var(--S))));
    scale: calc(0.82 + 0.26 * (-0.81 * var(--C) - 0.59 * var(--S)));
    filter: brightness(calc(0.88 + 0.22 * (-0.81 * var(--C) - 0.59 * var(--S))));
  }
  62.50% {
    translate: calc(var(--u) * var(--R) * (0.00 * var(--C) + -1.00 * var(--S))) calc(var(--u) * (-84.38 + 14 * (-1.00 * var(--C) - 0.00 * var(--S))));
    scale: calc(0.82 + 0.26 * (-1.00 * var(--C) - 0.00 * var(--S)));
    filter: brightness(calc(0.88 + 0.22 * (-1.00 * var(--C) - 0.00 * var(--S))));
  }
  66.67% {
    translate: calc(var(--u) * var(--R) * (-0.59 * var(--C) + -0.81 * var(--S))) calc(var(--u) * (-90.00 + 14 * (-0.81 * var(--C) - -0.59 * var(--S))));
    scale: calc(0.82 + 0.26 * (-0.81 * var(--C) - -0.59 * var(--S)));
    filter: brightness(calc(0.88 + 0.22 * (-0.81 * var(--C) - -0.59 * var(--S))));
  }
  70.83% {
    translate: calc(var(--u) * var(--R) * (-0.95 * var(--C) + -0.31 * var(--S))) calc(var(--u) * (-95.62 + 14 * (-0.31 * var(--C) - -0.95 * var(--S))));
    scale: calc(0.82 + 0.26 * (-0.31 * var(--C) - -0.95 * var(--S)));
    filter: brightness(calc(0.88 + 0.22 * (-0.31 * var(--C) - -0.95 * var(--S))));
  }
  75.00% {
    translate: calc(var(--u) * var(--R) * (-0.95 * var(--C) + 0.31 * var(--S))) calc(var(--u) * (-101.25 + 14 * (0.31 * var(--C) - -0.95 * var(--S))));
    scale: calc(0.82 + 0.26 * (0.31 * var(--C) - -0.95 * var(--S)));
    filter: brightness(calc(0.88 + 0.22 * (0.31 * var(--C) - -0.95 * var(--S))));
  }
  79.17% {
    translate: calc(var(--u) * var(--R) * (-0.59 * var(--C) + 0.81 * var(--S))) calc(var(--u) * (-106.88 + 14 * (0.81 * var(--C) - -0.59 * var(--S))));
    scale: calc(0.82 + 0.26 * (0.81 * var(--C) - -0.59 * var(--S)));
    filter: brightness(calc(0.88 + 0.22 * (0.81 * var(--C) - -0.59 * var(--S))));
  }
  83.33% {
    translate: calc(var(--u) * var(--R) * (0.00 * var(--C) + 1.00 * var(--S))) calc(var(--u) * (-112.50 + 14 * (1.00 * var(--C) - 0.00 * var(--S))));
    scale: calc(0.82 + 0.26 * (1.00 * var(--C) - 0.00 * var(--S)));
    filter: brightness(calc(0.88 + 0.22 * (1.00 * var(--C) - 0.00 * var(--S))));
  }
  87.50% {
    translate: calc(var(--u) * var(--R) * (0.59 * var(--C) + 0.81 * var(--S))) calc(var(--u) * (-118.12 + 14 * (0.81 * var(--C) - 0.59 * var(--S))));
    scale: calc(0.82 + 0.26 * (0.81 * var(--C) - 0.59 * var(--S)));
    filter: brightness(calc(0.88 + 0.22 * (0.81 * var(--C) - 0.59 * var(--S))));
  }
  91.67% {
    translate: calc(var(--u) * var(--R) * (0.95 * var(--C) + 0.31 * var(--S))) calc(var(--u) * (-123.75 + 14 * (0.31 * var(--C) - 0.95 * var(--S))));
    scale: calc(0.82 + 0.26 * (0.31 * var(--C) - 0.95 * var(--S)));
    filter: brightness(calc(0.88 + 0.22 * (0.31 * var(--C) - 0.95 * var(--S))));
  }
  95.83% {
    translate: calc(var(--u) * var(--R) * (0.95 * var(--C) + -0.31 * var(--S))) calc(var(--u) * (-129.38 + 14 * (-0.31 * var(--C) - 0.95 * var(--S))));
    scale: calc(0.82 + 0.26 * (-0.31 * var(--C) - 0.95 * var(--S)));
    filter: brightness(calc(0.88 + 0.22 * (-0.31 * var(--C) - 0.95 * var(--S))));
  }
  100.00% {
    translate: calc(var(--u) * var(--R) * (0.59 * var(--C) + -0.81 * var(--S))) calc(var(--u) * (-135.00 + 14 * (-0.81 * var(--C) - 0.59 * var(--S))));
    scale: calc(0.82 + 0.26 * (-0.81 * var(--C) - 0.59 * var(--S)));
    filter: brightness(calc(0.88 + 0.22 * (-0.81 * var(--C) - 0.59 * var(--S))));
  }
}
/* 葉そのもの: くるくる回り(kz-tumble)、1.35秒で消えて(kz-lfout)狐火に変わる */
.sp-fox .kz-lf {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  filter: drop-shadow(0 0 calc(var(--u) * 1.2) rgba(210, 255, 225, 0.95)) drop-shadow(0 0 calc(var(--u) * 3.5) rgba(120, 230, 180, 0.55));
  animation-name: kz-tumble, kz-lfout;
  animation-duration: var(--dur), 0.25s;
  animation-timing-function: linear, ease-in;
  animation-fill-mode: both;
  animation-delay: calc(var(--sp-t, 0.7s) + var(--d, 0s)), calc(var(--sp-t, 0.7s) + 1.35s + var(--j, 0s));
}
@keyframes kz-tumble {
  0% {
    transform: rotate3d(1, 0.6, 0.2, 0deg);
    rotate: 0deg;
  }
  100% {
    transform: rotate3d(1, 0.6, 0.2, calc(var(--spin) * 760deg));
    rotate: calc(var(--spin) * 300deg);
  }
}
@keyframes kz-lfout {
  0% {
    opacity: 1;
    scale: 1;
  }
  100% {
    opacity: 0;
    scale: 0.3;
  }
}
.sp-fox .kz-lfire {
  position: absolute;
  display: block;
  left: 50%;
  top: 50%;
  width: 80%;
  aspect-ratio: 1;
  margin: -40% 0 0 -40%;
  border-radius: 50% 0 50% 50%;
  rotate: -45deg;
  background: radial-gradient(circle at 40% 60%, #fff 0 14%, #cfeaff 30%, #6fb6ff 58%, #2f5fd6 100%);
  box-shadow: 0 0 calc(var(--u) * 2.5) rgba(150, 210, 255, 0.95), 0 0 calc(var(--u) * 7) rgba(80, 140, 255, 0.7);
  opacity: 0;
  animation: kz-lfin 1.1s ease-out both;
  animation-delay: calc(var(--sp-t, 0.7s) + 1.35s + var(--j, 0s));
}
@keyframes kz-lfin {
  0% {
    opacity: 0;
    scale: 0.2;
  }
  18% {
    opacity: 1;
    scale: 1.4;
  }
  35% {
    scale: 0.92;
  }
  55% {
    scale: 1.1;
  }
  100% {
    opacity: 0.9;
    scale: 1;
  }
}
/* 九尾の影: カードの下寄り(50, 96)を根もとに、扇のように開く。左の尾は左右反転して、先が外へ反る */
.sp-fox .kz-shade {
  left: calc(var(--u) * 50);
  top: calc(var(--u) * 96);
  height: calc(var(--u) * var(--L));
  width: calc(var(--u) * var(--L) * 0.4);
  translate: -50% -100%;
  transform-origin: 50% 100%;
  rotate: var(--a);
  animation-name: kz-shade;
  animation-duration: 1s;
}
.sp-fox .kz-shade svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  filter: drop-shadow(0 0 calc(var(--u) * 1.5) rgba(140, 190, 255, 0.95)) drop-shadow(0 0 calc(var(--u) * 5) rgba(90, 120, 255, 0.6));
}
.sp-fox .kz-l > svg {
  scale: -1 1;
}
@keyframes kz-shade {
  0% {
    opacity: 0;
    scale: 0.88;
  }
  30% {
    opacity: 0.95;
    scale: 1;
  }
  100% {
    opacity: 0;
    scale: 1.08;
  }
}

/* ---- ルージュ&アズール(2026年11月21日、くまねこ堂の指定で、見本の A「紅蒼の光翼」と B「融け合う炎」を合わせた):
   光でできた悪魔の翼が、左は紅・右は蒼で大きく開いて羽ばたく。紅と蒼の炎が尾を引きながらカードのまわりをらせん状に昇り、
   頭上で融け合って紫の炎が噴き上がる ---- */
.sp-devil {
  --shock: #d48cff;
}
.sp-devil .rd-r {
  --c: #ff4a6e;
  --c2: rgba(255, 60, 100, 0.85);
}
.sp-devil .rd-b {
  --c: #5aa0ff;
  --c2: rgba(70, 140, 255, 0.85);
}
/* 翼のうしろの、紅と蒼の光 */
.sp-devil .rd-glow {
  top: 36%;
  width: 200%;
  aspect-ratio: 1.2;
  translate: -50% -50%;
  border-radius: 50%;
  animation-name: sp-glow;
  animation-duration: 2.8s;
}
.sp-devil .rd-glow-r {
  left: 0%;
  background: radial-gradient(ellipse, rgba(255, 60, 100, 0.55), rgba(255, 60, 100, 0) 60%);
}
.sp-devil .rd-glow-b {
  left: 100%;
  background: radial-gradient(ellipse, rgba(70, 140, 255, 0.55), rgba(70, 140, 255, 0) 60%);
}
/* 光の翼(右の翼の絵を、左は左右反転)。開いて、2度羽ばたいて、消える */
.sp-devil .rd-wing {
  top: -14%;
  width: 150%;
  height: 92%;
  animation-name: rd-wing;
  animation-duration: 2.8s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.3, 1);
}
.sp-devil .rd-wing svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 0 calc(var(--u) * 1.5) var(--wc)) drop-shadow(0 0 calc(var(--u) * 6) var(--wc));
}
.sp-devil .rd-wing-r {
  --dir: 1;
  --wc: #6eb0ff;
  --wc2: rgba(40, 90, 230, 0.55);
  --d: 0.06s;
  left: 44%;
  transform-origin: 0% 66%;
}
.sp-devil .rd-wing-l {
  --dir: -1;
  --wc: #ff5a80;
  --wc2: rgba(220, 30, 70, 0.55);
  right: 44%;
  transform-origin: 100% 66%;
}
.sp-devil .rd-wing-l svg {
  transform: scaleX(-1);
}
.sp-devil .rd-wing .rw-m {
  fill: var(--wc2);
  stroke: var(--wc);
  stroke-width: 1.6px;
  vector-effect: non-scaling-stroke;
}
.sp-devil .rd-wing .rw-b {
  fill: none;
  stroke: #fff;
  stroke-width: 1.2px;
  vector-effect: non-scaling-stroke;
  opacity: 0.85;
}
@keyframes rd-wing {
  0% {
    opacity: 0;
    scale: 0.08 0.4;
    rotate: calc(var(--dir) * 30deg);
  }
  20% {
    opacity: 1;
    scale: 1.06 1;
    rotate: calc(var(--dir) * -6deg);
  }
  29% {
    scale: 0.96 0.96;
    rotate: 0deg;
  }
  38% {
    scale: 1.04 1.02;
    rotate: calc(var(--dir) * -4deg);
  }
  47% {
    scale: 0.92 0.94;
    rotate: calc(var(--dir) * 6deg);
  }
  58% {
    scale: 1.04 1.02;
    rotate: calc(var(--dir) * -4deg);
  }
  70% {
    opacity: 0.95;
    scale: 1 1;
    rotate: 0deg;
  }
  100% {
    opacity: 0;
    scale: 1.06 1.04;
    rotate: 0deg;
  }
}
/* 紅と蒼の炎: カードの下から、まわりをらせん状に昇って、頭上で出会う(--amp = 1 紅は右から / -1 蒼は左から) */
.sp-devil .rd-comet {
  left: 50%;
  top: calc(var(--u) * 150);
  width: calc(var(--u) * 15 * var(--s));
  aspect-ratio: 1;
  margin: calc(var(--u) * -7.5 * var(--s)) 0 0 calc(var(--u) * -7.5 * var(--s));
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0 20%, var(--c) 44%, rgba(0, 0, 0, 0) 72%);
  box-shadow: 0 0 calc(var(--u) * 5) var(--c), 0 0 calc(var(--u) * 14) var(--c2);
  animation-name: rd-helix;
  animation-duration: 1.45s;
  animation-timing-function: linear;
}
@keyframes rd-helix {
  0% {
    opacity: 0;
    translate: 0 0;
  }
  6% {
    opacity: var(--o);
  }
  12.5% {
    translate: calc(var(--u) * 84 * var(--amp) * 0.707) calc(var(--u) * -20);
  }
  25% {
    translate: calc(var(--u) * 86 * var(--amp)) calc(var(--u) * -40);
  }
  37.5% {
    translate: calc(var(--u) * 82 * var(--amp) * 0.707) calc(var(--u) * -60);
  }
  50% {
    translate: 0 calc(var(--u) * -80);
  }
  62.5% {
    translate: calc(var(--u) * -80 * var(--amp) * 0.707) calc(var(--u) * -100);
  }
  75% {
    translate: calc(var(--u) * -80 * var(--amp)) calc(var(--u) * -120);
  }
  87.5% {
    translate: calc(var(--u) * -56 * var(--amp) * 0.707) calc(var(--u) * -142);
    opacity: var(--o);
  }
  100% {
    translate: 0 calc(var(--u) * -165);
    opacity: 0;
  }
}
/* 融け合ったところの紫の光と、噴き上がる紫の炎 */
.sp-devil .rd-violet {
  --d: 1.37s;
  left: 50%;
  top: calc(var(--u) * -10);
  width: 320%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 230, 255, 0.9) 0 6%, rgba(190, 90, 255, 0.7) 18%, rgba(120, 40, 200, 0.35) 34%, rgba(80, 20, 160, 0) 58%);
  animation-name: sp-glow;
  animation-duration: 1.8s;
}
.sp-devil .rd-vt {
  left: var(--x);
  top: calc(var(--u) * 8);
  width: calc(var(--u) * 16);
  height: calc(var(--u) * var(--h));
  translate: -50% -100%;
  transform-origin: 50% 100%;
  border-radius: 50% 50% 35% 35% / 70% 70% 30% 30%;
  mix-blend-mode: screen;
  filter: blur(calc(var(--u) * 1));
  background: radial-gradient(ellipse at 50% 85%, #fff 0 12%, #f0b6ff 26%, #b45cff 50%, rgba(110, 30, 220, 0) 76%);
  animation-name: rd-vflame;
  animation-duration: 1.6s;
}
@keyframes rd-vflame {
  0% {
    opacity: 0;
    scale: 1 0.1;
  }
  18% {
    opacity: 1;
    scale: 1.05 1.15;
    skew: var(--sk);
  }
  40% {
    scale: 0.92 0.95;
    skew: calc(var(--sk) * -1);
  }
  62% {
    scale: 1.04 1.08;
    skew: var(--sk);
  }
  100% {
    opacity: 0;
    scale: 0.8 1.3;
    skew: 0deg;
  }
}
.sp-devil .rd-bloom {
  --d: 1.4s;
  left: 50%;
  top: calc(var(--u) * -12);
  width: 260%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0 5%, rgba(200, 110, 255, 0.6) 16%, rgba(0, 0, 0, 0) 44%);
  animation-name: sp-flash;
  animation-duration: 0.6s;
}
/* 紫の衝撃の輪(融け合ったところから。UR の共通の .sp-front .sp-shock より強く指定する) */
.sp-front.sp-devil .sp-shock {
  --d: 1.42s;
  top: calc(var(--u) * -10);
}
/* 光の粒: 翼から舞い、融け合ったあとにも散る */
.sp-devil .rd-mote {
  left: var(--x);
  top: calc(var(--u) * var(--y));
  width: 2.4%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0 25%, var(--c) 50%, rgba(0, 0, 0, 0) 72%);
  box-shadow: 0 0 calc(var(--u) * 2) var(--c);
  animation-name: rd-mote;
  animation-duration: 1.6s;
}
@keyframes rd-mote {
  0% {
    opacity: 0;
    translate: 0 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    translate: calc(var(--u) * var(--dx)) calc(var(--u) * var(--h) * -1);
  }
}

/* ---- リオ: ロシアンルーレット。後ろでリボルバーの弾倉が回って止まり、「バン!」——
       銃口の閃光、弾道、弾痕、跳ねる薬莢、流れる硝煙。
       弾が弾けるのは、止まった弾倉のいちばん上の穴(金の実弾。2026年11月21日、くまねこ堂の指定)。--fx・--fy がその位置 ---- */
.sp-gun {
  --shock: #ffe2a0;
  --fx: 50%;
  --fy: 5.3%;
}
.sp-gun .sp-cylinder {
  left: 50%;
  top: 46%;
  width: 165%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background:
    radial-gradient(circle, #1b1d24 0 9%, #8d939e 10% 12%, transparent 13%),
    radial-gradient(circle at 34% 30%, #d9dde4, #8a909b 38%, #3c4049 72%, #24262d);
  box-shadow: inset 0 0 0 calc(var(--u) * 2) #5b606a, inset 0 0 calc(var(--u) * 10) rgba(0, 0, 0, 0.6), 0 0 calc(var(--u) * 10) rgba(0, 0, 0, 0.6);
  animation-name: sp-cylinder;
  animation-duration: 2.5s;
  animation-timing-function: linear;
}
/* 弾倉の6つの穴(1つだけ金色 = 実弾。撃ったら空になる) */
.sp-gun .sp-cylinder > b {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 24%;
  aspect-ratio: 1;
  margin: -12% 0 0 -12%;
  border-radius: 50%;
  background: radial-gradient(circle at 45% 40%, #0b0c10 0 52%, #2a2d34 60%, #6d727c 70%, transparent 72%);
  transform: rotate(calc(var(--k) * 60deg)) translateY(-150%);
}
.sp-gun .sp-cylinder > b:first-child {
  background: radial-gradient(circle at 45% 40%, #fff1b8 0 16%, #e2b440 30%, #8a6418 50%, #2a2d34 60%, #6d727c 70%, transparent 72%);
}
/* 撃ったら、金の実弾は消えて空の穴になる(撃った瞬間に白く光ってから。2026年11月21日、くまねこ堂の指定「弾を撃ったら残らないように」) */
.sp-gun .sp-cylinder > b:first-child::before,
.sp-gun .sp-cylinder > b:first-child::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  opacity: 0;
  animation-fill-mode: both;
  animation-delay: calc(var(--sp-t, 0.7s) + 1s);
}
.sp-gun .sp-cylinder > b:first-child::after {
  background: radial-gradient(circle at 45% 40%, #0b0c10 0 52%, #2a2d34 60%, #6d727c 70%, transparent 72%);
  animation-name: sp-spent;
  animation-duration: 0.12s;
}
.sp-gun .sp-cylinder > b:first-child::before {
  z-index: 1;
  inset: -30%;
  background: radial-gradient(circle, #fff 0 18%, rgba(255, 220, 140, 0.8) 32%, rgba(255, 170, 60, 0) 62%);
  animation-name: sp-flash;
  animation-duration: 0.45s;
}
@keyframes sp-spent {
  to {
    opacity: 1;
  }
}
@keyframes sp-cylinder {
  0% {
    opacity: 0;
    scale: 0.6;
    rotate: 0deg;
    animation-timing-function: cubic-bezier(0.2, 0.6, 0.4, 1);
  }
  10% {
    opacity: 1;
    scale: 1;
  }
  36% {
    rotate: 1020deg;
    animation-timing-function: ease-out;
  }
  40% {
    rotate: 1080deg;
  }
  43% {
    scale: 1.04;
  }
  46% {
    scale: 1;
  }
  85% {
    opacity: 1;
    rotate: 1080deg;
  }
  100% {
    opacity: 0;
    rotate: 1080deg;
    scale: 1.05;
  }
}
/* 撃った瞬間の、まわりの明るさ */
.sp-gun .sp-gunglow {
  --d: 1s;
  left: var(--fx);
  top: var(--fy);
  width: 260%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 236, 170, 0.75), rgba(255, 170, 60, 0.25) 26%, rgba(255, 170, 60, 0) 52%);
  animation-name: sp-flash;
  animation-duration: 0.7s;
}
/* 弾が弾ける閃光(弾倉のいちばん上の穴から) */
.sp-gun .sp-muzzle {
  --d: 1s;
  left: var(--fx);
  top: var(--fy);
  width: 70%;
  aspect-ratio: 1;
  translate: -50% -50%;
  clip-path: polygon(50% 0, 58% 34%, 92% 12%, 66% 44%, 100% 50%, 66% 56%, 92% 88%, 58% 66%, 50% 100%, 42% 66%, 8% 88%, 34% 56%, 0 50%, 34% 44%, 8% 12%, 42% 34%);
  background: radial-gradient(circle, #ffffff 0 14%, #fff2b0 26%, #ffb340 52%, rgba(255, 120, 30, 0) 72%);
  animation-name: sp-muzzle;
  animation-duration: 0.45s;
}
@keyframes sp-muzzle {
  0% {
    opacity: 0;
    scale: 0.3;
    rotate: 0deg;
  }
  12% {
    opacity: 1;
    scale: 1.15;
  }
  100% {
    opacity: 0;
    scale: 0.8;
    rotate: 18deg;
  }
}
/* 弾道(弾倉のいちばん上の穴から、左下の弾痕へ走る光の線) */
.sp-gun .sp-tracer {
  --d: 1s;
  left: 17%;
  top: 39.6%;
  width: 150%;
  height: 1.6%;
  translate: -50% -50%;
  rotate: -56.7deg;
  border-radius: 50%;
  background: linear-gradient(90deg, rgba(255, 230, 160, 0), #fff6d8 50%, rgba(255, 230, 160, 0));
  box-shadow: 0 0 calc(var(--u) * 3) #ffd36a;
  animation-name: sp-tracer;
  animation-duration: 0.35s;
}
@keyframes sp-tracer {
  0% {
    opacity: 0;
    clip-path: inset(0 0 0 100%);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    clip-path: inset(0 0 0 0);
  }
}
/* 弾痕(カードの左下の外。ひびの入った穴) */
.sp-gun .sp-hole {
  --d: 1.05s;
  left: -16%;
  top: 74%;
  width: 26%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background:
    radial-gradient(circle, #050608 0 12%, #3a3d45 15%, rgba(200, 205, 215, 0.55) 19%, transparent 24%),
    repeating-conic-gradient(rgba(220, 225, 235, 0.75) 0deg 2deg, transparent 2deg 33deg);
  -webkit-mask: radial-gradient(circle, #000 0 30%, rgba(0, 0, 0, 0.6) 50%, transparent 70%);
  mask: radial-gradient(circle, #000 0 30%, rgba(0, 0, 0, 0.6) 50%, transparent 70%);
  animation-name: sp-hole;
  animation-duration: 1.5s;
}
@keyframes sp-hole {
  0% {
    opacity: 0;
    scale: 0.4;
  }
  6% {
    opacity: 1;
    scale: 1.1;
  }
  12% {
    scale: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
/* 衝撃の輪も、弾が弾けた穴から(UR の共通の .sp-front .sp-shock より強く指定する) */
.sp-front.sp-gun .sp-shock {
  --d: 1s;
  left: var(--fx);
  top: var(--fy);
  width: 90%;
}
.sp-gun .sp-spark {
  left: var(--fx);
  top: var(--fy);
  width: 2.6%;
  aspect-ratio: 1;
  margin: -1.3% 0 0 -1.3%;
  border-radius: 50%;
  background: #fff3c4;
  box-shadow: 0 0 calc(var(--u) * 2) #ffb340;
  animation-name: sp-burst;
  animation-duration: 0.6s;
}
/* 薬莢: 弾倉の上から右へ跳ね出て、くるくる回って落ちる */
.sp-gun .sp-casing {
  left: 58%;
  top: 4%;
  width: 4.5%;
  aspect-ratio: 1 / 2.4;
  border-radius: 20% 20% 8% 8%;
  background: linear-gradient(90deg, #8a6418, #ffe08a 40%, #c79a2e 70%, #6e4f12);
  box-shadow: 0 0 calc(var(--u) * 1.5) rgba(255, 210, 110, 0.7);
  animation-name: sp-casing;
  animation-duration: 1.1s;
  animation-timing-function: linear;
}
@keyframes sp-casing {
  0% {
    opacity: 0;
    transform: translate(0, 0) rotate(0deg);
    animation-timing-function: cubic-bezier(0.2, 0.7, 0.4, 1);
  }
  8% {
    opacity: 1;
  }
  35% {
    transform: translate(calc(var(--u) * var(--dx)), calc(var(--u) * var(--h) * -1)) rotate(calc(var(--spin) * 0.4));
    animation-timing-function: cubic-bezier(0.5, 0, 0.9, 0.5);
  }
  85% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(calc(var(--u) * var(--dx) * 1.6), calc(var(--u) * 90)) rotate(var(--spin));
  }
}
/* 硝煙: 弾倉のいちばん上の穴から右上へ流れて消える */
.sp-gun .sp-smoke {
  left: var(--x);
  top: var(--y);
  width: 34%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(220, 222, 230, 0.5), rgba(200, 202, 210, 0.2) 45%, rgba(200, 202, 210, 0) 70%);
  filter: blur(calc(var(--u) * 1.5));
  animation-name: sp-smoke;
  animation-duration: 1.6s;
}
@keyframes sp-smoke {
  0% {
    opacity: 0;
    scale: 0.4;
    transform: translate(0, 0);
  }
  15% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    scale: 1.8;
    transform: translate(calc(var(--u) * var(--dx)), calc(var(--u) * -30));
  }
}

/* ---- ラグナロク: 暗転のあと、カードの絵と同じオーロラの空に、極太の金の雷が落ちて地面を打つ。2度打ち直し、地面に光と衝撃の輪、火花。
   後ろに金の魔法陣(2026年11月21日、くまねこ堂の指定「オーロラの空に A の雷で。雷は地面に落として」。それまでは細い雷が3本) ---- */
.sp-ragnarok .sp-dusk {
  left: 50%;
  top: 50%;
  width: 520%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(40, 0, 10, 0) 12%, rgba(30, 0, 12, 0.6) 30%, rgba(0, 0, 0, 0.72) 50%, rgba(0, 0, 0, 0) 70%);
  animation-name: sp-dusk;
  animation-duration: 2.6s;
}
@keyframes sp-dusk {
  0% {
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  75% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
.sp-ragnarok .sp-core {
  left: 50%;
  top: 48%;
  width: 170%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 240, 190, 0.9) 0 10%, rgba(240, 190, 90, 0.55) 26%, rgba(200, 120, 40, 0) 58%);
  animation-name: sp-glow;
  animation-duration: 2.4s;
}
.sp-ragnarok .sp-rune {
  left: 50%;
  top: 48%;
  width: 200%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  border: calc(var(--u) * 0.9) solid rgba(240, 212, 138, 0.95);
  box-shadow: 0 0 calc(var(--u) * 4) rgba(240, 212, 138, 0.8), inset 0 0 calc(var(--u) * 4) rgba(240, 212, 138, 0.5);
  animation-name: sp-rune;
  animation-duration: 2.5s;
  animation-timing-function: cubic-bezier(0.2, 0.7, 0.3, 1);
}
.sp-ragnarok .sp-rune::before {
  content: "";
  position: absolute;
  inset: 7%;
  border-radius: 50%;
  background: repeating-conic-gradient(rgba(240, 212, 138, 0.95) 0deg 2deg, transparent 2deg 10deg);
  -webkit-mask: radial-gradient(circle, transparent 62%, #000 64% 72%, transparent 74%);
  mask: radial-gradient(circle, transparent 62%, #000 64% 72%, transparent 74%);
}
.sp-ragnarok .sp-rune::after {
  content: "";
  position: absolute;
  inset: 20%;
  border-radius: 50%;
  border: calc(var(--u) * 0.6) dashed rgba(240, 212, 138, 0.8);
}
@keyframes sp-rune {
  0% {
    opacity: 0;
    scale: 0.2;
    rotate: -40deg;
  }
  30% {
    opacity: 1;
    scale: 1;
    rotate: 0deg;
  }
  80% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    scale: 1.12;
    rotate: 30deg;
  }
}
.sp-ragnarok .sp-flash {
  inset: 0;
  border-radius: 4.5% / 3.1%;
  background: #fff;
  animation-name: sp-flash;
  animation-duration: 0.55s;
}
.sp-ragnarok .sp-flash2 {
  --d: 0.34s;
}
@keyframes sp-flash {
  0% {
    opacity: 0;
  }
  12% {
    opacity: 0.85;
  }
  100% {
    opacity: 0;
  }
}
.sp-ragnarok .sp-ember {
  left: var(--x);
  top: 92%;
  width: 2.6%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, #fff3c4, #ffb34a 60%, rgba(255, 140, 40, 0));
  box-shadow: 0 0 calc(var(--u) * 2) #ffb34a;
  animation-name: sp-ember;
  animation-duration: 1.9s;
}
@keyframes sp-ember {
  0% {
    opacity: 0;
    translate: 0 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    translate: calc(var(--u) * var(--dx)) calc(var(--u) * -120);
  }
}

/* オーロラ(カードの絵の空と同じ、紫・紅・青緑のカーテン)。暗転のあいだから見え始める */
.sp-ragnarok .rg-aurora {
  left: 50%;
  top: calc(var(--u) * -120);
  width: 520%;
  height: calc(var(--u) * 260);
  translate: -50% -50%;
  background: repeating-linear-gradient(90deg, rgba(255, 60, 160, 0) 0, rgba(255, 60, 160, 0.55) 4%, rgba(170, 80, 255, 0.5) 9%, rgba(60, 220, 200, 0.35) 13%, rgba(60, 220, 200, 0) 18%);
  -webkit-mask: linear-gradient(rgba(0, 0, 0, 0), #000 30%, #000 55%, rgba(0, 0, 0, 0));
  mask: linear-gradient(rgba(0, 0, 0, 0), #000 30%, #000 55%, rgba(0, 0, 0, 0));
  filter: blur(calc(var(--u) * 3));
  animation-name: rg-aurora;
  animation-duration: 2.8s;
  --d: -0.4s;
}
.sp-ragnarok .rg-aurora2 {
  width: 420%;
  top: calc(var(--u) * -90);
  animation-duration: 2.6s;
  --dir: -1;
  --d: -0.3s;
}
@keyframes rg-aurora {
  0% {
    opacity: 0;
    transform: translateX(calc(var(--u) * -20 * var(--dir, 1))) skewX(-12deg);
  }
  25% {
    opacity: 1;
  }
  75% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: translateX(calc(var(--u) * 20 * var(--dir, 1))) skewX(10deg);
  }
}
/* 雷: カードのまわりの広い範囲(カードの幅の5倍)に SVG を重ねる。光の外側・中・芯の3本の線で、上から一気に走って明滅する */
.sp-ragnarok .rg-sky {
  left: calc(var(--u) * -200);
  top: calc(var(--u) * -300);
  width: calc(var(--u) * 500);
  height: calc(var(--u) * 520);
  opacity: 1;
  animation: none;
  filter: drop-shadow(0 0 calc(var(--u) * 1.5) #ffe9a8) drop-shadow(0 0 calc(var(--u) * 6) rgba(255, 180, 60, 0.85));
}
.sp-ragnarok .rg-sky svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.sp-ragnarok .rg-bolt {
  opacity: 0;
  animation: rg-flick var(--dur, 0.8s) linear both;
  animation-delay: calc(var(--sp-t, 0.7s) + 0.6s + var(--d, 0s));
}
.sp-ragnarok .rg-bolt path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: rg-draw 0.09s ease-out both;
  animation-delay: calc(var(--sp-t, 0.7s) + 0.6s + var(--d, 0s));
}
.sp-ragnarok .rg-glow {
  stroke: rgba(255, 200, 90, 0.45);
}
.sp-ragnarok .rg-mid {
  stroke: #fff2c4;
}
.sp-ragnarok .rg-core {
  stroke: #fff;
}
@keyframes rg-draw {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes rg-flick {
  0% {
    opacity: 0;
  }
  3% {
    opacity: 1;
  }
  14% {
    opacity: 1;
  }
  18% {
    opacity: 0.2;
  }
  24% {
    opacity: 1;
  }
  34% {
    opacity: 0.55;
  }
  42% {
    opacity: 1;
  }
  70% {
    opacity: 0.7;
  }
  100% {
    opacity: 0;
  }
}
/* 落ちた瞬間の、画面いっぱいの閃光(雷の落ちたあたりを中心に) */
.sp-ragnarok .rg-bloom {
  left: var(--gx);
  top: calc(var(--u) * 120);
  width: 900%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0 6%, rgba(255, 180, 60, 0.85) 16%, rgba(255, 255, 255, 0) 48%);
  animation-name: rg-bloom;
  animation-duration: 0.7s;
}
@keyframes rg-bloom {
  0% {
    opacity: 0;
  }
  8% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
/* 地面: 雷の落ちたところが白く光り、横に平たい衝撃の輪が2度広がる */
.sp-ragnarok .rg-ground {
  left: var(--gx);
  top: calc(var(--u) * 172);
  width: 320%;
  height: calc(var(--u) * 60);
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 255, 255, 0.95) 0 6%, rgba(255, 220, 140, 0.8) 16%, rgba(255, 150, 50, 0.35) 34%, rgba(255, 120, 40, 0) 62%);
  animation-name: rg-ground;
  animation-duration: 1.3s;
}
@keyframes rg-ground {
  0% {
    opacity: 0;
    scale: 0.4;
  }
  6% {
    opacity: 1;
    scale: 1;
  }
  40% {
    opacity: 0.75;
  }
  100% {
    opacity: 0;
    scale: 1.15;
  }
}
.sp-ragnarok .rg-ripple {
  left: var(--gx);
  top: calc(var(--u) * 172);
  width: 150%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  border: calc(var(--u) * 1.6) solid #ffd36a;
  box-shadow: 0 0 calc(var(--u) * 5) #ffd36a, inset 0 0 calc(var(--u) * 5) #ffd36a;
  transform: scaleY(0.26);
  animation-name: sp-shock;
  animation-duration: 0.95s;
  animation-timing-function: cubic-bezier(0.2, 0.7, 0.3, 1);
}
/* 火花: 地面から上へ扇のように噴き上がる */
.sp-ragnarok .rg-spark {
  left: var(--gx);
  top: calc(var(--u) * 172);
  width: calc(var(--u) * 1.6);
  height: calc(var(--u) * 9);
  margin: calc(var(--u) * -4.5) 0 0 calc(var(--u) * -0.8);
  border-radius: var(--u);
  background: linear-gradient(#fff3c4, rgba(255, 255, 255, 0));
  box-shadow: 0 0 calc(var(--u) * 2) #ffd36a;
  animation-name: sp-burst;
  animation-duration: 0.8s;
  animation-timing-function: cubic-bezier(0.1, 0.7, 0.3, 1);
}

/* ---- 桜井 月美: 三日月が昇り、星がはじけて輪になる。変身後の面では決め台詞「変身!」 ---- */
.sp-moon .sp-luna {
  left: 74%;
  top: -10%;
  width: 70%;
  aspect-ratio: 1;
  translate: -50% 0;
  border-radius: 50%;
  box-shadow: inset calc(var(--u) * -11) calc(var(--u) * 6) 0 0 #fff1b8;
  filter: drop-shadow(0 0 calc(var(--u) * 4) rgba(255, 236, 170, 0.9));
  animation-name: sp-luna;
  animation-duration: 2.3s;
}
@keyframes sp-luna {
  0% {
    opacity: 0;
    translate: -50% 30%;
    rotate: -20deg;
  }
  35% {
    opacity: 1;
    translate: -50% 0;
    rotate: 0deg;
  }
  85% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
.sp-moon .sp-star {
  left: 50%;
  top: 46%;
  width: var(--s);
  aspect-ratio: 1;
  margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2);
  background: radial-gradient(circle, #fff 0 22%, var(--c) 46%);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  animation-name: sp-star;
  animation-duration: 1.8s;
  animation-timing-function: cubic-bezier(0.2, 0.7, 0.3, 1);
}
@keyframes sp-star {
  0% {
    opacity: 0;
    transform: rotate(var(--a)) translateY(0) rotate(0deg) scale(0.3);
  }
  18% {
    opacity: 1;
  }
  60% {
    opacity: 1;
    transform: rotate(var(--a)) translateY(calc(var(--u) * var(--r) * -0.85)) rotate(140deg) scale(1.1);
  }
  100% {
    opacity: 0;
    transform: rotate(var(--a)) translateY(calc(var(--u) * var(--r) * -1)) rotate(220deg) scale(0.6);
  }
}
.sp-moon .sp-dot {
  left: 50%;
  top: 46%;
  width: 2.4%;
  aspect-ratio: 1;
  margin: -1.2% 0 0 -1.2%;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 calc(var(--u) * 2) #ffd1e8, 0 0 calc(var(--u) * 4) rgba(255, 180, 220, 0.8);
  animation-name: sp-dotring;
  animation-duration: 1.5s;
}
@keyframes sp-dotring {
  0% {
    opacity: 0;
    transform: rotate(var(--a)) translateY(0);
  }
  25% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: rotate(calc(var(--a) + 60deg)) translateY(calc(var(--u) * -78));
  }
}
.sp-moon .sp-call {
  --d: 0.25s;
  left: 50%;
  top: 44%;
  translate: -50% -50%;
  white-space: nowrap;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: calc(var(--u) * 17);
  line-height: 1;
  color: #fff;
  text-shadow: 0 0 calc(var(--u) * 2) #ff7ab6, 0 0 calc(var(--u) * 6) rgba(255, 122, 182, 0.9), 0 calc(var(--u) * 0.8) 0 #8a1a5a;
  animation-name: sp-call;
  animation-duration: 1.6s;
}
@keyframes sp-call {
  0% {
    opacity: 0;
    scale: 2;
  }
  20% {
    opacity: 1;
    scale: 0.92;
  }
  32% {
    scale: 1.04;
  }
  80% {
    opacity: 1;
    scale: 1;
  }
  100% {
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sp-back,
  .sp-front {
    display: none;
  }
}

/* ---------- トップのカード紹介(1枚。home.js の duelHTML) ----------
   1枚が場に出されてめくれ、横にフレーバーテキストとカード設定が出る(設定が無いカードは能力)。
   文章は public/data/card-lore.csv から(lore.js)。枠が狭いとき(スマホなど)は縦に並べる。 */
.duel {
  container-type: inline-size;
}
.tcard {
  --dw: clamp(150px, 15vw, 206px);
  width: 100%;
  display: grid;
  grid-template-columns: var(--dw) minmax(0, 1fr);
  align-items: start;
  gap: clamp(1rem, 2.4vw, 1.75rem);
  text-align: left;
}
.tcard .dflip {
  --from-x: -40px;
  --from-r: -8deg;
}
.tcard-text {
  display: grid;
  align-content: start;
  gap: 0.65rem;
  min-width: 0;
  animation: tcard-text 0.6s ease 1.15s both;
}
@keyframes tcard-text {
  from {
    opacity: 0;
    translate: 0 10px;
  }
}
.tcard-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--gold-bright);
}
.tcard-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
}
.tcard-meta span::before {
  content: "";
  width: 5px;
  height: 5px;
  background: var(--gold);
  transform: rotate(45deg);
}
.tcard-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.15rem, 1.9vw, 1.5rem);
  line-height: 1.35;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.tcard-flavor {
  margin: 0;
  padding: 0.1rem 0 0.1rem 0.9rem;
  border-left: 2px solid var(--gold);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 1.85;
  color: var(--gold-pale);
}
.tcard-story h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0.3rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--gold-bright);
}
.tcard-story h3::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: rgba(201, 162, 75, 0.45);
}
.tcard-story p {
  font-size: 0.875rem;
  line-height: 1.85;
  color: var(--ink-soft);
}
.tcard .tcard-story p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 8;
  line-clamp: 8;
  overflow: hidden;
}
.tcard-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1.4rem;
  margin-top: 0.2rem;
}
.tcard-acts .btn-link {
  min-height: 40px;
  color: var(--gold-bright);
}
@container (max-width: 470px) {
  .tcard {
    --dw: clamp(120px, 46cqw, 190px);
    grid-template-columns: 1fr;
    justify-items: center;
  }
  .tcard-text {
    width: 100%;
  }
}
/* 拡大画面でも、フレーバーテキストと裏話を出す */
.zoom-lore {
  display: grid;
  gap: 0.9rem;
  margin: 1rem 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(201, 162, 75, 0.45);
}

/* ================= オープニング(intro.js) =================
   第1〜4弾のパックが4袋、扇に並ぶ。好きな袋を押すと、その袋が前に出て(0〜0.45秒)、ほかは下がる。
   袋が震え(0.45秒)、上の封がちぎれ(0.69秒)、口から光の柱が立ち、光の粒がのぼる。カードの動きと、画面を包む光は intro.js。
   袋は、表紙の絵を上下まで見せ、その上下に銀の封(ギザギザ)を足した形(幅 : 高さ = 50 : 78。絵は 5 : 7)。
   袋の形は、封をちぎる線で「ふた」と「本体」に切り分けて重ねる(intro.js の CLIP)。 */
body.intro-on {
  overflow: hidden;
}
.intro {
  --pw: min(30vw, 21vh, 210px);
  --ph: calc(var(--pw) * 1.56);
  --pick: 1.5;
  position: fixed;
  inset: 0;
  z-index: 300;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.op-scene {
  position: absolute;
  inset: 0;
}
.op-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 50% at 50% 46%, rgba(214, 178, 92, 0.24), rgba(10, 16, 48, 0) 70%),
    repeating-linear-gradient(45deg, rgba(201, 162, 75, 0.06) 0 1px, transparent 1px 36px),
    repeating-linear-gradient(-45deg, rgba(201, 162, 75, 0.06) 0 1px, transparent 1px 36px),
    var(--night);
}
.op-cap,
.op-hint {
  position: absolute;
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
}
.op-cap {
  top: calc(46% + var(--ph) / 2 + max(2.6rem, 6vh));
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(0.9375rem, 1.6vw, 1.125rem);
  letter-spacing: 0.3em;
  color: var(--gold-bright);
}
.op-hint {
  top: calc(46% + var(--ph) / 2 + max(4.9rem, 6vh + 2.3rem));
  font-size: clamp(0.875rem, 1.4vw, 1rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--ink);
  animation: op-hint 1.8s ease-in-out infinite;
}
/* 今日の1パック / おまけの1パック の見出し(袋の上)。確定の日は金に光る */
.op-top {
  position: absolute;
  left: 0;
  right: 0;
  top: max(1.2rem, calc(46% - var(--ph) / 2 - 6.4rem));
  display: grid;
  gap: 0.35rem;
  justify-items: center;
  margin: 0;
  text-align: center;
  pointer-events: none;
}
.op-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.375rem, 3.2vw, 1.875rem);
  letter-spacing: 0.14em;
  color: var(--gold-bright);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.7);
}
.op-note {
  margin: 0;
  font-size: clamp(0.8125rem, 1.3vw, 0.9375rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--on-night-soft);
}
.op-note.is-g {
  padding: 0.2em 0.9em;
  border: 1px solid var(--gold-bright);
  background: rgba(10, 16, 48, 0.75);
  color: var(--gold-pale);
  box-shadow: 0 0 18px -2px rgba(240, 212, 138, 0.55);
}
.opening .op-top {
  animation: op-out 0.25s ease forwards;
}
@keyframes op-hint {
  50% {
    opacity: 0.35;
  }
}
/* 袋(押せるボタン)。扇: --k = 位置(−1.5 … 1.5)、--lift = 端ほど下げる */
.op-pack {
  position: absolute;
  left: calc(50% - var(--pw) / 2);
  top: calc(46% - var(--ph) / 2);
  z-index: 1;
  width: var(--pw);
  height: var(--ph);
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transform: translateX(calc(var(--k) * var(--pw) * 0.66)) translateY(var(--lift)) rotate(calc(var(--k) * 6.5deg));
}
.op-pack:focus-visible {
  outline: none;
}
.intro:focus {
  outline: none;
}
.op-pieces {
  position: absolute;
  inset: 0;
  filter: drop-shadow(0 0 1.5px rgba(226, 232, 242, 0.9)) drop-shadow(0 14px 18px rgba(0, 0, 0, 0.6));
  animation: op-bob 3.2s ease-in-out calc(var(--i) * -0.7s) infinite;
  transition: translate 0.15s ease;
}
@keyframes op-bob {
  50% {
    translate: 0 -6px;
  }
}
.op-pack:hover .op-pieces,
.op-pack:focus-visible .op-pieces {
  translate: 0 -14px;
}
.op-pack:focus-visible .op-pieces {
  filter: drop-shadow(0 0 2px var(--gold-bright)) drop-shadow(0 0 10px rgba(240, 212, 138, 0.7)) drop-shadow(0 14px 18px rgba(0, 0, 0, 0.6));
}
/* 袋の絵: 上下に銀の封(縦の細い筋の箔)、そのあいだに表紙の絵をまるごと */
.op-piece {
  position: absolute;
  inset: 0;
  display: block;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.32) 0 1px, rgba(255, 255, 255, 0) 1px 5px) top / 100% 5.2% no-repeat,
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.32) 0 1px, rgba(255, 255, 255, 0) 1px 5px) bottom / 100% 5.2% no-repeat,
    linear-gradient(180deg, #f4f6fa 0%, #cdd3dd 40%, #959dab 82%, #575e6e 100%) top / 100% 5.2% no-repeat,
    linear-gradient(0deg, #f4f6fa 0%, #cdd3dd 40%, #959dab 82%, #575e6e 100%) bottom / 100% 5.2% no-repeat,
    var(--img) center / 100% auto no-repeat,
    #0d163c;
}
/* 選ぶ前に、袋の上をときどき光が横切る(本体だけ) */
.op-body::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 38%, rgba(255, 246, 214, 0.42) 50%, transparent 62%) no-repeat;
  background-size: 260% 100%;
  background-position: 130% 0;
  animation: op-sheen 3.6s ease-in-out calc(0.8s + var(--i) * 0.35s) infinite;
}
@keyframes op-sheen {
  0% {
    background-position: 130% 0;
  }
  40%,
  100% {
    background-position: -130% 0;
  }
}
/* 光: 口のかがやき・光の柱・後ろの光の筋・光の粒 */
.op-glow,
.op-beam,
.op-rays,
.op-spark {
  position: absolute;
  display: block;
  pointer-events: none;
  opacity: 0;
}
.op-glow {
  left: 50%;
  top: 10%;
  width: 150%;
  height: 40%;
  translate: -50% -50%;
  background: radial-gradient(closest-side, rgba(255, 252, 232, 0.98) 0 22%, rgba(255, 226, 150, 0.6) 55%, rgba(255, 226, 150, 0) 100%);
}
.op-beam {
  left: 50%;
  bottom: 90%;
  width: 320%;
  height: 190%;
  translate: -50% 0;
  transform-origin: 50% 100%;
  background: linear-gradient(0deg, rgba(255, 246, 214, 0.95), rgba(255, 236, 170, 0.35) 55%, rgba(255, 236, 170, 0) 92%);
  clip-path: polygon(41% 100%, 59% 100%, 100% 0, 0 0);
}
.op-rays {
  left: 50%;
  top: 10%;
  z-index: -1;
  width: 900%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 224, 140, 0.5) 0deg 4deg, rgba(255, 224, 140, 0) 4deg 15deg);
  -webkit-mask: radial-gradient(circle, transparent 4%, #000 12%, transparent 60%);
  mask: radial-gradient(circle, transparent 4%, #000 12%, transparent 60%);
}
.op-spark {
  left: calc(50% + var(--x));
  top: 10%;
  z-index: 4;
  width: 1vmin;
  height: 1vmin;
  min-width: 5px;
  min-height: 5px;
  rotate: 45deg;
  background: #fff6d6;
  box-shadow: 0 0 1vmin rgba(255, 226, 150, 0.9);
}
/* 出てくるカード(位置・大きさ・動き・せり上がるときの切り抜きは intro.js)。袋と光の柱より手前、画面を包む光よりも手前 */
.op-card {
  position: absolute;
  z-index: 9;
  opacity: 0;
  pointer-events: none;
  perspective: 1200px;
}
.op-card-in {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: rotateY(-180deg);
}
.op-card-in img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 4.5% / 3.1%;
  backface-visibility: hidden;
}
.op-card-front {
  box-shadow: 0 0 0 2px #e9cf8a, 0 0 30px rgba(233, 207, 138, 0.5);
}
.op-card-back {
  transform: rotateY(180deg);
}
.op-card-glow {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: -1;
  width: 260%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 252, 232, 0.95) 0 18%, rgba(255, 226, 150, 0.55) 42%, rgba(255, 226, 150, 0) 68%);
  opacity: 0;
  transform: translate(-50%, -50%);
}
/* 画面を包む光(intro.js が明るくし、引く) */
.op-flash {
  position: absolute;
  inset: 0;
  z-index: 8;
  background: radial-gradient(circle at 50% 47%, #fffdf3, #fff3d2 60%, #f8e3a8);
  opacity: 0;
  pointer-events: none;
}
/* 光が画面を包んだら、裏の場面を消す(光が引くとトップ) */
.intro.cleared .op-scene {
  visibility: hidden;
}

/* ---- 開ける(袋を押したあと) ---- */
.intro.opening {
  cursor: default;
}
.intro.opening .op-pack {
  pointer-events: none;
}
.opening .op-pieces,
.opening .op-body::after,
.opening .op-hint {
  animation: none;
}
.opening .op-cap,
.opening .op-hint {
  animation: op-out 0.25s ease forwards;
}
@keyframes op-out {
  to {
    opacity: 0;
  }
}
/* ほかの袋は下がって消え、選んだ袋は真ん中に出て大きくなる */
.opening .op-pack:not(.picked) {
  animation: op-away 0.4s cubic-bezier(0.5, 0, 0.9, 0.5) forwards;
}
@keyframes op-away {
  to {
    translate: 0 22vh;
    opacity: 0;
  }
}
.opening .op-pack.picked {
  z-index: 3;
  animation: op-center 0.45s cubic-bezier(0.25, 0.9, 0.3, 1) forwards;
}
@keyframes op-center {
  to {
    transform: translateX(0) translateY(0) rotate(0deg) scale(var(--pick));
  }
}
.opening .picked .op-pieces {
  translate: none;
  animation: op-shake 0.3s ease-in-out 0.45s;
}
@keyframes op-shake {
  20% {
    rotate: -2.2deg;
    scale: 1.03;
  }
  45% {
    rotate: 2.2deg;
    scale: 1.05;
  }
  70% {
    rotate: -1.4deg;
    scale: 1.05;
  }
  100% {
    rotate: 0deg;
    scale: 1;
  }
}
.opening .picked .op-cap {
  transform-origin: 100% 10%;
  animation: op-tear 0.5s cubic-bezier(0.3, 0.6, 0.3, 1) 0.69s forwards;
}
@keyframes op-tear {
  30% {
    transform: rotate(7deg);
    opacity: 1;
  }
  100% {
    transform: translate(26%, -62%) rotate(40deg);
    opacity: 0;
  }
}
.opening .picked .op-glow {
  animation: op-in 0.4s ease-out 0.75s forwards;
}
@keyframes op-in {
  to {
    opacity: 1;
  }
}
.opening .picked .op-beam {
  animation: op-beam 0.55s cubic-bezier(0.2, 0.8, 0.3, 1) 0.77s forwards;
}
@keyframes op-beam {
  0% {
    opacity: 0;
    transform: scaleY(0.05);
  }
  30% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: scaleY(1);
  }
}
.opening .picked .op-rays {
  animation: op-rays 1.2s ease-out 0.83s forwards;
}
@keyframes op-rays {
  0% {
    opacity: 0;
    rotate: 0deg;
  }
  40% {
    opacity: 1;
  }
  100% {
    opacity: 0.9;
    rotate: 32deg;
  }
}
.opening .picked .op-spark {
  animation: op-spark 0.95s ease-out calc(0.81s + var(--d)) forwards;
}
@keyframes op-spark {
  0% {
    opacity: 0;
    translate: 0 0;
    scale: 0.4;
  }
  15% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    translate: var(--dx) var(--dy);
    scale: var(--s);
  }
}
@media (prefers-reduced-motion: reduce) {
  .op-pieces,
  .op-body::after,
  .op-hint {
    animation: none;
  }
  .intro.opening {
    animation: op-out 0.3s ease forwards;
  }
  .opening .op-pack,
  .opening .op-pack.picked,
  .opening .picked .op-pieces,
  .opening .picked .op-cap,
  .opening .picked .op-glow,
  .opening .picked .op-beam,
  .opening .picked .op-rays,
  .opening .picked .op-spark {
    animation: none;
  }
}

/* ================= URカードの特殊演出(public/js/cardfx.js) =================
   作りは SP と同じ(.sp-back / .sp-front、--u・--sp-t)。パック開封では、めくる前の溜めとめくる瞬間の閃光のあとに流れる。
   テーマ: royal(ソフィア)/ blade(アイリス)/ mirror(酒呑童子)/ warlord(第六天魔王)/
           necro(メア)/ greed(ディアボリカ)/ chrono(クロセリア)/ eclipse(モルディアナ) */
@keyframes sp-shock {
  0% {
    opacity: 0;
    scale: 0.2;
  }
  15% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    scale: 1.7;
  }
}
.sp-front .sp-shock {
  left: 50%;
  top: 46%;
  width: 120%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  border: calc(var(--u) * 1.4) solid var(--shock, #ffe7a0);
  box-shadow: 0 0 calc(var(--u) * 5) var(--shock, #ffe7a0), inset 0 0 calc(var(--u) * 5) var(--shock, #ffe7a0);
  animation-name: sp-shock;
  animation-duration: 0.9s;
  animation-timing-function: cubic-bezier(0.2, 0.7, 0.3, 1);
}
@keyframes sp-burst {
  0% {
    opacity: 0;
    transform: rotate(var(--a)) translateY(0);
  }
  15% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: rotate(var(--a)) translateY(calc(var(--u) * var(--r) * -1)) scale(0.4);
  }
}

/* ---- ソフィア: 後ろにステンドグラスのバラ窓が開き、上から光の筋が差し込み、慈悲の光の粒が静かに降る ---- */
.sp-royal {
  --shock: #fff1cf;
}
/* バラ窓: 宝石の色のガラスに、金の窓枠(放射状の線と同心円)。ゆっくり回りながら、中心から光る */
.sp-royal .sp-rose {
  left: 50%;
  top: 44%;
  width: 196%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background:
    radial-gradient(circle closest-side, rgba(255, 252, 238, 0.95) 0 13%, rgba(255, 232, 170, 0.55) 20%, rgba(255, 232, 170, 0) 30%),
    repeating-conic-gradient(rgba(255, 226, 150, 0.9) 0deg 0.8deg, rgba(255, 226, 150, 0) 0.8deg 22.5deg),
    repeating-radial-gradient(circle closest-side, rgba(255, 226, 150, 0) 0 22.5%, rgba(255, 226, 150, 0.85) 23% 24.2%, rgba(255, 226, 150, 0) 24.7% 25%),
    radial-gradient(circle closest-side, rgba(255, 255, 255, 0.22) 0 30%, rgba(255, 255, 255, 0) 70%),
    repeating-conic-gradient(rgba(255, 255, 255, 0.14) 0deg 11.25deg, rgba(0, 0, 0, 0.16) 11.25deg 22.5deg),
    repeating-radial-gradient(circle closest-side, rgba(255, 255, 255, 0.1) 0 12%, rgba(0, 0, 0, 0.12) 12% 23.5%),
    conic-gradient(
      from 11.25deg,
      rgba(214, 64, 108, 0.62),
      rgba(232, 164, 64, 0.62),
      rgba(64, 150, 104, 0.62),
      rgba(64, 112, 214, 0.62),
      rgba(140, 86, 208, 0.62),
      rgba(214, 64, 108, 0.62),
      rgba(232, 164, 64, 0.62),
      rgba(64, 150, 104, 0.62),
      rgba(64, 112, 214, 0.62),
      rgba(140, 86, 208, 0.62),
      rgba(214, 64, 108, 0.62)
    );
  -webkit-mask: radial-gradient(circle closest-side, #000 0 95%, transparent 99%);
  mask: radial-gradient(circle closest-side, #000 0 95%, transparent 99%);
  filter: blur(calc(var(--u) * 0.25)) drop-shadow(0 0 calc(var(--u) * 6) rgba(255, 220, 150, 0.45));
  animation-name: sp-rose;
  animation-duration: 2.8s;
}
/* 外側の、やわらかな金の後光 */
.sp-royal .sp-rose2 {
  width: 240%;
  background: radial-gradient(circle closest-side, rgba(255, 236, 190, 0) 0 70%, rgba(255, 228, 160, 0.35) 80%, rgba(255, 228, 160, 0) 100%);
  -webkit-mask: none;
  mask: none;
  filter: blur(calc(var(--u) * 2));
  animation-direction: reverse;
}
@keyframes sp-rose {
  0% {
    opacity: 0;
    scale: 0.7;
    rotate: 0deg;
  }
  24% {
    opacity: 0.95;
    scale: 1;
  }
  80% {
    opacity: 0.85;
  }
  100% {
    opacity: 0;
    scale: 1.06;
    rotate: 36deg;
  }
}
/* 上から差し込む光の筋(カードの上に、明るさを足すように重ねる) */
.sp-royal .sp-shaft {
  left: var(--x);
  top: -24%;
  width: 34%;
  height: 130%;
  translate: -50% 0;
  rotate: var(--rot);
  transform-origin: 50% 0;
  clip-path: polygon(38% 0, 62% 0, 100% 100%, 0 100%);
  background: linear-gradient(180deg, rgba(255, 246, 214, 0.55), rgba(255, 232, 170, 0.22) 55%, rgba(255, 232, 170, 0));
  filter: blur(calc(var(--u) * 2.5));
  mix-blend-mode: screen;
  animation-name: sp-beam;
  animation-duration: 2.5s;
}
.sp-royal .sp-veil {
  left: 50%;
  top: 44%;
  width: 150%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 252, 238, 0.7), rgba(255, 236, 190, 0.22) 36%, rgba(255, 236, 190, 0) 62%);
  mix-blend-mode: screen;
  animation-name: sp-glow;
  animation-duration: 1.6s;
}
/* 慈悲の光の粒: ゆらゆらと静かに降る */
.sp-royal .sp-grace {
  left: var(--x);
  top: var(--y);
  width: calc(var(--u) * var(--s));
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0 32%, rgba(255, 230, 160, 0.95) 52%, rgba(255, 214, 120, 0) 74%);
  box-shadow: 0 0 calc(var(--u) * 2.4) rgba(255, 232, 170, 0.95);
  animation-name: sp-feather;
  animation-duration: 2.6s;
  animation-timing-function: linear;
}

/* ---- アイリス: 金色の光の柱の前を、2つの大きな剣閃が十字に走り、火花と衝撃の輪。最後に縦の光が上から振り下ろされる ---- */
.sp-blade {
  --shock: #ffd95a;
}
.sp-blade .sp-pillar {
  left: 50%;
  top: -55%;
  width: 64%;
  height: 210%;
  translate: -50% 0;
  background: linear-gradient(90deg, rgba(255, 205, 70, 0), rgba(255, 232, 140, 0.9) 50%, rgba(255, 205, 70, 0));
  filter: blur(calc(var(--u) * 2));
  animation-name: sp-beam;
  animation-duration: 1.9s;
}
/* 最後の縦の光の、後ろに広がる光 */
.sp-blade .sp-pillar-end {
  top: -80%;
  width: 110%;
  height: 260%;
  background: linear-gradient(90deg, rgba(255, 196, 40, 0), rgba(255, 226, 120, 0.85) 50%, rgba(255, 196, 40, 0));
  filter: blur(calc(var(--u) * 4));
  animation-duration: 1.5s;
}
.sp-blade .sp-slash {
  left: 50%;
  top: 46%;
  width: 290%;
  height: 5%;
  translate: -50% -50%;
  rotate: var(--rot);
  border-radius: 50%;
  background: linear-gradient(90deg, rgba(255, 196, 30, 0), #ffd84a 28%, #fffbe8 45% 55%, #ffd84a 72%, rgba(255, 196, 30, 0));
  box-shadow: 0 0 calc(var(--u) * 4) #fff1a8, 0 0 calc(var(--u) * 12) rgba(255, 196, 30, 0.95);
  animation-name: sp-slash;
  animation-duration: 0.85s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes sp-slash {
  0% {
    opacity: 1;
    scale: 0 1;
  }
  35% {
    opacity: 1;
    scale: 1 1;
  }
  100% {
    opacity: 0;
    scale: 1.1 0.3;
  }
}
.sp-blade .sp-shock {
  width: 170%;
}
.sp-blade .sp-spark {
  left: 50%;
  top: 46%;
  width: 4.6%;
  aspect-ratio: 1;
  margin: -2.3% 0 0 -2.3%;
  border-radius: 50%;
  background: #fff6c8;
  box-shadow: 0 0 calc(var(--u) * 2.5) #fff1a8, 0 0 calc(var(--u) * 6) #ffc21f;
  animation-name: sp-burst;
  animation-duration: 1s;
}
/* 最後の縦の光: カードの上から下へ一直線に走り、太くなって消える */
.sp-blade .sp-strike {
  left: 50%;
  top: -75%;
  width: 7%;
  height: 250%;
  translate: -50% 0;
  transform-origin: 50% 0;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 196, 30, 0), #ffd84a 16%, #fffbe8 30% 70%, #ffd84a 84%, rgba(255, 196, 30, 0));
  box-shadow: 0 0 calc(var(--u) * 5) #fff1a8, 0 0 calc(var(--u) * 16) rgba(255, 190, 20, 0.95);
  animation-name: sp-strike;
  animation-duration: 1.1s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes sp-strike {
  0% {
    opacity: 1;
    scale: 1 0;
  }
  28% {
    opacity: 1;
    scale: 1 1;
  }
  55% {
    opacity: 0.85;
    scale: 2.2 1;
  }
  100% {
    opacity: 0;
    scale: 3.4 1.04;
  }
}
.sp-blade .sp-shock-end {
  width: 210%;
}

/* ---- 酒呑童子: 紅い靄の中、カードの映し身が左右に分かれてまた重なる(コピーの能力)。紅い波紋 ---- */
.sp-mirror .sp-mist {
  left: 50%;
  top: 46%;
  width: 230%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 20, 50, 0.55), rgba(120, 0, 30, 0.35) 36%, rgba(80, 0, 20, 0) 64%);
  animation-name: sp-glow;
  animation-duration: 2.4s;
}
.sp-mirror .sp-ghost {
  inset: 0;
  border-radius: 4.5% / 3.1%;
  background-size: 100% 100%;
  filter: sepia(1) saturate(4) hue-rotate(-30deg) brightness(0.9);
  animation-name: sp-ghost;
  animation-duration: 2.2s;
  animation-timing-function: cubic-bezier(0.3, 0.7, 0.3, 1);
}
@keyframes sp-ghost {
  0% {
    opacity: 0;
    translate: 0 0;
    rotate: 0deg;
  }
  20% {
    opacity: 0.65;
  }
  45% {
    opacity: 0.6;
    translate: calc(var(--g) * 58%) -3%;
    rotate: calc(var(--g) * 8deg);
  }
  75% {
    opacity: 0.45;
    translate: calc(var(--g) * 52%) -2%;
    rotate: calc(var(--g) * 7deg);
  }
  100% {
    opacity: 0;
    translate: 0 0;
    rotate: 0deg;
  }
}
.sp-mirror .sp-ripple,
.sp-chrono .sp-ripple {
  left: 50%;
  top: 46%;
  width: 100%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  border: calc(var(--u) * 1) solid var(--rc);
  box-shadow: 0 0 calc(var(--u) * 4) var(--rc);
  animation-name: sp-shock;
  animation-duration: 1.2s;
}
.sp-mirror .sp-ripple {
  --rc: rgba(255, 60, 100, 0.9);
}
.sp-chrono .sp-ripple {
  --rc: rgba(190, 220, 255, 0.9);
}

/* ---- 第六天魔王(本能寺の業火。2026年11月21日の案 A): 空が紅く染まって黒煙が昇り、カードの後ろに炎の壁が二重に燃え立つ。
   足もとの左右でも炎がゆらめき、火の粉がたくさん舞う ---- */
.sp-warlord .wl-defs {
  width: 0;
  height: 0;
}
/* 炎の舌をまとめる箱(カードと同じ大きさ。中の炎はそれぞれの時刻で燃える) */
.sp-warlord .wl-layer {
  inset: 0;
  opacity: 1;
  animation: none;
}
.sp-warlord .wl-lick {
  opacity: 0.8;
}
.sp-warlord .wl-t {
  position: absolute;
  left: var(--x);
  top: calc(var(--u) * var(--y));
  width: calc(var(--u) * var(--w));
  height: calc(var(--u) * var(--h));
  translate: -50% -100%;
  transform-origin: 50% 100%;
  mix-blend-mode: screen;
  opacity: 0;
  animation: wl-flame var(--dur, 2.4s) ease-out both;
  animation-delay: calc(var(--sp-t, 0.7s) + var(--d, 0s));
}
.sp-warlord .wl-t svg {
  display: block;
  width: 100%;
  height: 100%;
  filter: blur(calc(var(--u) * 1.1)) drop-shadow(0 0 calc(var(--u) * 3) rgba(255, 90, 20, 0.6));
}
.sp-warlord .wl-hot .wl-t svg {
  filter: blur(calc(var(--u) * 0.5)) brightness(1.15) drop-shadow(0 0 calc(var(--u) * 3) rgba(255, 120, 30, 0.6));
}
.sp-warlord .wl-lick .wl-t {
  animation-duration: 2s;
}
@keyframes wl-flame {
  0% {
    opacity: 0;
    scale: 0.9 0.1;
    skew: 0deg;
  }
  12% {
    opacity: 1;
    scale: 1.05 1.15;
  }
  24% {
    scale: 0.92 0.92;
    skew: var(--sk, 4deg);
  }
  36% {
    scale: 1.06 1.1;
    skew: calc(var(--sk, 4deg) * -1);
  }
  48% {
    scale: 0.95 0.96;
    skew: var(--sk, 4deg);
  }
  60% {
    scale: 1.04 1.08;
    skew: calc(var(--sk, 4deg) * -0.6);
  }
  72% {
    opacity: 0.95;
    scale: 0.97 1;
    skew: var(--sk, 4deg);
  }
  100% {
    opacity: 0;
    scale: 0.8 1.35;
    skew: 0deg;
  }
}
/* 紅く染まる空 */
.sp-warlord .wl-sky {
  left: 50%;
  top: calc(var(--u) * 40);
  width: 560%;
  height: calc(var(--u) * 360);
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 110, 30, 0.55) 0, rgba(200, 30, 10, 0.5) 30%, rgba(60, 0, 0, 0.55) 48%, rgba(0, 0, 0, 0) 68%);
  animation-name: sp-dusk;
  animation-duration: 2.7s;
}
/* 昇っていく黒煙 */
.sp-warlord .wl-smoke {
  left: var(--x);
  top: calc(var(--u) * -10);
  width: 130%;
  aspect-ratio: 1.3;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(40, 10, 8, 0.75), rgba(40, 10, 8, 0) 65%);
  filter: blur(calc(var(--u) * 4));
  animation-name: wl-smoke;
  animation-duration: 2.6s;
}
@keyframes wl-smoke {
  0% {
    opacity: 0;
    transform: translateY(calc(var(--u) * 40)) scale(0.8);
  }
  30% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(calc(var(--u) * -60)) scale(1.3);
  }
}
/* 火の粉: 足もとから舞い上がる */
.sp-warlord .wl-ember {
  left: var(--x);
  top: 98%;
  width: calc(var(--u) * var(--s));
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, #fff1b0, #ff8a2a 60%, rgba(255, 60, 20, 0));
  box-shadow: 0 0 calc(var(--u) * 2) #ff7a2a;
  animation-name: wl-ember;
  animation-duration: 2.2s;
  animation-timing-function: cubic-bezier(0.3, 0.5, 0.6, 1);
}
@keyframes wl-ember {
  0% {
    opacity: 0;
    translate: 0 0;
  }
  15% {
    opacity: 1;
  }
  60% {
    translate: calc(var(--u) * var(--dx) * 0.6) calc(var(--u) * var(--h) * -0.6);
  }
  100% {
    opacity: 0;
    translate: calc(var(--u) * var(--dx)) calc(var(--u) * var(--h) * -1);
  }
}

/* ---- メア: 足もとに紫の渦の「冥府の門」が開き、青い人魂(16個)がゆらめきながら上へ昇っていく。
   1.75秒で門のふちが強く光り、閃光と光の柱、紫と青の光の輪が広がって、門が閉じる
   (2026年11月21日、くまねこ堂の指定で、見本の「B 冥府の門」を下に開くようにした)。
   座標はカードの幅 = 100(--u)。門の中心はカードの下(50, 150)で、地面に寝かせた楕円(縦 0.3)。 ---- */
.sp-necro .mz-defs {
  width: 0;
  height: 0;
}
.sp-necro .mz-aura {
  left: 50%;
  top: 50%;
  width: 260%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(120, 50, 200, 0.42), rgba(50, 20, 110, 0.32) 38%, rgba(20, 0, 50, 0) 66%);
  animation-name: sp-glow;
  animation-duration: 2.9s;
}
/* 門: 紫の渦(ぼかした円すいグラデーション) */
.sp-necro .mz-gate {
  left: calc(var(--u) * -50);
  top: calc(var(--u) * 50);
  width: calc(var(--u) * 200);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(10, 0, 25, 0.95) 0 22%, rgba(20, 0, 40, 0) 58%),
    conic-gradient(from 0deg, rgba(170, 90, 255, 0.95), rgba(25, 0, 50, 0.9) 18%, rgba(120, 50, 230, 0.9) 34%, rgba(25, 0, 50, 0.9) 50%, rgba(170, 90, 255, 0.95) 66%, rgba(25, 0, 50, 0.9) 84%, rgba(170, 90, 255, 0.95));
  -webkit-mask-image: radial-gradient(circle, #000 58%, transparent 71%);
  mask-image: radial-gradient(circle, #000 58%, transparent 71%);
  filter: blur(calc(var(--u) * 2));
  animation-name: mz-gate;
  animation-duration: 2.9s;
  animation-timing-function: linear;
}
@keyframes mz-gate {
  0% {
    opacity: 0;
    transform: scaleY(0.3) rotate(0deg) scale(0.1);
  }
  14% {
    opacity: 1;
    transform: scaleY(0.3) rotate(90deg) scale(1);
  }
  80% {
    opacity: 1;
    transform: scaleY(0.3) rotate(380deg) scale(1);
  }
  100% {
    opacity: 0;
    transform: scaleY(0.3) rotate(460deg) scale(0.25);
  }
}
/* 門のふち: 1.75秒(60%)で強く光る */
.sp-necro .mz-rim {
  left: calc(var(--u) * -45);
  top: calc(var(--u) * 55);
  width: calc(var(--u) * 190);
  aspect-ratio: 1;
  border-radius: 50%;
  border: calc(var(--u) * 2) solid rgba(205, 150, 255, 0.95);
  box-shadow: 0 0 calc(var(--u) * 5) rgba(180, 110, 255, 0.95), inset 0 0 calc(var(--u) * 8) rgba(180, 110, 255, 0.75), 0 0 calc(var(--u) * 16) rgba(120, 60, 255, 0.6);
  animation-name: mz-rim;
  animation-duration: 2.9s;
}
@keyframes mz-rim {
  0% {
    opacity: 0;
    transform: scaleY(0.3) scale(0.1);
  }
  14% {
    opacity: 1;
    transform: scaleY(0.3) scale(1);
  }
  56% {
    opacity: 1;
    transform: scaleY(0.3) scale(1);
    filter: brightness(1);
  }
  60% {
    transform: scaleY(0.3) scale(1.08);
    filter: brightness(2.6);
  }
  72% {
    transform: scaleY(0.3) scale(1.02);
    filter: brightness(1.4);
  }
  84% {
    opacity: 1;
    transform: scaleY(0.3) scale(1);
    filter: brightness(1.1);
  }
  100% {
    opacity: 0;
    transform: scaleY(0.3) scale(0.25);
  }
}
/* 門から立ちのぼる紫の光(mz-beam2 は門が光るときの、明るく短い光の柱) */
.sp-necro .mz-beam {
  left: calc(var(--u) * -30);
  top: calc(var(--u) * -110);
  width: calc(var(--u) * 160);
  height: calc(var(--u) * 260);
  transform-origin: 50% 100%;
  background: linear-gradient(to top, rgba(180, 115, 255, 0.7), rgba(120, 60, 230, 0.3) 45%, rgba(90, 40, 200, 0));
  -webkit-mask-image: linear-gradient(to right, transparent, #000 28%, #000 72%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 28%, #000 72%, transparent);
  animation-name: mz-beam;
  animation-duration: 2.5s;
}
@keyframes mz-beam {
  0% {
    opacity: 0;
    scale: 1 0;
  }
  20% {
    opacity: 1;
    scale: 1 1;
  }
  70% {
    opacity: 0.8;
  }
  100% {
    opacity: 0;
    scale: 1.05 1.05;
  }
}
.sp-necro .mz-beam2 {
  background: linear-gradient(to top, rgba(240, 215, 255, 0.95), rgba(185, 120, 255, 0.5) 40%, rgba(120, 60, 230, 0));
  animation-name: mz-beam2;
  animation-duration: 0.9s;
}
@keyframes mz-beam2 {
  0% {
    opacity: 0;
    scale: 0.6 0.2;
  }
  18% {
    opacity: 1;
    scale: 1 1;
  }
  100% {
    opacity: 0;
    scale: 1.15 1.1;
  }
}
/* 人魂: 門から上へ、左右にゆれながら昇る。--s は大きさ、--h は昇る高さ */
.sp-necro .mz-up {
  left: calc(var(--u) * var(--x));
  top: calc(var(--u) * var(--y));
  width: calc(var(--u) * 9 * var(--s));
  height: calc(var(--u) * 19.2 * var(--s));
  margin: calc(var(--u) * -4.8 * var(--s)) 0 0 calc(var(--u) * -4.5 * var(--s));
  transform-origin: 50% 25%;
  animation-name: mz-up;
  animation-duration: var(--dur);
  animation-timing-function: ease-in;
}
.sp-necro .mz-up svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  transform-origin: 50% 25%;
  filter: drop-shadow(0 0 calc(var(--u) * 1.4) rgba(130, 200, 255, 0.95)) drop-shadow(0 0 calc(var(--u) * 5) rgba(60, 110, 255, 0.7));
  animation: mz-wob 0.42s ease-in-out 8 alternate;
}
@keyframes mz-wob {
  from {
    transform: skewX(-8deg) scaleX(0.94);
  }
  to {
    transform: skewX(8deg) scaleX(1.04);
  }
}
@keyframes mz-up {
  0% {
    opacity: 0;
    translate: 0 0;
    scale: 0.3;
  }
  12% {
    opacity: 1;
    scale: 1;
  }
  40% {
    translate: calc(var(--u) * var(--sw)) calc(var(--u) * var(--h) * -0.38);
  }
  70% {
    translate: calc(var(--u) * var(--sw) * -1) calc(var(--u) * var(--h) * -0.72);
  }
  88% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    translate: calc(var(--u) * var(--sw) * 0.5) calc(var(--u) * var(--h) * -1);
    scale: 0.8;
  }
}
/* 門が光る: 門全体の閃光と、地面に沿って広がる紫と青の光の輪 */
.sp-necro .mz-flash {
  left: calc(var(--u) * -60);
  top: calc(var(--u) * 40);
  width: calc(var(--u) * 220);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0 12%, rgba(225, 185, 255, 0.85) 26%, rgba(160, 90, 255, 0.45) 46%, rgba(110, 50, 230, 0) 66%);
  animation-name: mz-flash;
  animation-duration: 0.9s;
}
@keyframes mz-flash {
  0% {
    opacity: 0;
    transform: scaleY(0.3) scale(0.4);
  }
  14% {
    opacity: 1;
    transform: scaleY(0.3) scale(1);
  }
  100% {
    opacity: 0;
    transform: scaleY(0.3) scale(1.25);
  }
}
.sp-necro .mz-ring {
  left: calc(var(--u) * 50);
  top: calc(var(--u) * 150);
  width: calc(var(--u) * 80);
  aspect-ratio: 1;
  margin: calc(var(--u) * -40) 0 0 calc(var(--u) * -40);
  border-radius: 50%;
  border: calc(var(--u) * 2) solid rgba(225, 180, 255, 1);
  box-shadow: 0 0 calc(var(--u) * 6) rgba(190, 120, 255, 1), inset 0 0 calc(var(--u) * 5) rgba(190, 120, 255, 0.8);
  animation-name: mz-ring;
  animation-duration: 1s;
}
.sp-necro .mz-ring2 {
  border-color: rgba(150, 210, 255, 1);
  box-shadow: 0 0 calc(var(--u) * 6) rgba(110, 180, 255, 1), inset 0 0 calc(var(--u) * 5) rgba(110, 180, 255, 0.8);
}
@keyframes mz-ring {
  0% {
    opacity: 0;
    transform: scaleY(0.3) scale(0.6);
  }
  12% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scaleY(0.3) scale(4.2);
  }
}

/* ---- ディアボリカ: 魔王。あたりが紅く暗くなり、足もとに紅い魔法陣(五芒星)が回る。
       後ろで黒い翼が大きく開き、蝙蝠が飛び立ち、紅い火の粉が舞う ---- */
.sp-demon {
  --shock: #ff3b5c;
}
.sp-demon .sp-gloom {
  left: 50%;
  top: 50%;
  width: 420%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(120, 0, 30, 0.45) 8%, rgba(40, 0, 12, 0.7) 26%, rgba(0, 0, 0, 0.6) 44%, rgba(0, 0, 0, 0) 66%);
  animation-name: sp-dusk;
  animation-duration: 2.7s;
}
.sp-demon .sp-sigil {
  left: 50%;
  top: 88%;
  width: 190%;
  aspect-ratio: 1;
  animation-name: sp-sigil;
  animation-duration: 2.7s;
}
.sp-demon .sp-sigil svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 0 calc(var(--u) * 1.5) #ff3b5c) drop-shadow(0 0 calc(var(--u) * 5) rgba(200, 0, 40, 0.85));
}
.sp-demon .sp-sigil circle,
.sp-demon .sp-sigil polygon {
  fill: none;
  stroke: #ff5a76;
  stroke-width: 1.3px;
  stroke-linejoin: round;
}
.sp-demon .sp-sigil .sg-dash {
  stroke-width: 2.4px;
  stroke-dasharray: 1.2 4;
}
@keyframes sp-sigil {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scaleY(0.34) rotate(0deg) scale(0.3);
  }
  22% {
    opacity: 1;
    transform: translate(-50%, -50%) scaleY(0.34) rotate(50deg) scale(1);
  }
  82% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scaleY(0.34) rotate(150deg) scale(1.06);
  }
}
/* 黒い翼(左右)。カードの後ろで、たたんだ形から大きく開く */
.sp-demon .sp-wing {
  top: -8%;
  width: 135%;
  height: 86%;
  animation-name: sp-dwing;
  animation-duration: 2.6s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.3, 1);
}
.sp-demon .sp-wing-r {
  --dir: 1;
  left: 46%;
  transform-origin: 0% 66%;
}
/* 左の翼は、右の翼の絵を左右反転したもの(開く向きも反対) */
.sp-demon .sp-wing-l {
  --dir: -1;
  right: 46%;
  transform-origin: 100% 66%;
}
.sp-demon .sp-wing-l svg {
  transform: scaleX(-1);
}
.sp-demon .sp-wing svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 0 calc(var(--u) * 2) rgba(255, 40, 80, 0.75));
}
.sp-demon .sp-wing path {
  fill: #0d0710;
  stroke: #b0163a;
  stroke-width: 1.2px;
  vector-effect: non-scaling-stroke;
}
.sp-demon .sp-wing .wg-bone {
  fill: none;
  stroke: #e0405e;
  stroke-width: 1px;
  opacity: 0.7;
}
@keyframes sp-dwing {
  0% {
    opacity: 0;
    rotate: calc(55deg * var(--dir));
  }
  12% {
    opacity: 1;
  }
  34% {
    rotate: calc(-6deg * var(--dir));
  }
  44% {
    rotate: calc(2deg * var(--dir));
  }
  56% {
    rotate: calc(-3deg * var(--dir));
  }
  84% {
    opacity: 1;
    rotate: 0deg;
  }
  100% {
    opacity: 0;
    rotate: 0deg;
  }
}
/* 飛び立つ蝙蝠(はばたきながら外へ) */
.sp-demon .sp-bat {
  left: 50%;
  top: 40%;
  width: calc(24% * var(--s, 1));
  aspect-ratio: 2 / 1;
  margin-left: calc(-12% * var(--s, 1));
  filter: drop-shadow(0 0 calc(var(--u) * 1.2) rgba(255, 60, 90, 0.9));
  animation-name: sp-batfly;
  animation-duration: 1.7s;
  animation-timing-function: cubic-bezier(0.3, 0.5, 0.5, 1);
}
/* 蝙蝠の形と、はばたき(形のほうだけを縦に縮めて、飛ぶ向きはそのまま) */
.sp-demon .sp-bat::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #120810;
  clip-path: polygon(50% 30%, 56% 12%, 58% 36%, 72% 18%, 100% 22%, 86% 46%, 92% 72%, 74% 58%, 60% 80%, 50% 64%, 40% 80%, 26% 58%, 8% 72%, 14% 46%, 0 22%, 28% 18%, 42% 36%, 44% 12%);
  animation: sp-flap 0.18s ease-in-out infinite;
}
@keyframes sp-batfly {
  0% {
    opacity: 0;
    transform: rotate(var(--a)) translateX(0) rotate(calc(var(--a) * -1)) scale(0.3);
  }
  12% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: rotate(var(--a)) translateX(calc(var(--u) * var(--r))) rotate(calc(var(--a) * -1)) scale(1);
  }
}
@keyframes sp-flap {
  50% {
    scale: 1 0.45;
  }
}
.sp-demon .sp-ember {
  left: var(--x);
  top: 96%;
  width: 2.6%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, #ffd0d8, #ff3b5c 60%, rgba(200, 0, 40, 0));
  box-shadow: 0 0 calc(var(--u) * 2) #ff3b5c;
  animation-name: sp-ember;
  animation-duration: 2.1s;
}

/* ---- クロセリア: 後ろに時計の文字盤。針が逆回りに巡り、歯車が回り、時の波紋が広がる ---- */
.sp-chrono .sp-dial {
  left: 50%;
  top: 46%;
  width: 185%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  border: calc(var(--u) * 1) solid rgba(200, 225, 255, 0.9);
  box-shadow: 0 0 calc(var(--u) * 4) rgba(150, 200, 255, 0.7), inset 0 0 calc(var(--u) * 8) rgba(150, 200, 255, 0.35);
  background:
    repeating-conic-gradient(rgba(220, 236, 255, 0.95) 0deg 1.2deg, transparent 1.2deg 30deg),
    repeating-conic-gradient(rgba(220, 236, 255, 0.5) 0deg 0.6deg, transparent 0.6deg 6deg);
  -webkit-mask: radial-gradient(closest-side, transparent 80%, #000 81%);
  mask: radial-gradient(closest-side, transparent 80%, #000 81%);
  animation-name: sp-dial;
  animation-duration: 2.6s;
}
@keyframes sp-dial {
  0% {
    opacity: 0;
    scale: 0.5;
    rotate: 40deg;
  }
  25% {
    opacity: 1;
    scale: 1;
    rotate: 0deg;
  }
  80% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    rotate: -25deg;
  }
}
.sp-chrono .sp-hand {
  left: 50%;
  top: 46%;
  width: 2%;
  border-radius: var(--u);
  background: linear-gradient(#fff, #bcd8ff);
  box-shadow: 0 0 calc(var(--u) * 2) #bcd8ff;
  translate: -50% -100%;
  transform-origin: 50% 100%;
  animation-name: sp-hand;
  animation-duration: 2.4s;
  animation-timing-function: cubic-bezier(0.2, 0.6, 0.3, 1);
}
.sp-chrono .sp-hand-h {
  --turn: -540deg;
  height: 42%;
}
.sp-chrono .sp-hand-m {
  --turn: -1440deg;
  width: 1.4%;
  height: 60%;
}
@keyframes sp-hand {
  0% {
    opacity: 0;
    rotate: 0deg;
  }
  15% {
    opacity: 1;
  }
  80% {
    opacity: 1;
    rotate: var(--turn);
  }
  100% {
    opacity: 0;
    rotate: var(--turn);
  }
}
.sp-chrono .sp-gear {
  left: var(--gx);
  top: var(--gy);
  width: 34%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  border: calc(var(--u) * 2.8) dotted rgba(220, 236, 255, 0.95);
  box-shadow: 0 0 calc(var(--u) * 3) rgba(150, 200, 255, 0.7), inset 0 0 0 calc(var(--u) * 3) rgba(200, 225, 255, 0.35);
  animation-name: sp-gear;
  animation-duration: 2.4s;
  animation-timing-function: linear;
}
@keyframes sp-gear {
  0% {
    opacity: 0;
    rotate: 0deg;
  }
  20% {
    opacity: 1;
  }
  80% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    rotate: calc(var(--gs, 1) * 200deg);
  }
}

/* ---- モルディアナ(紅の日蝕。2026年11月21日の案①): 暗くなった空に黒い太陽が昇り、紅い光冠がゆらめく。
   縁にダイヤモンドリングが光り、炎の輪が2重に広がって、火の粉が舞い上がる ---- */
.sp-eclipse {
  --shock: #ff6a35;
}
.sp-eclipse .sp-dim {
  left: 50%;
  top: 40%;
  width: 480%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(40, 0, 6, 0) 12%, rgba(25, 0, 6, 0.6) 30%, rgba(0, 0, 0, 0.62) 46%, rgba(0, 0, 0, 0) 68%);
  animation-name: sp-dusk;
  animation-duration: 2.9s;
}
/* 黒い太陽の後ろの、紅い光 */
.sp-eclipse .sp-flare {
  left: 50%;
  top: 28%;
  width: 260%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 90, 40, 0.75) 18%, rgba(200, 20, 40, 0.45) 30%, rgba(120, 0, 20, 0.2) 44%, rgba(120, 0, 20, 0) 62%);
  animation-name: sp-eclipse-rise;
  animation-duration: 2.8s;
}
/* 光冠: 炎の筋が放射状にゆらめきながら、ゆっくり回る */
.sp-eclipse .sp-corona {
  left: 50%;
  top: 28%;
  width: 230%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 70, 40, 0) 0deg, rgba(255, 90, 40, 0.8) 5deg, rgba(255, 210, 120, 0.65) 8deg, rgba(255, 60, 40, 0) 15deg);
  -webkit-mask: radial-gradient(circle, transparent 27%, #000 30%, #000 36%, transparent 60%);
  mask: radial-gradient(circle, transparent 27%, #000 30%, #000 36%, transparent 60%);
  filter: blur(calc(var(--u) * 0.8));
  animation-name: sp-corona;
  animation-duration: 2.7s;
  --d: 0.12s;
}
.sp-eclipse .sp-corona2 {
  width: 200%;
  --gs: -1;
  filter: blur(calc(var(--u) * 2));
  animation-duration: 2.5s;
  --d: 0.2s;
}
@keyframes sp-corona {
  0% {
    opacity: 0;
    rotate: 0deg;
    scale: 0.7;
  }
  25% {
    opacity: 1;
    scale: 1;
  }
  45% {
    opacity: 0.8;
    scale: 1.04;
  }
  65% {
    opacity: 1;
    scale: 1;
  }
  85% {
    opacity: 0.85;
  }
  100% {
    opacity: 0;
    rotate: calc(var(--gs, 1) * 50deg);
    scale: 1.1;
  }
}
/* 黒い太陽: 下から昇ってきて、縁が細く光る */
.sp-eclipse .sp-sun {
  left: 50%;
  top: 28%;
  width: 135%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle at 46% 44%, #1c0408, #050003 70%);
  box-shadow: 0 0 0 calc(var(--u) * 0.7) #ffc06a, 0 0 calc(var(--u) * 5) calc(var(--u) * 1.4) #ff5a2a, 0 0 calc(var(--u) * 18) calc(var(--u) * 5) rgba(200, 20, 40, 0.7);
  animation-name: sp-eclipse-rise;
  animation-duration: 2.8s;
}
@keyframes sp-eclipse-rise {
  0% {
    opacity: 0;
    transform: translateY(calc(var(--u) * 26)) scale(0.82);
  }
  24% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  80% {
    opacity: 1;
    transform: translateY(calc(var(--u) * -2)) scale(1.02);
  }
  100% {
    opacity: 0;
    transform: translateY(calc(var(--u) * -4)) scale(1.06);
  }
}
/* ダイヤモンドリング: 黒い太陽の右上の縁で、一瞬強く光る */
.sp-eclipse .sp-diamond {
  left: 97%;
  top: -3%;
  width: 34%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0 7%, rgba(255, 236, 180, 0.95) 12%, rgba(255, 150, 60, 0.5) 26%, rgba(255, 90, 40, 0) 50%);
  animation-name: sp-diamond;
  animation-duration: 0.95s;
  --d: 0.55s;
}
.sp-eclipse .sp-diamond::before,
.sp-eclipse .sp-diamond::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 260%;
  height: 4%;
  translate: -50% -50%;
  background: linear-gradient(90deg, rgba(255, 220, 150, 0), #fff 50%, rgba(255, 220, 150, 0));
}
.sp-eclipse .sp-diamond::after {
  rotate: 90deg;
  width: 180%;
}
@keyframes sp-diamond {
  0% {
    opacity: 0;
    scale: 0.2;
    rotate: -20deg;
  }
  30% {
    opacity: 1;
    scale: 1.25;
  }
  100% {
    opacity: 0;
    scale: 0.6;
    rotate: 25deg;
  }
}
.sp-front.sp-eclipse .sp-shock {
  top: 40%;
  width: 130%;
}
.sp-front.sp-eclipse .sp-shock2 {
  --shock: #ffb347;
  width: 100%;
}
/* 火の粉: カードの下の方から舞い上がる */
.sp-eclipse .sp-ember {
  left: var(--x);
  top: 96%;
  width: var(--s);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 calc(var(--u) * 2) var(--c), 0 0 calc(var(--u) * 4) rgba(255, 80, 30, 0.6);
  animation-name: sp-ember-rise;
  animation-duration: 2.2s;
}
@keyframes sp-ember-rise {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(1);
  }
  15% {
    opacity: 1;
  }
  70% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: translate(calc(var(--u) * var(--sw)), calc(var(--u) * var(--h) * -1)) scale(0.35);
  }
}

/* ---------- バトル: 発動中の効果(room.js の activeEffectsHTML) ----------
   バトルの番号の下に、いま効いている効果を大きな札で並べる。
   表で出された能力カード(春陽など)は、カードの絵と能力の文章つき。色: 能力カード = 属性の色、
   先に表で出す・小さい方が勝ち = 赤、次のカード+ ・持ち越し = 金、次のカード− = 青。 */
.effects {
  width: min(100%, 760px);
  margin: 0.5rem auto 0.2rem;
  display: grid;
  gap: 0.45rem;
  text-align: left;
}
.effects-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 0.875rem;
  letter-spacing: 0.12em;
  color: var(--gold-bright);
}
.effects-title::before,
.effects-title::after {
  content: "";
  flex: 1 1 0;
  height: 1px;
  background: rgba(201, 162, 75, 0.6);
}
.effects ul {
  display: grid;
  gap: 0.45rem;
}
.eff {
  --ec: var(--gold-bright);
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.85rem;
  padding: 0.6rem 0.9rem 0.6rem 0.7rem;
  border: 1px solid var(--ec);
  background: #111c4a;
  background: linear-gradient(90deg, color-mix(in srgb, var(--ec) 22%, #0d163c), #0d163c 70%);
  box-shadow: inset 4px 0 0 var(--ec), 0 0 22px -6px var(--ec);
  animation: eff-in 0.45s cubic-bezier(0.2, 1.3, 0.4, 1) both, eff-glow 2.4s ease-in-out 0.5s infinite;
}
@keyframes eff-in {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
  }
}
@keyframes eff-glow {
  50% {
    box-shadow: inset 4px 0 0 var(--ec), 0 0 32px -2px var(--ec);
  }
}
.eff-card[data-el="none"] {
  --ec: #c9c9d6;
}
.eff-card[data-el="fire"] {
  --ec: #ff8a4a;
}
.eff-card[data-el="water"] {
  --ec: #6fb6ff;
}
.eff-card[data-el="thunder"] {
  --ec: #c6e24a;
}
.eff-card[data-el="light"] {
  --ec: #ffd76a;
}
.eff-card[data-el="dark"] {
  --ec: #ef62ad;
}
.eff-card[data-el="god"] {
  --ec: #f3dca4;
}
.eff-forced,
.eff-first,
.eff-rev {
  --ec: var(--red-bright);
}
.eff-plus,
.eff-pend {
  --ec: var(--gold-bright);
}
.eff-minus {
  --ec: var(--blue-bright);
}
.eff-art .card {
  --cw: 52px;
}
.eff-mark {
  width: 22px;
  height: 22px;
  margin: 0 0.2rem;
  background: var(--ec);
  transform: rotate(45deg);
  box-shadow: 0 0 12px var(--ec);
}
.eff-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1rem, 1.6vw, 1.1875rem);
  line-height: 1.4;
  color: #fff;
}
.eff-title b {
  color: var(--ec);
}
.eff-text {
  margin-top: 0.15rem;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--ink-soft);
}
/* 名前の横の小さな札も大きく */
.fx {
  padding: 0.18em 0.7em;
  font-size: 0.875rem;
}
@media (max-width: 760px) {
  .effects {
    margin-top: 0.35rem;
    gap: 0.35rem;
  }
  .eff {
    gap: 0.6rem;
    padding: 0.45rem 0.6rem 0.45rem 0.55rem;
  }
  .eff-art .card {
    --cw: 40px;
  }
  .eff-title {
    font-size: 0.9375rem;
  }
  .eff-text {
    font-size: 0.75rem;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
  }
  .fx {
    font-size: 0.75rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .eff {
    animation: none;
  }
}

/* ---------- バトルの公開: 結果を予想する間(--wait) ----------
   カードがめくれてから結果(能力・パワー・勝敗)が出るまで、--wait(0.9秒)だけ待つ。そのあいだ、パワーの位置に「?」のひし形。
   長さを変えるときは、ここと public/js/show.js の RESULT_WAIT(効果音の時間)を同じ値にする。 */
.show-battle {
  --wait: var(--pace-wait, 0.9s);
}
.sc-res {
  position: relative;
}
.sc-guess {
  position: absolute;
  top: 0;
  left: 50%;
  translate: -50% 0;
  --s: clamp(40px, 9vw, 60px);
  animation: sc-guess calc(var(--wait) + 0.25s) ease both;
  animation-delay: 0.9s;
  pointer-events: none;
}
.show-cards[data-n="3"] .sc-guess,
.show-cards[data-n="4"] .sc-guess {
  --s: clamp(32px, 8vw, 56px);
}
.sc-guess::before {
  background: var(--night);
  box-shadow: 0 0 0 1px var(--gold), 0 0 16px rgba(240, 212, 138, 0.35);
}
.sc-guess > b {
  color: var(--gold-bright);
}
@keyframes sc-guess {
  0% {
    opacity: 0;
    scale: 0.6;
  }
  12% {
    opacity: 1;
    scale: 1;
  }
  45% {
    scale: 1.08;
  }
  75% {
    opacity: 1;
    scale: 1;
  }
  100% {
    opacity: 0;
    scale: 0.8;
  }
}
@media (prefers-reduced-motion: reduce) {
  .show-battle {
    --wait: 0s;
  }
  .sc-guess {
    display: none;
  }
}

/* ---------- カード一覧: 設定のあるカードの絞り込み ---------- */
.tab-lore {
  border-color: var(--gold);
  color: var(--gold-bright);
}


/* 言語の切り替え(トップは「English / 日本語」、ルームの上の帯は「EN / JA」の小さな札) */
.lang-btn {
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: none;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.lang-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}
.home-nav .lang-btn {
  padding: 0.3em 0.8em;
  font-size: 0.85rem;
}
.lang-mini {
  padding: 0.3em 0.6em;
  font-size: 0.72rem;
  line-height: 1;
  letter-spacing: 0.04em;
}

/* ---------- カード名のふりがな(日本語のとき) ---------- */
.cinfo-name ruby,
.tcard-name ruby {
  ruby-position: over;
}
.cinfo-name rt,
.tcard-name rt {
  font-family: var(--font-body);
  font-size: 0.5em;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}
.cinfo-name,
.tcard-name {
  line-height: 1.7;
}

/* ---------- カスタム(選んだカードだけをパックに入れる) ---------- */
.btn-sm {
  padding: 0.4em 0.9em;
  font-size: 0.8125rem;
}
.rule-custom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--gold);
  background: rgba(201, 162, 75, 0.08);
}
.rule-custom p {
  font-size: 0.875rem;
  color: var(--ink-soft);
}
.rule-custom b {
  margin: 0 0.2em;
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--gold-bright);
}
.modal-cpick {
  --mp: clamp(1.25rem, 4vw, 2.25rem);
  padding: var(--mp) var(--mp) 0;
}
.cpick-lead {
  margin: 0 0 0.8rem;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}
.cpick-bulk {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.3rem 0 0.9rem;
}
.cpick-grid {
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  padding-bottom: 1rem;
}
.cpick-card {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
/* 選んでいないカードは暗く */
.cpick-card .card {
  filter: grayscale(0.85) brightness(0.45);
  transition: filter 0.15s ease;
}
.cpick-card.on .card {
  filter: none;
  box-shadow: 0 0 0 2px var(--gold-bright);
}
.cpick-mark {
  position: absolute;
  top: 7px;
  left: 50%;
  z-index: 2;
  width: 22px;
  height: 22px;
  margin-left: -11px;
  border: 1.5px solid var(--gold-bright);
  background: rgba(6, 12, 34, 0.75);
  transform: rotate(45deg);
}
.cpick-card.on .cpick-mark {
  background: var(--gold-bright);
}
.cpick-card.on .cpick-mark::after {
  content: "";
  position: absolute;
  /* ひし形(45度回転)の中で、L字を立てて置くと、画面ではチェックの形になる */
  left: 6px;
  top: 1px;
  width: 6px;
  height: 12px;
  border: solid var(--night);
  border-width: 0 2.5px 2.5px 0;
}
.cpick-card:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}
.cpick-empty {
  padding: 2rem 0;
  color: var(--ink-soft);
}
.cpick-foot {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1rem;
  margin: 0 calc(-1 * var(--mp));
  padding: 0.8rem var(--mp);
  border-top: 1px solid var(--gold);
  background: var(--night-2);
}
.cpick-count {
  font-size: 0.875rem;
}
.cpick-short {
  display: block;
  color: var(--warn);
  font-weight: 700;
}
.cpick-acts {
  display: flex;
  gap: 0.6rem;
}

/* ---------- バトルの公開: パワーの数字 ----------
   カードに印刷されたパワーと同じく、属性の色のひし形に白い数字(神は金地に濃い茶の数字)。
   パワーが変わったカードは金の縁。パワーが変わらないカード(.sc-fixed)は、めくれたらすぐ数字を出し、「?」は出さない。 */
.sc[data-el="none"] {
  --elc: var(--el-none);
}
.sc[data-el="fire"] {
  --elc: var(--el-fire);
}
.sc[data-el="thunder"] {
  --elc: var(--el-thunder);
}
.sc[data-el="water"] {
  --elc: var(--el-water);
}
.sc[data-el="light"] {
  --elc: var(--el-light);
}
.sc[data-el="dark"] {
  --elc: var(--el-dark);
}
.sc[data-el="god"] {
  --elc: var(--el-god);
}
.sc-power .dia::before {
  background: var(--elc, var(--ink));
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.28), 0 0 14px rgba(0, 0, 0, 0.35);
}
.sc-power .dia > b {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.sc[data-el="god"] .sc-power .dia::before {
  box-shadow: inset 0 0 0 2px var(--gold), 0 0 14px rgba(0, 0, 0, 0.35);
}
.sc[data-el="god"] .sc-power .dia > b {
  color: #4a3305;
  text-shadow: none;
}
.sc-power.changed .dia::before {
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.35), 0 0 0 2.5px var(--gold-bright), 0 0 16px rgba(240, 212, 138, 0.65);
}
.sc-power .from {
  color: var(--ink-soft);
}
.sc-fixed .sc-guess {
  display: none;
}
.sc-fixed .sc-power {
  animation-delay: calc(0.8s + var(--i, 0) * 0.16s);
}
/* 場に残ったカードの、変わったあとのパワー(バトルの公開と同じく、属性の色のひし形 + 金の縁) */
body[data-screen="room"] .slot-pw {
  display: grid;
  place-items: center;
  left: -8px;
  top: -8px;
  width: 28px;
  height: 28px;
  min-width: 0;
  padding: 0;
  background: none;
  color: #fff;
  font-size: 0.875rem;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  isolation: isolate;
}
body[data-screen="room"] .slot-pw::before {
  content: "";
  position: absolute;
  inset: 14.6%;
  z-index: -1;
  transform: rotate(45deg);
  background: var(--elc, var(--el-none));
  box-shadow: 0 0 0 2px var(--gold-bright), 0 2px 6px rgba(0, 0, 0, 0.5);
}
.slot-pw[data-el="fire"] {
  --elc: var(--el-fire);
}
.slot-pw[data-el="thunder"] {
  --elc: var(--el-thunder);
}
.slot-pw[data-el="water"] {
  --elc: var(--el-water);
}
.slot-pw[data-el="light"] {
  --elc: var(--el-light);
}
.slot-pw[data-el="dark"] {
  --elc: var(--el-dark);
}
.slot-pw[data-el="god"] {
  --elc: var(--el-god);
  color: #4a3305 !important;
  text-shadow: none !important;
}

/* ---------- カスタム: ランダムパック(カードの裏面の絵) ---------- */
.packs-note {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: var(--ink-soft);
  text-align: center;
}
.pack-custom .pack-art img {
  object-fit: cover;
}

/* ---------- CPU の強さ「神」(金の文字と縁) ---------- */
.btn-cpu[data-level="god"] {
  border-color: var(--gold);
  color: var(--gold-bright);
  font-family: var(--font-display);
}
.btn-cpu[data-level="god"]:hover {
  border-color: var(--gold-bright);
  color: #fff6d0;
  box-shadow: 0 0 12px rgba(240, 212, 138, 0.45);
}

/* ---------- ラグナロク: 表になったとき、画面全体を一度暗転させる ----------
   真っ暗(約0.5秒)→ 雷の閃光で白く光り → 明るさが戻る。カードの演出(雷・魔法陣)は暗転のあと(+0.6秒)に始まる。
   時刻 --bt は show.js の blackoutHTML が入れる(表が見える時刻)。 */
.rg-black {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  background: #000;
  opacity: 0;
  animation: rg-black 1.1s linear both;
  animation-delay: calc(var(--bt, 0.7s) - 0.05s);
}
@keyframes rg-black {
  0% {
    opacity: 0;
    background: #000;
  }
  10% {
    opacity: 1;
    background: #000;
  }
  52% {
    opacity: 1;
    background: #000;
  }
  55% {
    opacity: 0.92;
    background: #fff6dc;
  }
  64% {
    opacity: 0.55;
    background: #1a1206;
  }
  100% {
    opacity: 0;
    background: #000;
  }
}
.sp-back.sp-ragnarok > *,
.sp-front.sp-ragnarok > * {
  animation-delay: calc(var(--sp-t, 0.7s) + 0.6s + var(--d, 0s));
}

/* ---------- 月美の変身(バトルの公開): 表面でめくれてから、光の中で裏面(ブロッサムーン)に入れ替わる ----------
   --tf = 表が見える時刻(.show-battle の --sp-t と同じ)。
   +0.35秒〜 足もとから光の柱とリボンの輪が昇り、カードが白く輝く → +0.75秒 白い閃光の中で入れ替わる
   → +0.9秒〜 変身後の面の特殊演出(三日月と星、決め台詞「変身!」)。効果音は show.js の henshin。 */
.sc-tf {
  --tf: calc(0.7s + var(--i, 0) * 0.16s);
}
.sc-tf .flipper {
  position: relative;
}
.show-battle .sc-tf .sp-host {
  --sp-t: calc(var(--tf) + 0.9s);
}
/* 変身の前の面(月美)。裏面の上に重ね、閃光の瞬間に消す */
.flip-in > .tf-before {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0.5px);
  animation: tf-before 0.82s linear both;
  animation-delay: var(--tf);
}
.flip-in > .tf-before > .card {
  --cw: var(--scw);
}
@keyframes tf-before {
  0%,
  42% {
    opacity: 1;
    filter: none;
  }
  90% {
    opacity: 1;
    filter: brightness(2.4) saturate(1.5);
  }
  100% {
    opacity: 0;
    filter: brightness(3);
  }
}
/* 変身後の面(ブロッサムーン)は、閃光の白さからふつうの明るさへ */
.sc-tf .flip-front {
  animation: tf-after 0.5s ease-out both;
  animation-delay: calc(var(--tf) + 0.76s);
}
@keyframes tf-after {
  from {
    filter: brightness(2.6) saturate(1.4);
  }
  to {
    filter: none;
  }
}
.tf-fx {
  --u: calc(var(--scw, 160px) / 100);
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}
.tf-fx > * {
  position: absolute;
  display: block;
  opacity: 0;
  animation-fill-mode: both;
}
.tf-pillar {
  left: 50%;
  bottom: -12%;
  width: 92%;
  height: 135%;
  translate: -50% 0;
  transform-origin: 50% 100%;
  background: linear-gradient(0deg, rgba(255, 170, 215, 0.85), rgba(255, 214, 236, 0.5) 45%, rgba(255, 240, 250, 0));
  filter: blur(calc(var(--u) * 3));
  mix-blend-mode: screen;
  animation: tf-pillar 0.95s ease-out;
  animation-delay: calc(var(--tf) + 0.3s);
}
@keyframes tf-pillar {
  0% {
    opacity: 0;
    scale: 0.6 0.1;
  }
  35% {
    opacity: 1;
    scale: 1 1;
  }
  70% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    scale: 1.2 1.05;
  }
}
/* リボンの輪: カードを包むように、足もとから頭の上へ昇る */
.tf-ring {
  left: -22%;
  top: 50%;
  width: 144%;
  height: 22%;
  border-radius: 50%;
  border: calc(var(--u) * 1.6) solid #ffb3d6;
  box-shadow: 0 0 calc(var(--u) * 3) #ff8fc4, inset 0 0 calc(var(--u) * 3) #ffd6ea;
  animation: tf-ring 0.62s ease-in-out;
  animation-delay: calc(var(--tf) + 0.32s + var(--k) * 0.1s);
}
.tf-ring:nth-child(3) {
  border-color: #ffe7a0;
  box-shadow: 0 0 calc(var(--u) * 3) #ffd36a, inset 0 0 calc(var(--u) * 3) #fff1c2;
}
@keyframes tf-ring {
  0% {
    opacity: 0;
    transform: translateY(calc(var(--u) * 80)) rotate(-8deg) scale(0.7);
  }
  20% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(calc(var(--u) * -90)) rotate(8deg) scale(1.05);
  }
}
/* 入れ替わる瞬間の白い閃光 */
.tf-flash {
  left: 50%;
  top: 50%;
  width: 230%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0 18%, rgba(255, 236, 246, 0.85) 30%, rgba(255, 200, 230, 0.35) 46%, rgba(255, 200, 230, 0) 64%);
  animation: tf-flash 0.5s ease-out;
  animation-delay: calc(var(--tf) + 0.68s);
}
@keyframes tf-flash {
  0% {
    opacity: 0;
    scale: 0.4;
  }
  20% {
    opacity: 1;
    scale: 1;
  }
  100% {
    opacity: 0;
    scale: 1.15;
  }
}
/* はじける星(4つの光の筋) */
.tf-star {
  left: 50%;
  top: 46%;
  width: 9%;
  aspect-ratio: 1;
  margin: -4.5% 0 0 -4.5%;
  background: #fff6fb;
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
  filter: drop-shadow(0 0 calc(var(--u) * 1.5) #ff9ccc);
  animation: tf-star 0.8s cubic-bezier(0.2, 0.7, 0.3, 1);
  animation-delay: calc(var(--tf) + 0.74s);
}
@keyframes tf-star {
  0% {
    opacity: 0;
    transform: rotate(var(--a)) translateY(0) scale(0.4);
  }
  15% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: rotate(var(--a)) translateY(calc(var(--u) * var(--r) * -1)) scale(1) rotate(90deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .tf-fx {
    display: none;
  }
  .flip-in > .tf-before {
    display: none;
  }
}
/* 変身して勝ったカードは、変身の明るさの戻りと、勝ちの金の縁の両方 */
.sc-tf.sc-win .flip-front {
  animation: tf-after 0.5s ease-out both, glow 0.5s ease both;
  animation-delay: calc(var(--tf) + 0.76s), calc(1.5s + var(--wait, 0s));
}

/* ---------- 酒呑童子のコピー(バトルの公開): 勝敗判定のときに、コピーしたカードに入れ替わる ----------
   めくれたときは酒呑童子(.cp-before を表の上に重ねる)。--cp から、紅い靄の中でコピーしたカードの映し身が左右から寄ってきて重なり、
   +0.45秒の紅い閃光で酒呑童子が消えて、コピーしたカード(.flip-front)が現れる。能力発動の光(--fx-t)・パワーの数字はその直後。
   --cp は show.js の COPY_AT + 予想する間。効果音(urMirror)は --cp で鳴らす。 */
.sc-cp {
  --cp: calc(0.55s + var(--wait, 0s) + var(--i, 0) * 0.08s);
}
.sc-cp .flipper {
  position: relative;
}
.flip-in > .cp-before {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0.5px);
  animation: cp-before 0.5s linear both;
  animation-delay: var(--cp);
}
.flip-in > .cp-before > .card {
  --cw: var(--scw);
}
@keyframes cp-before {
  0%,
  30% {
    opacity: 1;
    filter: none;
  }
  85% {
    opacity: 1;
    filter: brightness(1.6) sepia(0.7) saturate(3.5) hue-rotate(-28deg);
  }
  100% {
    opacity: 0;
    filter: brightness(2.6) sepia(0.4) saturate(2) hue-rotate(-28deg);
  }
}
/* 入れ替わったカードは、紅く輝いてからふつうの色へ */
.sc-cp .flip-front {
  animation: cp-after 0.6s ease-out both;
  animation-delay: calc(var(--cp) + 0.45s);
}
.sc-cp.sc-win .flip-front {
  animation: cp-after 0.6s ease-out both, glow 0.5s ease both;
  animation-delay: calc(var(--cp) + 0.45s), calc(1.5s + var(--wait, 0s));
}
@keyframes cp-after {
  from {
    filter: brightness(2.2) sepia(0.5) saturate(2.4) hue-rotate(-28deg);
  }
  to {
    filter: none;
  }
}
.cp-fx {
  --u: calc(var(--scw, 160px) / 100);
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}
.cp-fx > * {
  position: absolute;
  display: block;
  opacity: 0;
  animation-fill-mode: both;
}
.cp-mist {
  left: 50%;
  top: 46%;
  width: 240%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(210, 24, 56, 0.6), rgba(130, 0, 32, 0.38) 36%, rgba(80, 0, 20, 0) 64%);
  animation: cp-mist 1.5s ease-out;
  animation-delay: var(--cp);
}
@keyframes cp-mist {
  0% {
    opacity: 0;
    scale: 0.6;
  }
  30% {
    opacity: 1;
    scale: 1;
  }
  100% {
    opacity: 0;
    scale: 1.15;
  }
}
/* コピーしたカードの映し身: 左右から寄ってきて、酒呑童子に重なる */
.cp-ghost {
  inset: 0;
  border-radius: 4.5% / 3.1%;
  background-size: 100% 100%;
  filter: sepia(1) saturate(4) hue-rotate(-30deg) brightness(0.95);
  box-shadow: 0 0 calc(var(--u) * 5) rgba(255, 50, 90, 0.7);
  animation: cp-ghost 0.55s cubic-bezier(0.5, 0, 0.6, 1);
  animation-delay: var(--cp);
}
@keyframes cp-ghost {
  0% {
    opacity: 0;
    translate: calc(var(--g) * 64%) -3%;
    rotate: calc(var(--g) * 9deg);
  }
  30% {
    opacity: 0.75;
  }
  82% {
    opacity: 0.85;
    translate: 0 0;
    rotate: 0deg;
  }
  100% {
    opacity: 0;
    translate: 0 0;
    rotate: 0deg;
  }
}
.cp-flash {
  left: 50%;
  top: 50%;
  width: 220%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0 14%, rgba(255, 190, 205, 0.85) 28%, rgba(230, 40, 80, 0.4) 46%, rgba(200, 20, 60, 0) 64%);
  animation: tf-flash 0.5s ease-out;
  animation-delay: calc(var(--cp) + 0.4s);
}
.cp-ripple {
  left: 50%;
  top: 46%;
  width: 100%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  border: calc(var(--u) * 1) solid rgba(255, 60, 100, 0.9);
  box-shadow: 0 0 calc(var(--u) * 4) rgba(255, 60, 100, 0.9);
  animation: sp-shock 1.1s ease-out;
  animation-delay: calc(var(--cp) + 0.45s + var(--k) * 0.18s);
}
@media (prefers-reduced-motion: reduce) {
  .cp-fx,
  .flip-in > .cp-before {
    display: none;
  }
}

/* ---------- 構築済みパック(ロビーのルール欄) ----------
   人数のひし形が主役。選んでいるものは金で塗り、今の人数に合うものに「おすすめ」。 */
.selpicks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}
.selpick {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.6rem 0.45rem 0.3rem;
  border: 1px solid var(--line);
  background: none;
  color: var(--ink-soft);
  line-height: 1.3;
  text-align: left;
}
.selpick .dia {
  --s: 38px;
}
.selpick .dia::before {
  background: none;
  box-shadow: inset 0 0 0 1.5px var(--ink-soft);
}
.selpick .dia > b {
  color: var(--ink-soft);
}
.selpick-body {
  display: grid;
  min-width: 0;
}
.selpick-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
}
.selpick-body small {
  font-size: 0.75rem;
}
.selpick-tag {
  position: absolute;
  top: -0.6em;
  right: 0.5rem;
  padding: 0 0.45em;
  background: var(--pearl);
  color: var(--gold-bright);
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.2;
}
.selpick.on {
  border-color: var(--gold-bright);
  background: var(--paper);
  color: var(--ink);
  box-shadow: inset 0 -3px 0 var(--gold);
}
.selpick.on .dia::before {
  background: var(--gold);
  box-shadow: none;
}
.selpick.on .dia > b {
  color: var(--night);
}
.selpick:disabled {
  cursor: default;
}
.selpick:not(:disabled):not(.on):hover {
  border-color: var(--gold);
  color: var(--ink);
}
.rule-selection .rule-help {
  margin-top: 0.6rem;
}
.rule-selection.is-on .rule-help {
  padding-left: 0.7em;
  border-left: 3px solid var(--gold);
}
.selpick-warn {
  display: block;
  margin-top: 0.25em;
  color: var(--gold-bright);
}

/* ---------- ゲーム中のカードプール ---------- */
.bar-pool {
  margin-left: 0.6rem;
}
.modal-pool {
  --mp: clamp(1.25rem, 4vw, 2.25rem);
}
.pool-lead,
.pool-rest {
  margin: 0 0 0.4rem;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}
.pool-rest {
  margin-bottom: 0.6rem;
  color: var(--ink);
}
.pool-slot {
  padding: 0.7rem 0 0.9rem;
  border-top: 1px solid rgba(201, 162, 75, 0.3);
}
.pool-slot h3 {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: var(--ink-soft);
}
.pool-slot h3 .dia {
  --s: 30px;
}
.pool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pool-grid > li {
  display: grid;
  gap: 0.3rem;
  justify-items: center;
}
.pool-grid .card {
  width: 100%;
  --cw: 100px;
}
.pool-who {
  max-width: 100%;
  padding: 0.1em 0.5em;
  overflow: hidden;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.pool-me {
  background: var(--rose);
  color: var(--ink);
}
.pool-opp {
  box-shadow: inset 0 0 0 1px var(--ink-soft);
  color: var(--ink);
}
.pool-unk {
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink-soft);
  font-weight: 500;
}
/* まだ見ていないカードは少し暗く(持ち主が分かっているカードと見分ける) */
.pool-grid > li:has(.pool-unk) .card {
  filter: brightness(0.7);
}
@media (max-width: 560px) {
  .selpick {
    flex-direction: column;
    align-items: center;
    padding: 0.45rem 0.3rem;
    text-align: center;
  }
  .selpick-body {
    justify-items: center;
  }
  .pool-grid {
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  }
}
.pool-for {
  display: inline-block;
  font-size: 0.75em;
  color: var(--gold-bright);
}
/* デッキ構築の見出し: 構築済みパックの札(金)。ルールの札の横に並べる */
.rule-badge.rule-sel {
  --rc: var(--gold-bright);
  margin-left: 0.4rem;
}
/* 構築済みパック: 種類ごとに1行(名前と一言 + 人数のボタン3つ)。ボタンは人数の列にそろえ、無い人数は空ける。
   選んでいる種類の名前は明るい金。 */
.selgroups {
  display: grid;
}
.selgroup {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.45rem 0.75rem;
  padding: 0.6rem 0;
  border-top: 1px solid rgba(201, 162, 75, 0.22);
}
.selgroup:first-child {
  border-top: 0;
  padding-top: 0.1rem;
}
.selgroups .selpicks {
  grid-template-columns: repeat(3, 5.4rem);
  gap: 0.4rem;
}
.selgroups .selpick {
  padding: 0.3rem 0.45rem 0.3rem 0.2rem;
  gap: 0.2rem;
}
.selgroups .selpick .dia {
  --s: 32px;
}
.selgroups .selpick-name {
  font-size: 0.875rem;
}
.selgroups .selpick-body small {
  font-size: 0.6875rem;
}
/* 無い人数の枠(列をそろえるだけ) */
.selgroups .selpick-none {
  visibility: hidden;
}
.rule-row h4.selgroup-name {
  display: grid;
  gap: 0.1rem;
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}
.selgroup-name small {
  font-family: var(--font-body);
  font-size: 0.75rem;
  letter-spacing: 0;
  font-weight: 500;
  color: var(--ink-soft);
  opacity: 0.85;
}
.rule-row .selgroup.is-on h4.selgroup-name {
  color: var(--gold-bright);
}
/* 構築済みパックの1行(2026年11月20日): 表紙 | 名前・初心者向け〜ガチ勢向けの目盛り / ひとこと / 人数のボタンと「中身を見る」 */
.selgroups .selgroup {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
}
/* 表紙(そのパックを象徴するカード。5:7。押すと中身を見る。選んでいるパックは金の縁) */
.selgroup-art {
  display: block;
  width: 52px;
  aspect-ratio: 5 / 7;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--night-line);
  background: var(--night-2);
  cursor: pointer;
}
.selgroup-art:hover {
  border-color: var(--gold);
}
.selgroup-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.selgroup.is-on .selgroup-art {
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 1px var(--gold-bright);
}
.selgroup-body {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
}
.selgroup-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.7rem;
}
.selgroup-note {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--ink-soft);
}
.selgroup-acts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.8rem;
  margin-top: 0.1rem;
}
.selgroup-look {
  font-size: 0.75rem;
}
/* 初心者向け 〜 ガチ勢向け の目盛り(5つのひし形。ガチ勢向け度の数だけ金) */
.sel-level {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}
.sel-level small {
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--ink-soft);
}
.sel-level-dias {
  display: inline-flex;
  gap: 4px;
}
.sel-level-dias i {
  width: 7px;
  height: 7px;
  transform: rotate(45deg);
  border: 1px solid var(--gold);
}
.sel-level-dias i.on {
  background: var(--gold-bright);
  border-color: var(--gold-bright);
}
/* 構築済みパックの中身(モーダル) */
.sel-look-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.6rem;
}
.sel-look-art {
  flex: none;
  width: 72px;
  aspect-ratio: 5 / 7;
  object-fit: cover;
  border: 1px solid var(--gold);
}
.sel-look-head .modal-title {
  margin-bottom: 0.2rem;
}
.sel-look-head .cpick-lead {
  margin: 0 0 0.3rem;
}
.sel-look-camp h3 {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin: 1rem 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1rem;
}
.sel-look-camp h3 small {
  font-size: 0.75rem;
  color: var(--ink-soft);
}
@media (max-width: 760px) {
  .selgroups .selpicks {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .selgroup-acts .selpicks {
    flex: 1 1 100%;
  }
  /* スマホでも人数のボタンは横並び(縦に積むと9種類で長くなりすぎる) */
  .selgroups .selpick {
    flex-direction: row;
    justify-content: center;
    padding: 0.3rem 0.3rem 0.3rem 0.15rem;
    text-align: left;
  }
  .selgroups .selpick-body {
    justify-items: start;
  }
  .selgroups .selpick .dia {
    --s: 28px;
  }
}

/* 構築済みパック 美徳 vs 大罪・陣営戦: プレイヤーの陣営の札(色は陣営のカードの属性) */
.chip-camp {
  font-weight: 700;
}
.chip-camp-virtue,
.chip-camp-light {
  border-color: var(--el-light);
  color: var(--el-light);
}
.chip-camp-vice,
.chip-camp-dark {
  border-color: #c94d7e;
  color: #ec8db1;
}
.chip-camp-god {
  border-color: var(--el-god);
  color: #dcc69c;
}
.chip-camp-shift {
  border-color: var(--limited);
  color: #c9bdfb;
}
.build-status li:has(.chip-camp) {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
}
.build-status .chip-camp {
  padding: 0 0.4em;
  font-size: 0.6875rem;
}

/* ---------- 戦績(トップ・ルームのメニュー・結果画面から開く) ----------
   数字はひし形。勝率は金の細い棒、WIN は赤・LOSE は青の大きな欧文(結果の表示と同じ)。 */
.rec-lead {
  margin: -0.25rem 0 1rem;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}
.rec-empty {
  padding: 2rem 0 1rem;
  color: var(--ink-soft);
}
.rec-sum {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  padding: 0.25rem 0 1.25rem;
  border-bottom: 1px solid rgba(201, 162, 75, 0.35);
}
.rec-stat {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  text-align: center;
}
.rec-stat .dia {
  --s: 64px;
}
.rec-stat .dia::before {
  background: none;
  box-shadow: inset 0 0 0 1.5px var(--gold);
}
.rec-stat .dia > b {
  color: var(--gold-bright);
  font-family: var(--font-num);
  font-size: 1.375rem;
}
.rec-stat .dia small {
  font-size: 0.6em;
}
.rec-stat-label {
  display: grid;
  font-size: 0.8125rem;
  color: var(--ink);
}
.rec-stat-label small {
  font-size: 0.6875rem;
  color: var(--gold-bright);
}
.rec h3 {
  margin: 0 0 0.6rem;
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}
.rec-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.5rem 2rem;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(201, 162, 75, 0.35);
}
.rec-rates {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.rec-rate {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "name num" "meter pct";
  align-items: center;
  gap: 0.15rem 0.75rem;
}
.rec-rate-name {
  grid-area: name;
  font-size: 0.875rem;
  color: var(--ink);
}
.rec-rate-num {
  grid-area: num;
  font-size: 0.75rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.rec-meter {
  grid-area: meter;
  position: relative;
  height: 5px;
  background: rgba(58, 72, 140, 0.7);
}
.rec-meter i {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
}
.rec-rate-pct {
  grid-area: pct;
  min-width: 3em;
  text-align: right;
  font-family: var(--font-num);
  font-size: 0.875rem;
  color: var(--gold-bright);
}
.rec-cards {
  padding: 1rem 0;
  border-bottom: 1px solid rgba(201, 162, 75, 0.35);
}
.rec-ranks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem 1.25rem;
}
.rec-rank h4 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 0.9375rem;
  color: var(--ink);
}
.rec-rank ol {
  display: grid;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.rec-rank li {
  display: grid;
  grid-template-columns: 30px 46px minmax(0, 1fr);
  grid-template-rows: auto auto 1fr;
  grid-template-areas: "no card name" "no card count" "no card sub";
  align-items: center;
  column-gap: 0.55rem;
}
.rec-rank-name {
  grid-area: name;
  align-self: end;
  overflow: hidden;
  font-size: 0.8125rem;
  color: var(--ink);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.rec-rank li:first-child .rec-rank-no {
  color: var(--gold-bright);
}
.rec-rank-no {
  grid-area: no;
  font-family: var(--font-num);
  font-size: 1rem;
  color: var(--ink-soft);
  text-align: center;
}
.rec-rank .card {
  grid-area: card;
  width: 46px;
  --cw: 46px;
}
.rec-rank-count {
  grid-area: count;
  font-family: var(--font-num);
  font-size: 1rem;
  color: var(--gold-bright);
}
.rec-mvp {
  grid-area: mvp;
  align-self: start;
  justify-self: start;
  padding: 0 0.4em;
  border: 1px solid var(--gold);
  color: var(--gold-bright);
  font-size: 0.6875rem;
  line-height: 1.5;
}
.rec-none,
.rec-note {
  margin: 0;
  font-size: 0.75rem;
  color: var(--ink-soft);
}
.rec-note {
  margin-top: 0.75rem;
}
.rec-recent {
  padding: 1rem 0;
}
.rec-recent ol {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.rec-recent li {
  display: grid;
  grid-template-columns: 4.2rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-top: 1px solid rgba(58, 72, 140, 0.6);
}
.rec-res {
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: 0.06em;
}
.is-win .rec-res {
  color: var(--red-bright);
}
.is-lose .rec-res {
  color: var(--blue-bright);
}
.rec-game p {
  margin: 0;
}
.rec-vs {
  font-size: 0.875rem;
  color: var(--ink);
}
.rec-vs small {
  margin-left: 0.3em;
  font-size: 0.6875rem;
  color: var(--ink-soft);
}
.rec-meta {
  font-size: 0.75rem;
  color: var(--ink-soft);
}
.rec-meta b {
  color: var(--gold-bright);
  font-weight: 700;
}
.rec-best .card {
  width: 38px;
  --cw: 38px;
}
.rec-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.6rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(201, 162, 75, 0.35);
}
.rec-foot.is-confirm p {
  flex: 1 1 14rem;
  margin: 0;
  font-size: 0.8125rem;
  color: var(--gold-bright);
}
.ended-rec {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}
@media (max-width: 640px) {
  .rec-sum {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 1rem;
  }
  .rec-ranks {
    grid-template-columns: minmax(0, 1fr);
  }
  .rec-rank ol {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  .rec-recent li {
    grid-template-columns: 3.4rem minmax(0, 1fr) auto;
    gap: 0.5rem;
  }
}

/* ---- 実績・称号 ---- */
/* 称号(名前の横)。金の細い枠の小さな札 */
.ttl {
  display: inline-block;
  max-width: 11em;
  padding: 0 0.5em;
  border: 1px solid rgba(201, 162, 75, 0.6);
  border-radius: 2px;
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
.pl-line .ttl {
  flex: 0 1 auto;
  min-width: 0;
}
.scores .pl-who {
  display: grid;
  justify-items: start;
  gap: 0.15rem;
  min-width: 0;
  margin-right: auto;
}
.scores .pl-who .pl-name {
  margin-right: 0;
  max-width: 100%;
}
.ended-ttl {
  margin: 0.4rem 0 0;
}
.ended-ttl .ttl {
  max-width: none;
  font-size: 0.8125rem;
}
@media (max-width: 640px) {
  .table:not([data-n="1"]) .opp .ttl {
    display: none;
  }
}

/* 結果画面: この対戦で解除した実績 */
.ended-ach {
  display: grid;
  justify-items: center;
  gap: 0.6rem;
  width: min(100%, 440px);
  padding: 0.9rem 0 0.2rem;
  border-top: 1px solid rgba(201, 162, 75, 0.35);
}
.ended-ach-title {
  margin: 0;
  font-size: 0.875rem;
  color: var(--gold-bright);
  letter-spacing: 0.06em;
}
.ended-ach ul {
  display: grid;
  gap: 0.45rem;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ended-ach li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.6rem;
  text-align: left;
}
.ended-ach .ttl {
  max-width: none;
  font-size: 0.8125rem;
}
.ended-ach-desc {
  font-size: 0.75rem;
  color: var(--ink-soft);
}

/* 戦績のタブ */
.rec-tabs {
  display: flex;
  gap: 1.25rem;
  margin: -0.25rem 0 1rem;
  border-bottom: 1px solid rgba(201, 162, 75, 0.35);
}
.rec-tab {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  margin-bottom: -1px;
  padding: 0.35rem 0.1rem 0.5rem;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--ink-soft);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.rec-tab small {
  font-family: var(--font-num);
  font-size: 0.75rem;
  color: var(--gold);
}
.rec-tab:hover {
  color: var(--ink);
}
.rec-tab.on {
  border-bottom-color: var(--gold);
  color: var(--gold-bright);
}

/* いまの称号 */
.ach-now {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.8rem;
  margin-bottom: 1rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(201, 162, 75, 0.45);
  border-radius: 4px;
  background: rgba(201, 162, 75, 0.06);
}
.ach-now-label {
  font-size: 0.75rem;
  color: var(--ink-soft);
}
.ach-now .ach-title-tag {
  margin-right: auto;
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-size: 1.125rem;
  letter-spacing: 0.04em;
}
.ach-none {
  margin-right: auto;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}

/* 実績の一覧 */
.ach-group {
  padding: 0.4rem 0 0.9rem;
}
.ach-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ach {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--night-line);
}
/* 未解除は線だけのひし形、解除したら金で塗る */
.ach-mark {
  width: 14px;
  height: 14px;
  margin: 0 auto;
  transform: rotate(45deg);
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.ach.is-got .ach-mark {
  background: var(--gold);
  box-shadow: none;
}
.ach.is-title .ach-mark {
  background: var(--gold-bright);
  box-shadow: 0 0 0 3px rgba(240, 212, 138, 0.25);
}
.ach-body {
  min-width: 0;
}
.ach-name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink-soft);
}
.ach.is-got .ach-name {
  color: var(--ink);
}
.ach.is-title .ach-name {
  color: var(--gold-bright);
}
.ach-desc {
  margin: 0.1rem 0 0;
  font-size: 0.75rem;
  color: var(--ink-soft);
}
.ach:not(.is-got) .ach-desc {
  opacity: 0.75;
}
.ach-date {
  margin: 0.1rem 0 0;
  font-size: 0.6875rem;
  color: var(--gold);
}
.ach-using {
  font-size: 0.75rem;
  color: var(--gold-bright);
  white-space: nowrap;
}
.ach .btn-sm {
  white-space: nowrap;
}

/* ---------- 女神の気まぐれ ----------
   金の封印(ひし形の中に三日月)が目印。属性の日は、その属性の色で縁取る。 */
:where(.whim, .show-whim, .eff-whim, .whim-list li) {
  --wc: var(--gold-bright);
}
[data-el="fire"] {
  --wc: #ff8a4a;
}
[data-el="water"] {
  --wc: #6fb6ff;
}
[data-el="thunder"] {
  --wc: #c6e24a;
}
[data-el="light"] {
  --wc: #ffd76a;
}
[data-el="dark"] {
  --wc: #ef62ad;
}
[data-el="god"] {
  --wc: #f3dca4;
}
/* デッキ構築の見出しの札 */
.whim {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.9rem;
  width: min(100%, 560px);
  margin: 0.9rem auto 0;
  padding: 0.7rem 1.1rem 0.75rem 0.9rem;
  border: 1px solid var(--gold);
  background: linear-gradient(100deg, color-mix(in srgb, var(--wc) 20%, #0b1438), #0b1438 72%);
  box-shadow: inset 0 0 0 3px #0b1438, inset 0 0 0 4px color-mix(in srgb, var(--gold) 45%, transparent), 0 0 26px -10px var(--wc);
  text-align: left;
}
.whim-mark {
  position: relative;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
}
.whim-mark::before {
  content: "";
  position: absolute;
  inset: 6px;
  transform: rotate(45deg);
  border: 1.5px solid var(--gold-bright);
  background: color-mix(in srgb, var(--wc) 30%, #0b1438);
  box-shadow: 0 0 14px -2px var(--wc);
}
/* 三日月(円を、ずらした円で欠かせる) */
.whim-mark i,
.whim-seal i {
  position: relative;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  box-shadow: inset -5px 2px 0 0 var(--gold-bright);
  transform: rotate(-20deg);
}
.whim-label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.7em;
  color: var(--gold-bright);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}
.whim-label small {
  color: var(--on-night-soft);
  font-weight: 500;
  letter-spacing: 0.04em;
}
.whim-name {
  margin-top: 0.05rem;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.25rem, 3.2vw, 1.5625rem);
  line-height: 1.25;
  color: var(--wc);
}
.whim-text {
  margin-top: 0.15rem;
  font-size: 0.9375rem;
  color: var(--ink);
}
/* バトル中の「発動中の効果」 */
.eff-whim {
  --ec: var(--wc);
}
.eff-whim .eff-mark {
  background: none;
  border: 2px solid var(--gold-bright);
  box-shadow: 0 0 12px var(--ec), inset 0 0 0 3px #0d163c, inset 0 0 0 12px var(--ec);
}
/* 演出: 後光の中に封印が降りてきて、効果の名前が浮かぶ */
.show-whim {
  gap: 0.6rem;
}
.whim-stage {
  position: relative;
  width: 160px;
  height: 160px;
  display: grid;
  place-items: center;
}
.whim-rays {
  position: absolute;
  inset: 0;
  animation: whim-spin 18s linear infinite;
}
.whim-rays i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2px;
  height: 80px;
  margin-left: -1px;
  transform-origin: 50% 0;
  transform: rotate(var(--a));
  background: linear-gradient(var(--wc), transparent);
  opacity: 0.55;
}
.whim-seal {
  position: relative;
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  animation: whim-descend 1s cubic-bezier(0.2, 1.2, 0.4, 1) both;
}
.whim-seal::before {
  content: "";
  position: absolute;
  inset: 8px;
  transform: rotate(45deg);
  border: 2px solid var(--gold-bright);
  background: radial-gradient(circle, color-mix(in srgb, var(--wc) 55%, #101a48), #0b1438 75%);
  box-shadow: 0 0 34px -2px var(--wc), inset 0 0 0 4px #0b1438, inset 0 0 0 5px var(--gold);
}
.whim-seal i {
  width: 28px;
  height: 28px;
  box-shadow: inset -9px 3px 0 0 var(--gold-bright);
}
.whim-show-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2rem, 8vw, 3.052rem);
  line-height: 1.15;
  color: var(--wc);
  text-shadow: 0 0 24px color-mix(in srgb, var(--wc) 60%, transparent);
  animation: rise 0.5s ease 0.6s both;
}
.show-whim .show-sub {
  color: var(--ink);
  font-size: 1rem;
  animation: rise 0.5s ease 0.85s both;
}
@keyframes whim-spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes whim-descend {
  from {
    opacity: 0;
    transform: translateY(-40px) scale(0.6);
  }
}
@media (prefers-reduced-motion: reduce) {
  .whim-rays,
  .whim-seal,
  .whim-show-name,
  .show-whim .show-sub {
    animation: none;
  }
}
/* ロビー: アレンジ */
.rule-variants .toggle {
  margin-bottom: 0.2rem;
}
.whim-list {
  margin: 0.1rem 0 1rem 3.4rem;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}
.whim-list summary {
  width: fit-content;
  color: var(--gold-bright);
  cursor: pointer;
}
.whim-list ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.3rem 1rem;
  margin: 0.5rem 0;
}
.whim-list li {
  display: grid;
  gap: 0.05rem;
  padding-left: 0.6rem;
  border-left: 2px solid var(--wc);
}
.whim-list li b {
  color: var(--ink);
  font-family: var(--font-display);
}
.rule-draft h4 {
  margin: 0.2rem 0 0.5rem;
  font-size: 0.9375rem;
}
/* ドラフトの4つの選択肢は、2列 × 2段(ソロモンを足したとき、横1列では折り返して揃わないため) */
.seg-draft {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  max-width: 30rem;
}
.seg-draft button {
  padding-inline: 0.9em;
}
.seg-draft button:nth-child(n + 3) {
  border-top: 1px solid var(--line);
}
.seg-draft button:nth-child(even) {
  border-left: 1px solid var(--line);
}
/* デッキ構築画面の札 */
.rule-badge.rule-tut {
  --rc: var(--blue-bright);
}
.rule-badge.rule-draft {
  --rc: #5fd6c4;
}
.packs-note.packs-draft {
  color: #8fe6d8;
}

/* ---------- ドラフト ----------
   青緑の線を目印にする(パックの欄の下)。自分の番のときは、欄の縁が光る。 */
.draft {
  --dc: #5fd6c4;
  display: grid;
  gap: 0.8rem;
  padding: 1rem clamp(0.75rem, 2.4vw, 1.4rem) 1.1rem;
  border: 1px solid color-mix(in srgb, var(--dc) 55%, var(--line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--dc) 9%, #0d163c), #0d163c 60%);
}
.draft.my-turn {
  border-color: var(--dc);
  box-shadow: 0 0 0 1px var(--dc), 0 0 28px -8px var(--dc);
}
.dr-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}
.dr-head h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
}
.dr-head h2 small {
  margin-left: 0.7em;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--dc);
}
.dr-order {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.dr-order li {
  position: relative;
  display: grid;
  padding: 2px;
  border-radius: 50%;
}
.dr-order li.past {
  opacity: 0.3;
}
.dr-order li.now {
  box-shadow: 0 0 0 2px var(--gold-bright), 0 0 12px var(--gold);
}
.dr-lead {
  font-size: 0.9375rem;
  font-weight: 700;
}
.draft.my-turn .dr-lead {
  color: var(--gold-bright);
}
.dr-pool {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.9rem;
}
.dr-pool li {
  display: grid;
  justify-items: center;
  gap: 0.45rem;
}
.dr-pool .card {
  --cw: clamp(84px, 13vw, 116px);
}
.dr-take {
  min-width: 5.5em;
}
.dr-empty {
  padding: 0.8rem 0;
  color: var(--ink-soft);
  font-size: 0.875rem;
}
.dr-taken {
  display: grid;
  gap: 0.35rem;
  padding-top: 0.7rem;
  border-top: 1px solid color-mix(in srgb, var(--dc) 30%, var(--line));
}
.dr-taken li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  font-size: 0.875rem;
}
.dr-taken li > b {
  min-width: 5em;
}
.dr-k {
  min-width: 9em;
  color: var(--ink-soft);
}
.dr-got {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.dr-got .card {
  --cw: 44px;
}
.dr-got small {
  color: var(--ink-soft);
}
@media (max-width: 640px) {
  .whim-list {
    margin-left: 0;
  }
  .dr-k {
    min-width: 100%;
  }
}

/* ---------- チュートリアル ----------
   トップのボタンと、画面の場所を指す吹き出し(金の枠)。 */
.entry-tut {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.1rem 0.6em;
  width: 100%;
  margin-top: 0.6rem;
}
.entry-tut small {
  color: var(--gold-bright);
  font-size: 0.75rem;
  font-weight: 700;
}
.coach {
  position: fixed;
  z-index: 60;
  width: min(360px, calc(100vw - 20px));
  display: grid;
  gap: 0.55rem;
  padding: 0.85rem 1rem 0.8rem;
  border: 1px solid var(--gold);
  background: #0b1438;
  box-shadow: inset 0 0 0 3px #0b1438, inset 0 0 0 4px rgba(201, 162, 75, 0.45), 0 14px 40px -8px rgba(0, 0, 0, 0.7);
  color: var(--ink);
  text-align: left;
  animation: coach-in 0.3s ease both;
}
.coach[hidden] {
  display: none;
}
@keyframes coach-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}
.coach-step {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--gold-bright);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.coach-step .dia {
  --s: 28px;
}
.coach-step .dia::before {
  background: var(--gold);
}
.coach-step .dia > b {
  color: var(--night);
}
.coach-text {
  font-size: 0.9375rem;
  line-height: 1.75;
}
.coach-try {
  color: var(--gold-bright);
  font-size: 0.8125rem;
  font-weight: 700;
}
.coach-acts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem 0.8rem;
}
.coach-end {
  margin-right: auto;
  color: var(--ink-soft);
  font-size: 0.75rem;
}
.coach-arrow {
  position: absolute;
  left: calc(var(--ax, 50%) - 8px);
  width: 16px;
  height: 16px;
  transform: rotate(45deg);
  background: #0b1438;
  border: 1px solid var(--gold);
}
.coach[data-arrow="up"] .coach-arrow {
  top: -9px;
  border-right: 0;
  border-bottom: 0;
}
.coach[data-arrow="down"] .coach-arrow {
  bottom: -9px;
  border-left: 0;
  border-top: 0;
}
.coach[data-arrow="none"] .coach-arrow {
  display: none;
}
/* 示している場所 */
.coach-hl {
  outline: 2px solid var(--gold-bright);
  outline-offset: 6px;
  animation: coach-pulse 1.6s ease-in-out infinite;
}
@keyframes coach-pulse {
  50% {
    outline-color: rgba(240, 212, 138, 0.35);
    outline-offset: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .coach,
  .coach-hl {
    animation: none;
  }
}
@media (max-width: 640px) {
  .coach {
    gap: 0.4rem;
    padding: 0.65rem 0.8rem 0.6rem;
  }
  .coach-text {
    font-size: 0.875rem;
    line-height: 1.65;
  }
}

/* ---------- ひとりで遊ぶ(トップ) ---------- */
.entry-solo {
  margin-top: 0.8rem;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(201, 162, 75, 0.35);
}
.entry-solo-label {
  margin-bottom: 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gold-bright);
}
.entry-solo-acts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}
.solo-btn {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 0.15rem;
  min-height: 62px;
  padding: 0.45rem 0.4rem;
  text-align: center;
}
.solo-btn b {
  font-size: 0.9375rem;
  line-height: 1.3;
}
.solo-btn small {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--gold-bright);
  line-height: 1.35;
}
@media (max-width: 420px) {
  .solo-btn {
    min-height: 52px;
  }
  /* 名前の長い遊び方(入れ替え勝ち抜きの塔)は、スマホでも1行に収まるよう少し小さく */
  .solo-btn.solo-long b {
    font-size: 0.8125rem;
    letter-spacing: -0.02em;
  }
}

/* ---------- 成り上がり戦 ----------
   4つのひし形を下から積んだ塔が目印。突破 = 金、いまの階 = 赤、負けた階 = 青、まだ = 線だけ。 */
.rule-badge.rule-tower {
  --rc: var(--gold-bright);
}
.tw-strip {
  display: grid;
  justify-items: start;
  gap: 0.15rem;
  position: relative;
}
.tw-strip li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
/* 階と階をつなぐ線 */
.tw-strip li + li::before {
  content: "";
  position: absolute;
  left: calc(var(--s, 40px) / 2 - 1px);
  top: -0.5rem;
  width: 2px;
  height: 0.7rem;
  background: rgba(201, 162, 75, 0.5);
}
.tw-strip .dia {
  --s: 40px;
}
.tw-f {
  display: grid;
  line-height: 1.3;
}
.tw-f b {
  font-family: var(--font-display);
  font-size: 1rem;
}
.tw-f small {
  font-size: 0.75rem;
  color: var(--on-night-soft);
}
.tw-strip li.now .tw-f b {
  color: var(--red-bright);
}
.tw-strip li.done .tw-f b {
  color: var(--gold-bright);
}
.tw-strip li.lost .tw-f b {
  color: var(--blue-bright);
}
.tw-strip.compact {
  grid-auto-flow: column;
  justify-content: center;
  gap: 0.35rem;
  margin: 0.6rem auto 0;
}
.tw-strip.compact li + li::before {
  display: none;
}
.tw-strip.compact .dia {
  --s: 30px;
}
.tw-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
}
.tw-head-main {
  flex: 1 1 18rem;
  max-width: 34rem;
  text-align: left;
}
.tw-head h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.75rem, 5vw, 2.441rem);
  line-height: 1.2;
}
.tw-head p {
  margin-top: 0.4rem;
  color: var(--on-night-soft);
}
.tw-body {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.2rem clamp(0.75rem, 3vw, 2rem) 3rem;
  display: grid;
  gap: 1.6rem;
}
.tw-offer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 1.2rem;
}
.tw-offer li {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 0.5rem;
  width: min(100%, 210px);
  padding: 0.8rem 0.7rem 0.9rem;
  border: 1px solid rgba(201, 162, 75, 0.45);
  background: linear-gradient(180deg, rgba(201, 162, 75, 0.1), transparent 60%);
}
.tw-offer.five li {
  width: min(100%, 176px);
}
.tw-offer .card {
  --cw: 132px;
}
.tw-offer.five .card {
  --cw: 116px;
}
.tw-offer .cinfo {
  width: 100%;
  text-align: left;
  font-size: 0.8125rem;
}
.tw-mine h3 {
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: var(--ink-soft);
}
.tw-mine h3 small {
  margin-left: 0.6em;
  font-weight: 500;
}
.tw-minis {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.tw-minis .card {
  --cw: 56px;
}
.tw-end-lead {
  color: var(--on-night-soft);
}
.tw-end-body .tw-strip {
  justify-items: start;
}
.tw-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem 1.6rem;
}
.tw-stats li {
  display: grid;
  justify-items: center;
  gap: 0.2rem;
}
.tw-stats .dia {
  --s: 54px;
}
.tw-stats small {
  font-size: 0.75rem;
  color: var(--ink-soft);
}
.tw-got {
  width: 100%;
}
.tw-got h2 {
  margin-bottom: 0.6rem;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}
.tw-got ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
}
.tw-got li {
  display: grid;
  justify-items: center;
  gap: 0.2rem;
  width: 96px;
  font-size: 0.75rem;
}
.tw-got .card {
  --cw: 80px;
}
.tw-got small {
  color: var(--gold-bright);
}
.rec-tower .tw-stats,
.rec-puzzle .tw-stats,
.rec-lineup .tw-stats,
.rec-daily .tw-stats {
  justify-content: flex-start;
  gap: 0.6rem 1.1rem;
}
.rec-tower .tw-stats .dia,
.rec-puzzle .tw-stats .dia,
.rec-lineup .tw-stats .dia,
.rec-daily .tw-stats .dia {
  --s: 46px;
}
/* 階に入ったときの演出 */
.show-floor {
  gap: 0.7rem;
}
.tw-show-kicker {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--gold);
}
.tw-show-floor {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.441rem, 9vw, 3.815rem);
  animation: rise 0.5s ease 0.1s both;
}
.tw-show-floor .dia {
  --s: 76px;
}
.tw-show-opp {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.125rem;
  animation: rise 0.5s ease 0.4s both;
}
.show-floor .show-sub {
  animation: rise 0.5s ease 0.6s both;
}

/* ---------- 詰めバトル ----------
   上に相手の5枚(出す順が決まっている)、下にあなたの5枚を並べる列。結果は列ごとにパワーと勝敗を重ねる。 */
body[data-screen="puzzle"] {
  background: var(--night);
}
.pz {
  min-height: 100vh;
  padding-bottom: 3rem;
}
.pz-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.2rem;
  padding: 0.7rem calc(clamp(0.75rem, 3vw, 2rem) + 52px) 0.7rem clamp(0.75rem, 3vw, 2rem);
  border-bottom: 1px solid var(--gold);
  background: var(--night-2);
}
.pz-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  margin-right: auto;
}
.pz-nav button {
  min-height: 40px;
  padding: 0.3em 0.9em;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--ink-soft);
  font-weight: 700;
}
.pz-nav button.on {
  border-bottom-color: var(--gold);
  color: var(--gold-bright);
}
.pz-head,
.pz-board,
.pz-hand,
.pz-acts,
.pz-result {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding-inline: clamp(0.75rem, 3vw, 2rem);
}
.pz-head {
  padding-top: 1.4rem;
}
.pz-head h1 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.8rem;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.75rem, 5vw, 2.441rem);
  line-height: 1.2;
}
.pz-head h1 small {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--gold-bright);
}
.pz-rule {
  max-width: 62ch;
  margin-top: 0.5rem;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}
.pz-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin-top: 0.6rem;
  font-size: 0.8125rem;
  font-weight: 700;
}
.pz-clear {
  padding: 0 0.6em;
  border: 1px solid var(--gold);
  color: var(--gold-bright);
}
.pz-board {
  margin-top: 1.2rem;
  display: grid;
  gap: 0.35rem;
}
.pz-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}
.pz-label-me {
  margin-top: 0.4rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(201, 162, 75, 0.45);
  color: var(--gold-bright);
}
.pz-cols {
  --pzw: clamp(58px, 16vw, 132px);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.5rem;
  justify-items: center;
}
.pz-no {
  --s: 34px;
}
.pz-cell {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  width: 100%;
  min-height: calc(var(--pzw) * 1.4);
}
.pz-cell .card {
  --cw: var(--pzw);
}
.pz-cell.skipped > .card {
  opacity: 0.35;
}
.pz-empty {
  display: grid;
  place-items: center;
  width: var(--pzw);
  aspect-ratio: 5 / 7;
  padding: 0;
  border: 1px dashed var(--line);
  background: none;
  font: inherit;
  font-size: 0.75rem;
  color: var(--ink-soft);
  text-align: center;
}
button.pz-empty {
  cursor: pointer;
}
/* カードを選んでいる間は、空いている枠が「ここに出せる」と光る。先に選んだ枠は金で塗る */
.pz-empty.target {
  border: 1px solid var(--gold);
  color: var(--gold-bright);
  box-shadow: inset 0 0 18px rgba(240, 212, 138, 0.18);
  animation: pz-target 1.4s ease-in-out infinite;
}
.pz-empty.sel {
  border: 2px solid var(--gold-bright);
  background: rgba(240, 212, 138, 0.14);
  color: var(--gold-bright);
  font-weight: 700;
}
@keyframes pz-target {
  50% {
    box-shadow: inset 0 0 26px rgba(240, 212, 138, 0.32), 0 0 10px rgba(240, 212, 138, 0.25);
  }
}
button.pz-empty:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .pz-empty.target {
    animation: none;
  }
}
.pz-skip {
  font-size: 0.6875rem;
  color: var(--ink-soft);
}
/* 結果: カードの下側にパワーのひし形と勝敗 */
.pz-pw {
  position: absolute;
  left: 50%;
  bottom: 0.1rem;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  animation: rise 0.35s ease both;
  animation-delay: calc(var(--i) * 0.35s);
  pointer-events: none;
}
.pz-pw .dia {
  --s: 40px;
}
.pz-pw.changed .dia::before {
  box-shadow: 0 0 0 2px var(--gold-bright);
}
.pz-pw em {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 900;
  font-size: 0.875rem;
  letter-spacing: 0.06em;
  text-shadow: 0 1px 4px #000;
}
.pz-pw small {
  padding: 0 0.4em;
  background: var(--gold);
  color: var(--night);
  font-size: 0.625rem;
  font-weight: 700;
}
.pz-pw.out-win em {
  color: var(--red-bright);
}
.pz-pw.out-lose em {
  color: var(--blue-bright);
}
.pz-pw.out-draw em {
  color: #5fd68e;
}
.pz-hand {
  margin-top: 1.4rem;
}
.pz-hand h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.8rem;
  margin-bottom: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
}
.pz-hand h2 small {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-soft);
}
.pz-hand-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.pz-hand-row .card {
  --cw: clamp(62px, 16vw, 116px);
}
.pz-hand-row li {
  display: grid;
  justify-items: center;
  gap: 0.25rem;
}
.pz-hand-row li.used .card:not(.sel) {
  opacity: 0.35;
}
/* 並べたカード: どのバトルに出したか */
.pz-at {
  padding: 0 0.5em;
  border: 1px solid rgba(240, 212, 138, 0.55);
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.5;
  color: var(--gold-bright);
}
.pz-info-acts {
  margin-top: 0.6rem;
}
.pz-info {
  margin-top: 0.8rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line);
  background: var(--paper);
}
.pz-acts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.4rem;
}
.pz-result {
  margin-top: 1.4rem;
  display: grid;
  gap: 0.9rem;
}
.pz-verdict {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem 0.8rem;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.5625rem, 5vw, 2rem);
  animation: rise 0.4s ease 1.8s both;
}
.pz-verdict .dia {
  --s: 64px;
}
.pz-verdict .dia > b {
  font-size: 0.875rem;
}
.pz-verdict small {
  width: 100%;
  text-align: center;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--ink-soft);
}
.pz-verdict.win {
  color: var(--gold-bright);
}
.pz-log {
  display: grid;
  gap: 0.4rem;
}
.pz-log > li {
  display: grid;
  grid-template-columns: 5.5em minmax(0, 1fr) auto;
  gap: 0.2rem 0.8rem;
  padding: 0.5rem 0.7rem;
  border-left: 3px solid var(--line);
  background: rgba(22, 34, 87, 0.5);
  font-size: 0.875rem;
  animation: rise 0.3s ease both;
  animation-delay: calc(var(--i) * 0.35s);
}
.pz-log i {
  font-style: normal;
  font-weight: 700;
  color: var(--gold-bright);
}
.pz-log em {
  font-style: normal;
  font-weight: 700;
}
.pz-log ul {
  grid-column: 1 / -1;
  padding-left: 5.5em;
  color: var(--ink-soft);
  font-size: 0.8125rem;
}
@media (max-width: 640px) {
  .pz-cols {
    gap: 0.25rem;
  }
  .pz-pw .dia {
    --s: 30px;
  }
  .pz-pw em {
    font-size: 0.6875rem;
  }
  .pz-log > li {
    grid-template-columns: minmax(0, 1fr);
  }
  .pz-log ul {
    padding-left: 0.6em;
  }
}
@media (prefers-reduced-motion: reduce) {
  .pz-pw,
  .pz-verdict,
  .pz-log > li,
  .tw-show-floor,
  .tw-show-opp {
    animation: none;
  }
}

/* ---------- レイドボスバトル ----------
   ボスは赤(ボスの HP・ボスの印)、チームは青(ライフ・味方の札)。難しさは塗ったひし形の数。
   HP とライフは横長のメーター。数字はひし形の中(HP = 赤、ライフ = 青)。 */
.stars {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 3px;
}
.stars i {
  display: block;
  width: 8px;
  height: 8px;
  border: 1.5px solid var(--red-bright);
  transform: rotate(45deg);
}
.stars i.on {
  background: var(--red-bright);
}
/* ボスのアイコンは赤の二重の輪 */
.boss-av {
  display: inline-grid;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--night), 0 0 0 3.5px var(--red-bright), 0 0 18px -4px var(--red-bright);
}
.rule-badge.rule-raid {
  --rc: var(--red-bright);
}
.chip-boss {
  border-color: var(--red-bright);
  background: var(--rose);
  color: #fff;
}
.chip-ally {
  border-color: var(--blue-bright);
  color: var(--blue-bright);
}

/* メーター */
.meter {
  display: grid;
  grid-template-columns: auto minmax(60px, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}
.meter-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.meter-hp .meter-label {
  color: var(--red-bright);
}
.meter-life .meter-label {
  color: var(--blue-bright);
}
.meter-bar {
  position: relative;
  height: 10px;
  border: 1px solid var(--gold);
  background: #070d26;
  overflow: hidden;
}
.meter-bar i {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--to);
}
.meter-hp .meter-fill {
  background: linear-gradient(90deg, var(--rose), var(--red-bright));
}
.meter-life .meter-fill {
  background: linear-gradient(90deg, var(--azure), var(--blue-bright));
}
/* 減った分は白く光ってから消える(演出のときだけ) */
.meter.drop .meter-fill {
  width: var(--from);
  animation: meter-drop 0.7s ease calc(2.2s + var(--wait, 0s)) forwards;
}
.meter.drop .meter-lost {
  left: var(--to);
  width: calc(var(--from) - var(--to));
  background: #fff;
  opacity: 0;
  animation: meter-flash 1.1s ease calc(2.1s + var(--wait, 0s)) both;
}
@keyframes meter-drop {
  to {
    width: var(--to);
  }
}
@keyframes meter-flash {
  15% {
    opacity: 0.9;
  }
  to {
    opacity: 0;
  }
}
.meter-num {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  white-space: nowrap;
}
.meter-num .dia {
  --s: 34px;
}
.meter-num small {
  font-size: 0.75rem;
  color: var(--on-night-soft);
}
.raid-meters {
  display: grid;
  gap: 0.35rem;
  width: min(100%, 520px);
}

/* ロビー: ボスを選ぶ */
.bosspicks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}
.bosspick {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  min-height: 64px;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--line);
  background: none;
  color: var(--ink-soft);
  text-align: left;
  line-height: 1.35;
}
.bosspick .av img {
  filter: grayscale(0.85) brightness(0.7);
}
.bosspick-body {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}
.bosspick-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.0625rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bosspick-sub {
  font-size: 0.6875rem;
}
.bosspick-off {
  grid-column: 1 / -1;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  min-height: 44px;
}
.bosspick.on {
  border-color: var(--red-bright);
  background: linear-gradient(110deg, color-mix(in srgb, var(--rose) 30%, var(--paper)), var(--paper) 70%);
  color: var(--ink);
  box-shadow: inset 3px 0 0 var(--red-bright);
}
.bosspick-off.on {
  border-color: var(--gold-bright);
  background: var(--paper);
  box-shadow: inset 3px 0 0 var(--gold-bright);
}
.bosspick.on .av img {
  filter: none;
}
.bosspick:disabled {
  cursor: default;
}
.raid-help {
  margin-top: 0.7rem;
  padding: 0.65rem 0.85rem;
  border-left: 3px solid var(--red-bright);
  background: color-mix(in srgb, var(--rose) 12%, transparent);
  font-size: 0.875rem;
  line-height: 1.6;
}
.raid-help-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.6rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
}
.boss-ability {
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem 0.6em;
  margin: 0.25rem 0;
}
.boss-ability b {
  color: var(--red-bright);
}

/* デッキ構築: ボスの札 */
.raid-panel {
  display: grid;
  gap: 0.55rem;
  width: min(100%, 560px);
  margin: 0.9rem auto 0;
  padding: 0.8rem 1.1rem 0.85rem;
  border: 1px solid var(--red-bright);
  background: linear-gradient(100deg, color-mix(in srgb, var(--rose) 26%, #0b1438), #0b1438 72%);
  box-shadow: inset 0 0 0 3px #0b1438, inset 0 0 0 4px color-mix(in srgb, var(--red-bright) 45%, transparent);
  text-align: left;
}
.raid-panel-who {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}
.raid-panel-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--red-bright);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}
.raid-panel-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.25rem, 3.2vw, 1.5625rem);
  line-height: 1.25;
}
.raid-panel .boss-ability {
  font-size: 0.9375rem;
}
.raid-panel-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.2rem 1rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--gold-bright);
}
.raid-panel-foot span {
  font-weight: 500;
  color: var(--on-night-soft);
}
.raid-rage {
  color: var(--red-bright);
  font-weight: 700;
}
.raid-panel.rage,
.raid-hud-in.rage {
  animation: rage-glow 1.6s ease-in-out infinite;
}
@keyframes rage-glow {
  50% {
    box-shadow: inset 0 0 0 3px #0b1438, inset 0 0 0 4px var(--red-bright), 0 0 28px -4px var(--red-bright);
  }
}

/* バトル: 上の帯(ボスの HP・チームのライフ・ラウンド) */
.raid-hud {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0.35rem clamp(0.75rem, 3vw, 1.5rem) 0.45rem;
}
.raid-hud-in {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.4rem 1.4rem;
}
.raid-hud-round {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  white-space: nowrap;
}
.raid-hud-round .dia {
  --s: 34px;
}
.raid-hud-round .dia-line::before {
  box-shadow: inset 0 0 0 1.5px var(--gold-bright);
}
.raid-hud-round .dia-line > b {
  color: var(--gold-bright);
}
.raid-hud-round small {
  font-size: 0.75rem;
  color: var(--on-night-soft);
}
/* ボスの行は赤みを帯びた夜、味方の行は青い札 */
.opps .pl.boss-row {
  background: linear-gradient(90deg, color-mix(in srgb, var(--rose) 20%, transparent), transparent 55%);
  border-top: 1px solid rgba(238, 90, 114, 0.45);
}
.opps .pl.boss-row + .pl {
  border-top-color: rgba(238, 90, 114, 0.45);
}
.boss-skill {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--red-bright);
}
.dealt {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.75rem;
  font-weight: 700;
}
.dealt .dia {
  --s: 28px;
}
.ally-hand {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}
.ally-hand .card {
  --cw: 30px;
}
.slot-boss {
  position: relative;
}
.slot-raid {
  position: absolute;
  right: -6px;
  bottom: -6px;
  display: grid;
  gap: 2px;
}
.slot-raid b {
  padding: 1px 4px 0;
  font-family: var(--font-display);
  font-size: 0.6875rem;
  line-height: 1.3;
  color: #fff;
}
.slot-raid .sr-dmg {
  background: var(--rose);
}
.slot-raid .sr-lost {
  background: var(--azure);
}
.flag-raid {
  border-color: var(--red-bright);
  background: var(--rose);
  color: #fff;
}
.eff-boss {
  --ec: var(--red-bright);
}

/* 演出: バトルの公開(左にボス、右にチーム。ボスのあとに細い仕切り) */
.show-cards[data-n="5"] {
  --scw: clamp(54px, 15.5vw, 140px);
  gap: clamp(0.5rem, 2.4vw, 2.2rem);
}
.show-cards[data-n="5"] .sc-who {
  gap: 0.2rem;
  padding: 0 0.3em;
  font-size: 0.75rem;
}
.show-cards[data-n="5"] .dia {
  --s: clamp(28px, 7vw, 52px);
}
.raid-cards .sc-boss {
  position: relative;
}
.raid-cards .sc-boss::after {
  content: "";
  position: absolute;
  top: 8%;
  bottom: 8%;
  right: calc(clamp(0.5rem, 3vw, 2.2rem) / -2);
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--red-bright), transparent);
}
.sc-boss .sc-who {
  background: var(--rose);
}
.sc-boss .sc-out {
  display: none;
}
.chip-dmg {
  border-color: var(--red-bright);
  background: var(--rose);
  color: #fff;
}
.chip-lost {
  border-color: var(--blue-bright);
  background: var(--azure);
  color: #fff;
}
.sc-tags .chip-dmg,
.sc-tags .chip-lost {
  animation: rise 0.4s ease calc(1.6s + var(--wait, 0s)) both;
}
.sc-vs {
  font-size: 0.6875rem;
  color: var(--ink-soft);
  text-align: center;
}
.raid-meters-show {
  animation: rise 0.4s ease calc(1.8s + var(--wait, 0s)) both;
}
.raid-rage-show {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.25rem;
  color: var(--red-bright);
  animation: rise 0.4s ease calc(2s + var(--wait, 0s)) both;
}
.show-raid-round .raid-meters {
  margin: 0.2rem 0 0.4rem;
}
.raid-score {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.75rem;
  white-space: nowrap;
}
.raid-score .dia {
  --s: 32px;
}

/* 演出: ボスの登場(赤い後光の前に看板のカード) */
.show-boss {
  gap: 0.55rem;
}
.boss-stage {
  position: relative;
  display: grid;
  place-items: center;
  padding: 0.6rem 0 0.3rem;
}
/* ボスの名前・能力などの文字は、カードの特殊演出(翼・暗くなる影など)より手前に */
.show-boss > :not(.boss-stage) {
  position: relative;
  z-index: 1;
}
/* ボスのカード(特殊演出の置き場所 .sp-host を兼ねる)。特殊演出は、降りきったところ(--sp-t)で流れる。show.js の BOSS_FX_AT と同じ時刻 */
.boss-card {
  --cw: clamp(120px, 30vw, 180px);
  --spw: var(--cw);
  --sp-t: 0.85s;
  position: relative;
  animation: boss-in 0.7s cubic-bezier(0.2, 1.3, 0.4, 1) 0.15s both;
}
.boss-stage .card {
  --cw: clamp(120px, 30vw, 180px);
  position: relative;
}
.boss-rays {
  position: absolute;
  inset: -20% -40%;
  display: grid;
  place-items: center;
  animation: whim-spin 18s linear infinite;
}
.boss-rays i {
  position: absolute;
  width: 3px;
  height: 46%;
  transform-origin: 50% 100%;
  transform: translateY(-50%) rotate(var(--a));
  background: linear-gradient(to top, transparent, color-mix(in srgb, var(--red-bright) 55%, transparent), transparent);
}
@keyframes boss-in {
  from {
    opacity: 0;
    transform: scale(0.6) translateY(16px);
    filter: brightness(2.2);
  }
}
.boss-show-stats {
  display: flex;
  justify-content: center;
  gap: 1.4rem;
}
.boss-show-stats li {
  display: grid;
  justify-items: center;
  gap: 0.1rem;
}
.boss-show-stats small {
  font-size: 0.75rem;
  color: var(--ink-soft);
}

/* 結果 */
.raid-end.won .ended-av .av img {
  filter: grayscale(1) brightness(0.75);
}
.raid-end.won .boss-av {
  box-shadow: 0 0 0 2px var(--night), 0 0 0 3.5px var(--gold-bright), 0 0 22px -4px var(--gold-bright);
}
.raid-end-body .raid-meters {
  margin: 0 auto 0.4rem;
}
.raid-scores li {
  flex-wrap: wrap;
}

/* 戦績 */
.raid-rec {
  display: grid;
  gap: 0.35rem;
}
.raid-rec li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.2rem;
  border-bottom: 1px solid var(--line);
}
.rr-name {
  font-family: var(--font-display);
  font-weight: 700;
}
.rr-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
}
.rr-stat .dia {
  --s: 32px;
}

@media (max-width: 760px) {
  .raid-hud-in {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.2rem 0.8rem;
  }
  .raid-hud-in .meter-life {
    grid-column: 1;
  }
  .raid-hud-round {
    grid-row: 1 / span 2;
    grid-column: 2;
  }
  .meter {
    gap: 0.4rem;
  }
  .meter-num .dia,
  .raid-hud-round .dia {
    --s: 28px;
  }
  .ally-hand .card {
    --cw: 22px;
  }
  .table:not([data-n="1"]) .opp.boss-row .boss-skill {
    display: none;
  }
}

/* ---------- 機能一覧(トップの上のメニュー。features.js) ----------
   まとまりごとに金の線の見出し、機能は細い線の札を2列に。遊び方のモードには「始める」の赤いボタン。 */
.modal-features {
  width: min(100%, 960px);
}
.fl-intro {
  color: var(--ink-soft);
}
.fl-group {
  margin-top: 1.6rem;
}
.fl-group h3 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(201, 162, 75, 0.55);
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--gold-bright);
}
.fl-group h3::before {
  content: "";
  width: 9px;
  height: 9px;
  background: var(--gold);
  transform: rotate(45deg);
}
.fl-lead {
  margin-top: 0.45rem;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}
.fl-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 0.75rem;
}
.fl-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  align-items: start;
  gap: 0.25rem 0.75rem;
  padding: 0.75rem 0.85rem 0.8rem 0.7rem;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(22, 34, 87, 0.7), transparent 85%);
}
.fl-mark {
  width: 8px;
  height: 8px;
  margin: 0.55rem 0.15rem 0;
  border: 1.5px solid var(--gold);
  transform: rotate(45deg);
}
.fl-body h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.0625rem;
  line-height: 1.4;
}
.fl-body p {
  margin-top: 0.2rem;
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--ink-soft);
}
.fl-body .fl-status {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold-bright);
}
.fl-act {
  grid-column: 2;
  align-self: end;
  margin-top: 0.45rem;
}
.fl-act .btn {
  white-space: nowrap;
}
@media (max-width: 760px) {
  .fl-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- カード一覧: 両面カード ----------
   後ろに裏面を少し傾けて重ね(右上にのぞく)、下に金の「両面」の札。裏面を押すと裏面を拡大する。 */
.gallery-grid .g-dual {
  position: relative;
  isolation: isolate;
}
.gallery-grid .g-back {
  position: absolute !important;
  inset: 0 auto auto 0;
  z-index: -1;
  transform: translate(7%, -3%) rotate(6deg);
  transform-origin: 30% 100%;
  filter: brightness(0.85);
  box-shadow: 0 0 0 1.5px var(--gold-bright), 0 6px 14px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s ease, filter 0.2s ease;
}
.gallery-grid .g-back:hover,
.gallery-grid .g-back:focus-visible {
  transform: translate(14%, -4%) rotate(9deg);
  filter: none;
}
.gallery-grid .g-front {
  box-shadow: 0 0 0 1.5px var(--gold-bright), 0 6px 14px rgba(0, 0, 0, 0.45);
}
.g-dual-badge {
  position: absolute;
  left: 50%;
  bottom: -0.55rem;
  z-index: 2;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.15em 0.75em 0.15em 0.6em;
  border: 1.5px solid var(--night);
  background: var(--gold-bright);
  color: var(--night);
  font-size: 0.8125rem;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: 0.06em;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 0 0 1px var(--gold-bright), 0 4px 10px rgba(0, 0, 0, 0.5);
}
/* 札の印: 2枚のカードを少しずらして重ねた形 */
.g-dual-badge::before {
  content: "";
  width: 0.62em;
  height: 0.85em;
  border: 1.5px solid var(--night);
  border-radius: 1px;
  box-shadow: 0.22em -0.18em 0 -0.02em var(--gold-bright), 0.22em -0.18em 0 0.07em var(--night);
}
.gallery-grid {
  row-gap: 1.1rem;
}
.gallery-note {
  margin: -0.4rem 0 0.8rem;
  font-size: 0.75rem;
  color: var(--gold-bright);
}

/* ---------- 遊べる人数のバッジ(トップの「いろいろな遊び方」・機能一覧) ----------
   1人用 = 金の線、みんなで遊べる = 青の線、3人以上そろって遊ぶもの(3〜4人・4人) = 赤の線。ボタンでは右上の角に置く。 */
.players-badge {
  display: inline-block;
  padding: 0 0.5em;
  border: 1px solid var(--gold);
  color: var(--gold-bright);
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 700;
  font-style: normal;
  line-height: 1.55;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.players-badge.multi {
  border-color: var(--blue-bright);
  background: rgba(47, 95, 184, 0.35);
  color: #dbe6ff;
}
.players-badge.many {
  border-color: var(--red-bright);
  background: rgba(192, 22, 44, 0.38);
  color: #ffe1e6;
}
/* トップのボタンでは、上の縁にかかる札(塗り: 1人用 = 金、みんなで = 青) */
.solo-btn {
  position: relative;
  padding-top: 0.75rem;
}
.solo-btn .players-badge {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -55%);
  border-color: var(--gold-bright);
  background: var(--gold-bright);
  color: var(--night);
  font-size: 0.625rem;
  line-height: 1.45;
}
.solo-btn .players-badge.multi {
  border-color: var(--blue-bright);
  background: var(--azure);
  color: #fff;
}
.solo-btn .players-badge.many {
  border-color: var(--red-bright);
  background: var(--rose);
  color: #fff;
}
.entry-solo-acts {
  row-gap: 1rem;
  padding-top: 0.45rem;
}
.fl-body h4 .players-badge {
  margin-left: 0.6em;
  vertical-align: 0.15em;
}

/* ---------- 限定構築+自由枠 ----------
   色は限定構築と同じ藤。自由枠(6枚目)だけ金: コストの表示の「自」のひし形、デッキの空き枠の点線。 */
.seg-plus,
.rule-badge.rule-plus {
  --rc: var(--limited);
}
.rule-plus .rule-help {
  padding-left: 0.7em;
  border-left: 3px solid var(--limited);
}
.seg-plus::before {
  box-shadow: inset 0 0 0 1.5px var(--rc), 0 0 0 1.5px var(--gold-bright) !important;
}
.cost-plus .cost-slots .dia-free:not(.dia-line)::before {
  background: var(--gold-bright);
}
.cost-plus .cost-slots .dia-free:not(.dia-line) > b {
  color: var(--night);
}
.cost-plus .cost-slots .dia-free.dia-line::before {
  box-shadow: inset 0 0 0 1.5px var(--gold);
}
.cost-plus .cost-slots .dia-free.dia-line > b {
  color: var(--gold);
}
.cost-plus .cost-slots .dia-free > b {
  font-size: calc(var(--s) * 0.34);
}
.deck-row.six .card {
  --cw: clamp(50px, 13.4vw, 132px);
}
.free-slot .free-empty {
  display: grid;
  place-content: center;
  gap: 0.3rem;
  width: clamp(50px, 13.4vw, 132px);
  aspect-ratio: 600 / 875;
  padding: 0.4rem;
  border: 1.5px dashed var(--gold);
  background: rgba(201, 162, 75, 0.06);
  color: var(--gold-bright);
  text-align: center;
}
.free-slot .free-empty b {
  font-family: var(--font-display);
  font-size: clamp(0.75rem, 1.6vw, 1rem);
}
.free-slot .free-empty small {
  font-size: clamp(0.5625rem, 1.1vw, 0.75rem);
  line-height: 1.4;
  color: var(--ink-soft);
}
.free-slot .free-empty:hover:not(:disabled) {
  background: rgba(201, 162, 75, 0.14);
}
.hand.six .card {
  --cw: clamp(48px, 14.2vw, 124px);
}
.hand.six {
  gap: clamp(4px, 1.2vw, 14px);
}
/* 成り上がり戦: 挑戦の前に選ぶデッキ構築のルール */
.tw-rule {
  display: grid;
  justify-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1rem 1rem;
  border: 1px solid rgba(201, 162, 75, 0.45);
  text-align: center;
}
.tw-rule h3 {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 0.2rem 0.7rem;
  font-family: var(--font-display);
  font-size: 1.125rem;
}
.tw-rule h3 small {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--ink-soft);
}
.tw-rule .seg {
  flex-wrap: wrap;
  justify-content: center;
}
.tw-rule .rule-help {
  max-width: 44rem;
  text-align: left;
  font-size: 0.875rem;
}
.tw-rule.rule-casual .rule-help {
  border-left: 3px solid var(--casual);
  padding-left: 0.7em;
}
.tw-rule.rule-limited .rule-help {
  border-left: 3px solid var(--limited);
  padding-left: 0.7em;
}
/* 塔のルールは2段: デッキ構築 / 1戦の勝負(1ラウンド制・2ラウンド制)。段の名前は小さな金の文字 */
.tw-rule-block {
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  width: 100%;
}
.tw-rule-block + .tw-rule-block {
  padding-top: 0.8rem;
  border-top: 1px solid rgba(201, 162, 75, 0.3);
}
.tw-rule-block h4 {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--gold-bright);
}
.tw-rule .tw-rule-chips .rule-help {
  border-left: 3px solid var(--gold);
  padding-left: 0.7em;
}
.seg-chips button {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
}
.seg-chips button small {
  padding: 0.05em 0.45em;
  border: 1px solid rgba(240, 212, 138, 0.55);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--gold-bright);
}
.tw-show-chips {
  margin-top: -0.3rem;
  color: var(--gold-bright);
}

/* ---------- チュートリアル完了(tutorial.js の doneHTML) ----------
   ゲームが終わって結果の演出が済んだら、大きく出す。後光の前に金のひし形の勲章(中にチェックの印)、
   大きな明朝の「チュートリアル完了」、覚えたこと5つ(金の小さなひし形)、次の遊び方のボタン。 */
.modal-tutdone {
  width: min(100%, 580px);
  text-align: center;
}
.tutdone {
  display: grid;
  justify-items: center;
  gap: 0.85rem;
  padding: 0.25rem 0 0.1rem;
}
.tutdone-medal {
  position: relative;
  display: grid;
  place-items: center;
  width: 150px;
  height: 150px;
  margin-bottom: 0.2rem;
}
.tutdone-rays {
  position: absolute;
  inset: -34%;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(240, 212, 138, 0.42) 0 5deg, transparent 5deg 15deg);
  -webkit-mask: radial-gradient(circle, #000 18%, transparent 66%);
  mask: radial-gradient(circle, #000 18%, transparent 66%);
  animation: tutdone-rays 24s linear infinite;
}
@keyframes tutdone-rays {
  to {
    rotate: 360deg;
  }
}
.tutdone-dia {
  position: relative;
  width: 96px;
  height: 96px;
  rotate: 45deg;
  background: linear-gradient(135deg, #fbecc0, var(--gold-bright) 38%, var(--gold) 70%, #8a6826);
  box-shadow:
    0 0 0 4px var(--night),
    0 0 0 5.5px var(--gold-bright),
    0 0 44px rgba(240, 212, 138, 0.6);
  animation: tutdone-pop 0.75s cubic-bezier(0.2, 1.5, 0.4, 1) both;
}
@keyframes tutdone-pop {
  from {
    opacity: 0;
    scale: 0.3;
  }
}
/* チェックの印(ひし形の中で、ふつうの向きになるよう回す) */
.tutdone-check {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 46%;
  height: 24%;
  border-left: 8px solid var(--night);
  border-bottom: 8px solid var(--night);
  translate: -50% -50%;
  rotate: -90deg;
  transform: translate(8%, -12%);
}
.tutdone-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 7vw, 2.75rem);
  line-height: 1.2;
  letter-spacing: 0.08em;
  color: var(--gold-bright);
  text-shadow: 0 0 24px rgba(240, 212, 138, 0.35);
  animation: tutdone-rise 0.6s ease 0.25s both;
}
@keyframes tutdone-rise {
  from {
    opacity: 0;
    translate: 0 10px;
  }
}
.tutdone-lead {
  margin: 0;
  max-width: 30em;
  font-size: 1.0625rem;
  line-height: 1.75;
}
.tutdone-list {
  display: grid;
  gap: 0.45rem;
  margin: 0.2rem 0 0;
  padding: 0.95rem 1.2rem;
  list-style: none;
  text-align: left;
  border-top: 1px solid rgba(201, 162, 75, 0.55);
  border-bottom: 1px solid rgba(201, 162, 75, 0.55);
}
.tutdone-list li {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  line-height: 1.5;
}
.tutdone-list li::before {
  content: "";
  flex: none;
  width: 0.55em;
  height: 0.55em;
  rotate: 45deg;
  translate: 0 -0.1em;
  background: var(--gold-bright);
}
.tutdone-next {
  margin: 0;
  max-width: 30em;
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--ink-soft);
}
.tutdone-acts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}
.tutdone-close {
  margin-top: 0.1rem;
}
@media (max-width: 560px) {
  .tutdone {
    gap: 0.65rem;
  }
  .tutdone-medal {
    width: 112px;
    height: 112px;
  }
  .tutdone-dia {
    width: 72px;
    height: 72px;
  }
  .tutdone-check {
    border-width: 0 0 6px 6px;
  }
  .tutdone-title {
    white-space: nowrap;
    font-size: clamp(1.5rem, 7.4vw, 2rem);
    letter-spacing: 0.04em;
  }
  .tutdone-lead {
    font-size: 0.9375rem;
  }
  .tutdone-list {
    padding: 0.75rem 0.4rem;
    font-size: 0.875rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .tutdone-rays,
  .tutdone-dia,
  .tutdone-title {
    animation: none;
  }
}

/* ---------- 詰めバトル: 勝敗の演出(puzzle.js の showHTML) ----------
   バトルごとの勝敗が出終わる 1.9秒後(SHOW_AT)に、画面いっぱいに出す。
   クリア = 金の後光が回る前に金のひし形「WIN」が落ちてはじけ、金の粒が散り、明朝の大きな「クリア!」。
   失敗 = 青のひし形「LOSE」が静かに沈み、「ラウンドに勝てませんでした」と次にできること。押すと閉じる。 */
.pz-show {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: radial-gradient(ellipse at 50% 42%, rgba(15, 27, 69, 0.93), rgba(6, 12, 34, 0.98) 70%);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  cursor: pointer;
  animation: pz-show 0.35s ease 1.9s both;
}
@keyframes pz-show {
  from {
    opacity: 0;
    visibility: hidden;
  }
  to {
    opacity: 1;
    visibility: visible;
  }
}
.pz-show-in {
  display: grid;
  justify-items: center;
  gap: 0.55rem;
  max-width: 30rem;
  text-align: center;
}
.pz-show-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 200px;
  height: 200px;
}
.pz-show-mark .dia {
  --s: 150px;
  animation: pz-dia-win 0.7s cubic-bezier(0.2, 1.5, 0.4, 1) 2s both;
}
.pz-show-mark .dia > b {
  font-size: 2.1rem;
  letter-spacing: 0.06em;
}
@keyframes pz-dia-win {
  from {
    opacity: 0;
    translate: 0 -60px;
    scale: 0.4;
  }
}
.pz-show.win .pz-show-mark .dia::before {
  box-shadow:
    0 0 0 4px var(--night),
    0 0 0 6px var(--gold-bright),
    0 0 50px rgba(240, 212, 138, 0.65);
}
.pz-show-rays {
  position: absolute;
  inset: -45%;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(240, 212, 138, 0.4) 0 5deg, transparent 5deg 15deg);
  -webkit-mask: radial-gradient(circle, #000 16%, transparent 64%);
  mask: radial-gradient(circle, #000 16%, transparent 64%);
  animation:
    pz-rays-in 0.6s ease 2.05s both,
    tutdone-rays 24s linear 2.05s infinite;
}
@keyframes pz-rays-in {
  from {
    opacity: 0;
    scale: 0.5;
  }
}
/* はじける金の粒(小さなひし形) */
.pz-show-sparks {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.pz-show-sparks i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  background: var(--gold-bright);
  box-shadow: 0 0 10px rgba(240, 212, 138, 0.9);
  opacity: 0;
  animation: pz-spark 1s cubic-bezier(0.15, 0.7, 0.3, 1) 2.3s both;
}
@keyframes pz-spark {
  0% {
    opacity: 0;
    transform: rotate(var(--a)) translateY(0) rotate(45deg) scale(0.4);
  }
  15% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: rotate(var(--a)) translateY(calc(-150px * var(--r))) rotate(45deg) scale(1);
  }
}
.pz-show-word {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.4rem, 10vw, 3.6rem);
  line-height: 1.15;
  letter-spacing: 0.06em;
  color: var(--gold-bright);
  text-shadow: 0 0 28px rgba(240, 212, 138, 0.4);
  animation: tutdone-rise 0.5s ease 2.35s both;
}
.pz-show-score {
  margin: 0;
  font-family: var(--font-num);
  font-size: 1.25rem;
  color: var(--ink);
  animation: tutdone-rise 0.5s ease 2.5s both;
}
.pz-show-note {
  margin: 0;
  text-wrap: pretty;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--ink-soft);
  animation: tutdone-rise 0.5s ease 2.6s both;
}
.pz-show-in .btn {
  margin-top: 0.6rem;
  animation: tutdone-rise 0.5s ease 2.7s both;
}
/* 失敗: 青。ひし形は少し傾いて沈む */
.pz-show.lose .pz-show-mark {
  height: 170px;
}
.pz-show.lose .pz-show-mark .dia {
  animation-name: pz-dia-lose;
  animation-timing-function: ease-out;
}
.pz-show.lose .pz-show-mark .dia::before {
  box-shadow:
    0 0 0 4px var(--night),
    0 0 0 6px var(--blue-bright),
    0 0 40px rgba(141, 176, 247, 0.4);
}
@keyframes pz-dia-lose {
  from {
    opacity: 0;
    translate: 0 -20px;
  }
  to {
    rotate: -6deg;
  }
}
.pz-show.lose .pz-show-word {
  font-size: clamp(1.6rem, 6.4vw, 2.3rem);
  color: var(--blue-bright);
  text-shadow: 0 0 22px rgba(141, 176, 247, 0.35);
}
@media (prefers-reduced-motion: reduce) {
  .pz-show,
  .pz-show-mark .dia,
  .pz-show-rays,
  .pz-show-word,
  .pz-show-score,
  .pz-show-note,
  .pz-show-in .btn {
    animation: none;
  }
  .pz-show-sparks {
    display: none;
  }
}
/* 塔のルールのボタン: 名前の横に、最初に選ぶレアカードの数(金の細い枠)。もう選べないルールは暗く */
.tw-rule .seg-rule button small {
  padding: 0.05em 0.45em;
  border: 1px solid rgba(240, 212, 138, 0.55);
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--gold-bright);
}
.tw-rule .seg-rule button:disabled:not(.on) {
  opacity: 0.4;
}
/* 詰めバトルの勝敗の演出: この問題で解除した実績(称号の札) */
.pz-show-ach {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin: 0.2rem 0 0;
  font-size: 0.875rem;
  color: var(--gold-bright);
  animation: tutdone-rise 0.5s ease 2.65s both;
}
@media (prefers-reduced-motion: reduce) {
  .pz-show-ach {
    animation: none;
  }
}

/* ---------- 上級ルール(ロビーのルール欄。いまは「自由枠」= 限定構築+自由枠) ----------
   慣れてきた人向けの印として、金地に紺の小さな札「上級」。スイッチは限定構築のときだけ押せる。 */
.adv-tag {
  display: inline-block;
  margin-left: 0.45em;
  padding: 0.08em 0.45em;
  background: var(--gold-bright);
  color: var(--night);
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: 0.04em;
  vertical-align: 0.12em;
}
.rule-row.rule-adv h3 small {
  margin-left: 0.6em;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ink-soft);
}
.rule-adv .toggle input:disabled + .toggle-ui {
  opacity: 0.45;
}
.tw-rule .seg-rule button .adv-tag {
  margin-left: 0;
}

/* ---------- レアリティ解禁戦(ladder.js) ----------
   レアカードだけで7階まで登る。目印は、右上がりの階段に並べた7つのひし形と、レアリティの札。
   札の色は、解禁の順に強くなる: R = 青い線 → SR = 金の線 → UR = 金の地 → SP = 赤から藤への地。 */
.rchip {
  display: inline-grid;
  place-items: center;
  min-width: 2.1em;
  padding: 0.08em 0.4em;
  border: 1.5px solid var(--rk, var(--blue-bright));
  font-family: var(--font-num);
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.04em;
  color: var(--rk, var(--blue-bright));
}
.rchip-SR {
  --rk: var(--gold-bright);
}
.rchip-UR {
  border-color: var(--gold-bright);
  background: var(--gold-bright);
  color: var(--night);
}
.rchip-SP {
  border-color: transparent;
  background: linear-gradient(100deg, var(--rose-deep), var(--limited));
  color: #fff;
}
.rule-badge.rule-ladder-badge {
  --rc: var(--blue-bright);
  flex-wrap: wrap;
}
.ld-badge-r {
  display: inline-flex;
  gap: 0.25rem;
  align-self: center;
}

/* 階段: 1階(左下)から7階(右上)へ。段の踏み板は金の細い線 */
.ld-strip {
  --rise: 7px;
  display: flex;
  align-items: flex-end;
  gap: 0.3rem;
  padding-top: calc(var(--rise) * 6);
  flex: none;
}
.ld-strip li {
  display: grid;
  justify-items: center;
  gap: 0.25rem;
  padding: 0 0.1rem 0.3rem;
  border-bottom: 2px solid rgba(201, 162, 75, 0.45);
  transform: translateY(calc(var(--f) * var(--rise) * -1));
}
.ld-strip li .dia {
  --s: 38px;
}
.ld-strip li.now {
  border-bottom-color: var(--red-bright);
}
.ld-strip li.done {
  border-bottom-color: var(--gold-bright);
}
.ld-strip li.lost {
  border-bottom-color: var(--blue-bright);
}
.ld-un {
  display: grid;
  place-items: center;
  min-height: 1.15rem;
}
.ld-strip.compact {
  --rise: 4px;
  justify-content: center;
  margin: 0.7rem auto 0;
}
.ld-strip.compact li .dia {
  --s: 30px;
}
.ld-strip.compact .rchip {
  font-size: 0.625rem;
}
.tw-end-body .ld-strip {
  justify-content: center;
}
@media (max-width: 420px) {
  .ld-strip {
    gap: 0.15rem;
  }
  .ld-strip li .dia {
    --s: 34px;
  }

}

/* ロビーのルール欄 */
.seg-ladder button small,
.rule-ladder .ld-opt .seg button small {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--gold-bright);
}
.seg-ladder button {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
}
.seg-ladder button small {
  padding: 0.05em 0.45em;
  border: 1px solid rgba(240, 212, 138, 0.55);
}
.rule-ladder.is-on .seg-ladder button.on {
  box-shadow: inset 0 -2px 0 var(--blue-bright);
}
.ld-opt {
  margin-top: 0.9rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(201, 162, 75, 0.3);
}
.ld-opt h4 {
  margin: 0 0 0.45rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--gold-bright);
}
.rule-ladder .ld-opt .seg {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  max-width: 30rem;
}
.rule-ladder .ld-opt .seg button {
  display: grid;
  justify-items: center;
  gap: 0.1rem;
  padding: 0.5em 0.4em;
}
.rule-ladder .ld-opt .seg button small {
  padding: 0;
  border: 0;
}
.solo-btn.solo-wide {
  grid-column: 1 / -1;
}
.ld-unlock-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2em 0.45em;
}
.ld-unlock-title .rchip {
  font-size: 0.45em;
  padding: 0.12em 0.5em;
}
.ld-arrow {
  font-size: 1.5rem;
  line-height: 1;
  color: var(--gold-bright);
}
.ld-standings h3 {
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: var(--ink-soft);
}

/* 2〜4人: 勝った階の数 */
.ld-standings ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 0.5rem;
}
.ld-standings li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line);
  background: rgba(22, 34, 87, 0.55);
}
.ld-standings li.me {
  border-color: var(--red-bright);
}
.ld-standings .pl-name {
  min-width: 0;
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ld-wins {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  font-size: 0.6875rem;
  color: var(--ink-soft);
}
.ld-wins .dia {
  --s: 36px;
}
.ld-waiting {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.6rem 0;
}
.ld-waiting-who {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
  color: var(--ink);
}

/* 階に着いたときの演出: 解禁の階は、レアリティの札を大きく */
.ld-show-unlock {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--gold-bright);
  animation: rise 0.5s ease 0.35s both;
}
.ld-show-unlock .rchip {
  font-size: 1.375rem;
  padding: 0.1em 0.55em;
  border-width: 2px;
}
.ld-show-r {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}
.ld-show-r .rchip {
  font-size: 0.75rem;
}

@media (prefers-reduced-motion: reduce) {
  .ld-show-unlock {
    animation: none;
  }

}

/* レアリティ解禁戦: 最初から全解禁(解禁の選択肢は3つ。スマホでは縦に並べる) */
.rule-ladder .ld-opt .seg.seg-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 34rem;
}
@media (max-width: 560px) {
  .rule-ladder .ld-opt .seg.seg-3 {
    grid-template-columns: minmax(0, 1fr);
  }
  .rule-ladder .ld-opt .seg.seg-3 button {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.55em 0.9em;
  }
  .rule-ladder .ld-opt .seg.seg-3 button.on {
    box-shadow: inset 3px 0 0 var(--gold);
  }

}
/* 階段の1階の下: 全部のレアリティが最初から(青 → 金 → 赤) */
.rchip-ALL {
  border-color: transparent;
  background: linear-gradient(100deg, var(--azure) 0%, var(--gold) 55%, var(--rose-deep) 100%);
  color: #fff;
}

/* レアリティ解禁戦: 2枚(いちばん負けた人は3枚)から1枚を選ぶ解禁の札。手に入るカードの下に、入れ替わる自分のカードを小さく */
.tw-offer.ld-deals li {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, 250px);
}
/* 能力の文の長さがちがっても、入れ替わるカードとボタンは下にそろえる */
.tw-offer.ld-deals .ld-out {
  margin-top: auto;
}
.ld-out {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.55rem;
  border: 1px dashed rgba(141, 176, 247, 0.55);
  background: rgba(6, 12, 34, 0.45);
}
.ld-out .card {
  --cw: 46px;
}
.ld-out .ld-arrow {
  font-size: 1.125rem;
}
.ld-out-text {
  display: grid;
  gap: 0.05rem;
  min-width: 0;
  text-align: left;
}
.ld-out-text b {
  overflow: hidden;
  font-size: 0.8125rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ld-out-text small {
  font-size: 0.6875rem;
  line-height: 1.35;
  color: var(--ink-soft);
}
.ld-out-text small:first-child {
  color: var(--blue-bright);
  font-weight: 700;
}
.tw-offer.ld-deals .btn {
  width: 100%;
}
/* 3枚から選ぶとき(直前のラウンドでいちばん負けた人): タブレットの幅でも1行に並ぶように、札を少し細く */
.tw-offer.ld-deals.is-three li {
  width: min(100%, 224px);
}
/* 直前のラウンドでいちばん負けた人の札(その人は3枚から選べる)。ひし形の中は選べる枚数。自分なら金 */
.tw-head .ld-bonus {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: fit-content;
  max-width: 100%;
  margin-top: 0.7rem;
  padding: 0.3rem 0.85rem 0.3rem 0.3rem;
  border: 1px solid rgba(141, 176, 247, 0.4);
  background: rgba(6, 12, 34, 0.45);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--on-night-soft);
}
.tw-head .ld-bonus .dia {
  --s: 34px;
}
.tw-head .ld-bonus.is-me {
  border-color: rgba(201, 162, 75, 0.7);
  background: linear-gradient(90deg, rgba(201, 162, 75, 0.2), rgba(6, 12, 34, 0.45) 70%);
  font-weight: 700;
  color: var(--gold-bright);
}
.ld-show-bonus.is-me {
  font-weight: 700;
  color: var(--gold-bright);
}

/* ---------- レアカード争奪戦(scramble.js) ----------
   配られたレアカードで戦い、勝った人は負けた人のカードを奪い、負けた人は引き直す。3勝か2連勝で勝ち。
   目印は、プレイヤーごとの3つの丸(ラウンド勝利チップ。取ったラウンド = 金)と、赤の「あと1勝」の札。
   交換の画面は、上に負けた人のカード(青い線の箱。選ぶと金)、下に自分のカード(赤い線の箱。選ぶと赤)。 */
.rule-badge.rule-scramble-badge {
  --rc: var(--red-bright);
}
.rule-scramble.is-on .seg-scramble button.on {
  box-shadow: inset 0 -2px 0 var(--red-bright);
}
.rule-scramble .ld-opt .seg {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  max-width: 36rem;
}
.rule-scramble .sc-cap {
  margin-top: 0.6rem;
}
@media (max-width: 560px) {
  .rule-scramble .ld-opt .seg {
    grid-template-columns: minmax(0, 1fr);
  }
  .rule-scramble .ld-opt .seg button {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.55em 0.9em;
  }
}
.rule-scramble .ld-opt .seg button {
  display: grid;
  justify-items: center;
  gap: 0.1rem;
  padding: 0.5em 0.4em;
}
.rule-scramble .ld-opt .seg button small {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--gold-bright);
}

/* 成績の札 */
.sc-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 0.5rem;
  width: 100%;
}
.sc-board li {
  display: flex;
  align-items: center;
  gap: 0.35rem 0.55rem;
  min-height: 2.6rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line);
  background: rgba(22, 34, 87, 0.55);
}
.sc-board li.me {
  border-color: var(--red-bright);
}
.sc-board li.win {
  border-color: var(--gold-bright);
  box-shadow: inset 0 0 0 1px var(--gold-bright);
}
.sc-board .pl-name {
  min-width: 0;
  max-width: 9em;
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sc-score {
  display: grid;
  justify-items: end;
  gap: 0.1rem;
  flex: none;
  margin-left: auto;
}
/* 争奪戦の成績の札: ラウンド勝利チップ(丸。取った = 金で塗った丸) */
.sc-chips {
  display: inline-flex;
  gap: 4px;
}
.sc-chips i {
  display: block;
  width: 13px;
  height: 13px;
  border: 1.5px solid var(--gold);
  border-radius: 50%;
}
.sc-chips i.on {
  border-color: var(--gold-bright);
  background: radial-gradient(circle at 34% 30%, #fff6d6, var(--gold-bright) 50%, var(--gold));
}
.sc-board .dia,
.sc-hist .dia {
  --s: 20px;
}
.sc-streak {
  font-size: 0.625rem;
  line-height: 1.2;
  font-weight: 700;
  color: var(--gold-pale);
}
.sc-tag {
  padding: 0.05em 0.5em;
  background: var(--rose);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.6;
  white-space: nowrap;
}
.sc-tag-win {
  background: var(--gold-bright);
  color: var(--night);
}
.sc-board.compact {
  max-width: 44rem;
  margin: 0.7rem auto 0;
}
.sc-board.compact li {
  padding: 0.3rem 0.55rem;
  font-size: 0.8125rem;
}
.tw-head .sc-board.compact {
  flex: 1 1 16rem;
  max-width: 30rem;
  margin: 0;
  grid-template-columns: minmax(0, 1fr);
}

/* 交換の画面 */
.sc-trade {
  gap: 0.9rem;
}
.sc-side {
  padding: 0.8rem clamp(0.6rem, 2vw, 1rem) 0.9rem;
  border: 1px solid var(--blue-bright);
  background: rgba(6, 12, 34, 0.45);
}
.sc-side.sc-mine {
  border-color: var(--red-bright);
}
.sc-side h2 {
  display: flex;
  align-items: baseline;
  gap: 0.6em;
  margin-bottom: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.0625rem;
}
.sc-side h2 small {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--blue-bright);
}
.sc-mine h2 small {
  color: var(--red-bright);
}
.sc-hint {
  margin: -0.3rem 0 0.6rem;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}
.sc-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.sc-card {
  display: grid;
  justify-items: center;
  gap: 0.2rem;
}
.sc-card-btn {
  padding: 3px;
  border: 0;
  background: none;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.sc-card-btn .card {
  --cw: 92px;
}
.sc-card.sel .sc-card-btn {
  transform: translateY(-4px);
  box-shadow: 0 0 0 2px var(--gold-bright), 0 0 22px rgba(240, 212, 138, 0.35);
}
.sc-mine .sc-card.sel .sc-card-btn {
  box-shadow: 0 0 0 2px var(--red-bright), 0 0 22px rgba(238, 90, 114, 0.35);
}
.sc-card.off .sc-card-btn {
  cursor: default;
  opacity: 0.35;
}
.sc-card-btn:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}
.sc-card .cap {
  font-size: 0.6875rem;
  color: var(--ink-soft);
}
.sc-swap-mark {
  justify-self: center;
  margin: -0.4rem 0;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--gold-bright);
}
@media (max-width: 560px) {
  .sc-cards {
    gap: 0.35rem;
  }
  .sc-card-btn .card {
    --cw: 64px;
  }
}

/* 結果: ラウンドの経過 */
.sc-hist {
  width: 100%;
  text-align: left;
}
.sc-hist h2 {
  margin-bottom: 0.6rem;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}
.sc-hist ol {
  display: grid;
  gap: 0.45rem;
}
.sc-hist ol > li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line);
  background: rgba(22, 34, 87, 0.45);
}
.sc-hist b {
  margin-right: 0.7em;
  font-family: var(--font-display);
}
.sc-hist-win {
  font-size: 0.8125rem;
}
.sc-hist ul {
  margin-top: 0.2rem;
  font-size: 0.75rem;
  color: var(--ink-soft);
}

/* 最初の演出 */
.sc-show-goal span:last-child {
  font-size: 1.25rem;
}
.sc-show-rules {
  display: grid;
  gap: 0.35rem;
  max-width: 28rem;
  text-align: left;
  font-size: 0.875rem;
}
.sc-show-rules li {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
}
.sc-show-rules b {
  flex: none;
  padding: 0.05em 0.5em;
  border: 1px solid var(--gold-bright);
  color: var(--gold-bright);
  font-size: 0.75rem;
}
.sc-show-rules li + li b {
  border-color: var(--blue-bright);
  color: var(--blue-bright);
}

/* 限定構築+自由枠(デッキは5枚): 同じコストの枠の2枚目に、金の「自由枠」の札 */
.tag-free {
  background: var(--gold-bright);
  color: var(--night);
}

/* カード一覧にだけ載せるカード(第2弾のさとり): 下に青い線の「カードリストのみ」の札。拡大の説明にも札と注記 */
.gallery-grid .g-listonly {
  position: relative;
}
.g-list-badge {
  position: absolute;
  left: 50%;
  bottom: -0.55rem;
  z-index: 2;
  transform: translateX(-50%);
  padding: 0.15em 0.7em;
  border: 1.5px solid var(--blue-bright);
  background: var(--night);
  color: var(--blue-bright);
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1.4;
  white-space: nowrap;
  pointer-events: none;
}
.chip.chip-list {
  border-color: var(--blue-bright);
  color: var(--blue-bright);
}
.cinfo-note {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--blue-bright);
}
/* トップの「カード紹介」: カード一覧にだけ載せるカードには、青い「カードリストのみ」 */
.tcard-meta span.tcard-list {
  color: var(--blue-bright);
}
.tcard-meta span.tcard-list::before {
  background: var(--blue-bright);
}
/* カード紹介の、コレクションの札(collection.js。2026年11月20日、くまねこ堂の指定)。
   持っている = 金の地「コレクション済み」、はじめて手に入れた = 赤の「NEW」、まだ = 線だけ「まだ持っていません」 */
.tcard-col {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.45rem 0 0;
}
.tcard-col b {
  padding: 0.2em 0.6em;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.04em;
}
.tcard-col .tcol-own {
  background: var(--gold-bright);
  color: var(--night);
}
.tcard-col .tcol-new {
  background: var(--rose);
  color: #fff;
  animation: tcol-new 1.6s ease-in-out 0.9s 2;
}
/* はじめて手に入れたとき: 札を大きく(NEW と「コレクションに追加しました」) */
.tcard-col.is-new b {
  padding: 0.3em 0.75em;
  font-size: 0.8125rem;
}
.tcard-col.is-new .tcol-new {
  font-family: var(--font-num);
  letter-spacing: 0.12em;
}

/* カードの上の大きな「NEW」(2026年11月20日、くまねこ堂の指定「NEW は分かりやすいように」)。
   めくれ終わったところ(1.3秒)で、赤い札が斜めに押され、後ろに赤と金の光の輪が広がる。その後もゆっくり光る */
.tcard-art {
  position: relative;
}
.tnew {
  position: absolute;
  z-index: 3;
  top: -0.85rem;
  left: 50%;
  translate: -50% 0;
  padding: 0.28em 0.75em 0.22em;
  border: 2px solid var(--gold-bright);
  outline: 1px solid var(--rose);
  outline-offset: 2px;
  background: var(--rose);
  color: #fff;
  font-family: var(--font-num);
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.14em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45), 0 0 18px rgba(238, 90, 114, 0.55);
  rotate: -7deg;
  white-space: nowrap;
  pointer-events: none;
  animation:
    tnew-stamp 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) 1.3s both,
    tnew-glow 2.2s ease-in-out 1.9s infinite;
}
@keyframes tnew-stamp {
  from {
    opacity: 0;
    scale: 2.6;
  }
  60% {
    opacity: 1;
  }
}
@keyframes tnew-glow {
  50% {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45), 0 0 30px rgba(238, 90, 114, 0.9), 0 0 0 4px rgba(240, 212, 138, 0.25);
  }
}
/* 光の輪: カードの後ろから広がって消える(1回) */
.tnew-ring {
  position: absolute;
  z-index: 0;
  inset: 8% -6%;
  border: 2px solid var(--gold-bright);
  box-shadow: 0 0 24px rgba(238, 90, 114, 0.7), inset 0 0 24px rgba(240, 212, 138, 0.5);
  opacity: 0;
  pointer-events: none;
  animation: tnew-ring 0.9s ease-out 1.32s both;
}
@keyframes tnew-ring {
  0% {
    opacity: 0.95;
    scale: 0.9;
  }
  100% {
    opacity: 0;
    scale: 1.35;
  }
}
.tcard-art .dflip {
  position: relative;
  z-index: 1;
}
/* オープニングのカードが収まったあとに、すぐ押し直す */
.tcard-art.new-now .tnew {
  animation:
    tnew-stamp 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) 0.1s both,
    tnew-glow 2.2s ease-in-out 0.7s infinite;
}
.tcard-art.new-now .tnew-ring {
  animation: tnew-ring 0.9s ease-out 0.12s both;
}
.tcard-col .tcol-miss {
  border: 1px solid rgba(201, 162, 75, 0.6);
  color: var(--ink-soft);
}
@keyframes tcol-new {
  50% {
    box-shadow: 0 0 0 3px rgba(238, 90, 114, 0.35), 0 0 14px rgba(238, 90, 114, 0.6);
  }
}
@media (prefers-reduced-motion: reduce) {
  .tcard-col .tcol-new,
  .tnew,
  .tcard-art.new-now .tnew {
    animation: none;
  }
  .tnew-ring {
    display: none;
  }
}

/* ---------- ロビーのルール欄のタブ(基本ルール / アドバンスルール) ----------
   見出しのすぐ下に、幅を2つに分けたタブ。選んでいる方は、金の下線と明るい文字。
   アドバンスルールを使っているときは、その数を金のひし形で示す(基本ルールのタブを見ていても気づけるように)。 */
.rule-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0.35rem;
  border-bottom: 1px solid var(--line);
}
.rule-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  min-height: 2.9rem;
  padding: 0.5em 0.6em;
  border: 0;
  background: none;
  box-shadow: inset 0 -3px 0 transparent;
  color: var(--ink-soft);
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 0.15s, box-shadow 0.15s;
}
.rule-tab:hover {
  color: var(--ink);
}
.rule-tab.on {
  color: var(--ink);
  box-shadow: inset 0 -3px 0 var(--gold);
}
.rule-tab:focus-visible {
  outline-offset: -3px;
}
.rule-tab-n {
  --s: 24px;
}
.rule-unused {
  display: grid;
  justify-items: start;
  gap: 0.75rem;
}
.rule-unused .rule-help {
  margin-top: 0;
}
body[data-screen="room"] .rule-tabs {
  border-bottom-color: rgba(201, 162, 75, 0.3);
}
body[data-screen="room"] .rule-tab.on {
  color: var(--gold-bright);
  box-shadow: inset 0 -3px 0 var(--gold-bright);
}
@media (prefers-reduced-motion: reduce) {
  .rule-tab {
    transition: none;
  }
}
@media (max-width: 380px) {
  .rule-tab {
    font-size: 0.875rem;
    letter-spacing: 0;
  }
}

/* ---------- 大会モード(cup.js) ----------
   3〜4人のトーナメント。目印はトーナメント表: 左に準決勝(3人ならシード)、右に決勝。金の線でつなぐ。
   勝った人は明るい金の名前と金のひし形、負けた人は暗く。決勝の箱は金の二重線。見ている試合は明るい金の縁。
   デッキ構築・バトル中は、いまのラウンドの試合を小さく横に並べる(試合に出ていない人は、押して見る試合を選ぶ)。 */
.rule-badge.rule-cup-badge {
  --rc: var(--gold-bright);
}
.rule-cup.is-on .seg-cup button.on {
  box-shadow: inset 0 -2px 0 var(--gold-bright);
}
.cup-rules {
  display: grid;
  gap: 0.3rem;
  margin-top: 0.7rem;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}
.cup-rules li {
  position: relative;
  padding-left: 1.1em;
}
.cup-rules li::before {
  content: "";
  position: absolute;
  left: 0.15em;
  top: 0.62em;
  width: 0.4em;
  height: 0.4em;
  transform: rotate(45deg);
  background: var(--gold);
}

/* トーナメント表 */
.cupb {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2rem minmax(0, 1fr);
  align-items: center;
  width: 100%;
  max-width: 44rem;
  margin: 0 auto;
  text-align: left;
}
.cupb-left {
  display: grid;
  gap: 1rem;
}
.cupb-right {
  display: grid;
}
.cupb-third {
  grid-column: 3;
  margin-top: 0.9rem;
}
.cupb-m {
  padding: 0.5rem 0.65rem 0.6rem;
  border: 1px solid rgba(201, 162, 75, 0.5);
  background: rgba(6, 12, 34, 0.55);
}
.cupb-m h4 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2em 0.6em;
  margin: 0 0 0.35rem;
  padding: 0;
  font-family: var(--font-display);
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  color: var(--gold-bright);
}
.cupb-m h4 small {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--ink-soft);
}
.cupb-m ol {
  display: grid;
  gap: 0.25rem;
}
.cupb-p {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 28px;
  font-size: 0.875rem;
}
.cupb-p .dia {
  --s: 24px;
  margin-left: auto;
}
.cupb-name {
  min-width: 0;
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cupb-p.me {
  box-shadow: inset 3px 0 0 var(--red-bright);
  padding-left: 0.45rem;
}
.cupb-p.win .cupb-name {
  color: var(--gold-bright);
}
.cupb-p.lose {
  opacity: 0.5;
}
.cupb-tbd .cupb-name {
  font-weight: 500;
  color: var(--ink-soft);
}
.cupb-tbd {
  padding-left: 0.2rem;
}
.cupb-m.cupb-f {
  border: 3px double var(--gold);
}
.cupb-m.cupb-seed {
  border-style: dashed;
}
.cupb-m.is-focus {
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 1px var(--gold-bright), 0 0 20px rgba(240, 212, 138, 0.16);
}
.cupb-m.cupb-t {
  border-color: rgba(201, 162, 75, 0.35);
}
.cupb-m.cupb-t h4 {
  color: var(--ink-soft);
}
/* 準決勝の2つの箱から決勝へ: 「]」の形の線と、決勝へ伸びる横線 */
.cupb-link {
  position: relative;
  align-self: stretch;
}
.cupb-link i {
  position: absolute;
  top: 25%;
  bottom: 25%;
  left: 0;
  right: 50%;
  border: 1px solid var(--gold);
  border-left: 0;
}
.cupb-link::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  right: 0;
  border-top: 1px solid var(--gold);
}
.cupb-champ {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.5rem -0.65rem -0.6rem;
  padding: 0.45rem 0.65rem;
  background: linear-gradient(90deg, rgba(201, 162, 75, 0.28), rgba(201, 162, 75, 0.06));
  border-left: 3px solid var(--gold-bright);
  font-weight: 800;
  color: var(--gold-bright);
}
.cupb-champ span {
  display: grid;
  line-height: 1.25;
}
.cupb-champ small {
  font-size: 0.6875rem;
  color: var(--ink-soft);
}

/* デッキ構築・バトル中の小さな表 */
.cup-strip-wrap {
  width: 100%;
  margin-top: 0.6rem;
}
.cup-strip-note {
  margin-bottom: 0.35rem;
  font-size: 0.75rem;
  color: var(--gold-pale);
}
.cup-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
}
.cup-s {
  display: grid;
  justify-items: center;
  gap: 0.15rem;
  padding: 0.3rem 0.6rem 0.35rem;
  border: 1px solid rgba(201, 162, 75, 0.4);
  background: rgba(6, 12, 34, 0.55);
  color: var(--ink);
  font-size: 0.75rem;
  line-height: 1.3;
}
button.cup-s {
  cursor: pointer;
}
button.cup-s:hover {
  border-color: var(--gold);
}
.cup-s.on {
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 1px var(--gold-bright);
}
.cup-s-name {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--gold-bright);
}
.cup-s-vs {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.cup-s-vs > b {
  max-width: 7em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cup-s-score {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
  margin: 0 0.15rem;
}
.cup-s-score .dia {
  --s: 22px;
}
.cup-s-score i {
  font-style: normal;
  color: var(--ink-soft);
}
.cup-s-st {
  font-size: 0.6875rem;
  color: var(--ink-soft);
}
.cup-s-st.win {
  color: var(--gold-bright);
  font-weight: 700;
}
.horizon .cup-strip-wrap {
  margin-top: 0.35rem;
}
.flag-cup {
  border-color: var(--gold);
  background: rgba(6, 12, 34, 0.6);
  color: var(--gold-bright);
}
.tag-gift {
  background: var(--gold-bright);
  color: var(--night);
}
.build-head .cup-strip-wrap {
  max-width: 44rem;
  margin-left: auto;
  margin-right: auto;
}

/* 準決勝のあと: 渡すカード・受け継ぎの進み具合 */
.cup-body {
  gap: 1.1rem;
}
.cup-gifts {
  width: 100%;
  max-width: 44rem;
  margin: 0 auto;
  text-align: left;
}
.cup-gifts h2 {
  margin-bottom: 0.5rem;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}
.cup-gifts ul {
  display: grid;
  gap: 0.45rem;
}
.cup-gift {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem 0.8rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid rgba(201, 162, 75, 0.35);
  background: rgba(6, 12, 34, 0.45);
  font-size: 0.875rem;
}
.cup-gift.done {
  border-color: var(--gold);
}
.cup-gift-who {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
}
.cup-gift-who i {
  font-style: normal;
  color: var(--gold-bright);
}
.cup-gift-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.cup-gift-card .card {
  --cw: 46px;
}
.cup-gift-card small {
  color: var(--ink-soft);
}
.cup-third-st {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.2rem;
  padding: 0.2rem 0.2rem 0;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}

/* 結果: 順位 */
.cup-ranks {
  display: grid;
  gap: 0.4rem;
  width: 100%;
  max-width: 30rem;
  margin: 0 auto;
}
.cup-rank {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.45rem 0.8rem;
  border: 1px solid rgba(201, 162, 75, 0.35);
  background: rgba(6, 12, 34, 0.45);
  text-align: left;
}
.cup-rank .dia {
  --s: 34px;
}
.cup-rank .pl-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cup-rank.r1 {
  border: 3px double var(--gold);
  background: linear-gradient(90deg, rgba(201, 162, 75, 0.26), rgba(6, 12, 34, 0.45));
}
.cup-rank.r1 .pl-name {
  color: var(--gold-bright);
}
.cup-end {
  gap: 1.4rem;
}

/* 演出: 組み合わせの発表 */
.cup-show {
  display: grid;
  gap: 0.7rem;
  margin: 0.4rem 0 0.8rem;
}
.cup-show li {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid rgba(201, 162, 75, 0.45);
}
.cup-show-name {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--gold-bright);
}
.cup-show-vs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1rem;
}
.cup-show-vs i {
  font-style: normal;
  font-family: var(--font-display);
  color: var(--gold);
}

@media (max-width: 560px) {
  .cupb {
    grid-template-columns: minmax(0, 1fr) 1.1rem minmax(0, 1fr);
  }
  .cupb-m {
    padding: 0.4rem 0.45rem 0.5rem;
  }
  .cupb-p {
    gap: 0.3rem;
    font-size: 0.8125rem;
  }
  .cupb-p .dia {
    --s: 20px;
  }
  .cupb-p .av {
    display: none;
  }
  .cup-s-vs > b {
    max-width: 4.5em;
  }
  .cup-s .av {
    display: none;
  }
}

/* ---------- タッグバトル(tag.js) ----------
   4人で2対2。チームの色はロゴにそろえる: 赤チーム = Venus の赤、青チーム = Versus の青。
   名前の横・席・公開の演出のカードに、チームの札。公開の演出の下に、チームの合計パワー(数字はひし形)。 */
.chip-team-a {
  background: var(--rose);
  border-color: var(--red-bright);
  color: #fff;
}
.chip-team-b {
  background: var(--azure);
  border-color: var(--blue-bright);
  color: #fff;
}
.rule-tag.is-on .seg-tag button.on {
  box-shadow: inset 0 -2px 0 var(--gold-bright);
}
.rule-badge.rule-tag-badge {
  --rc: var(--gold-bright);
}
.rule-badge.rule-tag-badge.team-a {
  --rc: var(--red-bright);
}
.rule-badge.rule-tag-badge.team-b {
  --rc: var(--blue-bright);
}
.flag-tag {
  border-color: var(--gold);
  background: rgba(6, 12, 34, 0.6);
  color: var(--gold-bright);
}

/* ロビーの席: 赤 / 青 */
.seat-team {
  display: inline-flex;
  flex: none;
  border: 1px solid var(--line);
}
.seat-team button {
  min-width: 2.6em;
  padding: 0.2em 0.55em;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
}
.seat-team button + button {
  border-left: 1px solid var(--line);
}
.seat-team button.on[data-v="a"] {
  background: var(--rose);
  color: #fff;
}
.seat-team button.on[data-v="b"] {
  background: var(--azure);
  color: #fff;
}
.seat-team button:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: -2px;
}

/* 公開の演出: 相手のチームと自分のチームの間を少し空ける・合計パワー */
.show-cards.show-tag > li:nth-child(3) {
  margin-left: clamp(0.4rem, 3vw, 2rem);
}
.tag-sums {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem 1rem;
  margin: 0.2rem 0 0.1rem;
  animation: rise 0.4s ease both;
  animation-delay: calc(1.35s + var(--wait, 0s));
}
.tag-sums > i {
  font-style: normal;
  font-family: var(--font-display);
  color: var(--ink-soft);
}
.tag-sum {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.2rem 0.7rem 0.2rem 0.8rem;
  border: 1px solid var(--tc);
  background: color-mix(in srgb, var(--tc) 16%, transparent);
  color: var(--tc);
  font-weight: 800;
}
.tag-sum .dia {
  --s: 40px;
}
.tag-sum-a {
  --tc: var(--red-bright);
}
.tag-sum-b {
  --tc: var(--blue-bright);
}
.tag-sum.win {
  box-shadow: 0 0 0 1px var(--gold-bright), 0 0 18px rgba(240, 212, 138, 0.25);
}
.tag-sum-el {
  padding: 0.05em 0.45em;
  background: var(--gold-bright);
  color: var(--night);
  font-size: 0.6875rem;
  font-weight: 800;
  white-space: nowrap;
}

/* 結果: 2つのチーム */
.tag-avs {
  display: flex;
  justify-content: center;
}
.tag-avs .av + .av {
  margin-left: -14px;
}
.tag-teams {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  width: 100%;
  max-width: 40rem;
}
.tag-team {
  --tc: var(--red-bright);
  display: grid;
  gap: 0.5rem;
  padding: 0.7rem 0.8rem 0.8rem;
  border: 1px solid var(--tc);
  background: rgba(6, 12, 34, 0.45);
  text-align: left;
}
.tag-team-b {
  --tc: var(--blue-bright);
}
.tag-team.win {
  border: 3px double var(--gold);
}
.tag-team h2 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  color: var(--tc);
}
.tag-team-win {
  padding: 0.05em 0.5em;
  background: var(--gold-bright);
  color: var(--night);
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}
.tag-team ul {
  display: grid;
  gap: 0.4rem;
}
.tag-team li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.tag-team .pl-name {
  min-width: 0;
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 560px) {
  .tag-teams {
    grid-template-columns: 1fr;
  }
  .tag-sum .dia {
    --s: 32px;
  }
}

/* ---------- ドラフト「ソロモン」(variants.js) ----------
   2人専用。開けた4枚を左右2つの山に分け、相手が山を選ぶ。ドラフトの青緑の枠の中に、左右の山を並べる。
   分けている途中は、カードを押すと、もう片方の山へ移る(カードの下に「右へ」「左へ」)。 */
.rule-warn {
  color: var(--warn);
  font-weight: 700;
}
.dr-sol-order {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.9rem;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}
.dr-sol-order li b {
  margin-right: 0.45em;
  color: var(--dc);
}
.dr-sol-order li.past {
  opacity: 0.45;
}
.dr-sol-order li.now {
  color: var(--gold-bright);
  font-weight: 700;
}
.dr-piles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}
.dr-pile {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.6rem 0.8rem;
  border: 1px dashed color-mix(in srgb, var(--dc) 60%, var(--line));
  background: rgba(6, 12, 34, 0.35);
}
.dr-pile h3 {
  justify-self: stretch;
  display: flex;
  align-items: baseline;
  gap: 0.5em;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--dc);
}
.dr-pile h3 small {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--ink-soft);
}
.dr-pile-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  min-height: 3rem;
}
.dr-pile-cards li {
  display: grid;
  justify-items: center;
  gap: 0.25rem;
}
.dr-pile-cards .card {
  --cw: clamp(72px, 10vw, 100px);
}
.dr-pile-empty {
  align-self: center;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}
.dr-sol-card {
  padding: 3px;
  border: 0;
  background: none;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.dr-sol-card:hover {
  transform: translateY(-3px);
}
.dr-sol-card:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}
.dr-sol-to {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--dc);
}
.dr-sol-acts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem 0.9rem;
}
.dr-sol-acts small {
  color: var(--warn);
  font-weight: 700;
}
.dr-sol-hist {
  display: grid;
  gap: 0.45rem;
  padding-top: 0.7rem;
  border-top: 1px solid color-mix(in srgb, var(--dc) 30%, var(--line));
  font-size: 0.8125rem;
}
.dr-sol-hist > li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.9rem;
}
.dr-sol-hist b {
  color: var(--dc);
}
.dr-sol-who {
  color: var(--ink-soft);
}
.dr-sol-side {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.dr-sol-side .card {
  --cw: 40px;
}
@media (max-width: 560px) {
  .dr-piles {
    gap: 0.45rem;
  }
  .dr-pile {
    padding: 0.5rem 0.3rem 0.6rem;
  }
  .dr-pile-cards {
    gap: 0.35rem;
  }
  .dr-pile-cards .card {
    --cw: 64px;
  }
}

/* ---------- バトルロワイアル(royale.js) ----------
   地平線のひとことの下に、出す順の帯。番号はひし形、いま出す人は金のひし形と金の縁。出し終えた人は控えめに。
   人と人の間は、時計回りの向きを示す小さな山形。 */
.turn-strip {
  display: grid;
  justify-items: center;
  gap: 0.2rem;
  margin-top: 0.35rem;
  max-width: 100%;
}
.turn-steps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.35rem 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.turn-step {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.12rem 0.7rem 0.12rem 0.12rem;
  border: 1px solid var(--night-line);
  border-radius: 999px;
  background: rgba(6, 12, 34, 0.6);
  color: var(--on-night);
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.3;
}
.turn-step + .turn-step {
  margin-left: 1.1rem;
}
.turn-step + .turn-step::before {
  content: "";
  position: absolute;
  left: -0.85rem;
  top: 50%;
  width: 0.38rem;
  height: 0.38rem;
  border-top: 2px solid var(--on-night-soft);
  border-right: 2px solid var(--on-night-soft);
  transform: translateY(-50%) rotate(45deg);
}
.turn-step .dia {
  --s: 28px;
}
.turn-step .dia:not(.dia-gold):not(.dia-rose):not(.dia-azure)::before {
  background: var(--on-night-soft);
}
/* タッグバトルの「順番に表で出す」: ひし形はチームの色(赤チーム = 赤、青チーム = 青)、縁もうっすらチームの色 */
.turn-step.team-a:not(.is-now) {
  border-color: rgba(238, 90, 114, 0.55);
}
.turn-step.team-b:not(.is-now) {
  border-color: rgba(141, 176, 247, 0.55);
}
.turn-step.is-now {
  border-color: var(--gold);
  color: var(--gold-bright);
  box-shadow: 0 0 16px -5px var(--gold);
}
.turn-step.is-done {
  opacity: 0.55;
}
.turn-name {
  max-width: 9em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.turn-you {
  margin-left: 0.35em;
  color: var(--red-bright);
  font-size: 0.6875rem;
}
.turn-fx {
  color: var(--red-bright);
  font-size: 0.6875rem;
  white-space: nowrap;
}
/* バトルロワイアル: 最後に出す人以外の「+1」(出す順の有利・不利をそろえる決まり) */
.turn-plus {
  padding: 0 0.4em;
  border: 1px solid rgba(240, 212, 138, 0.6);
  color: var(--gold-bright);
  font-family: var(--font-latin, inherit);
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}
.turn-why {
  font-size: 0.75rem;
  color: var(--on-night-soft);
}
.flag-royale {
  border-color: var(--gold);
  background: rgba(6, 12, 34, 0.6);
  color: var(--gold-bright);
}
.rule-royale.is-on .seg-royale button.on {
  box-shadow: inset 0 -2px 0 var(--gold-bright);
}
.rule-badge.rule-royale-badge {
  --rc: var(--gold-bright);
}
@media (max-width: 560px) {
  .turn-step {
    font-size: 0.75rem;
    padding-right: 0.5rem;
  }
  .turn-step + .turn-step {
    margin-left: 0.9rem;
  }
  .turn-step + .turn-step::before {
    left: -0.7rem;
  }
  .turn-name {
    max-width: 6.5em;
  }
}

/* タッグバトル: チームの札は、ふだんは「赤チーム / 青チーム」。スマホ幅の相手の行では短く「赤 / 青」にし、「左隣」「味方」の札は出さない
   (味方は、自分と同じ色の札で分かる)
   (名前・チーム・味方・左隣の札が並ぶと、場のカードに重なるため。相手の行を詰める幅と同じ 760px から) */
.chip-team .ct-short {
  display: none;
}
@media (max-width: 760px) {
  .table:not([data-n="1"]) .opp .chip-team .ct-full {
    display: none;
  }
  .table:not([data-n="1"]) .opp .chip-team .ct-short {
    display: inline;
  }
  .table:not([data-n="1"]) .opp .pl-line:has(.chip-team) .chip-left,
  .table:not([data-n="1"]) .opp .pl-line .chip-ally {
    display: none;
  }
  .table:not([data-n="1"]) .opp .pl-line:has(.chip-team) .pl-name {
    min-width: 2.5em;
    flex: 0 1 auto;
  }
}

/* ---------- 2ピック(twopick.js) ----------
   デッキ構築のパックの欄の代わりに「2枚から1枚」の欄。上に5つのひし形(コストの枠 = 選ぶ順。選んだ枠は塗り、いまの枠は金、まだの枠は線)、
   その下に2枚の札(成り上がり戦の「もらう」札と同じ形)。札の色は金。 */
.tp-pick .tp-steps {
  display: flex;
  justify-content: center;
  gap: 0.15rem;
  margin: 0.2rem 0 0.9rem;
  padding: 0;
  list-style: none;
}
.tp-pick .tp-steps li {
  position: relative;
  display: grid;
  place-items: center;
}
.tp-pick .tp-steps li + li::before {
  content: "";
  position: absolute;
  left: -0.55rem;
  width: 0.7rem;
  height: 1px;
  background: var(--line);
}
.tp-pick .tp-steps .dia {
  --s: 34px;
}
.tp-pick .tp-steps li[aria-current] .dia {
  filter: drop-shadow(0 0 8px rgba(240, 212, 138, 0.55));
}
.tp-offer li {
  width: min(100%, 240px);
}
.tp-offer .card {
  --cw: 150px;
}
.rule-badge.rule-twopick-badge {
  --rc: var(--gold-bright);
}
.rule-twopick.is-on .seg-twopick button.on {
  box-shadow: inset 0 -2px 0 var(--gold-bright);
}
@media (max-width: 560px) {
  .tp-offer {
    flex-wrap: nowrap;
    gap: 0.6rem;
  }
  .tp-offer li {
    width: 50%;
    padding: 0.6rem 0.45rem 0.7rem;
  }
  .tp-offer .card {
    --cw: 118px;
  }
}

/* =====================================================================
   はじめての道・人数と時間から選ぶ・今週のおすすめ(トップ)
   見出しは「1ゲームの流れ」と同じ、金の線が右へ伸びる形。
   はじめての道の段: 終えた = 金、次 = 赤、まだ = 線。
   ===================================================================== */
.guide {
  display: grid;
  gap: clamp(2rem, 5vw, 3rem);
}
.path h2,
.chooser h2,
.weekly h2 {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 1rem;
}
.path h2::after,
.chooser h2::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--gold);
  box-shadow: 0 3px 0 rgba(201, 162, 75, 0.4);
}
.path-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
}
.path-head h2 {
  flex: 1 1 auto;
}
.path-lead {
  max-width: 42em;
  margin: -0.4rem 0 1.1rem;
  color: var(--ink-soft);
}
.path-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}
.path-steps > li {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 0.5rem 0.8rem;
  padding: 0.9rem 1rem 1rem 0.6rem;
  border: 1px solid var(--line);
}
.path-steps > li > .btn,
.path-steps > li > .path-state {
  grid-column: 2;
  justify-self: start;
}
.path-steps .dia {
  --s: 46px;
}
.path-steps .dia::before {
  background: none;
  box-shadow: inset 0 0 0 1.5px var(--ink-soft);
}
.path-steps .dia > b {
  color: var(--ink-soft);
}
.path-steps .is-done .dia::before {
  background: var(--gold);
  box-shadow: none;
}
.path-steps .is-done .dia > b {
  color: var(--night);
}
.path-steps .is-next {
  border-color: var(--rose-deep);
  box-shadow: inset 0 -3px 0 var(--rose);
}
.path-steps .is-next .dia::before {
  background: var(--rose);
  box-shadow: none;
}
.path-steps .is-next .dia > b {
  color: #fff;
}
.path-body h3 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
}
.path-body p {
  margin-top: 0.2rem;
  font-size: 0.875rem;
  color: var(--ink-soft);
}
.path-state {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--gold-bright);
}

.chooser-q {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1.1rem;
}
.chooser-field {
  display: grid;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink-soft);
}
.chooser-n button {
  display: inline-grid;
  place-items: center;
  padding: 0.25em 0.75em;
}
/* トップの下の段の中身は、画面の幅より広げない(長い英語の行で横にはみ出さないように) */
.home-below > *,
.home-part > * {
  min-width: 0;
}
.chooser-n .dia {
  --s: 30px;
}
.chooser-n .dia::before {
  background: none;
  box-shadow: inset 0 0 0 1.5px var(--ink-soft);
}
.chooser-n .dia > b {
  color: var(--ink-soft);
}
.chooser-n button.on .dia::before {
  background: var(--gold);
  box-shadow: none;
}
.chooser-n button.on .dia > b {
  color: var(--night);
}
.chooser-time button {
  display: grid;
  justify-items: start;
  line-height: 1.25;
  padding: 0.35em 1.1em;
}
.chooser-time small {
  font-size: 0.6875rem;
  font-weight: 500;
}
.picks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.9rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
/* 人数と時間から選ぶ の1件(カードの .card.pick とは別。.picks の中だけ) */
.picks > .pick {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 0.45rem;
  padding: 0.85rem 0.95rem 0.95rem;
  border: 1px solid var(--line);
  background: rgba(15, 27, 69, 0.55);
}
.pick-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.7rem;
}
.pick h3 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1.35;
}
.pick-time {
  display: inline-flex;
  align-items: center;
  flex: none;
  font-size: 0.75rem;
  color: var(--ink-soft);
}
.pick-time .dia {
  --s: 30px;
}
.pick-time .dia::before {
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--gold);
}
.pick-time .dia > b {
  color: var(--gold-bright);
}
.pick p {
  font-size: 0.875rem;
  color: var(--ink-soft);
}
.pick .btn {
  margin-top: 0.2rem;
}
.chooser-note {
  margin-top: 0.7rem;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}

/* 今週のおすすめ: 左にルール(金の二重線の額)、右にランキング */
.weekly {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 1.25rem;
}
.wk-rule {
  position: relative;
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 0.55rem;
  padding: 1.2rem 1.4rem 1.4rem;
  border: 1px solid var(--gold);
  box-shadow: inset 0 0 0 4px var(--pearl), inset 0 0 0 5px rgba(201, 162, 75, 0.55);
  background: radial-gradient(ellipse 80% 90% at 0% 0%, rgba(201, 162, 75, 0.12), transparent 70%), var(--pearl);
}
.weekly h2 {
  flex-wrap: wrap;
  gap: 0.2rem 0.9rem;
  margin: 0;
  font-size: 1.15rem;
  color: var(--gold-bright);
}
.wk-term {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ink-soft);
}
.wk-name-big {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.45rem, 3.4vw, 2rem);
  line-height: 1.25;
  color: var(--ink);
}
.wk-text {
  max-width: 34em;
  color: var(--ink-soft);
}
.wk-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.3rem;
}
.wk-board {
  display: grid;
  align-content: start;
  gap: 0.6rem;
  padding: 1rem 1.2rem 1.1rem;
  border: 1px solid var(--line);
}
.wk-board h3,
.wk-last h3 {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
}
.wk-board h3 small,
.wk-last h3 small {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-soft);
}
.wk-list {
  display: grid;
  gap: 0.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.wk-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.1rem 0.3rem 0.1rem 0;
  border-bottom: 1px solid rgba(58, 72, 140, 0.55);
}
.wk-list .dia {
  --s: 34px;
}
.wk-list .dia:not(.dia-gold)::before {
  background: none;
  box-shadow: inset 0 0 0 1.5px var(--ink-soft);
}
.wk-list .dia:not(.dia-gold) > b {
  color: var(--ink);
}
.wk-name {
  overflow: hidden;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.wk-name small {
  margin-left: 0.5em;
  padding: 0 0.4em;
  background: var(--rose);
  color: #fff;
  font-size: 0.6875rem;
}
.wk-wins {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--gold-bright);
}
.wk-wins small {
  margin-left: 0.4em;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-soft);
}
.wk-list li.is-me {
  background: rgba(192, 22, 44, 0.16);
}
.wk-me,
.wk-empty,
.wk-how {
  font-size: 0.875rem;
  color: var(--ink-soft);
}
.wk-board .btn-link {
  justify-self: start;
  color: var(--gold-bright);
}
.wk-modal {
  display: grid;
  gap: 0.9rem;
}
.wk-modal-rule {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.9rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
}
.wk-list-me {
  margin-top: -0.4rem;
}
.wk-last {
  display: grid;
  gap: 0.5rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(201, 162, 75, 0.35);
}
/* ロビーのルール欄の上: 今週のおすすめ */
.wk-tag {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.8rem;
  margin: 0 0 0.8rem;
  padding: 0.45rem 0.7rem;
  border: 1px dashed rgba(201, 162, 75, 0.6);
  font-size: 0.8125rem;
  color: var(--ink-soft);
}
.wk-tag.is-on {
  border-style: solid;
  border-color: var(--gold);
  background: rgba(201, 162, 75, 0.12);
}
.wk-tag b {
  color: var(--gold-bright);
}
.rule-badge.rule-weekly {
  --rc: var(--gold-bright);
  margin-left: 0.4rem;
}
@media (max-width: 760px) {
  .path-steps,
  .weekly {
    grid-template-columns: minmax(0, 1fr);
  }
  .path-steps {
    gap: 0.6rem;
  }
}

/* =====================================================================
   みんなの対戦データ
   ===================================================================== */
.stats {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.1rem;
}
.stats-scope {
  flex-wrap: wrap;
  justify-self: start;
  max-width: 100%;
}
.stats-lead,
.stats-note,
.stats-none {
  font-size: 0.875rem;
  color: var(--ink-soft);
}
.stats-scope button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding-right: 0.7em;
}
.stats-scope .dia {
  --s: 34px;
}
.stats-scope .dia::before {
  background: none;
  box-shadow: inset 0 0 0 1.5px var(--ink-soft);
}
.stats-scope .dia > b {
  color: var(--ink);
  font-size: 11px;
}
.stats-scope button.on .dia::before {
  background: var(--gold);
  box-shadow: none;
}
.stats-scope button.on .dia > b {
  color: var(--night);
}
.stats-sec {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.6rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(201, 162, 75, 0.35);
}
.stats-sec h3 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
}
.stats-scroll {
  overflow-x: auto;
}
.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.stats-table th,
.stats-table td {
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid rgba(58, 72, 140, 0.6);
  text-align: right;
  white-space: nowrap;
}
.stats-table th[scope="row"],
.stats-table thead th:first-child,
.stats-cards thead th:nth-child(2) {
  text-align: left;
}
.stats-table thead th {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink-soft);
}
.stats-table tbody th {
  font-weight: 700;
}
.stats-cards td:first-child {
  width: 1px;
  padding-right: 0;
}
.stats-cards .dia {
  --s: 30px;
}
.stats-cards .dia::before {
  background: none;
  box-shadow: inset 0 0 0 1px var(--ink-soft);
}
.stats-cards .dia > b {
  color: var(--ink);
  font-size: 11px;
}
.stats-card {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-weight: 700;
  text-align: left;
}
.stats-card .elmark {
  font-size: 0.75rem;
}
.stats-card small {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--ink-soft);
}
.stats-card:hover {
  color: var(--gold-bright);
}
.stats-rate {
  min-width: 9.5rem;
}
.stats-rate .rec-meter {
  display: inline-block;
  width: 5.5rem;
  margin-right: 0.45rem;
  vertical-align: middle;
}
.stats-table tr.is-few {
  opacity: 0.5;
}
.stats-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
}
.stats-bucket {
  display: flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}
.stats-bucket select {
  min-width: 0;
  flex: 1 1 auto;
}
.stats-bucket select,
.rl-field select,
.rl-mini select {
  min-height: 36px;
  max-width: 100%;
  padding: 0.25em 0.5em;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}
.seg-s button {
  min-height: 34px;
  padding: 0.3em 0.85em;
  font-size: 0.8125rem;
}
.stats-turnlist {
  display: grid;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.stats-turnlist li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 1rem;
}
.stats-turn-name {
  min-width: 12em;
  font-weight: 700;
}
.stats-turn-name small {
  margin-left: 0.5em;
  font-weight: 500;
  font-size: 0.75rem;
  color: var(--ink-soft);
}
.stats-turns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.8rem;
}
.stats-turn {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--gold-bright);
}
.stats-turn .dia {
  --s: 30px;
}
.stats-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(201, 162, 75, 0.35);
}

/* =====================================================================
   カードの裁定
   席ごとに、1つ前のカード(小)→ このバトルのカード → 選ぶもの。結果は、パワーのひし形(属性の色)と WIN / LOSE / DRAW。
   ===================================================================== */
.ruling {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}
.rl-lead {
  font-size: 0.875rem;
  color: var(--ink-soft);
}
.rl-examples h3,
.rl-result h4,
.rl-prevres h4 {
  margin-bottom: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--ink-soft);
}
.rl-examples ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.rl-ex {
  padding: 0.3em 0.8em;
  border: 1px solid rgba(201, 162, 75, 0.55);
  border-radius: 999px;
  background: none;
  color: var(--ink);
  font-size: 0.8125rem;
}
.rl-ex:hover {
  border-color: var(--gold-bright);
  color: var(--gold-bright);
}
.rl-set {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.7rem 1.4rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(201, 162, 75, 0.35);
}
.rl-field {
  display: grid;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink-soft);
}
.rl-set .seg button {
  display: inline-flex;
  align-items: center;
  padding: 0.15em 0.5em;
}
.rl-set .dia {
  --s: 28px;
}
.rl-set .dia::before {
  background: none;
  box-shadow: inset 0 0 0 1.5px var(--ink-soft);
}
.rl-set .dia > b {
  color: var(--ink-soft);
}
.rl-set button.on .dia::before {
  background: var(--gold);
  box-shadow: none;
}
.rl-set button.on .dia > b {
  color: var(--night);
}
.rl-battles button {
  padding: 0.15em 0.35em;
}
.rl-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.6rem;
}
.rl-toggles .toggle-text small {
  display: block;
}
.rl-seats {
  display: grid;
  grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr));
  gap: 0.8rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.rl-seats[data-n="3"] {
  --n: 3;
}
.rl-seats[data-n="4"] {
  --n: 4;
}
.rl-seat {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 0.45rem;
  padding: 0.7rem;
  border: 1px solid var(--line);
}
.rl-seat h3 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
}
.rl-slot {
  display: grid;
  place-items: center;
  width: 120px;
  aspect-ratio: 5 / 7;
  padding: 0;
  border: 1px dashed rgba(201, 162, 75, 0.7);
  background: rgba(6, 12, 34, 0.5);
  color: var(--gold-bright);
  font-size: 0.8125rem;
  font-weight: 700;
}
.rl-slot.is-set {
  border: 0;
  background: none;
}
.rl-slot .card {
  width: 100%;
  --cw: 120px;
}
.rl-slot:hover {
  filter: brightness(1.1);
}
.rl-slot-prev {
  width: 64px;
}
.rl-slot-prev .card {
  --cw: 64px;
}
.rl-slot-prev .rl-slot-empty {
  font-size: 0.625rem;
  text-align: center;
}
.rl-prevline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--ink-soft);
}
.rl-info {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
}
.rl-info .elmark {
  font-size: 0.75rem;
}
.rl-info .dia {
  --s: 28px;
}
.rl-text {
  font-size: 0.75rem;
  line-height: 1.55;
  color: var(--ink-soft);
}
.rl-opts {
  display: grid;
  gap: 0.4rem;
  width: 100%;
}
.rl-opts .toggle-inline {
  margin-top: 0;
}
.rl-opts .toggle-text small {
  display: block;
  font-size: 0.6875rem;
}
.rl-mini {
  display: grid;
  gap: 0.15rem;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--ink-soft);
}
.rl-more {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.rl-hint {
  font-size: 0.6875rem;
  color: var(--ink-soft);
}
.rl-picker {
  display: grid;
  gap: 0.5rem;
}
.rl-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.rl-picker-head h3 {
  font-family: var(--font-display);
  font-weight: 800;
}
.rl-grid {
  max-height: min(60vh, 560px);
  overflow-y: auto;
  row-gap: 1.1rem;
  padding-bottom: 0.6rem;
}
.rl-choice {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
}
/* 両面カードの裏面(表面のすぐ後ろに並ぶ): 下に金の「裏面」の札 */
.rl-back-badge {
  position: absolute;
  left: 50%;
  bottom: -0.5rem;
  z-index: 2;
  transform: translateX(-50%);
  padding: 0.1em 0.7em;
  border: 1.5px solid var(--night);
  background: var(--gold-bright);
  color: var(--night);
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1.4;
  white-space: nowrap;
}
/* 酒呑童子がコピーするカードの枠 */
.rl-copyline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold-bright);
}
.rl-copyline > span small {
  display: block;
  font-size: 0.6875rem;
  font-weight: 400;
  color: var(--ink-soft);
}
/* 右上の「カード裁定を終了する」(カードを選んでいる間は ×)。
   回り込み(float)にすると、隣の .ruling(grid)が丸ごと細くなるので、右寄せの1行にして、下の余白を詰めて見出しと並べる */
.modal-ruling > .modal-x {
  float: none;
  display: block;
  margin: -0.5rem -0.5rem calc(-38px + 0.5rem) auto;
}
.modal-ruling > .modal-x.modal-x-text {
  width: auto;
  padding: 0 0.85rem;
  font-size: 0.8125rem;
  font-weight: 700;
  white-space: nowrap;
}
.modal-ruling .modal-title {
  padding-right: calc(var(--rl-x, 38px) + 0.5rem);
}
.rl-choice:hover .card,
.rl-choice:focus-visible .card {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}
.rl-result {
  display: grid;
  gap: 0.6rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(201, 162, 75, 0.45);
}
.rl-verdict {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
}
.rl-verdict .dia {
  --s: 44px;
}
.rl-sides {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.8rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.rl-side {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 0.3rem;
  text-align: center;
}
.rl-side .card {
  width: 104px;
  --cw: 104px;
}
.rl-side.out-lose .card {
  filter: saturate(0.6) brightness(0.75);
}
.rl-pw {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}
.rl-orig {
  text-decoration: none;
  opacity: 0.55;
}
.rl-orig .dia {
  --s: 30px;
}
.rl-pw .rl-pwdia {
  --s: 42px;
}
.rl-pwdia::before {
  background: var(--elc, var(--el-none));
}
.rl-pwdia > b {
  color: #fff;
}
.rl-pwdia[data-el="none"] {
  --elc: var(--el-none);
}
.rl-pwdia[data-el="fire"] {
  --elc: var(--el-fire);
}
.rl-pwdia[data-el="thunder"] {
  --elc: var(--el-thunder);
}
.rl-pwdia[data-el="water"] {
  --elc: var(--el-water);
}
.rl-pwdia[data-el="light"] {
  --elc: var(--el-light);
}
.rl-pwdia[data-el="dark"] {
  --elc: var(--el-dark);
}
.rl-pwdia[data-el="god"] {
  --elc: var(--el-god);
}
.rl-pwdia[data-el="god"] > b {
  color: #2b1d05;
}
.rl-out {
  margin-left: 0.25rem;
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.04em;
}
.out-win .rl-out {
  color: var(--red-bright);
}
.out-lose .rl-out {
  color: var(--blue-bright);
}
.out-draw .rl-out {
  color: #5fd68e;
}
.rl-name {
  font-weight: 700;
  font-size: 0.875rem;
}
.rl-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem;
}
.rl-tags .chip {
  font-size: 0.6875rem;
}
.rl-sides-s .rl-pwdia {
  --s: 32px;
}
.rl-sides-s .rl-out {
  font-size: 1rem;
}
.rl-prevres {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line);
}
.rl-prevres h4 {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.8rem;
}
.rl-prevres h4 span {
  color: var(--ink);
}
.rl-notes {
  display: grid;
  gap: 0.25rem;
  margin: 0;
  padding-left: 1.6rem;
  list-style: decimal;
  font-size: 0.875rem;
}
.rl-notes li::marker {
  color: var(--gold-bright);
  font-weight: 700;
}
.rl-infos,
.rl-next ul {
  display: grid;
  gap: 0.2rem;
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.8125rem;
  color: var(--gold-bright);
}
.rl-next ul {
  color: var(--ink);
}
.rl-none,
.rl-wait {
  font-size: 0.875rem;
  color: var(--ink-soft);
}
.rl-err {
  color: var(--warn);
}
.zoom-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
@media (max-width: 760px) {
  .rl-seats,
  .rl-seats[data-n="3"],
  .rl-seats[data-n="4"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .rl-slot {
    width: 100px;
  }
  .rl-slot .card {
    --cw: 100px;
  }
  .rl-slot-prev {
    width: 64px;
  }
  .rl-slot-prev .card {
    --cw: 64px;
  }
  .rl-side .card {
    width: 84px;
    --cw: 84px;
  }
  .rl-sides {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- 入れ替え勝ち抜きの塔(factory.js) ----------
   目印は、1周5階のひし形を横一列に並べた「勝ち抜きの列」と、その左の大きな連勝の数。
   勝った階 = 金、いま(次)の階 = 赤、負けた階 = 青、まだ = 線だけ。番人の階は、ひし形の下に「番」の札。
   周の見出しの右に、その周で使えるレアリティの札(レアリティ解禁戦と同じ .rchip。解禁されたばかりのものは光る)。
   相手のヒント(切り札1枚と、いちばん多い属性)は、青い細い線の枠。番人のときは赤の枠。 */
.rule-badge.rule-factory {
  --rc: var(--blue-bright);
}
.fa-strip {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}
.fa-streak {
  display: grid;
  justify-items: center;
  line-height: 1;
}
.fa-streak b {
  font-family: var(--font-num);
  font-weight: var(--num-weight);
  font-size: clamp(2.2rem, 7vw, 3.05rem);
  color: var(--gold-bright);
}
.fa-streak span {
  margin-top: 0.2rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--on-night-soft);
}
.fa-set {
  display: grid;
  gap: 0.25rem;
}
.fa-set small {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem 0.5rem;
  font-size: 0.75rem;
  color: var(--on-night-soft);
}
.fa-rars {
  display: inline-flex;
  gap: 0.2rem;
}
.fa-rars .rchip {
  font-size: 0.625rem;
}
.rchip.is-new {
  box-shadow: 0 0 0 2px rgba(240, 210, 130, 0.35), 0 0 10px rgba(240, 210, 130, 0.55);
}
/* のこりのコンティニュー(周の見出しの右。使ったら薄く) */
.fa-cont {
  padding: 0 0.45em;
  border: 1px solid var(--red-bright);
  background: rgba(192, 22, 44, 0.3);
  color: #ffe1e6;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1.6;
  white-space: nowrap;
}
.fa-cont.used {
  border-color: var(--line);
  background: none;
  color: var(--ink-soft);
  opacity: 0.7;
}
/* 選ぶカードのうち、その周で解禁されたレアリティのもの */
.fa-new {
  display: inline-block;
  padding: 0 0.45em;
  font-size: 0.6875rem;
  line-height: 1.55;
  background: var(--gold-bright);
  color: var(--night);
}
.fa-set ol {
  display: flex;
  align-items: flex-start;
  gap: 0.2rem;
}
.fa-set li {
  position: relative;
  display: grid;
  justify-items: center;
}
/* 戦と戦をつなぐ線 */
.fa-set li + li::before {
  content: "";
  position: absolute;
  top: calc(var(--fs, 34px) / 2 - 1px);
  right: calc(100% - 0.2rem);
  width: 0.4rem;
  height: 2px;
  background: rgba(201, 162, 75, 0.5);
}
.fa-set .dia {
  --s: var(--fs, 34px);
}
.fa-set .dia > b {
  font-size: calc(var(--s) * 0.36);
}
.fa-boss-mark {
  margin-top: -0.1rem;
  padding: 0 0.3em;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.5;
  background: var(--rose);
  color: #fff;
}
.fa-strip.compact {
  justify-content: center;
  margin: 0.6rem auto 0;
  --fs: 28px;
}
.fa-strip.compact .fa-streak b {
  font-size: 1.75rem;
}
.tw-head .fa-strip {
  flex: 0 1 auto;
}

/* 相手とヒント */
.fa-foe {
  padding: 0.8rem 0.9rem 0.9rem;
  border: 1px solid var(--blue-bright);
  background: rgba(6, 12, 34, 0.45);
  text-align: left;
}
.fa-foe.is-boss {
  border-color: var(--red-bright);
  box-shadow: inset 0 0 0 1px rgba(238, 90, 114, 0.25);
}
.fa-foe h3 {
  display: flex;
  align-items: baseline;
  gap: 0.6em;
  margin-bottom: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.0625rem;
}
.fa-foe h3 small {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--blue-bright);
}
.fa-foe.is-boss h3 small {
  color: var(--red-bright);
}
.fa-foe-in {
  display: grid;
  gap: 0.8rem;
}
.fa-foe-who {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.6rem;
}
.fa-foe-who b {
  font-family: var(--font-display);
  font-size: 1.0625rem;
}
.fa-foe-who > span {
  font-size: 0.8125rem;
  color: var(--on-night-soft);
}
.fa-foe-who .fa-boss-tag {
  padding: 0.05em 0.5em;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--rose);
  color: #fff;
}
.fa-foe-hint {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
}
.fa-trump {
  display: grid;
  justify-items: center;
  gap: 0.2rem;
  flex: none;
}
.fa-trump .card {
  --cw: 92px;
}
.fa-trump small {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--gold-bright);
}
.fa-foe-notes {
  display: grid;
  gap: 0.35rem;
  font-size: 0.875rem;
}
.fa-foe-trump b {
  font-family: var(--font-display);
}
.fa-foe-el {
  display: flex;
  align-items: center;
  gap: 0.4em;
}
.fa-el {
  display: inline-grid;
  place-items: center;
  width: 1.5em;
  height: 1.5em;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 0.875rem;
  line-height: 1;
  background: var(--elc, var(--el-none));
  color: #fff;
}
.fa-foe-note {
  font-size: 0.75rem;
  color: var(--on-night-soft);
}
/* デッキ構築の見出し: 1行に小さく */
.fa-foe.compact {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.3rem 0.7rem;
  width: fit-content;
  max-width: 100%;
  margin: 0.5rem auto 0;
  padding: 0.3rem 0.7rem;
  font-size: 0.8125rem;
}
.fa-foe-line b {
  margin-right: 0.4em;
  font-size: 0.75rem;
  color: var(--gold-bright);
}

/* 借りる・交換する画面: 左にカード、右に相手のヒント */
.fa-body {
  grid-template-columns: minmax(0, 1fr) minmax(0, 300px);
  align-items: start;
}
.fa-body > .build-watch {
  grid-column: 1 / -1;
}
.fa-rent {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.5rem;
}
.fa-row {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 0.4rem;
  padding: 0.6rem 0.3rem 0.7rem;
  border: 1px solid var(--line);
  background: rgba(6, 12, 34, 0.35);
}
.fa-row.done {
  border-color: rgba(201, 162, 75, 0.7);
}
.fa-row h3 {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  color: var(--ink-soft);
}
.fa-row .dia {
  --s: 26px;
}
.fa-row.done h3 {
  color: var(--gold-bright);
}
.fa-pair {
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.fa-trade {
  display: grid;
  gap: 0.9rem;
}
.fa-quit.is-armed {
  border-color: var(--red-bright);
  color: var(--red-bright);
}

/* 1戦の初めの演出 */
.fa-show-retry {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.3rem;
  letter-spacing: 0.06em;
  color: var(--gold-bright);
}
.fa-show-boss {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.5rem;
  color: var(--red-bright);
}
.fa-show-unlock {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.2rem;
  color: var(--gold-bright);
}
.fa-show-unlock .rchip {
  font-size: 0.9rem;
}
.fa-show-hint {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin: 0.4rem 0;
}
.fa-show-hint .card {
  --cw: 84px;
}

/* 結果 */
.fa-record {
  display: inline-block;
  margin-left: 0.6em;
  padding: 0 0.5em;
  font-size: 0.8125rem;
  font-weight: 700;
  background: var(--gold-bright);
  color: var(--night);
}
.tw-end-body .fa-strip {
  justify-content: center;
}
.fa-swaps li span {
  font-size: 0.75rem;
  color: var(--on-night-soft);
}

@media (max-width: 860px) {
  .fa-body {
    grid-template-columns: minmax(0, 1fr);
  }
  /* スマホでは、相手のヒントをカードの上に */
  .fa-side {
    order: -1;
  }
  .fa-foe-in {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
  }
  .fa-foe-hint {
    gap: 0.6rem;
  }
  .fa-trump .card {
    --cw: 72px;
  }
}
@media (max-width: 720px) {
  .fa-rent {
    grid-template-columns: minmax(0, 1fr);
  }
  .fa-row {
    grid-template-columns: 4.6rem minmax(0, 1fr);
    justify-items: start;
    align-items: center;
    padding: 0.5rem 0.6rem;
  }
  .fa-row h3 {
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.75rem;
  }
  .fa-pair {
    flex-direction: row;
  }
}
@media (max-width: 560px) {
  .fa-strip {
    gap: 0.6rem;
    --fs: 30px;
  }
  /* スマホのヒント: 相手の名前の行と、切り札・属性の行を詰める(説明の文は出さない) */
  .fa-foe {
    padding: 0.55rem 0.7rem 0.65rem;
  }
  .fa-foe h3 {
    margin-bottom: 0.35rem;
    font-size: 1rem;
  }
  .fa-foe-in {
    gap: 0.45rem;
  }
  .fa-foe-who .av {
    --av: 36px;
  }
  .fa-foe-who b {
    font-size: 0.9375rem;
  }
  .fa-trump .card {
    --cw: 56px;
  }
  .fa-foe-notes {
    align-self: center;
    font-size: 0.8125rem;
  }
  .fa-foe-note {
    display: none;
  }
  .fa-strip.compact {
    --fs: 24px;
  }
  .fa-foe-in {
    grid-template-columns: minmax(0, 1fr);
  }
  .fa-row .sc-card-btn .card {
    --cw: 76px;
  }
}
@media (max-width: 380px) {
  .fa-strip {
    --fs: 26px;
  }
  .fa-set li + li::before {
    display: none;
  }
}
/* 入れ替え勝ち抜きの塔: 勝ったあとの「中断する」「ここでやめる」は、小さく並べて1つのまとまりに */
.fa-exit {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* ---------- 画像からアイコンを作る(アイコンを選ぶ画面。iconmaker.js) ---------- */
.iconpick-own-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
}
.iconpick-own-row .iconpick-item {
  width: auto;
  min-width: 104px;
}
.iconpick-file {
  position: relative;
  cursor: pointer;
}
.iconpick-file input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.iconpick-file:focus-within {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}
.iconpick-note {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}
.iconpick-hide {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
}
.iconpick-hide input {
  margin-top: 0.3em;
  accent-color: var(--gold);
}
/* 切り抜き: 左に正方形の画像と丸い線、右に説明とつまみ・ボタン */
.im {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1rem 1.4rem;
  margin-top: 0.8rem;
  padding: 0.9rem;
  border: 1px solid var(--gold);
  background: rgba(6, 12, 34, 0.5);
}
.im-stage {
  position: relative;
  flex: none;
  width: min(240px, 100%);
  aspect-ratio: 1;
  max-width: 100%;
  touch-action: none;
}
.im-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  background: var(--paper);
}
.im-canvas:active {
  cursor: grabbing;
}
/* 丸い線の外は少し暗く */
.im-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow:
    0 0 0 2px var(--gold-bright),
    0 0 0 999px rgba(6, 12, 34, 0.55);
  pointer-events: none;
  clip-path: inset(0);
}
.im-side {
  flex: 1 1 14rem;
  display: grid;
  gap: 0.8rem;
  min-width: 0;
}
.im-help {
  font-size: 0.875rem;
  color: var(--ink-soft);
}
.im-zoom {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.7rem;
  font-size: 0.875rem;
}
.im-zoom input {
  width: 100%;
  accent-color: var(--gold);
}
.im-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ---------- サウンド・演出の設定: 演出の速さ(pace.js) ---------- */
.snd-pace {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--line);
}
.snd-pace h3 {
  margin-bottom: 0.4rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
}
.snd-pace .seg {
  display: flex;
  width: 100%;
  border-color: var(--gold);
  border-radius: 0;
}
.snd-pace .seg button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 36px;
  padding: 0.35em 0.3em;
  font-size: 0.875rem;
  cursor: pointer;
}
.snd-pace .seg button + button {
  border-left: 1px solid rgba(201, 162, 75, 0.45);
}
.snd-pace .seg button.on {
  background: var(--gold);
  color: var(--night);
  box-shadow: none;
}

/* ---------- バトルの公開: 押してめくる・1段ずつ(show.js の stepsMode。演出の速さが「はやい」以外) ----------
   ほかの人が伏せて出したカードは伏せたまま(.st-park)。押すと表のカードの部分(.flipper.st-go)に入れ替わり、そこからめくれる。
   勝敗の部分(V 字の旗・WIN / LOSE・結果の文・メモ・チームの合計)は、--wait を -1.5s にして、足した瞬間に動くようにしている。
   パワーの数字(.st-pow)・能力の光(.sc-fx)・酒呑童子のコピー(--st-cp)は、show.js の runSteps が順に足す。 */
.show-steps .flipper.st-go {
  --tf: calc(0.7s + var(--i, 0) * 0.16s);
}
.show-steps .sc-cp {
  --cp: var(--st-cp, 9999s);
}
.show-steps .sc-fx .flipper {
  --fx-t: 0s;
}
.show-steps .st-pow {
  visibility: hidden;
  animation: none;
}
.show-steps .st-pow.on {
  visibility: visible;
}
.st-pow .from,
.st-pow .arrow {
  display: none;
}
.st-pow.changed .from,
.st-pow.changed .arrow {
  display: inline;
}
.show-steps .st-later:not(.on) {
  display: none;
}
.show-steps .st-later.on {
  animation: rise 0.3s ease both;
}
/* 伏せたまま届いたカード: 金の縁がゆっくり光り、「押してめくる」。下の線が減りきると自動でめくれる */
.st-park {
  position: relative;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.st-park::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 2px solid var(--gold-bright);
  border-radius: 6px;
  box-shadow: 0 0 18px rgba(240, 212, 138, 0.55);
  pointer-events: none;
  animation: st-beckon 1.4s ease-in-out infinite;
}
@keyframes st-beckon {
  50% {
    opacity: 0.35;
  }
}
.st-park:hover .st-back,
.st-park:focus-visible .st-back {
  transform: translateY(-4px);
}
.st-back {
  transition: transform 0.2s ease;
}
.st-hint {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  padding: 0.15em 0.7em;
  border: 1px solid var(--gold);
  background: rgba(6, 12, 34, 0.88);
  color: var(--gold-bright);
  font-size: clamp(0.6875rem, 2.6vw, 0.8125rem);
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
}
.st-bar {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -10px;
  height: 3px;
  background: rgba(58, 72, 140, 0.6);
  pointer-events: none;
}
.st-bar > i {
  position: absolute;
  inset: 0;
  background: var(--gold);
  transform-origin: left center;
  animation: st-bar 8s linear both;
}
@keyframes st-bar {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}
/* いまの段のひとこと(元々のパワー・能力のメモ・比べ方) */
.st-cap {
  min-height: 3.2em;
  max-width: 36em;
  margin: 0;
  color: var(--gold-bright);
  font-weight: 700;
  font-size: clamp(0.9375rem, 2.8vw, 1.0625rem);
  line-height: 1.6;
  text-wrap: balance;
}
.st-cap.on {
  animation: rise 0.25s ease both;
}
/* 同じパワーのとき、属性の札 */
.st-el {
  display: inline-block;
  margin-top: 0.15rem;
  padding: 0 0.6em;
  background: var(--elc, var(--line));
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.7;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  animation: rise 0.25s ease both;
}
.sc[data-el="god"] .st-el {
  color: #4a3305;
  text-shadow: none;
}
/* 「小さい方が勝ち」になったバトル */
.st-rule {
  margin-top: 0.3rem;
  padding: 0.05em 0.7em;
  background: var(--rose);
  box-shadow: 0 0 0 1px var(--gold-bright);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.6;
  animation: slam 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
/* 勝敗・結果の文・チームの合計: 出るまでは場所だけ取っておく(出たときに画面が動かないように) */
/* 下のボタン: まんなかに「カードをめくる」→「勝敗を見る」→「次へ」、その右に少し離して「スキップ」(勝敗が出たら消える) */
.st-acts {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
}
.st-acts .st-main {
  grid-column: 2;
}
.st-acts .st-skip {
  grid-column: 3;
  justify-self: start;
  margin-left: 2.5rem;
  color: var(--ink-soft);
}
@media (max-width: 560px) {
  .st-acts .st-skip {
    margin-left: 1.25rem;
  }
}
.show-steps .st-hold {
  visibility: hidden;
}
.show-steps .st-hold * {
  animation: none !important;
}
.st-hold-res {
  display: grid;
  justify-items: center;
  gap: 0.9rem;
}
/* 伏せたままのカードは、名前と札(リオの入れ替えなど)も、めくるまで出さない */
.sc.st-wait .sc-name,
.sc.st-wait .sc-tags {
  visibility: hidden;
}

/* ---------- 相手のカードを覚えておく助け(recall.js) ----------
   ラウンド結果: 名前の行の下に、そのラウンドで出した5枚(出した順)。ルール「前のラウンドのカードを見られる」:
   デッキ構築の見出しに前のラウンドの5枚、バトル中は相手の名前の下にパワーのひし形(属性の色)。どれも押すと拡大。
   勝ったカードは金の縁と「WIN」、負けたカードは暗く、引き分けは緑の縁。 */
.rc-cards li {
  position: relative;
}
.rc-cards .pc-win .card {
  box-shadow: 0 0 0 2px var(--gold-bright), 0 0 12px rgba(240, 212, 138, 0.45);
}
.rc-cards .pc-lose .card > img {
  filter: brightness(0.5) saturate(0.7);
}
.rc-cards .pc-draw .card {
  box-shadow: 0 0 0 2px #5fd68e;
}
.pc-mark {
  position: absolute;
  left: 50%;
  bottom: -7px;
  z-index: 2;
  translate: -50% 0;
  padding: 0 0.4em;
  background: var(--rose);
  box-shadow: 0 0 0 1px var(--gold-bright);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.625rem;
  letter-spacing: 0.06em;
  line-height: 1.5;
  pointer-events: none;
}
.show-round .scores {
  width: min(100%, 480px);
}
.scores li.has-cards {
  flex-wrap: wrap;
  row-gap: 0.5rem;
  padding-bottom: 0.8rem;
}
.scores .rc-round {
  flex-basis: 100%;
  margin-top: 0;
  padding-left: calc(28px + 0.75rem);
}
.rc-round .card {
  --cw: clamp(40px, 10vw, 56px);
}
.prev-decks .rc-cards {
  padding-bottom: 0.4rem;
}
/* バトル中: 相手の名前の下の、前のラウンドのパワーのひし形 */
.pl-prev {
  gap: 0.2rem 0.45rem;
}
.pl-prev-label {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--on-night-soft, var(--ink-soft));
  white-space: nowrap;
}
.pv-row {
  display: inline-flex;
  gap: 1px;
}
.pv {
  --s: 26px;
  position: relative;
  display: inline-grid;
  place-items: center;
  width: var(--s);
  height: var(--s);
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.pv::before {
  content: "";
  position: absolute;
  inset: 14.6%;
  transform: rotate(45deg);
  background: var(--elc, var(--line));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}
.pv > b {
  position: relative;
  font-family: var(--font-display);
  font-size: 0.75rem;
  line-height: 1;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.pv[data-el="none"] {
  --elc: var(--el-none);
}
.pv[data-el="fire"] {
  --elc: var(--el-fire);
}
.pv[data-el="thunder"] {
  --elc: var(--el-thunder);
}
.pv[data-el="water"] {
  --elc: var(--el-water);
}
.pv[data-el="light"] {
  --elc: var(--el-light);
}
.pv[data-el="dark"] {
  --elc: var(--el-dark);
}
.pv[data-el="god"] {
  --elc: var(--el-god);
}
.pv[data-el="god"] > b {
  color: #4a3305;
  text-shadow: none;
}
.pv-win::before {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3), 0 0 0 2px var(--gold-bright);
}
.pv-lose {
  opacity: 0.5;
}
.pv:hover::before,
.pv:focus-visible::before {
  filter: brightness(1.25);
}
/* ラウンド結果の .scores の中の小さなカードは、行(.scores li)の見た目を受けない */
.scores .rc-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding-bottom: 0.35rem;
}
.scores .rc-cards li {
  display: block;
  min-height: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
}
/* スマホ幅で相手が2人以上(1行に詰めた相手の行): 前のラウンドのひし形は、アイコンの下の行に小さく(「前のラウンド」の文字は出さない) */
@media (max-width: 760px) {
  .table:not([data-n="1"]) .opp .pl-head {
    flex-wrap: wrap;
    row-gap: 0.15rem;
  }
  .table:not([data-n="1"]) .opp .pl-prev {
    flex-basis: 100%;
  }
  .table:not([data-n="1"]) .opp .pl-prev-label {
    display: none;
  }
  .table:not([data-n="1"]) .opp .pv {
    --s: 21px;
  }
  .table:not([data-n="1"]) .opp .pv > b {
    font-size: 0.6875rem;
  }
}

/* ---------- 試練のダンジョン(dungeon.js) ----------
   目印は、夜の帯の下段に並ぶ「階の列」: いまの階を含む10階をひし形で並べ、10階目(ボス)だけ赤い札。
   こえた階 = 金、いまの階 = 赤(挑戦が終わったら青)、まだ = 線だけ。
   本文は「拾うカード → 敵 | 直前のバトル → 手札」の順。敵の枠は青の細い線、ボスの階は赤の線。 */
.rule-badge.rule-dungeon {
  --rc: var(--gold-pale);
}
.rule-dungeon.is-on .seg-ladder button.on {
  box-shadow: inset 0 -2px 0 var(--gold-pale);
}
.rule-dungeon .ld-opt .seg {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  width: 100%;
  max-width: 30rem;
}
.rule-dungeon .ld-opt .seg button {
  display: grid;
  justify-items: center;
  gap: 0.1rem;
  padding: 0.5em 0.4em;
}
.rule-dungeon .ld-opt .seg button small {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--gold-bright);
}
.rule-dungeon .ld-opt h4 small {
  margin-left: 0.6em;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--on-night-soft);
}
.rule-dungeon .dg-min {
  margin-top: 0.7rem;
}
.rule-dungeon .dg-who {
  margin-top: 0.7rem;
  color: var(--gold-bright);
}

/* 夜の帯 */
.dg-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 2rem;
}
.dg-title {
  flex: 1 1 20rem;
  min-width: 0;
  text-align: left;
}
.dg-title h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.75rem, 5vw, 2.441rem);
  line-height: 1.2;
}
.dg-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 1.1rem;
  margin-top: 0.4rem;
  font-size: 0.875rem;
  color: var(--on-night-soft);
}
.dg-life {
  display: inline-flex;
  gap: 0.3rem;
}
.dg-life i {
  width: 0.8rem;
  height: 0.8rem;
  transform: rotate(45deg) scale(0.8);
  box-shadow: inset 0 0 0 1.5px var(--ink-soft);
}
.dg-life i.on {
  background: var(--rose-deep);
  box-shadow: none;
}
.dg-path {
  --s: 30px;
  display: flex;
  align-items: flex-start;
  gap: 0.2rem;
  margin-top: 0.9rem;
}
.dg-path li {
  position: relative;
  display: grid;
  justify-items: center;
}
/* 階と階をつなぐ線 */
.dg-path li + li::before {
  content: "";
  position: absolute;
  top: calc(var(--s) / 2 - 1px);
  right: calc(100% - 0.2rem);
  width: 0.4rem;
  height: 2px;
  background: rgba(201, 162, 75, 0.5);
}
.dg-path .dia {
  --s: inherit;
}
.dg-path .dia > b {
  font-family: var(--font-num);
  font-size: calc(var(--s) * 0.34);
}
.dg-path li.now .dia {
  animation: dg-now 2.4s ease-in-out infinite;
}
.dg-boss-mark {
  display: inline-block;
  padding: 0 0.35em;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.5;
  background: var(--rose);
  color: #fff;
}
.dg-path .dg-boss-mark {
  margin-top: -0.1rem;
}
@keyframes dg-now {
  50% {
    transform: translateY(-3px);
  }
}

/* タイムアタック: 残り時間と順位 */
.dg-race {
  display: grid;
  gap: 0.6rem;
  flex: 0 1 19rem;
  min-width: min(100%, 15rem);
}
.dg-clock {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0.8rem;
  border: 1px solid rgba(201, 162, 75, 0.45);
}
.dg-clock span {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--on-night-soft);
}
.dg-clock b {
  font-family: var(--font-num);
  font-weight: var(--num-weight);
  font-size: 1.9rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--gold-bright);
}
.dg-clock.low {
  border-color: var(--red-bright);
}
.dg-clock.low b {
  color: var(--red-bright);
}
.dg-board {
  display: grid;
  gap: 0.25rem;
}
.dg-board li {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  grid-template-areas: "rank av name best" "rank av sub sub";
  align-items: center;
  column-gap: 0.5rem;
  padding: 0.2rem 0.5rem 0.2rem 0.2rem;
  border-left: 3px solid transparent;
  text-align: left;
}
.dg-board li.me {
  border-left-color: var(--rose-deep);
  background: rgba(192, 22, 44, 0.12);
}
.dg-board .dia {
  --s: 30px;
  grid-area: rank;
}
.dg-board .av {
  grid-area: av;
}
.dg-b-name {
  grid-area: name;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}
.dg-b-best {
  grid-area: best;
  font-family: var(--font-display);
  font-weight: 900;
  color: var(--gold-bright);
}
.dg-b-sub {
  grid-area: sub;
  font-size: 0.75rem;
  color: var(--on-night-soft);
}
.dg-board li.over .dg-b-sub {
  color: var(--blue-bright);
}

/* 本文 */
.dg-body {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.2rem clamp(0.75rem, 3vw, 2rem) 3rem;
  display: grid;
  gap: 1.4rem;
}
.dg-body h2 {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.2rem 0.6em;
  margin-bottom: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.0625rem;
}
.dg-body h2 small {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink-soft);
}
#dg-top:empty {
  display: none;
}
.dg-watch {
  color: var(--ink-soft);
}
/* 敵と手札を近くに(2026年11月20日、くまねこ堂の指定「試練のダンジョンの敵と手札が遠い」):
   PC は左の列に 敵 → 手札、右の列に前のバトル(縦に長いので、2段ぶん)。スマホは 敵 → 手札 → 前のバトル の順。
   (#dg-stage の中の 敵・前のバトル を、.dg-body の格子に直接並べる) */
.dg-stage {
  display: contents;
}
@media (min-width: 761px) {
  .dg-body {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
    grid-template-areas: "top top" "enemy last" "hand last";
    column-gap: 1rem;
    row-gap: 1.1rem;
    align-items: start;
  }
  .dg-body:has(> #dg-top:empty) {
    grid-template-rows: auto 1fr;
    grid-template-areas: "enemy last" "hand last";
  }
  /* 前のバトルが無いとき(1階のはじめ・やり直し)は、手札を横いっぱいに */
  .dg-body:not(:has(.dg-last)) {
    grid-template-areas: "top top" "enemy enemy" "hand hand";
  }
  .dg-body:not(:has(.dg-last)):has(> #dg-top:empty) {
    grid-template-areas: "enemy enemy" "hand hand";
  }
  .dg-body:not(:has(.dg-last)) .dg-enemy {
    max-width: calc(50% - 0.5rem);
  }
  #dg-top {
    grid-area: top;
  }
  .dg-body .dg-enemy {
    grid-area: enemy;
  }
  .dg-body .dg-last {
    grid-area: last;
  }
  #dg-hand {
    grid-area: hand;
  }
}

.dg-enemy,
.dg-last {
  padding: 0.8rem 0.9rem 0.9rem;
  border: 1px solid var(--blue-bright);
  background: rgba(6, 12, 34, 0.45);
}
.dg-enemy.is-boss {
  border-color: var(--red-bright);
  box-shadow: inset 0 0 0 1px rgba(238, 90, 114, 0.25);
}
.dg-enemy h2 .dg-boss-mark {
  font-family: var(--font-body);
  align-self: center;
}
.dg-enemy-in {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
}
.dg-enemy-card .card {
  --cw: clamp(112px, 15vw, 150px);
}
/* 敵のカードは裏向きで出てきて、左から右へめくれる(バトルの公開と同じ .flipper / .flip-in。
   --hold = 直前のバトルの結果を見せる時間。2026年11月20日、くまねこ堂の指定「敵が出てきたときにめくられる演出」) */
.dg-enemy-card .flipper {
  animation: dg-enemy-in 0.35s ease both;
}
.dg-enemy-card .flip-in {
  animation-duration: 0.75s;
}
/* めくれる直前に、カードが少し浮く */
@keyframes dg-enemy-in {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.96);
  }
}
/* 能力の説明は、めくれたあとに出る */
.dg-enemy-in > .cinfo {
  animation: dg-info-in 0.4s ease calc(var(--hold, 0s) + 1s) both;
}
@keyframes dg-info-in {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
}
.dg-enemy .cinfo {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.875rem;
}
/* カードは左から右へめくれる(バトルの公開と同じ向き) */
@keyframes dg-turn {
  from {
    transform: perspective(600px) rotateY(-90deg);
    opacity: 0.3;
  }
}

/* 直前のバトル */
.dg-last {
  border-color: rgba(201, 162, 75, 0.45);
  text-align: center;
  /* WIN・LOSE の文字が大きく押される演出(slam)が、欄の外(画面の横)にはみ出さないように。
     スマホでは、はみ出すと画面の幅が広がって、上の帯が右にずれていた(2026年11月20日) */
  overflow: hidden;
  overflow: clip;
}
.dg-last h2 {
  justify-content: center;
}
.dg-vs {
  display: flex;
  /* 敵を上、自分を下(2026年11月20日、くまねこ堂の指定。前は 自分 VS 敵 の横並び) */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}
.dg-vs .dg-vs-mark {
  margin-bottom: 0.45rem;
  line-height: 1;
}
.dg-side {
  display: grid;
  justify-items: center;
  gap: 0.25rem;
}
.dg-side .card {
  --cw: clamp(72px, 10vw, 96px);
}
/* カードごとの勝敗(2026年11月20日、くまねこ堂の指定「前回のバトルのお互いの勝敗を分かりやすく」):
   カードの上の札(WIN 赤 / LOSE 青 / DRAW 緑)。勝った方は赤の縁と光、負けた方はカードが暗くなる */
.dg-side-card {
  position: relative;
  display: grid;
  justify-items: center;
}
.dg-side-card > .card {
  position: relative;
  z-index: 1;
}
.dg-side-out {
  position: absolute;
  top: -0.7rem;
  left: 50%;
  z-index: 2;
  translate: -50% 0;
  padding: 0.05em 0.6em;
  border: 1px solid;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 900;
  line-height: 1.4;
  letter-spacing: 0.06em;
  white-space: nowrap;
  animation: dg-badge 0.4s cubic-bezier(0.2, 1.5, 0.4, 1) 0.75s both;
}
.dg-side-out.out-win {
  border-color: #ffb3c1;
  background: var(--rose);
  color: #fff;
  box-shadow: 0 0 14px rgba(238, 90, 114, 0.65);
}
.dg-side-out.out-lose {
  border-color: var(--blue-bright);
  background: #17306a;
  color: #dbe6ff;
}
.dg-side-out.out-draw {
  border-color: #5fd68e;
  background: #164a33;
  color: #d8f7e4;
}
@keyframes dg-badge {
  from {
    opacity: 0;
    scale: 1.8;
  }
}
.dg-side.win .card {
  box-shadow: 0 0 0 2px var(--red-bright), 0 0 18px rgba(238, 90, 114, 0.55);
  animation: dg-winner 0.45s ease 0.75s both;
}
.dg-side.win:last-child .card {
  animation:
    dg-turn 0.5s cubic-bezier(0.2, 0.8, 0.3, 1) both,
    dg-winner 0.45s ease 0.75s both;
}
@keyframes dg-winner {
  from {
    box-shadow: 0 2px 6px rgba(10, 8, 30, 0.35);
  }
}
.dg-side.lose .card > img {
  animation: dg-loser 0.5s ease 0.8s both;
}
@keyframes dg-loser {
  to {
    filter: brightness(0.45) saturate(0.5);
  }
}
.dg-side.lose .dg-who {
  opacity: 0.7;
}
/* 能力が発動したカード: うしろが薄く金に光る(ゆっくり明滅。2026年11月20日、くまねこ堂の指定「効果が発動するカードを薄く光らせて」) */
.dg-side.fired .dg-side-card::before {
  content: "";
  position: absolute;
  inset: -9px -9px 4px;
  z-index: 0;
  border-radius: 10px;
  background: radial-gradient(closest-side, rgba(240, 212, 138, 0.75), rgba(240, 212, 138, 0.25) 70%, transparent);
  filter: blur(7px);
  animation: dg-fired 2.4s ease-in-out 0.6s infinite both;
}
/* カードの中も、縁から薄く金に光る(勝った方の赤の縁・負けた方の暗さとは別に見える) */
.dg-fired-glow {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  box-shadow: inset 0 0 12px 3px rgba(255, 228, 150, 0.85);
  background: radial-gradient(ellipse 70% 55% at 50% 40%, rgba(255, 236, 170, 0.22), transparent 72%);
  pointer-events: none;
  animation: dg-fired 2.4s ease-in-out 0.6s infinite both;
}
.dg-side .dg-pow {
  position: relative;
  z-index: 3;
}
@keyframes dg-fired {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 0.9;
  }
}
.dg-side:last-child .card {
  animation: dg-turn 0.5s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}
.dg-side .chip {
  font-size: 0.6875rem;
}
.dg-who {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink-soft);
}
.dg-vs-mark {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--gold);
}
.dg-pow {
  --s: 40px;
  margin-top: -1.3rem;
}
.dg-pow::before {
  background: var(--elc, var(--el-none));
  box-shadow: 0 0 0 2px var(--night);
}
.dg-pow > b {
  font-family: var(--font-num);
  color: #fff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
}
.dg-pow.changed::before {
  box-shadow: 0 0 0 2px var(--night), 0 0 0 4px var(--gold);
}
.dg-pow[data-el="none"] { --elc: var(--el-none); }
.dg-pow[data-el="fire"] { --elc: var(--el-fire); }
.dg-pow[data-el="thunder"] { --elc: var(--el-thunder); }
.dg-pow[data-el="water"] { --elc: var(--el-water); }
.dg-pow[data-el="light"] { --elc: var(--el-light); }
.dg-pow[data-el="dark"] { --elc: var(--el-dark); }
.dg-pow[data-el="god"] { --elc: var(--el-god); }
.dg-out {
  margin-top: 0.6rem;
  line-height: 1;
  animation: slam 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) 0.45s both;
}
.dg-out.out-win {
  --out: var(--red-bright);
  --out-glow: rgba(232, 88, 122, 0.65);
}
.dg-out .out-word {
  font-size: clamp(1.6rem, 4.6vw, 2.4rem);
}
.dg-out-text {
  margin-top: 0.4rem;
  font-size: 0.875rem;
}
.dg-took {
  margin-top: 0.3rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--gold-bright);
}
.dg-notes {
  display: grid;
  gap: 0.2rem;
  margin-top: 0.6rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(201, 162, 75, 0.25);
  font-size: 0.8125rem;
  color: var(--ink-soft);
  text-align: left;
}

/* 勝ったとき(2026年11月20日、くまねこ堂の指定「勝ったときを分かりやすく」)。
   ・直前のバトルの欄: 金の縁と、WIN の後ろの金の光。WIN の下に「N階 突破!」
   ・拾うカードの欄の上: こえた階の金のひし形と「N階 突破!」
   ・画面の上に金の帯(.dg-clear。約2秒で消える。押せるものはふさがない。
     はじめは画面の真ん中だったが、カードの絵に重なるので上へ。2026年11月20日、くまねこ堂の指定) */
.dg-last.dg-out-win {
  border-color: var(--gold-bright);
  background:
    radial-gradient(ellipse 60% 45% at 50% 72%, rgba(240, 212, 138, 0.2), transparent 70%),
    rgba(6, 12, 34, 0.45);
  box-shadow: inset 0 0 0 1px rgba(240, 212, 138, 0.35), 0 0 22px rgba(240, 212, 138, 0.18);
}
.dg-pass {
  margin-top: 0.35rem;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.15rem, 3vw, 1.4rem);
  letter-spacing: 0.04em;
  color: var(--gold-bright);
  text-shadow: 0 0 16px rgba(240, 212, 138, 0.45);
  animation: tutdone-rise 0.4s ease 0.7s both;
}
.dg-offer-win {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  margin: -0.2rem 0 0.8rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(201, 162, 75, 0.45);
}
.dg-offer-win .dia {
  --s: 46px;
  animation: dg-pop 0.5s cubic-bezier(0.2, 1.5, 0.4, 1) 0.2s both;
}
.dg-offer-win .dia::before {
  box-shadow: 0 0 0 3px var(--night), 0 0 0 4px var(--gold-bright), 0 0 22px rgba(240, 212, 138, 0.55);
}
.dg-offer-win > span:last-child {
  display: grid;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.3rem, 3.4vw, 1.75rem);
  line-height: 1.2;
  color: var(--gold-bright);
  text-align: left;
}
.dg-offer-win small {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--ink-soft);
}
@keyframes dg-pop {
  from {
    opacity: 0;
    scale: 0.4;
  }
}

/* 引き分け・敗北のあとは、同じ階の別の敵(見出しに青い「入れ替わった敵」) */
.dg-swap-mark {
  align-self: center;
  padding: 0 0.45em;
  border: 1px solid var(--blue-bright);
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.5;
  color: var(--blue-bright);
}
.dg-enemy.swapped .dg-enemy-card .flipper {
  animation: dg-swap 0.5s cubic-bezier(0.2, 0.8, 0.3, 1) 0.2s both;
}
/* 新しい敵が、裏向きのまま左からすべり込んで、めくれる(直前のバトルの結果が出てから) */
@keyframes dg-swap {
  0% {
    transform: translateX(-36px) rotate(-4deg);
    opacity: 0;
  }
  100% {
    transform: none;
    opacity: 1;
  }
}

/* 画面の上の金の帯「N階 突破!」(負けたときの赤の帯 .dg-clear.lose も同じ場所) */
.dg-clear {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: start center;
  padding-top: max(0.5rem, env(safe-area-inset-top));
  pointer-events: none;
}
.dg-clear-band {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.9rem, 3vw, 1.6rem);
  width: 100%;
  padding: clamp(0.7rem, 2.2vw, 1rem) 1rem;
  /* 後光と金の粒は、帯の中だけ(下のカードにかからない) */
  overflow: hidden;
  border-block: 1px solid var(--gold-bright);
  background: linear-gradient(90deg, rgba(6, 12, 34, 0.6), var(--night) 14%, #0f1b45 50%, var(--night) 86%, rgba(6, 12, 34, 0.6));
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  box-shadow: 0 0 40px rgba(240, 212, 138, 0.25);
  animation:
    dg-band-in 0.4s cubic-bezier(0.2, 0.8, 0.3, 1) 0.4s both,
    dg-band-out 0.45s ease 2.05s forwards;
}
.dg-clear.boss .dg-clear-band {
  border-color: var(--red-bright);
  box-shadow: 0 0 40px rgba(238, 90, 114, 0.3);
}
@keyframes dg-band-in {
  from {
    opacity: 0;
    clip-path: inset(0 50% 0 50%);
  }
  to {
    opacity: 1;
    clip-path: inset(0 0 0 0);
  }
}
@keyframes dg-band-out {
  to {
    opacity: 0;
    translate: 0 -10px;
  }
}
.dg-clear-mark {
  position: relative;
  display: grid;
  place-items: center;
}
.dg-clear-mark .dia {
  --s: clamp(52px, 11vw, 72px);
  animation: dg-pop 0.5s cubic-bezier(0.2, 1.5, 0.4, 1) 0.55s both;
}
.dg-clear-mark .dia > b {
  font-size: 1.6em;
}
.dg-clear-mark .dia::before {
  box-shadow: 0 0 0 3px var(--night), 0 0 0 5px var(--gold-bright), 0 0 36px rgba(240, 212, 138, 0.7);
}
.dg-clear-rays {
  position: absolute;
  inset: -90%;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(240, 212, 138, 0.38) 0 5deg, transparent 5deg 15deg);
  -webkit-mask: radial-gradient(circle, #000 18%, transparent 62%);
  mask: radial-gradient(circle, #000 18%, transparent 62%);
  animation:
    pz-rays-in 0.5s ease 0.55s both,
    tutdone-rays 24s linear 0.55s infinite;
}
.dg-clear-sparks {
  position: absolute;
  inset: 0;
}
.dg-clear-sparks i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
  background: var(--gold-bright);
  box-shadow: 0 0 8px rgba(240, 212, 138, 0.9);
  opacity: 0;
  --spark-r: 90px;
  animation: dg-spark 0.9s cubic-bezier(0.15, 0.7, 0.3, 1) 0.7s both;
}
@keyframes dg-spark {
  0% {
    opacity: 0;
    transform: rotate(var(--a)) translateY(0) rotate(45deg) scale(0.4);
  }
  15% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: rotate(var(--a)) translateY(calc(var(--spark-r) * -1 * var(--r))) rotate(45deg) scale(1);
  }
}
.dg-clear-text {
  display: grid;
  gap: 0.15rem;
  animation: tutdone-rise 0.45s ease 0.65s both;
}
.dg-clear-text b {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.7rem, 6.4vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: 0.05em;
  color: var(--gold-bright);
  text-shadow: 0 0 26px rgba(240, 212, 138, 0.45);
}
.dg-clear.boss .dg-clear-text b {
  color: #fff;
  text-shadow: 0 0 26px rgba(238, 90, 114, 0.7);
}
.dg-clear-text small {
  font-size: clamp(0.8125rem, 2.4vw, 0.9375rem);
  font-weight: 700;
  color: var(--ink);
}

/* 負けたとき(2026年11月20日、くまねこ堂の指定「負けた時も大きく表示して、ライフが減った演出も」)。
   ・画面の上に赤の帯「敗北」(勝ったときの金の帯と同じ場所)。左にライフのひし形が並び、なくした1つがひび割れて砕ける
   ・帯は1度ゆれる。画面の縁が赤く光る
   ・ライフがなくなったときは「ライフがなくなりました」(帯は少し長く出す)
   ・直前のバトルの欄: 赤の縁と、LOSE の下に「ライフ −1(残りN)」 */
.dg-clear.lose .dg-clear-band {
  border-color: var(--red-bright);
  background: linear-gradient(90deg, rgba(34, 6, 16, 0.6), #1a0712 14%, #3a0d1e 50%, #1a0712 86%, rgba(34, 6, 16, 0.6));
  box-shadow: 0 0 40px rgba(238, 90, 114, 0.35);
  animation:
    dg-band-in 0.35s cubic-bezier(0.2, 0.8, 0.3, 1) 0.4s both,
    dg-hurt-shake 0.42s ease 0.95s,
    dg-band-out 0.45s ease 2.05s forwards;
}
.dg-clear.lose.out .dg-clear-band {
  animation:
    dg-band-in 0.35s cubic-bezier(0.2, 0.8, 0.3, 1) 0.4s both,
    dg-hurt-shake 0.42s ease 0.95s,
    dg-band-out 0.5s ease 2.45s forwards;
}
.dg-clear.lose .dg-clear-band {
  padding-inline: 0.75rem;
}
.dg-clear.lose .dg-clear-text {
  min-width: 0;
}
.dg-clear.lose.out .dg-clear-text b {
  font-size: clamp(1.35rem, 5.4vw, 2.5rem);
}
.dg-clear.lose .dg-clear-text b {
  color: #fff;
  text-shadow: 0 0 2px rgba(255, 255, 255, 0.35), 0 0 22px rgba(238, 90, 114, 0.85), 0 3px 0 rgba(6, 7, 20, 0.85);
}
.dg-clear.lose .dg-clear-text small {
  color: #ffd9e0;
}
@keyframes dg-hurt-shake {
  0%,
  100% {
    translate: 0 0;
  }
  20% {
    translate: -10px 0;
  }
  40% {
    translate: 8px 0;
  }
  60% {
    translate: -5px 0;
  }
  80% {
    translate: 3px 0;
  }
}
/* ライフのひし形(残り = 赤、なくした分 = 線だけ。いまなくした1つは、光って → ひびが入り → 砕ける) */
.dg-lose-life {
  display: inline-flex;
  gap: clamp(0.55rem, 1.8vw, 0.85rem);
  padding: 0.4rem 0.2rem;
}
.dg-lose-life i {
  position: relative;
  width: clamp(1.5rem, 4.6vw, 2.1rem);
  height: clamp(1.5rem, 4.6vw, 2.1rem);
  transform: rotate(45deg);
  box-shadow: inset 0 0 0 2px rgba(255, 217, 224, 0.55);
}
.dg-lose-life i.on {
  background: var(--rose-deep);
  box-shadow: 0 0 0 2px var(--night), 0 0 14px rgba(238, 90, 114, 0.55);
}
.dg-lose-life i.lost {
  background: var(--rose-deep);
  box-shadow: 0 0 0 2px #fff, 0 0 22px rgba(255, 255, 255, 0.7);
  animation: dg-gem-break 0.75s cubic-bezier(0.3, 0, 0.6, 1) 0.75s forwards;
}
/* ひび(斜めの白い線が2本) */
.dg-lose-life i.lost::before,
.dg-lose-life i.lost::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -10%;
  width: 2px;
  height: 120%;
  background: #fff;
  opacity: 0;
  transform-origin: center;
  animation:
    dg-gem-crack 0.25s ease 0.75s forwards,
    dg-gem-crack-out 0.3s ease 1.25s forwards;
}
.dg-lose-life i.lost::before {
  transform: translateX(-50%) rotate(28deg);
}
.dg-lose-life i.lost::after {
  transform: translateX(-50%) rotate(-52deg);
}
@keyframes dg-gem-crack {
  to {
    opacity: 1;
  }
}
@keyframes dg-gem-crack-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}
@keyframes dg-gem-break {
  0% {
    scale: 1;
  }
  30% {
    scale: 1.25;
    background: #fff;
  }
  100% {
    scale: 1;
    background: transparent;
    box-shadow: inset 0 0 0 2px rgba(255, 217, 224, 0.55);
  }
}
/* 砕けたかけら(6方向へ飛んで消える) */
.dg-lose-shards {
  position: absolute;
  inset: 0;
}
.dg-lose-shards i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
  background: var(--red-bright);
  box-shadow: 0 0 6px rgba(238, 90, 114, 0.9);
  opacity: 0;
  animation: dg-shard 0.7s cubic-bezier(0.15, 0.7, 0.3, 1) 0.98s both;
}
@keyframes dg-shard {
  0% {
    opacity: 1;
    transform: rotate(var(--a)) translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: rotate(var(--a)) translateY(-28px) scale(0.4);
  }
}
/* 画面の縁が赤く光る */
.dg-hurt-edge {
  position: fixed;
  inset: 0;
  box-shadow: inset 0 0 90px 18px rgba(217, 42, 66, 0.55);
  opacity: 0;
  animation: dg-hurt-edge 1.1s ease 0.9s both;
}
@keyframes dg-hurt-edge {
  0% {
    opacity: 0;
  }
  18% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
/* 直前のバトルの欄(負けたとき) */
.dg-last.dg-out-lose {
  border-color: var(--red-bright);
  background:
    radial-gradient(ellipse 60% 45% at 50% 72%, rgba(238, 90, 114, 0.16), transparent 70%),
    rgba(6, 12, 34, 0.45);
  box-shadow: inset 0 0 0 1px rgba(238, 90, 114, 0.3), 0 0 22px rgba(238, 90, 114, 0.14);
}
.dg-hurt-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  color: #ffd9e0;
  text-shadow: 0 0 16px rgba(238, 90, 114, 0.5);
}
.dg-hurt-line .dg-life i {
  width: 0.95rem;
  height: 0.95rem;
}

/* 手札のうち、いまの敵に出したら能力が発動するカード: 中から薄く金に光り(.dg-fired-glow)、外にも金の光がゆっくり明滅する
   (2026年11月20日、くまねこ堂の指定「現在の手札で効果が適用できるものも光らせて」。選んだカードは、選んだ印の縁を優先) */
.dg-hand li.fires .card {
  animation: dg-fires-halo 2.4s ease-in-out infinite both;
}
.dg-hand li.fires.sel .card {
  animation: none;
}
@keyframes dg-fires-halo {
  0%,
  100% {
    box-shadow: 0 0 0 1px rgba(240, 212, 138, 0.45), 0 0 8px rgba(240, 212, 138, 0.25);
  }
  50% {
    box-shadow: 0 0 0 1.5px rgba(240, 212, 138, 0.8), 0 0 18px rgba(240, 212, 138, 0.5);
  }
}

/* 手札がなくなって引いたカード(直前のバトルの欄の文と、手札の「引いた」の札) */
.dg-drew {
  margin-top: 0.3rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--blue-bright);
}
.dg-hand li.drew {
  position: relative;
}
.dg-hand li.drew .card {
  animation: dg-drew-in 0.6s cubic-bezier(0.2, 0.8, 0.3, 1) both;
  box-shadow: 0 0 0 2px var(--blue-bright), 0 0 18px rgba(141, 176, 247, 0.5);
}
.dg-drew-tag {
  position: absolute;
  top: -0.55rem;
  left: 50%;
  translate: -50% 0;
  padding: 0 0.5em;
  border: 1px solid var(--blue-bright);
  background: var(--night);
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.6;
  color: var(--blue-bright);
  white-space: nowrap;
  pointer-events: none;
}
.dg-hand li.drew.fires:not(.sel) .card {
  animation:
    dg-drew-in 0.6s cubic-bezier(0.2, 0.8, 0.3, 1) both,
    dg-fires-halo 2.4s ease-in-out 0.6s infinite both;
}
@keyframes dg-drew-in {
  from {
    opacity: 0;
    transform: translateY(18px) rotate(-4deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dg-clear-band,
  .dg-clear.lose .dg-clear-band,
  .dg-clear.lose.out .dg-clear-band {
    animation: dg-band-out 0.3s ease 1.6s forwards;
  }
  .dg-clear-mark .dia,
  .dg-clear-text,
  .dg-pass,
  .dg-offer-win .dia,
  .dg-enemy.swapped .dg-enemy-card .flipper,
  .dg-enemy-card .flipper,
  .dg-enemy-card .flip-in,
  .dg-enemy-in > .cinfo,
  .dg-side-out,
  .dg-side.win .card,
  .dg-side.fired .dg-side-card::before,
  .dg-fired-glow,
  .dg-hand li.fires .card,
  .dg-hand li.drew.fires:not(.sel) .card,
  .dg-hand li.drew .card {
    animation: none;
  }
  .dg-side.lose .card > img {
    animation: none;
    filter: brightness(0.45) saturate(0.5);
  }
  .dg-lose-life i.lost {
    animation: none;
    background: transparent;
  }
  .dg-clear-rays,
  .dg-clear-sparks,
  .dg-lose-shards,
  .dg-hurt-edge {
    display: none;
  }
}

/* 拾うカード */
.dg-offer {
  padding: 0.9rem 0.9rem 1rem;
  border: 1px solid var(--gold);
  background: linear-gradient(180deg, rgba(201, 162, 75, 0.14), transparent 70%);
}
.dg-offer h2 {
  justify-content: center;
}
.dg-offer ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 1.2rem;
}
.dg-offer li {
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  gap: 0.55rem;
  width: min(100%, 220px);
}
.dg-offer .card {
  --cw: 132px;
  animation: dg-turn 0.5s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}
.dg-offer li:nth-child(2) .card {
  animation-delay: 0.12s;
}
.dg-offer li:nth-child(3) .card {
  animation-delay: 0.24s;
}
.dg-offer .cinfo {
  width: 100%;
  text-align: left;
  font-size: 0.8125rem;
}
.dg-offer .btn {
  width: 100%;
}

/* 挑戦が終わった(タイムアタック) */
.dg-over {
  padding: 0.9rem 1rem 1rem;
  border: 1px solid var(--blue-bright);
  background: rgba(47, 95, 184, 0.16);
  text-align: center;
}
.dg-over h2 {
  justify-content: center;
}
.dg-over p {
  margin-bottom: 0.8rem;
  font-size: 0.9375rem;
}

/* 手札 */
.dg-hand ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.dg-card {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.dg-card .card {
  --cw: clamp(72px, 11vw, 104px);
}
.dg-card:hover:not(:disabled) {
  transform: translateY(-3px);
}
.dg-hand li.sel .dg-card {
  transform: translateY(-8px);
}
.dg-hand li.sel .card {
  box-shadow: 0 0 0 3px var(--gold-bright), 0 10px 22px -8px rgba(0, 0, 0, 0.8);
}
.dg-card:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}
.dg-hand.off .dg-card {
  cursor: default;
  opacity: 0.6;
}
.dg-empty {
  color: var(--ink-soft);
}

/* 結果 */
.dg-rules-note {
  font-size: 0.8125rem;
  color: var(--ink-soft);
  text-align: center;
}
.dg-used ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem 0.5rem;
}
.dg-used li {
  display: grid;
  justify-items: center;
  gap: 0.15rem;
}
.dg-used .card {
  --cw: 62px;
}
.dg-used small {
  font-size: 0.6875rem;
  color: var(--ink-soft);
}
.dg-u-out {
  font-family: var(--font-display);
  font-size: 0.6875rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: var(--red-bright);
}
.dg-u-lose .dg-u-out {
  color: var(--blue-bright);
}
.dg-u-draw .dg-u-out {
  color: #5fd68e;
}
.dg-u-lose .card,
.dg-u-draw .card {
  filter: brightness(0.6);
}
.dg-used h2,
.dg-final h2 {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 0.6em;
  margin-bottom: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.0625rem;
}
.dg-used h2 small,
.dg-final h2 small {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--ink-soft);
}
.dg-final {
  width: 100%;
}
.dg-final .dg-board {
  width: 100%;
  max-width: 26rem;
  margin: 0 auto;
}
.dg-final .dg-board li.over .dg-b-sub {
  color: var(--on-night-soft);
}
.dg-final .dg-board .dia {
  --s: 36px;
}

/* タイムアタック(ロビー): ゴールの階は6つ並び。1人で時間制限なしのときは、タイムアタックの欄を薄く */
.rule-dungeon .dg-sub {
  margin: 0.7rem 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--on-night-soft);
}
.rule-dungeon .ld-opt .seg.dg-goals {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  max-width: 34rem;
}
.rule-dungeon .dg-off > :not(h4) {
  opacity: 0.55;
}
/* ゴールの階(階の列・夜の帯の状況) */
.dg-goal-mark {
  display: inline-block;
  margin-top: 0.15rem;
  padding: 0 0.35em;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.5;
  background: var(--gold-bright);
  color: var(--night);
}
.dg-path li.goal .dia::before {
  box-shadow: 0 0 0 2px var(--gold-bright);
}
.dg-goal {
  padding: 0 0.5em;
  border: 1px solid var(--gold-bright);
  color: var(--gold-bright);
  font-weight: 700;
}
.dg-clock {
  flex-wrap: wrap;
}
.dg-clock small {
  flex-basis: 100%;
  text-align: right;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: var(--on-night-soft);
}
/* 戦績: 最速タイム */
.dg-times-h {
  margin: 0.7rem 0 0.35rem;
  font-size: 0.8125rem;
  color: var(--gold-bright);
}
.dg-times {
  display: grid;
  gap: 0.2rem;
}
.dg-times li {
  display: flex;
  align-items: baseline;
  gap: 0.6em;
}
.dg-times b {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  color: var(--gold-bright);
}
.dg-times small {
  font-size: 0.75rem;
  color: var(--ink-soft);
}

/* 2〜4人: 順位表の2行目(いまの階・ライフ・手札の枚数・直前の勝敗)と、お知らせ */
.dg-board .dg-b-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.55rem;
}
.dg-life-s {
  gap: 0.18rem;
}
.dg-life-s i {
  width: 0.55rem;
  height: 0.55rem;
}
.dg-b-out {
  font-family: var(--font-display);
  font-size: 0.6875rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: var(--red-bright);
}
.dg-b-out.out-lose {
  color: var(--blue-bright);
}
.dg-b-out.out-draw {
  color: #5fd68e;
}
.dg-news {
  display: grid;
  gap: 0.2rem;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(201, 162, 75, 0.3);
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--on-night-soft);
  text-align: left;
}
.dg-news li {
  position: relative;
  padding-left: 0.85rem;
}
.dg-news li::before {
  content: "";
  position: absolute;
  left: 0.1rem;
  top: 0.5em;
  width: 0.38rem;
  height: 0.38rem;
  transform: rotate(45deg);
  background: var(--line);
}
.dg-news li:first-child {
  color: var(--ink);
}
.dg-news li.big::before {
  background: var(--gold-bright);
}
.dg-news li.big {
  color: var(--gold-bright);
  font-weight: 700;
}
.dg-news li:first-child {
  animation: rise 0.3s ease both;
}
/* 画面の上に出すお知らせ(大事なもの) */
.toast-dg {
  border-color: var(--gold-bright);
  box-shadow: inset 4px 0 0 var(--gold-bright), var(--shadow);
  color: var(--gold-bright);
}
@media (prefers-reduced-motion: reduce) {
  .dg-news li:first-child {
    animation: none;
  }
}

@media (max-width: 760px) {
  /* スマホ: 1列。拾うカード → 敵 → 手札 → 前のバトル */
  .dg-body .dg-enemy {
    order: 1;
  }
  #dg-hand {
    order: 2;
  }
  .dg-body .dg-last {
    order: 3;
  }
  .dg-body:not(:has(.dg-last)) .dg-enemy {
    max-width: none;
  }
  .dg-race {
    flex-basis: 100%;
  }
}
@media (max-width: 420px) {
  .rule-dungeon .ld-opt .seg.dg-goals {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  /* 手札(多くて5枚)は1列に収める */
  .dg-hand ul {
    gap: 0.4rem;
  }
  .dg-card .card {
    --cw: min(72px, calc((100vw - 1.5rem - 1.6rem) / 5));
  }
  .dg-path {
    --s: 26px;
    gap: 0.1rem;
  }
  .dg-path li + li::before {
    display: none;
  }
  .dg-offer li {
    width: calc(50% - 0.6rem);
  }
  .dg-offer .card {
    --cw: 104px;
  }
  .dg-enemy-in {
    gap: 0.7rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .dg-path li.now .dia,
  .dg-enemy-card .card,
  .dg-side .card,
  .dg-offer .card,
  .dg-out {
    animation: none;
  }
}

/* ---------- 並び当て(lineup.js) ----------
   勝負した並びの6行: 行ごとに自分の5枚と、カードの下の帯に勝敗(WIN = 金、LOSE = 青、DRAW = 線だけ)。
   出したばかりの行は、効果音に合わせて左から順にめくれる(0.3秒ずつ)。 */
.ln .pz-board.ln-opp .pz-cell {
  min-height: 0;
}
.ln-no {
  --s: 30px;
  margin-bottom: 0.2rem;
}
.ln {
  --lnw: clamp(50px, 14vw, 92px);
}
/* 相手の5枚・勝負した並び・手札を、同じ幅の列にそろえて中央に */
.ln .ln-opp .pz-cols,
.ln-rows,
.ln .pz-hand-row {
  width: 100%;
  max-width: calc(var(--lnw) * 5 + 1.6rem + 2.4rem);
  margin-inline: auto;
}
.ln .ln-opp .pz-cols {
  --pzw: var(--lnw);
  padding-left: 2rem;
}
.ln .ln-opp .pz-label,
.ln .ln-board .pz-label {
  text-align: center;
}
.ln .pz-hand h2 {
  justify-content: center;
  text-align: center;
}
.ln .pz-hand-row {
  justify-content: center;
}
.ln .pz-hand-row .card {
  --cw: var(--lnw);
}
.ln-rows {
  display: grid;
  gap: 0.45rem;
}
.ln-row {
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr);
  align-items: center;
  gap: 0.4rem;
}
.ln-rno {
  font-family: var(--font-num);
  font-weight: var(--num-weight);
  font-size: 0.875rem;
  text-align: center;
  color: var(--ink-soft);
}
.ln-row.now .ln-rno {
  color: var(--gold-bright);
}
.ln-cells {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.4rem;
  justify-items: center;
  max-width: calc(var(--lnw) * 5 + 1.6rem);
}
.ln-cell {
  position: relative;
  display: grid;
  width: var(--lnw);
}
.ln-cell .card {
  --cw: var(--lnw);
}
.ln-slot {
  display: grid;
  place-items: center;
  width: var(--lnw);
  aspect-ratio: 5 / 7;
  border: 1px dashed var(--line);
  font-family: var(--font-num);
  font-size: 0.875rem;
  color: var(--ink-soft);
}
.ln-row.now .ln-slot {
  border-color: var(--gold);
  color: var(--gold-bright);
}
/* まだの行は細い帯だけ(6行ぶんの高さをとらない) */
.ln-slot-off {
  aspect-ratio: auto;
  height: 0.9rem;
  border-style: solid;
  border-color: rgba(58, 72, 140, 0.45);
}
.ln-out {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  place-items: center;
  padding: 0.12rem 0;
  font-family: var(--font-num);
  font-size: clamp(0.5625rem, 2.2vw, 0.75rem);
  letter-spacing: 0.06em;
}
.ln-out em {
  font-style: normal;
  font-weight: 700;
}
.ln-cell.out-win .ln-out {
  background: var(--gold-bright);
  color: var(--night);
}
.ln-cell.out-lose .ln-out {
  background: var(--azure);
  color: #fff;
}
.ln-cell.out-draw .ln-out {
  background: rgba(6, 12, 34, 0.85);
  box-shadow: inset 0 0 0 1px var(--ink-soft);
  color: var(--ink);
}
.ln-cell.out-lose .card,
.ln-cell.out-draw .card {
  filter: saturate(0.55) brightness(0.8);
}
.ln-cell.fresh {
  animation: ln-flip 0.42s cubic-bezier(0.3, 0.7, 0.4, 1) both;
  animation-delay: calc(0.15s + var(--i) * 0.3s);
}
@keyframes ln-flip {
  from {
    transform: perspective(500px) rotateX(80deg);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
.ln-left {
  color: var(--gold-bright);
}
.ln-verdict {
  animation-delay: 1.9s;
}
.ln-ach {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  color: var(--gold-bright);
}
.ln-share {
  display: grid;
  justify-items: center;
  gap: 0.7rem;
}
.ln-share-text {
  margin: 0;
  padding: 0.8rem 1.1rem;
  border: 1px solid var(--gold);
  background: var(--night-2);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--ink);
}
.ln-share-acts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}
.ln-answer summary {
  cursor: pointer;
  margin-bottom: 0.6rem;
  font-weight: 700;
  color: var(--gold-bright);
}
.ln-answer .pz-log > li {
  animation: none;
}
/* 戦績: 何回目で当てたか */
.ln-dist-h {
  margin: 0.6rem 0 0.4rem;
  font-size: 0.8125rem;
  color: var(--gold-bright);
}
.ln-dist {
  display: grid;
  gap: 0.2rem;
  max-width: 22rem;
}
.ln-dist li {
  display: grid;
  grid-template-columns: 1.2rem minmax(0, 1fr) 2rem;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
}
.ln-dist i {
  display: block;
  width: max(3px, var(--w));
  height: 0.8rem;
  background: var(--gold);
}
.ln-dist b {
  font-family: var(--font-num);
  text-align: right;
}

/* ---------- デイリーチャレンジ(daily.js) ----------
   14日分のスタンプ(ひし形の中は日付の日。押した日 = 金、今日でまだ = 赤、ほか = 線だけ)と、3つの挑戦。
   今日のスタンプが押されたときだけ、そのひし形が一度だけ大きく押し込まれる。 */
.solo-btn.solo-daily {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(240, 212, 138, 0.35);
}
.solo-btn.solo-daily b {
  color: var(--gold-bright);
}
.dl-head .players-badge {
  margin-top: 0.6rem;
}
.dl-wrap {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding-inline: clamp(0.75rem, 3vw, 2rem);
}
.dl-stamps {
  margin-top: 1.4rem;
  padding: 0.9rem 0 1rem;
  border-top: 1px solid var(--gold);
  border-bottom: 1px solid rgba(201, 162, 75, 0.45);
}
.dl-days {
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  justify-items: center;
  gap: 0.15rem;
}
.dl-days .dia {
  --s: clamp(30px, 6vw, 46px);
}
.dl-days .dia-line > b {
  color: var(--ink-soft);
}
.dl-days li.today {
  position: relative;
}
.dl-days li.today::after {
  content: "";
  display: block;
  width: 60%;
  height: 2px;
  margin: 0.15rem auto 0;
  background: var(--red-bright);
}
.dl-days li.today.on::after {
  background: var(--gold-bright);
}
.dl-days li.pop .dia {
  animation: dl-stamp 0.7s cubic-bezier(0.2, 1.4, 0.4, 1) 0.2s both;
}
@keyframes dl-stamp {
  0% {
    transform: scale(2.4) rotate(-12deg);
    opacity: 0;
  }
  60% {
    transform: scale(0.92);
    opacity: 1;
  }
  to {
    transform: none;
  }
}
.dl-stat {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.3rem 1.6rem;
  margin-top: 0.8rem;
  font-size: 0.875rem;
  color: var(--ink-soft);
}
.dl-stat b {
  margin-right: 0.15em;
  font-family: var(--font-num);
  font-weight: var(--num-weight);
  font-size: 1.5rem;
  color: var(--gold-bright);
}
.dl-list {
  display: grid;
  gap: 0.8rem;
  margin-top: 1.2rem;
}
.dl-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  background: var(--paper);
}
.dl-item.done {
  border-color: var(--gold);
}
.dl-mark .dia {
  --s: 48px;
}
.dl-body h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.1rem 0.7rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.3;
}
.dl-body h2 small {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--gold-bright);
}
.dl-text {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--ink-soft);
}
.dl-status {
  margin-top: 0.35rem;
  font-size: 0.875rem;
  font-weight: 700;
}
.dl-item.done .dl-status {
  color: var(--gold-bright);
}
.dl-act .btn {
  white-space: nowrap;
}
.dl-left {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}
.dl-share {
  display: grid;
  justify-items: center;
  gap: 0.7rem;
  margin-top: 1.4rem;
}
.dl-share-lead {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gold-bright);
}
@media (max-width: 640px) {
  .dl-days {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    row-gap: 0.4rem;
  }
  .dl-item {
    grid-template-columns: 44px minmax(0, 1fr);
  }
  .dl-mark .dia {
    --s: 40px;
  }
  .dl-act {
    grid-column: 1 / -1;
  }
  .dl-act .btn {
    width: 100%;
  }
  .ln-cells {
    gap: 0.25rem;
  }
}

/* ---------- 今日のダンジョン(ロビーのルール・結果) ---------- */
.dg-day-tag {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.8rem 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--gold-bright);
}
.dg-day-tag .dia {
  --s: 40px;
}
.dg-day-cond {
  margin-top: 0.5rem;
  font-weight: 700;
}
.dg-day-acts {
  margin-top: 0.7rem;
}
.dg-day-share {
  margin: 0.4rem 0 0.8rem;
  text-align: center;
}
@media (prefers-reduced-motion: reduce) {
  .ln-cell.fresh,
  .dl-days li.pop .dia {
    animation: none;
  }
}

/* ---------- 祝福と呪い(prize.js) ----------
   得点カードはひし形: 祝福(プラス)= 金、呪い(マイナス)= 青、まだ見せない = 線だけの「?」。
   色は勝ち(金)・負け(青)の決まりと同じ向き。 */
.pr-dia {
  --s: 40px;
}
.pr-dia > b {
  font-size: calc(var(--s) * 0.34);
  letter-spacing: -0.02em;
}
.pr-dia.pr-s {
  --s: 30px;
}
.pr-dia.pr-big {
  --s: 58px;
}
.pr-dia.pr-m {
  --s: 42px;
}
.pr-dia.pr-curse > b {
  color: #fff;
}
.pr-dia.pr-hidden > b {
  color: var(--ink-soft);
}
/* ロビー */
.rule-prize {
  margin-top: 0.9rem;
}
.rule-prize h4 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.6rem;
  margin: 0.2rem 0 0.5rem;
  font-size: 0.9375rem;
}
.rule-prize h4 small {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gold-bright);
}
.seg-prize {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  max-width: 24rem;
}
.seg-prize button {
  padding-inline: 0.6em;
}
.pr-list {
  margin-top: 0.4rem;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}
.pr-list summary {
  width: fit-content;
  color: var(--gold-bright);
  cursor: pointer;
}
.pr-cards {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.1rem;
  margin: 0.4rem 0;
}
.rule-badge.rule-prize-badge {
  --rc: var(--gold-bright);
}
/* デッキ構築: このラウンドの5枚 */
.pr-plaque {
  width: min(100%, 560px);
  margin: 0.9rem auto 0;
  padding: 0.7rem 1rem 0.75rem;
  border: 1px solid var(--gold);
  background: linear-gradient(100deg, rgba(201, 162, 75, 0.16), #0b1438 70%);
  box-shadow: inset 0 0 0 3px #0b1438, inset 0 0 0 4px rgba(201, 162, 75, 0.45);
  text-align: center;
}
.pr-label {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 0.1rem 0.6rem;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.0625rem;
  color: var(--gold-bright);
}
.pr-label small {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--ink-soft);
}
.pr-set {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  margin: 0.45rem 0 0.2rem;
}
.pr-set .pr-dia {
  --s: 46px;
}
.pr-note {
  font-size: 0.8125rem;
  color: var(--ink-soft);
}
/* バトル: 発動中の効果の札 */
.eff-prize {
  --ec: var(--gold-bright);
}
.eff-prize-curse {
  --ec: var(--blue-bright);
}
.eff-prize-hidden {
  --ec: #c5cbe6;
}
.eff-prize .eff-art {
  display: grid;
  place-items: center;
}
/* 発動中の効果: このバトルの得点カードと、持ち越しの得点カードを横に並べる(2026年11月20日、くまねこ堂の指定) */
.pr-stack {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.pr-plus {
  font-family: var(--font-num);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ec);
}
.pr-carry {
  display: grid;
  justify-items: center;
  gap: 0.05rem;
}
.pr-carry-row {
  display: flex;
  gap: 0.05rem;
}
.pr-carry small {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}
/* 名前の横: このラウンドの得点(大きめ。2026年11月20日、くまねこ堂の指定で、小さくて見にくかったので大きく) */
.pr-pts {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.pr-pts small {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--gold-bright);
}
.pr-pts .pr-dia > b {
  font-size: calc(var(--s) * 0.38);
}
/* 公開の演出: だれが取ったか */
.pr-result {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.2rem 0.6rem;
  margin-top: 0.35rem;
  font-weight: 700;
  color: var(--gold-bright);
}
.pr-result.curse {
  color: var(--blue-bright);
}
.pr-result .pr-cards {
  margin: 0;
}
.pr-round .dia > b {
  font-size: calc(var(--s) * 0.34);
}
@media (max-width: 640px) {
  .seg-prize {
    grid-template-columns: 1fr;
  }
  .seg-prize button + button {
    border-top: 1px solid var(--line);
  }
  .pr-set .pr-dia {
    --s: 40px;
  }
}
/* 女神の祝福と邪神の呪い: ロビーの小見出しと、ラウンドの5枚を見せるか */
.pr-sub {
  margin: 0.6rem 0 0.35rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--ink-soft);
}
.seg-prize-set {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  max-width: 24rem;
}
.seg-prize-set button {
  display: grid;
  justify-items: center;
  gap: 0.05rem;
  padding: 0.45em 0.5em;
}
.seg-prize-set button small {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--gold-bright);
}
.pr-result.carry {
  color: var(--ink-soft);
}

/* ---------- レーン戦(3つの場でパワーの合計を競う) ----------
   場ごとの色(--wc): 属性の日はその属性、逆さの月 = 青、倍の夜 = 藤、静寂の森 = 苔、小さき星・白日の誓い = 金。
   合計のひし形は、いま場を取っている人 = 金、ほかは線(ひし形の決まりどおり)。カードのパワーは属性の色のひし形。 */
:where(.ln-lane, .ln-tile, .ln-btn, .ln-sum, .ln-result li, .ln-list li) {
  --wc: var(--gold-bright);
}
:where(.ln-lane, .ln-tile, .ln-btn, .ln-sum, .ln-list li, .ln-result li)[data-k="reverse"] {
  --wc: var(--blue-bright);
}
:where(.ln-lane, .ln-tile, .ln-btn, .ln-sum, .ln-list li, .ln-result li)[data-k="doubleFirst"] {
  --wc: #b9a6ff;
}
:where(.ln-lane, .ln-tile, .ln-btn, .ln-sum, .ln-list li, .ln-result li)[data-k="noAbilities"] {
  --wc: #8fc2ad;
}
.ln-seal {
  width: 34px;
  height: 34px;
}
.ln-seal::before {
  inset: 5px;
  background: color-mix(in srgb, var(--wc) 30%, #0b1438);
  box-shadow: 0 0 12px -2px var(--wc);
}
.ln-seal i {
  width: 12px;
  height: 12px;
  box-shadow: inset -4px 2px 0 0 var(--gold-bright);
}
.ln-no {
  --s: 26px;
}
.ln-help {
  margin: -0.1rem 0 0.4rem 3.4rem;
}
.ln-list > p {
  margin: 0.4rem 0;
  line-height: 1.7;
}
.ln-tag {
  display: inline-block;
  padding: 0 0.45em;
  border: 1px solid var(--wc);
  color: var(--wc);
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.ln-tag.ln-rev {
  border-color: var(--blue-bright);
  color: var(--blue-bright);
}
.tag-lane {
  background: #0b1438;
  color: var(--gold-bright);
  box-shadow: inset 0 0 0 1px var(--gold-bright);
}
.rule-lanes-badge {
  border-color: var(--gold-bright);
}

/* デッキ構築: このラウンドの3つの場 */
.ln-plaque {
  width: min(100%, 680px);
  margin: 0.9rem auto 0;
  padding: 0.7rem 0.9rem 0.75rem;
  border: 1px solid var(--gold);
  background: linear-gradient(180deg, rgba(201, 162, 75, 0.12), #0b1438 60%);
  box-shadow: inset 0 0 0 3px #0b1438, inset 0 0 0 4px rgba(201, 162, 75, 0.45);
  text-align: center;
}
.ln-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 0.55rem 0 0.35rem;
}
.ln-tile {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  gap: 0.1rem 0.35rem;
  padding: 0.45rem 0.55rem 0.55rem;
  border-top: 2px solid var(--wc);
  background: color-mix(in srgb, var(--wc) 10%, #0b1438);
  text-align: left;
}
.ln-tile .ln-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1rem;
  color: var(--wc);
  line-height: 1.25;
}
.ln-tile .ln-text {
  grid-column: 1 / -1;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--ink);
}

/* バトル: 場の盤 */
.ln-board {
  width: min(100%, 820px);
  margin: 0.7rem auto 0;
}
.ln-goal {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 0.9375rem;
  color: var(--gold-bright);
}
.ln-goal small {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--ink-soft);
}
.ln-lanes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}
.ln-lane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0.45rem 0.5rem 0.4rem;
  border: 1px solid color-mix(in srgb, var(--wc) 55%, var(--line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--wc) 16%, #0b1438), #0b1438 58%);
  box-shadow: 0 0 22px -14px var(--wc);
}
.ln-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.1rem 0.35rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid color-mix(in srgb, var(--wc) 45%, transparent);
}
.ln-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.35rem;
  min-width: 0;
}
.ln-title b {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 0.9375rem;
  color: var(--wc);
  line-height: 1.2;
}
.ln-head .ln-text {
  grid-column: 1 / -1;
  font-size: 0.6875rem;
  line-height: 1.45;
  color: var(--ink-soft);
}
.ln-rows {
  display: grid;
  gap: 0.15rem;
  padding-top: 0.25rem;
  flex: 1;
}
.ln-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.3rem;
  min-height: 34px;
  padding: 0.05rem 0.15rem 0.05rem 0.3rem;
}
.ln-row + .ln-row {
  border-top: 1px dashed rgba(197, 203, 230, 0.16);
}
.ln-row.mine {
  box-shadow: inset 2px 0 0 var(--red-bright);
  background: rgba(232, 88, 122, 0.07);
}
.ln-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  min-width: 0;
}
.ln-total {
  --s: 32px;
}
.ln-none {
  width: 32px;
  text-align: center;
  color: var(--ink-soft);
  opacity: 0.6;
}
.ln-lead {
  margin-top: 0.25rem;
  font-size: 0.6875rem;
  color: var(--ink-soft);
  text-align: center;
}
.ln-lane:has(.ln-row.lead) .ln-lead {
  color: var(--gold-bright);
}
/* カードのパワー(場に足した分): 属性の色のひし形 */
.ln-pw {
  --s: 24px;
  --elc: var(--el-none);
  position: relative;
  display: inline-grid;
  place-items: center;
  width: var(--s);
  height: var(--s);
  flex: none;
}
.ln-pw::before {
  content: "";
  position: absolute;
  inset: 14.6%;
  transform: rotate(45deg);
  background: var(--elc);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
.ln-pw > b {
  position: relative;
  font-family: var(--font-num, var(--font-display));
  font-size: 0.75rem;
  line-height: 1;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.ln-pw[data-el="fire"] {
  --elc: var(--el-fire);
}
.ln-pw[data-el="thunder"] {
  --elc: var(--el-thunder);
}
.ln-pw[data-el="water"] {
  --elc: var(--el-water);
}
.ln-pw[data-el="light"] {
  --elc: var(--el-light);
}
.ln-pw[data-el="dark"] {
  --elc: var(--el-dark);
}
.ln-pw[data-el="god"] {
  --elc: var(--el-god);
}
.ln-pw[data-el="god"] > b {
  color: #4a3305;
  text-shadow: none;
}
.ln-pw.out::before {
  background: none;
  box-shadow: inset 0 0 0 1.5px var(--ink-soft);
}
.ln-pw.out > b {
  color: var(--ink-soft);
  text-shadow: none;
}
/* 名前の横の、いま取っている場の数 */
.ln-pts {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
}
.ln-pts .dia {
  --s: 26px;
}
.ln-pts small {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--ink-soft);
}

/* 操作欄: 置く場のボタン */
.dock-lanes {
  flex: 1 1 520px;
}
.ln-pick {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  flex: 1 1 420px;
}
.ln-btn {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.5rem 0.4rem 0.3rem;
  border: 1px solid color-mix(in srgb, var(--wc) 70%, var(--line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--wc) 14%, #0b1438), #0b1438);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.ln-btn:hover,
.ln-btn:focus-visible {
  border-color: var(--red-bright);
  box-shadow: 0 0 0 1px var(--red-bright), 0 0 16px -6px var(--red-bright);
}
.ln-btn-body {
  display: grid;
  min-width: 0;
}
.ln-btn-body b {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 0.875rem;
  color: var(--wc);
  line-height: 1.25;
}
.ln-btn-body small {
  font-size: 0.6875rem;
  color: var(--ink-soft);
  line-height: 1.4;
}
.ln-btn-body em {
  display: block;
  font-style: normal;
  font-weight: 700;
  color: var(--gold-bright);
}

.ln-head .ln-flip,
.ln-result .ln-flip {
  color: var(--blue-bright);
}
.ln-result .ln-flip {
  flex-basis: 100%;
  text-align: center;
}
.ln-void {
  margin-top: 0.35rem;
  font-weight: 700;
  color: var(--ink-soft);
  text-align: center;
}
.ln-note {
  margin-top: 0.3rem;
  color: var(--gold-bright);
}
/* レーン戦: 場ごとのバトルの結果(2026年11月20日、くまねこ堂の指定「バトル相手を同じ場に置いた人だけにする」)。
   場ごとに1行(場の札・勝った人 / 引き分け / 相手なし)。公開のカードには「場N」の札、相手のいなかったカードは「相手なし」 */
.ln-battles {
  display: grid;
  justify-content: center;
  gap: 0.3rem;
  margin-top: 0.2rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(0.9375rem, 2.8vw, 1.15rem);
  animation: rise 0.4s ease both;
  animation-delay: calc(1.7s + var(--wait, 0s));
}
/* 場の札は左に固定し、文が長いときは文だけ折り返す(スマホで札だけが1行になるのを防ぐ) */
.ln-battles li {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  text-align: left;
}
.ln-battles li > span:last-child {
  min-width: 0;
}
.ln-battles b {
  color: var(--gold);
}
.ln-battles li.alone,
.ln-battles li.even {
  color: var(--ink-soft);
}
.ln-lb-lane {
  flex: none;
  white-space: nowrap;
  padding: 0 0.5em;
  border: 1px solid var(--gold);
  font-family: var(--font-body);
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--gold-bright);
}
/* 公開の演出(レーン戦): 場ごとの枠。同じ枠のカードどうしでバトルする(カードの間に「VS」)。
   枠の色は場の色(--wc)。1段ずつ見せるとき、いま比べている場の枠は光る(.ln-now)。
   負けたカードは暗くしない(場にはパワーを足すため。2026年11月20日、くまねこ堂の指定) */
.show-lanes {
  align-items: stretch;
  gap: clamp(0.3rem, 1.6vw, 1.4rem);
}
/* 枠の余白のぶん、3〜4人のカードは少し小さく(スマホの画面に収まるように) */
.show-lanes[data-n="3"] {
  --scw: clamp(76px, 22vw, 170px);
}
.show-lanes[data-n="4"] {
  --scw: clamp(58px, 17vw, 140px);
}
:where(.ln-arena) {
  --wc: var(--gold-bright);
}
.ln-arena {
  --ag: clamp(1.4rem, 6vw, 4.5rem);
  /* 横の余白は、勝ったカードの V 字(.sc-main の --vx)が枠に当たらない幅 */
  --ap: clamp(0.75rem, 3.4vw, 2.6rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: none;
  /* 枠の幅はカードの列で決まる(場の名前が長いときは、名前のほうを折り返す) */
  width: min-content;
  padding: 0.35rem var(--ap) 0.6rem;
  border: 1px solid color-mix(in srgb, var(--wc) 60%, var(--line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--wc) 16%, #0b1438), rgba(11, 20, 56, 0.55) 34%);
  box-shadow: inset 0 0 0 3px rgba(11, 20, 56, 0.9), inset 0 0 0 4px color-mix(in srgb, var(--wc) 30%, transparent), 0 0 26px -12px var(--wc);
  animation: rise 0.4s ease both;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}
.ln-arena[data-k="reverse"] {
  --wc: var(--blue-bright);
}
.ln-arena[data-k="doubleFirst"] {
  --wc: #b9a6ff;
}
.ln-arena[data-k="noAbilities"] {
  --wc: #8fc2ad;
}
.show-cards[data-n="3"] .ln-arena,
.show-cards[data-n="4"] .ln-arena {
  --ag: clamp(0.8rem, 3.2vw, 3rem);
  --ap: clamp(0.4rem, 2vw, 1.9rem);
}
.show-cards[data-n="4"] .ln-arena {
  --ap: clamp(0.4rem, 1.6vw, 1.3rem);
}
.ln-arena.ln-now {
  border-color: var(--wc);
  box-shadow: inset 0 0 0 3px rgba(11, 20, 56, 0.9), inset 0 0 0 4px var(--wc), 0 0 30px -4px var(--wc);
}
/* 見出しは「場N」の札と場の名前の2行(枠ごとに高さがそろう) */
.ln-arena-head {
  display: grid;
  justify-items: center;
  gap: 0.2rem;
  margin-bottom: 1.1rem;
  text-align: center;
}
.ln-arena-head .ln-lb-lane {
  font-size: clamp(0.75rem, 2.2vw, 0.875rem);
  font-weight: 700;
}
.ln-arena-head > b {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(0.875rem, 2.8vw, 1.3rem);
  line-height: 1.25;
  color: var(--wc);
}
.show-cards[data-n="4"] .ln-arena-head > b {
  font-size: clamp(0.75rem, 2.6vw, 1.15rem);
}
.ln-arena-tag {
  margin-top: auto;
  padding-top: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink-soft);
  white-space: nowrap;
}
/* 名前の札は、枠の内側に収める(1枚だけの枠でも、はみ出さない) */
.ln-arena .sc-who {
  max-width: calc(100% + 2 * var(--ap) - 6px);
}
/* スマホの4人戦は、札が狭いのでアイコンを隠して名前を見せる */
@media (max-width: 560px) {
  .show-lanes[data-n="4"] .sc-who .av {
    display: none;
  }
}
.ln-arena-cards {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: var(--ag);
}
.ln-arena-cards > .sc {
  position: relative;
}
/* 同じ場のカードの間の「VS」(カードの高さの真ん中) */
.ln-arena-cards > .sc + .sc::before {
  content: "VS";
  position: absolute;
  z-index: 5;
  left: calc(var(--ag) / -2);
  top: calc(1.95rem + var(--scw) * 0.7);
  transform: translate(-50%, -50%);
  padding: 0.1em 0.35em;
  border: 1px solid var(--wc);
  background: #0b1438;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(0.6875rem, 2vw, 1rem);
  line-height: 1.2;
  letter-spacing: 0.04em;
  color: var(--wc);
  box-shadow: 0 0 12px -2px var(--wc);
}
.show-lanes .sc-lose .flip-front > img {
  animation: none;
}
.out-alone {
  --out: var(--ink-soft);
  --out-glow: rgba(197, 203, 230, 0.35);
}
.out-alone .out-word {
  font-family: var(--font-body);
  font-size: clamp(0.875rem, 2.6vw, 1.1rem);
  letter-spacing: 0.04em;
}

/* 公開の演出: だれがどの場に足したか */
.ln-result {
  display: grid;
  justify-content: center;
  gap: 0.15rem;
  margin-top: 0.4rem;
}
.ln-result li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.1rem 0.5rem;
  font-size: 0.875rem;
}
.ln-result li > span:not(.dia) {
  color: var(--wc);
  font-weight: 700;
}
.ln-result li small {
  color: var(--ink-soft);
}
.ln-add {
  --s: 30px;
}
.ln-add > b {
  font-size: 0.75rem;
}

/* ラウンドの結果: 場ごとの合計 */
.ln-sums {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  width: min(100%, 640px);
  margin: 0.7rem auto 0.2rem;
  text-align: left;
}
.ln-sum {
  padding: 0.4rem 0.5rem 0.45rem;
  border-top: 2px solid var(--wc);
  background: color-mix(in srgb, var(--wc) 9%, transparent);
}
.ln-sum-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.35rem;
  margin-bottom: 0.2rem;
}
.ln-sum-head b {
  font-family: var(--font-display);
  font-size: 0.875rem;
  color: var(--wc);
}
.ln-sum ul {
  display: grid;
  gap: 0.05rem;
}
.ln-sum li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: var(--ink-soft);
}
.ln-sum li.none {
  grid-template-columns: 1fr;
}
.ln-sum .ln-who-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ln-sum li.lead {
  color: var(--ink);
  font-weight: 700;
}
.ln-sum li .dia {
  --s: 26px;
}
.ln-sum-who {
  margin-top: 0.15rem;
  font-size: 0.6875rem;
  color: var(--gold-bright);
}

@media (max-width: 640px) {
  .ln-lanes,
  .ln-tiles,
  .ln-sums {
    gap: 0.3rem;
  }
  .ln-lane {
    padding: 0.35rem 0.3rem 0.3rem;
  }
  .ln-title b {
    font-size: 0.8125rem;
  }
  .ln-head .ln-text {
    font-size: 0.625rem;
  }
  .ln-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.15rem;
    padding-left: 0.2rem;
  }
  .ln-row .av {
    display: none;
  }
  .ln-pw {
    --s: 21px;
  }
  .ln-pw > b {
    font-size: 0.6875rem;
  }
  .ln-total {
    --s: 28px;
  }
  .ln-tile {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 0.35rem 0.4rem 0.45rem;
  }
  .ln-tile .ln-seal {
    display: none;
  }
  .ln-tile .ln-name {
    font-size: 0.875rem;
  }
  .ln-tile .ln-text {
    font-size: 0.6875rem;
  }
  .ln-pick {
    grid-template-columns: 1fr;
    flex-basis: 100%;
  }
  .ln-btn-body small {
    display: flex;
    flex-wrap: wrap;
    gap: 0 0.6em;
  }
  .ln-btn-body em {
    display: inline;
  }
}

/* =====================================================================
   遊び方の整理(2026年11月19日): トップの3つの扉・遊び方の一覧・ロビーの遊び方
   トップ: はじめての方へ(チュートリアルを終えるまで。点線の金)→ 対戦する(右にカードの絵を敷いた、いちばん大きな扉)
           → ひとりで挑む(5つの絵。押すと一覧を「1人」で開く)→ 今日のチャレンジ(金の縁。3つのひし形は、今日終えたものが金)。
   遊び方の一覧(modes.js): 3つのまとまりに、同じ形の札。遊んだことがある札は、絵の右上のひし形が金。
           人数を選ぶと、その人数で遊べない札は点線で薄く。
   ロビー(lobbymode.js): 遊び方の帯 → おすすめの遊び方(2列の札)→ いまのルール(読むだけの表)→ 細かく決める(開くとタブ)。
           「遊び方を変える」でルール欄が「遊び方を選ぶ」に替わる(9つの札。人数が足りない札は点線)。
   ===================================================================== */
.door-tut {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border: 1px dashed var(--gold-bright);
  background: rgba(240, 212, 138, 0.07);
}
.door-tut .dia {
  --s: 32px;
}
.door-tut-text {
  display: grid;
  gap: 0.1rem;
  flex: 1;
  min-width: 0;
}
.door-tut-text b {
  font-size: 0.875rem;
  color: var(--gold-bright);
}
.door-tut-text small {
  font-size: 0.75rem;
  color: var(--on-night-soft);
}
.door-tut .btn {
  flex: none;
  min-height: 40px;
  padding: 0.3em 1em;
}
.door {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--night-line);
  background: var(--night-2);
  color: var(--on-night);
  font: inherit;
  text-align: left;
}
button.door {
  cursor: pointer;
  transition: border-color 0.15s;
}
button.door:hover {
  border-color: var(--gold);
}
.door-versus {
  border-color: var(--gold);
}
.door-art {
  position: absolute;
  top: 0;
  right: 0;
  width: 62%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
}
.door-versus::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--night-2) 40%, rgba(10, 16, 48, 0.55) 70%, rgba(10, 16, 48, 0.2));
  pointer-events: none;
}
.door-in {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.6rem;
  padding: 1rem 1.1rem 0.4rem;
}
.door-head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}
.door-head h2,
.door-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.625rem;
  line-height: 1.2;
  color: var(--on-night);
}
.door-text {
  max-width: 17em;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--on-night-soft);
}
.door .entry-acts {
  max-width: 360px;
}
.door-link {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--gold-bright);
  font-size: 0.8125rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.door-link:hover {
  color: var(--gold-pale);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.door-chev {
  flex: none;
}
.door-solo {
  display: grid;
  gap: 0.65rem;
  padding: 0.9rem 1.1rem 1rem;
}
.door-solo .door-title {
  font-size: 1.375rem;
}
/* 「ふたり以上で」の横の「(CPUを入れて1人でも遊べます)」 */
.door-title-sub {
  display: inline-block;
  margin-left: 0.35em;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.8125rem;
  color: var(--on-night-soft);
  vertical-align: 0.15em;
}
@media (max-width: 560px) {
  .door-title-sub {
    display: block;
    margin: 0.15rem 0 0;
    font-size: 0.75rem;
    word-break: auto-phrase;
  }
}
.door-solo .door-head {
  align-items: center;
}
.door-solo .door-head .door-chev {
  width: 16px;
  height: 16px;
  margin-left: auto;
  color: var(--gold-bright);
}
.door-thumbs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.4rem;
}
.door-thumb {
  display: grid;
  align-content: start;
  gap: 0.25rem;
}
.door-thumb img {
  display: block;
  width: 100%;
  height: 56px;
  object-fit: cover;
  border: 1px solid var(--night-line);
}
.door-thumb small {
  font-size: 0.6875rem;
  line-height: 1.3;
  color: var(--on-night-soft);
  /* 2行になるときは、ことばの切れ目で(「今日の / チャレンジ」。対応していないブラウザは、いままでどおり) */
  word-break: auto-phrase;
  overflow-wrap: anywhere;
}
.door-daily {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem 1.1rem;
  border-color: var(--gold-bright);
  background: linear-gradient(100deg, rgba(240, 212, 138, 0.16), var(--night-2) 70%);
}
button.door-daily:hover {
  border-color: var(--gold-pale);
}
.door-daily-art {
  width: 72px;
  height: 72px;
  flex: none;
  object-fit: cover;
  border: 1px solid var(--gold-bright);
}
.door-daily-text {
  display: grid;
  gap: 0.2rem;
  flex: 1;
  min-width: 0;
}
.door-daily .door-title {
  font-size: 1.25rem;
  color: var(--gold-bright);
}
.door-daily-text small {
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--on-night-soft);
}
.door-daily-text .door-daily-sum {
  font-weight: 700;
  color: var(--gold-bright);
}
.door-stamps {
  display: flex;
  flex: none;
  gap: 10px;
  padding-right: 3px;
}
.door-stamps i {
  width: 13px;
  height: 13px;
  transform: rotate(45deg);
  border: 1.5px solid var(--gold-bright);
}
.door-stamps i.on {
  background: var(--gold-bright);
}
/* トップの右の列(2026年11月20日、くまねこ堂の指定「左と右の高さをそろえたい」): カード紹介 → 今日のチャレンジ → 今日の1パック。
   PC では左の列(ロゴ・入口)と上下をそろえる: 2つの列を同じ高さに伸ばし、右はカード紹介の額、左は入口の枠が伸びる(中身は額の真ん中・枠の上) */
.hero-side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}
.home-side {
  display: grid;
  gap: 1rem;
}
@media (min-width: 901px) {
  .hero-in {
    align-items: stretch;
    grid-template-areas: "head head" "entry side";
    row-gap: 1.75rem;
  }
  .hero-copy {
    display: contents;
  }
  .hero-head {
    grid-area: head;
  }
  /* 左の列が短いときは、余った高さを「対戦する」の扉が受け持つ(枠の下に空きを作らない。扉の中身は上下の真ん中) */
  .home .entry {
    grid-area: entry;
    display: flex;
    flex-direction: column;
  }
  .home .entry > .door-versus {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .hero-side {
    grid-area: side;
  }
  .hero-side .duel {
    flex: 1 1 auto;
    align-content: center;
  }
}
/* スマホ: ロゴ → カード紹介 → 入口 → 今日のチャレンジ・今日の1パック の順(右の列の入れ物は外す) */
@media (max-width: 900px) {
  .hero-side {
    display: contents;
  }
  .home-side {
    order: 4;
  }
}
/* 遊び方の一覧を「ふたり以上で」から開いたとき、送った先のまとまりの上に少し余白 */
.md-group {
  scroll-margin-top: 0.75rem;
}
/* 対戦する の扉: ルームをつくるのすぐ下に、ルーム番号で入室(同日、くまねこ堂の指定) */
.door-versus .door-in {
  padding-bottom: 1rem;
}
.door-versus .entry-or {
  margin-top: 0.2rem;
  padding-top: 0.75rem;
}
.door-versus .entry-join {
  max-width: 360px;
}
.door-versus .entry-note {
  font-size: 0.75rem;
  line-height: 1.6;
}
@media (max-width: 420px) {
  .door-in,
  .door-solo,
  .door-daily {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }
  .door-head h2 {
    font-size: 1.4375rem;
  }
  .door-daily-art {
    width: 56px;
    height: 56px;
  }
  .door-stamps {
    flex-direction: column;
    gap: 9px;
  }
}

/* ---------- 今日の1パック(ログインボーナス。collection.js。2026年11月20日、くまねこ堂の指定) ----------
   今日のチャレンジの下。まだ開けていなければ4つの弾の袋を小さく扇に、開けたら今日出たカードを並べる。確定の日(7日ごと・30日ごと)は金の光 */
.door-pack {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem 0.9rem;
  padding: 0.8rem 1.1rem;
  border-color: var(--gold);
  background: linear-gradient(100deg, rgba(240, 212, 138, 0.1), var(--night-2) 60%);
}
.door-pack.is-sr,
.door-pack.is-sp,
.door-pack.is-ur {
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 1px rgba(240, 212, 138, 0.3), 0 0 22px -6px rgba(240, 212, 138, 0.65);
}
.pk-bags {
  position: relative;
  flex: none;
  width: 72px;
  height: 64px;
}
.pk-bags img {
  position: absolute;
  bottom: 0;
  width: 32px;
  height: 50px;
  object-fit: cover;
  border: 1px solid #b9c0cc;
  box-shadow: 0 3px 8px -2px rgba(0, 0, 0, 0.6);
  transform-origin: 50% 100%;
}
.pk-bags img:nth-child(1) {
  left: 0;
  transform: rotate(-13deg);
}
.pk-bags img:nth-child(2) {
  left: 13px;
  transform: rotate(-4deg) translateY(-3px);
}
.pk-bags img:nth-child(3) {
  left: 26px;
  transform: rotate(5deg) translateY(-3px);
}
.pk-bags img:nth-child(4) {
  left: 39px;
  transform: rotate(14deg);
}
.pk-cards {
  display: flex;
  flex: none;
  gap: 4px;
}
.pk-cards .card {
  --cw: 40px;
}
/* おまけも開けた日(4枚)は2列に詰める */
.pk-cards.many {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 3px;
}
.pk-cards.many .card {
  --cw: 30px;
}
.pk-text {
  display: grid;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
}
.door-pack .door-title {
  font-size: 1.25rem;
  color: var(--gold-bright);
}
.pk-text small {
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--on-night-soft);
}
.pk-text .pk-sub {
  font-weight: 700;
  color: var(--on-night);
}
.door-pack.is-sr .pk-sub,
.door-pack.is-sp .pk-sub,
.door-pack.is-ur .pk-sub,
.pk-text .pk-bonus.ready {
  font-weight: 700;
  color: var(--gold-bright);
}
.pk-acts {
  display: grid;
  flex: none;
  gap: 0.4rem;
}
.pk-acts:empty {
  display: none;
}
@media (max-width: 480px) {
  .door-pack {
    grid-template-columns: auto minmax(0, 1fr);
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }
  .pk-cards:not(.many) .card {
    --cw: 34px;
  }
  .pk-acts {
    grid-column: 1 / -1;
    grid-auto-flow: column;
    justify-content: end;
  }
}

/* ---------- 遊び方の一覧(モーダル) ---------- */
.modal-modes {
  width: min(100%, 1120px);
}
.modes {
  display: grid;
  gap: 1.15rem;
}
.md-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.8rem 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(201, 162, 75, 0.45);
}
.md-head h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.75rem;
  line-height: 1.25;
}
.md-head p {
  margin-top: 0.3rem;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}
.md-progress {
  display: grid;
  justify-items: end;
  gap: 0.5rem;
  margin-left: auto;
  padding-right: 2.5rem;
}
.md-rail {
  display: flex;
  gap: 7px;
}
.md-rail i {
  width: 9px;
  height: 9px;
  transform: rotate(45deg);
  border: 1px solid var(--ink-soft);
}
.md-rail i.on {
  border-color: var(--gold-bright);
  background: var(--gold-bright);
}
.md-progress small {
  font-size: 0.75rem;
  color: var(--ink-soft);
}
.md-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.8rem;
}
.md-filter > span {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--ink-soft);
}
.md-filter small {
  font-size: 0.8125rem;
  color: var(--gold-bright);
}
.md-n {
  border-color: var(--gold);
  border-radius: 0;
}
.md-n button {
  min-width: 3.5em;
  padding-left: 0.9em;
  padding-right: 0.9em;
  white-space: nowrap;
}
.md-group {
  display: grid;
  gap: 0.7rem;
}
.md-group h3 {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.125rem;
}
.md-group h3 small {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-soft);
}
.md-group h3::after {
  content: "";
  flex: 1;
  align-self: center;
  height: 1px;
  background: rgba(201, 162, 75, 0.3);
}
.md-tiles {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.75rem;
}
.md-item {
  display: flex;
}
.md-tile {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--night-2);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, opacity 0.15s;
}
.md-tile:hover {
  border-color: var(--gold);
}
.md-art {
  position: relative;
  display: block;
  flex: none;
  height: 92px;
  overflow: hidden;
}
.md-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.md-stamp {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 13px;
  height: 13px;
  transform: rotate(45deg);
  border: 1.5px solid var(--ink);
  background: rgba(10, 16, 48, 0.55);
}
/* おすすめのリボン(遊び方の一覧・遊び方を選ぶ の札の絵の左上。2026年11月20日) */
.md-pick {
  position: absolute;
  top: 7px;
  left: 0;
  padding: 0.15em 0.7em 0.15em 0.55em;
  background: var(--rose);
  clip-path: polygon(0 0, 100% 0, calc(100% - 7px) 50%, 100% 100%, 0 100%);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  color: #fff6dc;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.rp-art .md-pick {
  top: 4px;
  font-size: 0.625rem;
}
.md-tile.played .md-stamp {
  border-color: var(--gold-bright);
  background: var(--gold-bright);
  box-shadow: 0 0 0 2px var(--night-2);
}
.md-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.6rem 0.7rem 0.7rem;
}
.md-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.3;
}
.md-text {
  flex: 1;
  font-size: 0.75rem;
  line-height: 1.55;
  color: var(--ink-soft);
}
.md-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.45rem;
}
.md-time {
  display: inline-flex;
  align-items: center;
  font-size: 0.6875rem;
  color: var(--ink-soft);
}
.md-time .dia {
  --s: 26px;
}
.md-go {
  margin-left: auto;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--gold-bright);
}
.md-rec {
  font-size: 0.6875rem;
  line-height: 1.4;
  color: var(--ink-soft);
}
.md-tile.played .md-rec {
  color: var(--gold-bright);
}
.md-item.off .md-tile {
  border-style: dashed;
  opacity: 0.38;
}
.md-item.off .md-tile:hover,
.md-item.off .md-tile:focus-visible {
  opacity: 0.75;
}
.md-note {
  grid-column: span 3;
  align-self: start;
  padding: 0.8rem 1rem;
  border: 1px dashed rgba(201, 162, 75, 0.5);
  font-size: 0.8125rem;
  line-height: 1.65;
  color: var(--ink-soft);
}
.md-note b {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--gold-bright);
}
@media (max-width: 1000px) {
  .md-tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .md-note {
    grid-column: 1 / -1;
  }
}
@media (max-width: 560px) {
  .md-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
  }
  .md-art {
    height: 72px;
  }
  .md-head h2 {
    font-size: 1.375rem;
  }
  .md-progress {
    justify-items: start;
    margin-left: 0;
    padding-right: 0;
  }
  .md-rail {
    gap: 5px;
  }
  .md-body {
    padding: 0.5rem 0.55rem 0.6rem;
  }
  .md-go {
    margin-left: 0;
    width: 100%;
  }
  .md-n button {
    min-width: 0;
    padding-left: 0.75em;
    padding-right: 0.75em;
  }
}
@media (prefers-reduced-motion: reduce) {
  button.door,
  .md-tile {
    transition: none;
  }
}

/* ---------- ロビーのルール欄 ---------- */
.lm-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.8rem;
  margin-top: 0.6rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line);
  background: var(--night-2);
}
.lm-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gold-bright);
}
.lm-cur {
  display: grid;
  flex: 1;
  gap: 0.15rem;
  min-width: 10em;
}
.lm-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.lm-name b {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.125rem;
}
.lm-cur small {
  font-size: 0.75rem;
  color: var(--ink-soft);
}
.lm-change {
  flex: none;
}
.lm-chev {
  flex: none;
}
.lm-hint {
  margin-top: 0.4rem;
  font-size: 0.75rem;
  color: var(--ink-soft);
}
.lm-sec {
  display: grid;
  gap: 0.6rem;
  margin-top: 1.2rem;
}
.lm-sec-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.7rem;
}
.rulebox .lm-sec-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.0625rem;
  letter-spacing: 0;
  color: var(--ink);
}
.lm-sec-head small {
  font-size: 0.75rem;
  color: var(--ink-soft);
}
.lm-rule-line::after {
  content: "";
  flex: 1;
  align-self: center;
  height: 1px;
  background: rgba(201, 162, 75, 0.3);
}
/* 「いまのルール」の線の右に「ルールをリセット」(ホストだけ。1回目で赤い縁の「もう一度押すとリセット」) */
.lm-reset {
  order: 2;
  align-self: center;
  min-height: 30px;
  padding: 0.2em 0.8em;
  font-size: 0.75rem;
}
.lm-reset:disabled {
  opacity: 0.4;
  cursor: default;
}
.lm-reset.armed {
  border-color: var(--red-bright);
  color: var(--red-bright);
}
.lm-recipes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}
.lm-recipe {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.lm-recipe:hover {
  border-color: var(--gold);
}
/* おすすめの遊び方の絵(札の上いっぱいに。遊び方の一覧と同じ絵) */
.lm-recipe-art {
  display: block;
  align-self: stretch;
  aspect-ratio: 16 / 5;
  margin: -0.7rem -0.85rem 0.2rem;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.lm-recipe-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  transition: transform 0.25s ease;
}
.lm-recipe:hover .lm-recipe-art img {
  transform: scale(1.04);
}
.lm-recipe.on .lm-recipe-art {
  border-bottom-color: var(--gold-bright);
}
@media (prefers-reduced-motion: reduce) {
  .lm-recipe-art img {
    transition: none;
  }
}
.lm-recipe.on {
  border-color: var(--gold-bright);
  background: rgba(240, 212, 138, 0.13);
  box-shadow: inset 0 0 0 1px var(--gold-bright);
}
.lm-recipe.lm-weekly:not(.on) {
  border-color: var(--gold);
}
.lm-recipe-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.lm-recipe-head b {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1rem;
}
.lm-recipe.on .lm-recipe-head b {
  color: var(--gold-bright);
}
.lm-recipe > small {
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--ink-soft);
}
.lm-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.lm-tag,
.lm-new,
.lm-rank {
  padding: 0 0.45em;
  border: 1px solid var(--ink-soft);
  font-size: 0.6875rem;
  line-height: 1.6;
  color: var(--ink-soft);
}
.lm-tag-gold,
.lm-rank {
  border-color: var(--gold-bright);
  color: var(--gold-bright);
}
.lm-tag-casual {
  border-color: var(--casual);
  color: var(--casual);
}
.lm-tag-limited {
  border-color: var(--limited);
  color: var(--limited);
}
.lm-new {
  border-color: var(--rose);
  background: var(--rose);
  color: #fff;
  font-weight: 700;
}
.lm-rank {
  font-weight: 700;
}
.lm-now {
  display: grid;
  grid-template-columns: minmax(7.5em, auto) minmax(0, 1fr);
  margin: 0;
  border-top: 1px solid var(--line);
}
.lm-now dt,
.lm-now dd {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}
.lm-now dt {
  display: flex;
  align-items: center;
  padding-right: 1rem;
  font-size: 0.75rem;
  color: var(--ink-soft);
}
.lm-now dd {
  margin: 0;
  font-size: 0.875rem;
}
.lm-now .lm-casual {
  color: var(--casual);
}
.lm-now .lm-limited {
  color: var(--limited);
}
/* 細かく決める(いつも開いた形。見出しは「いまのルール」と同じ線つき) */
.lm-more-note {
  margin: -0.3rem 0 0;
  font-size: 0.75rem;
  color: var(--ink-soft);
}
.rule-more {
  margin-top: 0.3rem;
}
@media (max-width: 480px) {
  .lm-recipes {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- 遊び方を選ぶ(ルール欄が替わる) ---------- */
.rp {
  display: grid;
  gap: 0.9rem;
  margin-top: 0.6rem;
}
.rp-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--gold);
}
.rp-back {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  background: none;
  color: var(--ink);
  cursor: pointer;
}
.rp-back:hover {
  border-color: var(--gold);
}
.rulebox .rp-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.25rem;
  letter-spacing: 0;
  color: var(--ink);
}
.rp-head small {
  font-size: 0.75rem;
  color: var(--ink-soft);
}
.rp-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}
.rp-cards li {
  display: flex;
}
.rp-card {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  padding: 0;
  border: 1px solid var(--line);
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.rp-card:hover {
  border-color: var(--gold);
}
.rp-card.on {
  border-color: var(--gold-bright);
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--gold-bright);
}
.rp-card.short {
  border-style: dashed;
}
.rp-art {
  position: relative;
  display: block;
  flex: none;
  height: 64px;
  overflow: hidden;
}
.rp-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.rp-card.short img {
  opacity: 0.35;
}
.rp-mark {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 14px;
  height: 14px;
  transform: rotate(45deg);
  border: 1.5px solid var(--ink);
  background: rgba(10, 16, 48, 0.55);
}
.rp-card.on .rp-mark {
  border-color: var(--gold-bright);
  background: var(--gold-bright);
  box-shadow: 0 0 0 2px var(--night-2);
}
.rp-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem 0.6rem 0.6rem;
}
.rp-body b {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 0.9375rem;
  line-height: 1.3;
}
.rp-card.on .rp-body b {
  color: var(--gold-bright);
}
.rp-card.short .rp-body b,
.rp-card.short .rp-players {
  color: #8a92b8;
}
.rp-players {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--blue-bright);
}
.rp-text {
  font-size: 0.6875rem;
  line-height: 1.5;
  color: var(--ink-soft);
}
.rp-detail {
  display: grid;
  gap: 0.4rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(240, 212, 138, 0.55);
  background: var(--night-2);
}
.rp-detail h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1rem;
  color: var(--gold-bright);
}
.rp-detail .rule-row {
  padding: 0;
  border-bottom: 0;
}
.rp-detail .rule-row > h3 {
  display: none;
}
/* 遊び方の設定(ルール欄の上。2026年11月20日): 遊び方を選ぶ の下の枠と同じ見た目で、いまの遊び方の決めることを出す */
.lm-mode-body {
  display: grid;
  gap: 0.4rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(240, 212, 138, 0.55);
  background: var(--night-2);
}
.lm-mode-body .rule-row {
  padding: 0;
  border-bottom: 0;
}
.lm-mode-body .rule-row > h3 {
  display: none;
}
.rp-dl {
  display: grid;
  grid-template-columns: 5.5em minmax(0, 1fr);
  gap: 0.3rem 0.7rem;
  margin: 0.4rem 0 0;
  padding-top: 0.6rem;
  border-top: 1px solid var(--line);
  font-size: 0.8125rem;
}
.rp-dl dt {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold-bright);
}
.rp-dl dd {
  margin: 0;
}
.rp-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
}
.rp-foot small {
  flex: 1;
  min-width: 12em;
  font-size: 0.75rem;
  color: var(--ink-soft);
}
@media (max-width: 480px) {
  .rp-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* =====================================================================
   カードの記録(cardrec.js。2026年11月19日): 使用回数・勝率・引いた回数・MVP の順位。
   順位のバッジ: 1位 = 金・2位 = 銀・3位 = 銅のひし形(数字はひし形の中)、4位から = 線のひし形。
   戦績のタブ「カードの記録」: 上位3枚の表彰台(2位・1位・3位の順、1位がいちばん高い)と、全部のカードの行(使用回数の棒 = 青、勝率の棒 = 金)。
   ===================================================================== */
.rk {
  --s: 30px;
}
.rk-1::before {
  background: linear-gradient(135deg, #fbefc4 0%, #e6c77a 30%, var(--gold) 60%, #9d7631 100%);
}
.rk-1 > b {
  color: var(--night-2);
}
.rk-1 {
  filter: drop-shadow(0 0 5px rgba(240, 212, 138, 0.55));
}
.rk-2::before {
  background: linear-gradient(135deg, #eef1f8 0%, #c3cad8 35%, #959eb4 65%, #687189 100%);
}
.rk-2 > b {
  color: #141a33;
}
.rk-3::before {
  background: linear-gradient(135deg, #f0bf95 0%, #c8834d 35%, #a15e2d 65%, #6c3a17 100%);
}
.rk-3 > b {
  color: #fff4e8;
}
.rk-none::before {
  background: none;
  box-shadow: inset 0 0 0 1px var(--line);
}
.rk-none > b {
  color: var(--ink-soft);
}
.rec-rank li > .rk {
  grid-area: no;
}
.rec-rank-sub {
  grid-area: sub;
  align-self: start;
  font-size: 0.6875rem;
  color: var(--ink-soft);
}
.rec-rank h4 small {
  margin-left: 0.5em;
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--ink-soft);
}
.rec-cards-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.75rem;
}
.rec-cards-head h3 {
  margin: 0;
}
.rec-cards-head h3 small {
  margin-left: 0.7em;
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ink-soft);
}
.cr-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1rem;
  margin: 0.25rem 0 0.5rem;
}
.cr-total {
  font-size: 0.8125rem;
  color: var(--ink-soft);
}
.cr-sort {
  border-color: var(--gold);
  border-radius: 0;
}
.cr-sort button {
  min-height: 36px;
  padding: 0.3em 0.9em;
  white-space: nowrap;
}
.cr-podium {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(0.75rem, 4vw, 2.25rem);
  margin: 0 0 1rem;
  padding: 1.6rem 0 1rem;
  list-style: none;
  border-bottom: 1px solid rgba(201, 162, 75, 0.3);
}
.cr-place {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0.3rem;
  width: clamp(80px, 17vw, 112px);
}
.cr-place.rk-row-1 {
  width: clamp(96px, 21vw, 140px);
  margin-bottom: 1rem;
}
.cr-place .card {
  --cw: 100%;
  width: 100%;
}
.cr-place.rk-row-1 .card {
  box-shadow: 0 0 0 2px var(--gold-bright), 0 0 22px rgba(240, 212, 138, 0.45);
}
.cr-medal {
  position: absolute;
  top: -18px;
  left: 50%;
  z-index: 2;
  translate: -50% 0;
  --s: 40px;
}
.cr-place .cr-name {
  max-width: 100%;
  overflow: hidden;
  font-size: 0.8125rem;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cr-val {
  font-family: var(--font-num);
  font-size: 1.125rem;
  color: var(--gold-bright);
}
.cr-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cr-row {
  display: grid;
  grid-template-columns: 34px 44px minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid var(--line);
}
.cr-row.is-top {
  background: linear-gradient(90deg, rgba(240, 212, 138, 0.09), rgba(240, 212, 138, 0) 65%);
}
.cr-row .rk {
  --s: 32px;
}
.cr-row .card {
  --cw: 44px;
  width: 44px;
}
.cr-main {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
}
.cr-row .cr-name {
  overflow: hidden;
  font-size: 0.875rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cr-stats {
  display: grid;
  grid-template-columns: minmax(0, 9rem) minmax(0, 9rem) auto auto;
  justify-content: start;
  align-items: end;
  gap: 0.25rem 1.4rem;
}
.cr-stat {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: start;
  align-items: baseline;
  column-gap: 0.4rem;
}
.cr-stat small {
  font-size: 0.6875rem;
  color: var(--ink-soft);
}
.cr-stat b {
  font-family: var(--font-num);
  font-size: 1rem;
  font-weight: var(--num-weight, 700);
  color: var(--ink);
}
.cr-stat.is-few b,
.cr-sub b {
  color: var(--ink-soft);
}
.cr-bar {
  grid-column: 1 / -1;
  height: 3px;
  margin-top: 0.15rem;
  background: linear-gradient(90deg, var(--blue-bright) var(--p), rgba(141, 176, 247, 0.16) var(--p));
}
.cr-bar-rate {
  background: linear-gradient(90deg, var(--gold-bright) var(--p), rgba(201, 162, 75, 0.18) var(--p));
}
.cr-stat.is-few .cr-bar-rate {
  opacity: 0.45;
}
@media (max-width: 560px) {
  .cr-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }
  .cr-row {
    grid-template-columns: 30px 40px minmax(0, 1fr);
    gap: 0.5rem;
    padding: 0.45rem 0.2rem;
  }
  .cr-row .card {
    --cw: 40px;
    width: 40px;
  }
}
/* カードの拡大: あなたの記録 */
.zoom-rec {
  margin: 0 0 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(201, 162, 75, 0.45);
}
.zoom-rec h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--gold-bright);
}
.zoom-rec h3::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: rgba(201, 162, 75, 0.45);
}
.zr-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.zr-list li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.zr-list small {
  font-size: 0.75rem;
  color: var(--ink-soft);
}
.zr-list b {
  font-family: var(--font-num);
  font-size: 1.0625rem;
}
.zr-badge {
  --s: 30px;
}
.zr-place {
  font-size: 0.75rem;
  font-style: normal;
  color: var(--ink-soft);
}
.zr-sub {
  font-size: 0.6875rem;
  color: var(--ink-soft);
}
.zr-note {
  margin-top: 0.4rem;
  font-size: 0.6875rem;
  color: var(--ink-soft);
}

/* ---------- コレクション(戦績のタブ。collection.js。2026年11月20日、くまねこ堂の指定) ----------
   まとめのひし形3つ → 今日の1パック(開ける・おまけ・SR以上確定までの7つのひし形)→ 弾ごとのカード(持っていないカードは影)→ 最近開けたパック */
.rec-coltab .rec-sum {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 520px) {
  .rec-tabs {
    gap: 0.85rem;
    overflow-x: auto;
  }
  .rec-tab {
    white-space: nowrap;
  }
}
.col-today {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.8rem 1.2rem;
  margin: 1.25rem 0 1.5rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--gold);
  background: linear-gradient(100deg, rgba(240, 212, 138, 0.1), transparent 70%);
}
.col-today h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.125rem;
  color: var(--gold-bright);
}
.col-today-text p {
  margin: 0.2rem 0 0;
  font-size: 0.875rem;
}
.col-today-text .col-bonus {
  font-size: 0.75rem;
  color: var(--ink-soft);
}
.col-acts {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}
.col-acts:empty {
  display: none;
}
.col-road {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1rem;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(201, 162, 75, 0.3);
}
.col-road p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}
.col-steps {
  display: flex;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.col-steps .dia {
  --s: 30px;
}
.col-steps .dia-line > b {
  color: var(--ink-soft);
}
.col-steps .goal .dia > b {
  font-size: calc(var(--s) * 0.3);
}
.col-set {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 1.4rem;
}
.col-set h3 {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin: 0;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(201, 162, 75, 0.35);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
}
.col-set h3 small {
  margin-left: auto;
  font-family: var(--font-num);
  font-size: 0.875rem;
  color: var(--gold-bright);
}
.col-note {
  margin: 0;
  font-size: 0.75rem;
  color: var(--ink-soft);
}
.col-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.col-card {
  position: relative;
  display: grid;
}
.col-card .card {
  --cw: 100%;
  width: 100%;
}
.col-miss {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.15rem;
  width: 100%;
  aspect-ratio: 600 / 875;
  border: 1px dashed rgba(201, 162, 75, 0.35);
  border-radius: 5.5% / 3.77%;
  background: rgba(6, 12, 34, 0.6);
  color: var(--ink-soft);
}
.col-miss b {
  font-family: var(--font-num);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
}
.col-miss i {
  font-style: normal;
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1;
  opacity: 0.6;
}
.col-miss.rar-SR,
.col-miss.rar-UR,
.col-miss.rar-SP {
  border-color: rgba(240, 212, 138, 0.55);
  color: var(--gold-bright);
}
.col-n,
.col-new {
  position: absolute;
  z-index: 2;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.2em 0.4em;
}
.col-n {
  right: -2px;
  bottom: -4px;
  background: var(--night);
  border: 1px solid var(--gold);
  color: var(--gold-bright);
}
.col-new {
  left: -2px;
  top: -4px;
  background: var(--rose);
  color: #fff;
  letter-spacing: 0.06em;
}
.col-log h3 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
}
.col-log ol {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.col-log li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.6rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(201, 162, 75, 0.2);
  font-size: 0.8125rem;
}
.col-log-d {
  font-family: var(--font-num);
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.col-log-k {
  font-weight: 700;
  color: var(--gold-bright);
}
.col-log-k.bonus {
  color: var(--blue-bright);
}
.col-log-c {
  flex-basis: 100%;
  min-width: 0;
}
@media (max-width: 520px) {
  .col-today {
    grid-template-columns: minmax(0, 1fr);
  }
  .col-acts {
    justify-content: flex-start;
  }
}
/* デイリーチャレンジの画面: おまけの1パック */
.dl-bonus {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.6rem 1rem;
  margin: 0.4rem 0 0.8rem;
  font-weight: 700;
  color: var(--gold-bright);
}
.dl-bonus.done {
  font-weight: 400;
  color: var(--ink-soft);
}
/* コレクション: R以上(今日の1パック)と N・スターター(カード紹介でめくる)の内わけ */
.col-split {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.3rem 1.4rem;
  margin: 0.6rem 0 0;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}
.col-split span {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
}
.col-split b {
  font-family: var(--font-num);
  color: var(--gold-bright);
}
.col-group {
  display: grid;
  gap: 0.45rem;
}
.col-group + .col-group {
  margin-top: 0.4rem;
}
.col-group-h {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.7rem;
  margin: 0;
  font-size: 0.75rem;
  color: var(--ink-soft);
}
.col-group-h b {
  font-size: 0.8125rem;
  color: var(--on-night);
}
.col-group-h small {
  margin-left: auto;
  font-family: var(--font-num);
  color: var(--gold-bright);
}
.col-miss.rar-ST {
  border-color: rgba(141, 176, 247, 0.4);
}

/* ---------- 動画ページ(videos.js。2026年11月21日) ----------
   上に再生の枠(トップの動画と同じ二重線の枠)、その下に まとまりごとの札(絵・長さ・題・ひとこと)。準備中の札は薄く、押せない。 */
.modal-videos {
  width: min(100%, 1080px);
}
.vids {
  display: grid;
  gap: 1.3rem;
}
.vid-guide {
  margin-left: auto;
}
.vid-player .movie-frame {
  max-width: none;
}
.vid-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #000;
}
.vid-player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.vid-now {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.3rem 1rem;
  margin-top: 0.9rem;
}
.vid-now h3 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.375rem;
}
.vid-now h3 small {
  margin-left: 0.6em;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--ink-soft);
}
.vid-now-text,
.vid-bgm {
  margin-top: 0.3rem;
  font-size: 0.875rem;
  color: var(--ink-soft);
}
.vid-group h3,
.gs-group h3 {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.7rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.125rem;
  color: var(--gold-bright);
}
.vid-group h3::after,
.gs-group h3::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(201, 162, 75, 0.45);
}
.vid-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.9rem;
  list-style: none;
}
.vid-tile {
  display: grid;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 1px solid var(--line);
  background: rgba(22, 34, 87, 0.45);
  color: var(--ink);
  font: inherit;
  text-align: left;
}
button.vid-tile {
  cursor: pointer;
}
button.vid-tile:hover,
.vid-tile.on {
  border-color: var(--gold-bright);
}
.vid-tile.on {
  box-shadow: inset 0 0 0 1px var(--gold-bright);
}
.vid-tile.is-soon {
  opacity: 0.62;
}
.vid-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--night);
}
.vid-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.vid-tile.is-soon .vid-thumb img {
  filter: grayscale(0.55) brightness(0.6);
}
.vid-mini-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44px;
  translate: -50% -50%;
  color: var(--gold-bright);
}
.vid-mini-play svg {
  display: block;
  width: 100%;
  height: auto;
}
.vid-soon {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  padding: 0.2em 0.9em;
  border: 1px solid var(--gold);
  background: rgba(6, 12, 34, 0.75);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: 0.14em;
  white-space: nowrap;
  color: var(--gold-bright);
}
.vid-len {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 0.05em 0.45em;
  background: rgba(6, 12, 34, 0.85);
  font-size: 0.75rem;
  font-weight: 700;
}
.vid-body {
  display: grid;
  gap: 0.25rem;
  padding: 0.65rem 0.8rem 0.8rem;
}
.vid-body b {
  word-break: auto-phrase;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
}
.vid-body small {
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--ink-soft);
}
.movie-links {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.2rem;
}
.movie-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #000;
}

/* ---------- 1枚でわかる遊び方(sheets.js。2026年11月21日) ----------
   一覧 = 遊び方の一覧と同じまとまりで、縦長の画像の札。押すと大きく(前へ・次へ・画像を開く・この遊び方で遊ぶ)。 */
.modal-sheets {
  width: min(100%, 1120px);
}
.gsheets {
  display: grid;
  gap: 1.3rem;
}
.gsheets .md-head .btn {
  margin-left: auto;
}
.gs-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 0.9rem;
  list-style: none;
}
.gs-tile {
  display: grid;
  gap: 0.45rem;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.gs-tile img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  border: 1px solid var(--line);
  transition: transform 0.2s ease, border-color 0.2s;
}
.gs-tile:hover img {
  transform: translateY(-3px);
  border-color: var(--gold-bright);
}
.gs-tile span {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.9375rem;
  text-align: center;
}
.gs-view {
  display: grid;
  gap: 0.9rem;
}
.gs-view-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.gs-count {
  font-family: var(--font-num, inherit);
  font-size: 0.875rem;
  color: var(--ink-soft);
}
.gs-stage {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 0.6rem;
}
.gs-big {
  display: block;
  width: 100%;
  max-width: 640px;
  height: auto;
  margin: 0 auto;
  border: 1px solid var(--gold);
  box-shadow: 0 0 0 5px var(--night), 0 0 0 6px rgba(201, 162, 75, 0.5);
}
.gs-nav {
  display: grid;
  place-items: center;
  width: 48px;
  height: 72px;
  border: 1px solid var(--gold);
  background: rgba(6, 12, 34, 0.6);
  color: var(--gold-bright);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}
.gs-nav:hover {
  background: rgba(201, 162, 75, 0.18);
}
.gs-acts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem 1rem;
}
/* トップの「1枚でわかる遊び方」の帯(sheets.js の sheetsHomeHTML)。PC は左右の ‹ › で送り、スマホは指で横に送る */
.gs-home-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem 1rem;
  margin-bottom: 1.1rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--gold);
  box-shadow: 0 3px 0 var(--night-2), 0 4px 0 rgba(201, 162, 75, 0.4);
}
.gs-home-text {
  margin: -0.2rem 0 1rem;
  max-width: 40em;
  color: var(--ink-soft);
}
.gs-strip-wrap {
  position: relative;
}
.gs-strip {
  display: flex;
  gap: 0.9rem;
  padding: 5px 2px 12px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 162, 75, 0.6) transparent;
  list-style: none;
}
.gs-strip li {
  flex: 0 0 clamp(128px, 13vw, 160px);
  scroll-snap-align: start;
}
.gs-strip .gs-tile span {
  word-break: auto-phrase;
  font-size: 0.875rem;
  line-height: 1.4;
}
.gs-strip-nav {
  position: absolute;
  top: calc(50% - 22px);
  z-index: 1;
  translate: 0 -50%;
  background: rgba(6, 12, 34, 0.86);
}
.gs-strip-prev {
  left: -16px;
}
.gs-strip-wrap:not(.is-moved) .gs-strip-prev,
.gs-strip-wrap.is-end .gs-strip-next {
  visibility: hidden;
}
.gs-strip-next {
  right: -16px;
}
@media (hover: none), (max-width: 560px) {
  .gs-strip-nav {
    display: none;
  }
}
@media (max-width: 560px) {
  /* 帯は画面の端まで広げて、横に続いていることが分かるように */
  .gs-strip {
    gap: 0.7rem;
    margin-inline: -1rem;
    padding-inline: 1rem;
    scroll-padding-inline: 1rem;
  }
  .gs-strip li {
    flex-basis: 118px;
  }
}
.md-links {
  display: inline-flex;
  gap: 1rem;
}
.rules-more {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.6rem 0 0.4rem;
}
@media (max-width: 560px) {
  /* メニューが増えたので、スマホでは字と間を少し詰めて3行に収める */
  .home-nav {
    gap: 0 1rem;
  }
  .home-nav button {
    min-height: 40px;
    font-size: 0.875rem;
  }
  .gs-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  /* スマホでは画像を幅いっぱいにして、前へ・次へは画像の左右に重ねる */
  .gs-stage {
    position: relative;
    grid-template-columns: minmax(0, 1fr);
  }
  .gs-nav {
    position: absolute;
    top: 50%;
    z-index: 1;
    width: 34px;
    height: 56px;
    translate: 0 -50%;
    background: rgba(6, 12, 34, 0.78);
    font-size: 1.6rem;
  }
  .gs-prev {
    left: -4px;
  }
  .gs-next {
    right: -4px;
  }
  .vid-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
  }
  .vid-body small {
    display: none;
  }
}

/* ---------- トップの動画の横の小さい動画(site.js の sideHTML。2026年11月21日) ----------
   PC は動画の右に縦に2つ。幅 900px 以下は動画の下に横に2つ。押すと動画ページで再生。 */
.movie.has-side .movie-head {
  max-width: none;
}
.movie-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(220px, 22vw, 280px);
  align-items: start;
  gap: 1.6rem;
}
.movie-main .movie-frame {
  max-width: none;
}
.movie-side {
  margin-top: 6px;
}
.movie-side ul {
  display: grid;
  gap: 1rem;
  list-style: none;
}
.ms-tile {
  display: grid;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  background: rgba(22, 34, 87, 0.45);
  color: var(--ink);
  font: inherit;
  text-align: left;
}
button.ms-tile {
  cursor: pointer;
  transition: border-color 0.2s;
}
button.ms-tile:hover {
  border-color: var(--gold-bright);
}
.ms-tile.is-soon {
  opacity: 0.72;
}
.ms-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--night);
}
.ms-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ms-tile.is-soon .ms-thumb img {
  filter: grayscale(0.55) brightness(0.6);
}
.ms-body {
  display: grid;
  gap: 0.2rem;
  padding: 0.55rem 0.75rem 0.7rem;
}
.ms-body em {
  font-style: normal;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gold-bright);
}
.ms-body b {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  word-break: auto-phrase;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.9375rem;
  line-height: 1.45;
}
@media (max-width: 900px) {
  .movie-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.1rem;
  }
  .movie-side {
    margin-top: 0;
  }
  .movie-side ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
  }
  .ms-body {
    padding: 0.45rem 0.6rem 0.6rem;
  }
  .ms-body b {
    font-size: 0.8125rem;
  }
  .ms-body em {
    font-size: 0.6875rem;
  }
}

/* ---------- スタンプ(stamps.js。2026年11月21日) ----------
   右下のボタン(下の帯・公開の演出のボタンの上。高さは stamps.js が合わせる)・8種類の一覧(PC は小窓、スマホは下から)・吹き出し。
   重なり: 公開の演出(60)より上、選択の画面(70)・モーダル(80)より下。吹き出しはモーダルより上(95)。 */
#layer-stamp {
  position: relative;
  z-index: 65;
}
.stamp-fab {
  position: fixed;
  z-index: 65;
  right: 18px;
  bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  overflow: hidden;
  padding: 0.5rem 1rem 0.5rem 0.65rem;
  border: 1px solid var(--gold);
  border-radius: 999px;
  background: #0a1030;
  box-shadow: 0 0 0 3px rgba(6, 12, 34, 0.9), 0 8px 20px rgba(0, 0, 0, 0.5);
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  cursor: pointer;
}
.stamp-fab svg {
  width: 26px;
  height: 26px;
  flex: none;
}
.stamp-fab:hover {
  background: #16225a;
}
.stamp-fab.on {
  background: var(--gold);
  color: var(--night);
}
/* 送ったあとの3秒: 下の線が縮んでいく */
.stamp-fab.cool::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--gold-bright);
  transform-origin: left;
  animation: stamp-cool 3s linear forwards;
}
@keyframes stamp-cool {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}
.stamp-pal {
  position: fixed;
  z-index: 66;
  right: 18px;
  width: min(420px, calc(100vw - 36px));
  padding: 14px 16px 12px;
  border: 1px solid var(--gold);
  background: #0a1030;
  box-shadow: 0 0 0 5px #060c22, 0 0 0 6px rgba(201, 162, 75, 0.5), 0 18px 40px rgba(0, 0, 0, 0.55);
  color: var(--ink);
  animation: stamp-pal-in 0.18s ease-out;
}
@keyframes stamp-pal-in {
  from {
    opacity: 0;
    translate: 0 8px;
  }
}
.stamp-pal header {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  margin-bottom: 10px;
}
.stamp-pal h3 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  color: var(--gold-bright);
}
.stamp-pal header small {
  font-size: 0.75rem;
  color: var(--ink-soft);
}
.stamp-x {
  margin-left: auto;
  padding: 0 0.2rem;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font-size: 1.1rem;
  cursor: pointer;
}
.stamp-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  list-style: none;
}
.stamp-grid button {
  display: grid;
  justify-items: center;
  gap: 5px;
  width: 100%;
  padding: 8px 2px 7px;
  border: 1px solid var(--line);
  background: rgba(22, 34, 87, 0.55);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.stamp-grid button:hover:not([disabled]) {
  border-color: var(--gold-bright);
  background: rgba(201, 162, 75, 0.16);
  transform: translateY(-2px);
}
.stamp-grid button[disabled] {
  opacity: 0.45;
  cursor: default;
}
.stamp-grid img {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 2px var(--gold), 0 0 0 4px #0a1030;
}
.stamp-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid rgba(201, 162, 75, 0.35);
  font-size: 0.75rem;
  color: var(--ink-soft);
}
.stamp-sw {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.stamp-sw i {
  position: relative;
  width: 34px;
  height: 18px;
  border-radius: 999px;
  background: #3a488c;
  transition: background 0.15s;
}
.stamp-sw i::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #0a1030;
  transition: left 0.15s;
}
.stamp-sw[aria-checked="true"] i {
  background: var(--gold);
}
.stamp-sw[aria-checked="true"] i::after {
  left: 18px;
}
/* 吹き出し */
.stamp-bubble {
  position: fixed;
  z-index: 95;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 16px);
  padding: 5px 14px 5px 5px;
  border: 2px solid var(--gold);
  border-radius: 999px;
  background: #fff8e6;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  color: #16204f;
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
  pointer-events: none;
  rotate: -2deg;
  animation: stamp-pop 0.32s cubic-bezier(0.2, 1.6, 0.4, 1);
  transition: opacity 0.3s, translate 0.3s;
}
.stamp-bubble b {
  font-weight: 900;
}
.stamp-bubble img {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 2px var(--gold);
}
.stamp-bubble .sb-who {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  max-width: 9em;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.75rem;
  font-weight: 700;
  color: #5a6390;
  letter-spacing: 0;
}
.stamp-bubble .sb-who small {
  padding: 0 0.3em;
  border: 1px solid #8a93bf;
  font-size: 0.65rem;
}
.stamp-bubble.out {
  opacity: 0;
  translate: 0 -6px;
}
.stamp-bubble::before {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid var(--gold);
  border-top: 0;
  border-right: 0;
  background: #fff8e6;
}
.stamp-bubble.floating::before {
  display: none;
}
.stamp-bubble.tail-left::before {
  left: -8px;
  top: 50%;
  translate: 0 -50%;
  rotate: 45deg;
}
.stamp-bubble.tail-down::before {
  left: var(--tail-x, 50%);
  bottom: -8px;
  translate: -50% 0;
  rotate: -45deg;
}
.stamp-bubble.tail-up::before {
  left: var(--tail-x, 50%);
  top: -8px;
  translate: -50% 0;
  rotate: 135deg;
}
@keyframes stamp-pop {
  from {
    opacity: 0;
    scale: 0.6;
  }
}
@media (prefers-reduced-motion: reduce) {
  .stamp-bubble,
  .stamp-pal {
    animation: none;
  }
}
@media (max-width: 560px) {
  .stamp-fab {
    right: 12px;
    padding: 0.45rem;
    gap: 0;
  }
  .stamp-fab span {
    display: none;
  }
  .stamp-fab svg {
    width: 28px;
    height: 28px;
  }
  .stamp-pal {
    left: 0;
    right: 0;
    width: auto;
    padding: 12px 12px 10px;
    border-left: 0;
    border-right: 0;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
  }
  .stamp-grid {
    gap: 6px;
  }
  .stamp-grid button {
    padding: 7px 0 6px;
    font-size: 0.75rem;
  }
  .stamp-grid img {
    width: 52px;
    height: 52px;
  }
  .stamp-bubble {
    gap: 6px;
    padding: 3px 11px 3px 3px;
    font-size: 0.95rem;
  }
  .stamp-bubble img {
    width: 30px;
    height: 30px;
  }
}

/* ---------------------------------------------------------------- 入れ替え勝ち抜きの塔: むずかしさ(2026年11月21日) */
/* むずかしさの札(周の見出し・結果・1戦の初めの演出)。かんたん = 青、ふつう = 金、むずかしい = 赤 */
.fa-lv {
  display: inline-block;
  padding: 0 0.5em;
  border: 1px solid var(--blue-bright);
  background: rgba(40, 90, 200, 0.28);
  color: #e3ecff;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.6;
  white-space: nowrap;
  vertical-align: middle;
}
.fa-lv-normal {
  border-color: var(--gold);
  background: rgba(201, 162, 75, 0.25);
  color: #fff1cf;
}
.fa-lv-hard {
  border-color: var(--red-bright);
  background: rgba(192, 22, 44, 0.32);
  color: #ffe1e6;
}
.ended-sub .fa-lv,
.tw-show-kicker .fa-lv {
  margin-left: 0.7em;
  letter-spacing: 0.05em;
}
/* むずかしさごとの記録(戦績・結果) */
.fa-lv-recs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1.2rem;
  margin-top: 0.8rem;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}
.fa-lv-recs li {
  display: flex;
  align-items: center;
  gap: 0.45em;
}
/* むずかしさを選ぶ画面 */
.modal-factory-levels {
  width: min(100%, 880px);
}
.fa-levels {
  display: grid;
  gap: 1.1rem;
}
.fa-lv-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}
.fa-lv-pick {
  position: relative;
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 0.45rem;
  width: 100%;
  height: 100%;
  padding: 1rem 1rem 0.9rem;
  border: 1px solid var(--blue-bright);
  background: rgba(6, 12, 34, 0.45);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.fa-lv-pick-normal {
  border-color: var(--gold);
}
.fa-lv-pick-hard {
  border-color: var(--red-bright);
}
.fa-lv-pick:hover,
.fa-lv-pick:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 0 0 1px var(--gold-bright), 0 10px 26px rgba(0, 0, 0, 0.45);
  outline: none;
}
.fa-lv-pick.is-last {
  box-shadow: inset 0 0 0 1px rgba(240, 212, 138, 0.45);
}
.fa-lv-stars {
  display: flex;
  gap: 0.25rem;
}
.fa-lv-stars i {
  width: 0.7rem;
  height: 0.7rem;
  background: var(--blue-bright);
  transform: rotate(45deg) scale(0.8);
}
.fa-lv-pick-normal .fa-lv-stars i {
  background: var(--gold-bright);
}
.fa-lv-pick-hard .fa-lv-stars i {
  background: var(--red-bright);
}
.fa-lv-pick b {
  font-family: var(--font-display);
  font-size: 1.375rem;
  line-height: 1.2;
}
.fa-lv-pick p {
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--on-night-soft);
}
.fa-lv-rec {
  display: flex;
  align-items: center;
  gap: 0.4em;
  margin-top: auto;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  width: 100%;
  font-size: 0.75rem;
  color: var(--ink-soft);
}
.fa-lv-clear {
  padding: 0 0.45em;
  background: var(--gold);
  color: #1a1408;
  font-weight: 700;
  font-size: 0.625rem;
  line-height: 1.6;
}
.fa-lv-last {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--gold-bright);
}
.fa-lv-note {
  font-size: 0.75rem;
  color: var(--ink-soft);
}
@media (max-width: 720px) {
  .fa-lv-list {
    grid-template-columns: 1fr;
  }
  .fa-lv-pick {
    padding: 0.8rem 0.9rem;
  }
  .fa-lv-pick b {
    font-size: 1.1875rem;
  }
}
/* ふつう: レアカードを1枚選んで入れる画面 */
.fa-pickwrap {
  display: grid;
  gap: 0.9rem;
}
.fa-pickwrap .sc-side h2 {
  flex-wrap: wrap;
  row-gap: 0.15rem;
  white-space: nowrap;
}
.fa-pickwrap .sc-side h2 small {
  white-space: normal;
}
.fa-picks .sc-cards,
.fa-deck .sc-cards {
  justify-content: center;
}
.fa-picks .sc-card-btn .card {
  --cw: 112px;
}
.fa-picks .sc-card {
  width: 132px;
}
.fa-picks .sc-card .cap {
  display: grid;
  justify-items: center;
  gap: 0.1rem;
  line-height: 1.4;
  text-align: center;
}
.fa-picks .sc-card .cap small {
  font-size: 0.6875rem;
  color: var(--on-night-soft);
}
.fa-deck {
  border-color: var(--line);
}
.fa-deck h2 small {
  color: var(--ink-soft);
}
.fa-deck .sc-card .card {
  --cw: 78px;
}
.fa-deck .sc-card.fa-out .card {
  opacity: 0.45;
  box-shadow: 0 0 0 2px var(--red-bright);
}
.fa-deck .sc-card.fa-out .cap b {
  color: var(--red-bright);
}
/* デッキ構築の見出しの、次の相手(名前と強さだけ) */
.fa-foe.compact .fa-foe-line b {
  margin-right: 0.5em;
  font-family: var(--font-display);
  font-size: 0.875rem;
  color: var(--ink);
}
.fa-foe.compact .fa-boss-tag {
  padding: 0.05em 0.5em;
  font-size: 0.6875rem;
  font-weight: 700;
  background: var(--rose);
  color: #fff;
}
@media (max-width: 560px) {
  .fa-picks .sc-cards {
    flex-wrap: nowrap;
  }
  .fa-picks .sc-card {
    width: auto;
    flex: 1 1 0;
    min-width: 0;
  }
  .fa-picks .sc-card-btn .card {
    --cw: 88px;
  }
  .fa-deck .sc-card .card {
    --cw: 58px;
  }
}
