/* 残響のローグ — 「夜の楽譜」: indigo night, gold-leaf rules, teal luminescence.
   layout: one tall phone screen; a background layer, an fx canvas, then top bar / view / tabs; battle, modals and transitions stack above. */
:root {
  color-scheme: dark;
  --ink: #090b18;
  --ink-2: #11142d;
  --ink-3: #1a1e44;
  --glass: rgba(20, 24, 56, .78);
  --line: rgba(242, 195, 91, .26);
  --line-2: rgba(140, 150, 230, .2);
  --paper: #efeaf8;
  --mute: #a9a5c8;
  --dim: #6f6c93;
  --teal: #4fe3d0;
  --teal-d: #1a9f8f;
  --gold: #f2c35b;
  --gold-l: #ffe9a8;
  --gold-d: #a8701c;
  --red: #ff5d7a;
  --p-beat: #ff9b4a; --p-str: #b57bff; --p-brass: #f2c35b; --p-key: #5fa8ff; --p-voice: #f5f2ff;
  --r-ur: #ff6fd8; --r-ssr: #ffd36b; --r-sr: #c79bff; --r-r: #7fb6ff;
  --display: "Shippori Mincho B1", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --body: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  --latin: "Cinzel", "Shippori Mincho B1", serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --corner: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18'%3E%3Cpath d='M1 17V7C1 3.7 3.7 1 7 1h10' fill='none' stroke='%23f2c35b' stroke-width='1.2'/%3E%3Ccircle cx='5' cy='5' r='1.6' fill='%23f2c35b'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: #04050b; }
body { color: var(--paper); font-family: var(--body); font-size: 14px; line-height: 1.55; text-wrap: pretty; line-break: strict; overflow: hidden; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
img { -webkit-user-drag: none; max-width: 100%; }
a { color: var(--teal); }
input { font: inherit; user-select: text; -webkit-user-select: text; }
[hidden] { display: none !important; }

#app { height: 100%; display: flex; justify-content: center; align-items: center; background: radial-gradient(ellipse at 50% 0%, #161a3c, #04050b 70%); }
#screen { position: relative; width: 100%; max-width: 460px; height: 100%; max-height: 960px; overflow: hidden; background: var(--ink); display: flex; flex-direction: column; box-shadow: 0 0 0 1px rgba(242,195,91,.12), 0 30px 80px rgba(0,0,0,.7); isolation: isolate; }
@media (min-width: 461px) { #screen { border-radius: 18px; height: calc(100% - 24px); } }

/* background layer behind every menu */
#bgl { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
#bgl img { position: absolute; inset: -4%; width: 108%; height: 108%; object-fit: cover; opacity: 0; transition: opacity .9s var(--ease); filter: saturate(.75) brightness(.42) blur(1px); animation: drift 26s ease-in-out infinite alternate; }
#bgl img.on { opacity: 1; }
#bgl::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 20%, transparent 30%, rgba(9,11,24,.75) 85%), linear-gradient(180deg, rgba(9,11,24,.2), rgba(9,11,24,.85)); }
@keyframes drift { from { transform: scale(1) translate(0, 0); } to { transform: scale(1.04) translate(-1.5%, 1%); } }
#fxc { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 76; pointer-events: none; }

/* ---------- typography helpers ---------- */
.fit { display: block; white-space: nowrap; overflow: hidden; text-overflow: clip; min-width: 0; }
.nw { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.goldt { background: linear-gradient(180deg, #fff6d6 0%, #ffd77a 45%, #c88a24 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.h { font-family: var(--display); font-weight: 700; font-size: 19px; margin: 0; letter-spacing: .08em; white-space: nowrap; display: flex; align-items: center; gap: 10px; }
.h::before, .h::after { content: ""; height: 1px; flex: 1; background: linear-gradient(90deg, transparent, var(--line)); }
.h::after { background: linear-gradient(90deg, var(--line), transparent); }
.h.left::before { display: none; }
.sub { color: var(--mute); font-size: 12px; }
.tiny { font-size: 11px; color: var(--dim); }
.sp { flex: 1; }

/* ---------- top bar ---------- */
#topbar { position: relative; z-index: 6; display: flex; align-items: center; gap: 6px; padding-block: calc(8px + env(safe-area-inset-top, 0px)) 8px; padding-left: max(10px, env(safe-area-inset-left, 0px)); padding-right: max(10px, env(safe-area-inset-right, 0px)); background: linear-gradient(180deg, rgba(9,11,24,.95), rgba(9,11,24,.55)); }
#topbar::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--line), transparent); }
.res { position: relative; display: flex; align-items: center; gap: 5px; height: 28px; padding: 0 9px 0 3px; border-radius: 999px; background: linear-gradient(180deg, rgba(26,30,68,.95), rgba(13,15,36,.95)); border: 1px solid var(--line-2); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 0; }
.res svg { width: 22px; height: 22px; flex: none; }
.res small { color: var(--mute); font-size: 10px; font-weight: 500; }
.res .plus { margin-left: 3px; width: 17px; height: 17px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(180deg, #ff8ba2, #e2405f); color: #fff; font-size: 13px; line-height: 1; font-weight: 900; box-shadow: 0 0 8px rgba(255,93,122,.6); }
.ibtn { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; background: linear-gradient(180deg, rgba(26,30,68,.95), rgba(13,15,36,.95)); border: 1px solid var(--line-2); }
.ibtn svg { width: 17px; height: 17px; }

/* ---------- view ---------- */
#view { position: relative; z-index: 2; flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; scrollbar-width: none; }
#view::-webkit-scrollbar { display: none; }
.pad { padding-block: 12px 28px; padding-left: max(14px, env(safe-area-inset-left, 0px)); padding-right: max(14px, env(safe-area-inset-right, 0px)); display: grid; gap: 14px; }
.vin > * { animation: rise .55s var(--ease) backwards; }
.vin > *:nth-child(2) { animation-delay: .05s; } .vin > *:nth-child(3) { animation-delay: .1s; } .vin > *:nth-child(4) { animation-delay: .15s; } .vin > *:nth-child(5) { animation-delay: .2s; } .vin > *:nth-child(n+6) { animation-delay: .25s; }
.vin.from-l > * { animation-name: slideL; } .vin.from-r > * { animation-name: slideR; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes slideL { from { opacity: 0; transform: translateX(-26px); } }
@keyframes slideR { from { opacity: 0; transform: translateX(26px); } }

/* ---------- bottom tabs ---------- */
#tabs { position: relative; z-index: 6; display: grid; grid-template-columns: repeat(5, 1fr); padding-bottom: env(safe-area-inset-bottom, 0px); padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); background: linear-gradient(180deg, rgba(13,15,36,.92), #070814); }
#tabs::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--line), transparent); }
#tabs button { position: relative; height: 58px; display: grid; justify-items: center; align-content: center; gap: 3px; color: var(--dim); font-size: 10.5px; font-weight: 700; letter-spacing: .06em; white-space: nowrap; transition: color .3s; }
#tabs button svg { width: 24px; height: 24px; transition: transform .35s var(--ease), filter .35s; }
#tabs button.on { color: var(--gold); }
#tabs button.on svg { transform: translateY(-2px) scale(1.08); filter: drop-shadow(0 0 6px rgba(242,195,91,.8)); }
#tabs button.on::before { content: ""; position: absolute; top: -1px; left: 26%; right: 26%; height: 2px; background: linear-gradient(90deg, transparent, var(--gold), transparent); box-shadow: 0 0 12px var(--gold); }
#tabs button.on::after { content: ""; position: absolute; inset: 6px 12% 4px; border-radius: 12px; background: radial-gradient(ellipse at 50% 20%, rgba(242,195,91,.14), transparent 70%); }
.dot { position: absolute; top: 7px; right: calc(50% - 19px); width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px #0b0d1a, 0 0 8px var(--red); animation: dotp 1.6s ease-in-out infinite; }
@keyframes dotp { 50% { transform: scale(1.25); } }

/* ---------- panes (ornamented frames) ---------- */
.pane { position: relative; padding: 14px; border-radius: 12px; background: linear-gradient(180deg, rgba(30,35,80,.82), rgba(13,15,36,.9)); border: 1px solid var(--line); box-shadow: inset 0 1px 0 rgba(255,255,255,.05), inset 0 0 0 4px rgba(9,11,24,.45), inset 0 0 0 5px rgba(242,195,91,.08), 0 10px 26px rgba(0,0,0,.35); }
.pane::before, .pane::after { content: ""; position: absolute; width: 18px; height: 18px; background: var(--corner) no-repeat; opacity: .85; pointer-events: none; }
.pane::before { top: 3px; left: 3px; }
.pane::after { bottom: 3px; right: 3px; transform: rotate(180deg); }
.pane.plain::before, .pane.plain::after { display: none; }
.row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row > .grow { flex: 1; min-width: 0; }
.stack { display: grid; gap: 6px; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.sep { height: 1px; background: linear-gradient(90deg, transparent, var(--line), transparent); border: 0; margin: 2px 0; }

/* ---------- buttons ---------- */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 8px 14px; border-radius: 10px; font-weight: 700; font-size: 14px; letter-spacing: .04em; white-space: nowrap; overflow: hidden; color: var(--paper); background: linear-gradient(180deg, rgba(42,48,100,.95), rgba(20,24,56,.95)); border: 1px solid var(--line-2); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 4px 12px rgba(0,0,0,.3); transition: transform .12s, filter .2s, box-shadow .2s; }
.btn:active:not(:disabled) { transform: scale(.96); }
.btn small { font-weight: 500; font-size: 11px; opacity: .85; }
.btn.col { flex-direction: column; gap: 0; line-height: 1.25; }
.btn.gold { color: #2b1a00; background: linear-gradient(180deg, #fff3c9 0%, #ffd77a 38%, #e1a33a 70%, #b77a1e 100%); border-color: #fff0bd; box-shadow: inset 0 1px 0 rgba(255,255,255,.8), inset 0 -2px 0 rgba(120,70,0,.35), 0 0 0 1px rgba(0,0,0,.35), 0 6px 20px rgba(242,195,91,.3); text-shadow: 0 1px 0 rgba(255,255,255,.5); }
.btn.teal { color: #032420; background: linear-gradient(180deg, #b6fff4 0%, #5ff0dd 40%, #1fb3a2 100%); border-color: #c8fff7; box-shadow: inset 0 1px 0 rgba(255,255,255,.8), inset 0 -2px 0 rgba(0,70,60,.3), 0 0 0 1px rgba(0,0,0,.35), 0 6px 20px rgba(79,227,208,.3); }
.btn.red { color: #fff; background: linear-gradient(180deg, #ffa0b2 0%, #ff6a86 40%, #d9304f 100%); border-color: #ffc4cf; box-shadow: inset 0 1px 0 rgba(255,255,255,.6), inset 0 -2px 0 rgba(90,0,20,.3), 0 0 0 1px rgba(0,0,0,.35), 0 6px 18px rgba(255,93,122,.35); text-shadow: 0 1px 1px rgba(120,0,30,.5); }
.btn.gold::after, .btn.teal::after, .btn.red::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.55) 48%, transparent 60%); background-size: 260% 100%; animation: sheen 3.6s ease-in-out infinite; pointer-events: none; }
@keyframes sheen { 0%, 55% { background-position: 160% 0; } 100% { background-position: -60% 0; } }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--mute); }
.btn:disabled { filter: grayscale(.8) brightness(.6); cursor: default; }
.btn:disabled::after { display: none; }
.btn.big { width: 100%; min-height: 54px; font-size: 18px; border-radius: 13px; font-family: var(--display); font-weight: 800; letter-spacing: .14em; }
.btn.big small { font-family: var(--body); letter-spacing: .02em; }
.btn.pulse { animation: cta 2.2s ease-in-out infinite; }
@keyframes cta { 50% { box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 0 0 1px rgba(0,0,0,.35), 0 0 30px rgba(242,195,91,.65); } }

/* ---------- tags / bars ---------- */
.tag { display: inline-flex; align-items: center; height: 19px; padding: 0 8px; border-radius: 5px; font-size: 10.5px; font-weight: 900; letter-spacing: .06em; white-space: nowrap; color: #fff; background: linear-gradient(180deg, #ff8aa0, #e2405f); }
.tag.teal { background: linear-gradient(180deg, #8ff7ea, #22b9a6); color: #032420; }
.tag.gold { background: linear-gradient(180deg, #ffe9a8, #e2a332); color: #2b1a00; }
.tag.line { background: rgba(9,11,24,.6); border: 1px solid var(--line); color: var(--gold); }
.strike { text-decoration: line-through; text-decoration-color: rgba(255,93,122,.8); color: var(--mute); font-size: 12px; }
.bar { position: relative; height: 8px; border-radius: 99px; background: rgba(4,5,11,.8); border: 1px solid var(--line-2); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--teal-d), var(--teal), var(--gold)); box-shadow: 0 0 10px rgba(79,227,208,.6); transition: width .6s var(--ease); }

/* ---------- part chips ---------- */
.part { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px; border-radius: 99px; font-size: 11px; font-weight: 700; border: 1px solid currentColor; white-space: nowrap; background: rgba(9,11,24,.5); }
.p-beat { color: var(--p-beat); } .p-str { color: var(--p-str); } .p-brass { color: var(--p-brass); } .p-key { color: var(--p-key); } .p-voice { color: var(--p-voice); }

/* ---------- home ---------- */
.stage-card { position: relative; height: 360px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 16px 40px rgba(0,0,0,.5), inset 0 0 0 1px rgba(255,255,255,.04); }
.stage-card > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 22%; animation: breathe 9s ease-in-out infinite alternate; }
@keyframes breathe { from { transform: scale(1.02); } to { transform: scale(1.08) translateY(-1%); } }
.stage-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(9,11,24,0) 35%, rgba(9,11,24,.6) 62%, rgba(9,11,24,.96)); pointer-events: none; }
.stage-card .frame { position: absolute; inset: 7px; border: 1px solid rgba(242,195,91,.35); border-radius: 11px; pointer-events: none; z-index: 2; }
.stage-card .frame::before, .stage-card .frame::after { content: ""; position: absolute; width: 18px; height: 18px; background: var(--corner) no-repeat; }
.stage-card .frame::before { top: -1px; left: -1px; } .stage-card .frame::after { bottom: -1px; right: -1px; transform: rotate(180deg); }
.stage-card .in { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; padding: 14px 16px 16px; display: grid; gap: 10px; }
.stagepick { display: grid; grid-template-columns: 36px 1fr 36px; align-items: center; gap: 8px; }
.stagepick .nm { text-align: center; min-width: 0; display: grid; gap: 1px; }
.stagepick .ch { font-size: 11px; color: var(--gold); letter-spacing: .3em; white-space: nowrap; }
.stagepick .st { font-family: var(--display); font-weight: 800; font-size: 23px; letter-spacing: .1em; text-shadow: 0 2px 10px rgba(0,0,0,.8); }
.arrow { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgba(9,11,24,.7); border: 1px solid var(--line); font-size: 18px; color: var(--gold); }
.arrow:disabled { opacity: .3; }
.power { display: inline-flex; align-items: baseline; gap: 6px; justify-content: center; white-space: nowrap; font-size: 11px; color: var(--mute); letter-spacing: .1em; }
.power b { font-family: var(--latin); font-size: 16px; color: var(--teal); letter-spacing: .04em; text-shadow: 0 0 10px rgba(79,227,208,.5); }
.side { position: absolute; top: 12px; right: 12px; z-index: 4; display: grid; gap: 8px; }
.side button { position: relative; width: 50px; height: 54px; border-radius: 12px; display: grid; justify-items: center; align-content: center; gap: 2px; background: rgba(9,11,24,.72); border: 1px solid var(--line); font-size: 10px; font-weight: 700; letter-spacing: .04em; white-space: nowrap; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.side button svg { width: 22px; height: 22px; }
.side .dot { top: -3px; right: -3px; }
.echo-float { position: absolute; left: 10px; top: 10px; z-index: 4; width: 64px; height: 64px; border-radius: 50%; overflow: hidden; border: 1px solid rgba(79,227,208,.6); box-shadow: 0 0 18px rgba(79,227,208,.5); animation: floaty 4s ease-in-out infinite; background: #0b0d1a; }
.echo-float img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; transform: scale(1.5); transform-origin: 50% 20%; }
@keyframes floaty { 50% { transform: translateY(-6px); } }
.chest { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; }
.chest .box { position: relative; width: 56px; height: 56px; border-radius: 12px; display: grid; place-items: center; background: radial-gradient(circle at 50% 35%, #fff1c4, #c98e1f 60%, #6b4210); box-shadow: 0 0 18px rgba(242,195,91,.35), inset 0 -4px 0 rgba(0,0,0,.25); }
.chest .box svg { width: 34px; height: 34px; }
.chest.full .box { animation: glow 1.4s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 34px rgba(242,195,91,.9); transform: scale(1.05) rotate(-3deg); } }
.chest .t { font-weight: 700; white-space: nowrap; }
.chest .stack { min-width: 0; }

/* offers */
.offer { position: relative; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 14px; border-radius: 14px; overflow: hidden; width: 100%; text-align: left; background: linear-gradient(115deg, #3a1a4f 0%, #1c1a48 55%, #12294a 100%); border: 1px solid rgba(255,140,180,.4); box-shadow: 0 10px 30px rgba(60,10,60,.45); }
.offer::before { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.1) 45%, transparent 60%); background-size: 250% 100%; animation: sheen 4s linear infinite; pointer-events: none; }
.offer .l { display: grid; gap: 3px; min-width: 0; position: relative; z-index: 1; }
.offer .t { font-family: var(--display); font-weight: 800; font-size: 17px; letter-spacing: .06em; }
.offer .timer { color: var(--gold); font-size: 11.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.offer .pr { position: relative; z-index: 1; display: grid; justify-items: center; gap: 3px; }
.ribbon { position: absolute; top: 10px; right: -32px; z-index: 2; transform: rotate(35deg); width: 120px; text-align: center; background: linear-gradient(180deg, #ff8aa0, #d9304f); color: #fff; font-weight: 900; font-size: 11px; padding: 3px 0; letter-spacing: .06em; box-shadow: 0 2px 8px rgba(0,0,0,.45); white-space: nowrap; }

/* ---------- 強化 ---------- */
.upg { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; }
.upg .ic { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; background: radial-gradient(circle at 40% 30%, rgba(79,227,208,.35), rgba(9,11,24,.9)); border: 1px solid var(--line-2); }
.upg .ic svg { width: 26px; height: 26px; }
.upg .lv { font-family: var(--latin); color: var(--teal); font-size: 15px; white-space: nowrap; }
.upg .nm { font-weight: 700; white-space: nowrap; }
.upg .btn { min-width: 104px; }
.statline { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.statline div { padding: 8px 4px; border-radius: 10px; background: rgba(9,11,24,.55); border: 1px solid var(--line-2); display: grid; gap: 1px; min-width: 0; }
.statline b { font-family: var(--latin); font-size: 16px; color: var(--paper); white-space: nowrap; }
.statline small { font-size: 10.5px; color: var(--mute); white-space: nowrap; }

/* ---------- 奏者 ---------- */
.ally { position: relative; border-radius: 12px; overflow: hidden; background: #0b0d1a; border: 1px solid var(--line-2); aspect-ratio: 2 / 3; width: 100%; box-shadow: 0 6px 16px rgba(0,0,0,.4); transition: transform .2s var(--ease); }
.ally:active { transform: scale(.97); }
.ally img { width: 100%; height: 100%; object-fit: cover; object-position: center 10%; display: block; }
.ally .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 6px 6px; background: linear-gradient(180deg, transparent, rgba(5,6,13,.95) 60%); display: grid; gap: 1px; text-align: center; }
.ally .cap b { font-family: var(--display); font-size: 14px; font-weight: 800; letter-spacing: .06em; }
.ally .stars { color: var(--gold); font-size: 10px; letter-spacing: -1px; white-space: nowrap; }
.ally .rar { position: absolute; top: 5px; left: 5px; font-family: var(--latin); font-size: 10.5px; font-weight: 700; padding: 0 6px; height: 17px; display: grid; place-items: center; border-radius: 4px; background: rgba(5,6,13,.85); letter-spacing: .06em; }
.ally .lvb { position: absolute; top: 5px; right: 5px; font-size: 10px; font-weight: 900; padding: 0 5px; height: 17px; display: grid; place-items: center; border-radius: 4px; background: rgba(5,6,13,.85); color: var(--teal); }
.ally.ur { border-color: var(--r-ur); box-shadow: 0 0 18px rgba(255,111,216,.4); }
.ally.ur::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.25) 45%, transparent 60%); background-size: 260% 100%; animation: sheen 3s linear infinite; pointer-events: none; }
.ally.ssr { border-color: var(--r-ssr); box-shadow: 0 0 14px rgba(255,211,107,.3); }
.ally.sr { border-color: var(--r-sr); }
.ally.ur .rar { color: var(--r-ur); } .ally.ssr .rar { color: var(--r-ssr); } .ally.sr .rar { color: var(--r-sr); }
.ally.locked img { filter: grayscale(1) brightness(.25); }
.ally.locked .cap b { color: var(--dim); }
.ally .eq { position: absolute; top: 26px; right: 5px; }
.party { display: grid; grid-template-columns: 132px 1fr; gap: 14px; align-items: stretch; }
.party .ally { aspect-ratio: auto; height: 198px; }
.party .info { display: grid; gap: 6px; align-content: start; min-width: 0; }
.party .info .nm { font-family: var(--display); font-weight: 800; font-size: 24px; letter-spacing: .08em; white-space: nowrap; }
.skillbox { padding: 8px 10px; border-radius: 10px; background: rgba(9,11,24,.55); border: 1px solid var(--line-2); display: grid; gap: 2px; }
.skillbox b { color: var(--gold); font-size: 12.5px; white-space: nowrap; }
.skillbox span { font-size: 11.5px; color: var(--mute); line-height: 1.5; }

/* ---------- 共鳴 ---------- */
.bnr-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bnr-tabs button { position: relative; height: 44px; border-radius: 10px; font-weight: 800; font-size: 13px; letter-spacing: .06em; white-space: nowrap; background: rgba(9,11,24,.6); border: 1px solid var(--line-2); color: var(--mute); }
.bnr-tabs button.on { color: #2b1a00; background: linear-gradient(180deg, #fff3c9, #e1a33a); border-color: #fff0bd; }
.bnr-tabs button.ur.on { color: #fff; background: linear-gradient(180deg, #ff9be6, #9b3cff); border-color: #ffc8f2; }
.gbanner { position: relative; height: 370px; border-radius: 16px; overflow: hidden; border: 1px solid var(--r-ssr); background: radial-gradient(ellipse at 65% 30%, #3a2d63, #0b0d1a 70%); box-shadow: 0 16px 40px rgba(0,0,0,.5); }
.gbanner.ur { border-color: var(--r-ur); background: radial-gradient(ellipse at 65% 30%, #4a1f55, #08060f 72%); }
.gbanner > img { position: absolute; right: -36px; bottom: -10px; height: 108%; width: auto; max-width: none; animation: floaty 6s ease-in-out infinite; }
.gbanner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(9,11,24,.92) 0%, rgba(9,11,24,.5) 45%, transparent 70%); pointer-events: none; }
.gbanner .in { position: absolute; left: 16px; top: 16px; bottom: 16px; width: 56%; display: flex; flex-direction: column; gap: 6px; z-index: 2; }
.gbanner .t { font-family: var(--display); font-weight: 800; font-size: 28px; line-height: 1.2; letter-spacing: .06em; text-shadow: 0 2px 14px #000; }
.gbanner .t small { display: block; font-size: 13px; font-weight: 600; color: var(--gold); letter-spacing: .2em; margin-top: 4px; }
.gbanner .rates { font-size: 11.5px; color: var(--paper); text-shadow: 0 1px 4px #000; }
.gbanner .pity { margin-top: auto; background: rgba(5,6,13,.82); border: 1px solid var(--line); border-radius: 12px; padding: 9px 11px; display: grid; gap: 5px; }
.gbanner .pity .row b { font-family: var(--latin); color: var(--gold); font-size: 24px; line-height: 1; }
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.steps span { text-align: center; font-size: 10.5px; padding: 7px 0; border-radius: 9px; background: rgba(9,11,24,.6); border: 1px solid var(--line-2); color: var(--mute); line-height: 1.35; white-space: nowrap; }
.steps span b { display: block; font-family: var(--latin); font-size: 13px; color: var(--paper); }
.steps span.now { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 12px rgba(242,195,91,.35); }
.steps span.done { opacity: .35; }

/* ---------- shop ---------- */
.subtabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.subtabs button { position: relative; height: 36px; border-radius: 99px; background: rgba(9,11,24,.6); border: 1px solid var(--line-2); font-size: 12.5px; font-weight: 800; white-space: nowrap; color: var(--mute); }
.subtabs button.on { background: linear-gradient(180deg, #b6fff4, #22b9a6); color: #032420; border-color: transparent; }
.subtabs .dot { top: -2px; right: 2px; }
.item { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; padding: 14px; border-radius: 13px; width: 100%; text-align: left; background: linear-gradient(180deg, rgba(30,35,80,.85), rgba(13,15,36,.92)); border: 1px solid var(--line-2); overflow: hidden; box-shadow: 0 6px 16px rgba(0,0,0,.3); }
.item.hot { border-color: rgba(242,195,91,.55); background: linear-gradient(120deg, #2f2010, #171a3e 62%); }
.item .l { display: grid; gap: 3px; min-width: 0; }
.item .nm { font-weight: 800; font-size: 14.5px; display: flex; align-items: center; gap: 6px; min-width: 0; }
.item .nm .fit { flex: 0 1 auto; }
.item .ds { color: var(--mute); font-size: 11.5px; line-height: 1.55; }
.item .val { color: var(--gold); font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.item:disabled { opacity: .5; }
.price { display: grid; justify-items: end; gap: 3px; }
.price .btn { min-width: 92px; min-height: 40px; }
.gemgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.gemc { position: relative; padding: 14px 10px 12px; border-radius: 13px; background: linear-gradient(180deg, rgba(30,35,80,.85), rgba(13,15,36,.92)); border: 1px solid var(--line-2); text-align: center; display: grid; gap: 6px; justify-items: center; overflow: hidden; width: 100%; }
.gemc .gico { width: 46px; height: 46px; filter: drop-shadow(0 0 10px rgba(79,227,208,.6)); }
.gemc .q { font-family: var(--latin); font-size: 22px; color: var(--teal); line-height: 1; white-space: nowrap; }
.gemc .bonus { font-size: 11px; color: var(--gold); font-weight: 700; min-height: 16px; white-space: nowrap; }
.gemc .btn { width: 100%; min-height: 38px; }
.gemc.rec { border-color: var(--gold); box-shadow: 0 0 20px rgba(242,195,91,.25); }
.rank { display: grid; gap: 7px; }
.rank .lv { font-family: var(--display); font-weight: 800; font-size: 17px; letter-spacing: .08em; white-space: nowrap; }
.legal { text-align: center; line-height: 2; font-size: 11.5px; color: var(--dim); }
.legal a { color: var(--mute); }

/* ---------- modal ---------- */
#modal { position: absolute; inset: 0; z-index: 40; display: grid; place-items: center; padding-block: calc(16px + env(safe-area-inset-top, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)); padding-left: max(14px, env(safe-area-inset-left, 0px)); padding-right: max(14px, env(safe-area-inset-right, 0px)); background: radial-gradient(ellipse at 50% 40%, rgba(20,22,52,.55), rgba(2,3,8,.85)); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); animation: fadein .25s ease-out; }
@keyframes fadein { from { opacity: 0; } }
.mbox { position: relative; width: 100%; max-height: 100%; display: flex; flex-direction: column; border-radius: 16px; background: linear-gradient(180deg, #1c2050, #0e1128 70%); border: 1px solid var(--line); box-shadow: inset 0 0 0 4px rgba(9,11,24,.5), inset 0 0 0 5px rgba(242,195,91,.1), 0 24px 70px rgba(0,0,0,.7); animation: pop .4s var(--ease); overflow: hidden; }
.mbox::before, .mbox::after { content: ""; position: absolute; width: 18px; height: 18px; background: var(--corner) no-repeat; z-index: 3; pointer-events: none; }
.mbox::before { top: 4px; left: 4px; } .mbox::after { bottom: 4px; right: 4px; transform: rotate(180deg); }
@keyframes pop { from { transform: scale(.9) translateY(10px); opacity: 0; } }
.mbody { overflow-y: auto; padding: 22px 16px 14px; display: grid; gap: 12px; min-height: 0; scrollbar-width: thin; }
.mbody > * { animation: rise .45s var(--ease) backwards; }
.mbody > *:nth-child(2) { animation-delay: .04s; } .mbody > *:nth-child(3) { animation-delay: .08s; } .mbody > *:nth-child(4) { animation-delay: .12s; } .mbody > *:nth-child(n+5) { animation-delay: .16s; }
.mfoot { padding: 10px 16px 16px; display: grid; gap: 8px; border-top: 1px solid rgba(242,195,91,.12); background: rgba(9,11,24,.4); }
.mfoot:empty { display: none; }
.mbox .x { position: absolute; top: 9px; right: 9px; z-index: 4; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: rgba(9,11,24,.75); border: 1px solid var(--line-2); font-size: 14px; }
.mt { font-family: var(--display); font-weight: 800; font-size: 22px; text-align: center; letter-spacing: .1em; padding: 0 30px; white-space: nowrap; }
.mt.fit { padding: 0 34px; }
.note { color: var(--mute); font-size: 12px; text-align: center; line-height: 1.7; text-wrap: balance; }
.rew { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.rew span { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 12px; border-radius: 99px; background: linear-gradient(180deg, rgba(42,48,100,.95), rgba(20,24,56,.95)); border: 1px solid var(--line); font-size: 13px; font-weight: 700; white-space: nowrap; animation: pop .4s var(--ease) backwards; }
.rew span:nth-child(2) { animation-delay: .08s; } .rew span:nth-child(3) { animation-delay: .16s; } .rew span:nth-child(n+4) { animation-delay: .24s; }
.cmp { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; text-align: center; }
.cmp b { font-family: var(--latin); font-size: 24px; }
.cmp .to { color: var(--teal); text-shadow: 0 0 12px rgba(79,227,208,.6); }
.cmp i { color: var(--gold); font-style: normal; font-size: 20px; }

/* login bonus */
.login7 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ld { position: relative; border-radius: 11px; padding: 8px 4px; text-align: center; display: grid; gap: 3px; align-content: center; min-height: 82px; background: linear-gradient(180deg, rgba(42,48,100,.9), rgba(20,24,56,.95)); border: 1px solid var(--line-2); }
.ld b { font-family: var(--latin); font-size: 11px; color: var(--gold); letter-spacing: .1em; }
.ld .w { font-size: 11.5px; font-weight: 700; line-height: 1.35; display: grid; padding: 0 4px; }
.ld.got { opacity: .4; }
.ld.got::after { content: "受取済"; position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-weight: 800; color: var(--teal); font-size: 15px; transform: rotate(-12deg); text-shadow: 0 0 8px rgba(0,0,0,.9); }
.ld.today { border-color: var(--gold); box-shadow: 0 0 16px rgba(242,195,91,.45); animation: glow 1.8s ease-in-out infinite; }
.ld.d7 { grid-column: 1 / -1; grid-template-columns: 84px 1fr; text-align: left; padding: 0; overflow: hidden; border-color: var(--r-ssr); min-height: 0; }
.ld.d7 img { width: 84px; height: 106px; object-fit: cover; object-position: center 8%; }
.ld.d7 .t { padding: 10px; display: grid; gap: 3px; }
.ld.d7 .t strong { font-family: var(--display); font-size: 18px; letter-spacing: .06em; white-space: nowrap; }
.flame { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 12px; color: var(--gold); white-space: nowrap; }
.flame b { font-family: var(--latin); font-size: 26px; text-shadow: 0 0 14px rgba(255,155,74,.8); }
.flame svg { width: 22px; height: 22px; }

.mission { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; padding: 11px 12px; border-radius: 11px; background: rgba(9,11,24,.55); border: 1px solid var(--line-2); }
.mission.done { border-color: rgba(79,227,208,.6); }
.mission b { white-space: nowrap; }
.mission .btn { min-width: 96px; min-height: 36px; font-size: 12.5px; }
.codex { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.cx { padding: 10px; border-radius: 10px; background: rgba(9,11,24,.55); border: 1px solid var(--line-2); font-size: 11.5px; color: var(--mute); line-height: 1.5; min-width: 0; }
.cx b { display: block; font-family: var(--display); font-weight: 800; font-size: 14px; color: var(--paper); white-space: nowrap; }
.cx.no b { color: var(--dim); }
.tw { overflow-x: auto; }
.odds { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.odds td, .odds th { padding: 7px 8px; border-bottom: 1px solid var(--line-2); text-align: left; white-space: nowrap; }
.odds th { color: var(--mute); font-weight: 600; }
.field-in { width: 100%; height: 40px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line-2); background: rgba(4,5,11,.8); color: var(--paper); font-size: 12px; }

/* ---------- battle ---------- */
#battle { position: absolute; inset: 0; z-index: 20; background: #05060c; overflow: hidden; }
#battle .bg { position: absolute; inset: -3%; width: 106%; height: 106%; object-fit: cover; filter: saturate(.2) brightness(.55) contrast(1.05); transition: filter 1.6s; animation: drift 30s ease-in-out infinite alternate; }
#battle.full .bg { filter: saturate(1.25) brightness(.85); }
#battle .vig { position: absolute; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(ellipse at 50% 55%, transparent 40%, rgba(0,0,0,.65)); }
#battle.full .vig { background: radial-gradient(ellipse at 50% 55%, transparent 45%, rgba(40,0,60,.4)); }
#battle .aurora { position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity 1.6s; background: linear-gradient(120deg, rgba(255,155,74,.12), rgba(181,123,255,.14), rgba(95,168,255,.12), rgba(79,227,208,.14)); background-size: 300% 300%; animation: aur 8s ease-in-out infinite; mix-blend-mode: screen; }
#battle.full .aurora { opacity: 1; }
@keyframes aur { 50% { background-position: 100% 100%; } }
#battle .hud { position: absolute; top: 0; left: 0; right: 0; z-index: 6; padding-top: calc(10px + env(safe-area-inset-top, 0px)); padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); display: grid; gap: 8px; background: linear-gradient(180deg, rgba(5,6,12,.85), transparent); padding-bottom: 14px; }
.wave { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wave .stn { font-family: var(--display); font-weight: 800; font-size: 16px; letter-spacing: .08em; white-space: nowrap; }
.wave .mv { margin-left: auto; font-family: var(--display); font-size: 12.5px; font-weight: 700; color: var(--gold); white-space: nowrap; padding: 2px 10px; border: 1px solid var(--line); border-radius: 99px; background: rgba(5,6,12,.7); }
.parts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.pm { position: relative; height: 40px; border-radius: 9px; display: grid; justify-items: center; align-content: center; gap: 3px; background: rgba(5,6,12,.72); border: 1px solid rgba(255,255,255,.08); font-family: var(--display); font-size: 13px; font-weight: 800; transition: all .45s var(--ease); }
.pm .pips { display: flex; gap: 4px; }
.pm .pips i { width: 6px; height: 6px; border-radius: 50%; background: #262a4d; transition: background .3s, box-shadow .3s; }
.pm.l1, .pm.l2, .pm.l3 { border-color: currentColor; box-shadow: 0 0 12px -3px currentColor, inset 0 0 12px -6px currentColor; }
.pm.l1 .pips i:nth-child(-n+1), .pm.l2 .pips i:nth-child(-n+2), .pm.l3 .pips i { background: currentColor; box-shadow: 0 0 6px currentColor; }
.pm.l3 { background: radial-gradient(circle at 50% 30%, rgba(255,255,255,.14), rgba(5,6,12,.72)); }
.pm.pop { animation: pmpop .6s var(--ease); }
@keyframes pmpop { 30% { transform: scale(1.18); filter: brightness(1.8); } }
.allybar { display: grid; grid-template-columns: 34px 1fr; gap: 8px; align-items: center; }
.allybar img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; object-position: 50% 10%; border: 1px solid var(--gold); }
.allybar .bar > span { background: linear-gradient(90deg, #b77a1e, #ffd77a, #fff3c9); box-shadow: 0 0 10px rgba(242,195,91,.8); }
.allybar.ready .bar { animation: glow 0.9s ease-in-out infinite; }
.field { position: absolute; inset: 0; z-index: 2; }
.hero { position: absolute; left: -6%; bottom: 19%; height: 40%; z-index: 3; pointer-events: none; filter: drop-shadow(0 0 14px rgba(79,227,208,.35)); animation: idle 3s ease-in-out infinite; }
.hero img { height: 100%; width: auto; max-width: none; -webkit-mask-image: radial-gradient(ellipse 46% 54% at 50% 46%, #000 60%, transparent 100%); mask-image: radial-gradient(ellipse 46% 54% at 50% 46%, #000 60%, transparent 100%); }
@keyframes idle { 50% { transform: translateY(-4px); } }
.hero.atk { animation: lunge .18s ease-out; }
@keyframes lunge { 50% { transform: translateX(14px); } }
.hero.hit img { filter: brightness(2) sepia(1) hue-rotate(-50deg) saturate(4); }
.shadow { position: absolute; left: 6%; bottom: 18.5%; width: 30%; height: 3%; border-radius: 50%; background: radial-gradient(ellipse, rgba(0,0,0,.6), transparent 70%); z-index: 2; }
.hpbox { position: absolute; left: max(12px, env(safe-area-inset-left, 0px)); bottom: calc(10% + env(safe-area-inset-bottom, 0px)); width: 52%; z-index: 6; display: grid; gap: 4px; font-size: 11px; }
.hpbox .row b { font-family: var(--display); font-size: 14px; letter-spacing: .08em; }
.hpbar { height: 11px; border-radius: 99px; background: #1a0b12; border: 1px solid rgba(255,93,122,.4); overflow: hidden; position: relative; }
.hpbar span { position: absolute; inset: 0 auto 0 0; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #ff5d7a, #ffb36b); transition: width .15s; }
.hpbar .lag { background: rgba(255,255,255,.5); transition: width .9s .2s ease-out; }
.foe { position: absolute; width: 70px; height: 70px; margin-left: -35px; margin-top: -35px; z-index: 4; pointer-events: none; transition: filter .08s; }
.foe img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(0,0,0,.6)); animation: hover 2.4s ease-in-out infinite; }
@keyframes hover { 50% { transform: translateY(-5px); } }
.foe .fhp { position: absolute; left: 12%; right: 12%; bottom: -6px; height: 4px; border-radius: 2px; background: rgba(0,0,0,.7); overflow: hidden; }
.foe .fhp span { display: block; height: 100%; background: linear-gradient(90deg, #ff5d7a, #ffb36b); }
.foe.frozen img { filter: hue-rotate(160deg) brightness(1.5) drop-shadow(0 0 10px #5fa8ff); }
.foe.hurt { filter: brightness(3) saturate(0); }
.foe.big { width: 120px; height: 120px; margin-left: -60px; margin-top: -70px; }
.foe.boss { width: 210px; height: 290px; margin-left: -105px; margin-top: -170px; }
.foe.boss img { object-fit: cover; -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 45%, #000 55%, transparent 100%); mask-image: radial-gradient(ellipse 50% 50% at 50% 45%, #000 55%, transparent 100%); animation: bossb 4s ease-in-out infinite; }
@keyframes bossb { 50% { transform: translateY(-8px) scale(1.02); } }
.foe.boss .fhp { display: none; }
.foe.dying { transition: opacity .35s, transform .35s; opacity: 0; transform: scale(.4) rotate(10deg); }
.bossbar { display: grid; gap: 3px; animation: rise .5s var(--ease); }
.bossbar .row b { font-family: var(--display); font-size: 13px; letter-spacing: .1em; white-space: nowrap; }
.bossbar .hpbar { height: 12px; border-color: rgba(233,230,245,.35); }
.bossbar .hpbar span { background: linear-gradient(90deg, #a3a0c2, #f5f2ff); }
.dmg { position: absolute; z-index: 8; font-family: var(--latin); font-weight: 700; font-size: 17px; color: #fff; pointer-events: none; animation: dmg .9s var(--ease) forwards; white-space: nowrap; font-variant-numeric: tabular-nums; text-shadow: 0 0 2px #000, 0 2px 0 #000, 0 0 10px rgba(0,0,0,.6); }
.dmg.crit { font-size: 26px; background: linear-gradient(180deg, #fff6d6, #ffc94d 55%, #ff7a2f); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 2px 0 #000) drop-shadow(0 0 6px rgba(255,160,40,.8)); }
.dmg.crit::before { content: "CRITICAL"; position: absolute; top: -12px; left: 50%; transform: translateX(-50%); font-size: 9px; letter-spacing: .2em; color: #ffd36b; -webkit-text-fill-color: #ffd36b; }
.dmg.heal { color: #7dffb0; }
.dmg.big { font-size: 30px; color: #fff; }
@keyframes dmg { 0% { transform: translate(-50%, 0) scale(.5); opacity: 0; } 18% { transform: translate(-50%, -14px) scale(1.25); opacity: 1; } 35% { transform: translate(-50%, -18px) scale(1); } 100% { transform: translate(-50%, -54px) scale(.95); opacity: 0; } }
.combo { position: absolute; right: max(14px, env(safe-area-inset-right, 0px)); top: 34%; z-index: 7; text-align: right; font-family: var(--latin); pointer-events: none; }
.combo b { display: block; font-size: 34px; line-height: 1; background: linear-gradient(180deg, #fff, #4fe3d0); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 2px 0 #000); }
.combo small { font-size: 10px; letter-spacing: .3em; color: var(--teal); }
.combo.bump b { animation: bump .2s ease-out; }
@keyframes bump { 50% { transform: scale(1.25); } }
.fx { position: absolute; z-index: 7; pointer-events: none; border-radius: 50%; }
.fx.slash { width: 90px; height: 90px; margin: -45px 0 0 -45px; border: 3px solid transparent; border-top-color: #e9fffb; filter: drop-shadow(0 0 6px var(--teal)); animation: slash .26s ease-out forwards; }
.fx.slash.c-str { border-top-color: #f0e2ff; filter: drop-shadow(0 0 8px var(--p-str)); }
.fx.slash.c-x { transform: rotate(90deg); }
@keyframes slash { from { transform: rotate(-70deg) scale(.5); opacity: 1; } to { transform: rotate(90deg) scale(1.25); opacity: 0; } }
.fx.boom { width: 160px; height: 160px; margin: -80px 0 0 -80px; background: radial-gradient(circle, rgba(255,250,220,1), rgba(255,190,80,.7) 30%, rgba(242,120,40,.25) 55%, transparent 70%); mix-blend-mode: screen; animation: boom .5s ease-out forwards; }
@keyframes boom { from { transform: scale(.2); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
.fx.wave { width: 40px; height: 40px; margin: -20px 0 0 -20px; border: 3px solid var(--p-beat); box-shadow: 0 0 14px var(--p-beat); animation: ring .55s ease-out forwards; }
@keyframes ring { from { transform: scale(.3); opacity: 1; } to { transform: scale(8); opacity: 0; } }
.fx.pillar { width: 90px; height: 100%; top: 0 !important; margin-left: -45px; border-radius: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent); mix-blend-mode: screen; animation: pillar .8s ease-out forwards; }
@keyframes pillar { from { opacity: 0; transform: scaleX(.2); } 30% { opacity: 1; transform: scaleX(1); } to { opacity: 0; transform: scaleX(1.6); } }
.banner { position: absolute; left: 0; right: 0; top: 36%; z-index: 9; text-align: center; pointer-events: none; font-family: var(--display); font-weight: 800; font-size: 30px; letter-spacing: .16em; white-space: nowrap; animation: banner 1.7s var(--ease) forwards; }
.banner b { background: linear-gradient(180deg, #fff, #ffe39a 60%, #e7a63a); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 2px 0 rgba(0,0,0,.8)) drop-shadow(0 0 14px rgba(242,195,91,.6)); }
.banner small { display: block; font-size: 13px; letter-spacing: .1em; color: var(--teal); margin-top: 4px; font-family: var(--body); font-weight: 700; text-shadow: 0 2px 6px #000; }
.banner::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 64px; transform: translateY(-50%); background: linear-gradient(90deg, transparent, rgba(5,6,12,.75) 20%, rgba(5,6,12,.75) 80%, transparent); z-index: -1; }
@keyframes banner { 0% { opacity: 0; transform: scaleX(1.6); letter-spacing: .5em; } 14% { opacity: 1; transform: scaleX(1); letter-spacing: .16em; } 82% { opacity: 1; } 100% { opacity: 0; transform: translateY(-12px); } }
.rainbow { position: absolute; inset: 0; z-index: 8; pointer-events: none; background: conic-gradient(from 0deg at 50% 55%, #ff9b4a66, #b57bff66, #f2c35b66, #5fa8ff66, #f5f2ff66, #ff9b4a66); mix-blend-mode: screen; animation: rb 1.8s ease-out forwards; }
@keyframes rb { from { opacity: 1; transform: scale(.4) rotate(0deg); } to { opacity: 0; transform: scale(2.2) rotate(120deg); } }
.roar { position: absolute; inset: 0; z-index: 8; pointer-events: none; background: radial-gradient(circle at 74% 50%, rgba(255,255,255,.0), rgba(0,0,0,.75)); animation: roar 1.2s ease-out forwards; }
@keyframes roar { 0% { opacity: 0; backdrop-filter: grayscale(0); } 20% { opacity: 1; } 100% { opacity: 0; } }
.choices { position: absolute; left: 0; right: 0; bottom: 0; z-index: 10; padding-block: 26px calc(16px + env(safe-area-inset-bottom, 0px)); padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); background: linear-gradient(180deg, transparent, rgba(5,6,12,.92) 22%); display: grid; gap: 12px; }
.choices .ttl { text-align: center; font-family: var(--display); font-weight: 800; font-size: 17px; letter-spacing: .18em; white-space: nowrap; }
.choices .ttl small { display: block; font-family: var(--body); font-size: 11px; color: var(--mute); letter-spacing: .04em; font-weight: 500; }
.ccards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cc { position: relative; padding: 0 0 10px; border-radius: 13px; overflow: hidden; background: linear-gradient(180deg, #1d2149, #0c0e24); border: 1px solid currentColor; text-align: center; display: grid; gap: 6px; align-content: start; min-height: 196px; animation: cin .5s var(--ease) backwards; box-shadow: 0 0 18px -6px currentColor, 0 10px 24px rgba(0,0,0,.5); min-width: 0; }
.cc:nth-child(2) { animation-delay: .08s; } .cc:nth-child(3) { animation-delay: .16s; }
@keyframes cin { from { transform: translateY(40px) rotateX(40deg); opacity: 0; } }
.cc .hd { height: 50px; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 120%, currentColor -40%, transparent 70%); border-bottom: 1px solid rgba(255,255,255,.08); }
.cc .glyph { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 1px solid currentColor; font-family: var(--display); font-weight: 800; font-size: 16px; background: rgba(5,6,12,.7); box-shadow: 0 0 12px currentColor; }
.cc .pl { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; white-space: nowrap; }
.cc .sn { color: var(--paper); font-family: var(--display); font-size: 15.5px; font-weight: 800; padding: 0 6px; letter-spacing: .02em; }
.cc .ef { color: var(--mute); font-size: 11px; line-height: 1.5; padding: 0 7px; min-height: 50px; }
.cc .lvn { color: var(--paper); font-size: 11px; font-family: var(--latin); letter-spacing: .06em; white-space: nowrap; }
.cc .lvn i { color: currentColor; font-style: normal; }
.cc.chord { color: #ffe9ff; border-color: transparent; background: linear-gradient(#1d1a46, #0c0e24) padding-box, linear-gradient(135deg, #ff9b4a, #b57bff, #5fa8ff, #4fe3d0, #f2c35b) border-box; border: 1.5px solid transparent; box-shadow: 0 0 26px rgba(181,123,255,.5); }
.cc.chord .hd { background: radial-gradient(ellipse at 50% 120%, rgba(181,123,255,.8), transparent 70%); }
.cc .new { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); z-index: 2; }
.cc.chosen { animation: chosen .45s var(--ease) forwards; }
@keyframes chosen { to { transform: translateY(-90px) scale(.6); opacity: 0; } }
.cc.dropped { animation: dropped .35s ease-in forwards; }
@keyframes dropped { to { transform: translateY(60px); opacity: 0; } }
.rerolls { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rerolls .btn { min-height: 38px; font-size: 12px; }
.bctl { position: absolute; right: max(12px, env(safe-area-inset-right, 0px)); bottom: calc(10% + env(safe-area-inset-bottom, 0px)); z-index: 6; display: grid; gap: 6px; }
.bctl .btn { min-height: 36px; min-width: 64px; font-size: 12.5px; }
.flash { position: absolute; inset: 0; z-index: 81; pointer-events: none; animation: flash .4s ease-out forwards; }
@keyframes flash { from { opacity: var(--op, .85); } to { opacity: 0; } }

/* cut-in */
.cutin { position: absolute; inset: 0; z-index: 12; pointer-events: none; display: grid; align-items: center; }
.cutin .band { position: relative; height: 150px; overflow: hidden; transform: skewY(-8deg); background: linear-gradient(90deg, rgba(5,6,12,.95), rgba(40,30,80,.92) 50%, rgba(5,6,12,.95)); border-block: 2px solid var(--gold); box-shadow: 0 0 40px rgba(242,195,91,.5); animation: band 1.15s var(--ease) forwards; }
.cutin.r-ur .band { border-color: var(--r-ur); box-shadow: 0 0 50px rgba(255,111,216,.6); }
.cutin .band img { position: absolute; right: -10px; top: -60px; width: 70%; height: auto; transform: skewY(8deg); animation: cimg 1.15s var(--ease) forwards; }
.cutin .band::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 2px, transparent 2px 22px); animation: lines .5s linear infinite; }
@keyframes lines { to { background-position: -22px 0; } }
.cutin .cap { position: absolute; left: 16px; top: 50%; transform: translateY(-50%) skewY(8deg); display: grid; gap: 2px; z-index: 2; width: 52%; animation: ccap 1.15s var(--ease) forwards; }
.cutin .cap small { font-size: 11px; color: var(--gold); letter-spacing: .2em; white-space: nowrap; }
.cutin .cap b { font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: .08em; text-shadow: 0 2px 10px #000; }
@keyframes band { 0% { transform: skewY(-8deg) scaleY(0); } 14% { transform: skewY(-8deg) scaleY(1); } 86% { transform: skewY(-8deg) scaleY(1); opacity: 1; } 100% { transform: skewY(-8deg) scaleY(0); opacity: 0; } }
@keyframes cimg { 0% { transform: skewY(8deg) translateX(60%); } 20% { transform: skewY(8deg) translateX(0); } 85% { transform: skewY(8deg) translateX(-6%); } 100% { transform: skewY(8deg) translateX(-30%); opacity: 0; } }
@keyframes ccap { 0% { opacity: 0; transform: translateY(-50%) skewY(8deg) translateX(-40px); } 22% { opacity: 1; transform: translateY(-50%) skewY(8deg) translateX(0); } 85% { opacity: 1; } 100% { opacity: 0; } }

/* title card (stage intro, boss) */
.tcard { position: absolute; inset: 0; z-index: 30; pointer-events: none; display: grid; place-items: center; }
.tcard .lb { position: absolute; left: 0; right: 0; height: 13%; background: #000; animation: lbin .5s var(--ease) both; }
.tcard .lb.t { top: 0; } .tcard .lb.b { bottom: 0; }
.tcard .lb::after { content: ""; position: absolute; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.tcard .lb.t::after { bottom: 0; } .tcard .lb.b::after { top: 0; }
@keyframes lbin { from { transform: scaleY(0); } }
.tcard .tc { text-align: center; display: grid; gap: 4px; animation: tcin .9s var(--ease) both .15s; }
.tcard .tc small { font-family: var(--latin); font-size: 12px; letter-spacing: .5em; color: var(--gold); }
.tcard .tc b { font-family: var(--display); font-weight: 800; font-size: 34px; letter-spacing: .2em; white-space: nowrap; background: linear-gradient(180deg, #fff, #ffe39a 60%, #e7a63a); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 2px 0 #000) drop-shadow(0 0 18px rgba(242,195,91,.6)); }
.tcard .tc em { font-style: normal; font-size: 12px; color: var(--teal); letter-spacing: .3em; }
@keyframes tcin { from { opacity: 0; letter-spacing: .6em; filter: blur(6px); } }
.tcard.out { animation: fadeout .38s forwards; }
@keyframes fadeout { to { opacity: 0; } }

/* ---------- transitions ---------- */
.tr { position: absolute; inset: 0; z-index: 82; pointer-events: all; }
.tr-fade { background: #05060c; animation: fadein .32s both; }
.tr-fade.out { animation: fadeout .4s forwards; }
.tr-ripple { background: radial-gradient(circle at var(--ox, 50%) var(--oy, 60%), #0b1d2a, #05060c 70%); clip-path: circle(0 at var(--ox, 50%) var(--oy, 60%)); animation: ripin .52s var(--ease) forwards; }
.tr-ripple::before, .tr-ripple::after { content: ""; position: absolute; left: var(--ox, 50%); top: var(--oy, 60%); width: 20px; height: 20px; margin: -10px; border-radius: 50%; border: 2px solid var(--teal); box-shadow: 0 0 20px var(--teal); animation: ring .7s ease-out forwards; }
.tr-ripple::after { animation-delay: .14s; border-color: var(--gold); box-shadow: 0 0 20px var(--gold); }
@keyframes ripin { to { clip-path: circle(150% at var(--ox, 50%) var(--oy, 60%)); } }
.tr-ripple.out { animation: ripout .64s var(--ease) forwards; }
@keyframes ripout { from { clip-path: circle(150% at 50% 50%); } to { clip-path: circle(0 at 50% 50%); } }
.tr-staff { display: grid; align-content: center; gap: 12%; background: rgba(5,6,12,0); animation: staffbg .56s forwards; }
@keyframes staffbg { to { background: #05060c; } }
.tr-staff i { height: 3px; background: linear-gradient(90deg, transparent, var(--gold), #fff, var(--gold), transparent); box-shadow: 0 0 14px var(--gold); transform: scaleX(0); animation: staffin .5s var(--ease) forwards; }
.tr-staff i:nth-child(2) { animation-delay: .04s; } .tr-staff i:nth-child(3) { animation-delay: .08s; } .tr-staff i:nth-child(4) { animation-delay: .12s; } .tr-staff i:nth-child(5) { animation-delay: .16s; }
@keyframes staffin { to { transform: scaleX(1); } }
.tr-staff.out { animation: fadeout .62s forwards; }
.tr-staff.out i { animation: staffout .5s var(--ease) forwards; }
@keyframes staffout { from { transform: scaleX(1); } to { transform: scaleX(0); transform-origin: right; } }
.tr-iris { background: #05060c; clip-path: circle(150% at 50% 50%); animation: irisin .52s var(--ease) both; }
@keyframes irisin { from { clip-path: circle(150% at 50% 50%); background: transparent; } to { clip-path: circle(150% at 50% 50%); background: #05060c; } }
.tr-iris.out { animation: irisout .64s var(--ease) forwards; }
@keyframes irisout { from { clip-path: circle(150% at 50% 50%); } to { clip-path: circle(0 at 50% 50%); } }
.tr-burst { background: radial-gradient(circle, #fff, #fff6d6 30%, #ffd77a 60%, rgba(242,195,91,0) 100%); animation: burstin .36s ease-in both; }
@keyframes burstin { from { opacity: 0; transform: scale(.2); } to { opacity: 1; transform: scale(2.4); } }
.tr-burst.out { animation: fadeout .5s forwards; transform: scale(2.4); }
.tr-curtain i { position: absolute; top: 0; bottom: 0; width: 51%; background: repeating-linear-gradient(90deg, #2a0a26 0 12px, #3d1236 12px 24px), #2a0a26; box-shadow: inset 0 0 60px rgba(0,0,0,.8); border-inline: 2px solid var(--gold); }
.tr-curtain i:first-child { left: 0; animation: curl .6s var(--ease) both; }
.tr-curtain i:last-child { right: 0; animation: curr .6s var(--ease) both; }
@keyframes curl { from { transform: translateX(-100%); } } @keyframes curr { from { transform: translateX(100%); } }
.tr-curtain.out i:first-child { animation: curlo .66s var(--ease) forwards; } .tr-curtain.out i:last-child { animation: curro .66s var(--ease) forwards; }
@keyframes curlo { to { transform: translateX(-100%); } } @keyframes curro { to { transform: translateX(100%); } }
.tr-ink { background: #05060c; animation: inkin .7s ease-in both; filter: url(#none); }
@keyframes inkin { from { opacity: 0; backdrop-filter: grayscale(0); } to { opacity: 1; } }
.tr-ink.out { animation: fadeout .8s forwards; }
.tr-shatter { pointer-events: all; }
.tr-shatter i { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 40%, #2a3070, #05060c 80%); box-shadow: inset 0 0 0 1px rgba(255,255,255,.4); animation: shardin .3s ease-out both; }
@keyframes shardin { from { opacity: 0; } }
.tr-shatter .crack { position: absolute; inset: 0; background: linear-gradient(32deg, transparent 49.7%, rgba(255,255,255,.95) 50%, transparent 50.3%), linear-gradient(-48deg, transparent 49.7%, rgba(255,255,255,.95) 50%, transparent 50.3%), linear-gradient(92deg, transparent 49.8%, rgba(255,255,255,.8) 50%, transparent 50.2%); mix-blend-mode: screen; animation: crack .5s ease-out both; }
@keyframes crack { 0% { opacity: 0; transform: scale(.3); } 30% { opacity: 1; transform: scale(1); } 100% { opacity: .2; } }
.tr-shatter.go i { animation: shardfall .9s cubic-bezier(.55, 0, .9, .4) forwards; animation-delay: var(--dl); }
@keyframes shardfall { to { transform: translate(var(--dx), 120vh) rotate(var(--dr)); opacity: .2; } }
.tr-shatter.go .crack { animation: fadeout .25s forwards; }

/* ---------- gacha reveal ---------- */
#reveal { position: absolute; inset: 0; z-index: 45; overflow: hidden; background: radial-gradient(ellipse at 50% 42%, #1d1a40, #02030a 72%); display: grid; align-content: center; justify-items: center; gap: 14px; padding-block: calc(20px + env(safe-area-inset-top, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)); padding-left: max(14px, env(safe-area-inset-left, 0px)); padding-right: max(14px, env(safe-area-inset-right, 0px)); }
#reveal .rays { position: absolute; inset: -50%; background: repeating-conic-gradient(from 0deg, rgba(255,255,255,.08) 0 6deg, transparent 6deg 18deg); animation: spin 18s linear infinite; pointer-events: none; }
#reveal.r-ssr .rays { background: repeating-conic-gradient(from 0deg, rgba(255,211,107,.18) 0 6deg, transparent 6deg 18deg); }
#reveal.r-ur .rays { background: repeating-conic-gradient(from 0deg, rgba(255,111,216,.2) 0 5deg, rgba(120,200,255,.12) 5deg 10deg, transparent 10deg 18deg); animation-duration: 9s; }
@keyframes spin { to { transform: rotate(360deg); } }
.orbwrap { position: relative; width: 170px; height: 170px; display: grid; place-items: center; }
.orb { width: 120px; height: 120px; border-radius: 50%; animation: orb 1.1s ease-in-out infinite; }
.orbwrap::before, .orbwrap::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(255,255,255,.35); animation: orbring 1.6s ease-out infinite; }
.orbwrap::after { animation-delay: .8s; }
@keyframes orb { 50% { transform: scale(1.12); filter: brightness(1.3); } }
@keyframes orbring { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.orb.charge { animation: charge .9s ease-in forwards; }
@keyframes charge { 70% { transform: scale(.75); filter: brightness(1.6); } 100% { transform: scale(3.5); opacity: 0; filter: brightness(3); } }
.rhint { font-family: var(--display); font-weight: 800; letter-spacing: .3em; font-size: 15px; color: var(--paper); white-space: nowrap; animation: blink 1.6s infinite; }
.rgrid { position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; width: 100%; }
.rc { position: relative; aspect-ratio: 2/3; border-radius: 9px; overflow: hidden; border: 1.5px solid var(--r-r); background: radial-gradient(circle at 50% 40%, #233a6a, #0b0d1a); display: grid; place-items: center; animation: flip .5s var(--ease) backwards; box-shadow: 0 6px 14px rgba(0,0,0,.5); }
.rc img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 10%; }
.rc svg { width: 54%; height: auto; opacity: .9; }
.rc.sr { border-color: var(--r-sr); box-shadow: 0 0 14px rgba(199,155,255,.55); }
.rc.ssr { border-color: var(--r-ssr); box-shadow: 0 0 20px rgba(255,211,107,.8); }
.rc.ur { border-color: var(--r-ur); box-shadow: 0 0 24px rgba(255,111,216,.9); }
.rc.ssr::after, .rc.ur::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.5) 45%, transparent 60%); background-size: 260% 100%; animation: sheen 2s linear infinite; }
.rc .lb { position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 2px; background: rgba(5,6,13,.88); font-size: 9.5px; font-weight: 800; text-align: center; }
.rc .rr { position: absolute; top: 3px; left: 4px; font-family: var(--latin); font-weight: 700; font-size: 10px; text-shadow: 0 1px 3px #000; }
.rc.ur .rr { color: var(--r-ur); } .rc.ssr .rr { color: var(--r-ssr); } .rc.sr .rr { color: var(--r-sr); } .rc .rr { color: var(--r-r); }
@keyframes flip { from { transform: perspective(500px) rotateY(100deg) scale(.7); opacity: 0; } }
.bigchar { position: relative; width: min(74%, 290px); aspect-ratio: 2/3; border-radius: 16px; overflow: hidden; border: 2px solid var(--r-ssr); box-shadow: 0 0 50px rgba(255,211,107,.55); animation: bigin .8s var(--ease); }
.bigchar.ur { border-color: var(--r-ur); box-shadow: 0 0 60px rgba(255,111,216,.7); }
.bigchar img { width: 100%; height: 100%; object-fit: cover; }
.bigchar::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.45) 45%, transparent 60%); background-size: 260% 100%; animation: sheen 2.4s linear infinite; }
@keyframes bigin { from { transform: scale(1.3); opacity: 0; filter: brightness(3); } }
.namep { position: relative; text-align: center; display: grid; gap: 2px; animation: rise .6s var(--ease) .3s backwards; }
.namep small { font-family: var(--latin); letter-spacing: .4em; font-size: 12px; }
.namep b { font-family: var(--display); font-weight: 800; font-size: 28px; letter-spacing: .14em; white-space: nowrap; }
.namep em { font-style: normal; font-size: 12.5px; color: var(--mute); }
#reveal .skip { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); z-index: 3; }

/* ---------- story / title ---------- */
#story { position: absolute; inset: 0; z-index: 77; background: #000; overflow: hidden; }
#story img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: kb 9s ease-out forwards, fadein 1s; }
@keyframes kb { from { transform: scale(1.12); } to { transform: scale(1); } }
#story .txt { position: absolute; left: 0; right: 0; bottom: 0; padding-block: 80px calc(38px + env(safe-area-inset-bottom, 0px)); padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); background: linear-gradient(180deg, transparent, rgba(0,0,0,.9) 38%); font-family: var(--display); font-weight: 600; font-size: 17px; line-height: 2; letter-spacing: .06em; }
#story .txt p { margin: 0; animation: storyin 1.2s var(--ease) backwards; }
#story .txt p + p { animation-delay: .6s; }
@keyframes storyin { from { opacity: 0; filter: blur(6px); transform: translateY(8px); } }
#story .skip { position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); right: max(14px, env(safe-area-inset-right, 0px)); z-index: 2; height: 30px; padding: 0 14px; border-radius: 99px; background: rgba(0,0,0,.5); border: 1px solid rgba(255,255,255,.3); font-size: 12px; }
#story .tap { color: var(--mute); font-size: 12px; text-align: right; margin-top: 10px; font-family: var(--body); animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: .3; } }
#title { position: absolute; inset: 0; z-index: 78; background: #000; cursor: pointer; overflow: hidden; }
#title img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: kb 14s ease-out forwards; }
#title .in { position: absolute; left: 0; right: 0; bottom: 0; padding-block: 140px calc(48px + env(safe-area-inset-bottom, 0px)); text-align: center; background: linear-gradient(180deg, transparent, rgba(5,6,13,.92) 45%); }
#title h1 { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(38px, 12vw, 50px); letter-spacing: .16em; white-space: nowrap; animation: logo 2.4s var(--ease) both; }
#title h1 span { background: linear-gradient(180deg, #ffffff 0%, #fff1c4 40%, #e3a945 100%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 22px rgba(79,227,208,.55)) drop-shadow(0 2px 0 rgba(0,0,0,.8)); }
@keyframes logo { from { opacity: 0; letter-spacing: .7em; filter: blur(10px); } }
#title .en { font-family: var(--latin); font-size: 11px; letter-spacing: .7em; color: var(--teal); margin-top: 6px; animation: fadein 2s 1s both; }
#title .orn { width: 180px; height: 14px; margin: 14px auto 0; background: linear-gradient(90deg, transparent, var(--gold), transparent) center/100% 1px no-repeat; position: relative; }
#title .orn::after { content: "♪"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -55%); color: var(--gold); font-size: 13px; background: #090b18; padding: 0 6px; }
#title .go { margin-top: 26px; font-family: var(--display); font-weight: 700; font-size: 16px; letter-spacing: .3em; animation: blink 2.2s infinite, fadein 1s 1.6s both; white-space: nowrap; }
#title .ver { margin-top: 18px; font-size: 10px; color: var(--dim); letter-spacing: .1em; }

/* ---------- guide (tutorial) ---------- */
#guide { position: absolute; inset: 0; z-index: 79; pointer-events: none; }
#guide .blk { position: absolute; background: rgba(3,4,10,.66); pointer-events: auto; }
#guide .ring { position: absolute; border-radius: 13px; box-shadow: 0 0 0 2px var(--teal), 0 0 24px 6px rgba(79,227,208,.7); animation: ringp 1.1s ease-in-out infinite; pointer-events: none; }
@keyframes ringp { 50% { box-shadow: 0 0 0 2px var(--gold), 0 0 34px 10px rgba(242,195,91,.6); } }
#guide .finger { position: absolute; width: 34px; height: 34px; pointer-events: none; animation: tapf 1s ease-in-out infinite; filter: drop-shadow(0 2px 4px #000); }
@keyframes tapf { 50% { transform: translate(6px, 8px) scale(.9); } }
#guide .talk { position: absolute; left: max(8px, env(safe-area-inset-left, 0px)); right: max(8px, env(safe-area-inset-right, 0px)); display: grid; grid-template-columns: 76px 1fr; align-items: end; gap: 4px; pointer-events: auto; animation: rise .4s var(--ease); }
#guide .talk img { width: 76px; height: 112px; object-fit: cover; object-position: center 8%; border-radius: 12px 12px 0 0; -webkit-mask-image: linear-gradient(180deg, #000 75%, transparent); mask-image: linear-gradient(180deg, #000 75%, transparent); }
#guide .bub { position: relative; background: linear-gradient(180deg, #fbfaff, #e9e5fb); color: #1b1840; border-radius: 14px; padding: 10px 13px; font-size: 13.5px; line-height: 1.65; font-weight: 700; margin-bottom: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.45), 0 0 0 1px rgba(242,195,91,.5); }
#guide .bub::before { content: ""; position: absolute; left: -7px; bottom: 16px; border: 8px solid transparent; border-right-color: #f2effd; border-left: 0; }
#guide .bub .nm { color: #1fa595; font-size: 11px; font-weight: 900; letter-spacing: .1em; }
#guide .bub .nx { color: #8b88a8; font-size: 10.5px; text-align: right; }

/* ---------- toast / celebrate / boot ---------- */
#toast { position: absolute; left: 50%; top: calc(58px + env(safe-area-inset-top, 0px)); z-index: 85; transform: translateX(-50%); max-width: calc(100% - 28px); background: linear-gradient(180deg, rgba(30,35,80,.98), rgba(13,15,36,.98)); border: 1px solid var(--teal); color: var(--paper); padding: 9px 16px; border-radius: 12px; font-size: 13px; font-weight: 700; text-align: center; pointer-events: none; box-shadow: 0 8px 24px rgba(0,0,0,.5), 0 0 16px rgba(79,227,208,.3); animation: toast 2.2s var(--ease) forwards; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, -10px); } 10%, 82% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }
#celebrate { position: absolute; inset: 0; z-index: 75; display: grid; place-items: center; align-content: center; gap: 14px; padding-inline: 20px; background: radial-gradient(circle, rgba(242,195,91,.32), rgba(3,4,10,.9) 68%); text-align: center; overflow: hidden; }
#celebrate .rays { position: absolute; inset: -50%; background: repeating-conic-gradient(rgba(255,233,168,.12) 0 6deg, transparent 6deg 18deg); animation: spin 20s linear infinite; }
#celebrate .t { position: relative; font-family: var(--display); font-weight: 800; font-size: 28px; letter-spacing: .14em; white-space: nowrap; animation: bigin .6s var(--ease); }
#celebrate .rew, #celebrate .sub { position: relative; }
#boot { position: absolute; inset: 0; z-index: 90; display: grid; place-items: center; align-content: center; gap: 16px; background: radial-gradient(ellipse at 50% 40%, #161a3c, #05060c 70%); }
#boot .sub { letter-spacing: .3em; }
.spin { width: 46px; height: 46px; border-radius: 50%; border: 2px solid rgba(242,195,91,.2); border-top-color: var(--gold); border-right-color: var(--teal); animation: spin 1s linear infinite; }
#ad { position: absolute; inset: 0; z-index: 70; background: #000; display: grid; place-items: center; }

@media (max-width: 360px) {
  .pad { gap: 12px; }
  .btn.big { font-size: 16px; }
  .gbanner .t { font-size: 24px; }
  .cc .sn { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- story player (visual novel) ---------- */
#story.vn { background: #05060c; }
#story.vn .vbg { position: absolute; inset: -3%; width: 106%; height: 106%; object-fit: cover; filter: brightness(.5) saturate(.85); animation: drift 30s ease-in-out infinite alternate; }
#story.vn .vch { position: absolute; bottom: 21%; height: 60%; width: auto; max-width: none; filter: brightness(.45) saturate(.7); transition: filter .35s, transform .35s var(--ease); animation: vchin .6s var(--ease) backwards; -webkit-mask-image: linear-gradient(180deg, #000 82%, transparent); mask-image: linear-gradient(180deg, #000 82%, transparent); }
#story.vn .vch.l { left: -16%; } #story.vn .vch.r { right: -16%; }
#story.vn .vch.solo { left: 50%; transform: translateX(-50%); }
#story.vn .vch.solo.on { transform: translateX(-50%) scale(1.03) translateY(-6px); }
#story.vn .vch.on { filter: none; transform: scale(1.03) translateY(-6px); z-index: 1; }
@keyframes vchin { from { opacity: 0; transform: translateY(16px); } }
#story.vn .vbox { position: absolute; left: max(10px, env(safe-area-inset-left, 0px)); right: max(10px, env(safe-area-inset-right, 0px)); bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 3; min-height: 132px; padding: 22px 18px 16px; border-radius: 14px; background: linear-gradient(180deg, rgba(20,24,56,.92), rgba(9,11,24,.96)); border: 1px solid var(--line); box-shadow: inset 0 0 0 4px rgba(9,11,24,.5), inset 0 0 0 5px rgba(242,195,91,.1), 0 10px 30px rgba(0,0,0,.6); }
#story.vn .vbox::before, #story.vn .vbox::after { content: ""; position: absolute; width: 18px; height: 18px; background: var(--corner) no-repeat; }
#story.vn .vbox::before { top: 4px; left: 4px; } #story.vn .vbox::after { bottom: 4px; right: 4px; transform: rotate(180deg); }
#story.vn .vname { position: absolute; top: -15px; left: 16px; height: 28px; padding: 0 16px; display: grid; place-items: center; border-radius: 8px; font-family: var(--display); font-weight: 800; font-size: 14px; letter-spacing: .14em; color: #2b1a00; background: linear-gradient(180deg, #fff3c9, #e1a33a); box-shadow: 0 4px 12px rgba(0,0,0,.5); white-space: nowrap; }
#story.vn .vtext { margin: 0; font-family: var(--display); font-weight: 600; font-size: 16px; line-height: 1.9; letter-spacing: .04em; min-height: 3.8em; }
#story.vn .vtext.narr { color: var(--mute); font-style: normal; }
#story.vn .tap { position: absolute; right: 16px; bottom: 8px; color: var(--gold); font-size: 12px; animation: blink 1.2s infinite; }
