/* ============================================================
   FrameArmies : バトル以外の各画面
   ============================================================ */

/* ---------------------------- 読み込み画面 ---------------------------- */

/* ロゴは出さない。次のタイトル画面で見せるため（SPEC 2.1） */
#screen-loading {
  align-items: center;
  justify-content: center;
  cursor: default;
}

#screen-loading.is-ready {
  cursor: pointer;
}

.loading {
  width: min(420px, 78vw);
  text-align: center;
}

.loading__label {
  margin: 0 0 14px;
  font-family: var(--font-en);
  font-size: 13px;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  color: var(--ink-faint);
}

.loading__bar {
  height: 3px;
  background: rgba(255, 255, 255, 0.09);
  border-radius: 2px;
  overflow: hidden;
}

.loading__fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold));
  box-shadow: 0 0 10px rgba(230, 199, 106, 0.5);
  transition: width 0.18s ease-out;
}

.loading__pct {
  margin: 12px 0 0;
  font-family: var(--font-en);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--ink-faint);
}

.loading__go {
  margin: 12px 0 0;
  font-size: 13px;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  color: var(--gold);
  animation: blink 2.1s ease-in-out infinite;
}

@keyframes blink {

  0%,
  100% {
    opacity: 0.25;
  }

  50% {
    opacity: 1;
  }
}

/* ---------------------------- タイトル ---------------------------- */

#screen-title {
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.title-wrap {
  text-align: center;
  max-width: 760px;
  /* 起動画面を廃したので、その立ち上がり演出はこの画面が引き継ぐ */
  animation: title-rise 1s ease both;
}

@keyframes title-rise {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
    filter: blur(6px);
  }

  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

/* 旧・起動画面の副題をタイトルへ移したもの */
.title-tagline {
  margin: 20px 0 0;
  font-size: clamp(13px, 1.8vw, 18px);
  letter-spacing: 0.5em;
  color: var(--ink-dim);
  text-indent: 0.5em;
}

.title-tagline::before,
.title-tagline::after {
  content: "—";
  color: var(--gold-dim);
  margin: 0 14px;
  letter-spacing: 0;
}

.title-logo {
  margin: 0;
  font-family: var(--font-en);
  font-size: clamp(46px, 9vw, 104px);
  letter-spacing: 0.08em;
  line-height: 1;
  font-weight: 600;
}

.title-logo__a {
  color: #dfe7f4;
}

.title-logo__b {
  color: var(--gold);
}

.title-logo::after {
  content: "";
  display: block;
  width: 62%;
  height: 2px;
  margin: 22px auto 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.title-lead {
  margin: 14px 0 0;
  font-size: clamp(14px, 2vw, 19px);
  letter-spacing: 0.24em;
  color: var(--ink-dim);
}

.title-press {
  margin-top: 60px;
  font-size: 13px;
  letter-spacing: 0.3em;
  color: var(--gold);
  animation: blink 2.1s ease-in-out infinite;
}

/* ---------------------------- メインメニュー ---------------------------- */

#screen-menu {
  align-items: center;
  justify-content: center;
}

.menu-wrap {
  width: min(520px, 100%);
  text-align: center;
}

.menu-list {
  display: grid;
  gap: 14px;
  margin-top: 30px;
}

.menu-btn {
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 16px 24px;
  color: var(--ink);
  background: linear-gradient(100deg, rgba(36, 43, 60, 0.95), rgba(19, 24, 36, 0.95));
  border: 1px solid rgba(230, 199, 106, 0.24);
  border-left: 3px solid var(--gold-dim);
  border-radius: var(--radius);
  cursor: pointer;
  transition: 0.16s ease;
  text-align: left;
}

.menu-btn:hover {
  border-left-color: var(--gold);
  transform: translateX(5px);
  box-shadow: -6px 0 22px rgba(230, 199, 106, 0.1);
}

.menu-btn__label {
  font-size: 20px;
  letter-spacing: 0.22em;
  color: var(--gold);
}

.menu-btn__sub {
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
}

.menu-foot {
  margin-top: 26px;
  font-size: 12px;
  color: var(--ink-faint);
}

.menu-foot strong {
  color: var(--ink-dim);
}

/* ---------------------------- 共通ページ枠 ---------------------------- */

.page {
  width: min(1080px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.page--wide {
  width: min(1360px, 100%);
}

.page--narrow {
  width: min(620px, 100%);
}

.page__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(230, 199, 106, 0.2);
  padding-bottom: 12px;
}

.page__tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.deck-pick {
  font-size: 12px;
  color: var(--ink-dim);
  display: flex;
  align-items: center;
  gap: 8px;
}

.deck-pick select {
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  background: var(--bg-2);
  border: 1px solid rgba(230, 199, 106, 0.3);
  border-radius: 8px;
  padding: 7px 10px;
}

/* ---------------------------- ステージ選択 ---------------------------- */

/* 左：番号だけのタイル一覧　右：選択中ステージの詳細 */
.stage-pick {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 18px;
  align-items: start;
  padding-bottom: 20px;
}

/* 同じ敵で配置違いの3面を1グループとして束ね、グループ単位で並べる */
.stage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(184px, 1fr));
  gap: 14px 12px;
  align-content: start;
}

.stage-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.stage-group__name {
  grid-column: 1 / -1;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stage-tile {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-family: inherit;
  color: var(--ink);
  background: linear-gradient(160deg, rgba(31, 38, 54, 0.92), rgba(16, 20, 30, 0.92));
  border: 1px solid rgba(230, 199, 106, 0.2);
  border-radius: var(--radius);
  cursor: pointer;
  transition: 0.14s ease;
}

.stage-tile:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}

.stage-tile.is-sel {
  border-color: var(--gold);
  background: linear-gradient(160deg, rgba(52, 46, 30, 0.95), rgba(24, 22, 16, 0.95));
  box-shadow: 0 0 0 1px rgba(230, 199, 106, 0.45), var(--shadow);
}

.stage-tile.is-cleared::after {
  content: "✓";
  position: absolute;
  top: 3px;
  right: 7px;
  font-size: 12px;
  color: var(--green);
}

.stage-tile__no {
  font-family: var(--font-en);
  font-size: 21px;
  line-height: 1;
  color: var(--gold);
}

.stage-tile__diff {
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
}

.stage-tile--EASY .stage-tile__diff {
  color: var(--green);
}

.stage-tile--NORMAL .stage-tile__diff {
  color: var(--amber);
}

.stage-tile--HARD .stage-tile__diff {
  color: var(--red);
}

.stage-tile__stars {
  font-size: 9px;
  letter-spacing: 1px;
  line-height: 1;
  height: 10px;
  color: var(--gold);
}

/* クリアで駒が解禁されるステージの印（解禁済みなら付けない） */
.stage-tile.has-unlock::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 6px rgba(127, 212, 255, 0.8);
}

/* ---- 詳細パネル ---- */

.stage-detail {
  position: sticky;
  top: 0;
  padding: 16px 18px;
  background: linear-gradient(170deg, rgba(31, 38, 54, 0.95), rgba(13, 17, 26, 0.95));
  border: 1px solid rgba(230, 199, 106, 0.25);
  border-radius: var(--radius);
  max-height: calc(100vh - 130px);
  overflow-y: auto;
}

.stage-detail__head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stage-detail__no {
  font-family: var(--font-en);
  font-size: 32px;
  line-height: 1;
  color: var(--gold);
  min-width: 38px;
  text-align: center;
}

.stage-detail__title {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.06em;
}

.stage-detail__sub {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  text-transform: uppercase;
}

.stage-detail__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.stage-detail__desc {
  margin: 12px 0 0;
  font-size: 12.5px;
  color: var(--ink-dim);
  line-height: 1.7;
}

.stage-detail__hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--blue);
  background: rgba(127, 212, 255, 0.08);
  border-left: 2px solid rgba(127, 212, 255, 0.5);
  padding: 5px 10px;
  border-radius: 0 6px 6px 0;
}

/* クリアで解禁される駒の案内 */
.stage-detail__unlock {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
  padding: 7px 10px;
  font-size: 12px;
  color: var(--green);
  background: rgba(126, 200, 130, 0.08);
  border: 1px solid rgba(126, 200, 130, 0.35);
  border-radius: 8px;
}

.stage-detail__unlock.is-done {
  color: var(--ink-faint);
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.12);
}

.stage-detail__unlock img {
  width: 30px;
  height: 30px;
  flex: none;
}

.stage-detail__unlock-role {
  margin-top: 2px;
  font-size: 11px;
  color: var(--ink-faint);
}

.stage-detail__label {
  margin: 16px 0 7px;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--gold);
  border-bottom: 1px solid rgba(230, 199, 106, 0.22);
  padding-bottom: 5px;
}

.enemy-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.enemy-row {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 9px;
  align-items: center;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}

.enemy-row img {
  width: 34px;
  height: 34px;
  display: block;
}

.enemy-row__head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  line-height: 1.4;
}

.enemy-row__num {
  color: var(--gold);
}

.enemy-row__hp {
  font-size: 11px;
  color: var(--ink-faint);
}

.enemy-row__move {
  font-size: 11px;
  color: var(--ink-dim);
  line-height: 1.5;
}

.stage-detail__record {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.stage-detail__best {
  font-size: 11px;
  color: var(--ink-dim);
}

/* パネル内をスクロールしても出撃ボタンは下端に残す */
.stage-detail__foot {
  position: sticky;
  bottom: 0;
  margin: 12px -18px -16px;
  padding: 10px 18px 16px;
  background: linear-gradient(180deg, rgba(15, 19, 28, 0) 0%, rgba(15, 19, 28, 0.96) 45%);
}

.stage-detail__go {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  letter-spacing: 0.2em;
}

.badge {
  font-size: 11px;
  letter-spacing: 0.16em;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid currentColor;
}

.badge--EASY {
  color: var(--green);
}

.badge--NORMAL {
  color: var(--amber);
}

.badge--HARD {
  color: var(--red);
}

.badge--turn {
  color: var(--ink-dim);
  border-color: rgba(255, 255, 255, 0.16);
}

.badge--clear {
  color: #0f1a12;
  background: var(--green);
  border-color: var(--green);
  font-weight: 700;
}

.stars {
  font-size: 15px;
  letter-spacing: 2px;
  color: var(--gold);
}

.stars .off {
  color: rgba(255, 255, 255, 0.14);
}

/* ---------------------------- デッキ選択 ---------------------------- */

.deck-slots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.deck-slot {
  padding: 20px;
  background: linear-gradient(160deg, rgba(31, 38, 54, 0.92), rgba(16, 20, 30, 0.92));
  border: 1px solid rgba(230, 199, 106, 0.2);
  border-radius: var(--radius);
  cursor: pointer;
  transition: 0.16s ease;
}

.deck-slot:hover {
  border-color: var(--gold);
  transform: translateY(-3px);
}

.deck-slot__name {
  font-size: 18px;
  color: var(--gold);
  letter-spacing: 0.1em;
}

.deck-slot__note {
  font-size: 12px;
  color: var(--ink-faint);
  margin-top: 2px;
  min-height: 20px;
}

.deck-slot__count {
  margin-top: 14px;
  font-size: 26px;
  font-family: var(--font-en);
}

.deck-slot__count.is-warn {
  color: var(--red);
}

.deck-slot__count small {
  font-size: 14px;
  color: var(--ink-faint);
}

.deck-slot__cost {
  font-size: 12px;
  color: var(--ink-dim);
  margin-top: 6px;
}

.deck-slot__warn {
  margin-top: 8px;
  font-size: 12px;
  color: var(--red);
}

/* ---------------------------- デッキ編成 ---------------------------- */

.deckedit {
  display: grid;
  grid-template-columns: 1.15fr 1fr 0.95fr;
  gap: 16px;
  min-height: 0;
  flex: 1;
}

.deckedit__col {
  background: rgba(13, 17, 26, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.unit-pool,
.deck-contents {
  overflow-y: auto;
  display: grid;
  gap: 8px;
  align-content: start;
  padding-right: 4px;
  max-height: min(60vh, 560px);
}

.unit-pool {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.unit-chip {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 9px;
  align-items: center;
  padding: 8px 10px;
  background: linear-gradient(100deg, rgba(36, 43, 60, 0.9), rgba(19, 24, 36, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  cursor: pointer;
  transition: 0.14s ease;
}

.unit-chip:hover,
.unit-chip.is-sel {
  border-color: var(--gold);
  background: linear-gradient(100deg, rgba(52, 46, 30, 0.9), rgba(28, 25, 18, 0.9));
}

.unit-chip img {
  width: 40px;
  height: 40px;
  display: block;
}

.unit-chip__name {
  font-size: 14px;
  line-height: 1.3;
}

.unit-chip__meta {
  font-size: 11px;
  color: var(--ink-faint);
}

.cost-pip {
  color: var(--gold);
  font-weight: 700;
}

/* 未解禁のユニット。何が待っているかは見せるが、デッキには入れられない */
.unit-chip.is-locked {
  cursor: not-allowed;
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.02);
}

.unit-chip.is-locked img {
  filter: grayscale(1) brightness(0.65);
}

.unit-chip.is-locked .unit-chip__name {
  color: var(--ink-faint);
}

.unit-chip.is-locked:hover,
.unit-chip.is-locked.is-sel {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.05);
}

.lock-pip {
  font-size: 11px;
}

.detail-locked {
  margin-top: 10px;
  padding: 6px 10px;
  font-size: 11.5px;
  color: var(--amber);
  background: rgba(230, 180, 80, 0.09);
  border: 1px solid rgba(230, 180, 80, 0.32);
  border-radius: 7px;
}

.deck-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}

.deck-row.is-sel {
  border-color: var(--gold);
}

.deck-row img {
  width: 34px;
  height: 34px;
}

.deck-row__name {
  font-size: 13px;
}

.deck-row__ctrl {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qty-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid rgba(230, 199, 106, 0.3);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.qty-btn:hover {
  border-color: var(--gold);
  background: var(--gold-soft);
}

.qty {
  min-width: 26px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--gold);
}

.deck-empty {
  color: var(--ink-faint);
  font-size: 13px;
  text-align: center;
  padding: 30px 10px;
}

.deck-count {
  font-family: var(--font-en);
  font-size: 20px;
  color: var(--green);
}

.deck-count.is-warn {
  color: var(--red);
}

.unit-detail {
  overflow-y: auto;
  font-size: 13px;
  max-height: min(60vh, 560px);
}

.detail-head {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.detail-head img {
  width: 62px;
  height: 62px;
}

.detail-name {
  font-size: 19px;
  color: var(--gold);
}

.detail-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--ink-dim);
}

.tag--physical {
  color: #cfd8e6;
  border-color: #6b7789;
}

.tag--magic {
  color: var(--violet);
  border-color: #6a4fa0;
}

.tag--blast {
  color: var(--amber);
  border-color: #8a5a28;
}

.tag--trap {
  color: #c3cede;
  border-color: #5a6472;
}

.tag--control {
  color: var(--blue);
  border-color: #3f7d9c;
}

.tag--defense {
  color: var(--gold);
  border-color: var(--gold-dim);
}

.detail-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.detail-stat {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 8px 10px;
}

.detail-stat span {
  display: block;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
}

.detail-stat strong {
  font-size: 20px;
  color: var(--ink);
}

.detail-sec {
  margin-top: 12px;
}

.detail-sec h4 {
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--gold);
}

.detail-sec p {
  margin: 0;
  color: var(--ink-dim);
  line-height: 1.65;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
  width: 150px;
  margin-top: 6px;
}

.detail-grid div {
  aspect-ratio: 1;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.detail-grid .self {
  background: var(--gold);
}

.detail-grid .hit {
  background: rgba(255, 168, 72, 0.75);
}

.detail-empty {
  color: var(--ink-faint);
  text-align: center;
  padding: 40px 10px;
}

/* ---------------------------- 勝敗画面 ---------------------------- */

#screen-result {
  align-items: center;
  justify-content: center;
}

.result-card {
  width: min(560px, 100%);
  padding: 34px 38px;
  text-align: center;
  background: linear-gradient(170deg, rgba(31, 38, 54, 0.97), rgba(13, 16, 24, 0.97));
  border: 1px solid var(--gold-dim);
  border-radius: 14px;
  box-shadow: var(--shadow);
  animation: result-pop 0.4s cubic-bezier(0.2, 1.1, 0.4, 1) both;
}

@keyframes result-pop {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(14px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.result-card.is-lose {
  border-color: rgba(224, 96, 79, 0.55);
}

.result-title {
  margin: 0;
  font-size: 38px;
  letter-spacing: 0.2em;
  color: var(--gold);
  text-shadow: 0 0 30px rgba(230, 199, 106, 0.35);
}

.result-card.is-lose .result-title {
  color: var(--red);
  text-shadow: 0 0 30px rgba(224, 96, 79, 0.3);
}

.result-stage {
  margin: 6px 0 0;
  color: var(--ink-dim);
  letter-spacing: 0.1em;
}

.result-stars {
  font-size: 44px;
  letter-spacing: 8px;
  color: var(--gold);
  margin: 16px 0 6px;
  min-height: 10px;
}

.result-stars .off {
  color: rgba(255, 255, 255, 0.12);
}

.result-stars .pop {
  display: inline-block;
  animation: star-pop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

@keyframes star-pop {
  from {
    opacity: 0;
    transform: scale(0) rotate(-40deg);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 20px 0 0;
}

.result-stats div {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 10px;
}

.result-stats dt {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
}

.result-stats dd {
  margin: 2px 0 0;
  font-size: 22px;
  font-family: var(--font-en);
  color: var(--ink);
}

/* 初クリアで駒が解禁されたときの告知 */
.result-unlock {
  margin-top: 20px;
  padding: 12px 14px;
  text-align: left;
  background: linear-gradient(120deg, rgba(126, 200, 130, 0.14), rgba(126, 200, 130, 0.05));
  border: 1px solid rgba(126, 200, 130, 0.45);
  border-radius: 10px;
  animation: unlock-in 0.5s ease both 0.4s;
}

@keyframes unlock-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.result-unlock__label {
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--green);
  margin-bottom: 8px;
}

.result-unlock__body {
  display: flex;
  align-items: center;
  gap: 12px;
}

.result-unlock__body img {
  width: 46px;
  height: 46px;
  flex: none;
}

.result-unlock__name {
  font-size: 16px;
  color: var(--ink);
}

.result-unlock__cost {
  font-size: 11px;
  color: var(--gold);
}

.result-unlock__role {
  margin-top: 3px;
  font-size: 12px;
  color: var(--ink-dim);
  line-height: 1.5;
}

.result-unlock__hint {
  margin-top: 3px;
  font-size: 11px;
  color: var(--ink-faint);
}

.result-note {
  margin: 18px 0 0;
  font-size: 13px;
  color: var(--ink-dim);
  line-height: 1.7;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 26px;
}

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

#screen-settings {
  align-items: center;
  justify-content: center;
}

.settings {
  display: grid;
  gap: 20px;
}

.setting label,
.setting>span {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--ink-dim);
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.setting output {
  color: var(--gold);
  font-family: var(--font-en);
}

.setting--row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.setting--row>span {
  margin: 0;
}

input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  appearance: none;
  background: linear-gradient(90deg, var(--gold-dim), var(--bg-3));
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid #2a2210;
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid #2a2210;
  cursor: pointer;
}

.settings__note {
  font-size: 12px;
  color: var(--ink-faint);
  text-align: center;
  margin: 0;
}

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

@media (max-width: 1100px) {
  .deckedit {
    grid-template-columns: 1fr 1fr;
  }

  .deckedit__col--detail {
    grid-column: 1 / -1;
  }
}

/* 狭い画面では詳細を上に置き、タイルを送っても見え続けるようにする */
@media (max-width: 860px) {
  .stage-pick {
    grid-template-columns: 1fr;
  }

  .stage-detail {
    order: -1;
    z-index: 2;
    /* 画面を占領しないよう高さを抑え、下のタイルが常に見えるようにする */
    max-height: min(58vh, 420px);
    box-shadow: var(--shadow);
  }
}

@media (max-width: 720px) {
  .deckedit {
    grid-template-columns: 1fr;
  }

  .stage-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px 10px;
  }

  .stage-tile__no {
    font-size: 18px;
  }
}
