/* Atlas Nocturne. The game is drawn on a fixed 1280x720 stage that scales to the window, like a console game. */
:root {
  --ink: #0d0c12; --night: #15131c; --panel: rgba(18, 16, 26, .82); --panel-2: rgba(30, 26, 42, .9);
  --gold: #d8b46a; --gold-2: #f4dfa6; --gold-3: #8c6b34; --line: rgba(216, 180, 106, .32);
  --text: #efe8d8; --mute: #a49db1; --violet: #4a3a9e; --violet-2: #7b66e0; --teal: #3fcab9;
  --serif: 'Marcellus', 'Cormorant Garamond', Georgia, serif;
  --body: 'Cormorant Garamond', Georgia, serif;
  --ar: 'Amiri', 'Noto Naskh Arabic', serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--ink); color: var(--text); overflow: hidden; }
body { font-family: var(--body); -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 3px; border-radius: 6px; }
a { color: inherit; }

#wrap { position: fixed; inset: 0; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 40%, #1d1a28, #0a090e 70%); }
#stage { position: relative; width: 1280px; height: 720px; flex: none; overflow: hidden; transform-origin: 0 0; position: absolute; left: 0; top: 0;
  background: #120f19; box-shadow: 0 0 0 1px rgba(216, 180, 106, .18), 0 30px 80px rgba(0, 0, 0, .7); }
#stage.ar { font-family: var(--ar); }
.ar .serif, .ar .btn-img span, .ar h1, .ar h2 { font-family: var(--ar) !important; letter-spacing: 0 !important; }
.serif { font-family: var(--serif); }
.num { font-family: var(--serif); font-variant-numeric: lining-nums tabular-nums; font-weight: 400; }

/* background layers */
.bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.bg.dim::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 8, 16, .55), rgba(10, 8, 16, .35) 40%, rgba(10, 8, 16, .8)); }
.vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 55%, rgba(5, 4, 9, .75)); }
.mist { position: absolute; inset: 0; pointer-events: none; opacity: .35; background:
  radial-gradient(ellipse 60% 25% at 20% 85%, rgba(160, 140, 220, .25), transparent 70%),
  radial-gradient(ellipse 50% 20% at 80% 90%, rgba(120, 110, 190, .22), transparent 70%); animation: mist 18s ease-in-out infinite alternate; }
@keyframes mist { to { transform: translateX(-40px); opacity: .55; } }
.dust { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: var(--gold-2); box-shadow: 0 0 6px var(--gold-2); opacity: 0; animation: dust 9s linear infinite; pointer-events: none; }
@keyframes dust { 0% { opacity: 0; transform: translateY(0); } 15% { opacity: .8; } 100% { opacity: 0; transform: translateY(-260px) translateX(30px); } }

/* top bar */
.top { position: absolute; left: 0; right: 0; top: 0; height: 84px; display: flex; align-items: center; padding: 0 28px 0 22px; z-index: 20;
  background: linear-gradient(180deg, rgba(8, 7, 12, .85), rgba(8, 7, 12, 0)); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand .emb { width: 66px; height: 44px; color: var(--gold); }
.brand .home { display: flex; align-items: center; gap: 10px; }
.brand .back { width: 18px; height: 18px; color: var(--gold); opacity: .8; }
.brand h1 { font-family: var(--serif); font-weight: 400; font-size: 30px; letter-spacing: .04em; color: #f6efdf; line-height: 1; text-shadow: 0 2px 12px rgba(0, 0, 0, .6); }
.brand small { display: block; font: italic 500 12px/1 var(--body); letter-spacing: .32em; color: var(--mute); margin-top: 5px; font-family: 'Cormorant Garamond', serif !important; }
.res { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.pill { position: relative; display: flex; align-items: center; height: 30px; min-width: 112px; padding: 0 6px 0 34px; border-radius: 16px;
  background: linear-gradient(180deg, #2a2633, #17141e); border: 1px solid var(--line); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); }
.pill img { position: absolute; left: -8px; top: 50%; width: 38px; height: 38px; transform: translateY(-50%); filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .6)); }
.pill .num { flex: 1; text-align: right; font-size: 16px; padding-right: 8px; color: #f3ecdc; }
.pill .plus { width: 20px; height: 20px; display: grid; place-items: center; color: var(--gold-2); border-left: 1px solid var(--line); padding-left: 6px; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; color: var(--gold-2); position: relative; }
.icon-btn svg { width: 30px; height: 30px; }
.icon-btn .dot { position: absolute; right: 6px; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: #e4613f; box-shadow: 0 0 6px #e4613f; }

/* left rail tabs */
.rail { position: absolute; left: 0; top: 150px; width: 230px; z-index: 10; }
.rail::before { content: ''; position: absolute; left: 30px; top: -24px; bottom: -40px; width: 1px; background: linear-gradient(180deg, transparent, var(--line) 15%, var(--line) 85%, transparent); }
.tab { position: relative; display: flex; align-items: center; height: 54px; width: 200px; padding-left: 58px; margin-bottom: 18px; font-family: var(--serif); font-size: 20px; color: #cfc7d9; text-align: left; }
.tab::before { content: ''; position: absolute; left: 26px; top: 50%; width: 9px; height: 9px; margin-top: -4.5px; border-radius: 50%; border: 1px solid var(--gold); background: #15131c; }
.tab.on { color: #fff; }
.tab.on::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; right: 0; z-index: -1; border-radius: 0 28px 28px 0;
  background: linear-gradient(90deg, #2c2470, #4f3fb0 70%, #5d4cc4); border: 1px solid rgba(244, 223, 166, .7); border-left: 0;
  box-shadow: 0 0 18px rgba(110, 90, 220, .45), inset 0 1px 0 rgba(255, 255, 255, .15); }
.tab.on::before { display: none; }
.tab .spark { position: absolute; right: 16px; top: 50%; width: 26px; height: 26px; margin-top: -13px; color: var(--gold-2); display: none; }
.tab.on .spark { display: block; animation: twinkle 2.4s ease-in-out infinite; }
.tab small { position: absolute; left: 58px; bottom: 5px; font: italic 10px/1 var(--body); letter-spacing: .25em; color: rgba(255, 255, 255, .45); display: none; }
.tab.on small { display: block; }
@keyframes twinkle { 50% { transform: rotate(45deg) scale(.82); opacity: .7; } }
.ar .tab { font-family: var(--ar); font-size: 21px; }

/* gold and teal image buttons */
.btn-img { position: relative; display: inline-grid; place-items: center; height: 58px; min-width: 210px; padding: 0 40px; isolation: isolate;
  font-family: var(--serif); font-size: 19px; letter-spacing: .03em; transition: transform .12s, filter .2s; }
.btn-img::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--face) center / 100% 100% no-repeat; transition: filter .2s; }
.btn-img > span { position: relative; font-weight: 400; }
.btn-img.gold { --face: url(img/ui/btn-gold.webp); color: #2a1903; text-shadow: 0 1px 0 rgba(255, 246, 214, .75); }
.btn-img.gold::before { filter: brightness(1.3) saturate(1.45) contrast(1.05); }
.btn-img.teal { --face: url(img/ui/btn-teal.webp); color: #fff; text-shadow: 0 1px 2px rgba(0, 38, 34, .95), 0 0 8px rgba(0, 50, 46, .8); }
.btn-img.gold:hover::before { filter: brightness(1.45) saturate(1.5) contrast(1.05); }
.btn-img.teal:hover::before { filter: brightness(1.15); }
.btn-img:active { transform: scale(.97); }
.btn-img[disabled] { filter: grayscale(.9) brightness(.7); cursor: default; }
.btn-img small { display: flex; align-items: center; justify-content: center; gap: 3px; font: 400 14px/1 var(--serif); margin-top: 3px; }
.btn-img small img { width: 22px !important; height: 22px; margin: -4px 0; }
.btn-ghost { height: 34px; padding: 0 16px; border-radius: 4px; display: inline-flex; align-items: center; gap: 8px; font-size: 15px; color: #e6dfcf;
  background: linear-gradient(180deg, #2a2633, #1a1722); border: 1px solid var(--line); clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%); }
.btn-ghost.on { background: linear-gradient(180deg, #4b3c9f, #2f2575); color: #fff; }
.btn-silver { height: 46px; min-width: 170px; padding: 0 26px; border-radius: 23px; font-family: var(--serif); font-size: 18px; color: #2b2833;
  background: linear-gradient(180deg, #f3f1f6, #b9b5c2 55%, #d8d5de); border: 2px solid #8f8a99; box-shadow: 0 0 0 2px #2a2733, 0 4px 12px rgba(0, 0, 0, .5); }
.btn-silver:hover { filter: brightness(1.08); }

/* shared bits */
.stars { display: inline-flex; gap: 2px; }
.stars svg { width: 15px; height: 15px; }
.badge { display: grid; place-items: center; border-radius: 50%; color: #fff; }
.badge svg { width: 62%; height: 62%; }
.diamond { transform: rotate(45deg); }
.hdr { display: flex; align-items: center; gap: 8px; font-size: 16px; color: #ddd3bf; padding: 4px 10px; margin: 0 0 10px;
  background: linear-gradient(90deg, rgba(216, 180, 106, .16), transparent 70%); border-left: 2px solid var(--gold); }
.hdr i { font: italic 11px var(--body); letter-spacing: .2em; color: var(--mute); }
.hdr svg { width: 12px; height: 12px; color: var(--gold); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }

/* lobby */
.lobby-hero { position: absolute; left: 150px; bottom: -40px; height: 740px; filter: drop-shadow(0 0 30px rgba(10, 6, 20, .7)); transition: opacity .4s; animation: breathe 6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: translateY(-6px); } }
.bubble { position: absolute; left: 520px; top: 170px; max-width: 330px; padding: 14px 18px; font: italic 500 19px/1.35 var(--body); color: #f4ecdc;
  background: rgba(16, 13, 24, .78); border: 1px solid var(--line); border-radius: 4px 18px 18px 18px; }
.ar .bubble { font-family: var(--ar); font-style: normal; }
.bubble b { display: block; font: 400 13px var(--serif); letter-spacing: .15em; color: var(--gold); margin-bottom: 4px; font-style: normal; }
.menu { position: absolute; right: 56px; top: 130px; width: 360px; display: grid; gap: 16px; }
.mbtn { position: relative; height: 104px; display: flex; align-items: center; gap: 18px; padding: 0 24px; text-align: left; overflow: hidden;
  background: linear-gradient(100deg, rgba(36, 30, 54, .92), rgba(18, 15, 27, .9)); border: 1px solid var(--line);
  clip-path: polygon(18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%, 0 18px); transition: transform .15s, box-shadow .2s, border-color .2s; }
.mbtn::before { content: ''; position: absolute; inset: 4px; border: 1px solid rgba(216, 180, 106, .14); clip-path: inherit; pointer-events: none; }
.mbtn:hover { transform: translateX(-6px); border-color: rgba(244, 223, 166, .7); }
.mbtn .ico { width: 62px; height: 62px; flex: none; display: grid; place-items: center; }
.mbtn .ico img { width: 62px; height: 62px; }
.mbtn .ico svg { width: 40px; height: 40px; color: var(--gold-2); }
.mbtn b { display: block; font: 400 25px var(--serif); color: #f7f0e0; }
.ar .mbtn b { font-family: var(--ar); }
.mbtn i { display: block; font: italic 15px var(--body); color: var(--mute); margin-top: 3px; }
.ar .mbtn i { font-family: var(--ar); font-style: normal; }
.mbtn.main { height: 132px; background: linear-gradient(100deg, rgba(76, 58, 160, .92), rgba(32, 24, 70, .92)); border-color: rgba(244, 223, 166, .6); }
.mbtn.main b { font-size: 30px; }
.mbtn .go { position: absolute; right: 20px; width: 22px; height: 22px; color: var(--gold-2); }
.ar .mbtn { text-align: right; }
.credit { position: absolute; left: 24px; bottom: 16px; font: italic 14px var(--body); color: rgba(239, 232, 216, .55); text-decoration: none; letter-spacing: .05em; z-index: 5; }
.credit:hover { color: var(--gold-2); }
.chapter-tag { position: absolute; right: 56px; bottom: 30px; width: 360px; text-align: center; font: italic 15px var(--body); color: var(--mute); }
.chapter-tag img { width: 260px; display: block; margin: 0 auto 4px; opacity: .8; }

/* character screen */
.ring { position: absolute; left: 160px; top: 40px; width: 640px; height: 640px; opacity: .22; color: #b6a4ff; animation: spin 120s linear infinite; pointer-events: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.char-art { position: absolute; left: 470px; top: 62px; height: 960px; transform: translateX(-50%); filter: drop-shadow(0 0 40px rgba(8, 5, 18, .8)); pointer-events: none; }
.char-art.in { animation: slideIn .45s cubic-bezier(.2, .8, .2, 1); }
@keyframes slideIn { from { opacity: 0; transform: translateX(-46%); } }
.arrow { position: absolute; top: 330px; width: 44px; height: 64px; color: var(--gold-2); z-index: 6; transition: transform .15s; }
.arrow svg { width: 100%; height: 100%; filter: drop-shadow(0 0 6px rgba(244, 223, 166, .6)); }
.arrow:hover { transform: scale(1.12); }
.quote { position: absolute; left: 230px; top: 470px; width: 300px; z-index: 6; font: italic 500 22px/1.3 var(--body); color: #fff; text-shadow: 0 2px 10px #000, 0 0 2px #000; }
.ar .quote { font-family: var(--ar); font-style: normal; font-size: 21px; }
.quote::first-letter { font-size: 30px; }
.carousel { position: absolute; left: 70px; bottom: 34px; display: flex; align-items: center; gap: 4px; z-index: 6; }
.carousel .ca { width: 18px; height: 18px; color: var(--gold); }
.thumb { width: 50px; height: 50px; overflow: hidden; border: 1px solid var(--gold); background: #2a2235; transform: rotate(45deg); margin: 0 6px; opacity: .7; transition: all .2s; flex: none; }
.thumb i { display: block; width: 142%; height: 142%; margin: -21%; transform: rotate(-45deg); background-repeat: no-repeat; }
.thumb.on { width: 64px; height: 64px; opacity: 1; border: 2px solid var(--gold-2); box-shadow: 0 0 14px rgba(244, 223, 166, .6); }
.info { position: absolute; right: 40px; top: 96px; width: 410px; bottom: 30px; z-index: 6; }
.info .name { display: flex; align-items: center; gap: 12px; padding: 8px 14px; border-radius: 30px; background: linear-gradient(90deg, rgba(30, 26, 42, .9), rgba(30, 26, 42, .2)); }
.info .name .badge { width: 46px; height: 46px; border: 2px solid var(--gold); box-shadow: 0 0 12px var(--g); }
.info .name h2 { font: 400 27px var(--serif); flex: 1; }
.info .name .stars svg { width: 19px; height: 19px; }
.lvrow { display: flex; align-items: baseline; justify-content: space-between; margin: 16px 6px 6px; font-size: 18px; }
.lvrow small { font-size: 12px; color: var(--mute); }
.bar { height: 7px; border: 1px solid var(--line); background: #1a1722; position: relative; margin: 0 6px 18px; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #a98a4f, #f4dfa6); box-shadow: 0 0 8px rgba(244, 223, 166, .6); transition: width .5s; }
.bar::after { content: ''; position: absolute; right: -9px; top: -5px; border: 8px solid transparent; border-left-color: var(--gold); border-right: 0; }
.stats { list-style: none; margin: 0 8px 18px; }
.stats li { display: flex; align-items: center; gap: 10px; font-size: 16px; padding: 4px 0; color: #d9d1c2; }
.stats li svg { width: 15px; height: 15px; color: #cbbfa4; }
.stats li .num { margin-left: auto; font-size: 17px; color: #f1eadb; }
.ar .stats li .num { margin-left: 0; margin-right: auto; }
.skills { display: flex; gap: 22px; justify-content: center; margin-bottom: 20px; }
.sk { position: relative; width: 78px; height: 78px; }
.sk img.icon { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .6)); transition: transform .15s, filter .2s; }
.sk img.rim { position: absolute; inset: 0; width: 78px; height: 78px; pointer-events: none; }
.sk:hover img.icon { transform: scale(1.06); filter: brightness(1.15) drop-shadow(0 0 10px rgba(244, 223, 166, .5)); }
.actions { position: absolute; bottom: 0; left: 0; right: 0; display: flex; gap: 10px; justify-content: center; }
.actions .btn-img { min-width: 190px; }
.cost { position: absolute; bottom: 62px; left: 0; right: 0; text-align: center; font-size: 14px; color: var(--mute); }
.skill-list { display: grid; gap: 12px; }
.skill-row { display: flex; gap: 14px; align-items: flex-start; padding: 10px; background: rgba(20, 17, 30, .7); border: 1px solid rgba(216, 180, 106, .18); }
.skill-row .sk { width: 64px; height: 64px; flex: none; }
.skill-row .sk img.rim { width: 64px; height: 64px; }
.skill-row b { display: block; font: 400 18px var(--serif); color: #f2ead9; }
.ar .skill-row b { font-family: var(--ar); }
.skill-row em { font: italic 12px var(--body); color: var(--gold); letter-spacing: .12em; margin-inline-start: 10px; }
.skill-row p { font-size: 15.5px; line-height: 1.35; color: #cfc7b8; margin-top: 3px; }
.story { font-size: 19px; line-height: 1.5; color: #e1d9c9; padding: 6px 8px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; margin: 14px 8px 0; font-size: 16px; }
.facts dt { color: var(--mute); }

/* collection */
.grid-wrap { position: absolute; left: 262px; right: 34px; top: 136px; bottom: 0; overflow-y: auto; overflow-x: hidden; padding: 12px 8px 40px; scrollbar-width: thin; scrollbar-color: var(--gold-3) transparent; }
.tools { position: absolute; right: 40px; top: 92px; display: flex; gap: 10px; z-index: 6; }
.grid { display: grid; grid-template-columns: repeat(5, 172px); gap: 22px 20px; }
.card { position: relative; width: 172px; height: 250px; transition: transform .18s, filter .2s; text-align: left; }
.card:hover { transform: translateY(-6px); }
.card .in { position: absolute; left: 8px; right: 8px; top: 10px; bottom: 10px; overflow: hidden; background: var(--cbg); }
.card .in::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 52%, rgba(10, 8, 16, .95) 88%); }
.card .art { position: absolute; inset: 0; background-repeat: no-repeat; }
.card .frame { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .6)); }
.card .lv { position: absolute; left: 16px; top: 18px; font-size: 11px; line-height: 1; color: #f2ead9; z-index: 2; text-shadow: 0 1px 3px #000; }
.card .lv .num { display: block; font-size: 22px; }
.card .badge { position: absolute; right: 16px; top: 18px; width: 30px; height: 30px; z-index: 2; border: 1.5px solid var(--gold); transform: rotate(45deg); border-radius: 6px; }
.card .badge svg { transform: rotate(-45deg); }
.card .foot { position: absolute; left: 0; right: 0; bottom: 20px; text-align: center; z-index: 2; }
.card .foot .stars svg { width: 13px; height: 13px; }
.card .foot b { display: block; font: 400 17px var(--serif); color: #fff; margin-top: 3px; text-shadow: 0 1px 4px #000; }
.ar .card .foot b { font-family: var(--ar); }
.card.locked .art { filter: brightness(0) opacity(.55); }
.card.locked .foot b { color: var(--mute); font: italic 14px var(--body); }
.card.r5 .frame { filter: drop-shadow(0 0 8px rgba(244, 223, 166, .55)); }
.enemy-card .in { background: radial-gradient(ellipse at 50% 70%, #3a2f4f, #120f19); }

/* team */
.team-tabs { position: absolute; left: 0; right: 0; top: 92px; height: 52px; display: flex; justify-content: center; gap: 110px; border-bottom: 1px solid var(--line); z-index: 6; }
.team-tabs button { position: relative; width: 70px; font: 400 21px var(--serif); color: #9c94a8; }
.team-tabs button.on { color: #fff; }
.team-tabs button.on::before { content: ''; position: absolute; left: 50%; bottom: -1px; width: 110px; height: 52px; transform: translateX(-50%); z-index: -1;
  border-radius: 55px 55px 0 0; border: 1px solid rgba(244, 223, 166, .7); border-bottom: 0; background: radial-gradient(ellipse at 50% 100%, rgba(244, 223, 166, .35), rgba(40, 30, 60, .6) 70%); }
.stage-pick { position: absolute; left: 50%; top: 152px; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; z-index: 6; font-size: 17px; color: #e7dfcf; }
.stage-pick button { width: 28px; height: 28px; color: var(--gold-2); }
.stage-pick button[disabled] { opacity: .25; }
.stage-pick .foes { display: flex; gap: 4px; margin-left: 8px; }
.stage-pick .foes i { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: #1a1622 no-repeat center 15% / 200%; }
.slots { position: absolute; left: 0; right: 0; top: 196px; display: flex; justify-content: center; gap: 26px; }
.slot { position: relative; width: 214px; height: 332px; transition: transform .18s; }
.slot:hover { transform: translateY(-6px); }
.slot .in { position: absolute; left: 13px; right: 13px; top: 42px; bottom: 14px; overflow: hidden; background: var(--cbg, linear-gradient(180deg, #24203a, #15121f)); border-radius: 90px 90px 0 0; }
.slot .in::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(10, 8, 16, .95) 90%); }
.slot .art { position: absolute; inset: 0; background-repeat: no-repeat; }
.slot .frame { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .7)); }
.slot .badge { position: absolute; left: 26px; top: 64px; width: 34px; height: 34px; z-index: 2; border: 1.5px solid var(--gold); }
.slot .foot { position: absolute; left: 0; right: 0; bottom: 40px; text-align: center; z-index: 2; }
.slot .foot b { display: block; font: 400 19px var(--serif); color: #fff; margin: 3px 0 0; text-shadow: 0 1px 4px #000; }
.ar .slot .foot b { font-family: var(--ar); }
.slot .foot .num { display: block; font: 400 34px/1 var(--serif); color: var(--gold-2); text-shadow: 0 0 10px rgba(244, 223, 166, .5); }
.slot.empty .in { background: linear-gradient(180deg, #232038, #17142a); }
.slot.empty .plus { position: absolute; left: 50%; top: 52%; width: 84px; height: 84px; transform: translate(-50%, -50%); color: var(--gold-2); z-index: 2; filter: drop-shadow(0 0 8px rgba(244, 223, 166, .5)); }
.team-bar { position: absolute; left: 90px; right: 60px; bottom: 40px; display: flex; align-items: center; }
.team-bar .center { position: absolute; left: 50%; transform: translateX(-50%); }
.team-bar .power { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 18px; color: #eae2d2; }
.team-bar .power svg { width: 18px; height: 18px; color: var(--gold-2); }
.potion-cost { display: inline-flex; align-items: center; gap: 2px; margin-right: 14px; padding-right: 14px; border-right: 1px solid rgba(59, 40, 8, .4); font: 600 14px var(--body); }
.potion-cost img { width: 28px; height: 28px; margin: -6px 0; }
.btn-img.start { min-width: 300px; }

/* summon */
.altar-hero { position: absolute; left: 60px; bottom: -60px; height: 780px; filter: drop-shadow(0 0 40px rgba(110, 90, 220, .5)); animation: breathe 6s ease-in-out infinite; }
.altar-panel { position: absolute; right: 60px; top: 130px; width: 470px; padding: 30px 34px; text-align: center; }
.altar-panel h2 { font: 400 38px var(--serif); color: #fbf3e2; letter-spacing: .03em; }
.altar-panel img.div { width: 300px; margin: 6px auto 12px; display: block; }
.altar-panel p { font-size: 19px; line-height: 1.45; color: #d9d0c0; }
.altar-panel .rates { margin: 14px 0 24px; font-size: 15px; color: var(--mute); letter-spacing: .05em; }
.altar-panel .row { display: flex; gap: 12px; justify-content: center; }
.altar-panel .btn-img { min-width: 200px; height: 64px; }
.featured { position: absolute; left: 470px; top: 170px; width: 240px; }
.featured b { display: block; font: 400 30px var(--serif); color: #fff; text-shadow: 0 2px 10px #000; }
.ar .featured b { font-family: var(--ar); }
.featured i { display: block; font: italic 17px var(--body); color: var(--gold-2); text-shadow: 0 2px 6px #000; margin-top: 4px; }

/* overlays: modals, results, toast */
.veil { position: absolute; inset: 0; z-index: 50; background: rgba(6, 5, 10, .72); display: grid; place-items: center; animation: fade .25s; }
@keyframes fade { from { opacity: 0; } }
.modal { position: relative; width: 640px; max-height: 600px; padding: 26px 30px; background: linear-gradient(180deg, #1f1b2b, #131019); border: 1px solid rgba(244, 223, 166, .45);
  box-shadow: 0 0 0 4px rgba(19, 16, 25, .9), 0 0 0 5px var(--line), 0 30px 80px rgba(0, 0, 0, .8); animation: pop .3s cubic-bezier(.2, 1.4, .4, 1); overflow: auto; }
@keyframes pop { from { transform: scale(.9); opacity: 0; } }
.modal h3 { font: 400 26px var(--serif); text-align: center; color: #fbf3e2; }
.ar .modal h3 { font-family: var(--ar); }
.modal img.div { width: 280px; display: block; margin: 4px auto 16px; }
.modal .x { position: absolute; right: 14px; top: 12px; width: 34px; height: 34px; color: var(--gold-2); }
.modal .x svg { width: 22px; height: 22px; }
.letter { padding: 14px 16px; margin-bottom: 12px; background: rgba(36, 31, 50, .6); border: 1px solid rgba(216, 180, 106, .2); }
.letter header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.letter b { font: 400 19px var(--serif); color: #f6eedd; }
.ar .letter b { font-family: var(--ar); }
.letter small { color: var(--gold); font-size: 14px; }
.letter p { font-size: 17px; line-height: 1.45; color: #d6cebf; margin: 8px 0 12px; }
.letter .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.letter .gift { display: inline-flex; align-items: center; gap: 4px; font-size: 15px; margin-right: 8px; }
.letter .gift img { width: 26px; height: 26px; }
.letter a.btn-ghost { text-decoration: none; }
.langs { display: flex; gap: 10px; justify-content: center; margin: 6px 0 22px; }
.langs .btn-ghost { min-width: 120px; justify-content: center; font-size: 17px; }
.set-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-top: 1px solid rgba(216, 180, 106, .15); font-size: 17px; }
.picker { display: grid; grid-template-columns: repeat(4, 120px); gap: 14px; justify-content: center; }
.picker .card { width: 120px; height: 175px; }
.picker .card .foot b { font-size: 14px; }
.picker .card .lv .num { font-size: 17px; }
.picker .card .badge { width: 24px; height: 24px; right: 12px; top: 14px; }
.picker .card.in-team { filter: grayscale(.8) brightness(.6); }
.center-btns { display: flex; gap: 12px; justify-content: center; margin-top: 20px; }
.toast { position: absolute; left: 50%; top: 96px; transform: translateX(-50%); z-index: 80; padding: 10px 22px; font-size: 17px; color: #fbf3e2; white-space: nowrap;
  background: rgba(20, 16, 30, .94); border: 1px solid rgba(244, 223, 166, .5); animation: toast 2.4s forwards; pointer-events: none; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, -8px); } 10%, 80% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }
.tip { position: absolute; z-index: 70; width: 280px; padding: 12px 14px; background: rgba(16, 13, 24, .96); border: 1px solid rgba(244, 223, 166, .45); pointer-events: none; font-size: 15px; line-height: 1.35; color: #d8d0c1; }
.tip b { display: block; font: 400 17px var(--serif); color: #f6eedd; margin-bottom: 4px; }
.ar .tip b { font-family: var(--ar); }

/* summon reveal */
.reveal { display: flex; flex-wrap: wrap; gap: 18px 14px; justify-content: center; }
.reveal .card { width: 150px; height: 218px; }
.modal:has(.reveal) { max-height: 690px; padding-top: 18px; }
.reveal .card { opacity: 0; animation: flip .55s cubic-bezier(.2, 1.2, .4, 1) forwards; }
.reveal .card.r5 { box-shadow: 0 0 40px rgba(244, 223, 166, .55); }
@keyframes flip { from { opacity: 0; transform: rotateY(90deg) scale(.8); } to { opacity: 1; transform: none; } }
.reveal .tag { position: absolute; left: 50%; top: -12px; transform: translateX(-50%); z-index: 4; padding: 2px 10px; font: 600 12px var(--body); letter-spacing: .1em; white-space: nowrap;
  background: linear-gradient(180deg, #f4dfa6, #c99e52); color: #3b2808; }
.reveal .tag.sh { background: linear-gradient(180deg, #8f7be8, #5440b8); color: #fff; }
.burst { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 50% 50%, rgba(244, 223, 166, .85), rgba(140, 110, 255, .3) 30%, transparent 60%); animation: burst .9s ease-out forwards; z-index: 49; }
@keyframes burst { from { opacity: 1; transform: scale(.3); } to { opacity: 0; transform: scale(2.2); } }

/* battle */
.field { position: absolute; inset: 0; }
.unit { position: absolute; bottom: 150px; width: 0; transform-origin: 50% 100%; transition: filter .3s, opacity .6s; }
.unit img { position: absolute; left: 50%; bottom: 0; height: 100%; max-width: none; transform: translateX(-50%); filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .7)); }
.unit .hp { position: absolute; left: 50%; bottom: -26px; width: 120px; transform: translateX(-50%); }
.unit .hp i { display: block; height: 7px; background: #261f2c; border: 1px solid rgba(0, 0, 0, .7); position: relative; overflow: hidden; }
.unit .hp i b { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(180deg, #8de08a, #3e9b47); transition: width .35s; }
.unit.foe .hp i b { background: linear-gradient(180deg, #ff8a72, #b9382a); }
.unit .hp i s { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(160, 200, 255, .7); transition: width .35s; }
.unit .hp em { display: block; text-align: center; font: 600 15px var(--body); color: #f2eadb; text-shadow: 0 1px 3px #000; margin-top: 2px; white-space: nowrap; }
.ar .unit .hp em { font-family: var(--ar); }
.unit.dead { opacity: 0; filter: grayscale(1) brightness(.4); }
.unit.stunned img { filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .7)) saturate(.3) brightness(.8); }
.unit.acting { z-index: 5; }
.unit.lunge-r { animation: lungeR .5s ease; }
.unit.lunge-l { animation: lungeL .5s ease; }
@keyframes lungeR { 40% { transform: translateX(70px) scale(1.04); } }
@keyframes lungeL { 40% { transform: translateX(-70px) scale(1.04); } }
.unit.hit { animation: hit .35s ease; }
@keyframes hit { 25% { transform: translateX(8px); filter: brightness(2.2); } 60% { transform: translateX(-5px); } }
.unit.glow img { filter: drop-shadow(0 0 18px var(--g)) drop-shadow(0 8px 14px rgba(0, 0, 0, .7)); }
.float { position: absolute; z-index: 30; font: 700 30px var(--serif); color: #fff; text-shadow: 0 2px 0 #000, 0 0 10px rgba(0, 0, 0, .8); pointer-events: none; animation: float 1s ease-out forwards; white-space: nowrap; }
.float.crit { font-size: 40px; color: #ffd36b; }
.float.heal { color: #8ef08a; }
.float.sh { color: #a9cbff; font-size: 24px; }
.float.miss { font-size: 20px; color: #ccc; }
@keyframes float { 0% { opacity: 0; transform: translateY(10px) scale(.6); } 15% { opacity: 1; transform: translateY(-6px) scale(1.15); } 100% { opacity: 0; transform: translateY(-70px) scale(1); } }
.banner { position: absolute; left: 0; right: 0; top: 260px; height: 86px; z-index: 35; display: grid; place-items: center; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(12, 9, 20, .9) 25%, rgba(12, 9, 20, .9) 75%, transparent); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); animation: banner .9s ease forwards; }
.banner b { font: 400 34px var(--serif); color: #fff6e2; letter-spacing: .06em; text-shadow: 0 0 18px var(--g); }
.ar .banner b { font-family: var(--ar); }
@keyframes banner { 0% { opacity: 0; transform: scaleY(.2); } 15%, 75% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.ult-cut { position: absolute; inset: 0; z-index: 34; pointer-events: none; overflow: hidden; background: radial-gradient(ellipse at 60% 50%, var(--g), rgba(8, 6, 14, .88) 60%); animation: ultBg 1.4s ease forwards; }
.ult-cut img { position: absolute; right: 120px; bottom: -120px; height: 900px; animation: ultIn 1.4s cubic-bezier(.2, .8, .2, 1) forwards; }
@keyframes ultBg { 0% { opacity: 0; } 15%, 75% { opacity: 1; } 100% { opacity: 0; } }
@keyframes ultIn { 0% { transform: translateX(300px); opacity: 0; } 25% { transform: translateX(0); opacity: 1; } 80% { transform: translateX(-30px); opacity: 1; } 100% { transform: translateX(-80px); opacity: 0; } }
.flash { position: absolute; inset: 0; z-index: 33; pointer-events: none; background: var(--g); mix-blend-mode: screen; animation: flash .5s ease-out forwards; }
@keyframes flash { from { opacity: .7; } to { opacity: 0; } }
.shake { animation: shake .4s ease; }
@keyframes shake { 20% { transform: translate(6px, -3px); } 40% { transform: translate(-5px, 3px); } 60% { transform: translate(4px, 2px); } 80% { transform: translate(-2px, -1px); } }
.bhud { position: absolute; left: 0; right: 0; bottom: 0; height: 128px; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 0 30px;
  background: linear-gradient(180deg, transparent, rgba(8, 6, 12, .92) 40%); }
.port { position: relative; width: 92px; height: 92px; flex: none; }
.port .face { position: absolute; inset: 8px; border-radius: 50%; background-repeat: no-repeat; background-color: #241f31; overflow: hidden; }
.port svg.gauge { position: absolute; inset: 0; width: 92px; height: 92px; transform: rotate(-90deg); }
.port svg.gauge circle { fill: none; stroke-width: 5; }
.port .hpline { position: absolute; left: 10px; right: 10px; bottom: -8px; height: 5px; background: #261f2c; }
.port .hpline b { position: absolute; left: 0; top: 0; bottom: 0; background: #6fcf6b; transition: width .35s; }
.port.ready { cursor: pointer; animation: ready 1.2s ease-in-out infinite; }
.port.ready .face { box-shadow: 0 0 22px var(--g), inset 0 0 0 2px var(--gold-2); }
@keyframes ready { 50% { transform: translateY(-4px); } }
.port.dead { filter: grayscale(1) brightness(.4); }
.port.queued .face { box-shadow: 0 0 0 3px #fff, 0 0 30px var(--g); }
.bctl { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.bctl .hint { font: italic 15px var(--body); color: var(--mute); margin-right: 10px; max-width: 240px; text-align: right; }
.ar .bctl .hint { font-family: var(--ar); font-style: normal; }
.wave { position: absolute; left: 50%; top: 96px; transform: translateX(-50%); z-index: 20; font: 400 20px var(--serif); color: #f3ead8; letter-spacing: .1em; text-shadow: 0 2px 8px #000; }
.ar .wave { font-family: var(--ar); }
.result { text-align: center; }
.result h3 { font-size: 46px !important; letter-spacing: .08em; }
.result.win h3 { color: var(--gold-2) !important; text-shadow: 0 0 24px rgba(244, 223, 166, .6); }
.result.lose h3 { color: #c9c2d6 !important; }
.result .big-stars { display: flex; justify-content: center; gap: 10px; margin: 6px 0 14px; }
.result .big-stars svg { width: 46px; height: 46px; animation: starPop .5s cubic-bezier(.2, 1.6, .4, 1) backwards; }
@keyframes starPop { from { transform: scale(0) rotate(-90deg); } }
.result .rew { display: flex; justify-content: center; gap: 22px; margin: 14px 0 4px; font-size: 18px; }
.result .rew span { display: inline-flex; align-items: center; gap: 4px; }
.result .rew img { width: 34px; height: 34px; }

/* portrait phones */
#rotate { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; text-align: center; padding: 30px; background: #0d0c12; color: var(--text); }
#rotate svg { width: 70px; height: 70px; color: var(--gold); margin-bottom: 16px; animation: tilt 2.4s ease-in-out infinite; }
@keyframes tilt { 50% { transform: rotate(-90deg); } }
#rotate p { font: 400 22px var(--serif); margin-bottom: 18px; }
#rotate button { color: var(--gold-2); border: 1px solid var(--line); padding: 10px 20px; font-size: 16px; }
@media (orientation: portrait) and (max-width: 820px) { body:not(.anyway) #rotate { display: grid; } }

@media (prefers-reduced-motion: reduce) {
  .mist, .dust, .ring, .lobby-hero, .altar-hero, .tab.on .spark, .port.ready { animation: none !important; }
}
