/* タイトル・メニュー系の画面（装備・工房・ガチャ・店・なかま・アルバム・設定・リザルトなど）。 */

/* ================= タイトル ================= */
.title { background: linear-gradient(180deg, #1b2470 0%, #6a3a9a 34%, #ff6a5a 62%, #ffc06a 78%, #ffe3a0 100%); color: #fff; }
.title-kv { position: absolute; inset: 0; z-index: 1; }
.title-kv-img { width: 100%; height: 100%; object-fit: cover; }
.title.has-kv .title-art { display: none; }
.title-art { position: absolute; inset: 0; overflow: hidden; }
.title-sun { position: absolute; left: 28%; top: 54%; width: 46vh; height: 46vh; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle, #fff7d0 0%, #ffd36b 40%, rgba(255, 140, 60, 0) 70%); filter: blur(2px); }
.title-rays { position: absolute; left: 28%; top: 54%; width: 220vmax; height: 220vmax; transform: translate(-50%, -50%);
  background: repeating-conic-gradient(rgba(255, 255, 255, .13) 0 6deg, transparent 6deg 18deg); animation: spin 60s linear infinite; }
.title-bigruler { position: absolute; left: -10%; right: -10%; top: 44%; height: 12vh; transform: rotate(-8deg); border: 4px solid rgba(255,255,255,.95);
  background: linear-gradient(180deg, rgba(200, 240, 255, .55), rgba(140, 210, 255, .3)); box-shadow: 0 0 40px rgba(180, 230, 255, .9), inset 0 0 30px rgba(255,255,255,.6); }
.title-bigruler::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 45%; background: var(--ruler-ticks); background-size: 100% 100%; opacity: .55; }
.title-bigruler i { position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.9) 50%, transparent 70%); background-size: 300% 100%; animation: shine-x 3.5s linear infinite; }
.title-stars i { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: #fff; box-shadow: 0 0 6px #fff; animation: p-twinkle 2.4s ease-in-out infinite; }
.title-chars { position: absolute; left: 0; bottom: 0; width: 56%; height: 92%; }
.title-char { position: absolute; bottom: -2%; height: 100%; display: flex; align-items: flex-end; }
.title-char--kanata { left: 22%; height: 98%; animation: title-char-in .9s .2s cubic-bezier(.2, .9, .3, 1) backwards; z-index: 2; }
.title-char--chika { left: 46%; height: 92%; animation: title-char-in .9s .35s cubic-bezier(.2, .9, .3, 1) backwards; filter: brightness(.92); }
.title-char-img { height: 100%; width: auto; filter: drop-shadow(0 0 3px #fff) drop-shadow(8px 8px 0 rgba(27, 31, 59, .35)); }
.title-char .ph-portrait { width: 26vh; height: 86%; }
@keyframes title-char-in { from { opacity: 0; transform: translateX(-60px); } }
.title-floor { position: absolute; left: 0; right: 0; bottom: 0; height: 18%; background: linear-gradient(180deg, transparent, rgba(30, 20, 60, .55)); }
.title-speed { position: absolute; inset: 0; z-index: 2; pointer-events: none; background: repeating-linear-gradient(170deg, transparent 0 40px, rgba(255,255,255,.05) 40px 42px); }
.title-logo-wrap { position: absolute; z-index: 3; right: calc(var(--safe-r) + 4vw); top: 10vh; width: min(50vw, 820px); display: flex; flex-direction: column; align-items: center; animation: pop-in .7s .1s cubic-bezier(.2, 1.4, .4, 1) backwards; }
.title-sub { margin-top: 1vh; padding: .2em 1.2em; border-radius: 999px; background: rgba(27, 31, 59, .85); border: 3px solid #fff; font: 800 clamp(12px, 1vw + .6vh, 24px) var(--font-ui); letter-spacing: .08em; white-space: nowrap; }
.title-menu { position: absolute; z-index: 4; right: calc(var(--safe-r) + 4vw); bottom: calc(var(--safe-b) + 7vh); width: min(40vw, 520px); display: flex; flex-direction: column; gap: clamp(8px, 1.6vh, 18px); align-items: stretch; }
.title-btn { width: 100%; font-size: var(--fs-l); animation: telop-in .5s backwards; }
.title-btn:nth-child(1) { animation-delay: .5s; } .title-btn:nth-child(2) { animation-delay: .6s; }
.title-menu-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; animation: fade-in .5s .7s backwards; }
/* キービジュアルがあるときは、絵の左の空き（夕焼けの空）にロゴとメニューを置く */
.title.has-kv .title-logo-wrap { left: calc(var(--safe-l) + 3vw); right: auto; top: 6vh; width: min(40vw, 640px); }
.title.has-kv .title-menu { left: calc(var(--safe-l) + 5vw); right: auto; width: min(30vw, 420px); }
.title.has-kv .title-kv::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(20, 16, 60, .45) 0%, rgba(20, 16, 60, 0) 45%); pointer-events: none; }
.title.has-kv .title-speed { display: none; }
.title-foot { position: absolute; z-index: 4; left: calc(var(--safe-l) + 12px); right: 12px; bottom: calc(var(--safe-b) + 6px); display: flex; justify-content: space-between; font-size: var(--fs-xs); color: rgba(255,255,255,.75); text-shadow: 0 1px 2px #000; pointer-events: none; }

/* ロゴ（画像が無いうちは文字で） */
.logo { position: relative; display: flex; flex-direction: column; align-items: center; width: 100%; }
.logo-img { width: 100%; height: auto; display: block; filter: drop-shadow(0 8px 0 rgba(0,0,0,.25)); }
.logo.has-img .logo-text, .logo.has-img .logo-ruler { display: none; }
.logo-text { position: relative; display: flex; flex-direction: column; align-items: center; line-height: .95; transform: rotate(-4deg); }
.logo-l1, .logo-l2 { font-family: var(--font-title); letter-spacing: .02em; white-space: nowrap;
  background: linear-gradient(180deg, #fff6a0 0%, #ffb02e 40%, #ff4a1c 70%, #c4160c 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 0 #fff) drop-shadow(3px 3px 0 #fff) drop-shadow(-3px -3px 0 #fff) drop-shadow(3px -3px 0 #fff) drop-shadow(-3px 3px 0 #fff) drop-shadow(0 6px 0 var(--c-accent-2)) drop-shadow(0 10px 8px rgba(0,0,0,.35)); }
.logo-l1 { font-size: clamp(54px, 9vw, 180px); }
.logo-l2 { font-size: clamp(28px, 4.6vw, 92px); margin-top: -.05em; }
.logo-l2 em { font-style: normal; display: inline-block; transform: rotate(12deg); background: inherit; -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo-ruler { position: absolute; left: 4%; right: 4%; top: 46%; height: 18%; transform: rotate(-4deg); background: linear-gradient(180deg, #c8f0ff, #6fc2ff); border: 4px solid var(--c-accent-2); border-radius: 6px;
  box-shadow: 0 6px 0 var(--c-accent-2); }
.logo-ruler::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 55%; background: var(--ruler-ticks); background-size: 100% 100%; }
.logo--credits { width: min(60vw, 700px); margin: 0 auto 2vh; }

/* ================= メニュー系の画面の枠 ================= */
.ms { background: var(--c-bg); color: #fff; display: flex; flex-direction: column; }
.ms-bg { position: absolute; inset: 0; z-index: 0; background: var(--ms-bg, none), var(--c-bg); background-size: cover; filter: blur(3px) brightness(.45) saturate(1.1); transform: scale(1.05); }
.ms::before { content: ''; position: absolute; inset: 0; z-index: 0; background: var(--stripe), radial-gradient(ellipse at 20% 0%, rgba(127, 216, 255, .18), transparent 60%); pointer-events: none; }
.ms--equip { --c-bg: #1a2a6a; } .ms--forge { --c-bg: #3a1e12; } .ms--gacha { --c-bg: #4a1a52; } .ms--shop { --c-bg: #1c4a3a; } .ms--bond { --c-bg: #5a1f40; } .ms--album { --c-bg: #2a245a; } .ms--room { --c-bg: #3a2a50; } .ms--battle { --c-bg: #1a1030; }
.ms.is-push { animation: ms-in .28s cubic-bezier(.2, .9, .3, 1); }
@keyframes ms-in { from { opacity: 0; transform: translateY(18px) scale(.985); } }
.ms-top { position: relative; z-index: 2; flex: none; display: flex; align-items: center; gap: var(--gap); height: clamp(48px, 9vh, 80px);
  padding: 0 calc(var(--safe-r) + 12px) 0 calc(var(--safe-l) + 10px); background: linear-gradient(180deg, rgba(8, 12, 36, .9), rgba(8, 12, 36, .6)); border-bottom: 3px solid rgba(255,255,255,.85); }
.ms-back { flex: none; width: clamp(38px, 6.4vh, 54px); height: clamp(38px, 6.4vh, 54px); min-width: 0; min-height: 0; font-size: var(--fs-m); }
.ms-titles { min-width: 0; }
.ms-title { font: 400 var(--fs-l)/1.1 var(--font-title); letter-spacing: .06em; transform: skewX(-8deg); text-shadow: 0 3px 0 var(--c-accent); white-space: nowrap; }
.ms-subtitle { font-size: var(--fs-xs); font-weight: 700; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-top-extra { flex: 1; }
.ms-wallet { display: flex; gap: 8px; }
.ms-body { position: relative; z-index: 1; flex: 1; min-height: 0; overflow: auto; padding: var(--gap) calc(var(--safe-r) + var(--gap)) calc(var(--safe-b) + var(--gap)) calc(var(--safe-l) + var(--gap)); scrollbar-width: thin; }
.eq-sub { font: 800 var(--fs-s) var(--font-ui); color: var(--c-ice); margin: .2em 0 .4em; display: flex; gap: .6em; align-items: baseline; }
.eq-sub small { color: #fff; opacity: .8; font-weight: 700; }
.panel .eq-sub { color: var(--c-accent-2); }
.panel .eq-sub small { color: var(--c-text-dim); }
.empty { padding: 1.4em; text-align: center; color: var(--c-text-dim); font-weight: 700; }
.ms .empty { color: rgba(255,255,255,.7); }
.panel .empty { color: var(--c-text-dim); }

/* タブ */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: var(--gap); }
.tab { position: relative; padding: .45em 1.1em; min-height: 38px; border-radius: 10px 10px 4px 4px; border: 3px solid var(--c-line); background: #d8def5; color: var(--c-text); font: 800 var(--fs-s) var(--font-ui); cursor: pointer; transform: skewX(-8deg); box-shadow: 0 3px 0 var(--c-line); transition: transform .1s, background .15s; }
.tab > * { display: inline-block; transform: skewX(8deg); }
.tab:hover { background: #fff; }
.tab.is-on { background: linear-gradient(180deg, #ffb347, #ff6a2b); color: #fff; transform: skewX(-8deg) translateY(-3px); text-shadow: 0 1px 0 rgba(0,0,0,.3); }
.tab-badge { position: absolute; right: -6px; top: -8px; font-style: normal; background: var(--c-danger); color: #fff; border-radius: 999px; padding: 0 .4em; font-size: .75em; }
.tabs--v { flex-direction: column; flex-wrap: nowrap; }
.tabs--v .tab { border-radius: 10px; text-align: left; }

/* 定規の2D絵 */
.ruler-art { --rb: #e8f6ff; --rs: #1b1f3b; position: relative; display: grid; place-items: center; width: 100%; }
.ruler-art-body { position: relative; width: 92%; aspect-ratio: 6 / 1; border-radius: 6px; background: var(--rb); border: 3px solid var(--c-line); box-shadow: 0 5px 0 var(--c-line), 0 10px 18px rgba(0,0,0,.25); overflow: hidden; transform: rotate(-6deg); }
.ruler-art.is-clear .ruler-art-body { background: linear-gradient(180deg, color-mix(in srgb, var(--rb) 70%, transparent), color-mix(in srgb, var(--rb) 40%, transparent)); backdrop-filter: blur(2px); }
.ruler-art-ticks { position: absolute; left: 4%; right: 4%; top: 0; height: 42%; background: repeating-linear-gradient(90deg, var(--rs) 0 2px, transparent 2px 10%), repeating-linear-gradient(90deg, var(--rs) 0 1px, transparent 1px 2%); background-size: 100% 100%, 100% 55%; background-repeat: no-repeat; opacity: .75; }
.ruler-art-shine { position: absolute; inset: 0; background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.75) 45%, transparent 55%); background-size: 250% 100%; animation: shine-x 4s linear infinite; }
.ruler-art-name { position: absolute; left: 6%; bottom: 8%; font: 400 clamp(9px, 1vw, 18px) var(--font-title); color: var(--rs); opacity: .7; white-space: nowrap; }
.ruler-art--s .ruler-art-name { display: none; }
.ruler-art--s .ruler-art-body { border-width: 2px; box-shadow: 0 3px 0 var(--c-line); }
.ruler-art.shape-tri45 .ruler-art-body, .ruler-art.shape-tri60 .ruler-art-body { aspect-ratio: 2 / 1; clip-path: polygon(0 100%, 100% 100%, 0 0); width: 60%; border-radius: 0; }
.ruler-art.shape-protractor .ruler-art-body { aspect-ratio: 2 / 1; border-radius: 999px 999px 4px 4px; width: 60%; }
.ruler-art.shape-blob .ruler-art-body { aspect-ratio: 2.4 / 1; border-radius: 60% 40% 55% 45% / 60% 50% 50% 40%; width: 70%; }
.ruler-art.shape-ring .ruler-art-body, .ruler-art.shape-compass .ruler-art-body { aspect-ratio: 1; border-radius: 50%; width: 40%; }
.ruler-art.dan-1 .ruler-art-body { box-shadow: 0 5px 0 var(--c-line), 0 0 14px rgba(127, 216, 255, .9); }
.ruler-art.dan-2 .ruler-art-body { box-shadow: 0 5px 0 var(--c-line), 0 0 20px rgba(255, 140, 60, .95); }
.ruler-art.dan-3 .ruler-art-body { box-shadow: 0 5px 0 var(--c-line), 0 0 26px rgba(255, 230, 110, 1); }
.ruler-art-slots { position: absolute; right: 4%; bottom: 10%; display: flex; gap: 3%; width: 50%; justify-content: flex-end; }
.ruler-slot { width: 13%; aspect-ratio: 1; border-radius: 50%; border: 2px dashed rgba(27, 31, 59, .45); display: grid; place-items: center; overflow: hidden; }
.ruler-slot.is-filled { border: 0; }
.ruler-slot img, .ruler-slot .ph { width: 100%; height: 100%; object-fit: contain; font-size: 6px; }

/* 定規のカード */
.rlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 8px; padding-top: 8px; }
.rlist > * { min-width: 0; }
.rcard { position: relative; display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 12px; border: 3px solid var(--c-line); background: var(--c-panel); color: var(--c-text); cursor: pointer; text-align: left; font-family: var(--font-ui); box-shadow: 0 4px 0 var(--c-line); transition: transform .1s; }
.rcard:hover { transform: translateY(-2px); }
.rcard.is-on { background: linear-gradient(180deg, #fff6d8, #ffe08a); outline: 3px solid var(--c-accent); }
.rcard-art { flex: none; width: 28%; }
.rcard-main { flex: 1; min-width: 0; }
.rcard-name { display: flex; align-items: center; gap: 6px; font-weight: 900; font-size: var(--fs-s); }
.rcard-name span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.rcard:has(.rcard-badge) .rcard-name { padding-right: 3.4em; }   /* 右上の「メイン」の札で名前が隠れないように */
.rcard-meta { display: flex; gap: 8px; font-size: var(--fs-xs); font-weight: 800; color: var(--c-text-dim); flex-wrap: wrap; }
.rcard-plus { color: var(--c-accent); }
.rcard-power b { color: var(--c-accent-2); }
.rcard-badge { position: absolute; right: 6px; top: -8px; padding: 0 .6em; border-radius: 6px; background: var(--c-accent); color: #fff; font: 800 var(--fs-xs) var(--font-ui); border: 2px solid var(--c-line); }

/* 能力値 */
.stats { display: flex; flex-direction: column; gap: 4px; }
.stat { display: grid; grid-template-columns: 7.2em minmax(2.5em, 1fr) minmax(5.6em, auto) 1.2em; align-items: center; gap: 6px; font-size: var(--fs-s); font-weight: 800; }
.stat-name { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.stat-ic { display: inline-grid; width: 1.5em; height: 1.5em; } .stat-ic img, .stat-ic .ph { width: 100%; height: 100%; font-size: 8px; object-fit: contain; }
.stat-bar { height: .7em; border-radius: 999px; background: rgba(27, 31, 59, .15); overflow: hidden; border: 2px solid var(--c-line); }
.stat-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ffb347, #ff6a2b); transition: width .5s cubic-bezier(.2, .9, .3, 1); }
.stat--hp .stat-bar i { background: linear-gradient(90deg, #7af0b0, #22b46a); } .stat--wt .stat-bar i { background: linear-gradient(90deg, #c8b0ff, #7a50e0); }
.stat--grip .stat-bar i { background: linear-gradient(90deg, #ffe680, #e0a800); } .stat--tec .stat-bar i { background: linear-gradient(90deg, #8fe0ff, #2f8fe0); }
.stat-val { text-align: right; font-size: 1.05em; white-space: nowrap; }
.stat-diff.up { color: var(--c-ok); } .stat-diff.down { color: var(--c-danger); }
.power { display: flex; align-items: baseline; justify-content: space-between; gap: .6em; padding: .3em .8em; margin: .4em 0; border-radius: 10px; background: linear-gradient(90deg, var(--c-accent-2), #3a4ab0); color: #fff; border: 3px solid var(--c-line); }
.power-label { font: 800 var(--fs-xs) var(--font-ui); letter-spacing: .1em; white-space: nowrap; }
.power-val { font-size: var(--fs-l); line-height: 1.15; color: var(--c-gold); text-shadow: 0 2px 0 rgba(0,0,0,.4); overflow-wrap: anywhere; }   /* 無量大数の桁は折り返す（敵側と同じ） */
.hearts { display: inline-flex; gap: 1px; } .hearts i { font-style: normal; color: #d9cbd2; } .hearts i.on { color: var(--c-heart); }

/* ================= メニュー（ハブ） ================= */
.menu-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: var(--gap); height: 100%; }
.menu-hero { display: flex; gap: var(--gap); overflow: hidden; min-height: 0; }
.menu-hero-art { flex: none; width: 40%; display: flex; align-items: flex-end; justify-content: center; margin: -10px 0 -14px; }
.menu-hero-img { height: 100%; max-height: 62vh; width: auto; object-fit: contain; }
.menu-hero-art .ph-portrait { width: 100%; height: 90%; }
.menu-hero-info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: .4em; }
.menu-hero-name { font: 400 var(--fs-l) var(--font-title); } .menu-hero-name small { font: 700 var(--fs-xs) var(--font-ui); color: var(--c-text-dim); }
.menu-hero-lv { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-weight: 800; } .menu-hero-lv b { font-size: var(--fs-xl); color: var(--c-accent); line-height: 1; }
.menu-exp { flex: 1; min-width: 60px; height: 10px; border-radius: 999px; border: 2px solid var(--c-line); overflow: hidden; background: #e6e9f5; } .menu-exp i { display: block; height: 100%; background: linear-gradient(90deg, #6fd0ff, #2f8cff); }
.menu-hero-power { display: flex; align-items: baseline; gap: .5em; min-width: 0; } .menu-hero-power span { white-space: nowrap; } .menu-hero-power b { font-size: var(--fs-l); color: var(--c-accent-2); white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.menu-hero-ruler, .menu-hero-ch { font-size: var(--fs-s); font-weight: 800; color: var(--c-text-dim); }
.menu-right { display: flex; flex-direction: column; gap: var(--gap); min-height: 0; }
.menu-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); flex: 1; }
.menu-tile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 8px; border-radius: 16px; border: var(--bw) solid var(--c-line); cursor: pointer; min-height: 0;
  background: linear-gradient(160deg, #fff 0%, #e9eefc 100%); color: var(--c-text); box-shadow: 0 5px 0 var(--c-line); font-family: var(--font-ui); animation: pop-in .35s backwards; transition: transform .1s; overflow: hidden; }
.menu-tile::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 8px; background: var(--ruler-ticks); background-size: 100% 100%; opacity: .3; }
.menu-tile:hover { transform: translateY(-3px) rotate(-1deg); background: linear-gradient(160deg, #fff, #ffe9c0); }
.menu-tile:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--c-line); }
.menu-tile-ic { width: clamp(30px, 8vh, 72px); height: clamp(30px, 8vh, 72px); } .menu-tile-ic img, .menu-tile-ic .ph { width: 100%; height: 100%; object-fit: contain; }
.menu-tile-label { font: 400 var(--fs-m) var(--font-title); }
.menu-tile-sub { font-size: var(--fs-xs); color: var(--c-text-dim); font-weight: 700; text-align: center; }
.menu-foot { display: flex; gap: 8px; justify-content: flex-end; }

/* アイテム */
.item-wrap { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: var(--gap); }
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(74px, 10vw, 120px), 1fr)); gap: 8px; align-content: start; }
.item-cell { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px; border-radius: 12px; border: 3px solid var(--c-line); background: var(--c-panel); cursor: pointer; font-family: var(--font-ui); color: var(--c-text); }
.item-cell.is-on { outline: 3px solid var(--c-accent); }
.item-cell img, .item-cell .ph { width: 62%; aspect-ratio: 1; object-fit: contain; font-size: 11px; margin-top: .9em; }
.item-n { position: absolute; right: 4px; top: 3px; z-index: 1; font-size: var(--fs-xs); color: var(--c-accent-2); padding: 0 .35em; border-radius: 6px; background: rgba(255, 255, 255, .92); line-height: 1.35; white-space: nowrap; }
.item-n:empty { display: none; }
.item-name { font-size: var(--fs-xs); font-weight: 800; text-align: center; line-height: 1.2; }
.item-detail { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; align-self: start; }
.item-detail-ic { width: 40%; } .item-detail-ic img, .item-detail-ic .ph { width: 100%; aspect-ratio: 1; object-fit: contain; }
.item-detail-name { font: 400 var(--fs-l) var(--font-title); }
.item-detail-desc { font-size: var(--fs-s); font-weight: 700; color: var(--c-text-dim); }

/* ================= 装備 ================= */
.eq-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr); gap: var(--gap); min-height: 100%; }
.eq-left { display: flex; flex-direction: column; gap: 4px; align-self: start; }
.eq-rname { display: flex; align-items: center; gap: 8px; font: 400 var(--fs-l) var(--font-title); }
.eq-rname small { font: 700 var(--fs-xs) var(--font-ui); color: var(--c-text-dim); }
.eq-rmeta { display: flex; gap: 6px; flex-wrap: wrap; font-size: var(--fs-xs); font-weight: 800; }
.eq-rmeta > span { padding: .1em .6em; border-radius: 6px; background: var(--c-panel-2); border: 2px solid rgba(27,31,59,.3); }
.eq-rmeta .eq-tag-main { background: var(--c-accent); color: #fff; } .eq-rmeta .eq-tag-sub { background: var(--c-sp); color: #fff; }
.eq-preview { position: relative; height: clamp(90px, 24vh, 260px); display: grid; place-items: center; border-radius: 12px; margin: 4px 0;
  background: radial-gradient(ellipse at 50% 70%, rgba(127, 216, 255, .35), transparent 70%), linear-gradient(180deg, #eef4ff, #d6e2ff); border: 2px solid rgba(27,31,59,.2); overflow: hidden; }
.eq-preview.has-3d > .ruler-art { display: none; }
.eq-preview canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
.eq-right { min-width: 0; }
.eq-pane { display: flex; flex-direction: column; gap: 8px; }
.eq-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.eq-note { font-size: var(--fs-xs); opacity: .8; }

.stk-slots { display: flex; gap: 10px; flex-wrap: wrap; }
.stk-slot { position: relative; width: clamp(54px, 10vh, 90px); aspect-ratio: 1; border-radius: 50%; border: 3px dashed rgba(255,255,255,.75); background: rgba(255,255,255,.1); display: grid; place-items: center; cursor: pointer; padding: 0; }
.stk-slot.is-filled { border-style: solid; background: rgba(255,255,255,.9); }
.stk-slot.is-on { outline: 4px solid var(--c-gold); outline-offset: 2px; }
.stk-slot img, .stk-slot .ph { width: 92%; height: 92%; object-fit: contain; font-size: 9px; }
.stk-slot-no { position: absolute; left: -4px; top: -6px; width: 1.4em; height: 1.4em; border-radius: 50%; background: var(--c-accent-2); color: #fff; font: 800 var(--fs-xs)/1.4em var(--font-ui); border: 2px solid #fff; }
.stk-slot-empty { color: #fff; font-size: var(--fs-l); }
.stk-cur { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 10px; border-radius: 10px; background: rgba(0,0,0,.25); font-size: var(--fs-s); font-weight: 700; min-height: 44px; }
.stk-empty { grid-column: 1 / -1; }   /* 空表示はグリッドの1マスに押しこめず、横いっぱいに */
.stk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(82px, 11vw, 130px), 1fr)); gap: 8px; }
.stk-cell { position: relative; display: flex; flex-direction: column; align-items: center; padding: 6px 4px; border-radius: 12px; border: 3px solid var(--c-line); background: var(--c-panel); cursor: pointer; color: var(--c-text); font-family: var(--font-ui); }
.stk-cell:hover { transform: translateY(-2px); }
.stk-cell[disabled] { opacity: .45; cursor: not-allowed; }
.stk-cell.is-pick { outline: 4px solid var(--c-accent); transform: translateY(-2px); box-shadow: 0 0 0 7px rgba(255, 122, 47, .25); }
.stk-pick { background: rgba(255, 170, 60, .18); border: 2px solid var(--c-accent); }
.stk-pick-tag { padding: 0 .5em; border-radius: 6px; background: var(--c-accent); color: #fff; font-size: var(--fs-xs); }
.stk-cell.r-R { background: linear-gradient(180deg, #fff, #dcebff); } .stk-cell.r-SR { background: linear-gradient(180deg, #fff, #ecd8ff); } .stk-cell.r-L { background: linear-gradient(180deg, #fff, #ffeab0); }
.stk-img { width: 72%; aspect-ratio: 1; } .stk-img img, .stk-img .ph { width: 100%; height: 100%; object-fit: contain; font-size: 9px; }
.stk-name { font-size: var(--fs-xs); font-weight: 800; text-align: center; line-height: 1.2; }
.stk-star { color: var(--c-gold); font-size: var(--fs-xs); text-shadow: 0 1px 0 var(--c-line); }
.stk-n { position: absolute; right: 4px; top: 2px; font-size: var(--fs-xs); color: var(--c-text-dim); }
.book { display: flex; flex-direction: column; gap: 12px; }
.book-series { padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.08); border: 2px solid rgba(255,255,255,.3); }
.book-series-name { font: 400 var(--fs-m) var(--font-title); margin-bottom: 6px; display: flex; gap: .6em; align-items: baseline; } .book-series-name small { font: 800 var(--fs-xs) var(--font-ui); opacity: .8; }
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(64px, 8vw, 100px), 1fr)); gap: 6px; }
.book-cell { display: flex; flex-direction: column; align-items: center; padding: 4px; border-radius: 10px; background: rgba(0,0,0,.25); }
.book-cell.is-own { background: rgba(255,255,255,.92); color: var(--c-text); }
.book-cell img, .book-cell .ph { width: 80%; aspect-ratio: 1; object-fit: contain; font-size: 8px; }
.album-still .album-lock { width: auto; height: 74%; max-width: 74%; margin: auto; }
.book-unknown, .album-lock { width: 80%; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.1); font: 400 var(--fs-l) var(--font-title); color: rgba(255,255,255,.4); }
.book-name { font-size: var(--fs-xs); font-weight: 800; text-align: center; line-height: 1.2; }
.book-star { color: var(--c-gold); font-size: 10px; }

.sk-list { display: flex; flex-direction: column; gap: 6px; }
.sk-row { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 12px; border: 3px solid var(--c-line); background: var(--c-panel); cursor: pointer; text-align: left; font-family: var(--font-ui); color: var(--c-text); }
.sk-row.is-on { background: linear-gradient(180deg, #fff6d8, #ffe08a); }
.sk-row.is-fixed { cursor: default; background: linear-gradient(180deg, #f2f6ff, #dfe8ff); }
.sk-tag { display: inline-block; margin-right: .5em; padding: 0 .45em; border-radius: 5px; font-size: var(--fs-xs); color: #fff; background: var(--c-accent-2); vertical-align: .1em; }
.sk-tag--stk { background: #c04fd8; }
.sk-ic { width: clamp(30px, 6vh, 46px); aspect-ratio: 1; flex: none; } .sk-ic img, .sk-ic .ph { width: 100%; height: 100%; object-fit: contain; font-size: 10px; }
.sk-main { flex: 1; min-width: 0; } .sk-name { font-weight: 900; font-size: var(--fs-s); } .sk-desc { font-size: var(--fs-xs); color: var(--c-text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sk-sp { display: flex; align-items: baseline; gap: 2px; color: var(--c-sp); } .sk-sp b { font-size: var(--fs-l); }
.sk-check { width: 1.6em; height: 1.6em; border-radius: 50%; border: 3px solid var(--c-line); display: grid; place-items: center; color: var(--c-ok); font-weight: 900; background: #fff; }
.sk-specials { display: flex; gap: 8px; flex-wrap: wrap; }
.sk-special { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 12px; border: 3px solid var(--c-line); background: var(--c-panel); cursor: pointer; font: 900 var(--fs-s) var(--font-ui); }
.sk-special.is-on { background: linear-gradient(90deg, #ff9ae8, #ff4fd8); color: #fff; }
.sk-special-tag { padding: 0 .5em; border-radius: 6px; background: var(--c-special); color: #fff; font-size: var(--fs-xs); }

.sec-list { display: flex; flex-direction: column; gap: 8px; }
.sec-card { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 14px; border: 3px solid var(--c-line); background: var(--c-panel); cursor: pointer; color: var(--c-text); font-family: var(--font-ui); text-align: left; }
.sec-card.is-on { background: linear-gradient(180deg, #ffeef6, #ffc7de); outline: 3px solid var(--c-heart); }
.sec-card[disabled] { opacity: .5; }
.sec-face { flex: none; width: clamp(44px, 8vh, 70px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; border: 3px solid var(--c-line); background: #fff; display: grid; place-items: center; font-weight: 900; }
.sec-face img, .sec-face .ph { width: 100%; height: 100%; object-fit: cover; }
.sec-main { flex: 1; min-width: 0; } .sec-name { font: 400 var(--fs-m) var(--font-title); display: flex; gap: 8px; align-items: center; }
.sec-skill { font-size: var(--fs-xs); font-weight: 800; display: flex; gap: 6px; align-items: center; margin-top: 2px; }
.sec-tag { padding: 0 .5em; border-radius: 5px; background: var(--c-sp); color: #fff; font-size: .9em; } .sec-tag--assist { background: var(--c-heart); }
.sec-dist { text-align: center; line-height: 1.1; } .sec-dist b { display: block; font-size: var(--fs-l); color: var(--c-heart); }
.sec-na { color: var(--c-danger); font-size: var(--fs-xs); font-weight: 800; }

/* ================= バトル準備 ================= */
.prep-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: var(--gap); }
.prep-enemy { position: relative; display: flex; gap: 10px; overflow: hidden; background: linear-gradient(160deg, #2a1030, #5a1a3a); color: #fff; border-color: #fff; min-height: clamp(160px, 46vh, 520px); }
.prep-vs { position: absolute; left: 6px; top: 0; font: 400 clamp(36px, 8vh, 96px)/1 var(--font-title); color: var(--c-danger); -webkit-text-stroke: 3px #fff; paint-order: stroke fill; transform: rotate(-10deg); z-index: 2; }
.prep-enemy-art { flex: none; width: 46%; display: flex; align-items: flex-end; justify-content: center; margin-bottom: -14px; }
.prep-enemy-art img { max-height: 100%; max-width: 100%; object-fit: contain; filter: drop-shadow(0 0 6px rgba(255, 60, 90, .7)); }
.prep-enemy-art .ph-portrait { width: 90%; height: 92%; }
.prep-enemy-info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: .3em; }
.prep-enemy-role { font: 800 var(--fs-xs) var(--font-ui); color: #ffb0c0; letter-spacing: .2em; }
.prep-enemy-name { font: 400 var(--fs-l)/1.2 var(--font-title); }
.prep-enemy-lv { display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; } .prep-enemy-lv b { font-size: var(--fs-xl); color: var(--c-gold); }
.prep-stocks { margin-left: .6em; padding: .1em .6em; border-radius: 6px; background: var(--c-danger); font-size: var(--fs-xs); font-weight: 800; }
.prep-enemy-power b { color: var(--c-gold); font-size: var(--fs-m); }
.prep-enemy-power { white-space: nowrap; }
.prep-obj { display: flex; flex-direction: column; gap: 4px; font-weight: 800; font-size: var(--fs-s); margin-top: .4em; }
.prep-mine { display: flex; flex-direction: column; gap: 6px; }
.prep-mine-head { display: flex; gap: 10px; align-items: center; }
.prep-mine-art { width: 40%; flex: none; }
.prep-mine-info { flex: 1; min-width: 0; }
.prep-mine-name { display: flex; align-items: center; gap: 6px; font-weight: 900; font-size: var(--fs-m); }
.prep-judge { display: inline-block; padding: .1em .8em; border-radius: 999px; font: 400 var(--fs-s) var(--font-title); color: #fff; transform: rotate(-3deg); }
.prep-judge--ok { background: var(--c-ok); } .prep-judge--even { background: var(--c-sp); } .prep-judge--warn { background: #f0a000; } .prep-judge--ng { background: var(--c-danger); animation: blink 1s steps(2) infinite; }
.prep-sec-title { font: 800 var(--fs-s) var(--font-ui); color: var(--c-accent-2); display: flex; gap: .8em; align-items: baseline; flex-wrap: wrap; } .prep-sec-title small { color: var(--c-text-dim); font-size: var(--fs-xs); }
.prep-picks { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.prep-pick { min-width: 0; }
.prep-seconds, .prep-cons { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 6px; }
.prep-second { flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; width: clamp(64px, 11vh, 100px); padding: 6px 4px; border-radius: 12px; border: 3px solid var(--c-line); background: #fff; cursor: pointer; font-family: var(--font-ui); }
.prep-second.is-on { background: linear-gradient(180deg, #ffeef6, #ffc7de); outline: 3px solid var(--c-heart); }
.prep-second[disabled] { opacity: .4; }
.prep-second-face { width: 76%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; border: 2px solid var(--c-line); display: grid; place-items: center; background: #eef; }
.prep-second-face img, .prep-second-face .ph { width: 100%; height: 100%; object-fit: cover; }
.prep-second-none { font-weight: 900; color: var(--c-text-dim); font-size: var(--fs-xs); }
.prep-second-name { font-size: var(--fs-xs); font-weight: 900; }
.prep-second .hearts { font-size: 9px; }
.prep-con { flex: none; position: relative; display: flex; flex-direction: column; align-items: center; width: clamp(60px, 10vh, 90px); padding: 4px; border-radius: 12px; border: 3px solid var(--c-line); background: #fff; cursor: pointer; font-family: var(--font-ui); }
.prep-con.is-on { outline: 3px solid var(--c-accent); background: #fff3d8; }
.prep-con img, .prep-con .ph { width: 64%; aspect-ratio: 1; object-fit: contain; font-size: 10px; }
.prep-con-none { height: 3em; display: grid; place-items: center; font-weight: 900; color: var(--c-text-dim); font-size: var(--fs-xs); }
.prep-con-n { position: absolute; right: 4px; top: 2px; font-size: var(--fs-xs); }
.prep-con-name { font-size: 10px; font-weight: 800; }
.prep-actions { position: fixed; right: calc(var(--safe-r) + 16px); bottom: calc(var(--safe-b) + 12px); z-index: 5; display: flex; gap: 10px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.scr-prep .ms-body { padding-bottom: calc(var(--safe-b) + 80px); }
.prep-go { min-width: 12em; }

/* ================= バトルの器 ================= */
.battle-host { background: #000; }
.battle-loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; color: #fff; font-weight: 800; background: radial-gradient(circle, #2a3a8a, #05081a); }
.battle-loading-ruler { width: min(40vw, 300px); height: 22px; border: 3px solid #fff; border-radius: 4px; background: var(--ruler-ticks); filter: invert(1); animation: blink 1s ease-in-out infinite; }

/* ================= リザルト ================= */
.result { color: #fff; display: flex; flex-direction: column; padding: calc(var(--safe-t) + 8px) calc(var(--safe-r) + 16px) calc(var(--safe-b) + 10px) calc(var(--safe-l) + 16px); gap: var(--gap); }
.res-bg { position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse at 50% 0%, #ffcf5a 0%, #ff6a2b 30%, #6a1a5a 70%, #1a0e30 100%); }
.result--lose .res-bg { background: radial-gradient(ellipse at 50% 0%, #6a7ab0 0%, #2a3060 50%, #0a0c20 100%); }
.res-bg::after { content: ''; position: absolute; inset: 0; background: var(--stripe); }
.res-banner { position: relative; flex: none; text-align: center; height: clamp(60px, 18vh, 190px); display: flex; flex-direction: column; justify-content: center; }
.res-burst { position: absolute; left: 50%; top: 50%; width: 60vmax; height: 60vmax; transform: translate(-50%, -50%); background: repeating-conic-gradient(rgba(255,255,255,.18) 0 8deg, transparent 8deg 20deg); animation: spin 20s linear infinite; pointer-events: none; z-index: -1; border-radius: 50%; -webkit-mask: radial-gradient(circle, #000 20%, transparent 70%); mask: radial-gradient(circle, #000 20%, transparent 70%); }
.res-banner-text { font: 400 clamp(46px, 9vh + 2vw, 170px)/1 var(--font-title); color: var(--c-gold); -webkit-text-stroke: 4px var(--c-line); paint-order: stroke fill; text-shadow: 0 8px 0 var(--c-accent), 0 0 30px rgba(255, 220, 100, .8); animation: res-in .6s cubic-bezier(.2, 1.6, .4, 1); letter-spacing: .04em; transform: rotate(-4deg); }
.result--lose .res-banner-text { color: #b8c4ff; text-shadow: 0 8px 0 #2a3060; }
.result--quiet .res-bg { background: radial-gradient(ellipse at 50% 0%, #4a5478 0%, #1e2440 55%, #08091a 100%); }
.result--quiet .res-banner-text { color: #e8ecff; font-size: clamp(34px, 6vh + 1.4vw, 110px); text-shadow: 0 4px 0 #1e2440; transform: none; animation: res-quiet-in .8s ease-out; letter-spacing: .2em; }
@keyframes res-quiet-in { from { opacity: 0; letter-spacing: .5em; } }
.res-banner-sub { font: 800 var(--fs-m) var(--font-ui); opacity: .9; }
@keyframes res-in { from { transform: rotate(-4deg) scale(3); opacity: 0; } }
.res-grid { flex: 1; min-height: 0; align-items: start; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap); }
.res-col { display: flex; flex-direction: column; gap: var(--gap); min-height: 0; }
.res-hero { display: flex; gap: 10px; align-items: center; overflow: hidden; }
.res-hero-face { flex: none; width: 30%; height: clamp(70px, 22vh, 240px); overflow: hidden; display: flex; align-items: flex-start; justify-content: center; border-radius: 10px; background: linear-gradient(180deg, #ffe8b0, #ffb06a); }
.res-hero-img { width: 140%; height: auto; object-fit: cover; object-position: top; margin-top: 4%; }
.res-hero-face .ph-portrait { width: 90%; height: 160%; }
.res-hero-info { flex: 1; min-width: 0; }
.res-lv { position: relative; display: flex; align-items: baseline; gap: 6px; } .res-lv b { font-size: var(--fs-num); color: var(--c-accent); line-height: 1; }
.res-lvup { position: absolute; left: 40%; top: -10%; font: 400 var(--fs-l) var(--font-title); color: var(--c-gold); -webkit-text-stroke: 2px var(--c-line); paint-order: stroke fill; opacity: 0; white-space: nowrap; }
.res-lvup.is-on { animation: lvup 1s ease-out; }
@keyframes lvup { 0% { opacity: 0; transform: translateY(10px) scale(.6); } 20% { opacity: 1; transform: translateY(0) scale(1.2); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-20px); } }
.res-exp-bar { height: 16px; border-radius: 999px; border: 3px solid var(--c-line); background: #e6e9f5; overflow: hidden; } .res-exp-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #6fd0ff, #2f8cff); box-shadow: inset 0 -4px 0 rgba(0,0,0,.15); }
.res-exp-txt { font-size: var(--fs-xs); font-weight: 800; color: var(--c-text-dim); text-align: right; }
.res-list { overflow: auto; min-height: 0; }
.res-list-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.res-first { font: 400 var(--fs-s) var(--font-title); color: var(--c-danger); animation: blink 1s steps(2) infinite; }
.res-row { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 2px dashed rgba(27,31,59,.15); opacity: 0; transform: translateX(20px); transition: .3s; }
.res-row.is-in { opacity: 1; transform: none; }
.res-row-ic { width: 2em; height: 2em; display: inline-grid; } .res-row-ic img, .res-row-ic .ph { width: 100%; height: 100%; object-fit: contain; font-size: 9px; }
.res-row-label { flex: 1; font-weight: 800; }
.res-row b { font-size: var(--fs-l); color: var(--c-accent-2); } .res-row.is-money b { color: #d08a00; }
.res-row b::before { content: '+'; }
.res-sub { font: 800 var(--fs-xs) var(--font-ui); color: var(--c-text-dim); margin-top: 8px; }
.res-drops { display: flex; flex-wrap: wrap; gap: 6px; }
.res-drop { display: flex; align-items: center; gap: 4px; padding: 3px 10px 3px 3px; border-radius: 999px; background: var(--c-panel-2); border: 2px solid var(--c-line); font-size: var(--fs-xs); font-weight: 800; opacity: 0; transform: scale(.5); transition: .3s cubic-bezier(.2, 1.6, .4, 1); }
.res-drop.is-in { opacity: 1; transform: none; }
.res-drop img, .res-drop .ph { width: 28px; height: 28px; object-fit: contain; font-size: 8px; }
.res-rec { font-size: var(--fs-s); font-weight: 800; display: flex; flex-direction: column; gap: 4px; }
.res-rec-row { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.res-maxdmg { font-size: var(--fs-l); color: var(--c-gold); }
.res-rec-mount { color: var(--c-heart); font: 400 var(--fs-m) var(--font-title); }
.res-bond { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: var(--fs-s); }
.res-bond-face { width: clamp(40px, 8vh, 64px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; border: 3px solid var(--c-heart); flex: none; } .res-bond-face img, .res-bond-face .ph { width: 100%; height: 100%; object-fit: cover; }
.res-bond-dist b { color: var(--c-heart); }
.res-bond-up { margin-left: auto; font: 400 var(--fs-l) var(--font-title); color: var(--c-heart); animation: pop-up .5s 1.5s backwards; }
.res-digit { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%) scale(0); z-index: 5; padding: 1em 2em; border-radius: 20px; background: rgba(10, 8, 30, .92); border: 4px solid var(--c-gold); text-align: center; font: 400 var(--fs-l) var(--font-title); pointer-events: none; transition: transform .4s cubic-bezier(.2, 1.6, .4, 1); }
.res-digit b { display: block; font-size: var(--fs-num); color: var(--c-gold); }
.res-digit.is-on { transform: translate(-50%, -50%) scale(1); animation: res-digit-out .5s 2.6s forwards; }
@keyframes res-digit-out { to { opacity: 0; transform: translate(-50%, -50%) scale(1.3); } }
.res-foot { flex: none; display: flex; justify-content: flex-end; }

/* 負け画面 */
.losescr { color: #fff; display: grid; place-items: center; padding: 16px; }
.lose-bg { position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse at 50% 30%, #3a4070, #0a0c20); }
.lose-bg::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(100deg, rgba(150, 170, 255, .06) 0 2px, transparent 2px 30px); }
.lose-wrap { display: flex; flex-direction: column; align-items: center; gap: var(--gap); width: min(92vw, 720px); }
.lose-title { font: 400 var(--fs-xl) var(--font-title); color: #b8c4ff; text-shadow: 0 5px 0 #1a2050; animation: res-in .5s; }
.lose-sub { font-weight: 800; opacity: .8; }
.lose-advice { display: flex; align-items: center; gap: 12px; width: 100%; }
.lose-advice-face { flex: none; width: clamp(50px, 10vh, 90px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; border: 3px solid var(--c-line); } .lose-advice-face img, .lose-advice-face .ph { width: 100%; height: 100%; object-fit: cover; }
.lose-advice-text { font-weight: 800; }
.lose-btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* ================= 設定・スロット・クレジット ================= */
.set-wrap { display: grid; grid-template-columns: minmax(120px, 220px) minmax(0, 1fr); gap: var(--gap); max-width: 1200px; margin: 0 auto; }
.set-pane { display: flex; flex-direction: column; gap: 10px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 4px; border-bottom: 2px dashed rgba(27,31,59,.12); flex-wrap: wrap; }
.set-label { font-weight: 900; font-size: var(--fs-s); display: flex; flex-direction: column; } .set-label small { font-size: var(--fs-xs); color: var(--c-text-dim); font-weight: 700; }
.seg { display: flex; border: 3px solid var(--c-line); border-radius: 12px; overflow: hidden; flex-wrap: wrap; }
.seg-btn { padding: .45em .9em; min-height: 40px; border: 0; border-right: 2px solid var(--c-line); background: #fff; font: 800 var(--fs-s) var(--font-ui); cursor: pointer; color: var(--c-text); }
.seg-btn:last-child { border-right: 0; }
.seg-btn.is-on { background: linear-gradient(180deg, #ffb347, #ff6a2b); color: #fff; }
.set-slider { display: flex; align-items: center; gap: 10px; flex: 1; max-width: 420px; }
.set-range { flex: 1; accent-color: var(--c-accent); height: 30px; }
.set-val { width: 3em; text-align: right; }
.set-note { font-size: var(--fs-xs); color: var(--c-text-dim); margin: 0; }
.slot-list { display: flex; flex-direction: column; gap: 10px; max-width: 900px; margin: 0 auto; }
.slot-card { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; border: var(--bw) solid var(--c-line); background: var(--c-panel); cursor: pointer; text-align: left; font-family: var(--font-ui); color: var(--c-text); box-shadow: 0 4px 0 var(--c-line); min-height: clamp(56px, 13vh, 110px); }
.slot-card:hover:not([disabled]) { transform: translateY(-2px); background: #fff7e0; }
.slot-card[disabled] { opacity: .6; cursor: default; }
.slot-card.is-auto { background: linear-gradient(90deg, #e8f4ff, #fff); }
.slot-no { flex: none; width: 4.4em; text-align: center; font: 400 var(--fs-m) var(--font-title); color: var(--c-accent); }
.slot-face { flex: none; width: clamp(40px, 8vh, 70px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; border: 3px solid var(--c-line); } .slot-face img, .slot-face .ph { width: 100%; height: 100%; object-fit: cover; }
.slot-info { flex: 1; min-width: 0; } .slot-ch { font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot-meta { display: flex; gap: 12px; font-size: var(--fs-xs); font-weight: 800; color: var(--c-text-dim); flex-wrap: wrap; }
.slot-date { font-size: var(--fs-xs); font-weight: 800; color: var(--c-text-dim); }
.slot-empty { flex: 1; color: var(--c-text-dim); font-weight: 800; }
.slot-note { text-align: center; font-size: var(--fs-xs); opacity: .8; }
.credits { background: radial-gradient(ellipse at 50% 120%, #3a2a80, #05081a); color: #fff; overflow: hidden; }
.credits-roll { position: absolute; left: 0; right: 0; top: 100%; display: flex; flex-direction: column; align-items: center; gap: 3vh; animation: credits 34s linear forwards; padding: 0 16px; }
@keyframes credits { to { transform: translateY(calc(-100% - 100vh)); } }
.credits-sub { font-weight: 800; letter-spacing: .1em; margin-bottom: 6vh; }
.credits-row { text-align: center; } .credits-k { font-size: var(--fs-s); color: var(--c-ice); font-weight: 800; } .credits-v { font: 400 var(--fs-l) var(--font-title); }
.credits-end { margin-top: 20vh; font: 400 var(--fs-xl) var(--font-title); color: var(--c-gold); }
.credits-back { position: absolute; right: calc(var(--safe-r) + 12px); top: calc(var(--safe-t) + 10px); }
.credits-fin { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.4vh; opacity: 0; pointer-events: none; transition: opacity .8s; }
.credits-fin.is-on { opacity: 1; pointer-events: auto; background: rgba(5, 8, 26, .82); }
.credits-fin-t { font: 400 var(--fs-xl) var(--font-title); color: var(--c-gold); text-shadow: 0 0 18px rgba(255, 210, 90, .6); }
.credits-fin-s { font-size: var(--fs-s); color: var(--c-ice); font-weight: 800; }

/* ================= 工房 ================= */
.forge-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }
.forge-list { max-height: 100%; overflow: auto; }
.rlist--forge { grid-template-columns: 1fr; }
.forge-main { display: flex; flex-direction: column; gap: 6px; }
.forge-rname { display: flex; align-items: center; gap: 8px; font: 400 var(--fs-l) var(--font-title); flex-wrap: wrap; }
.forge-plus { color: var(--c-accent); } .forge-plus.is-up { animation: pop-up .5s; color: var(--c-ok); }
.forge-dan { font: 800 var(--fs-s) var(--font-ui); padding: .1em .6em; border-radius: 6px; background: var(--c-accent-2); color: #fff; }
.forge-anvil { position: relative; height: clamp(80px, 20vh, 200px); display: grid; place-items: center; border-radius: 12px; background: radial-gradient(ellipse at 50% 80%, #ffb06a 0%, #6a3a1a 60%, #2a140a 100%); overflow: hidden; }
.forge-anvil .ruler-art { width: 80%; }
.forge-hammer { position: absolute; right: 10%; top: -10%; width: 26%; aspect-ratio: 1; background: linear-gradient(180deg, #888 0 34%, transparent 34%), linear-gradient(90deg, transparent 44%, #8a5a2a 44% 56%, transparent 56%); border-radius: 6px; transform-origin: 70% 90%; transform: rotate(40deg); opacity: 0; }
.forge-anvil.is-hit .forge-hammer { opacity: 1; animation: hammer .16s ease-in 3; }
@keyframes hammer { 0% { transform: rotate(40deg); } 70% { transform: rotate(-20deg); } 100% { transform: rotate(40deg); } }
.forge-sparks { position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; }
.forge-anvil.spark .forge-sparks { animation: sparks .4s ease-out; }
@keyframes sparks { 0% { box-shadow: 0 0 0 0 #fff8a0; } 100% { box-shadow: 30px -40px 0 -3px rgba(255, 220, 100, 0), -40px -30px 0 -3px rgba(255, 200, 60, 0), 50px 10px 0 -3px rgba(255, 240, 160, 0), -20px -55px 0 -3px rgba(255, 180, 60, 0); } }
.forge-anvil.spark .forge-sparks { box-shadow: 30px -40px 0 2px #fff8a0, -40px -30px 0 2px #ffd060, 50px 10px 0 2px #ffe080, -20px -55px 0 2px #ffb040; border-radius: 50%; }
.forge-desc { font-size: var(--fs-xs); font-weight: 700; color: var(--c-text-dim); }
.forge-cost { display: flex; flex-direction: column; gap: 4px; padding: 6px 10px; border-radius: 10px; background: var(--c-panel-2); }
.forge-cost-row { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: var(--fs-s); }
.forge-cost-row i { width: 1.8em; height: 1.8em; display: inline-grid; } .forge-cost-row i img, .forge-cost-row i .ph { width: 100%; height: 100%; object-fit: contain; font-size: 8px; }
.forge-cost-row span { flex: 1; } .forge-cost-row small { color: var(--c-text-dim); }
.forge-cost-row.is-short b, .forge-cost-row.is-short small { color: var(--c-danger); }
.forge-go { align-self: center; min-width: 10em; }
.forge-stats { align-self: start; }

/* ================= ガチャ ================= */
.gc-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: var(--gap); height: 100%; }
.gc-stage { display: grid; place-items: center; min-height: 0; }
.gmachine { --gc: #ff9ec7; position: relative; height: min(68vh, calc(100vh - 150px)); aspect-ratio: 2 / 3; }
.gmachine.has-img > :not(.gm-img):not(.gm-out) { display: none; }
.gm-img { width: 100%; height: 100%; object-fit: contain; }
.gmachine.has-img.is-crank .gm-img { animation: machine-shake .12s linear 5; }
.gm-top { position: absolute; left: 6%; right: 6%; top: 0; height: 9%; border-radius: 14px 14px 4px 4px; background: var(--gc); border: 4px solid var(--c-line); display: grid; place-items: center; font: 400 clamp(10px, 1.2vw, 22px) var(--font-title); color: #fff; text-shadow: 0 2px 0 var(--c-line); overflow: hidden; white-space: nowrap; }
.gm-dome { position: absolute; left: 8%; right: 8%; top: 9%; height: 46%; border-radius: 40% 40% 8% 8%; border: 4px solid var(--c-line); background: radial-gradient(ellipse at 30% 25%, rgba(255,255,255,.9), rgba(200, 235, 255, .35) 30%, rgba(160, 210, 255, .25)); overflow: hidden; }
.gm-cap { position: absolute; width: 22%; aspect-ratio: 1; border-radius: 50%; border: 3px solid var(--c-line); background: linear-gradient(180deg, #fff 50%, #ddd 50%); }
.gm-cap--blue { background: linear-gradient(180deg, #7cc0ff 50%, #fff 50%); } .gm-cap--gold { background: linear-gradient(180deg, #ffd84a 50%, #fff 50%); }
.gm-cap--rainbow { background: linear-gradient(180deg, transparent 50%, #fff 50%), linear-gradient(90deg, #ff7a7a, #ffd36b, #7aff9a, #7ab8ff, #d67aff); }
.gm-body { position: absolute; left: 4%; right: 4%; top: 55%; bottom: 0; border-radius: 6px 6px 16px 16px; background: linear-gradient(180deg, #ff4a4a, #c41c2c); border: 4px solid var(--c-line); box-shadow: inset 0 -12px 0 rgba(0,0,0,.2); }
.gm-handle { position: absolute; left: 50%; top: 18%; width: 34%; aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(circle, #fff 0 20%, #ddd 21% 60%, #aaa 61%); border: 4px solid var(--c-line); }
.gm-handle i { position: absolute; left: 44%; top: 6%; width: 12%; height: 88%; border-radius: 6px; background: #ffcc33; border: 3px solid var(--c-line); }
.gmachine.is-crank .gm-handle { animation: crank .7s ease-in-out; }
@keyframes crank { to { transform: translateX(-50%) rotate(360deg); } }
@keyframes machine-shake { 50% { transform: translateX(4px) rotate(1deg); } }
.gm-slot { position: absolute; left: 30%; right: 30%; bottom: 10%; height: 20%; border-radius: 12px 12px 4px 4px; background: #2a0a10; border: 4px solid var(--c-line); }
.gm-price { position: absolute; right: 8%; top: 8%; padding: .1em .5em; border-radius: 6px; background: #fff; border: 3px solid var(--c-line); font: 800 var(--fs-xs) var(--font-ui); }
.gc-side { display: flex; flex-direction: column; gap: 8px; overflow: auto; min-height: 0; }
.gc-title { font: 400 var(--fs-l) var(--font-title); color: var(--c-accent-2); }
.gc-rates { display: flex; gap: 10px; flex-wrap: wrap; font-size: var(--fs-xs); font-weight: 800; } .gc-rate { display: flex; align-items: center; gap: 4px; }
.gc-btns { display: flex; gap: 10px; flex-wrap: wrap; } .gc-btns .btn { flex: 1; flex-direction: column; gap: 0; } .gc-btns small { font-size: .6em; }
.gc-stamp { padding: 8px; border-radius: 12px; background: #fff7e0; border: 3px dashed #e0a000; }
.gc-stamp-head { display: flex; justify-content: space-between; font-weight: 900; font-size: var(--fs-s); margin-bottom: 4px; }
.gc-stamp-grid { display: grid; grid-template-columns: repeat(15, 1fr); gap: 3px; margin-bottom: 4px; }
.gc-stamp-grid i { aspect-ratio: 1; border-radius: 50%; border: 2px solid #e0c080; background: #fff; }
.gc-stamp-grid i.on { background: radial-gradient(circle, #ff6a6a 40%, #d02020 41%); border-color: #d02020; }
.gc-lineup-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(44px, 6vw, 70px), 1fr)); gap: 6px; }
.gc-lineup-grid--k { grid-template-columns: repeat(auto-fill, minmax(clamp(34px, 4.4vw, 54px), 1fr)); gap: 4px; }   /* スキルシールは数が多いので小さめ */
.gc-lineup-sub { margin-top: 2px; }
.gc-li { position: relative; display: grid; place-items: center; padding: 4px; border-radius: 10px; background: var(--c-panel-2); filter: grayscale(.6) brightness(.9); }
.gc-li.is-own { filter: none; }
.gc-li img, .gc-li .ph { width: 100%; aspect-ratio: 1; object-fit: contain; font-size: 7px; }
.gc-li .rarity { position: absolute; bottom: -2px; right: -2px; font-size: 9px; min-width: 0; height: 1.4em; }
.gc-reveal { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; background: rgba(5, 5, 20, .82); cursor: pointer; animation: fade-in .2s; overflow: hidden; }
.gc-reveal.is-out { opacity: 0; transition: opacity .2s; }
.gc-rays { position: absolute; left: 50%; top: 50%; width: 200vmax; height: 200vmax; transform: translate(-50%, -50%); background: repeating-conic-gradient(rgba(255,255,255,.12) 0 6deg, transparent 6deg 18deg); animation: spin 14s linear infinite; }
.cap-gold .gc-rays { background: repeating-conic-gradient(rgba(255, 210, 60, .3) 0 6deg, transparent 6deg 18deg); }
.cap-rainbow .gc-rays { background: repeating-conic-gradient(rgba(255, 120, 120, .3) 0 6deg, rgba(255, 220, 100, .3) 6deg 12deg, rgba(120, 220, 255, .3) 12deg 18deg, transparent 18deg 24deg); animation-duration: 6s; }
.gc-capsule { position: relative; width: clamp(100px, 26vh, 260px); aspect-ratio: 1; transform: translateY(-80vh); transition: transform .6s cubic-bezier(.3, 1.5, .5, 1); }
.gc-capsule.is-landed { transform: translateY(0); animation: cap-wobble .5s .6s ease-in-out infinite alternate; }
@keyframes cap-wobble { from { rotate: -6deg; } to { rotate: 6deg; } }
.gc-capsule-top, .gc-capsule-bottom { position: absolute; left: 0; right: 0; height: 50%; border: 5px solid var(--c-line); }
.gc-capsule-top { top: 0; border-radius: 999px 999px 0 0; background: radial-gradient(circle at 35% 30%, #fff, #ddd); transition: transform .35s; }
.gc-capsule-bottom { bottom: 0; border-radius: 0 0 999px 999px; background: #fff; border-top-width: 3px; transition: transform .35s; }
.gc-capsule--blue .gc-capsule-top { background: radial-gradient(circle at 35% 30%, #d8f0ff, #3a8fff); }
.gc-capsule--gold .gc-capsule-top { background: radial-gradient(circle at 35% 30%, #fff8c0, #ffb000); box-shadow: 0 0 40px #ffd060; }
.gc-capsule--rainbow .gc-capsule-top { background: conic-gradient(#ff7a7a, #ffd36b, #7aff9a, #7ab8ff, #d67aff, #ff7a7a); box-shadow: 0 0 60px #fff; animation: kira 1s linear infinite; }
.gc-capsule.is-crack { animation: cap-shake .1s linear 4; }
@keyframes cap-shake { 50% { transform: translateX(8px) rotate(4deg); } }
.gc-reveal.is-open .gc-capsule-top { transform: translateY(-80%) rotate(-30deg); opacity: 0; transition-duration: .4s; }
.gc-reveal.is-open .gc-capsule-bottom { transform: translateY(80%); opacity: 0; }
.gc-reveal.is-open .gc-capsule { position: absolute; animation: none; }
.gc-capsule--img img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 10px 20px rgba(0,0,0,.5)); }
.gc-capsule--img.gc-capsule--gold img { filter: drop-shadow(0 0 30px #ffd060); } .gc-capsule--img.gc-capsule--rainbow img { filter: drop-shadow(0 0 40px #fff); }
.gc-reveal.is-open .gc-capsule--img { opacity: 0; transform: scale(1.5); transition: opacity .6s .15s, transform .6s; }
.gc-tap { position: absolute; bottom: calc(var(--safe-b) + 6vh); color: #fff; font: 800 var(--fs-m) var(--font-ui); animation: blink 1s steps(2) infinite; }
.gc-cards { position: relative; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; max-width: 92vw; }
.gc-cards.is-many { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); width: min(92vw, 1100px); }
.gc-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px; border-radius: 14px; background: #fff; border: 4px solid var(--c-line); color: var(--c-text); animation: card-in .45s cubic-bezier(.2, 1.4, .4, 1) backwards; box-shadow: 0 6px 0 var(--c-line); }
.gc-cards:not(.is-many) .gc-card { width: min(60vw, 300px); padding: 14px; }
.gc-card.r-R { background: linear-gradient(180deg, #fff, #cfe6ff); } .gc-card.r-SR { background: linear-gradient(180deg, #fff, #e6cfff); box-shadow: 0 6px 0 var(--c-line), 0 0 20px #c08aff; }
.gc-card.r-L, .gc-card.r-G { background: linear-gradient(180deg, #fffbe0, #ffd96a); box-shadow: 0 6px 0 var(--c-line), 0 0 30px #ffd060; }
.gc-card-glow { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.8) 50%, transparent 70%); background-size: 250% 100%; animation: shine-x 2s linear infinite; }
.gc-card-img { width: 80%; aspect-ratio: 1; } .gc-card-img img, .gc-card-img .ph { width: 100%; height: 100%; object-fit: contain; font-size: 10px; }
.gc-card-name { font-weight: 900; font-size: var(--fs-xs); text-align: center; line-height: 1.2; }
.gc-cards:not(.is-many) .gc-card-name { font: 400 var(--fs-l) var(--font-title); }
.gc-card-meta { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; justify-content: center; max-width: 100%; }
.gc-cards.is-many .gc-conv { white-space: normal; text-align: center; line-height: 1.25; }
.gc-new { color: #fff; background: var(--c-danger); border-radius: 5px; padding: 0 .4em; font: 800 10px var(--font-ui); }
.gc-up { color: #5a3500; background: var(--c-gold); border-radius: 5px; padding: 0 .4em; font: 800 10px var(--font-ui); }
.gc-conv { color: #fff; background: #6a5a8a; border-radius: 5px; padding: 0 .4em; font: 800 10px var(--font-ui); white-space: nowrap; }
.gc-card-conv { color: #ffe08a; }
.gc-card-eff { font-size: var(--fs-s); font-weight: 800; color: var(--c-accent-2); }
@keyframes card-in { from { opacity: 0; transform: scale(.3) rotateY(180deg); } }

/* ================= 店・ワゴン ================= */
.shop-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.5fr) minmax(0, 1fr); gap: var(--gap); height: 100%; }
.shop-grid--noclerk { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) !important; }
.shop-stats .stats { margin-top: 2px; }
.shop-clerk { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-height: 0; overflow: hidden; }
.shop-clerk-img { height: 100%; max-height: 70vh; width: auto; object-fit: contain; object-position: bottom; }
.shop-clerk .ph-portrait { width: 80%; height: 90%; }
.shop-bubble { position: absolute; top: 4%; left: 4%; right: 4%; padding: .5em .8em; border-radius: 14px; background: #fff; color: var(--c-text); border: 3px solid var(--c-line); font-weight: 800; font-size: var(--fs-s); box-shadow: var(--shadow-s); }
.shop-mid { min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.shop-list { display: flex; flex-direction: column; gap: 6px; overflow: auto; min-height: 0; }
.shop-row { display: grid; grid-template-columns: clamp(60px, 10vw, 120px) 1fr auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 6px 10px; border-radius: 12px; border: 3px solid var(--c-line); background: var(--c-panel); cursor: pointer; text-align: left; font-family: var(--font-ui); color: var(--c-text); }
.shop-row.is-on { background: linear-gradient(180deg, #fff6d8, #ffe08a); }
.shop-ic { grid-row: span 2; display: grid; place-items: center; } .shop-ic > img, .shop-ic > .ph { width: 60%; aspect-ratio: 1; object-fit: contain; font-size: 9px; }
.shop-name { display: flex; align-items: center; gap: 6px; font-weight: 900; font-size: var(--fs-s); min-width: 0; } .shop-name span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shop-own { font-size: var(--fs-xs); color: var(--c-text-dim); font-weight: 700; grid-column: 2; }
.shop-price { grid-row: 1 / span 2; grid-column: 3; text-align: right; } .shop-price b { font-size: var(--fs-m); color: #c07a00; } .shop-price small { display: block; font-size: var(--fs-xs); color: var(--c-text-dim); }
.shop-price.is-short b { color: var(--c-danger); }
.shop-detail { display: flex; flex-direction: column; overflow: auto; align-self: start; max-height: 100%; }
.shop-detail-in { display: flex; flex-direction: column; gap: 6px; }
.shop-dname { font: 400 var(--fs-l) var(--font-title); }
.shop-ruby { font-size: var(--fs-xs); color: var(--c-text-dim); font-weight: 800; }
.shop-art { padding: 10px 0; } .shop-art--st { width: 50%; margin: 0 auto; } .shop-art--st img, .shop-art--st .ph { width: 100%; aspect-ratio: 1; object-fit: contain; }
.shop-kv { display: flex; justify-content: space-between; font-size: var(--fs-s); font-weight: 800; border-bottom: 2px dashed rgba(27,31,59,.15); padding: 3px 0; } .shop-kv span { color: var(--c-text-dim); }
.shop-eff { font-weight: 800; color: var(--c-accent-2); font-size: var(--fs-s); }
/* 買うボタンは詳細パネルの下に固定（低い画面で能力値の比較が長くなっても見える） */
.shop-buy { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; position: sticky; bottom: calc(-1 * var(--gap)); z-index: 2; padding: 6px 0 var(--gap); margin-bottom: calc(-1 * var(--gap)); background: linear-gradient(180deg, transparent, var(--c-panel) 8px); } .shop-buy .btn { flex: 1; flex-direction: column; gap: 0; } .shop-buy small { font-size: .6em; }
.wagon-wrap { display: flex; flex-direction: column; align-items: center; gap: var(--gap); }
.wagon-sign { padding: .2em 1.4em; border-radius: 10px; background: #fff3c0; color: #b02020; border: 4px solid var(--c-line); font: 400 var(--fs-l) var(--font-title); transform: rotate(-3deg); box-shadow: var(--shadow); }
.wagon-sign span { font-size: 1.8em; margin: 0 .1em; }
.wagon-items { display: flex; gap: var(--gap); flex-wrap: wrap; justify-content: center; }
.wagon-item { display: flex; flex-direction: column; align-items: center; gap: 6px; width: clamp(130px, 20vw, 240px); padding: 12px; border-radius: 16px; background: var(--c-panel); color: var(--c-text); border: 4px solid var(--c-line); box-shadow: var(--shadow); }
.wagon-item.is-sold { filter: grayscale(1); opacity: .7; }
.wagon-ic { width: 60%; } .wagon-ic img, .wagon-ic .ph { width: 100%; aspect-ratio: 1; object-fit: contain; font-size: 10px; }
.wagon-name { font-weight: 900; text-align: center; }
.wagon-sold { font: 400 var(--fs-m) var(--font-title); color: var(--c-danger); transform: rotate(-10deg); border: 3px solid var(--c-danger); padding: 0 .4em; border-radius: 6px; }
.wagon-note { font-weight: 800; font-size: var(--fs-s); opacity: .85; }

/* ================= なかま ================= */
.bond-grid { display: grid; grid-template-columns: minmax(120px, 220px) minmax(0, 1fr); gap: var(--gap); height: 100%; }
.bond-list { display: flex; flex-direction: column; gap: 6px; overflow: auto; }
.bond-tab { --cc: #ff8fbf; position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 6px 10px; border-radius: 14px; border: 3px solid var(--c-line); background: var(--c-panel); cursor: pointer; text-align: left; font-family: var(--font-ui); color: var(--c-text); }
.bond-tab.is-on { background: linear-gradient(90deg, color-mix(in srgb, var(--cc) 40%, #fff), #fff); outline: 3px solid var(--cc); }
.bond-tab-face { grid-row: span 2; width: clamp(36px, 7vh, 56px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; border: 2px solid var(--c-line); } .bond-tab-face img, .bond-tab-face .ph { width: 100%; height: 100%; object-fit: cover; }
.bond-tab-name { font-weight: 900; font-size: var(--fs-s); } .bond-tab .hearts { font-size: var(--fs-xs); }
.bond-tab-new { position: absolute; right: 6px; top: 6px; font-style: normal; width: 1.4em; height: 1.4em; border-radius: 50%; background: var(--c-danger); color: #fff; display: grid; place-items: center; font-weight: 900; font-size: var(--fs-xs); }
.bond-main { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.4fr) minmax(0, 1.2fr); gap: var(--gap); overflow: hidden; min-height: 0; }
.bond-art { display: flex; align-items: flex-end; justify-content: center; margin-bottom: -14px; min-height: 0; overflow: hidden; }
.bond-art-img { height: 100%; max-height: 66vh; width: auto; object-fit: contain; }
.bond-art .ph-portrait { width: 90%; height: 92%; }
.bond-info { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.bond-name { --cc: #ff8fbf; font: 400 var(--fs-l) var(--font-title); border-left: 8px solid var(--cc); padding-left: .4em; }
.bond-hearts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 800; } .bond-hearts .hearts { font-size: var(--fs-l); } .bond-hearts small { color: var(--c-text-dim); }
.bond-dist { position: relative; }
.bond-dist-ruler { position: relative; height: clamp(48px, 9vh, 72px); border-radius: 8px; border: 3px solid var(--c-line); background: linear-gradient(180deg, #fff0f6, #ffd0e2); overflow: hidden; }
.bond-dist-ruler::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 30%; background: var(--ruler-ticks); background-size: 100% 100%; opacity: .5; }
.bond-dist-a, .bond-dist-b { position: absolute; top: 50%; width: clamp(34px, 6.4vh, 52px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--c-line); transform: translate(-50%, -40%); transition: left 1s cubic-bezier(.2, .9, .3, 1); }
.bond-dist-a { left: 10%; } .bond-dist-a img, .bond-dist-b img, .bond-dist-a .ph, .bond-dist-b .ph { width: 100%; height: 100%; object-fit: cover; }
.bond-dist-gap { position: absolute; left: 14%; top: 50%; height: 4px; transform: translateY(2px); border-top: 3px dashed var(--c-heart); display: flex; justify-content: center; }
.bond-dist-gap b { transform: translateY(-140%); color: var(--c-heart); font-size: var(--fs-m); white-space: nowrap; }
.bond-dist-near { position: absolute; top: 50%; transform: translateY(-30%); color: var(--c-heart); font-size: var(--fs-l); white-space: nowrap; text-shadow: 0 2px 0 #fff; }
.bond-dist-label { position: absolute; right: 8px; top: 2px; font-size: var(--fs-xs); font-weight: 800; color: var(--c-text-dim); }
.bond-skill { font-size: var(--fs-s); font-weight: 800; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; } .bond-skill small { color: var(--c-text-dim); }
.bond-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.bond-daily { display: flex; flex-direction: column; gap: 6px; overflow: auto; min-height: 0; }
.bond-ev { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; background: var(--c-panel-2); font-weight: 800; font-size: var(--fs-s); min-height: 44px; }
.bond-ev--open { background: linear-gradient(90deg, #ffe0ec, #fff); outline: 2px solid var(--c-heart); }
.bond-ev--locked { opacity: .65; }
.bond-ev-ic { width: 1.4em; text-align: center; color: var(--c-heart); } .bond-ev-name { flex: 1; min-width: 0; }

/* ================= アルバム ================= */
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(110px, 16vw, 220px), 1fr)); gap: 10px; }
.album-still { position: relative; aspect-ratio: 3 / 2; border-radius: 10px; border: 3px solid var(--c-line); background: #111; overflow: hidden; cursor: pointer; padding: 0; display: grid; place-items: center; }
.album-still[disabled] { cursor: default; background: rgba(0,0,0,.4); border-color: rgba(255,255,255,.3); }
.album-still img, .album-still .ph { width: 100%; height: 100%; object-fit: cover; font-size: 10px; }
.album-no { position: absolute; left: 4px; top: 2px; font: 400 var(--fs-xs) var(--font-title); color: #fff; text-shadow: 0 1px 2px #000; }
.album-view { position: absolute; inset: 0; z-index: 30; background: #000; display: grid; place-items: center; cursor: pointer; animation: fade-in .2s; }
.album-view-img, .album-view .ph { width: 100%; height: 100%; object-fit: contain; }
.album-scenes { display: flex; flex-direction: column; gap: 10px; }
.album-ch-name { font: 400 var(--fs-m) var(--font-title); margin-bottom: 6px; }
.album-ch { display: flex; flex-direction: column; } .album-ch .btn { margin: 0 6px 6px 0; } .album-ch { flex-wrap: wrap; flex-direction: row; } .album-ch-name { width: 100%; }
.album-diary { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.diary-page { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: #fffaf0; color: var(--c-text); border: 3px solid var(--c-line); background-image: repeating-linear-gradient(180deg, transparent 0 22px, rgba(100, 150, 220, .2) 22px 23px); }
.diary-face { width: 48px; aspect-ratio: 1; border-radius: 50%; overflow: hidden; border: 2px solid var(--c-heart); } .diary-face img, .diary-face .ph { width: 100%; height: 100%; object-fit: cover; }
.dex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(110px, 14vw, 180px), 1fr)); gap: 8px; }
.dex-cell { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px; border-radius: 12px; background: rgba(0,0,0,.25); }
.dex-cell.is-own { background: rgba(255,255,255,.92); color: var(--c-text); }
.dex-name { font-size: var(--fs-xs); font-weight: 800; text-align: center; }
.dex-char { --cc: #888; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px; border-radius: 12px; background: rgba(0,0,0,.25); }
.dex-char.is-own { background: linear-gradient(180deg, #fff, color-mix(in srgb, var(--cc) 30%, #fff)); color: var(--c-text); }
.dex-char img, .dex-char .ph { width: 70%; aspect-ratio: 1; border-radius: 50%; object-fit: cover; }

/* ================= 部屋 ================= */
.room-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap); height: 100%; align-items: center; }
.room-desk { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-height: 0; }
.room-chibi { height: 60%; display: flex; align-items: flex-end; animation: float-y 2s ease-in-out infinite; } .room-chibi-img { height: 100%; width: auto; }
.room-chibi .ph-sd { width: 20vh; height: 100%; }
.room-bubble { position: absolute; top: 6%; left: 10%; right: 10%; padding: .6em 1em; border-radius: 16px; background: #fff; color: var(--c-text); border: 3px solid var(--c-line); font-weight: 800; text-align: center; box-shadow: var(--shadow-s); }
.room-menu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.room-btn { display: flex; align-items: center; gap: 10px; padding: clamp(8px, 2vh, 18px) 14px; border-radius: 16px; border: var(--bw) solid var(--c-line); background: var(--c-panel); color: var(--c-text); cursor: pointer; font: 400 var(--fs-m) var(--font-title); box-shadow: 0 5px 0 var(--c-line); animation: pop-in .35s backwards; min-height: var(--tap); }
.room-btn:hover { transform: translateY(-2px); background: #fff7e0; }
.room-btn.btn--blue { background: linear-gradient(180deg, #d8f0ff, #9fd0ff); } .room-btn.btn--gold { background: linear-gradient(180deg, #fff6c0, #ffd84a); }
.room-btn-ic { width: clamp(28px, 6vh, 48px); aspect-ratio: 1; } .room-btn-ic img, .room-btn-ic .ph { width: 100%; height: 100%; object-fit: contain; font-size: 9px; }
.room-rest { grid-column: span 2; justify-self: end; }

/* ================= 小さい画面（スマホ横持ち） ================= */
@media (max-height: 500px) {
  .title-logo-wrap { top: 5vh; width: min(52vw, 820px); }
  .title-menu { bottom: calc(var(--safe-b) + 8vh); gap: 6px; }
  .title-btn { min-height: 40px; padding: .3em 1em; }
  .ms-body { padding-top: 6px; }
  .tabs { margin-bottom: 6px; } .tab { min-height: 34px; padding: .3em .8em; }
  .menu-tile-sub { display: none; }
  .stat { grid-template-columns: 6.4em minmax(2em, 1fr) minmax(4.6em, auto) 1em; }
  .eq-preview { height: 70px; }
  .prep-enemy { min-height: 0; }
  .scr-prep .ms-body { padding-bottom: calc(var(--safe-b) + 8px); }
  .prep-actions { bottom: calc(var(--safe-b) + 14px); right: calc(var(--safe-r) + 18px); }
  /* 低い画面：セコンドと消耗品を横にならべ、右パネルの下にボタンの列のぶんの余白をとる（ボタンが枠にかぶらないように） */
  .prep-picks { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 8px; }
  .prep-sec-title small { display: none; }
  .prep-mine { padding-bottom: 62px; gap: 4px; }
  .prep-second { width: 60px; padding: 3px 2px; } .prep-con { width: 58px; }
  .prep-mine-art { width: 34%; }
  .forge-anvil { height: 60px; }
  .prep-enemy-art { width: 38%; }
  .res-banner { height: 72px; padding-top: 4px; }
  .res-banner-text { -webkit-text-stroke-width: 3px; font-size: 40px; }
  .res-hero-face { height: 80px; }
  .bond-main { grid-template-columns: minmax(0, .6fr) minmax(0, 1.4fr) minmax(0, 1.2fr); }
  .shop-grid { grid-template-columns: minmax(0, .55fr) minmax(0, 1.5fr) minmax(0, 1fr); }
  .gc-cards.is-many { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
  .gc-card { padding: 4px; } .gc-cards.is-many .gc-card-name { font-size: 9px; }
  .set-wrap { grid-template-columns: minmax(100px, 160px) minmax(0, 1fr); }
  .seg-btn { min-height: 34px; padding: .3em .7em; }
  .slot-card { min-height: 52px; padding: 6px 10px; }
}
.slot-card.is-broken .slot-empty { color: var(--c-danger); }

/* 育てれば必ず勝てる（バランス第3回）：準備画面の「育成のまもり／リベンジ応援」と、負け画面の「育てると、こう変わる」 */
.prep-guard { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: var(--fs-s); font-weight: 800; }
.prep-guard-item { display: inline-flex; align-items: baseline; gap: 4px; padding: .1em .6em; border-radius: 999px; background: #e3f4ff; }
.prep-guard-item b { color: #1767b8; }
.prep-revenge { background: #ffe6d2; } .prep-revenge b { color: #c84a00; }
.prep-subwarn { background: #ffe3e8; } .prep-subwarn b { color: #c0143c; }
.res-hero-name { font-weight: 900; font-size: var(--fs-s); opacity: .9; }
.lose-grow { width: 100%; display: flex; flex-direction: column; gap: 4px; padding: 8px 12px; font-size: var(--fs-s); }
.lose-grow:empty { display: none; }
.lose-grow-head { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; font-weight: 800; }
.lose-grow-head:empty { display: none; }
.lose-revenge b { color: #c84a00; font-size: 1.1em; }
.lose-exp { color: #18803a; }
.lose-grow-title { font-weight: 900; opacity: .8; }
.lose-grow-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.lose-grow-list li { display: flex; gap: 8px; align-items: baseline; line-height: 1.35; }
.lose-grow-list i { flex: none; min-width: 2.6em; text-align: center; font-style: normal; font-weight: 900; font-size: .85em; padding: .05em .4em; border-radius: 6px; background: #ffeaa8; color: #7a4f00; }
@media (max-height: 460px) { .prep-guard { font-size: 10px; gap: 2px 5px; } .prep-guard-item { padding: 0 .45em; } .lose-wrap { gap: 6px; } .lose-title { font-size: var(--fs-l); } .lose-grow { padding: 5px 10px; gap: 2px; } }
/* 準備画面：パネルを画面の高さいっぱいに伸ばす（1280×720 で下に 200px ほど空いていた。QA 第3回） */
.scr-prep .ms-body { display: flex; flex-direction: column; }
.scr-prep .prep-grid { flex: 1 0 auto; }
