/* CHRONICLE PACKER — デザイントークン・レイアウト・共通部品（architecture.md 6章） */
:root {
  --bg0: #0b1026; --bg1: #121a3d; --panel: rgba(22, 30, 70, .72); --panel2: rgba(14, 20, 50, .82);
  --line: rgba(216, 180, 90, .35); --line2: rgba(216, 180, 90, .6);
  --gold: #d8b45a; --gold2: #ffe39a; --ink: #eef0ff; --sub: #a9b0d6; --dim: #6f77a6;
  --pink: #ff9ec7; --cyan: #8fe3ff; --violet: #c7a6ff; --red: #ff5a6e; --green: #6ee7a8;
  --r: 14px;
  --f-head: "Zen Maru Gothic", "Noto Sans JP", sans-serif;
  --f-serif: "Shippori Mincho B1", "Shippori Mincho", "Noto Serif JP", serif;
  --f-num: "Rajdhani", "Noto Sans JP", sans-serif;
  --f-body: "Noto Sans JP", sans-serif;
  --ease-out: cubic-bezier(.2, .9, .3, 1);
  --ease-back: cubic-bezier(.2, 1.4, .4, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #04060f; overflow: hidden; }
body { font-family: var(--f-body); color: var(--ink); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, select, input { font: inherit; color: inherit; }
::selection { background: rgba(255, 158, 199, .35); }

/* ---------- ステージ ---------- */
#viewport { position: fixed; inset: 0; overflow: clip; background: radial-gradient(ellipse at 50% 50%, #0d1330, #03040b 75%); }
#stage { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; overflow: clip; background: var(--bg0); contain: layout paint; }

/* 背景: 画像（assets/bg/main.webp）＋グラデーション＋光の粒 */
#bg { position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 50% at 18% 20%, rgba(199, 166, 255, .22), transparent 70%),
    radial-gradient(ellipse 55% 45% at 85% 80%, rgba(255, 158, 199, .16), transparent 70%),
    radial-gradient(ellipse 70% 60% at 60% 10%, rgba(143, 227, 255, .14), transparent 70%),
    linear-gradient(170deg, #1b2350 0%, #121a3d 40%, #0b1026 100%); }
#bg-img { position: absolute; inset: 0; background: url(../assets/bg/main.webp) center / cover no-repeat; opacity: .55; animation: bgDrift 60s ease-in-out infinite alternate; }
@keyframes bgDrift { to { transform: scale(1.06) translate(-10px, -6px); } }
#bg-veil { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 40%, transparent 30%, rgba(5, 8, 22, .65) 100%), linear-gradient(180deg, rgba(11, 16, 38, .35), rgba(11, 16, 38, .55)); }
#amb-canvas { position: absolute; inset: 0; width: 1920px; height: 1080px; }

/* ---------- パネル（ガラス×金の細線） ---------- */
.panel {
  position: absolute; border-radius: var(--r);
  background: linear-gradient(180deg, rgba(30, 40, 92, .74), rgba(16, 22, 56, .78));
  backdrop-filter: blur(10px) saturate(1.15); -webkit-backdrop-filter: blur(10px) saturate(1.15);
  border: 1px solid var(--line);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04), inset 0 1px 0 rgba(255, 227, 154, .18), 0 12px 36px rgba(0, 0, 0, .42);
}
.panel::before { /* 内側の細い金線 */
  content: ""; position: absolute; inset: 5px; border-radius: calc(var(--r) - 5px); pointer-events: none;
  border: 1px solid rgba(216, 180, 90, .16);
}
.panel::after { /* 角の飾り */
  content: ""; position: absolute; inset: -1px; border-radius: var(--r); pointer-events: none;
  background:
    linear-gradient(var(--gold2), var(--gold2)) left top / 18px 1px no-repeat,
    linear-gradient(var(--gold2), var(--gold2)) left top / 1px 18px no-repeat,
    linear-gradient(var(--gold2), var(--gold2)) right bottom / 18px 1px no-repeat,
    linear-gradient(var(--gold2), var(--gold2)) right bottom / 1px 18px no-repeat;
  opacity: .55;
}
.ph { margin: 0; padding: 12px 18px 8px; display: flex; align-items: baseline; gap: 10px; font-family: var(--f-head); font-weight: 900; font-size: 16px; letter-spacing: .12em; color: var(--gold2); }
.ph span { text-shadow: 0 0 12px rgba(255, 227, 154, .35); }
.ph small { font-family: var(--f-body); font-weight: 500; font-size: 12px; letter-spacing: .02em; color: var(--sub); margin-left: auto; }

/* ---------- 上部バー ---------- */
#top { position: absolute; left: 0; top: 0; right: 0; height: 64px; z-index: 5; display: flex; align-items: center; gap: 22px; padding: 0 18px;
  background: linear-gradient(180deg, rgba(10, 14, 36, .92), rgba(18, 26, 61, .78));
  border-bottom: 1px solid var(--line); box-shadow: 0 6px 24px rgba(0, 0, 0, .35), inset 0 -1px 0 rgba(255, 227, 154, .12); }
#top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold2), transparent); opacity: .6; }
.logo { width: 364px; display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.logo b { font-family: var(--f-serif); font-weight: 800; font-size: 25px; letter-spacing: .06em; line-height: 1;
  background: linear-gradient(180deg, #fff7d6 0%, #ffe39a 40%, #c89a3a 62%, #ffe9b0 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .7)) drop-shadow(0 0 10px rgba(255, 210, 120, .25)); }
.logo .l2 { background: linear-gradient(180deg, #fff 0%, #ffd1ea 45%, #c7a6ff 100%); -webkit-background-clip: text; background-clip: text; }
.logo small { font-family: var(--f-head); font-size: 11px; color: var(--sub); letter-spacing: .1em; }
#top .cur { display: flex; gap: 10px; }
.cu { position: relative; display: flex; align-items: center; gap: 10px; min-width: 176px; height: 46px; padding: 0 16px 0 8px; border-radius: 23px;
  background: linear-gradient(180deg, rgba(8, 12, 32, .75), rgba(26, 34, 80, .6)); border: 1px solid rgba(216, 180, 90, .3); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); }
.cu .ic { width: 32px; height: 32px; border-radius: 50%; flex: none; position: relative; }
.cu.g .ic { background: radial-gradient(circle at 35% 30%, #fff6c8, #f2c14e 45%, #8a5a10 100%); box-shadow: 0 0 12px rgba(255, 210, 100, .55), inset 0 0 0 2px rgba(255, 240, 190, .5); }
.cu.g .ic::after { content: "G"; position: absolute; inset: 0; display: grid; place-items: center; font: 700 17px var(--f-num); color: #6a3e00; }
.cu.m .ic { background: radial-gradient(circle at 35% 30%, #f0fdff, #8fe3ff 45%, #2a5cc0 100%); border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; box-shadow: 0 0 14px rgba(143, 227, 255, .6); }
.cu.m .ic::after { content: "✧"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 16px; color: #fff; text-shadow: 0 0 4px #2a5cc0; }
.cu.s .ic { background: linear-gradient(135deg, #f5e8ff, #c7a6ff 40%, #6a3ac0); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); filter: drop-shadow(0 0 8px rgba(199, 166, 255, .7)); }
.cu div { display: flex; flex-direction: column; line-height: 1; }
.cu b { font: 700 26px var(--f-num); letter-spacing: .02em; color: #fff; text-shadow: 0 0 10px rgba(255, 255, 255, .15); }
.cu.g b { color: var(--gold2); } .cu.m b { color: #d4f6ff; } .cu.s b { color: #eadcff; }
.cu small { font: 600 13px var(--f-num); color: var(--sub); margin-top: 2px; }
.cu.bump { animation: bump .45s var(--ease-back); }
@keyframes bump { 30% { transform: scale(1.12); box-shadow: 0 0 22px rgba(255, 227, 154, .6); } }
.goal { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 16px; border-radius: 20px; background: rgba(8, 12, 32, .45); border: 1px solid rgba(255, 158, 199, .25); }
.goal i { flex: none; font-style: normal; font: 700 12px var(--f-head); color: #2a0e1f; background: linear-gradient(90deg, var(--pink), var(--violet)); padding: 3px 10px; border-radius: 10px; letter-spacing: .1em; }
.goal span { font-family: var(--f-head); font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.goal.new span { animation: goalIn .6s var(--ease-out); }
@keyframes goalIn { from { opacity: 0; transform: translateY(8px); filter: blur(3px); } }
.top-btns { display: flex; gap: 8px; }
.ibtn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: rgba(8, 12, 32, .6); color: var(--gold2); font-size: 20px; cursor: pointer; transition: transform .12s, box-shadow .2s, background .2s; }
.ibtn:hover { box-shadow: 0 0 14px rgba(255, 227, 154, .45); background: rgba(40, 50, 110, .7); }
.ibtn:active { transform: scale(.92); }
.ibtn.off { color: var(--dim); text-decoration: line-through; }

/* ---------- 3ペイン ---------- */
#left, #right, #center { position: absolute; top: 64px; bottom: 0; z-index: 2; overflow: clip; transition: filter .3s, opacity .3s; }
#left { left: 0; width: 400px; }
#right { right: 0; width: 400px; }
#center { left: 400px; width: 1120px; }
#stage.overlay-on #left, #stage.overlay-on #right { filter: brightness(.45) saturate(.6); pointer-events: none; }
#summaryPanel { left: 12px; right: 6px; top: 12px; height: 470px; }
#liricaPanel { left: 12px; right: 6px; top: 494px; bottom: 12px; overflow: hidden; }
#detailPanel { left: 6px; right: 12px; top: 12px; height: 420px; }
#handPanel { left: 6px; right: 12px; top: 444px; bottom: 12px; display: flex; flex-direction: column; }
#tabbar { position: absolute; left: 6px; right: 6px; top: 12px; height: 58px; display: flex; gap: 6px; padding: 5px; border-radius: var(--r);
  background: rgba(10, 14, 36, .6); border: 1px solid var(--line); backdrop-filter: blur(8px); }
#tabview { position: absolute; left: 6px; right: 6px; top: 82px; bottom: 12px; }
#tabview > .tab-root { position: absolute; inset: 0; }
#tabview > .tab-root.enter { animation: tabIn .32s var(--ease-out); }
#tabview > .tab-root.leave { animation: tabOut .16s ease-in forwards; pointer-events: none; }
@keyframes tabIn { from { opacity: 0; transform: translateY(14px) scale(.99); filter: blur(4px); } }
@keyframes tabOut { to { opacity: 0; transform: translateY(-8px); filter: blur(3px); } }

/* タブ列 */
.tb { position: relative; z-index: 1; flex: 1; border: 0; border-radius: 10px; background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--sub); transition: color .2s, background .2s, transform .1s; padding: 0 6px; min-width: 0; }
.tb i { font-style: normal; font-size: 19px; width: 24px; text-align: center; }
.tb b { font-family: var(--f-head); font-weight: 900; font-size: 17px; letter-spacing: .08em; white-space: nowrap; }
.tb small { position: absolute; left: 4px; right: 4px; bottom: 2px; font-size: 9.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--dim); }
.tb:hover:not(.locked) { color: var(--ink); background: rgba(255, 255, 255, .05); }
.tb:active:not(.locked) { transform: translateY(1px) scale(.98); }
.tb.on { color: #1d1206; }
.tb.on i { text-shadow: none; }
.tb.locked { cursor: not-allowed; opacity: .6; }
.tb.locked b { margin-bottom: 10px; font-size: 15px; }
.tb.locked i { margin-bottom: 10px; }
.tb.denied { animation: deny .35s; }
@keyframes deny { 25% { transform: translateX(-5px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
.tb-ink { position: absolute; top: 5px; bottom: 5px; left: 5px; width: 0; border-radius: 10px; z-index: 0; transition: left .35s var(--ease-out), width .35s var(--ease-out);
  background: linear-gradient(180deg, #fff2c4, #e8c46a 55%, #c5953a); box-shadow: 0 0 18px rgba(255, 220, 130, .45), inset 0 1px 0 #fff; }
.lk { display: inline-block; position: relative; width: 12px; height: 10px; border-radius: 2px; background: currentColor; margin-top: 6px; vertical-align: middle; }
.lk::before { content: ""; position: absolute; left: 2px; right: 2px; top: -7px; height: 9px; border: 2px solid currentColor; border-bottom: 0; border-radius: 6px 6px 0 0; }

/* ---------- 左: サマリ ---------- */
#summary { padding: 0 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.sm-row { position: relative; display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 12px 0 10px; border-radius: 11px; border: 1px solid rgba(169, 176, 214, .14); cursor: pointer; text-align: left;
  background: linear-gradient(90deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .015)); transition: transform .15s var(--ease-out), border-color .2s, background .2s, box-shadow .2s; overflow: hidden; }
.sm-row::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 2px; background: var(--dim); transition: background .2s; }
.sm-row:hover { transform: translateX(3px); border-color: var(--line2); background: linear-gradient(90deg, rgba(255, 227, 154, .1), rgba(255, 255, 255, .02)); }
.sm-row:active { transform: translateX(3px) scale(.985); }
.sm-row.cur { border-color: var(--line2); background: linear-gradient(90deg, rgba(255, 227, 154, .14), rgba(255, 255, 255, .03)); }
.sm-row.cur::before { background: var(--gold2); box-shadow: 0 0 8px var(--gold2); }
.sm-ic { flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-style: normal; font-size: 20px; color: var(--gold2); background: radial-gradient(circle at 40% 30%, rgba(255, 227, 154, .22), rgba(10, 14, 36, .6)); border: 1px solid rgba(216, 180, 90, .3); }
.sm-tx { flex: 1; min-width: 0; }
.sm-l1 { display: flex; align-items: baseline; gap: 10px; }
.sm-title { font-family: var(--f-head); font-weight: 900; font-size: 15px; color: var(--ink); white-space: nowrap; }
.sm-main { font: 700 20px var(--f-num); color: var(--gold2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-left: auto; }
.sm-sub { font-size: 12.5px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }
.sm-tag { flex: none; align-self: center; font-style: normal; font-size: 10px; font-weight: 700; letter-spacing: .05em; padding: 0 6px; border-radius: 6px; line-height: 15px; }
.sm-tag:empty { display: none; }
.sm-row.lv-red::before { background: var(--red); } .sm-row.lv-red .sm-sub { color: #ffb3bd; } .sm-row.lv-red .sm-tag { background: var(--red); color: #fff; }
.sm-row.lv-gold::before { background: var(--gold2); } .sm-row.lv-gold .sm-sub { color: var(--gold2); } .sm-row.lv-gold .sm-tag { background: var(--gold2); color: #3a2400; }
.sm-row.lv-blue::before { background: var(--cyan); } .sm-row.lv-blue .sm-sub { color: var(--cyan); } .sm-row.lv-blue .sm-tag { background: var(--cyan); color: #06283a; }
.sm-row.lv-red .sm-main { color: #ffb3bd; }
.sm-row.blink.lv-red { animation: blinkR 1.6s ease-in-out infinite; }
.sm-row.blink.lv-blue { animation: blinkB 1.6s ease-in-out infinite; }
.sm-row.blink.lv-gold { animation: blinkG 1.8s ease-in-out infinite; }
.sm-row.blink.lv-red .sm-main, .sm-row.blink.lv-red .sm-tag { margin-right: 0; }
@keyframes blinkR { 50% { box-shadow: inset 0 0 0 1px var(--red), 0 0 16px rgba(255, 90, 110, .45); } }
@keyframes blinkB { 50% { box-shadow: inset 0 0 0 1px var(--cyan), 0 0 16px rgba(143, 227, 255, .4); } }
@keyframes blinkG { 50% { box-shadow: inset 0 0 0 1px var(--gold2), 0 0 16px rgba(255, 227, 154, .35); } }
.sm-row.locked { opacity: .55; cursor: default; }
.sm-row.locked:hover { transform: none; }
.sm-row.locked .sm-ic { color: var(--dim); }
.sm-row.locked .sm-sub { font-size: 11.5px; }

/* ---------- 左: リリカ ---------- */
#lirica { position: absolute; inset: 0; }
.lr-stage { position: absolute; left: 0; right: 0; top: 0; bottom: 0; cursor: pointer; }
.lr-glow { position: absolute; left: 50%; top: 52%; width: 420px; height: 420px; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 158, 199, .28), rgba(199, 166, 255, .12) 45%, transparent 70%); animation: glowP 5s ease-in-out infinite; }
@keyframes glowP { 50% { transform: translate(-50%, -50%) scale(1.08); opacity: .8; } }
.lr-breathe { position: absolute; left: 0; right: 0; top: 96px; height: 820px; transform-origin: 50% 70%; animation: breathe 4.2s ease-in-out infinite; }
@keyframes breathe { 50% { transform: translateY(-2px) scaleY(1.008) scaleX(.997); } }
.lr-breathe.hop { animation: hop .45s var(--ease-back), breathe 4.2s ease-in-out .45s infinite; }
@keyframes hop { 40% { transform: translateY(-14px); } }
.lr-img { position: absolute; left: 50%; top: 0; height: 820px; width: auto; transform: translateX(-50%); opacity: 0; transition: opacity .35s ease; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .45)); user-select: none; -webkit-user-drag: none; }
.lr-img.on { opacity: 1; }
.lr-bubble { position: absolute; left: 14px; right: 14px; top: 14px; min-height: 84px; padding: 12px 16px 12px; border-radius: 16px; z-index: 2;
  background: linear-gradient(180deg, rgba(255, 255, 255, .97), rgba(246, 240, 255, .95)); color: #2a1f3d; box-shadow: 0 8px 22px rgba(0, 0, 0, .35), 0 0 0 2px rgba(255, 158, 199, .5);
  opacity: 0; transform: translateY(-6px) scale(.96); transition: opacity .25s, transform .25s var(--ease-back); pointer-events: none; }
.lr-bubble::after { content: ""; position: absolute; left: 50%; bottom: -12px; width: 22px; height: 14px; background: #f6f0ff; clip-path: polygon(0 0, 100% 0, 30% 100%); filter: drop-shadow(0 2px 0 rgba(255, 158, 199, .5)); }
.lr-bubble.show { opacity: 1; transform: none; }
.lr-bubble.show.hide { opacity: 0; transform: translateY(-4px) scale(.98); transition-duration: .6s; }
.lr-bubble.pop { animation: bubPop .3s var(--ease-back); }
@keyframes bubPop { from { transform: scale(.85); } }
.lr-name { position: absolute; left: 14px; top: -11px; font: 900 12px var(--f-head); letter-spacing: .15em; color: #fff; background: linear-gradient(90deg, var(--pink), var(--violet)); padding: 2px 12px; border-radius: 10px; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.lr-text { font-family: var(--f-head); font-weight: 700; font-size: 16.5px; line-height: 1.6; min-height: 52px; }

/* ---------- 右: 詳細 ---------- */
#detail { position: absolute; inset: 14px 14px 12px; overflow-y: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(#000 calc(100% - 14px), transparent); mask-image: linear-gradient(#000 calc(100% - 14px), transparent); }
#detail.dt-in { animation: dtIn .22s var(--ease-out); }
@keyframes dtIn { from { opacity: .3; transform: translateX(6px); } }
.dt-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; color: var(--sub); font-family: var(--f-head); line-height: 1.7; border-radius: 12px;
  background: radial-gradient(ellipse at 50% 38%, rgba(199, 166, 255, .14), transparent 60%); }
.dt-e-card { transform: rotate(-6deg); animation: dtFloat 4s ease-in-out infinite; box-shadow: 0 0 0 1px #111, 0 0 30px rgba(199, 166, 255, .35), 0 14px 30px rgba(0, 0, 0, .6) !important; }
@keyframes dtFloat { 50% { transform: rotate(-3deg) translateY(-8px); } }
.dt-e-txt { display: flex; flex-direction: column; gap: 6px; }
.dt-e-txt b { font: 700 15px var(--f-num); letter-spacing: .5em; color: var(--gold2); }
.dt-e-txt span { font-size: 14px; color: #d6dbf5; }
.dt-e-txt small { font-size: 12px; color: var(--dim); }
.dt-top { display: flex; gap: 14px; }
.dt-card { flex: none; }
.dt-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.dt-rar { font: 700 22px var(--f-num); line-height: 1; letter-spacing: .06em; display: flex; align-items: baseline; gap: 8px; }
.dt-rar small { font: 500 11px var(--f-body); color: var(--sub); letter-spacing: 0; }
.dt-rar.r-N { color: #cfd6ff; } .dt-rar.r-R { color: #eef2ff; text-shadow: 0 0 8px rgba(255, 255, 255, .5); }
.dt-rar.r-SR { color: var(--gold2); text-shadow: 0 0 10px rgba(255, 210, 100, .6); }
.dt-rar.r-UR { background: linear-gradient(90deg, #ff8ad8, #ffe39a, #8fe3ff, #c7a6ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.dt-name { font-family: var(--f-serif); font-weight: 800; font-size: 18px; line-height: 1.3; word-break: keep-all; overflow-wrap: anywhere; }
.dt-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.dt-chip { font-size: 11px; padding: 1px 8px; border-radius: 8px; background: rgba(143, 227, 255, .1); border: 1px solid rgba(143, 227, 255, .25); color: #cdefff; }
.dt-stat { font: 700 18px var(--f-num); color: #fff; display: flex; gap: 6px; align-items: baseline; }
.dt-stat b { font-size: 12px; color: var(--sub); margin-left: 4px; }
.dt-own { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 13px; }
.dt-own b { color: var(--gold2); font-family: var(--f-head); }
.dt-own span { color: var(--cyan); font-size: 12px; }
.dt-own small { width: 100%; color: var(--sub); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dt-roles { margin-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.dt-role { display: grid; grid-template-columns: 22px 52px 1fr; align-items: start; gap: 4px; font-size: 12.5px; line-height: 1.45; padding: 5px 8px; border-radius: 8px; background: rgba(255, 255, 255, .03); border: 1px solid transparent; }
.dt-role i { font-style: normal; color: var(--gold2); text-align: center; }
.dt-role b { font-family: var(--f-head); color: var(--ink); font-size: 12px; }
.dt-role span { color: #d6dbf5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.dt-role.off { opacity: .45; }
.dt-role.focus { border-color: var(--line2); background: rgba(255, 227, 154, .08); box-shadow: inset 3px 0 0 var(--gold2); }
.dt-finish { margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12px; padding: 6px 10px; border-radius: 8px; background: rgba(199, 166, 255, .1); border: 1px solid rgba(199, 166, 255, .3); }
.dt-finish > span:not(.fbadge) { color: var(--gold2); font-weight: 700; }
.dt-finish small { width: 100%; color: #d9ccff; }

/* ---------- 右: 手持ち ---------- */
.hand-tools { display: flex; align-items: center; gap: 8px; padding: 0 14px 8px; }
.chips { display: flex; gap: 4px; flex: 1; }
.chip { border: 1px solid rgba(169, 176, 214, .25); background: rgba(255, 255, 255, .04); border-radius: 12px; padding: 3px 10px; font-size: 12px; cursor: pointer; color: var(--sub); transition: all .15s; }
.chip:hover { color: var(--ink); border-color: var(--line2); }
.chip.on { background: linear-gradient(180deg, #fff2c4, #d8b45a); color: #2a1a05; border-color: transparent; font-weight: 700; }
.sel { background: rgba(8, 12, 32, .7); border: 1px solid var(--line); border-radius: 8px; padding: 3px 6px; font-size: 12px; }
#hand { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 12px 16px 14px; scrollbar-width: thin; scrollbar-color: rgba(216, 180, 90, .4) transparent; }
#hand::-webkit-scrollbar { width: 6px; } #hand::-webkit-scrollbar-thumb { background: rgba(216, 180, 90, .4); border-radius: 3px; }
.hand-grid { display: grid; grid-template-columns: repeat(3, 104px); gap: 14px 10px; justify-content: space-between; padding-top: 4px; }
/* 一覧の NEW は小さな光る点（カードの内側に収め、隣にかからない）。件数は見出しに出す */
.hand-grid .cv-new { left: auto; right: 5px; top: 5px; width: 12px; height: 12px; padding: 0; border-radius: 50%; font-size: 0; line-height: 0; box-shadow: 0 0 0 2px #fff, 0 0 10px rgba(255, 90, 142, .9); }
.hc-new { font-style: normal; margin-left: 8px; padding: 0 7px; border-radius: 8px; font: 700 11px var(--f-num); letter-spacing: .08em; color: #fff; background: linear-gradient(90deg, #ff5a8e, #ff9ec7); }
.hand-empty { height: 100%; min-height: 200px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--dim); font-family: var(--f-head); }
.hand-empty b { color: var(--sub); }

/* カードの包み（cardview） */
.cv { position: relative; transition: transform .16s var(--ease-out), filter .2s; }
.cv.clickable { cursor: pointer; }
.cv:hover { transform: translateY(-4px); z-index: 2; }
.cv:hover .tcg-card { box-shadow: 0 0 0 2px var(--gold2), 0 0 18px rgba(255, 227, 154, .45), 0 8px 18px rgba(0, 0, 0, .5); }
.cv:active { transform: translateY(-1px) scale(.97); }
.cv.dim { filter: grayscale(.7) brightness(.55); }
.cv.allused .tcg-card { filter: brightness(.6); }
.cv-count { position: absolute; right: -5px; bottom: -5px; min-width: 24px; height: 22px; padding: 0 6px; border-radius: 11px; display: grid; place-items: center; grid-auto-flow: column; gap: 0;
  font: 700 15px var(--f-num); color: #2a1a05; background: linear-gradient(180deg, #fff2c4, #d8b45a); box-shadow: 0 2px 6px rgba(0, 0, 0, .5), 0 0 0 1.5px #3a2a0a; z-index: 3; }
.cv-count small { font-size: 10px; opacity: .7; }
.cv-new { position: absolute; left: -6px; top: -7px; z-index: 3; font: 700 11px var(--f-num); letter-spacing: .08em; color: #fff; padding: 0 6px; border-radius: 7px; line-height: 16px;
  background: linear-gradient(90deg, #ff5a8e, #ff9ec7); box-shadow: 0 0 10px rgba(255, 90, 142, .7); animation: newP 1.4s ease-in-out infinite; }
@keyframes newP { 50% { transform: scale(1.1); box-shadow: 0 0 16px rgba(255, 90, 142, .9); } }
.cv-fin { position: absolute; left: -4px; bottom: 16px; z-index: 3; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font: 900 10px var(--f-head); color: #111; box-shadow: 0 1px 4px rgba(0, 0, 0, .6); }
.cv-fin.f-foil { background: linear-gradient(135deg, #fff, #a8c8ff, #ffb8e8); }
.cv-fin.f-relief { background: linear-gradient(135deg, #fff, #b8c0cc); }
.cv-fin.f-secret { background: conic-gradient(#ff7ad9, #ffe37a, #7affc1, #7ad3ff, #c47aff, #ff7ad9); }
.cv-fin.f-ghost { background: radial-gradient(#fff, #bfe8ff); color: #335; }
.cv-used { text-align: center; font-size: 10.5px; color: var(--cyan); margin-top: 3px; white-space: nowrap; }
.zoom-card { position: absolute; z-index: 1; pointer-events: none; animation: zoomIn .18s var(--ease-out); filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .7)); }
@keyframes zoomIn { from { opacity: 0; transform: scale(.9) translateY(6px); } }
#zoom-layer { position: absolute; inset: 0; z-index: 30; pointer-events: none; }

/* 加工バッジ */
.fbadge { display: inline-block; font: 700 12px var(--f-head); padding: 1px 9px; border-radius: 10px; white-space: nowrap; color: #111; letter-spacing: .04em; }
.fbadge.f-foil { background: linear-gradient(90deg, #ffffff, #b8d4ff, #ffc8ec); }
.fbadge.f-relief { background: linear-gradient(90deg, #ffffff, #c9d0da, #8d96a3); }
.fbadge.f-secret { background: linear-gradient(90deg, #ff9ae0, #ffe37a, #7affc1, #7ad3ff, #c9a0ff); background-size: 200% 100%; animation: tcgName 3s linear infinite; }
.fbadge.f-ghost { background: linear-gradient(90deg, #f4fbff, #bfe8ff, #e0d4ff); color: #24304f; box-shadow: 0 0 10px rgba(191, 232, 255, .7); }

/* ---------- ボタン ---------- */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 20px; border-radius: 12px; cursor: pointer;
  font-family: var(--f-head); font-weight: 900; font-size: 15px; letter-spacing: .06em; color: var(--ink);
  background: linear-gradient(180deg, rgba(70, 86, 170, .9), rgba(36, 46, 110, .95)); border: 1px solid rgba(143, 227, 255, .35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 3px 0 rgba(10, 14, 40, .9), 0 6px 14px rgba(0, 0, 0, .35);
  transition: transform .08s, box-shadow .15s, filter .15s; overflow: hidden; }
.btn::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .25) 50%, transparent 70%); transform: translateX(-120%); transition: transform .5s; pointer-events: none; }
.btn:hover:not(:disabled) { filter: brightness(1.12); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 3px 0 rgba(10, 14, 40, .9), 0 0 18px rgba(143, 227, 255, .35); }
.btn:hover:not(:disabled)::after { transform: translateX(120%); }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 0 0 rgba(10, 14, 40, .9), 0 2px 6px rgba(0, 0, 0, .35); }
.btn:disabled { cursor: not-allowed; filter: grayscale(.8) brightness(.6); }
.btn.gold { color: #2a1a05; background: linear-gradient(180deg, #fff2c4, #e8c46a 50%, #c08a2e); border-color: rgba(255, 240, 190, .8); box-shadow: inset 0 1px 0 #fff, 0 3px 0 #6a4510, 0 6px 16px rgba(0, 0, 0, .35); }
.btn.gold:hover:not(:disabled) { box-shadow: inset 0 1px 0 #fff, 0 3px 0 #6a4510, 0 0 22px rgba(255, 220, 130, .6); }
.btn.gold:active:not(:disabled) { box-shadow: inset 0 1px 0 #fff, 0 0 0 #6a4510; }
.btn.pink { background: linear-gradient(180deg, #ffc2dc, #ff8ab8 55%, #d85a90); color: #3a0a20; border-color: rgba(255, 220, 235, .8); box-shadow: inset 0 1px 0 #fff, 0 3px 0 #7a2048, 0 6px 16px rgba(0, 0, 0, .35); }
.btn.ghost { background: rgba(10, 14, 36, .55); border-color: var(--line); box-shadow: none; }
.btn.danger { background: linear-gradient(180deg, #ff8a96, #c8344a); border-color: #ffb3bd; box-shadow: 0 3px 0 #5a0a18; }
.btn.big { min-height: 54px; padding: 0 40px; font-size: 19px; border-radius: 16px; }
.btn.sm { min-height: 30px; padding: 0 12px; font-size: 13px; border-radius: 9px; }

/* 目標要素を光らせる */
.ui-pulse { animation: uiPulse 1.1s ease-in-out 2 !important; position: relative; z-index: 3; }
@keyframes uiPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 227, 154, 0); } 50% { box-shadow: 0 0 0 4px rgba(255, 227, 154, .9), 0 0 34px rgba(255, 227, 154, .7); } }

/* ---------- 準備中のタブ・鍵 ---------- */
.tab-wip, .tab-lock { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; border-radius: var(--r); }
.tab-wip .big-ic, .tab-lock .big-ic { width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; font-size: 56px; color: var(--gold2);
  background: radial-gradient(circle at 40% 30%, rgba(255, 227, 154, .25), rgba(10, 14, 36, .7)); border: 1px solid var(--line2); box-shadow: 0 0 40px rgba(255, 227, 154, .2); animation: glowP2 3s ease-in-out infinite; }
@keyframes glowP2 { 50% { box-shadow: 0 0 60px rgba(255, 227, 154, .35); } }
.tab-lock .big-ic .lk { transform: scale(3.2); margin: 0; color: var(--gold2); }
.tab-wip h2, .tab-lock h2 { margin: 0; font-family: var(--f-serif); font-size: 36px; color: var(--gold2); letter-spacing: .1em; }
.tab-wip p, .tab-lock p { margin: 0; color: var(--sub); font-family: var(--f-head); font-size: 17px; line-height: 1.8; }
.tab-wip .wip-tag { font: 700 13px var(--f-num); letter-spacing: .4em; color: var(--cyan); }

/* ---------- オーバーレイ（中央ペイン） ---------- */
#overlay { position: absolute; inset: 0; z-index: 10; display: none; overflow: clip; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
#overlay.on { display: block; animation: ovIn .3s ease-out; }
#overlay.out { animation: ovOut .38s ease-in forwards; }
@keyframes ovIn { from { opacity: 0; } }
@keyframes ovOut { to { opacity: 0; transform: scale(1.02); } }

/* ---------- 演出レイヤー ---------- */
#fx-canvas { position: absolute; inset: 0; width: 1920px; height: 1080px; z-index: 60; pointer-events: none; }
#fx-layer { position: absolute; inset: 0; z-index: 61; pointer-events: none; overflow: hidden; }
.fx-pop { position: absolute; transform: translate(-50%, -50%); font: 700 28px var(--f-num); white-space: nowrap; letter-spacing: .02em; pointer-events: none;
  text-shadow: 0 0 10px currentColor, 0 2px 0 rgba(0, 0, 0, .8), 0 0 2px #000; animation: popUp 1.1s var(--ease-out) forwards; }
.fx-pop.small { text-shadow: 0 1px 0 rgba(0, 0, 0, .8), 0 0 6px currentColor; }
@keyframes popUp { 0% { opacity: 0; transform: translate(-50%, -20%) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); } 30% { transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, calc(-50% + var(--dy))); } }
.fx-flash { position: absolute; inset: 0; mix-blend-mode: screen; animation: fxFlash .5s ease-out forwards; }
@keyframes fxFlash { 0% { opacity: 0; } 15% { opacity: var(--o); } 100% { opacity: 0; } }
.fx-fly { position: absolute; width: 10px; height: 10px; border-radius: 50%; transform: translate(-50%, -50%); }
.fx-shake { animation: fxShake .45s; }
@keyframes fxShake { 15% { transform: translate(-8px, 3px); } 30% { transform: translate(7px, -4px); } 45% { transform: translate(-5px, 2px); } 60% { transform: translate(4px, -2px); } 80% { transform: translate(-2px, 1px); } }

/* ---------- トースト ---------- */
/* トーストは中央ペインの下寄りに出す（上部は各タブの数値表示があるため）。pointer-events:none なので下のボタンは押せる */
#toasts { position: absolute; left: 960px; bottom: 34px; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 520px; padding: 12px 18px; border-radius: 12px; font-family: var(--f-head); font-weight: 700; font-size: 15px;
  background: linear-gradient(90deg, rgba(20, 28, 70, .95), rgba(30, 40, 92, .92)); border: 1px solid var(--line2); box-shadow: 0 8px 24px rgba(0, 0, 0, .45); animation: toastIn .35s var(--ease-back); }
.toast i { font-style: normal; font-size: 18px; color: var(--gold2); }
.toast.t-gold { border-color: var(--gold2); box-shadow: 0 0 20px rgba(255, 227, 154, .3), 0 8px 24px rgba(0, 0, 0, .45); }
.toast.t-red { border-color: var(--red); } .toast.t-blue { border-color: var(--cyan); } .toast.t-pink { border-color: var(--pink); }
.toast.out { animation: toastOut .4s ease-in forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(24px) scale(.95); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-12px); } }

/* ---------- モーダル（設定） ---------- */
#modal { position: absolute; inset: 0; z-index: 80; display: none; }
#modal.on { display: block; }
.md-veil { position: absolute; inset: 0; background: rgba(3, 5, 15, .6); backdrop-filter: blur(3px); animation: ovIn .2s; }
.md-box { left: 50%; top: 50%; width: 520px; transform: translate(-50%, -50%); padding: 26px 30px 24px; animation: mdIn .3s var(--ease-back); }
@keyframes mdIn { from { opacity: 0; transform: translate(-50%, -46%) scale(.95); } }
.md-h { margin: 0 0 18px; font-family: var(--f-serif); font-size: 26px; color: var(--gold2); letter-spacing: .15em; }
.md-row { display: grid; grid-template-columns: 90px 1fr 44px; align-items: center; gap: 14px; margin: 14px 0; font-family: var(--f-head); font-weight: 700; }
.md-row em { font: 700 18px var(--f-num); font-style: normal; color: var(--gold2); text-align: right; }
.md-row input[type=range] { accent-color: var(--gold); }
.tog { width: 54px; height: 28px; border-radius: 14px; border: 1px solid var(--line); background: rgba(8, 12, 32, .7); position: relative; cursor: pointer; }
.tog i { position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--sub); transition: left .2s, background .2s; }
.tog.on { background: rgba(255, 158, 199, .3); } .tog.on i { left: 29px; background: var(--pink); }
.md-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; }

/* ---------- ストーリー（全画面） ---------- */
#story { position: absolute; inset: 0; z-index: 90; display: none; overflow: hidden; cursor: pointer; user-select: none; }
#story.on { display: block; animation: ovIn .5s ease-out; }
#story.out { animation: ovOut .45s ease-in forwards; }
.st-bg, .st-bgimg { position: absolute; inset: 0; }
.st-bgimg { background: center / cover no-repeat; opacity: 0; transition: opacity .8s; }
.st-bgimg.on { opacity: 1; animation: bgDrift 40s ease-in-out infinite alternate; }
.st-vignette { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 40%, transparent 45%, rgba(0, 0, 0, .55) 100%); pointer-events: none; }
.st-chars { position: absolute; inset: 0; pointer-events: none; }
.st-char { position: absolute; bottom: -80px; height: 1020px; width: 640px; display: flex; justify-content: center; align-items: flex-end; opacity: 0;
  transition: left .5s var(--ease-out), opacity .5s, filter .35s, transform .5s var(--ease-out); filter: brightness(.55) saturate(.7); transform: translateY(20px); }
.st-char.in { opacity: 1; transform: none; }
.st-char.active { filter: none; transform: translateY(-8px); }
.st-char[data-pos="left"] { left: 120px; }
.st-char[data-pos="right"] { left: 1160px; }
.st-char[data-pos="center"] { left: 720px; }
.st-char img { position: absolute; bottom: 0; height: 100%; width: auto; max-width: none; filter: drop-shadow(0 10px 30px rgba(0, 0, 0, .5)); }
.st-char img.fadein { animation: ovIn .3s; }
.st-char.jump { animation: hop .45s var(--ease-back); }
.st-sil { display: none; }
/* 立ち絵が無いときの仮表示: 光の柱と後光。テキスト枠（上端 y=810）より上で止める */
.st-char.nofile .st-sil { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; position: absolute; bottom: 380px; width: 520px; height: 600px; animation: silFloat 4s ease-in-out infinite; }
@keyframes silFloat { 50% { transform: translateY(-12px); } }
.st-aura { position: absolute; inset: -60px -40px; border-radius: 50%; background: radial-gradient(ellipse at 50% 45%, color-mix(in srgb, var(--c) 70%, #fff) 0%, color-mix(in srgb, var(--c) 35%, transparent) 30%, transparent 65%); filter: blur(6px); animation: auraP 3s ease-in-out infinite; }
@keyframes auraP { 50% { opacity: .75; transform: scale(1.04); } }
.st-pillar { position: absolute; left: 50%; top: -260px; bottom: -40px; width: 220px; margin-left: -110px; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--c) 45%, transparent) 30%, rgba(255, 255, 255, .55) 50%, color-mix(in srgb, var(--c) 45%, transparent) 70%, transparent);
  mask: linear-gradient(180deg, transparent, #000 25%, #000 70%, transparent); -webkit-mask: linear-gradient(180deg, transparent, #000 25%, #000 70%, transparent); filter: blur(4px); mix-blend-mode: screen; }
.st-ring { position: absolute; left: 50%; top: 90px; width: 300px; height: 300px; margin-left: -150px; border-radius: 50%; border: 3px solid color-mix(in srgb, var(--c) 50%, #fff);
  box-shadow: 0 0 30px var(--c), inset 0 0 30px color-mix(in srgb, var(--c) 60%, transparent); opacity: .8;
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .18) 0 4deg, transparent 4deg 16deg); animation: spin2 24s linear infinite; }
.st-sil i { position: relative; margin-top: -40px; font-style: normal; font: 800 120px var(--f-serif); color: rgba(255, 255, 255, .95); text-shadow: 0 0 30px var(--c), 0 0 60px var(--c); }
.st-sil span { position: relative; font: 900 26px var(--f-head); color: #fff; letter-spacing: .3em; text-shadow: 0 0 12px var(--c), 0 2px 4px rgba(0, 0, 0, .6); }
.st-char.enemy.nofile .st-ring { border-style: dashed; animation-duration: 10s; }
.st-char.enemy img { filter: drop-shadow(0 0 30px rgba(255, 90, 120, .45)) drop-shadow(0 10px 30px rgba(0, 0, 0, .6)); }
.st-char.enemy:not(.nofile) { bottom: 300px; height: 620px; }
/* 白い背景（天界）では暗幕を薄く */
#story[data-bg="white"] .st-vignette, #story[data-bg="heaven"] .st-vignette { background: radial-gradient(ellipse at 50% 40%, transparent 55%, rgba(60, 50, 120, .35) 100%); }
.st-title { position: absolute; left: 0; right: 0; top: 38%; text-align: center; transition: opacity .6s, transform .6s; pointer-events: none; }
.st-title small { display: block; font: 700 18px var(--f-num); letter-spacing: .8em; color: var(--gold2); }
.st-title b { display: inline-block; margin-top: 10px; font: 800 56px var(--f-serif); letter-spacing: .12em; color: #fff; text-shadow: 0 0 30px rgba(255, 227, 154, .6), 0 3px 0 rgba(0, 0, 0, .6);
  padding: 8px 60px; background: linear-gradient(90deg, transparent, rgba(11, 16, 38, .7), transparent); }
.st-title.out { opacity: 0; transform: translateY(-30px); }
.st-box { position: absolute; left: 200px; right: 200px; bottom: 40px; height: 230px; padding: 46px 56px 24px; border-radius: 22px;
  background: linear-gradient(180deg, rgba(14, 20, 52, .82), rgba(10, 14, 36, .92)); border: 1px solid var(--line2); backdrop-filter: blur(10px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 227, 154, .25), inset 0 0 0 6px rgba(255, 227, 154, .04); }
.st-box::before { content: ""; position: absolute; inset: 8px; border-radius: 16px; border: 1px solid rgba(216, 180, 90, .2); pointer-events: none; }
.st-name { position: absolute; left: 40px; top: -24px; min-width: 200px; padding: 8px 30px; border-radius: 14px; text-align: center;
  font: 900 24px var(--f-head); letter-spacing: .16em; color: #fff; background: linear-gradient(90deg, color-mix(in srgb, var(--c) 85%, #000), color-mix(in srgb, var(--c) 55%, #0b1026));
  border: 1px solid color-mix(in srgb, var(--c) 60%, #fff); box-shadow: 0 6px 18px rgba(0, 0, 0, .4), 0 0 18px color-mix(in srgb, var(--c) 40%, transparent); }
.st-name.hide { display: none; }
.st-text { font-family: var(--f-head); font-weight: 700; font-size: 30px; line-height: 1.75; color: #fff; text-shadow: 0 2px 4px rgba(0, 0, 0, .5); letter-spacing: .03em; }
.st-box.narr .st-text { color: #e4e8ff; font-family: var(--f-serif); font-weight: 600; text-align: center; padding-top: 14px; }
.st-next { position: absolute; right: 44px; bottom: 22px; color: var(--gold2); font-size: 22px; opacity: 0; }
.st-next.on { opacity: 1; animation: nextB .9s ease-in-out infinite; }
@keyframes nextB { 50% { transform: translateY(6px); } }
.st-ctrl { position: absolute; right: 220px; bottom: 282px; display: flex; gap: 8px; z-index: 5; }
.st-btn { cursor: pointer; padding: 6px 16px; border-radius: 16px; font: 700 14px var(--f-head); letter-spacing: .08em; color: var(--ink); background: rgba(10, 14, 36, .7); border: 1px solid var(--line); transition: all .15s; }
.st-btn:hover { border-color: var(--gold2); color: var(--gold2); }
.st-btn.on { background: linear-gradient(180deg, #fff2c4, #d8b45a); color: #2a1a05; }
.st-log { position: absolute; left: 260px; right: 260px; top: 60px; bottom: 336px; z-index: 3; padding: 24px 40px; border-radius: 20px; overflow-y: auto; display: none;
  background: rgba(8, 12, 30, .95); border: 1px solid var(--line2); cursor: default; }
.st-log.on { display: block; animation: ovIn .2s; }
.st-log h4 { margin: 0 0 12px; font: 800 24px var(--f-serif); color: var(--gold2); letter-spacing: .2em; }
.st-log p { margin: 0 0 12px; font-family: var(--f-head); font-size: 18px; line-height: 1.6; }
.st-log p b { display: block; font-size: 14px; color: var(--pink); }

/* ---------- ヒロインのカットイン ---------- */
#cutin { position: absolute; inset: 0; z-index: 85; display: none; cursor: pointer; }
#cutin.on { display: block; }
#cutin.out { animation: ovOut .38s ease-in forwards; }
#cutin::before { content: ""; position: absolute; inset: 0; background: rgba(3, 5, 15, .55); animation: ovIn .2s; }
.ci-band { position: absolute; left: 0; right: 0; top: 250px; height: 560px; overflow: hidden; animation: ciIn .45s var(--ease-out);
  background: linear-gradient(100deg, color-mix(in srgb, var(--hc) 30%, #0b1026) 0%, color-mix(in srgb, var(--hc) 70%, #1b2350) 50%, color-mix(in srgb, var(--hc) 30%, #0b1026) 100%);
  border-top: 3px solid var(--gold2); border-bottom: 3px solid var(--gold2); box-shadow: 0 0 80px color-mix(in srgb, var(--hc) 60%, transparent); transform: skewY(-3deg); }
@keyframes ciIn { from { transform: skewY(-3deg) scaleY(0); } }
.ci-lines { position: absolute; inset: 0; background: repeating-linear-gradient(-12deg, transparent 0 22px, rgba(255, 255, 255, .12) 22px 25px); animation: ciLines .5s linear infinite; }
@keyframes ciLines { to { background-position: -160px 0; } }
.ci-portrait { position: absolute; left: 140px; top: -80px; width: 640px; height: 900px; transform: skewY(3deg); animation: ciPor .6s var(--ease-out); }
.ci-portrait img { position: absolute; left: 50%; bottom: 0; height: 100%; transform: translateX(-50%); filter: drop-shadow(0 0 30px rgba(255, 255, 255, .5)); }
.ci-sil { position: absolute; left: 130px; top: 120px; width: 380px; height: 660px; border-radius: 190px 190px 30px 30px; display: grid; place-items: center;
  background: radial-gradient(ellipse at 50% 22%, rgba(255, 255, 255, .7) 0 14%, transparent 15%), linear-gradient(180deg, color-mix(in srgb, var(--hc) 70%, #fff), color-mix(in srgb, var(--hc) 40%, #0b1026)); border: 3px solid #fff; box-shadow: 0 0 60px #fff; }
.ci-sil i { font-style: normal; font: 800 160px var(--f-serif); color: #fff; text-shadow: 0 0 30px var(--hc); }
@keyframes ciPor { from { transform: skewY(3deg) translateX(-300px); opacity: 0; } }
.ci-text { position: absolute; left: 860px; top: 120px; right: 80px; transform: skewY(3deg); display: flex; flex-direction: column; gap: 6px; animation: ciTx .6s .1s var(--ease-out) backwards; }
@keyframes ciTx { from { transform: skewY(3deg) translateX(200px); opacity: 0; } }
.ci-text small { font: 700 26px var(--f-num); letter-spacing: .6em; color: var(--gold2); text-shadow: 0 0 12px rgba(255, 227, 154, .6); }
.ci-text em { font-style: normal; font: 700 32px var(--f-head); color: #fff; opacity: .9; }
.ci-text b { font: 800 110px var(--f-serif); line-height: 1.1; color: #fff; text-shadow: 0 0 40px var(--hc), 0 6px 0 rgba(0, 0, 0, .35); letter-spacing: .04em; }
.ci-text span { margin-top: 14px; font: 700 28px var(--f-head); color: #fff; background: rgba(0, 0, 0, .25); padding: 8px 20px; border-radius: 12px; align-self: flex-start; }
.ci-text span:empty { display: none; }
.ci-hint { position: absolute; right: 150px; top: 690px; z-index: 2; padding: 6px 18px; border-radius: 16px; font: 700 16px var(--f-head); letter-spacing: .1em; color: #fff;
  background: rgba(5, 8, 22, .55); border: 1px solid rgba(255, 255, 255, .35); text-shadow: 0 1px 2px #000; animation: hintBlink 1.4s ease-in-out infinite; }
@keyframes hintBlink { 50% { opacity: .3; } }

/* ---------- タイトル画面 ---------- */
#title-screen { position: absolute; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 60px; cursor: pointer; overflow: hidden; padding-right: 340px;
  background: #070a1a; transition: opacity .7s; }
/* キービジュアル: 背景絵を強めにぼかして暗幕。後ろのゲーム画面は見せない */
.ts-bg { position: absolute; inset: -40px; background: radial-gradient(ellipse at 50% 45%, #2b3a7a, #070a1a 75%), #070a1a; }
.ts-bg::after { content: ""; position: absolute; inset: 0; background: url(../assets/bg/main.webp) center / cover no-repeat; filter: blur(6px) saturate(1.15); opacity: .85; animation: bgDrift 40s ease-in-out infinite alternate; }
.ts-veil { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 46%, rgba(10, 14, 40, .25) 0%, rgba(5, 8, 22, .72) 60%, rgba(3, 5, 15, .95) 100%), linear-gradient(0deg, rgba(3, 5, 15, .8), transparent 30%); }
.ts-lirica { position: absolute; right: 70px; bottom: -40px; height: 900px; pointer-events: none; filter: drop-shadow(0 0 40px rgba(255, 158, 199, .35)) drop-shadow(0 10px 30px rgba(0, 0, 0, .6)); animation: tsLir 1.4s .3s var(--ease-out) backwards; }
@keyframes tsLir { from { opacity: 0; transform: translateX(80px); } }
#title-screen.gone { opacity: 0; pointer-events: none; }
.ts-glow { position: absolute; left: calc(50% - 170px); top: 44%; width: 1100px; height: 1100px; transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, rgba(255, 227, 154, .07) 0 4deg, transparent 4deg 14deg); mask: radial-gradient(circle, #000 10%, transparent 65%); -webkit-mask: radial-gradient(circle, #000 10%, transparent 65%); animation: spin 60s linear infinite; }
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.ts-logo { position: relative; display: flex; flex-direction: column; align-items: center; line-height: .95; animation: tsIn 1.2s var(--ease-out); }
@keyframes tsIn { from { opacity: 0; transform: scale(.92); filter: blur(8px); } }
.ts-logo small { font: 700 22px var(--f-head); letter-spacing: .6em; color: var(--pink); margin-bottom: 18px; text-shadow: 0 0 14px rgba(255, 158, 199, .6); }
.ts-logo b { font: 800 150px var(--f-serif); letter-spacing: .06em;
  background: linear-gradient(180deg, #fffbe8 0%, #ffe39a 38%, #b8862e 60%, #ffeab8 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .6)) drop-shadow(0 0 30px rgba(255, 210, 120, .35)); }
.ts-logo .l2 { background: linear-gradient(180deg, #fff 0%, #ffd1ea 45%, #c7a6ff 100%); -webkit-background-clip: text; background-clip: text; margin-top: -6px; }
.ts-start { position: relative; font: 900 30px var(--f-head); letter-spacing: .4em; color: #fff; padding: 14px 60px; border-top: 1px solid var(--line2); border-bottom: 1px solid var(--line2);
  background: linear-gradient(90deg, transparent, rgba(255, 227, 154, .14), transparent); animation: hintBlink 2s ease-in-out infinite; }
.ts-foot { position: absolute; bottom: 40px; left: 0; right: 340px; text-align: center; color: var(--dim); font-family: var(--f-head); letter-spacing: .1em; }

/* ---------- 縦画面の案内 ---------- */
#rotate { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; text-align: center; background: rgba(5, 8, 22, .94); color: var(--ink); font-family: var(--f-head); }
#rotate > div { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 0 16px; }
#rotate i { font-style: normal; font-size: 64px; color: var(--gold2); animation: rot 2s ease-in-out infinite; }
@keyframes rot { 50% { transform: rotate(90deg); } }
#rotate b { font-size: 22px; } #rotate small { color: var(--sub); }
body.portrait #rotate { display: flex; }

/* ストーリー・開封中は背景の重い演出を控える */
#stage.story-on #left, #stage.story-on #right, #stage.story-on #center, #stage.story-on #top { visibility: hidden; }

/* =====================================================================
   開封演出（ui/packopen.js）
   ===================================================================== */
.po { position: absolute; inset: 0; --glow: #8fe3ff; }
.po-bg { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 42%, rgba(40, 46, 110, .94), rgba(6, 8, 22, .98) 72%); }
.po-rays-bg { position: absolute; left: 50%; top: 42%; width: 1600px; height: 1600px; transform: translate(-50%, -50%); border-radius: 50%; opacity: .5;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--glow) 18%, transparent) 0 3deg, transparent 3deg 12deg);
  mask: radial-gradient(circle, #000 5%, transparent 60%); -webkit-mask: radial-gradient(circle, #000 5%, transparent 60%); animation: spin 80s linear infinite; }
.po-title { position: absolute; top: 22px; left: 0; right: 0; text-align: center; z-index: 2; }
.po-title small { display: block; font: 700 14px var(--f-num); letter-spacing: .5em; color: var(--sub); }
.po-title b { font: 800 30px var(--f-serif); letter-spacing: .08em; color: var(--gold2); text-shadow: 0 0 18px rgba(255, 227, 154, .45); }
.po-hint { position: absolute; top: 92px; left: 0; right: 0; text-align: center; font-family: var(--f-head); font-size: 17px; color: #d8dcf5; z-index: 2; }
.po-hint b { color: var(--cyan); }
.po-sum { font: 700 22px var(--f-num); letter-spacing: .04em; color: #fff; }
.po-sum em { font-style: normal; padding: 0 8px; border-radius: 6px; margin-right: 2px; }
.po-sum .r-N { background: #3a4680; } .po-sum .r-R { background: #8a97c8; color: #111; } .po-sum .r-SR { background: linear-gradient(90deg, #fff2c4, #d8b45a); color: #3a2400; }
.po-sum .r-UR { background: linear-gradient(90deg, #ff8ad8, #ffe39a, #8fe3ff); color: #201030; } .po-sum .fin { background: linear-gradient(90deg, #fff, #c7a6ff); color: #201030; } .po-sum .nw { background: #ff5a8e; }
.po-stage { position: absolute; left: 0; right: 0; top: 130px; height: 560px; display: grid; place-items: center; }
.po-stage > * { grid-area: 1 / 1; }
.po.multi .po-stage { top: 128px; height: 780px; }
.po-row { position: absolute; left: 0; right: 0; top: 716px; display: flex; justify-content: center; gap: 18px; }
.po.multi .po-row { display: none; }
.po-btns { position: absolute; left: 0; right: 0; bottom: 34px; display: flex; justify-content: center; gap: 16px; z-index: 5; }

/* パック本体 */
.po-pack { position: relative; width: 300px; height: 500px; cursor: grab; touch-action: none; animation: packIn .7s var(--ease-back); }
@keyframes packIn { from { transform: translateY(-560px) rotate(-14deg); } }
.po-pack:active { cursor: grabbing; }
.po-body, .po-top { position: absolute; inset: 0; }
.po-body { clip-path: inset(12.5% 0 0 0); animation: packFloat 3s ease-in-out infinite; }
.po-top { clip-path: inset(0 0 87.5% 0); transition: transform .55s cubic-bezier(.5, 0, .8, .5), opacity .55s; animation: packFloat 3s ease-in-out infinite; }
@keyframes packFloat { 50% { transform: translateY(-6px); } }
.po-pack .pk-vis { width: 100%; height: 100%; }
.po-stackpk { position: absolute; inset: 0; }
.po-stackpk .pk-vis { position: absolute; inset: 0; filter: brightness(.55); }
.po-stackpk .pk-vis:nth-child(1) { transform: translate(-26px, 14px) rotate(-6deg); }
.po-stackpk .pk-vis:nth-child(2) { transform: translate(24px, 10px) rotate(5deg); }
.po-count { position: absolute; right: -40px; bottom: 40px; font: 700 54px var(--f-num); color: var(--gold2); text-shadow: 0 0 18px rgba(255, 227, 154, .7), 0 3px 0 #000; transform: rotate(-8deg); }
.po-cutguide { position: absolute; left: 3%; right: 3%; top: 11%; height: 3%; border-top: 2px dashed rgba(255, 255, 255, .7); pointer-events: none; animation: hintBlink 1.1s ease-in-out infinite; }
.po-cutguide::after { content: "✂"; position: absolute; left: -26px; top: -18px; font-size: 22px; color: #fff; animation: scis 1.6s ease-in-out infinite; }
@keyframes scis { 50% { transform: translateX(300px); } }
.po-pack.torn .po-cutguide { display: none; }
.po-cut { position: absolute; left: 0; right: 0; top: 12.2%; height: 4px; pointer-events: none; }
.po-cut i { display: block; height: 100%; width: 0; background: #fff; box-shadow: 0 0 18px var(--glow), 0 0 6px #fff, 0 0 40px var(--glow); border-radius: 2px; }
.po-leak { position: absolute; left: 0; top: 4%; width: var(--w, 0); height: 18%; opacity: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 60%, var(--glow), transparent 70%); filter: blur(8px); mix-blend-mode: screen; }
.po-pack.torn .po-top { transform: translate(180px, -220px) rotate(32deg); opacity: 0; }
.po-pack.torn .po-leak { width: 100%; height: 70%; top: -30%; opacity: 1; transition: all .5s; }
.po-pack.torn::after { content: ""; position: absolute; left: 10%; right: 10%; top: -400px; height: 470px; background: linear-gradient(0deg, var(--glow), transparent); filter: blur(12px); mix-blend-mode: screen; opacity: .8; animation: beam .7s ease-out forwards; pointer-events: none; }
@keyframes beam { from { transform: scaleY(0); transform-origin: bottom; } }
.po-pack.gone { transition: transform .4s ease-in, opacity .4s; transform: translateY(420px) scale(.92); opacity: 0; }
.po-circle { position: absolute; inset: -90px; border-radius: 50%; display: none; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, rgba(255, 215, 100, 0) 0 8deg, rgba(255, 215, 100, .35) 8deg 10deg), radial-gradient(circle, transparent 52%, rgba(255, 215, 100, .5) 53%, transparent 56%, transparent 64%, rgba(255, 215, 100, .4) 65%, transparent 67%);
  animation: spin2 8s linear infinite; }
@keyframes spin2 { to { transform: rotate(360deg); } }
.po-pack.omen-ur .po-circle { display: block; background: repeating-conic-gradient(from 0deg, rgba(255, 138, 216, 0) 0 8deg, rgba(255, 138, 216, .4) 8deg 10deg), radial-gradient(circle, transparent 52%, rgba(143, 227, 255, .6) 53%, transparent 56%, transparent 64%, rgba(255, 227, 154, .5) 65%, transparent 67%); }
.po-pack.omen-sr .po-body { filter: drop-shadow(0 0 18px rgba(255, 211, 107, .55)); }
.po-pack.omen-ur .po-body { filter: drop-shadow(0 0 26px rgba(255, 138, 216, .75)); }
.po-pack.omen-fin .po-top::after, .po-pack.omen-foil .po-top::after { content: ""; position: absolute; inset: 0; mix-blend-mode: color-dodge; opacity: .8; background: linear-gradient(90deg, #ff6ec7, #ffe66e, #6effa0, #6ed8ff, #b06eff); background-size: 200% 100%; animation: rainbowShift 1.5s linear infinite; }
.po-pack.omen-foil .po-top::after { opacity: .35; }
@keyframes rainbowShift { to { background-position: 200% 0; } }

/* パックの見た目（仮デザインと画像） */
.pk-vis { position: relative; border-radius: 10px; overflow: hidden; }
.pk-vis .pk-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; user-select: none; }
.pk-vis.has-img .pk-fb { visibility: hidden; }
.pk-fb { position: absolute; inset: 0; border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4%;
  background: radial-gradient(ellipse at 50% 38%, color-mix(in srgb, var(--pa) 55%, #fff) 0%, var(--pa) 18%, var(--pb) 62%, #050816 100%);
  box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--pc) 70%, transparent), inset 0 0 40px rgba(0, 0, 0, .5); }
.pk-fb::before { content: ""; position: absolute; inset: 7% 7%; border: 1.5px solid color-mix(in srgb, var(--pc) 70%, transparent); border-radius: 6px; }
.pk-crimp { position: absolute; left: 0; right: 0; height: 7%; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .35) 0 3px, rgba(0, 0, 0, .25) 3px 6px), linear-gradient(180deg, color-mix(in srgb, var(--pc) 80%, #fff), color-mix(in srgb, var(--pc) 50%, #000)); }
.pk-crimp.t { top: 0; } .pk-crimp.b { bottom: 0; }
.pk-logo { font: 800 calc(min(100cqw, 300px) * .075) var(--f-serif); font-size: 21px; letter-spacing: .12em; text-align: center; line-height: 1; color: var(--pc); text-shadow: 0 2px 0 rgba(0, 0, 0, .5); }
.pk-emb { width: 48%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 40% 35%, rgba(255, 255, 255, .5), transparent 60%), radial-gradient(circle, color-mix(in srgb, var(--pc) 40%, transparent), transparent 70%);
  border: 2px solid color-mix(in srgb, var(--pc) 80%, #fff); box-shadow: 0 0 30px color-mix(in srgb, var(--pa) 70%, transparent), inset 0 0 20px rgba(255, 255, 255, .3); }
.pk-emb i { font-style: normal; font-size: 70px; color: #fff; text-shadow: 0 0 24px var(--pa), 0 0 8px #fff; }
.pk-vol { font: 700 18px var(--f-num); letter-spacing: .3em; color: #fff; background: rgba(0, 0, 0, .3); padding: 2px 16px; border-radius: 10px; }
.pk-name { font: 800 21px var(--f-serif); text-align: center; color: #fff; padding: 0 12%; line-height: 1.35; text-shadow: 0 2px 6px rgba(0, 0, 0, .7); }
.pk-sheen { position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .35) 45%, transparent 60%); background-size: 300% 100%; mix-blend-mode: overlay; animation: sheen 4s ease-in-out infinite; pointer-events: none; }
@keyframes sheen { 0% { background-position: 150% 0; } 60%, 100% { background-position: -150% 0; } }

/* 束・めくり */
.po-stack { position: relative; width: 250px; height: 364px; cursor: pointer; }
.po-stack .po-back { position: absolute; left: 0; top: 0; transform: translate(calc(var(--i) * 3px), calc(var(--i) * -3px)) rotate(calc(var(--i) * 1deg - 2deg)); animation: rise .6s var(--ease-back) backwards; animation-delay: calc(var(--i) * .07s); }
@keyframes rise { from { transform: translateY(380px) scale(.9); opacity: 0; } }
.po-back.peek { box-shadow: 0 0 0 calc(var(--cw) * .012) #111, -4px 0 0 0 var(--peek), 0 10px 24px rgba(0, 0, 0, .6); }
/* 枠チラは左端の色の影（box-shadow）だけで見せる。::before は裏面の金枠に使う */
.po-back.peek-rare { animation: rise .6s var(--ease-back) backwards, rareEdge 1.2s ease-in-out infinite; animation-delay: calc(var(--i) * .07s), 0s; }
@keyframes rareEdge { 50% { box-shadow: 0 0 0 calc(var(--cw) * .012) #111, -5px 0 0 0 #ffe39a, 0 0 28px rgba(255, 211, 107, .8); } }
.po-back.peek-ur { animation: rise .6s var(--ease-back) backwards, urEdge 1s linear infinite; animation-delay: calc(var(--i) * .07s), 0s; }
@keyframes urEdge { 0% { box-shadow: -5px 0 0 #ff8ad8, 0 0 28px #ff8ad8; } 33% { box-shadow: -5px 0 0 #8fe3ff, 0 0 28px #8fe3ff; } 66% { box-shadow: -5px 0 0 #ffe39a, 0 0 28px #ffe39a; } 100% { box-shadow: -5px 0 0 #ff8ad8, 0 0 28px #ff8ad8; } }
.po-face-wrap { position: absolute; left: 0; top: 0; z-index: 10; perspective: 1200px; }
.po-face-wrap.stow { transition: transform .26s ease-in, opacity .26s; transform: translateY(300px) scale(.5); opacity: 0; }
.po-flip { position: relative; transform-style: preserve-3d; transition: transform .5s cubic-bezier(.3, 1.3, .5, 1); }
.po-flip.flipped { transform: rotateY(180deg); }
.po-f-back, .po-f-front { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.po-f-back { position: absolute !important; left: 0; top: 0; }
.po-f-front { transform: rotateY(180deg); }
.po-face-wrap.charge .po-flip { animation: charge .12s linear infinite; }
.po-face-wrap.charge .po-f-back { box-shadow: 0 0 40px #ffe39a, 0 0 80px rgba(255, 211, 107, .6); filter: brightness(1.3); }
.po-face-wrap.r-UR.charge .po-f-back { box-shadow: 0 0 40px #ff8ad8, 0 0 90px rgba(143, 227, 255, .6); }
@keyframes charge { 25% { transform: translate(-2px, 1px) rotate(-.6deg); } 75% { transform: translate(2px, -1px) rotate(.6deg); } }
.po-rays, .po-halo { position: absolute; left: 50%; top: 50%; pointer-events: none; border-radius: 50%; opacity: 0; z-index: -1; }
.po-rays { width: 900px; height: 900px; margin: -450px 0 0 -450px; background: repeating-conic-gradient(from 0deg, rgba(255, 236, 170, .55) 0 5deg, transparent 5deg 15deg);
  mask: radial-gradient(circle, #000 12%, transparent 62%); -webkit-mask: radial-gradient(circle, #000 12%, transparent 62%); }
.po-halo { width: 560px; height: 560px; margin: -280px 0 0 -280px; background: radial-gradient(circle, rgba(255, 240, 190, .9), rgba(255, 158, 199, .35) 40%, transparent 70%); }
.po-face-wrap.burst .po-rays { opacity: 1; animation: spin2 9s linear infinite, raysIn .6s var(--ease-out); }
.po-face-wrap.burst .po-halo { animation: haloB 1.4s ease-out forwards; }
@keyframes raysIn { from { transform: scale(.2); opacity: 0; } }
@keyframes haloB { 0% { transform: scale(.3); opacity: 1; } 100% { transform: scale(1.3); opacity: .5; } }
.po-face-wrap.ur .po-rays { background: repeating-conic-gradient(from 0deg, rgba(255, 138, 216, .5) 0 5deg, transparent 5deg 10deg, rgba(143, 227, 255, .5) 10deg 15deg, transparent 15deg 20deg, rgba(255, 227, 154, .55) 20deg 25deg, transparent 25deg 30deg); }
.po-face-wrap.ur .po-halo { background: radial-gradient(circle, #fff, rgba(255, 138, 216, .5) 35%, rgba(143, 227, 255, .3) 55%, transparent 72%); animation: haloB 1.4s ease-out forwards; }
.po-face-wrap.shine .po-halo { opacity: .6; width: 420px; height: 420px; margin: -210px 0 0 -210px; background: radial-gradient(circle, rgba(220, 230, 255, .6), transparent 65%); animation: haloB 1s ease-out forwards; }
.po-face-wrap.promo { animation: charge .08s linear infinite; }
.po-face-wrap.promo .tcg-card { filter: brightness(2.6) saturate(0); transition: filter .3s; }
.po-urtag { position: absolute; left: 50%; top: -58px; transform: translateX(-50%); white-space: nowrap; font: 700 34px var(--f-num); letter-spacing: .3em;
  background: linear-gradient(90deg, #ff8ad8, #ffe39a, #8fe3ff, #c7a6ff, #ff8ad8); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 10px rgba(255, 138, 216, .8)); animation: stampIn .5s var(--ease-back), rainbowShift 2s linear infinite; }
.po-stamp { position: absolute; left: 50%; bottom: -54px; transform: translateX(-50%); white-space: nowrap; display: flex; flex-direction: column; align-items: center; padding: 4px 22px; border-radius: 12px; line-height: 1.1;
  animation: stampIn .4s cubic-bezier(.2, 1.8, .4, 1); box-shadow: 0 0 24px rgba(255, 255, 255, .55); color: #111; }
.po-stamp b { font: 900 20px var(--f-head); letter-spacing: .1em; }
.po-stamp small { font: 700 11px var(--f-num); letter-spacing: .4em; }
.po-stamp.f-foil { background: linear-gradient(90deg, #ffffff, #b8d4ff, #ffc8ec); }
.po-stamp.f-relief { background: linear-gradient(180deg, #ffffff, #c9d0da 50%, #8d96a3); }
.po-stamp.f-secret { background: linear-gradient(90deg, #ff9ae0, #ffe37a, #7affc1, #7ad3ff, #c9a0ff); background-size: 200% 100%; animation: stampIn .4s cubic-bezier(.2, 1.8, .4, 1), rainbowShift 2s linear infinite; }
.po-stamp.f-ghost { background: linear-gradient(90deg, #f4fbff, #bfe8ff, #e0d4ff); box-shadow: 0 0 30px rgba(191, 232, 255, .9); }
@keyframes stampIn { from { transform: translateX(-50%) scale(2.6) rotate(-8deg); opacity: 0; } }
.po-new { position: absolute; top: -14px; right: -16px; z-index: 12; font: 700 20px var(--f-num); letter-spacing: .1em; color: #fff; padding: 0 12px; border-radius: 12px;
  background: linear-gradient(90deg, #ff3a7a, #ff9ec7); box-shadow: 0 0 16px rgba(255, 58, 122, .8); animation: newIn .45s var(--ease-back), newP 1.4s ease-in-out .45s infinite; }
@keyframes newIn { from { transform: scale(0) rotate(-20deg); } }
.po-new.sm { font-size: 12px; top: -7px; right: -7px; padding: 0 6px; border-radius: 7px; }
.po-mini { position: relative; animation: miniIn .35s var(--ease-back); }
@keyframes miniIn { from { transform: translateY(-120px) scale(1.4); opacity: 0; } }
.po-mini.r-SR .tcg-card { box-shadow: 0 0 0 2px #ffe39a, 0 0 18px rgba(255, 211, 107, .6); }
.po-mini.r-UR .tcg-card { box-shadow: 0 0 0 2px #ff8ad8, 0 0 22px rgba(255, 138, 216, .7); }
.po-mtag { position: absolute; left: 0; right: 0; bottom: -26px; text-align: center; }

/* 複数パックのまとめ表示 */
.po-grid { display: grid; grid-template-columns: repeat(var(--cols), var(--gw)); gap: 14px 12px; cursor: pointer; }
.po-cell { position: relative; width: var(--gw); aspect-ratio: 59 / 86; animation: deal .4s var(--ease-back) backwards; animation-delay: calc(var(--k) * 12ms); perspective: 800px; }
@keyframes deal { from { transform: translateY(-260px) rotate(-12deg) scale(.6); opacity: 0; } }
.po-cell > .po-back { position: absolute; left: 0; top: 0; transform: none; animation: none; transition: transform .25s ease-in, opacity .25s; }
.po-cell > .po-back.peek-rare { animation: rareEdge 1.2s ease-in-out infinite; }
.po-cell > .po-back.peek-ur { animation: urEdge 1s linear infinite; }
.po-cell > .po-back.away { transform: rotateY(90deg); opacity: 0; animation: none; }
.po-cell .po-gface { position: absolute; left: 0; top: 0; animation: gflip .3s ease-out; }
@keyframes gflip { from { transform: rotateY(-90deg); } }
.po-cell.r-SR .po-gface { box-shadow: 0 0 0 2px #ffe39a, 0 0 16px rgba(255, 211, 107, .7); }
.po-cell.r-UR .po-gface { box-shadow: 0 0 0 2px #ff8ad8, 0 0 20px rgba(255, 138, 216, .8); }
.po-cell.r-R .po-gface { box-shadow: 0 0 0 1px #dfe6ff, 0 0 8px rgba(223, 230, 255, .4); }
.po-gfin { position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); font: 900 10px var(--f-head); padding: 0 6px; border-radius: 6px; white-space: nowrap; color: #111; z-index: 3; }
.po-gfin.f-foil { background: linear-gradient(90deg, #fff, #b8d4ff, #ffc8ec); } .po-gfin.f-relief { background: linear-gradient(180deg, #fff, #9aa3b0); }
.po-gfin.f-secret { background: linear-gradient(90deg, #ff9ae0, #ffe37a, #7affc1, #7ad3ff); } .po-gfin.f-ghost { background: #dff4ff; box-shadow: 0 0 8px #bfe8ff; }
.po-spot { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; background: rgba(4, 6, 18, .78); cursor: pointer; animation: ovIn .2s; }
.po-spot.out { animation: ovOut .24s ease-in forwards; }
.po-spot-in { position: relative; width: 280px; height: 408px; }

/* 開封結果（1パック）: 中央に大きく。いちばん良いカードは真ん中で大きく光る */
.po-row.gone { display: none; }
.po-result { display: flex; align-items: center; justify-content: center; gap: 26px; padding-top: 30px; }
.po-rcell { position: relative; cursor: pointer; animation: resIn .5s var(--ease-back) backwards; animation-delay: calc(var(--k) * 70ms); transition: transform .18s var(--ease-out); }
.po-rcell:hover { transform: translateY(-10px) scale(1.03); z-index: 3; }
@keyframes resIn { from { transform: translateY(80px) scale(.8); opacity: 0; } }
.po-rcell.r-R .tcg-card { box-shadow: 0 0 0 1px #dfe6ff, 0 0 14px rgba(223, 230, 255, .45), 0 12px 30px rgba(0, 0, 0, .55); }
.po-rcell.r-SR .tcg-card { box-shadow: 0 0 0 2px #ffe39a, 0 0 26px rgba(255, 211, 107, .7), 0 12px 30px rgba(0, 0, 0, .55); }
.po-rcell.r-UR .tcg-card { box-shadow: 0 0 0 2px #ff8ad8, 0 0 30px rgba(255, 138, 216, .8), 0 12px 30px rgba(0, 0, 0, .55); }
.po-rcell.best { margin: 0 14px; }
.po-rglow { position: absolute; left: 50%; top: 50%; width: 620px; height: 620px; margin: -310px 0 0 -310px; z-index: -1; pointer-events: none; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--glow) 55%, transparent), transparent 62%),
              repeating-conic-gradient(from 0deg, rgba(255, 236, 170, .22) 0 5deg, transparent 5deg 15deg);
  mask: radial-gradient(circle, #000 18%, transparent 66%); -webkit-mask: radial-gradient(circle, #000 18%, transparent 66%); animation: spin2 14s linear infinite; }
.po-rbest { position: absolute; left: 50%; top: -38px; transform: translateX(-50%); white-space: nowrap; font: 700 20px var(--f-num); letter-spacing: .35em; color: var(--gold2);
  text-shadow: 0 0 12px rgba(255, 227, 154, .8), 0 2px 0 #000; }
.po-rcell .po-gfin { bottom: -13px; font-size: 13px; padding: 1px 10px; border-radius: 8px; }
.po-rcell .po-new.sm { font-size: 14px; top: -10px; right: -10px; padding: 0 8px; }

/* 開封結果（複数パック）: N を沈め、SR 以上と加工を浮かせる */
.po-grid.done { cursor: default; }
.po-grid.done .po-cell { cursor: pointer; transition: transform .15s, filter .3s; }
.po-grid.done .po-cell:hover { transform: scale(1.12); z-index: 4; filter: none !important; }
.po-grid.done .po-cell.r-N, .po-grid.done .po-cell.r-R { filter: brightness(.5) saturate(.55); }
.po-grid.done .po-cell.r-N:has(.po-gfin), .po-grid.done .po-cell.r-R:has(.po-gfin), .po-grid.done .po-cell:has(.po-new) { filter: brightness(.82) saturate(.85); }
.po-grid.done .po-cell.r-SR, .po-grid.done .po-cell.r-UR { z-index: 2; transform: scale(1.08); }
.po-grid.done .po-cell.r-SR .po-gface { animation: srPulse 1.6s ease-in-out infinite; }
.po-grid.done .po-cell.r-UR .po-gface { animation: urPulse 1.2s linear infinite; }
@keyframes srPulse { 50% { box-shadow: 0 0 0 3px #ffe39a, 0 0 30px rgba(255, 211, 107, 1); } }
@keyframes urPulse { 0%, 100% { box-shadow: 0 0 0 3px #ff8ad8, 0 0 30px #ff8ad8; } 33% { box-shadow: 0 0 0 3px #8fe3ff, 0 0 30px #8fe3ff; } 66% { box-shadow: 0 0 0 3px #ffe39a, 0 0 30px #ffe39a; } }

/* 仮表示の話し手が話していないときは、暗くせず薄くする（明るい背景で灰色に濁らないように） */
.st-char.nofile:not(.active) { filter: opacity(.55) saturate(.8); }

/* ---------- 統合の修正 ---------- */
/* ボタンの中身（span・small・i など）は押下の対象にしない。中身を書き直してもクリックが消えないように */
button * { pointer-events: none; }
/* トーストは左下（リリカの立ち絵の上）に出す。中央ペインの主要ボタンを隠さない */
#toasts { left: 14px; right: auto; bottom: 22px; width: 380px; transform: none; align-items: stretch; }
#toasts .toast { min-width: 0; max-width: none; font-size: 14px; padding: 10px 14px; }
/* まとめて開封の結果 */
.po-bulk { display: flex; flex-direction: column; align-items: center; gap: 30px; max-height: 760px; }
.po-bulk .po-grid { cursor: default; }
.po-bulk-rest { font-family: var(--f-head); font-size: 16px; color: var(--sub); padding: 6px 18px; border-radius: 14px; background: rgba(8, 12, 32, .6); }
.po-bulk-rest b { color: var(--ink); font-family: var(--f-num); }
.po-bulk-none { font-family: var(--f-head); font-size: 22px; color: var(--sub); padding: 40px; }
.po-cnt { position: absolute; right: -8px; bottom: -8px; z-index: 12; font: 700 18px var(--f-num); color: #2a1a05; padding: 0 9px; border-radius: 10px; background: linear-gradient(180deg, #fff2c4, #d8b45a); box-shadow: 0 2px 8px rgba(0, 0, 0, .6), 0 0 0 1.5px #3a2a0a; }
.po-cnt small { font-size: 12px; margin-right: 1px; }
