/* ============================================================
   components.css — buttons / cards / modals
   ============================================================ */

/* ---------- Button ---------- */
.btn {
  appearance: none;
  background: var(--accent);
  color: #1a1420;
  border: none;
  border-radius: 6px;
  padding: 0.55rem 0.9rem;
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: opacity 0.18s, transform 0.1s;
}
.btn:hover { opacity: 0.9; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn--secondary {
  background: rgba(196,163,90,0.12);
  color: var(--accent);
  border: 1.5px solid var(--accent);
}
.btn--ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid transparent;
}
.btn--ghost:hover { border-color: var(--accent); }

.btn--danger {
  background: transparent;
  color: var(--ifrit);
  border: 1.5px solid var(--ifrit);
}
.btn--danger:hover {
  background: rgba(231,96,96,0.12);
}

/* ---------- Card ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: var(--shadow-md);
}

/* ---------- Modal ---------- */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 120;
  animation: modal-fade-in 0.18s ease;
}
.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.4rem;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modal-pop-in 0.22s cubic-bezier(.2,.8,.4,1);
}
.modal__title {
  margin: 0 0 0.8rem;
  color: var(--accent);
  font-size: 1.1rem;
}
.modal__body {
  margin-bottom: 1rem;
}
.modal__actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

@keyframes modal-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes modal-pop-in {
  from { opacity: 0; transform: scale(0.94) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ---------- Hero select modal (= SPEC-001 Phase 1 mock) ---------- */
.hero-modal {
  position: fixed;
  inset: 0;
  z-index: 320;
  background: rgba(15, 12, 22, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: modal-fade-in 0.18s ease;
}
.hero-modal.hidden { display: none !important; }

.hero-modal__card {
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  background: linear-gradient(180deg, #2c2440 0%, var(--panel) 100%);
  border: 2px solid var(--accent);
  border-radius: 14px;
  padding: 1rem 1.1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  overflow-y: auto;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
  animation: modal-pop-in 0.22s cubic-bezier(.2, .8, .4, 1);
}

.hero-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.hero-modal__title {
  margin: 0;
  font-size: 1.1rem;
  color: var(--accent);
  letter-spacing: 0.04em;
}
.hero-modal__close-x {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
  width: 2rem;
  height: 2rem;
  cursor: pointer;
  border-radius: 4px;
}
.hero-modal__close-x:hover { color: var(--text); background: rgba(255,255,255,0.06); }

.hero-modal__grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.5rem;
}

.hero-modal__hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
  min-height: 1.1em;
}

.hero-modal__cta {
  align-self: stretch;
}

/* ---------- Hero tile (= SPEC-002 data-driven) ---------- */
.hero-tile {
  appearance: none;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  aspect-ratio: 4 / 5;
  padding: 0;
  background: var(--panel-2);
  border: 1.5px solid var(--border);
  border-top: 3px solid var(--border);   /* element accent はここに上書き */
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s, transform 0.1s, background 0.15s, box-shadow 0.15s;
}
.hero-tile:hover { border-color: var(--accent); }
.hero-tile:active { transform: translateY(1px); }
.hero-tile[aria-selected="true"] {
  background: linear-gradient(180deg, rgba(196,163,90,0.18) 0%, var(--panel-2) 70%);
  box-shadow: 0 0 0 2px rgba(196, 163, 90, 0.45);
}

.hero-tile[data-faction="SEIRYU"] { border-top-color: var(--seiryu); }
.hero-tile[data-faction="SUZAKU"] { border-top-color: var(--suzaku); }
.hero-tile[data-faction="BYAKKO"] { border-top-color: var(--byakko); }
.hero-tile[data-faction="GENBU"]  { border-top-color: var(--genbu); }
.hero-tile[data-faction="KOURYU"] { border-top-color: var(--kouryu); }

.hero-tile__portrait {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background:
    radial-gradient(circle at 50% 35%, rgba(196,163,90,0.12), transparent 70%),
    var(--panel);
  display: block;
}
.hero-tile__portrait--missing {
  /* CDN 画像 404 時、 src を外して silhouette gradient のみ残す */
  opacity: 0.6;
}

.hero-tile__meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  padding: 0.3rem 0.3rem 0.4rem;
  text-align: center;
}
.hero-tile__name {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.04em;
  line-height: 1.1;
}
.hero-tile__sub {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.hero-tile__faction { font-size: 0.85rem; line-height: 1; }
.hero-tile__rarity[data-rarity="Common"]    { color: var(--muted); }
.hero-tile__rarity[data-rarity="Uncommon"]  { color: var(--garuda); }
.hero-tile__rarity[data-rarity="Rare"]      { color: var(--leviathan); }
.hero-tile__rarity[data-rarity="Epic"]      { color: var(--rarity-sr); }
.hero-tile__rarity[data-rarity="Legendary"] { color: var(--rarity-ssr); }

@media (max-width: 480px) {
  .hero-modal__grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.35rem; }
  .hero-tile__name { font-size: 0.78rem; }
  .hero-tile__sub  { font-size: 0.62rem; }
}

/* ---------- Header owned-hero badge ---------- */
.header__hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 0.6rem;
  padding: 0.18rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--text);
  background: rgba(196, 163, 90, 0.08);
  letter-spacing: 0.04em;
}
.header__hero-badge[data-faction="SEIRYU"] { border-color: var(--seiryu); }
.header__hero-badge[data-faction="SUZAKU"] { border-color: var(--suzaku); }
.header__hero-badge[data-faction="BYAKKO"] { border-color: var(--byakko); }
.header__hero-badge[data-faction="GENBU"]  { border-color: var(--genbu); }
.header__hero-badge[data-faction="KOURYU"] { border-color: var(--kouryu); }

/* ---------- Help overlay ---------- */
.help-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 130;
}
.help-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.4rem;
  max-width: 520px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
}
.help-card h2 {
  margin-top: 0;
  color: var(--accent);
}

/* ---------- Notification tile ---------- */
.notif-layer {
  position: fixed;
  top: 4rem;
  right: 1rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  pointer-events: none;
}
.notification {
  position: relative;
  padding: 0.4rem 0.6rem;
  background: var(--panel-2);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  font-size: 0.78rem;
  pointer-events: auto;
  animation: slide-in 0.3s ease;
}
@keyframes slide-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ============================================================
   HUD (= SPEC-004 Survival HUD: Day + 3 stat bars)
   ============================================================ */
.hud {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
  color: var(--text);
}
.hud__level {
  font-weight: 700;
  min-width: 48px;
  white-space: nowrap;
  letter-spacing: 0.04em;
  color: var(--accent);
}
.hud__elapsed {
  font-weight: 600;
  min-width: 56px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  opacity: 0.85;
}
.hud__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 0;
  min-width: 0;
}
.hud__bar-label {
  width: 32px;
  opacity: 0.9;
  flex-shrink: 0;
}
.hud__bar-track {
  flex: 1 1 0;
  height: 8px;
  min-width: 40px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}
.hud__bar-fill {
  display: block;
  height: 100%;
  width: 100%;
  transition: width 0.4s linear;
}
.hud__bar[data-stat="hp"] .hud__bar-fill { background: var(--hp); }
.hud__bar[data-stat="xp"] .hud__bar-fill { background: var(--xp); }
.hud__bar-value {
  min-width: 44px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* ============================================================
   Battle stage canvas + virtual joystick (= SPEC-006)
   ============================================================ */
.battle-canvas {
  /* SPEC-010: position absolute で親 .stage の resolved size に確実に追従 (= flex 競合回避) */
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  background: #0e0c14;
  touch-action: none;       /* スクロール / ズーム抑止 */
  user-select: none;
  -webkit-user-select: none;
}

.joystick {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}
.joystick.hidden { display: none; }

.joystick__base {
  position: absolute;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid rgba(255, 255, 255, 0.18);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.joystick__stick {
  position: absolute;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(196, 163, 90, 0.45);
  border: 2px solid var(--accent);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* ============================================================
   Level-up modal (= SPEC-008、 starter pick + LV up)
   ============================================================ */
.levelup-modal {
  position: fixed; inset: 0; z-index: 320;
  background: rgba(15, 12, 22, 0.92);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  animation: modal-fade-in 0.18s ease;
}
.levelup-modal.hidden { display: none !important; }

.levelup-modal__card {
  width: 100%; max-width: 560px;
  background: linear-gradient(180deg, #2c2440 0%, var(--panel) 100%);
  border: 2px solid var(--accent);
  border-radius: 14px;
  padding: 1rem 1.1rem 1.1rem;
  display: flex; flex-direction: column;
  gap: 0.8rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
  animation: modal-pop-in 0.22s cubic-bezier(.2, .8, .4, 1);
}

.levelup-modal__title {
  margin: 0;
  text-align: center;
  color: var(--accent);
  font-size: 1.3rem;
  letter-spacing: 0.08em;
}
.levelup-modal__sub {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.levelup-modal__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

/* SPEC-010: アイコン + メインの 2 列 grid に再設計 */
.levelup-card {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
  background: var(--panel-2);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s, background 0.15s;
  min-height: 156px;
  text-align: center;
}
.levelup-card:hover  { border-color: var(--accent); }
.levelup-card:active { transform: translateY(1px); }

.levelup-card__icon-wrap {
  width: 100%;
  aspect-ratio: 1;
  background: linear-gradient(135deg, var(--panel-2), var(--panel));
  border: 1.5px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.levelup-card__icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.levelup-card__icon--missing {
  background: linear-gradient(135deg, var(--panel), var(--panel-2));
}

.levelup-card__main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  min-width: 0;
  flex: 1;
}
.levelup-card__series {
  width: 100%;
  height: 5px;
  border-radius: 3px;
}
.levelup-card__name {
  font-weight: 800;
  font-size: 0.86rem;
  line-height: 1.15;
  margin-top: 0.15rem;
  word-break: break-word;
}
.levelup-card__series-label {
  font-size: 0.66rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.levelup-card__skill {
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.levelup-card__effect {
  font-size: 0.68rem;
  color: var(--text);
  opacity: 0.85;
  letter-spacing: 0.02em;
  line-height: 1.3;
  text-align: center;
}
.levelup-card[data-category="buff"] {
  border-color: rgba(94, 207, 138, 0.5);
}

/* SPEC-024: カード上端のカテゴリ見出し (= 武器エクステ / 強化エクステ) */
.levelup-card__cat {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 0.18rem 0.4rem;
  border-radius: 999px;
  align-self: center;
  background: rgba(231, 96, 96, 0.18);
  color: #f4b8b8;
  border: 1px solid rgba(231, 96, 96, 0.55);
}
.levelup-card[data-category="buff"] .levelup-card__cat {
  background: rgba(94, 207, 138, 0.18);
  color: #b8eccb;
  border-color: rgba(94, 207, 138, 0.6);
}
.levelup-card__lv {
  font-size: 0.74rem;
  color: var(--accent);
  font-weight: 700;
  margin-top: auto;
}

@media (max-width: 480px) {
  .levelup-modal__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.35rem; }
  .levelup-card { padding: 0.4rem; min-height: 132px; gap: 0.3rem; }
  .levelup-card__name { font-size: 0.74rem; }
  .levelup-card__series-label { font-size: 0.6rem; }
  .levelup-card__effect { font-size: 0.62rem; }
  .levelup-card__lv { font-size: 0.66rem; }
  .levelup-card__cat { font-size: 0.58rem; padding: 0.14rem 0.3rem; }
}

/* ============================================================
   Game Over modal (= SPEC-009)
   ============================================================ */
.gameover-modal {
  position: fixed; inset: 0; z-index: 330;
  background: rgba(15, 12, 22, 0.95);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  animation: modal-fade-in 0.2s ease;
}
.gameover-modal.hidden { display: none !important; }

.gameover-modal__card {
  width: 100%; max-width: 400px;
  background: linear-gradient(180deg, #2c2440 0%, var(--panel) 100%);
  border: 2px solid var(--ifrit, #e76060);
  border-radius: 14px;
  padding: 1.2rem 1.1rem;
  display: flex; flex-direction: column;
  gap: 1rem;
  text-align: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
  animation: modal-pop-in 0.22s cubic-bezier(.2, .8, .4, 1);
}

.gameover-modal__title {
  margin: 0;
  color: var(--ifrit, #e76060);
  font-size: 1.4rem;
  letter-spacing: 0.1em;
}

.gameover-modal__stats {
  display: flex; flex-direction: column;
  gap: 0.25rem;
  color: var(--text);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}
.gameover-stat { line-height: 1.4; }

.gameover-modal__form {
  display: flex; flex-direction: column;
  gap: 0.5rem;
}
.gameover-form__label {
  color: var(--muted);
  font-size: 0.78rem;
  text-align: left;
  letter-spacing: 0.04em;
}
.gameover-form__input {
  appearance: none;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.55rem 0.7rem;
  font-size: 0.95rem;
  width: 100%;
  box-sizing: border-box;
}
.gameover-form__input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
}
.gameover-form__msg {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  min-height: 1em;
}
.gameover-modal__retry {
  margin-top: 0.3rem;
}

/* ============================================================
   Hero detail panel (= SPEC-014、 hero modal 内に統合)
   ============================================================ */
.hero-detail {
  background: linear-gradient(180deg, rgba(196,163,90,0.10), rgba(0,0,0,0.0));
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem;
  min-height: 96px;
}
.hero-detail__placeholder {
  text-align: center;
  color: var(--muted);
  padding: 1.4rem 0;
  font-size: 0.85rem;
}
.hero-detail__placeholder.hidden,
.hero-detail__content.hidden { display: none !important; }

.hero-detail__content {
  display: grid;
  grid-template-columns: 64px 1fr 1fr;
  gap: 0.55rem;
  align-items: center;
}
.hero-detail__portrait {
  width: 64px; height: 64px;
  object-fit: cover;
  border-radius: 6px;
  border: 1.5px solid var(--accent);
  background: var(--panel);
}
.hero-detail__portrait--missing {
  background: linear-gradient(135deg, var(--panel-2), var(--panel));
}
.hero-detail__info { min-width: 0; }
.hero-detail__name {
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  line-height: 1.15;
}
.hero-detail__sub {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 0.1rem;
}
.hero-detail__stats {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.3rem;
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
}
.hero-detail__stat {
  white-space: nowrap;
}

.hero-detail__weapon {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 0.4rem;
  align-items: center;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.3rem;
  min-width: 0;
}
.hero-detail__weapon-icon {
  width: 40px; height: 40px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--panel);
}
.hero-detail__weapon-icon--missing {
  background: linear-gradient(135deg, var(--panel-2), var(--panel));
}
.hero-detail__weapon-info { min-width: 0; }
.hero-detail__weapon-label {
  font-size: 0.6rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.hero-detail__weapon-name {
  font-weight: 700;
  font-size: 0.78rem;
  line-height: 1.15;
  word-break: break-word;
}
.hero-detail__weapon-skill {
  font-size: 0.7rem;
  color: var(--accent);
  margin-top: 0.05rem;
}
.hero-detail__weapon-desc {
  font-size: 0.6rem;
  color: var(--text);
  opacity: 0.8;
  margin-top: 0.1rem;
  line-height: 1.25;
  word-break: break-word;
}

@media (max-width: 480px) {
  .hero-detail__content {
    grid-template-columns: 56px 1fr;
    gap: 0.4rem;
  }
  .hero-detail__weapon { grid-column: 1 / -1; }
  .hero-detail__portrait { width: 56px; height: 56px; }
}

/* SPEC-023: ピッカーリロールボタン (= モーダル下部) */
.levelup-modal__reroll {
  align-self: stretch;
  margin-top: 0.4rem;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
.levelup-modal__reroll:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* SPEC-033: 活動レポートモーダル (= 全ステージ clear 時) */
.report-card {
  max-width: 560px;
}
.report-hero {
  margin: 0.2rem 0 0.6rem;
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.report-stages-wrap {
  overflow-x: auto;
  margin: 0.4rem 0 0.6rem;
}
.report-stages {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}
.report-stages th, .report-stages td {
  padding: 0.32rem 0.4rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.report-stages th {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  background: rgba(196, 163, 90, 0.06);
}
.report-stages tbody tr:last-child td { border-bottom: none; }
.report-stages__ext {
  color: var(--text);
  opacity: 0.85;
  word-break: break-word;
}
.report-totals {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  align-items: center;
  margin: 0.4rem 0 0.6rem;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.report-totals__score {
  font-size: 1.1rem;
  color: var(--accent);
}

@media (max-width: 480px) {
  .report-stages { font-size: 0.7rem; }
  .report-stages th { font-size: 0.64rem; padding: 0.22rem 0.3rem; }
  .report-stages td { padding: 0.22rem 0.3rem; }
  .report-totals { font-size: 0.78rem; }
  .report-totals__score { font-size: 1rem; }
}

/* SPEC-034: 一時停止メニュー */
.pause-menu__card {
  max-width: 360px;
}
.pause-menu__buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: stretch;
  margin-top: 0.4rem;
}
.pause-menu__buttons .btn {
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  padding: 0.7rem 1rem;
}

/* SPEC-035: ランキングモーダル */
.ranking-card {
  max-width: 520px;
}
.title-screen__ranking {
  margin-top: 0.4rem;
  font-size: 0.86rem;
  letter-spacing: 0.04em;
}
.ranking-toolbar {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  margin: 0.3rem 0 0.4rem;
}
.ranking-filter {
  flex: 1;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.5rem;
  font-size: 0.84rem;
}
.ranking-table-wrap {
  overflow-x: auto;
  margin-bottom: 0.5rem;
}
.ranking-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
}
.ranking-table th, .ranking-table td {
  padding: 0.32rem 0.4rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}
.ranking-table th {
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  background: rgba(196, 163, 90, 0.06);
}
.ranking-table tbody tr:last-child td { border-bottom: none; }
.ranking-table .ranking-rank   { width: 2.2rem; color: var(--accent); font-weight: 800; }
.ranking-table .ranking-player { word-break: break-word; }
.ranking-table .ranking-score  { color: var(--accent); font-weight: 700; }
.ranking-msg {
  min-height: 1.1em;
  margin: 0 0 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.ranking-config {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.6rem;
  background: rgba(196, 163, 90, 0.06);
  border: 1px dashed var(--border);
  border-radius: 8px;
  margin-bottom: 0.5rem;
}
.ranking-config__label {
  font-size: 0.74rem;
  color: var(--muted);
}
.ranking-close {
  align-self: stretch;
  margin-top: 0.4rem;
}

@media (max-width: 480px) {
  .ranking-table          { font-size: 0.78rem; }
  .ranking-table th       { font-size: 0.66rem; padding: 0.22rem 0.3rem; }
  .ranking-table td       { padding: 0.22rem 0.3rem; }
}

/* SPEC-037: ゲームモード選択画面 + ABSOLUTE スライダー */
.mode-select {
  gap: 1rem;
  padding: 2rem 1rem 1rem;
}
.mode-select__title {
  margin: 0;
  font-size: clamp(1.4rem, 4.5vw, 2rem);
  color: var(--accent);
  letter-spacing: 0.06em;
}
.mode-select__sub {
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.78rem, 2vw, 0.95rem);
}
.mode-select__cards {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  max-width: 760px;
}
.mode-card {
  flex: 1 1 320px;
  min-width: 280px;
  max-width: 360px;
  background: var(--panel);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  text-align: left;
}
.mode-card[data-mode="ABSOLUTE"] { border-color: rgba(231, 96, 96, 0.55); }
.mode-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}
.mode-card__name {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.mode-card__mul {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text);
}
.mode-card[data-mode="ABSOLUTE"] .mode-card__mul { color: #ff8a8a; }
.mode-card__desc {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
}
.mode-card__cta {
  align-self: stretch;
  margin-top: auto;
}
.mode-card__sliders {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.4rem 0.2rem 0.2rem;
}
.abs-slider {
  display: grid;
  grid-template-columns: minmax(7em, auto) 1fr 3.5em;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.78rem;
}
.abs-slider__label {
  color: var(--muted);
}
.abs-slider__range {
  width: 100%;
  accent-color: var(--accent);
}
.abs-slider__value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--text);
}
.mode-select__back {
  align-self: center;
  margin-top: 0.4rem;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

/* SPEC-037: gameover の 2 ボタン choices */
.gameover-modal__choices {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-self: stretch;
  margin-top: 0.4rem;
}
.gameover-modal__choices .btn { letter-spacing: 0.04em; }

/* SPEC-038: 活動レポートをアイコン重視に刷新 + スコアを大きく */
.report-hero { padding: 0; margin: 0.2rem 0 0.6rem; }
.report-hero__inner {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.45rem 0.6rem;
  background: var(--panel-2);
  border: 1.5px solid var(--border);
  border-top: 3px solid var(--border);
  border-radius: 10px;
}
.report-hero__inner[data-faction="SEIRYU"] { border-top-color: var(--seiryu); }
.report-hero__inner[data-faction="SUZAKU"] { border-top-color: var(--suzaku); }
.report-hero__inner[data-faction="BYAKKO"] { border-top-color: var(--byakko); }
.report-hero__inner[data-faction="GENBU"]  { border-top-color: var(--genbu);  }
.report-hero__inner[data-faction="KOURYU"] { border-top-color: var(--kouryu); }
.report-hero__portrait {
  width: 56px; height: 56px;
  object-fit: cover;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, rgba(196,163,90,0.18), transparent 70%), var(--panel);
  flex-shrink: 0;
}
.report-hero__portrait--missing { opacity: 0.55; }
.report-hero__name {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--text);
}

/* SPEC-038: ステージカード (= 旧テキスト table を icon タイル化) */
.report-stages {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0 0 0.6rem;
}
.report-stage {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.5rem;
}
.report-stage__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
}
.report-stage__name { font-weight: 800; color: var(--accent); letter-spacing: 0.04em; }
.report-stage__stats { color: var(--muted); font-variant-numeric: tabular-nums; }
.report-stage__exts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
}
.report-ext {
  position: relative;
  width: 38px; height: 38px;
  border-radius: 6px;
  background: var(--panel);
  border: 1px solid var(--border);
  overflow: hidden;
  flex-shrink: 0;
}
.report-ext__icon {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.report-ext__icon--missing {
  background: linear-gradient(135deg, var(--panel-2), var(--panel));
}
.report-ext__lv {
  position: absolute;
  bottom: 0; right: 0;
  background: rgba(0, 0, 0, 0.72);
  color: var(--accent);
  font-size: 0.62rem;
  font-weight: 800;
  padding: 0 3px;
  border-top-left-radius: 4px;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.report-ext--empty {
  color: var(--muted);
  font-size: 0.8rem;
}

/* SPEC-038: 総合スタッツ: メタ行 + 巨大スコア */
.report-meta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin: 0.4rem 0 0.2rem;
  font-size: 0.82rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.report-meta { white-space: nowrap; }
.report-score-big {
  font-size: clamp(2.6rem, 9vw, 4rem);
  font-weight: 900;
  text-align: center;
  color: var(--accent);
  letter-spacing: 0.04em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 12px rgba(196, 163, 90, 0.35);
  margin: 0.1rem 0 0;
}
.report-score-label {
  text-align: center;
  font-size: 0.74rem;
  color: var(--muted);
  letter-spacing: 0.3em;
  margin-bottom: 0.4rem;
}

/* SPEC-038: ranking modal もスコアカラム強調 */
.ranking-table .ranking-score {
  font-size: 1.05rem;
  font-weight: 900;
}

@media (max-width: 480px) {
  .report-hero__portrait { width: 48px; height: 48px; }
  .report-hero__name { font-size: 0.95rem; }
  .report-ext { width: 34px; height: 34px; }
  .report-ext__lv { font-size: 0.58rem; }
  .report-stage__head { font-size: 0.72rem; }
}
