/* =====================================================================
   Echoes of the Divine — v0.4 "White-gold Sky" theme (bright fantasy).
   One stylesheet for the whole game. Design tokens first; reuse them.
   ===================================================================== */
:root {
  --sky-1: #a9dcff;
  --sky-2: #dff2ff;
  --sky-3: #f5fbff;
  --paper: #fffdf8;
  --ivory: #f7f3ea;
  --gold: #e8b54a;
  --gold-light: #ffd98a;
  --gold-deep: #c18a24;
  --navy: #1e2a44;
  --ink: #2f3d5c;
  --muted: #6d7a93;
  --line: rgba(30, 42, 68, .12);
  --line-gold: rgba(200, 146, 42, .45);
  --blue: #4a90e2;
  --green: #36a865;
  --red: #e0554b;
  --purple: #8e5bd6;
  --shadow: 0 12px 34px rgba(36, 74, 130, .16);
  --shadow-sm: 0 4px 14px rgba(36, 74, 130, .12);
  --radius: 18px;
  --serif: Georgia, 'Songti SC', 'STSong', serif;
  --sans: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.55 var(--sans); color: var(--ink); background: linear-gradient(var(--sky-1), var(--sky-3)); overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
button:disabled { opacity: .45; cursor: default; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { font-family: var(--serif); color: var(--navy); font-weight: 600; }
small { font-size: 11px; }
em { font-style: normal; }
input { font: inherit; color: var(--navy); background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 10px 14px; }
input:focus { border-color: var(--gold); outline: none; }
.grain { display: none; }
#app { height: 100dvh; }

/* ---------- buttons ---------- */
.button { position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 46px; padding: 10px 22px; border-radius: 14px; font-weight: 600; letter-spacing: .5px; transition: transform .15s, box-shadow .15s, filter .15s; }
.button small { font-size: 10px; font-weight: 500; opacity: .85; letter-spacing: 0; }
.button:not(:disabled):hover { transform: translateY(-2px); }
.button:not(:disabled):active { transform: translateY(1px); }
.button.gold { color: #fff; background: linear-gradient(180deg, #ffd06a, #e8a93a 55%, #d18f22); box-shadow: 0 4px 0 #b37619, 0 8px 18px rgba(209, 143, 34, .35); text-shadow: 0 1px 2px rgba(120, 70, 0, .45); }
.button.glass { color: var(--navy); background: #fff; border: 2px solid var(--line); box-shadow: 0 3px 0 rgba(30, 42, 68, .08); }
.button.danger { color: #fff; background: linear-gradient(180deg, #f07a6e, #d9473c); box-shadow: 0 4px 0 #a8352c; }
.button.big { min-height: 56px; font-size: 16px; padding: 12px 30px; }
.button.full { width: 100%; margin-top: 10px; }
.text-button { color: var(--gold-deep); font-weight: 600; }
.round-button, .language-button { white-space: nowrap; min-width: 38px; height: 38px; border-radius: 12px; background: #fff; color: var(--navy); border: 2px solid var(--line); font-weight: 600; font-size: 13px; padding: 0 8px; box-shadow: var(--shadow-sm); }
.eyebrow { font-size: 11px; letter-spacing: 3px; text-transform: uppercase; color: var(--gold-deep); font-weight: 700; }

/* ---------- rarity, realm, stars ---------- */
.rarity { font: italic 800 1em var(--serif); letter-spacing: .5px; }
.rarity.white { color: #7d8aa0; }
.rarity.blue { color: #2f80d8; }
.rarity.s { color: #8e5bd6; }
.rarity.ss { color: #e2871c; }
.rarity.sss { background: linear-gradient(90deg, #f2a81d, #ff6f91, #a46bff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.faction { color: var(--faction); font-weight: 700; font-size: 11px; letter-spacing: .5px; filter: saturate(1.3) brightness(.8); }
.stars { color: #f2b625; letter-spacing: 1px; font-size: 14px; text-shadow: 0 1px 0 #b37619; }
.stars i { color: #d6dbe5; text-shadow: none; font-style: normal; }
.portrait { background: url('../../assets/portraits.webp') no-repeat var(--x) var(--y) / 400% 300%; }
.v3-fullbody { aspect-ratio: 1 / 1; background: url('../../assets/fullbody.webp') no-repeat var(--x) var(--y) / 400% 300%; }
.v3-enemy-art { aspect-ratio: 1 / 1; background: url('../../assets/enemies.webp') no-repeat var(--x) var(--y) / 400% 200%; }
.avatar-svg { display: block; width: 100%; height: 100%; overflow: visible; }

/* ---------- shared widgets ---------- */
.v3-bar { display: block; height: 8px; border-radius: 8px; background: #e6edf5; overflow: hidden; margin: 4px 0; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .08); }
.v3-bar i { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, #5fd08f, #36a865); transition: width .4s; }
.v3-bar.xp i { background: linear-gradient(90deg, #a78bfa, #7c5ce0); }
.v3-bar.gold i { background: linear-gradient(90deg, #ffd06a, #e8a93a); }
.v3-bar.hp i { background: linear-gradient(90deg, #6ee39b, #36a865); }
.v3-bar.atk i { background: linear-gradient(90deg, #ff9a8a, #e0554b); }
.v3-bar.def i { background: linear-gradient(90deg, #8ec5ff, #4a90e2); }
.v3-dot { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--red); color: #fff; font: 700 11px/20px var(--sans); text-align: center; box-shadow: 0 0 0 2px #fff; font-style: normal; z-index: 2; }
.v3-rewards { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 12px 0; }
.v3-rewards > span { display: flex; align-items: center; gap: 6px; padding: 6px 12px; background: #fff; border: 2px solid var(--line); border-radius: 12px; }
.v3-rewards b { font-size: 16px; color: var(--gold-deep); font-weight: 400; }
.v3-rewards strong { color: var(--navy); }
.v3-rewards small { color: var(--muted); }
.v3-rewards .chip-xp b { color: var(--purple); }
.v3-rewards .chip-gems b { color: #e2a514; }
.v3-rewards.compact { justify-content: flex-start; gap: 5px; margin: 6px 0; }
.v3-rewards.compact > span { padding: 3px 8px; border-width: 1px; border-radius: 9px; font-size: 12px; }
.v3-rewards.compact small { display: none; }
.v3-levelups { display: flex; flex-direction: column; gap: 4px; align-items: center; margin: 6px 0 10px; }
.v3-levelup { color: var(--purple); font-weight: 600; }
.v3-levelup.unlock { color: var(--gold-deep); }
.v3-subhead { font-size: 12px; font-weight: 700; letter-spacing: 2px; color: var(--muted); text-transform: uppercase; margin: 18px 0 8px; }
.v3-hint { font-size: 12px; color: var(--muted); margin-top: 10px; }
.v3-ok { color: var(--green); font-weight: 600; }
.v3-modal-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.v3-modal-actions .button { flex: 1; min-width: 140px; }
.v3-modal-actions.center .button { flex: 0 1 auto; }
.v3-power { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 14px; margin: 10px 0; border-radius: 12px; background: #f3f7fc; font-size: 12px; color: var(--muted); }
.v3-power b { font: 700 17px var(--serif); margin-left: 6px; color: var(--navy); }
.v3-power.ok b { color: var(--green); }
.v3-power.low b { color: var(--red); }
.v3-chip { display: inline-flex; gap: 4px; align-items: center; padding: 4px 12px; border-radius: 20px; background: #fffffff0; border: 2px solid var(--line-gold); font-size: 11px; font-weight: 600; color: var(--navy); box-shadow: var(--shadow-sm); }
.v3-chip.tide { border-color: var(--faction); }
.v3-chip.blessing b { color: var(--gold-deep); font-weight: 400; }
.v3-battle-chips { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 6px; pointer-events: auto; }
.v3-link { color: var(--gold-deep); font-weight: 600; margin-top: 10px; }
.toggle { display: inline-flex; background: #eef3f9; border-radius: 12px; padding: 4px; gap: 4px; }
.toggle button { padding: 8px 18px; border-radius: 9px; font-weight: 600; color: var(--muted); }
.toggle button.on { background: #fff; color: var(--navy); box-shadow: var(--shadow-sm); }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 36px; height: 36px; border-radius: 50%; background: var(--c); border: 3px solid #fff; box-shadow: 0 0 0 2px var(--line); }
.swatch.on { box-shadow: 0 0 0 3px var(--gold); transform: scale(1.1); }
#toast { position: fixed; left: 50%; bottom: 34px; transform: translate(-50%, 20px); z-index: 60; max-width: min(90vw, 560px); padding: 12px 22px; border-radius: 14px; background: var(--navy); color: #fff; font-weight: 600; text-align: center; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .25s; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- top bar ---------- */
.topbar { position: absolute; inset: 0 0 auto; z-index: 20; height: 68px; display: flex; align-items: center; gap: 14px; padding: 0 22px; background: linear-gradient(#ffffffe6, #ffffffb3); border-bottom: 1px solid #ffffff; box-shadow: 0 4px 20px rgba(36, 74, 130, .1); backdrop-filter: blur(10px); }
.logo { display: flex; align-items: center; gap: 10px; text-align: left; }
.logo-mark { font-size: 30px; color: var(--gold); text-shadow: 0 2px 8px rgba(232, 181, 74, .5); }
.logo > span:last-child { font: 700 17px var(--serif); color: var(--navy); letter-spacing: 1px; }
.logo small { display: block; font: 600 8px var(--sans); letter-spacing: 2px; color: var(--muted); }
.v3-account { display: flex; align-items: center; gap: 10px; margin-left: 8px; margin-right: auto; padding: 4px 16px 4px 4px; background: #fff; border-radius: 40px; box-shadow: var(--shadow-sm); text-align: left; }
.v3-account-avatar { position: relative; width: 48px; height: 48px; border-radius: 50%; background: radial-gradient(circle at 50% 30%, #fff, color-mix(in srgb, var(--cls) 35%, #fff)); border: 3px solid var(--gold); overflow: hidden; flex-shrink: 0; }
.v3-account-avatar em { position: absolute; right: -2px; bottom: -2px; min-width: 22px; height: 20px; padding: 0 4px; border-radius: 10px; background: var(--navy); color: #fff; font: 700 11px/20px var(--sans); text-align: center; }
.v3-account-info { display: flex; flex-direction: column; min-width: 130px; }
.v3-account-info strong { color: var(--navy); font-size: 14px; }
.v3-account-info small { color: var(--muted); font-size: 10px; }
.v3-account-info .v3-bar { height: 6px; margin: 2px 0; }
.wallet { display: flex; align-items: center; gap: 8px; }
.v3-currency { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 8px; background: #fff; border-radius: 30px; box-shadow: var(--shadow-sm); font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.v3-currency i { font-style: normal; width: 24px; height: 24px; display: grid; place-content: center; border-radius: 50%; background: #fff4d8; color: var(--gold-deep); }
.v3-currency em { width: 20px; height: 20px; display: grid; place-content: center; border-radius: 50%; background: linear-gradient(#7bd88f, #36a865); color: #fff; font-size: 15px; line-height: 1; }

/* ---------- modal ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(30, 50, 90, .35); backdrop-filter: blur(6px); overflow-y: auto; animation: fade .2s; }
.modal-panel { position: relative; max-width: 100%; max-height: calc(100dvh - 40px); overflow-y: auto; background: var(--paper); border-radius: 24px; border-top: 6px solid var(--gold); box-shadow: 0 30px 80px rgba(20, 40, 80, .35); animation: pop .25s ease-out; }
.modal-close { position: absolute; right: 14px; top: 12px; z-index: 5; width: 36px; height: 36px; border-radius: 50%; background: #f1f4f9; color: var(--muted); font-size: 22px; line-height: 1; }
.story-modal, .result-modal, .confirm-modal { width: min(560px, 100%); padding: 34px 34px 28px; text-align: center; }
.wide-modal { width: min(820px, 100%) !important; }
.story-modal h2, .result-modal h2, .confirm-modal h2 { font-size: 28px; margin: 8px 0 12px; }
.story-text { color: var(--muted); line-height: 1.9; margin: 10px 0 16px; }
.story-symbol, .result-sigil { font-size: 56px; color: var(--gold); line-height: 1.3; text-shadow: 0 4px 18px rgba(232, 181, 74, .5); }
.v3-result .modal-close, .v3-bless-modal .modal-close { display: none; }
.v3-result-sub { color: var(--gold-deep); font-weight: 700; font-size: 15px; }
.v3-battle-stats { display: flex; justify-content: center; gap: 18px; font-size: 12px; color: var(--muted); }
.v3-battle-stats b { color: var(--navy); margin-left: 4px; }

/* ---------- title screen ---------- */
.title-screen { position: relative; height: 100dvh; overflow: hidden; display: flex; align-items: center; justify-content: center; isolation: isolate; }
.title-map { position: absolute; inset: 0; z-index: -4; background: url('../../assets/world-map.jpg') center 60% / cover; filter: saturate(1.15) brightness(1.08); animation: drift 40s ease-in-out infinite alternate; }
.title-sky { position: absolute; inset: 0; z-index: -3; background: radial-gradient(ellipse at 50% 30%, #ffffffd9, #ffffff80 35%, transparent 70%), linear-gradient(#bfe6ffcc, transparent 45%, #ffffff55); }
.title-cloud { position: absolute; z-index: -2; width: 420px; height: 120px; border-radius: 100px; background: radial-gradient(ellipse at 30% 60%, #fff, #ffffffcc 40%, transparent 70%), radial-gradient(ellipse at 70% 40%, #fff, transparent 60%); filter: blur(2px); animation: cloud 60s linear infinite; }
.title-cloud.c1 { top: 12%; left: -10%; }
.title-cloud.c2 { top: 62%; left: 60%; animation-duration: 80s; animation-delay: -30s; transform: scale(1.4); }
.title-cloud.c3 { top: 30%; left: 40%; animation-duration: 100s; animation-delay: -60s; opacity: .7; }
.title-hero { position: absolute; bottom: -2%; height: 82%; z-index: -1; filter: drop-shadow(0 20px 30px rgba(20, 50, 90, .35)); animation: float 6s ease-in-out infinite; }
.title-hero .v3-fullbody { height: 100%; }
.title-hero.left { left: 2%; }
.title-hero.right { right: 2%; animation-delay: -3s; transform: scaleX(-1); }
.title-center { display: flex; flex-direction: column; align-items: center; gap: 34px; }
.title-logo { text-align: center; }
.logo-star { display: block; font-size: 58px; color: var(--gold); text-shadow: 0 0 30px #fff, 0 4px 14px rgba(232, 181, 74, .7); animation: twinkle 3s ease-in-out infinite; }
.title-logo h1 { font-size: clamp(40px, 6vw, 76px); letter-spacing: 3px; color: #fff; text-shadow: 0 3px 0 var(--gold-deep), 0 0 18px rgba(30, 60, 110, .55), 0 6px 30px rgba(30, 60, 110, .5); }
.title-logo p { margin-top: 8px; font-weight: 700; letter-spacing: 5px; color: var(--navy); font-size: 13px; }
.title-menu { display: flex; flex-direction: column; gap: 12px; width: min(340px, 86vw); padding: 22px; border-radius: 26px; background: #ffffffcc; backdrop-filter: blur(8px); box-shadow: var(--shadow); }
.title-menu .button { width: 100%; }
.title-foot { position: absolute; bottom: 16px; left: 0; right: 0; display: flex; justify-content: center; align-items: center; gap: 14px; font-size: 12px; color: var(--navy); font-weight: 600; }
.slots-modal { width: min(620px, 100%); padding: 32px; text-align: center; }
.slot-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; text-align: left; }
.slot-card { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 18px; background: #fff; border: 2px solid var(--line); }
.slot-card.active { border-color: var(--gold); box-shadow: 0 0 0 4px #ffe8b5; }
.slot-card.empty { justify-content: center; flex-direction: column; gap: 2px; border-style: dashed; color: var(--muted); min-height: 86px; }
.slot-card.empty b { font-size: 26px; color: var(--gold); }
.slot-avatar { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; background: radial-gradient(#fff, #e3f2ff); border: 3px solid var(--gold); flex-shrink: 0; display: grid; place-content: center; }
.slot-info { flex: 1; display: flex; flex-direction: column; }
.slot-info strong { font: 700 18px var(--serif); color: var(--navy); }
.slot-info small { color: var(--muted); }
.slot-actions { display: flex; gap: 6px; align-items: center; }
.slot-actions .button { min-height: 40px; padding: 6px 20px; }
.slot-delete { width: 38px; height: 38px; border-radius: 10px; background: #fbeeee; }

/* ---------- character creation ---------- */
.create-screen, .v3-screen { position: relative; height: 100dvh; overflow-y: auto; isolation: isolate; }
.create-screen { padding: 22px clamp(14px, 4vw, 60px) 40px; }
.create-sky, .v3-screen::before { content: ''; position: fixed; inset: 0; z-index: -2; background: radial-gradient(ellipse at 20% 0%, #ffffffcc, transparent 50%), radial-gradient(ellipse at 90% 10%, #fff6dccc, transparent 40%), linear-gradient(#a9dcff, #e4f4ff 45%, #fbf8f1); }
.v3-screen::after { content: ''; position: fixed; left: 0; right: 0; bottom: 0; height: 40%; z-index: -1; background: linear-gradient(transparent, #dff3d8 70%, #c9ebb8); pointer-events: none; }
.create-head { display: flex; align-items: center; gap: 18px; margin-bottom: 14px; }
.create-head > div { flex: 1; }
.create-head h1 { font-size: clamp(26px, 3vw, 38px); }
.create-note { margin: 0 0 14px; padding: 10px 16px; border-radius: 12px; background: #e8f8ee; color: #22744a; font-weight: 600; }
.create-layout, .player-layout { display: grid; grid-template-columns: minmax(260px, 38%) 1fr; gap: 26px; align-items: start; }
.create-preview { position: sticky; top: 10px; height: min(78vh, 640px); border-radius: 28px; background: radial-gradient(ellipse at 50% 70%, color-mix(in srgb, var(--cls) 30%, #fff), #fff 70%); box-shadow: var(--shadow); overflow: hidden; }
.preview-glow { position: absolute; inset: 10% 10% 30%; border-radius: 50%; background: radial-gradient(color-mix(in srgb, var(--cls) 35%, #fff), transparent 70%); filter: blur(10px); animation: pulse 3s ease-in-out infinite; }
.preview-figure { position: absolute; left: 50%; bottom: 14%; height: 78%; aspect-ratio: 240 / 360; transform: translateX(-50%); animation: float 4s ease-in-out infinite; }
.preview-pedestal { position: absolute; left: 20%; right: 20%; bottom: 10%; height: 7%; border-radius: 50%; background: radial-gradient(color-mix(in srgb, var(--cls) 45%, #fff), transparent 70%); }
.preview-name { position: absolute; left: 0; right: 0; bottom: 18px; text-align: center; }
.preview-name strong { display: block; font: 700 26px var(--serif); color: var(--navy); }
.preview-name small { color: var(--muted); font-weight: 600; font-size: 13px; }
.create-panel { display: flex; flex-direction: column; gap: 10px; padding: 24px; border-radius: 28px; background: #ffffffd9; backdrop-filter: blur(8px); box-shadow: var(--shadow); }
.step { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.step-n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-content: center; background: var(--gold); color: #fff; font-weight: 800; }
.step h2 { font-size: 20px; }
.class-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.class-card { display: flex; flex-direction: column; align-items: center; padding: 10px 6px 12px; border-radius: 18px; background: #fff; border: 3px solid transparent; box-shadow: var(--shadow-sm); transition: .15s; }
.class-card:not(:disabled):hover { transform: translateY(-3px); }
.class-card.selected { border-color: var(--cls); background: color-mix(in srgb, var(--cls) 10%, #fff); }
.class-thumb { width: 74px; height: 74px; border-radius: 50%; overflow: hidden; background: radial-gradient(#fff, color-mix(in srgb, var(--cls) 25%, #fff)); margin-bottom: 6px; }
.class-card strong { color: var(--navy); font-size: 14px; }
.class-card small { color: var(--muted); font-size: 11px; text-align: center; }
.class-detail { padding: 16px; border-radius: 18px; background: color-mix(in srgb, var(--cls) 7%, #fff); border: 2px solid color-mix(in srgb, var(--cls) 30%, #fff); }
.class-head { display: flex; align-items: center; gap: 12px; }
.class-head > b { width: 48px; height: 48px; border-radius: 14px; display: grid; place-content: center; font-size: 24px; color: #fff; background: var(--cls); font-weight: 400; }
.class-head > div { flex: 1; }
.class-head h3 { font-size: 22px; }
.class-head p { color: var(--muted); font-size: 13px; }
.difficulty { font-size: 12px; color: var(--gold-deep); font-weight: 700; }
.class-desc { margin: 10px 0; color: var(--ink); }
.class-cols { display: grid; grid-template-columns: 1fr 1.6fr; gap: 16px; }
.stat-bar { display: grid; grid-template-columns: 48px 1fr 40px; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.stat-bar b { color: var(--navy); text-align: right; }
.skill-block { padding: 10px 12px; border-radius: 12px; background: #fff; margin-bottom: 8px; }
.skill-block > span { font-size: 11px; font-weight: 700; color: var(--gold-deep); letter-spacing: 1px; }
.skill-block.passive > span { color: var(--purple); }
.skill-block h4 { font: 700 16px var(--serif); color: var(--navy); margin: 2px 0; }
.skill-block p { font-size: 12px; color: var(--muted); }
.rank-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.rank-list li { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: var(--muted); }
.rank-list li b { min-width: 26px; height: 20px; border-radius: 6px; background: #eef3f9; color: var(--navy); display: grid; place-content: center; font: 700 11px var(--serif); }
.rank-list li.on b { background: var(--gold); color: #fff; }
.rank-list li.locked { opacity: .55; }
.rank-list small { font-weight: 700; color: var(--ink); }
.look-row { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.name-row { display: flex; gap: 8px; }
.name-row input { flex: 1; font-size: 16px; }
.begin { margin-top: 8px; }
.look-modal { display: grid; grid-template-columns: 160px 1fr; gap: 18px; align-items: center; text-align: left; }
.look-modal > div:last-child { display: flex; flex-direction: column; gap: 14px; }
.look-figure { height: 230px; }
.player-screen .create-preview { height: min(70vh, 600px); }
.welcome-figure { width: 140px; height: 200px; margin: 0 auto -6px; }

/* ---------- panel screens ---------- */
.v3-screen { padding: 86px clamp(14px, 4vw, 60px) 50px; }
.v3-panel-head { display: flex; align-items: flex-end; gap: 20px; margin: 4px 0 22px; }
.v3-panel-head h1 { font-size: clamp(28px, 3.2vw, 42px); }
.v3-panel-head p { color: var(--muted); }
.v3-back { padding: 10px 18px; border-radius: 12px; background: #fff; color: var(--navy); font-weight: 600; box-shadow: var(--shadow-sm); flex-shrink: 0; }
.v3-tabs { display: flex; gap: 6px; margin-bottom: 18px; padding: 5px; border-radius: 16px; background: #ffffffb3; width: fit-content; box-shadow: var(--shadow-sm); }
.v3-tabs button { position: relative; padding: 10px 22px; border-radius: 12px; font-weight: 700; color: var(--muted); }
.v3-tabs button.active { background: linear-gradient(180deg, #ffd06a, #e8a93a); color: #fff; text-shadow: 0 1px 1px rgba(120, 70, 0, .4); }
.v3-empty { max-width: 460px; margin: 50px auto; text-align: center; padding: 36px; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.v3-empty b { font-size: 44px; display: block; }
.v3-empty p { color: var(--muted); margin: 10px 0 18px; }
.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------- world map ---------- */
.world-screen { position: relative; height: 100dvh; overflow: hidden; overflow: clip; isolation: isolate; }
.map-art { position: absolute; inset: 0; z-index: -5; width: 100%; height: 100%; display: block; background: #56b9ef; animation: map-in 1.2s ease-out both; }
.map-vignette { position: absolute; inset: 0; z-index: -3; background: linear-gradient(#ffffff59, transparent 22%, transparent 78%, #ffffff40); pointer-events: none; }
.map-cloud { position: absolute; inset: -10%; z-index: 1; pointer-events: none; background: radial-gradient(ellipse at 20% 40%, #ffffff66, transparent 30%), radial-gradient(ellipse at 75% 65%, #ffffff55, transparent 22%); animation: drift 40s ease-in-out infinite alternate; }
.cloud-two { animation-delay: -15s; opacity: .6; transform: scale(1.4); }
.world-title { position: absolute; top: 88px; left: 4%; pointer-events: none; }
.world-title > span { font-size: 11px; font-weight: 700; letter-spacing: 5px; color: #fff; text-shadow: 0 1px 4px rgba(20, 40, 80, .6); }
.world-title h1 { font-size: 34px; color: #fff; margin: 4px 0; text-shadow: 0 2px 0 var(--gold-deep), 0 4px 16px rgba(20, 40, 80, .5); }
.world-title p { color: #fff; font-weight: 600; text-shadow: 0 1px 4px rgba(20, 40, 80, .7); }
.map-label { position: absolute; font: italic 700 12px var(--serif); letter-spacing: 4px; color: #fff; text-shadow: 0 1px 4px rgba(20, 40, 80, .8); pointer-events: none; opacity: .9; }
.label-mortal { left: 7%; top: 52%; } .label-sea { left: 31%; top: 78%; } .label-sky { left: 60%; top: 22%; } .label-under { left: 79%; top: 16%; }
.map-locations, .map-routes { position: absolute; inset: 90px 5% 125px; width: 90%; height: calc(100% - 215px); }
.map-routes { pointer-events: none; overflow: visible; z-index: 2; }
.map-routes path { fill: none; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.route-dark { stroke: #ffffffb3; stroke-width: 8; stroke-dasharray: 2 12; }
.route-lit { stroke: #ffd06a; stroke-width: 6; filter: drop-shadow(0 0 6px #fff3c4); stroke-dasharray: 12 10; animation: route 3s linear infinite; }
.map-locations { z-index: 4; pointer-events: none; }
.map-node { position: absolute; transform: translate(-50%, -50%); width: 58px; height: 58px; padding: 0; border-radius: 50%; pointer-events: auto; color: var(--navy); background: radial-gradient(circle at 40% 30%, #fff, #e6f2ff); border: 4px solid #fff; box-shadow: 0 5px 0 #9fb9d6, 0 10px 22px rgba(20, 50, 90, .35); transition: transform .15s; }
.map-node:not(:disabled):hover { transform: translate(-50%, -58%) scale(1.08); }
.map-node b { font: 800 19px var(--serif); }
.map-node .node-orbit { position: absolute; inset: -9px; border-radius: 50%; border: 2px dashed #ffffffaa; }
.map-node.completed { background: radial-gradient(circle at 40% 30%, #c9f5d8, #5cc489); color: #fff; box-shadow: 0 5px 0 #2f8a57, 0 10px 22px rgba(20, 50, 90, .3); }
.map-node:disabled { opacity: 1; }
.map-node.locked { background: radial-gradient(circle at 40% 30%, #f4f7fb, #b9c6d6); color: #5d6b80; box-shadow: 0 5px 0 #8796ab, 0 8px 16px rgba(20, 50, 90, .3); }
.map-node.locked .node-caption { opacity: .85; }
.map-node.current { width: 72px; height: 72px; background: radial-gradient(circle at 40% 30%, #fff6d6, #ffc94d); color: #7a4a00; box-shadow: 0 6px 0 #c18a24, 0 0 0 8px #ffffff66, 0 0 40px #ffe08a; }
.map-node.current .node-orbit { border-color: #fff; animation: spin 8s linear infinite; }
.final-node { border-radius: 20px; background: radial-gradient(circle at 40% 30%, #f6e6ff, #b98cf0) !important; color: #fff !important; }
.node-caption { position: absolute; top: calc(100% + 12px); left: 50%; transform: translateX(-50%); white-space: nowrap; padding: 4px 12px; border-radius: 10px; background: #ffffffe6; box-shadow: var(--shadow-sm); text-align: center; }
.node-caption small { display: block; font-size: 9px; font-weight: 700; letter-spacing: 2px; color: var(--gold-deep); }
.node-caption strong { font-size: 12px; color: var(--navy); }
.map-node em { position: absolute; bottom: calc(100% + 16px); left: 50%; transform: translateX(-50%); white-space: nowrap; padding: 4px 12px; border-radius: 10px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: 1px; box-shadow: 0 3px 0 #a8352c; animation: bob 1.4s ease-in-out infinite; }
.map-progress { position: absolute; left: 26px; bottom: 148px; display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-radius: 16px; background: #ffffffe6; box-shadow: var(--shadow); }
.map-progress > span { font-size: 26px; color: var(--gold); }
.map-progress small { display: block; font-size: 10px; font-weight: 700; letter-spacing: 2px; color: var(--muted); }
.map-progress strong { font: 800 22px var(--serif); color: var(--navy); }
.map-current { position: absolute; right: 26px; bottom: 26px; z-index: 5; width: min(380px, 40vw); padding: 20px 22px; border-radius: 24px; background: #ffffffeb; box-shadow: var(--shadow); }
.map-current h2 { font-size: 26px; margin: 4px 0; }
.map-current p { color: var(--muted); font-size: 13px; }
.map-current .button { width: 100%; }
.v3-rail { position: absolute; top: 86px; right: 22px; z-index: 6; display: flex; flex-direction: column; gap: 10px; }
.v3-rail-btn { position: relative; width: 66px; height: 66px; border-radius: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: linear-gradient(#fff, #eef6ff); border: 3px solid #fff; box-shadow: var(--shadow); }
.v3-rail-btn b { font-size: 24px; color: var(--gold-deep); font-weight: 400; line-height: 1.1; }
.v3-rail-btn span { font-size: 10px; font-weight: 700; color: var(--navy); }
.v3-dock { position: absolute; left: 22px; bottom: 22px; z-index: 5; display: flex; gap: 8px; padding: 10px; border-radius: 26px; background: #ffffffd9; backdrop-filter: blur(8px); box-shadow: var(--shadow); }
.dock-btn { position: relative; width: 78px; height: 78px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 18px; background: linear-gradient(#fff, #edf5ff); box-shadow: 0 3px 0 #c8d7ea; transition: transform .15s; }
.dock-btn:hover { transform: translateY(-3px); }
.dock-btn b { font-size: 28px; line-height: 1; color: var(--gold-deep); font-weight: 400; }
.dock-btn span { font-size: 12px; font-weight: 700; color: var(--navy); }
.dock-btn.hero-btn b { width: 46px; height: 46px; border-radius: 50%; overflow: hidden; background: radial-gradient(#fff, #ffe8b5); border: 2px solid var(--gold); }
.v3-stage-modal { width: min(560px, 100%) !important; }
.v3-stage-art { width: 170px; height: 170px; margin: -6px auto 0; }
.v3-stage-art .v3-enemy-art { height: 100%; transform: scaleX(-1); filter: drop-shadow(0 10px 12px rgba(20, 40, 80, .3)); }
.v3-enemy-line { display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.v3-enemy-line strong { color: var(--navy); }
.v3-enemy-line em { color: var(--red); font-weight: 700; }
.v3-welcome-steps { display: flex; flex-direction: column; gap: 8px; max-width: 360px; margin: 0 auto; text-align: left; }
.v3-welcome-steps span { display: flex; gap: 10px; align-items: center; font-weight: 600; color: var(--navy); }
.v3-welcome-steps b { width: 26px; height: 26px; border-radius: 50%; display: grid; place-content: center; background: var(--gold); color: #fff; }

/* ---------- battle ---------- */
.cinema-battle { position: relative; height: 100dvh; overflow: hidden; isolation: isolate; background: #cfe9ff; }
.battle-landscape { position: absolute; inset: 0; z-index: -5; background: url('../../assets/battle-landscape.jpg') center / cover; filter: brightness(1.28) saturate(1.15) contrast(.95); }
.realm-sea .battle-landscape { filter: brightness(1.3) saturate(1.2) hue-rotate(-8deg); }
.realm-sky .battle-landscape { filter: brightness(1.38) saturate(1.05) sepia(.18); }
.realm-under .battle-landscape { filter: brightness(1.2) saturate(1.15) hue-rotate(18deg); }
.battle-depth { position: absolute; inset: 0; z-index: -3; background: linear-gradient(#bfe6ffb3, #ffffff33 30%, transparent 55%, #ffffff26); pointer-events: none; }
.battle-fog { position: absolute; inset: 30% -20% 10%; z-index: -2; background: radial-gradient(ellipse at 30% 70%, #ffffff40, transparent 45%); animation: drift 20s infinite alternate; pointer-events: none; }
.battle-head { position: absolute; top: 80px; left: 22px; right: 22px; z-index: 8; display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; }
.battle-head > div { text-align: center; }
.battle-head .eyebrow { color: #fff; text-shadow: 0 1px 4px rgba(20, 40, 80, .8); }
.battle-head h1 { font-size: 28px; color: #fff; text-shadow: 0 2px 0 var(--gold-deep), 0 4px 14px rgba(20, 40, 80, .6); }
.scene-back, .battle-toggles button { pointer-events: auto; padding: 9px 16px; border-radius: 12px; background: #ffffffe6; color: var(--navy); font-weight: 700; box-shadow: var(--shadow-sm); }
.battle-toggles { display: flex; gap: 8px; pointer-events: auto; }
.battle-toggles .enabled { background: linear-gradient(#ffd06a, #e8a93a); color: #fff; }
.combat-board { position: absolute; inset: 140px 0 180px; z-index: 3; }
.combat-units { position: absolute; inset: 0; isolation: isolate; }
.fighter { position: absolute; left: var(--ux); top: var(--uy); transform: translate(-50%, -70%); width: clamp(190px, 29vh, 430px); height: clamp(190px, 29vh, 430px); padding: 0; z-index: var(--depth, 4); }
.fighter.is-boss { width: clamp(250px, 40vh, 580px); height: clamp(250px, 40vh, 580px); }
.fighter-move, .fighter-body { position: absolute; inset: 0; display: block; pointer-events: none; }
.fighter-body { transform-origin: 50% 85%; animation: breathe 3.6s ease-in-out infinite; animation-delay: var(--stagger); }
.body-sprite { position: absolute; inset: 0; background-repeat: no-repeat; background-position: var(--sx) var(--sy); filter: drop-shadow(0 10px 6px rgba(20, 40, 80, .3)); }
.full-sprite { background-image: url('../../assets/fullbody.webp'); background-size: 400% 300%; }
.pose-sprite { background-image: url('../../assets/actions.webp'); background-size: 600% 300%; }
.pose-sprite.sheet-1 { background-image: url('../../assets/actions-divine.webp'); }
.pose-sprite.sheet-2 { background-image: url('../../assets/actions-allies.webp'); }
.pose-sprite.sheet-3 { background-image: url('../../assets/actions-dusk-v2.webp'); }
.enemy-sprite { background-image: url('../../assets/enemies.webp'); background-size: 400% 200%; transform: scaleX(-1); }
.avatar-sprite { inset: 2% 16% 4%; }
.fighter.performing { z-index: 110 !important; }
.fighter.performing .fighter-body { animation: none; }
.ground-shadow { position: absolute; bottom: 5%; left: 20%; right: 20%; height: 8%; border-radius: 50%; background: rgba(20, 40, 70, .28); filter: blur(4px); }
.selection-ring { position: absolute; bottom: 6%; left: 18%; right: 18%; height: 9%; border-radius: 50%; border: 3px solid transparent; }
.is-selected .selection-ring { border-color: #ffd06a; box-shadow: 0 0 18px #ffd06a; animation: pulse 1.6s infinite; }
.foe.is-selected .selection-ring { border-color: #ff8a7a; box-shadow: 0 0 18px #ff8a7a; }
.fighter-vitals { position: absolute; left: 14%; right: 14%; top: 100%; text-align: center; line-height: 1.2; pointer-events: none; }
.fighter-tag { display: inline-block; padding: 2px 10px; border-radius: 10px; background: #ffffffe6; color: var(--navy); font-weight: 700; font-size: 12px; white-space: nowrap; box-shadow: var(--shadow-sm); }
.fighter-tag em { color: var(--gold-deep); font-size: .85em; }
.fighter-vitals .hp-track { display: block; height: 8px; max-width: 160px; margin: 5px auto 2px; border-radius: 6px; background: #ffffffcc; border: 2px solid #fff; overflow: hidden; }
.hp-track i { display: block; height: 100%; background: linear-gradient(90deg, #6ee39b, #36a865); transition: width .35s; }
.fighter.foe .hp-track i { background: linear-gradient(90deg, #ff9a8a, #e0554b); }
.energy-track { display: block; height: 5px; max-width: 160px; margin: 3px auto 0; border-radius: 4px; background: #ffffffaa; overflow: hidden; }
.energy-track i { display: block; height: 100%; background: linear-gradient(90deg, #8ec5ff, #4a90e2); transition: width .35s; }
.energy-track.full i { background: linear-gradient(90deg, #ffd06a, #f2a81d); box-shadow: 0 0 8px #ffd06a; }
.fighter-vitals small { display: block; font-size: 10px; font-weight: 700; color: #fff; text-shadow: 0 1px 3px rgba(20, 40, 80, .9); }
.fighter-status { display: block; margin-top: 3px; font-size: 10px; font-weight: 800; color: #ffe08a; text-shadow: 0 1px 3px #000; }
.fighter.fallen { opacity: .25; pointer-events: none; z-index: 1; }
.fighter.fallen .fighter-body { transform: translateY(30%) rotate(70deg); animation: none; filter: grayscale(1); }
.fighter.fallen .fighter-vitals, .fighter.fallen .ground-shadow { opacity: 0; }
.fighter.spent:not(.performing) .fighter-body { filter: saturate(.6) brightness(.95); }
.stun-stars { position: absolute; top: 0; left: 30%; font-size: 22px; color: #ffd06a; text-shadow: 0 0 8px #fff; animation: bob 1.2s infinite; }
.ward-bubble { position: absolute; inset: 6% 14% 2%; border-radius: 50%; border: 2px solid #9fe0ff; background: radial-gradient(ellipse, transparent 50%, #bfeaff33 80%); box-shadow: 0 0 20px #9fe0ff66; animation: pulse 3s infinite; pointer-events: none; }
.battle-turn { position: absolute; top: 10px; left: 22px; padding: 8px 16px; border-radius: 14px; background: #ffffffe6; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; z-index: 2; pointer-events: none; }
.battle-turn > span { font-size: 9px; font-weight: 800; letter-spacing: 2px; color: var(--gold-deep); }
.battle-turn strong { font: 800 16px var(--serif); color: var(--navy); }
.battle-turn small { color: var(--muted); font-weight: 600; }
.boss-bar { position: absolute; top: 8px; left: 33%; right: 22%; z-index: 5; text-align: center; pointer-events: none; }
.boss-bar > span { font-weight: 800; letter-spacing: 2px; color: #fff; text-shadow: 0 1px 4px rgba(80, 0, 0, .8); }
.boss-bar > div { height: 12px; margin: 4px 0 2px; border-radius: 8px; background: #ffffffaa; border: 2px solid #fff; overflow: hidden; }
.boss-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ff7a8a, #d9334b); transition: width .4s; }
.boss-bar > small { font-weight: 700; color: #fff; text-shadow: 0 1px 3px #000; }
.combat-hud { position: absolute; left: 22px; right: 22px; bottom: 28px; z-index: 8; display: flex; gap: 16px; align-items: flex-end; pointer-events: none; }
.party-hud { display: flex; gap: 8px; pointer-events: auto; }
.party-chip { position: relative; display: flex; align-items: center; gap: 8px; width: 156px; padding: 6px 10px 6px 6px; border-radius: 16px; background: #ffffffeb; border: 3px solid transparent; box-shadow: var(--shadow-sm); text-align: left; }
.party-chip .portrait, .chip-avatar { width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0; overflow: hidden; }
.chip-avatar { background: radial-gradient(#fff, #ffe8b5); }
.party-chip > div:not(.portrait):not(.chip-avatar) { flex: 1; min-width: 0; }
.party-chip strong { font-size: 12px; color: var(--navy); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.party-chip small { font-size: 9px; font-weight: 800; color: var(--green); letter-spacing: .5px; }
.party-chip .hp-track { height: 5px; margin: 3px 0 0; border-radius: 4px; background: #e6edf5; }
.party-chip .energy-track { height: 4px; margin: 2px 0 0; background: #e6edf5; }
.party-chip > em { position: absolute; right: 8px; top: 6px; font-size: 10px; font-weight: 800; color: var(--blue); }
.party-chip.active { border-color: var(--gold); box-shadow: 0 0 0 3px #ffe8b5, var(--shadow-sm); }
.party-chip.used small { color: var(--muted); }
.party-chip.knocked-out { opacity: .45; filter: grayscale(1); }
.command-panel { margin-left: auto; display: flex; gap: 16px; align-items: center; max-width: 700px; padding: 14px 18px; border-radius: 22px; background: #ffffffeb; box-shadow: var(--shadow); pointer-events: auto; }
.command-description { max-width: 280px; }
.command-description > small { font-size: 9px; font-weight: 800; letter-spacing: 2px; color: var(--gold-deep); }
.command-description h3 { font-size: 20px; }
.command-description p { font-size: 12px; color: var(--muted); line-height: 1.5; }
.v3-passive-line { color: var(--purple) !important; }
.command-buttons { display: flex; gap: 10px; }
.command-buttons button { display: flex; align-items: center; gap: 10px; min-width: 150px; min-height: 68px; padding: 10px 16px; border-radius: 18px; text-align: left; font-weight: 700; transition: transform .15s; }
.command-buttons button:not(:disabled):hover { transform: translateY(-2px); }
.command-buttons b { font-size: 28px; font-weight: 400; }
.command-buttons small { display: block; font-size: 10px; font-weight: 600; opacity: .85; }
.attack-command { background: #fff; color: var(--navy); border: 3px solid var(--line); box-shadow: 0 4px 0 #c8d7ea; }
.skill-command { color: #fff; background: linear-gradient(180deg, #ffd06a, #e8a93a 55%, #d18f22); box-shadow: 0 4px 0 #b37619, 0 0 22px #ffd06a88; text-shadow: 0 1px 2px rgba(120, 70, 0, .45); }
.combat-caption { position: absolute; left: 0; right: 0; bottom: 6px; z-index: 8; text-align: center; font-size: 12px; font-weight: 600; color: #fff; text-shadow: 0 1px 3px rgba(20, 40, 80, .9); pointer-events: none; }
#combat-fx { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 12; pointer-events: none; }
.skill-announcement { position: absolute; top: 22%; left: 4%; z-index: 14; width: min(460px, 60%); padding: 14px 24px; border-radius: 18px; background: linear-gradient(90deg, #ffffffee, #ffffffaa 70%, transparent); border-left: 6px solid var(--spell-color); box-shadow: var(--shadow); pointer-events: none; }
.skill-announcement > small { font-size: 10px; font-weight: 800; letter-spacing: 3px; color: var(--gold-deep); }
.skill-announcement > strong { display: block; font: 800 30px var(--serif); color: var(--navy); }
.skill-announcement > span { font-weight: 600; color: var(--muted); }
.wave-announcement { position: absolute; top: 24%; left: 0; right: 0; z-index: 16; padding: 22px; text-align: center; background: linear-gradient(90deg, transparent, #ffffffee 25%, #ffffffee 75%, transparent); pointer-events: none; animation: pop .5s ease-out; }
.wave-announcement > span { display: block; font-size: 11px; font-weight: 800; letter-spacing: 4px; color: var(--gold-deep); }
.wave-announcement > strong { display: block; font: 800 40px var(--serif); color: var(--navy); letter-spacing: 3px; }
.wave-announcement > small { font-weight: 600; color: var(--muted); }

/* ---------- heroes ---------- */
.v3-formation { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 22px; padding: 20px; margin-bottom: 18px; border-radius: 24px; background: #ffffffd9; box-shadow: var(--shadow); }
.v3-formation-info h3 { font-size: 22px; margin: 4px 0; }
.v3-formation-info h3 b { color: var(--gold-deep); }
.v3-formation-info p { font-size: 13px; color: var(--muted); margin-top: 6px; }
.v3-items { color: var(--navy) !important; font-weight: 600; }
.v3-slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.v3-slot { position: relative; height: 180px; border-radius: 18px; overflow: hidden; padding: 0; text-align: left; background: radial-gradient(ellipse at 50% 85%, #ffe8b5, #f4f9ff 70%); border: 3px solid #fff; box-shadow: var(--shadow-sm); }
.v3-slot.leader { background: radial-gradient(ellipse at 50% 85%, color-mix(in srgb, var(--cls) 35%, #fff), #fff 70%); border-color: var(--gold); }
.v3-slot .v3-fullbody { position: absolute; left: 50%; translate: -50% 0; bottom: 34px; height: calc(100% - 34px); }
.v3-slot.leader .avatar-svg { position: absolute; left: 50%; translate: -50% 0; bottom: 30px; height: calc(100% - 30px); width: auto; }
.v3-slot-info { position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 10px; background: #ffffffeb; }
.v3-slot strong { display: block; font: 700 15px var(--serif); color: var(--navy); }
.v3-slot small { color: var(--muted); font-size: 11px; }
.v3-slot > span { position: absolute; top: 6px; left: 10px; font: 800 18px var(--serif); color: var(--gold-deep); }
.v3-slot.empty { display: grid; place-content: center; color: var(--muted); font-weight: 600; border: 3px dashed #c8d7ea; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 16px; }
.filters button { padding: 8px 16px; border-radius: 20px; background: #fff; font-weight: 700; color: var(--muted); box-shadow: var(--shadow-sm); }
.filters button.active { background: var(--navy); color: #fff; }
.filters > span { margin-left: auto; color: var(--muted); font-weight: 600; }
.hero-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.hero-card { position: relative; aspect-ratio: .68; overflow: hidden; padding: 0; text-align: left; border-radius: 18px; background: #fff; border: 4px solid #fff; box-shadow: var(--shadow-sm); transition: transform .15s; }
.hero-card:hover { transform: translateY(-4px); }
.hero-card.sss { border-color: #ffd06a; box-shadow: 0 0 0 2px #f2a81d, 0 0 20px #ffd06a88; }
.hero-card.ss { border-color: #ffcf8a; }
.hero-card.s { border-color: #d8c2ff; }
.hero-card.unowned .portrait { filter: grayscale(.7) brightness(1.05); opacity: .8; }
.hero-card .portrait { position: absolute; inset: 0 0 auto; aspect-ratio: 1; }
.card-rarity { position: absolute; top: 6px; left: 8px; z-index: 1; font-size: 20px; text-shadow: 0 0 6px #fff, 0 0 2px #fff; }
.deployed { position: absolute; top: 8px; right: 8px; z-index: 1; padding: 2px 8px; border-radius: 8px; background: var(--green); color: #fff; font-size: 10px; font-weight: 800; }
.card-info { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 10px 8px; background: linear-gradient(transparent, #fff 28%); z-index: 1; }
.card-info > .faction { display: block; font-size: 10px; }
.card-info > small { display: block; font-size: 9px; color: var(--muted); }
.card-info strong { display: block; font: 700 17px var(--serif); color: var(--navy); }
.card-info .stars { font-size: 11px; }
.card-info > span:last-child { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
.card-info em { float: right; font-size: 10px; }
.v3-hero-detail { width: min(980px, 100%); padding: 0 !important; }
.v3-detail { display: grid; grid-template-columns: 42% 1fr; min-height: 560px; }
.v3-detail-art { position: relative; overflow: hidden; background: radial-gradient(ellipse at 50% 75%, color-mix(in srgb, var(--faction) 45%, #fff), #f4f9ff 70%); }
.v3-detail-art .v3-fullbody { position: absolute; left: 50%; translate: -50% 0; bottom: 3%; height: 92%; filter: drop-shadow(0 16px 16px rgba(20, 40, 80, .3)); animation: float 5s ease-in-out infinite; }
.v3-detail-glow { position: absolute; left: 12%; right: 12%; bottom: 3%; height: 9%; border-radius: 50%; background: radial-gradient(color-mix(in srgb, var(--faction) 50%, #fff), transparent 70%); }
.v3-detail-copy { padding: 30px 30px 26px; text-align: left; }
.v3-detail-copy h2 { font-size: 34px; margin: 2px 0; }
.v3-detail-copy blockquote { margin: 6px 0 12px; font: italic 13px var(--serif); color: var(--muted); }
.detail-top { display: flex; gap: 10px; align-items: center; }
.v3-role { font-size: 11px; font-weight: 700; color: var(--muted); padding: 2px 10px; border-radius: 8px; background: #eef3f9; }
.v3-level { margin: 6px 0 12px; }
.v3-level span { color: var(--muted); }
.v3-level b { font: 800 22px var(--serif); color: var(--navy); }
.v3-level small { color: var(--muted); }
.stat-grid, .v3-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 8px 0; }
.v3-stats span { padding: 10px; border-radius: 14px; background: #f3f7fc; text-align: center; }
.v3-stats small { display: block; color: var(--muted); font-weight: 700; }
.v3-stats b { font: 800 20px var(--serif); color: var(--navy); }
.v3-skill { padding: 12px 14px; margin: 8px 0; border-radius: 14px; background: #fffaf0; border: 2px solid #ffeccb; }
.v3-skill > span { font-size: 11px; font-weight: 800; color: var(--gold-deep); letter-spacing: 1px; }
.v3-skill h3 { font-size: 17px; margin: 2px 0; }
.v3-skill p { font-size: 12px; color: var(--muted); }
.v3-skill.passive { background: #f7f2ff; border-color: #e6d9ff; }
.v3-skill.passive > span { color: var(--purple); }
.v3-skill.locked { opacity: .55; }
.copies { font-size: 12px; color: var(--muted); }
.v3-train { display: flex; gap: 8px; margin-top: 10px; }
.v3-train .button:first-child { flex: 1; }
.v3-swap { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; font-size: 12px; color: var(--muted); }
.v3-swap button { width: 70px; padding: 4px; border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; align-items: center; }
.v3-swap .portrait { width: 54px; height: 54px; border-radius: 10px; }
.v3-swap small { color: var(--navy); font-weight: 600; }

/* ---------- summon ---------- */
.v3-banner { position: relative; display: grid; grid-template-columns: 1.1fr 1fr; min-height: 470px; overflow: hidden; border-radius: 30px; background: radial-gradient(circle at 30% 60%, #fff6d6, transparent 55%), linear-gradient(120deg, #cfeaff, #fff 60%, #ffeccb); box-shadow: var(--shadow); border: 4px solid #fff; }
.v3-banner-art { position: relative; }
.v3-banner-art .v3-fullbody { position: absolute; bottom: 0; height: 100%; }
.v3-banner-art .front { left: 10%; z-index: 2; filter: drop-shadow(0 20px 20px rgba(20, 40, 80, .3)); animation: float 6s ease-in-out infinite; }
.v3-banner-art .back { left: 40%; opacity: .6; transform: scale(.86); transform-origin: bottom; }
.v3-banner-rays { position: absolute; inset: -30%; background: repeating-conic-gradient(from 0deg at 50% 50%, #ffffff99 0 6deg, transparent 6deg 18deg); animation: spin 90s linear infinite; }
.v3-banner-copy { position: relative; z-index: 3; padding: 40px 40px 34px 10px; display: flex; flex-direction: column; justify-content: center; }
.v3-banner-copy .tag { font-size: 11px; font-weight: 800; letter-spacing: 2px; color: var(--gold-deep); }
.v3-banner-copy h2 { font-size: 44px; line-height: 1.1; margin: 10px 0; }
.v3-banner-copy h2 em { color: var(--gold-deep); font-style: italic; }
.v3-banner-copy > p { color: var(--muted); }
.v3-pity { margin: 16px 0; padding: 14px 16px; border-radius: 16px; background: #ffffffcc; max-width: 380px; }
.v3-pity > span { font-size: 11px; font-weight: 800; letter-spacing: 2px; color: var(--muted); }
.v3-pity strong { display: block; font: 800 30px var(--serif); color: var(--navy); }
.v3-pity strong small { font-size: 14px; color: var(--muted); }
.v3-pity > small { color: var(--muted); }
.v3-summon-actions { display: flex; gap: 12px; }
.v3-summon-actions .button { flex: 1; min-height: 66px; }
.v3-odds { display: grid; grid-template-columns: 1fr auto; gap: 26px; align-items: center; margin-top: 18px; padding: 22px 24px; border-radius: 24px; background: #ffffffd9; box-shadow: var(--shadow); }
.v3-odds h3 { font-size: 20px; margin: 4px 0 6px; }
.v3-odds p { font-size: 12px; color: var(--muted); line-height: 1.8; }
.rates { display: flex; gap: 16px; }
.rates span { display: flex; flex-direction: column; align-items: center; font-size: 18px; }
.rates small { font-size: 12px; color: var(--muted); font-weight: 700; }
.draw-modal { width: min(1060px, 100%); padding: 30px; }
.draw-header { text-align: center; margin-bottom: 18px; }
.draw-header h2 { font-size: 28px; }
.draw-header p { color: var(--muted); font-size: 12px; }
.draw-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.draw-grid.single { grid-template-columns: 220px; justify-content: center; }
.draw-card { position: relative; aspect-ratio: .72; overflow: hidden; border-radius: 16px; background: #fff; border: 4px solid #fff; box-shadow: var(--shadow-sm); }
.draw-card .portrait { position: absolute; inset: 0 0 auto; aspect-ratio: 1; }
.draw-card.sealed { background: radial-gradient(circle, #fff6d6, #bfe0ff); display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--gold-deep); font-weight: 800; letter-spacing: 2px; }
.seal-mark { font-size: 44px; color: var(--gold); animation: twinkle 2s infinite; }
.draw-card.sealed.glow-sss { background: radial-gradient(circle, #fff, #ffd06a); box-shadow: 0 0 30px #ffd06a; }
.draw-card.sealed.glow-ss { background: radial-gradient(circle, #fff, #ffcf8a); }
.draw-card.revealed { animation: flip .5s ease-out; }
.draw-card.revealed.sss { border-color: #ffd06a; box-shadow: 0 0 24px #ffd06a; }
.draw-card.revealed.ss { border-color: #ffcf8a; }
.draw-card-info { position: absolute; left: 0; right: 0; bottom: 0; padding: 20px 6px 8px; text-align: center; background: linear-gradient(transparent, #fff 30%); }
.draw-card-info small { display: block; font-size: 10px; font-weight: 800; color: var(--gold-deep); }
.draw-card-info strong { display: block; font: 700 17px var(--serif); color: var(--navy); }
.draw-footer { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-top: 18px; color: var(--muted); font-size: 12px; }

/* ---------- fusion ---------- */
.tier-tabs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.tier-tabs button { display: flex; flex-direction: column; align-items: center; padding: 10px 18px; border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); border: 3px solid transparent; font-size: 16px; }
.tier-tabs button.active { border-color: var(--gold); }
.tier-tabs small { color: var(--muted); font-weight: 600; }
.altar-stage { display: grid; grid-template-columns: 360px 1fr; gap: 26px; align-items: center; padding: 24px; border-radius: 28px; background: radial-gradient(circle at 25% 50%, #fff6d6, #ffffffd9 60%); box-shadow: var(--shadow); }
.altar-circle { position: relative; width: 320px; height: 320px; margin: auto; }
.altar-ring { position: absolute; inset: 20px; border-radius: 50%; border: 3px dashed var(--gold); animation: spin 30s linear infinite; }
.altar-ring.r2 { inset: 70px; border-style: solid; border-color: #ffe08a; box-shadow: 0 0 40px #ffe08a, inset 0 0 30px #ffe08a; animation: pulse 3s infinite; }
.altar-slot { position: absolute; width: 86px; height: 86px; border-radius: 20px; overflow: hidden; background: #fff; border: 3px dashed #c8d7ea; display: grid; place-content: center; color: var(--muted); font-size: 24px; box-shadow: var(--shadow-sm); }
.altar-slot.filled { border: 3px solid var(--gold); padding: 0; }
.altar-slot.filled .portrait { width: 80px; height: 80px; }
.altar-slot.s0 { left: 117px; top: 0; } .altar-slot.s1 { left: 0; bottom: 30px; } .altar-slot.s2 { right: 0; bottom: 30px; }
.altar-result { position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%); width: 110px; height: 110px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; background: radial-gradient(#fff, #fff1c4); box-shadow: 0 0 30px #ffd06a; }
.altar-result b { font: 800 40px var(--serif); color: var(--gold-deep); line-height: 1; }
.altar-info h3 { font-size: 24px; }
.altar-info p { color: var(--muted); margin: 8px 0; }
.altar-cost { font-weight: 800; color: var(--navy); }
.spare-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.spare-card { display: flex; flex-direction: column; align-items: center; padding: 8px; border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); }
.spare-card .portrait { width: 80px; height: 80px; border-radius: 14px; }
.spare-card strong { color: var(--navy); font-size: 13px; }
.spare-card small { color: var(--green); font-weight: 800; }
.spare-card.none small { color: var(--muted); }
.starup { display: grid; grid-template-columns: 300px 1fr; gap: 20px; }
.starup-list { display: flex; flex-direction: column; gap: 8px; max-height: 66vh; overflow-y: auto; padding: 4px; }
.starup-row { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); text-align: left; border: 3px solid transparent; }
.starup-row.active { border-color: var(--gold); }
.starup-row .portrait { width: 52px; height: 52px; border-radius: 12px; flex-shrink: 0; }
.starup-row > div { flex: 1; }
.starup-row strong { display: block; color: var(--navy); }
.starup-row > small { color: var(--muted); font-weight: 700; }
.starup-row .v3-dot { top: 6px; right: 8px; }
.starup-detail { display: grid; grid-template-columns: 260px 1fr; gap: 20px; align-items: center; padding: 22px; border-radius: 28px; background: #ffffffd9; box-shadow: var(--shadow); }
.starup-art { height: 300px; border-radius: 22px; background: radial-gradient(ellipse at 50% 80%, #ffe8b5, #f4f9ff 70%); position: relative; overflow: hidden; }
.starup-art .v3-fullbody { position: absolute; left: 50%; translate: -50% 0; bottom: 0; height: 100%; }
.starup-detail h2 { font-size: 30px; }
.compare { display: flex; align-items: center; gap: 16px; margin: 14px 0; }
.compare > div { flex: 1; padding: 12px; border-radius: 16px; background: #f3f7fc; }
.compare > b { font-size: 28px; color: var(--gold-deep); }
.compare small { font-weight: 800; color: var(--muted); letter-spacing: 1px; }
.compare p { font-size: 13px; color: var(--ink); }
.compare .up { color: var(--green); font-weight: 700; }
.starup-cost { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.starup-cost span { padding: 6px 12px; border-radius: 12px; background: #fff; border: 2px solid var(--line); font-weight: 700; }
.starup-cost .ok { color: var(--green); border-color: #bfe8cf; }
.starup-cost .no { color: var(--red); border-color: #f6c9c4; }
.fusion-reveal { position: relative; width: 240px; height: 240px; margin: -10px auto 6px; }
.fusion-reveal .v3-fullbody { position: absolute; inset: 0; animation: pop .6s ease-out; }
.reveal-burst { position: absolute; inset: -30px; border-radius: 50%; background: repeating-conic-gradient(#ffe08a 0 8deg, transparent 8deg 20deg); animation: spin 12s linear infinite; mask-image: radial-gradient(#000 30%, transparent 70%); -webkit-mask-image: radial-gradient(#000 30%, transparent 70%); }

/* ---------- shop ---------- */
.v3-sandbox-note { margin-bottom: 16px; padding: 10px 14px; border-radius: 12px; background: #fff6dc; border: 2px dashed #f2c75c; color: #8a5a00; font-weight: 600; font-size: 13px; }
.v3-product { position: relative; overflow: hidden; border-radius: 22px; background: #fff; box-shadow: var(--shadow); }
.v3-ribbon { position: absolute; top: 12px; left: -2px; z-index: 2; padding: 4px 12px 4px 10px; background: linear-gradient(90deg, #ff6b6b, #ff9a5a); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: 1px; border-radius: 0 10px 10px 0; box-shadow: var(--shadow-sm); }
.v3-ribbon.alt { background: linear-gradient(90deg, #f2a81d, #ffd06a); }
.v3-topup-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.v3-product.topup { display: flex; flex-direction: column; align-items: center; padding: 36px 16px 16px; text-align: center; background: radial-gradient(circle at 50% 30%, #fff6d6, #fff 70%); }
.v3-product.topup strong { font: 800 26px var(--serif); color: var(--navy); margin-top: 4px; }
.v3-product.topup small { color: var(--muted); min-height: 18px; }
.v3-product.topup .v3-bonus { color: var(--red); font-weight: 800; }
.v3-product.topup .button { width: 100%; margin-top: 10px; font-size: 17px; }
.v3-gem-pile { position: relative; width: 110px; height: 90px; }
.v3-gem-pile i { position: absolute; width: 34px; height: 34px; border-radius: 4px; transform: rotate(45deg); background: linear-gradient(135deg, #fff, #ffd06a 45%, #e8a93a); box-shadow: 0 0 18px #ffd06a; }
.v3-gem-pile i:nth-child(1) { left: 38px; top: 10px; }
.v3-gem-pile i:nth-child(2) { left: 12px; top: 42px; width: 26px; height: 26px; opacity: 0; }
.v3-gem-pile i:nth-child(3) { left: 70px; top: 44px; width: 22px; height: 22px; opacity: 0; }
.tier-3 .v3-gem-pile i:nth-child(2), .tier-4 .v3-gem-pile i, .tier-5 .v3-gem-pile i, .tier-6 .v3-gem-pile i { opacity: 1; }
.tier-5 .v3-gem-pile, .tier-6 .v3-gem-pile { transform: scale(1.15); }
.tier-6 .v3-gem-pile i { background: linear-gradient(135deg, #fff, #d8b6ff 45%, #8e5bd6); box-shadow: 0 0 22px #c9a5ff; }
.v3-pack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 16px; }
.v3-product.pack { display: grid; grid-template-columns: 160px 1fr; min-height: 230px; }
.v3-pack-art { position: relative; overflow: hidden; background: radial-gradient(ellipse at 50% 80%, #ffe8b5, #e9f6ff 70%); }
.v3-pack-art .v3-fullbody { position: absolute; left: 50%; translate: -50% 0; bottom: 0; height: 100%; }
.v3-moon { position: absolute; inset: 0; margin: auto; width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fffbe8, #ffd06a 60%, #e8a93a); box-shadow: 0 0 40px #ffd06a; }
.v3-moon::after { content: ''; position: absolute; width: 74px; height: 74px; border-radius: 50%; background: #eaf5ff; left: 30px; top: -10px; }
.v3-pack-copy { display: flex; flex-direction: column; padding: 18px; }
.v3-pack-copy .v3-ribbon { position: static; align-self: flex-start; margin-bottom: 6px; border-radius: 10px; }
.v3-pack-copy h3 { font-size: 20px; }
.v3-pack-copy p { font-size: 12px; color: var(--muted); }
.v3-pack-copy .button { margin-top: auto; align-self: flex-end; min-width: 140px; font-size: 16px; }
.v3-monthly { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 10px; color: var(--green); font-weight: 700; font-size: 13px; }
.v3-monthly .button { min-height: 38px; padding: 6px 14px; }
.v3-exchange-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.v3-product.exchange { display: flex; flex-direction: column; padding: 24px 16px 14px; }
.v3-product.exchange h3 { font-size: 17px; margin-top: 4px; }
.v3-product.exchange small { color: var(--muted); }
.v3-product.exchange .button { margin-top: 10px; }
.v3-product.exchange.free { background: radial-gradient(circle at 50% 0%, #fff1c4, #fff 70%); border: 3px solid #ffd06a; }

/* ---------- modes ---------- */
.v3-mode-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.v3-mode-card { position: relative; display: flex; flex-direction: column; padding: 0; overflow: hidden; text-align: left; border-radius: 26px; background: #fff; box-shadow: var(--shadow); border: 4px solid #fff; transition: transform .15s; }
.v3-mode-card:hover { transform: translateY(-4px); }
.v3-mode-art { position: relative; height: 220px; background: url('../../assets/battle-landscape.jpg') center / cover; filter: brightness(1.25) saturate(1.1); }
.v3-mode-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(#bfe6ff55, transparent 50%, #fff); }
.v3-mode-art .v3-enemy-art { position: absolute; left: 50%; translate: -50% 0; bottom: 0; height: 96%; transform: scaleX(-1); z-index: 1; filter: drop-shadow(0 10px 12px rgba(20, 40, 80, .35)); }
.v3-mode-copy { padding: 14px 22px 22px; }
.v3-mode-copy h2 { font-size: 26px; margin: 2px 0 6px; }
.v3-mode-copy p { color: var(--muted); font-size: 13px; }
.v3-mode-go { position: absolute; right: 20px; bottom: 18px; font-size: 22px; color: var(--gold-deep); }
.v3-mode-card.locked { filter: grayscale(.7); opacity: .8; }
.v3-tide { display: flex; align-items: center; gap: 18px; padding: 16px 22px; margin-bottom: 18px; border-radius: 22px; background: linear-gradient(90deg, color-mix(in srgb, var(--faction) 28%, #fff), #fff); box-shadow: var(--shadow); }
.v3-tide > b { font-size: 40px; font-weight: 400; color: var(--faction); filter: saturate(1.4) brightness(.8); }
.v3-tide > div { flex: 1; }
.v3-tide h3 { font-size: 18px; }
.v3-tide p { color: var(--muted); font-size: 13px; }
.v3-trial-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.v3-trial { padding-bottom: 14px; border-radius: 24px; background: #fff; box-shadow: var(--shadow); overflow: hidden; }
.v3-trial-art { position: relative; height: 150px; background: radial-gradient(ellipse at 50% 90%, #ffe8b5, #e9f6ff 70%); }
.v3-trial-art .v3-enemy-art { position: absolute; left: 50%; translate: -50% 0; bottom: 0; height: 100%; transform: scaleX(-1); }
.v3-trial-art b { position: absolute; left: 14px; top: 10px; font-size: 26px; color: var(--gold-deep); font-weight: 400; }
.v3-trial h3, .v3-trial > p, .v3-attempts { padding: 0 16px; }
.v3-trial h3 { font-size: 20px; margin-top: 8px; }
.v3-trial > p { font-size: 12px; color: var(--muted); }
.v3-attempts { display: block; margin: 4px 0 8px; font-size: 12px; font-weight: 800; color: var(--gold-deep); }
.v3-tiers { display: flex; flex-direction: column; gap: 8px; padding: 0 12px; }
.v3-tier { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 14px; background: #f3f7fc; text-align: left; border: 2px solid transparent; }
.v3-tier:not(:disabled):hover { border-color: var(--gold); }
.v3-tier strong { display: block; color: var(--navy); }
.v3-tier small { color: var(--muted); }
.v3-tier .v3-rewards { margin: 0; }
.v3-tower-layout { display: grid; grid-template-columns: 220px 1fr; gap: 22px; align-items: start; }
.v3-tower-column { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 24px; background: linear-gradient(#ffffffaa, #fff); box-shadow: var(--shadow); }
.v3-floor { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: #f3f7fc; color: var(--muted); font-weight: 600; font-size: 12px; }
.v3-floor b { font: 800 22px var(--serif); color: var(--navy); width: 34px; }
.v3-floor em { margin-left: auto; color: var(--red); }
.v3-floor.current { background: linear-gradient(90deg, #fff1c4, #fff); border: 3px solid var(--gold); color: var(--navy); }
.v3-floor.done { color: var(--green); opacity: .8; }
.v3-tower-card { max-width: 640px; padding: 24px 30px; border-radius: 28px; background: #fff; box-shadow: var(--shadow); text-align: center; }
.v3-tower-art { width: 220px; height: 220px; margin: 0 auto; }
.v3-tower-art .v3-enemy-art { height: 100%; transform: scaleX(-1); filter: drop-shadow(0 12px 12px rgba(20, 40, 80, .3)); }
.v3-tower-card h2 { font-size: 28px; margin: 4px 0 10px; }
.v3-affix { display: inline-block; padding: 10px 18px; border-radius: 16px; background: #f7f2ff; border: 2px solid #e6d9ff; }
.v3-affix b { color: var(--purple); }
.v3-affix p { font-size: 13px; color: var(--muted); }
.v3-exp-intro { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
.v3-exp-rules { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.v3-exp-rules > div { padding: 20px; border-radius: 22px; background: #fff; box-shadow: var(--shadow-sm); }
.v3-exp-rules b { font-size: 28px; color: var(--gold-deep); font-weight: 400; }
.v3-exp-rules h3 { font-size: 18px; margin: 4px 0; }
.v3-exp-rules p { font-size: 13px; color: var(--muted); }
.v3-exp-start { display: flex; flex-direction: column; gap: 12px; padding: 22px; border-radius: 24px; background: radial-gradient(circle at 50% 0%, #f3eaff, #fff 70%); box-shadow: var(--shadow); }
.v3-exp-start p { font-size: 13px; color: var(--muted); }
.v3-run-party { display: flex; flex-direction: column; gap: 8px; }
.v3-run-hero { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 14px; background: #f3f7fc; }
.v3-run-hero .portrait, .v3-run-hero .chip-avatar { width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0; }
.v3-run-hero > div:not(.portrait):not(.chip-avatar) { flex: 1; }
.v3-run-hero strong { color: var(--navy); font-size: 13px; }
.v3-run-hero small { color: var(--muted); font-size: 11px; }
.v3-run-hero.down { opacity: .5; filter: grayscale(1); }
.v3-run { display: grid; grid-template-columns: 1fr 300px; gap: 18px; }
.v3-run-map { display: flex; align-items: center; justify-content: space-between; min-height: 420px; padding: 30px 24px; overflow-x: auto; border-radius: 28px; background: radial-gradient(ellipse at 85% 50%, #efe3ff, transparent 50%), linear-gradient(90deg, #e9f6ff, #fff); box-shadow: var(--shadow); }
.v3-tier-col { display: flex; flex-direction: column; gap: 16px; align-items: center; min-width: 110px; }
.v3-tier-col > small { font-size: 10px; font-weight: 800; letter-spacing: 2px; color: var(--muted); }
.v3-link-line { flex: 1; min-width: 14px; height: 4px; border-radius: 2px; background: repeating-linear-gradient(90deg, #e8b54a 0 8px, transparent 8px 14px); }
.v3-node { width: 104px; padding: 14px 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; border-radius: 18px; background: #fff; box-shadow: var(--shadow-sm); border: 3px solid transparent; }
.v3-node b { font-size: 28px; line-height: 1; color: var(--gold-deep); font-weight: 400; }
.v3-node span { font-size: 12px; font-weight: 700; color: var(--navy); }
.v3-node.elite b { color: var(--red); }
.v3-node.rest b { color: var(--green); }
.v3-node.treasure b { color: #f2a81d; }
.v3-node.boss { width: 124px; padding: 22px 6px; background: radial-gradient(#fff, #e7d8ff); border-color: #c9a5ff; }
.v3-node.boss b { color: var(--purple); font-size: 36px; }
.v3-tier-col.now .v3-node:not(:disabled) { border-color: var(--gold); box-shadow: 0 0 0 4px #ffe8b5, var(--shadow); animation: bob 2s ease-in-out infinite; }
.v3-tier-col.past .v3-node { opacity: .35; }
.v3-tier-col.past .v3-node.chosen { opacity: 1; border-color: var(--green); }
.v3-tier-col.future .v3-node { opacity: .7; }
.v3-run-side { display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: 24px; background: #fff; box-shadow: var(--shadow); }
.v3-blessings { display: flex; flex-wrap: wrap; gap: 6px; }
.v3-blessings span { padding: 4px 10px; border-radius: 14px; background: #fff6dc; font-size: 12px; font-weight: 700; color: var(--navy); }
.v3-blessings b { color: var(--gold-deep); font-weight: 400; margin-right: 3px; }
.v3-blessings small { color: var(--muted); }
.v3-bless-modal { width: min(760px, 100%) !important; }
.v3-blessing-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.v3-blessing-pick button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 14px; border-radius: 22px; background: radial-gradient(circle at 50% 0%, #fff1c4, #fff 70%); border: 3px solid #ffe8b5; box-shadow: var(--shadow-sm); transition: transform .15s; }
.v3-blessing-pick button:hover { transform: translateY(-4px); border-color: var(--gold); }
.v3-blessing-pick b { font-size: 36px; color: var(--gold-deep); font-weight: 400; }
.v3-blessing-pick strong { font: 700 18px var(--serif); color: var(--navy); }
.v3-blessing-pick p { font-size: 12px; color: var(--muted); }

/* ---------- quests ---------- */
.v3-quest-list { display: flex; flex-direction: column; gap: 10px; max-width: 920px; }
.v3-quest { flex-shrink: 0; display: grid; grid-template-columns: 1fr minmax(160px, auto) 130px; gap: 16px; align-items: center; max-width: 920px; padding: 14px 18px; border-radius: 20px; background: #fff; box-shadow: var(--shadow-sm); border: 3px solid transparent; }
.v3-quest h3 { font-size: 16px; }
.v3-quest small { color: var(--muted); }
.v3-quest .v3-bar { max-width: 260px; }
.v3-quest .button { min-height: 42px; padding: 6px 12px; white-space: nowrap; }
.v3-quest.ready { border-color: var(--gold); }
.v3-quest.claimed, .v3-quest.locked { opacity: .55; }
.v3-quest.bonus { margin-top: 14px; background: radial-gradient(circle at 0% 50%, #fff1c4, #fff 60%); }
.v3-signin { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; max-width: 1000px; }
.v3-day { position: relative; min-height: 150px; padding: 14px 8px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; border-radius: 20px; background: #fff; box-shadow: var(--shadow-sm); border: 3px solid transparent; }
.v3-day > small { font-weight: 800; letter-spacing: 2px; color: var(--muted); }
.v3-day .v3-rewards { justify-content: center; }
.v3-day > b { position: absolute; inset: 0; display: grid; place-content: center; border-radius: 17px; background: #ffffffcc; font-size: 46px; color: var(--green); font-weight: 400; }
.v3-day.today { border-color: var(--gold); box-shadow: 0 0 0 4px #ffe8b5; animation: bob 2s ease-in-out infinite; }
.v3-day.grand { background: radial-gradient(circle, #f3eaff, #fff 70%); border-color: #e6d9ff; }
.v3-profile { text-align: left !important; }
.v3-profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.v3-profile-stats span { padding: 10px; border-radius: 14px; background: #f3f7fc; }
.v3-profile-stats small { display: block; color: var(--muted); font-weight: 700; }
.v3-profile-stats b { font: 800 20px var(--serif); color: var(--navy); }
.v3-unlocks { display: flex; flex-wrap: wrap; gap: 6px; }
.v3-unlocks span { padding: 4px 10px; border-radius: 10px; background: #f3f7fc; color: var(--muted); font-size: 12px; font-weight: 600; }
.v3-unlocks span.on { background: #e8f8ee; color: var(--green); }
.v3-row { display: flex; gap: 8px; margin-top: 6px; }
.v3-row .button { flex: 1; min-height: 42px; }
.v3-profile textarea { width: 100%; margin-top: 4px; padding: 8px 12px; border-radius: 12px; border: 2px solid var(--line); font: 11px var(--sans); resize: vertical; }

/* ---------- animation ---------- */
@keyframes float { 50% { transform: translateY(-8px); } }
@keyframes breathe { 50% { transform: translateY(-4px) scaleY(1.015); } }
@keyframes bob { 50% { translate: 0 -5px; } }
@keyframes pulse { 50% { opacity: .65; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes twinkle { 50% { opacity: .6; transform: scale(.92); } }
@keyframes pop { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } }
@keyframes flip { from { transform: rotateY(90deg); } to { transform: none; } }
@keyframes drift { to { translate: 3% 2%; } }
@keyframes cloud { from { translate: -20vw 0; } to { translate: 120vw 0; } }
@keyframes route { to { stroke-dashoffset: -44; } }
@keyframes map-in { from { transform: scale(1.05); opacity: .4; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; } }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .class-grid { grid-template-columns: repeat(3, 1fr); }
  .v3-mode-grid, .v3-trial-grid { grid-template-columns: 1fr 1fr; }
  .v3-exp-intro, .v3-run, .altar-stage, .starup, .starup-detail { grid-template-columns: 1fr; }
  .v3-pack-grid { grid-template-columns: 1fr; }
  .v3-slots { grid-template-columns: repeat(2, 1fr); }
  .command-description { display: none; }
  .party-chip { width: 120px; }
}
@media (max-width: 760px) {
  .topbar { height: 60px; padding: 0 10px; gap: 6px; }
  .logo { display: none; }
  .v3-account { margin-left: 0; padding-right: 8px; }
  .v3-account-avatar { width: 40px; height: 40px; }
  .v3-account-info { min-width: 60px; }
  .v3-account-info small, .v3-account-info .v3-bar { display: none; }
  .v3-currency { padding: 4px 8px 4px 4px; font-size: 11px; gap: 3px; }
  .v3-currency i { width: 18px; height: 18px; font-size: 11px; }
  .v3-currency em, .wallet .round-button:not(:last-child) { display: none; }
  .title-hero { height: 46%; opacity: .55; }
  .title-logo p { letter-spacing: 1px; font-size: 11px; }
  .world-title p { display: none; }
  .world-title { top: 70px; left: 14px; right: 80px; }
  .battle-head .eyebrow { display: none; }
  .scene-back, .battle-toggles button { padding: 6px 10px; font-size: 12px; }
  .battle-turn { top: 2px; }
  .title-hero.left { left: -18%; } .title-hero.right { right: -18%; }
  .create-layout, .player-layout { grid-template-columns: 1fr; }
  .create-preview { position: relative; height: 340px; }
  .class-grid { grid-template-columns: repeat(3, 1fr); }
  .class-cols, .look-modal { grid-template-columns: 1fr; }
  .v3-screen { padding: 72px 12px 40px; }
  .v3-panel-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .world-title h1 { font-size: 24px; }
  .map-locations, .map-routes { inset: 160px 18px 230px; width: calc(100% - 36px); height: calc(100% - 390px); }
  .map-node { width: 38px; height: 38px; border-width: 3px; }
  .map-node.current { width: 48px; height: 48px; }
  .map-node b { font-size: 13px; }
  .node-caption { padding: 2px 6px; }
  .node-caption strong { font-size: 9px; }
  .node-caption small { display: none; }
  .map-label, .map-progress { display: none; }
  .v3-rail { top: 70px; right: 10px; gap: 6px; }
  .v3-rail-btn { width: 50px; height: 50px; border-radius: 14px; }
  .v3-rail-btn b { font-size: 18px; } .v3-rail-btn span { font-size: 8px; }
  .map-current { left: 12px; right: 12px; bottom: 104px; width: auto; padding: 12px 16px; display: grid; grid-template-columns: 1fr auto; gap: 0 10px; align-items: center; }
  .map-current h2 { font-size: 18px; } .map-current p, .map-current .v3-power { display: none; }
  .map-current .button { grid-row: 1 / 3; grid-column: 2; width: auto; }
  .v3-dock { left: 8px; right: 8px; bottom: 10px; gap: 4px; padding: 6px; justify-content: space-between; border-radius: 20px; }
  .dock-btn { width: auto; flex: 1; height: 72px; border-radius: 14px; }
  .dock-btn b { font-size: 22px; } .dock-btn span { font-size: 10px; }
  .dock-btn.hero-btn b { width: 34px; height: 34px; }
  .battle-head { top: 66px; left: 10px; right: 10px; }
  .battle-head h1 { font-size: 17px; }
  .v3-battle-chips { display: none; }
  .combat-board { inset: 120px 0 230px; }
  .fighter { width: clamp(140px, 22vh, 210px); height: clamp(140px, 22vh, 210px); }
  .fighter.is-boss { width: clamp(180px, 30vh, 280px); height: clamp(180px, 30vh, 280px); }
  .fighter-tag { font-size: 9px; padding: 1px 6px; }
  .combat-hud { left: 8px; right: 8px; bottom: 22px; flex-direction: column; gap: 8px; }
  .party-hud { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; align-self: stretch; }
  .party-chip { width: auto; padding: 4px; gap: 4px; }
  .party-chip .portrait, .chip-avatar { width: 28px; height: 28px; }
  .party-chip strong { font-size: 9px; } .party-chip > em { display: none; }
  .command-panel { margin: 0; padding: 10px; justify-content: center; }
  .command-buttons button { min-width: 0; flex: 1; min-height: 58px; }
  .battle-turn { left: 10px; padding: 4px 10px; }
  .boss-bar { left: 32%; right: 6%; }
  .skill-announcement { width: 80%; }
  .skill-announcement > strong { font-size: 20px; }
  .v3-formation, .v3-detail, .v3-banner, .v3-odds, .v3-tower-layout, .v3-exp-rules { grid-template-columns: 1fr; }
  .v3-detail-art { height: 280px; }
  .v3-detail-copy { padding: 20px; }
  .v3-stats, .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .v3-banner-art { height: 260px; }
  .v3-banner-copy { padding: 18px; }
  .v3-banner-copy h2 { font-size: 30px; }
  .v3-summon-actions { flex-direction: column; }
  .draw-grid { grid-template-columns: repeat(3, 1fr); }
  .v3-mode-grid, .v3-trial-grid, .v3-blessing-pick { grid-template-columns: 1fr; }
  .v3-tower-column { flex-direction: row; overflow-x: auto; }
  .v3-quest { grid-template-columns: 1fr auto; }
  .v3-quest .v3-rewards { grid-column: 1; }
  .v3-quest .button { grid-column: 2; grid-row: 1 / 3; }
  .v3-signin { grid-template-columns: repeat(4, 1fr); }
  .v3-topup-grid { grid-template-columns: repeat(2, 1fr); }
  .v3-product.pack { grid-template-columns: 110px 1fr; }
  .altar-circle { transform: scale(.85); }
}

/* =====================================================================
   v0.5 — chibi art in menus + real-time action battle
   ===================================================================== */
.portrait.chibi { background: radial-gradient(circle at 50% 40%, #fff, color-mix(in srgb, var(--realm, #e8b54a) 30%, #eaf5ff)); overflow: hidden; position: relative; }
.portrait.chibi img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.v3-fullbody.chibi, .v3-enemy-art.chibi { background: none; }
.v3-fullbody.chibi img, .v3-enemy-art.chibi img { width: 100%; height: 100%; object-fit: contain; object-position: center bottom; display: block; }
.avatar-img { object-fit: contain; object-position: center bottom; }
.hero-card .portrait.chibi { aspect-ratio: 1; }
.hero-card .portrait.chibi img { inset: 8% 6% 2%; width: 88%; height: 90%; }
.draw-card .portrait.chibi { aspect-ratio: 1; }

.act-screen { position: relative; height: 100dvh; overflow: hidden; background: #bfe6ff; user-select: none; -webkit-user-select: none; touch-action: none; }
#act-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.act-btn { pointer-events: auto; padding: 8px 14px; border-radius: 12px; background: #ffffffe6; color: var(--navy); font-weight: 800; box-shadow: var(--shadow-sm); }
.act-btn.on { background: linear-gradient(#ffd06a, #e8a93a); color: #fff; }
.act-top { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: flex-start; z-index: 5; pointer-events: none; }
.act-title { text-align: center; padding: 6px 18px; border-radius: 16px; background: #ffffffcc; box-shadow: var(--shadow-sm); }
.act-title small { display: block; font-size: 10px; font-weight: 800; letter-spacing: 2px; color: var(--gold-deep); }
.act-title strong { display: block; font: 800 20px var(--serif); color: var(--navy); }
.act-title em { font-size: 11px; color: var(--muted); font-weight: 700; }
.act-boss { position: absolute; top: 88px; left: 50%; transform: translateX(-50%); width: min(560px, 70vw); z-index: 5; text-align: center; }
.act-boss span { font-weight: 900; color: #fff; text-shadow: 0 1px 3px #6a0d1f, 0 0 10px #ff6b6b; letter-spacing: 1px; }
.act-boss div { height: 14px; margin-top: 4px; border-radius: 8px; background: #ffffffaa; border: 2px solid #fff; overflow: hidden; box-shadow: var(--shadow-sm); }
.act-boss i { display: block; height: 100%; background: linear-gradient(90deg, #ff9aa8, #e0334b); transition: width .2s; }
.act-skillname { position: absolute; top: 120px; left: 24px; z-index: 6; padding: 8px 20px 8px 14px; border-radius: 0 16px 16px 0; background: linear-gradient(90deg, #fffffff2, #ffffff99 80%, transparent); border-left: 6px solid var(--c, #e8b54a); pointer-events: none; }
.act-skillname.show { animation: slidein .25s ease-out; }
.act-skillname small { display: block; font-size: 10px; font-weight: 900; letter-spacing: 2px; color: var(--gold-deep); }
.act-skillname strong { display: block; font: 900 22px var(--serif); color: var(--navy); }
.act-skillname span { font-size: 12px; font-weight: 700; color: var(--muted); }
.act-help { position: absolute; top: 74px; left: 50%; transform: translateX(-50%); z-index: 7; padding: 10px 14px 10px 18px; border-radius: 14px; background: var(--navy); color: #fff; font-size: 13px; font-weight: 600; display: flex; gap: 12px; align-items: center; white-space: nowrap; box-shadow: var(--shadow); }
.act-help button { padding: 4px 12px; border-radius: 8px; background: var(--gold); color: #fff; font-weight: 800; }

.act-hud { position: absolute; left: 0; right: 0; bottom: 14px; z-index: 5; display: flex; align-items: flex-end; gap: 12px; padding: 0 14px; pointer-events: none; }
.act-status { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 20px; background: #ffffffe6; box-shadow: var(--shadow); pointer-events: auto; }
.act-face { position: relative; width: 64px; height: 64px; border-radius: 16px; overflow: hidden; background: radial-gradient(#fff, #ffe8b5); border: 3px solid var(--gold); }
.act-face img { width: 100%; height: 100%; object-fit: contain; }
.act-face em { position: absolute; right: 2px; bottom: 2px; padding: 0 5px; border-radius: 8px; background: var(--navy); color: #fff; font: 800 11px var(--sans); }
.act-bars { width: 230px; }
.act-bars strong { font-size: 13px; color: var(--navy); }
.act-bars strong small { color: var(--muted); font-weight: 700; }
.act-bars .bar { position: relative; height: 16px; margin-top: 4px; border-radius: 8px; background: #e6edf5; overflow: hidden; box-shadow: inset 0 1px 2px rgba(0,0,0,.12); }
.act-bars .bar i { display: block; height: 100%; transition: width .15s; }
.act-bars .bar.hp i { background: linear-gradient(#ff8a8a, #e0334b); }
.act-bars .bar.mp i { background: linear-gradient(#8ec5ff, #2f6fd8); }
.act-bars .bar span { position: absolute; inset: 0; text-align: center; font: 800 10px/16px var(--sans); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.act-heroes { display: flex; gap: 8px; pointer-events: auto; }
.act-hero { position: relative; width: 64px; height: 64px; padding: 0; border-radius: 18px; overflow: hidden; background: radial-gradient(#fff, #e3f2ff); border: 3px solid #fff; box-shadow: var(--shadow-sm); }
.act-hero img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; }
.act-hero .ring { position: absolute; inset: 0; z-index: 0; display: flex; align-items: flex-end; }
.act-hero .ring i { width: 100%; background: linear-gradient(#bfe0ff, #8ec5ff); transition: height .2s; }
.act-hero b { position: absolute; z-index: 2; left: 4px; top: 2px; font: 900 12px var(--sans); color: var(--navy); text-shadow: 0 0 3px #fff; }
.act-hero .mini { position: absolute; z-index: 2; left: 4px; right: 4px; bottom: 3px; height: 5px; border-radius: 3px; background: #ffffffaa; overflow: hidden; }
.act-hero .mini i { display: block; height: 100%; background: #36a865; }
.act-hero.ready { border-color: var(--gold); box-shadow: 0 0 0 3px #ffe08a, 0 0 18px #ffd06a; animation: pulse 1s infinite; }
.act-hero.ready .ring i { background: linear-gradient(#fff1b8, #ffd06a); }
.act-hero.down { filter: grayscale(1); opacity: .5; }
.act-pad { display: none; gap: 8px; pointer-events: auto; }
.act-actions { margin-left: auto; display: flex; gap: 10px; align-items: flex-end; pointer-events: auto; }
.act-key { position: relative; width: 78px; height: 78px; border-radius: 50%; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 35%, #fff, #e3f0ff); border: 3px solid #fff; box-shadow: 0 4px 0 #b8cbe2, var(--shadow-sm); color: var(--navy); touch-action: none; }
.act-key b { position: relative; z-index: 1; font-size: 26px; line-height: 1; font-weight: 400; }
.act-key small { position: relative; z-index: 1; font-size: 9px; font-weight: 800; max-width: 70px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-key kbd { position: absolute; z-index: 1; bottom: 4px; font: 800 8px var(--sans); color: var(--muted); }
.act-key.pressed { transform: translateY(3px); box-shadow: 0 1px 0 #b8cbe2; }
.act-key.attack { width: 92px; height: 92px; background: radial-gradient(circle at 50% 35%, #fff4d6, #ffc45a); color: #6a3e00; box-shadow: 0 5px 0 #c18a24, var(--shadow-sm); }
.act-key.attack b { font-size: 34px; }
.act-key.skill .ring { position: absolute; inset: 0; display: flex; align-items: flex-end; }
.act-key.skill .ring i { width: 100%; background: linear-gradient(#cfe6ff, #8ec5ff); }
.act-key.skill.ready { border-color: var(--gold); box-shadow: 0 4px 0 #c18a24, 0 0 22px #ffd06a; }
.act-key.skill.ready .ring i { background: linear-gradient(#fff1b8, #ffc45a); }
.act-key.move { width: 62px; height: 62px; }
.act-exp { position: absolute; left: 0; right: 0; bottom: 0; height: 8px; z-index: 5; background: #1e2a44cc; }
.act-exp i { display: block; height: 100%; background: linear-gradient(90deg, #ffe08a, #f2a81d); }
.act-exp span { position: absolute; right: 8px; bottom: 9px; font: 800 10px var(--sans); color: #fff; text-shadow: 0 1px 2px #000; }
@keyframes slidein { from { transform: translateX(-30px); opacity: 0; } }
@media (hover: none), (max-width: 900px) {
  .act-pad { display: flex; }
  .act-key kbd { display: none; }
  .act-help { display: none; }
}
@media (max-width: 760px) {
  .act-hud { flex-wrap: wrap; gap: 6px; padding: 0 8px; }
  .act-status { order: 1; width: 100%; padding: 6px; }
  .act-bars { flex: 1; width: auto; }
  .act-heroes { order: 2; }
  .act-hero { width: 50px; height: 50px; }
  .act-pad { order: 3; width: 100%; justify-content: space-between; }
  .act-actions { position: absolute; right: 8px; bottom: 74px; }
  .act-key { width: 62px; height: 62px; }
  .act-key.attack { width: 76px; height: 76px; }
  .act-title strong { font-size: 15px; }
  .act-boss { top: 70px; }
}
/* phones held sideways: status + companions move to the top corners, controls stay at the bottom */
@media (max-height: 520px) {
  .act-top { top: 6px; left: 8px; right: 8px; }
  .act-btn { padding: 6px 10px; font-size: 12px; }
  .act-title { padding: 3px 12px; }
  .act-title small { display: none; }
  .act-title strong { font-size: 14px; }
  .act-hud { bottom: 12px; padding: 0 10px; flex-wrap: nowrap; }
  .act-status { position: fixed; top: 52px; left: 8px; padding: 4px 8px 4px 4px; border-radius: 14px; }
  .act-face { width: 40px; height: 40px; border-radius: 10px; border-width: 2px; }
  .act-bars { width: 150px; flex: none; }
  .act-bars strong { font-size: 11px; }
  .act-bars .bar { height: 11px; margin-top: 2px; }
  .act-bars .bar span { font-size: 8px; line-height: 11px; }
  .act-heroes { position: fixed; top: 52px; right: 8px; }
  .act-hero { width: 44px; height: 44px; border-radius: 12px; }
  .act-pad { display: flex; order: 0; width: auto; }
  .act-key.move { width: 54px; height: 54px; }
  .act-actions { position: static; margin-left: auto; }
  .act-key { width: 56px; height: 56px; }
  .act-key.attack { width: 70px; height: 70px; }
  .act-key small, .act-key kbd { display: none; }
  .act-boss { top: 104px; }
  .act-skillname { top: 104px; }
}

/* portrait phones: suggest rotating (dismissable); the stage still works upright */
.act-rotate { display: none; }
@media (orientation: portrait) and (max-width: 600px) {
  .act-rotate { display: flex; position: absolute; inset: 0; z-index: 20; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 30px; text-align: center; background: #eaf5fff2; color: var(--navy); }
  .act-rotate b { font-size: 54px; animation: tilt 1.6s ease-in-out infinite; }
  .act-rotate strong { font: 800 22px var(--serif); }
  .act-rotate p { color: var(--muted); margin: 0; }
  .act-screen.upright .act-rotate { display: none; }
  .act-title small { display: none; }
  .act-btn { padding: 6px 10px; font-size: 12px; }
}
@keyframes tilt { 50% { transform: rotate(90deg); } }

/* v0.6 skill bar (X C V + F ultimate) */
.act-actions { flex-direction: row; align-items: flex-end; gap: 14px; }
.act-skillbar { display: flex; gap: 8px; align-items: flex-end; padding: 8px; border-radius: 22px; background: #ffffffb8; box-shadow: var(--shadow-sm); }
.act-main { display: flex; gap: 10px; align-items: flex-end; }
.act-key.sk, .act-key.ult { width: 66px; height: 66px; border-radius: 18px; background: radial-gradient(circle at 50% 30%, #fff, color-mix(in srgb, var(--c, #8ec5ff) 35%, #eef5ff)); border-color: color-mix(in srgb, var(--c, #8ec5ff) 60%, #fff); box-shadow: 0 4px 0 color-mix(in srgb, var(--c, #8ec5ff) 50%, #8aa0bf); }
.act-key.sk b { font-size: 24px; }
.act-key.sk small, .act-key.ult small { font-size: 8.5px; max-width: 60px; }
.act-key em { position: relative; z-index: 2; font: 800 8px var(--sans); color: #2f5bb8; font-style: normal; }
.act-key.sk .cd { position: absolute; inset: 0; z-index: 3; pointer-events: none; background: conic-gradient(rgba(25,35,60,.62) var(--cd, 0deg), transparent 0); transition: none; }
.act-key.sk.nomp { filter: saturate(.3); }
.act-key.sk.nomp em { color: #e0334b; }
.act-key.sk.ready { box-shadow: 0 4px 0 color-mix(in srgb, var(--c) 50%, #8aa0bf), 0 0 12px color-mix(in srgb, var(--c) 70%, transparent); }
.act-key.sk.locked { filter: grayscale(1); opacity: .55; }
.act-key.sk.locked em { color: var(--muted); }
.act-key.ult { --c: #ffc45a; }
.act-key.ult .ring { position: absolute; inset: 0; display: flex; align-items: flex-end; }
.act-key.ult .ring i { width: 100%; background: linear-gradient(#fff1b8, #ffc45a); opacity: .65; }
.act-key.ult.ready { animation: pulse 1s infinite; border-color: var(--gold); }
.act-key kbd { z-index: 2; }
@media (max-width: 1100px) { .act-key.sk small, .act-key.ult small { display: none; } }
@media (max-height: 520px), (max-width: 760px) {
  .act-actions { flex-direction: column; align-items: flex-end; gap: 6px; }
  .act-skillbar { padding: 4px; gap: 5px; border-radius: 16px; }
  .act-key.sk, .act-key.ult { width: 46px; height: 46px; border-radius: 13px; }
  .act-key.sk b, .act-key.ult b { font-size: 18px; }
  .act-key em { font-size: 7px; }
}

/* v0.6 wardrobe */
.wardrobe .wd-layout { display: grid; grid-template-columns: minmax(300px, 400px) 1fr; gap: 22px; align-items: start; }
.wd-stage { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 12px; }
.wd-podium { position: relative; border-radius: 28px; overflow: hidden; background: radial-gradient(circle at 50% 30%, #fff 0%, #fff6dc 45%, #dcefff 100%); box-shadow: var(--shadow); border: 3px solid #fff; }
.wd-podium::before { content: ''; position: absolute; inset: 0; background: repeating-conic-gradient(from 0deg at 50% 92%, rgba(255,214,106,.13) 0 8deg, transparent 8deg 20deg); }
#wd-canvas { position: relative; display: block; width: 100%; height: auto; }
.wd-name { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; }
.wd-name strong { display: inline-block; padding: 2px 14px; border-radius: 8px; background: rgba(30,42,68,.82); color: #ffe08a; font-weight: 800; }
.wd-name small { display: block; margin-top: 4px; color: var(--muted); font-weight: 700; }
.wd-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.wd-stats div { padding: 8px 4px; border-radius: 14px; background: #fff; text-align: center; box-shadow: var(--shadow-sm); }
.wd-stats span { display: block; font-size: 10px; font-weight: 800; color: var(--muted); }
.wd-stats b { display: block; font-size: 15px; color: var(--navy); }
.wd-stats em { font-style: normal; font-size: 10px; font-weight: 800; color: #2fa86a; }
.wd-equipped { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.wd-slot { position: relative; aspect-ratio: .8; padding: 2px; border-radius: 14px; background: #fff; border: 2px solid #e3ebf5; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; }
.wd-slot img { width: 100%; flex: 1; min-height: 0; object-fit: contain; }
.wd-slot b { font-size: 22px; opacity: .45; flex: 1; display: grid; place-items: center; }
.wd-slot small { font-size: 8.5px; font-weight: 700; color: var(--muted); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wd-slot em { position: absolute; top: 2px; right: 4px; font: 800 10px var(--sans); color: #e8a21a; }
.wd-slot.r-rare { border-color: #9cc8f5; } .wd-slot.r-epic { border-color: #c9a2ef; } .wd-slot.r-legend { border-color: #f2c35a; box-shadow: 0 0 10px #ffd86a88; }
.wd-tabs { flex-wrap: wrap; }
.wd-tabs i { font-style: normal; }
.wd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 14px; }
.wd-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 26px 8px 10px; border-radius: 20px; background: linear-gradient(#fff, color-mix(in srgb, var(--rc, #8a97ab) 12%, #fff)); border: 2px solid color-mix(in srgb, var(--rc, #8a97ab) 40%, #fff); box-shadow: var(--shadow-sm); text-align: center; transition: transform .12s; }
.wd-item:hover { transform: translateY(-3px); }
.wd-item.picked { border-color: var(--rc, var(--gold)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--rc, #e8b54a) 35%, transparent), var(--shadow); }
.wd-item img { width: 100%; max-width: 130px; aspect-ratio: 1; object-fit: contain; }
.wd-item strong { font-size: 13px; color: var(--navy); }
.wd-item strong em { font-style: normal; color: #e8a21a; }
.wd-item small { font-size: 10.5px; font-weight: 700; color: #2fa86a; min-height: 26px; }
.wd-rarity { position: absolute; top: 8px; left: 10px; font: 800 10px var(--sans); color: var(--rc, var(--muted)); letter-spacing: .5px; }
.wd-worn { position: absolute; top: 7px; right: 8px; padding: 1px 7px; border-radius: 8px; background: #2fa86a; color: #fff; font: 800 9px var(--sans); }
.wd-price { margin-top: 4px; padding: 3px 10px; border-radius: 10px; background: #fff3d6; color: #a86a00; font: 800 12px var(--sans); }
.wd-price.gems { background: #efe6ff; color: #7a3fd6; }
.wd-price.owned { background: #e6f6ec; color: #2fa86a; }
.wd-item.r-legend { background: linear-gradient(160deg, #fffdf2, #ffeebd); }
.wd-detail { position: sticky; bottom: 12px; z-index: 4; margin-top: 16px; display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 14px 18px; border-radius: 20px; background: #ffffffee; border: 2px solid color-mix(in srgb, var(--rc, #e8b54a) 50%, #fff); box-shadow: var(--shadow); backdrop-filter: blur(8px); }
.wd-detail.inline { position: static; }
.wd-detail strong { display: block; font: 800 18px var(--serif); color: var(--navy); }
.wd-detail small { display: block; font-size: 12px; font-weight: 700; color: #2fa86a; }
.wd-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.wd-max { font-weight: 800; color: #e8a21a; }
.wd-salon h3 { margin: 18px 0 0; font: 800 16px var(--serif); color: var(--navy); }
.wd-salon h3 small { font: 700 12px var(--sans); color: #a86a00; }
.wd-grid.salon { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.wd-grid.salon .wd-item { padding-top: 10px; }
.wd-swatches { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.wd-swatches button { width: 38px; height: 38px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff8, transparent 50%), var(--c); border: 3px solid #fff; box-shadow: var(--shadow-sm); }
.wd-swatches button.active { box-shadow: 0 0 0 3px var(--gold), var(--shadow-sm); }
.wd-link { margin-left: auto; padding: 8px 14px; border-radius: 14px; background: linear-gradient(135deg, #ffe6f0, #e8dcff); color: #7a3fd6; font-weight: 800; }
.skill-list { display: grid; gap: 8px; margin: 12px 0; }
.skill-row { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 16px; background: #fff; border-left: 5px solid var(--c); box-shadow: var(--shadow-sm); }
.skill-row > b { font-size: 24px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: color-mix(in srgb, var(--c) 25%, #fff); }
.skill-row div { flex: 1; }
.skill-row strong { font-size: 14px; color: var(--navy); }
.skill-row kbd { padding: 0 6px; border-radius: 5px; background: var(--navy); color: #fff; font-size: 10px; }
.skill-row small { display: block; font-size: 12px; color: var(--muted); }
.skill-row em { font-style: normal; font-size: 11px; font-weight: 800; color: #2f5bb8; white-space: nowrap; }
.skill-row.locked { opacity: .55; filter: grayscale(.8); }
@media (max-width: 900px) {
  .wardrobe .wd-layout { grid-template-columns: 1fr; }
  .wd-stage { position: static; }
  .wd-podium { max-width: 360px; margin: 0 auto; width: 100%; }
  .wd-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .wd-detail { flex-direction: column; align-items: stretch; }
}

/* v0.6 title: tree-house character select */
.title-screen.ms { display: block; background: #bfe6ff; }
#ts-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
.ts-logo { position: absolute; z-index: 3; top: 18px; left: 22px; display: flex; gap: 12px; align-items: center; padding: 10px 20px 10px 14px; border-radius: 22px; background: linear-gradient(#ffffffee, #fff6dcee); border: 3px solid #fff; box-shadow: 0 6px 0 #d9b77a, var(--shadow); }
.ts-logo > span { font-size: 38px; color: var(--gold); text-shadow: 0 0 12px #ffd86a; }
.ts-logo h1 { margin: 0; font: 900 30px/1 var(--serif); color: var(--navy); letter-spacing: 1px; }
.ts-logo p { margin: 4px 0 0; font: 800 10px var(--sans); letter-spacing: 2px; color: var(--gold-deep); }
.ts-world { position: absolute; z-index: 3; top: 22px; right: 22px; padding: 10px 18px; border-radius: 16px; background: linear-gradient(#a8703f, #7a4c2a); color: #fff3d6; font-weight: 800; border: 3px solid #e9c48a; box-shadow: 0 5px 0 #4a2c17, var(--shadow-sm); text-align: right; }
.ts-world b { color: #ffe08a; }
.ts-world small { display: block; font-size: 11px; opacity: .85; }
.ts-spots { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.ts-spot { position: absolute; pointer-events: auto; background: none; border: 0; border-radius: 30px; cursor: pointer; }
.ts-spot:focus-visible { outline: 3px solid var(--gold); }
.ts-plate { position: absolute; left: 50%; bottom: calc(-38px * var(--s, 1)); transform: translateX(-50%); padding: calc(4px * var(--s, 1)) calc(14px * var(--s, 1)); border-radius: 8px; background: linear-gradient(#b9814b, #7a4c2a); color: #fff3d6; font: 800 calc(16px * var(--s, 1)) var(--sans); white-space: nowrap; border: 2px solid #e9c48a; box-shadow: 0 3px 0 #4a2c17; }
.ts-spot.sel .ts-plate { background: linear-gradient(#ffd86a, #e8a21a); color: #5a3400; border-color: #fff3c4; }
.ts-spot.empty .ts-plate { opacity: .7; }
.ts-panel { position: absolute; z-index: 3; right: 28px; top: 50%; transform: translateY(-45%); width: 300px; }
.ts-card { padding: 18px 18px 20px; border-radius: 26px; background: linear-gradient(#fffdf6, #fff1d0); border: 4px solid #e9c48a; box-shadow: 0 0 0 4px #a8703f, 0 10px 0 4px #4a2c17, var(--shadow); text-align: center; }
.ts-card-head { margin: -6px -6px 10px; padding: 8px; border-radius: 16px; background: linear-gradient(#a8703f, #7a4c2a); color: #fff3d6; font-weight: 800; }
.ts-card-head b { font-size: 26px; color: #ffe08a; margin-left: 6px; }
.ts-card-name { font: 900 26px var(--serif); color: var(--navy); margin-bottom: 10px; }
.ts-card-rows { display: grid; gap: 6px; margin-bottom: 16px; }
.ts-card-rows span { display: flex; justify-content: space-between; padding: 7px 12px; border-radius: 10px; background: #fff; box-shadow: inset 0 1px 2px #0001; }
.ts-card-rows i { font-style: normal; color: var(--muted); font-weight: 700; font-size: 13px; }
.ts-card-rows b { color: var(--navy); }
.ts-card p { color: var(--muted); font-size: 14px; }
.ts-start { width: 100%; padding: 16px; border-radius: 18px; background: linear-gradient(#ffcf6a, #f2931d); color: #fff; font: 900 22px var(--serif); letter-spacing: 2px; text-shadow: 0 2px 0 #b86a00; border: 3px solid #fff3c4; box-shadow: 0 6px 0 #b86a00, 0 0 24px #ffd06a99; animation: pulse 2s infinite; }
.ts-start:active { transform: translateY(4px); box-shadow: 0 2px 0 #b86a00; }
.ts-bar { position: absolute; z-index: 3; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; gap: 14px; }
.ts-wood { padding: 12px 26px; border-radius: 30px; background: linear-gradient(#c58d55, #8a5a32); color: #fff3d6; font-weight: 800; font-size: 15px; border: 3px solid #e9c48a; box-shadow: 0 5px 0 #4a2c17; }
.ts-wood:disabled { opacity: .5; }
.title-screen.ms .title-foot { z-index: 3; }
@media (max-width: 900px) {
  .ts-logo { top: 10px; left: 10px; padding: 6px 12px; }
  .ts-logo h1 { font-size: 20px; } .ts-logo > span { font-size: 24px; } .ts-logo p { display: none; }
  .ts-world { display: none; }
  .ts-panel { top: auto; bottom: 74px; right: 50%; transform: translateX(50%); width: min(92vw, 380px); }
  .ts-card { padding: 10px 12px 12px; }
  .ts-card-name { font-size: 20px; margin-bottom: 6px; }
  .ts-card-rows { grid-template-columns: repeat(3, 1fr); margin-bottom: 10px; }
  .ts-card-rows span { flex-direction: column; padding: 4px; }
  .ts-start { padding: 10px; font-size: 18px; }
  .ts-bar { bottom: 12px; }
  .ts-wood { padding: 8px 16px; font-size: 13px; }
}
.title-screen.ms .title-foot { left: 14px; right: auto; bottom: 14px; transform: none; justify-content: flex-start; }
@media (max-width: 900px) { .title-screen.ms .title-foot span { display: none; } .title-screen.ms .title-foot { bottom: auto; top: 14px; left: auto; right: 12px; } }
@media (max-height: 520px) and (min-width: 600px) {
  .ts-panel { top: 50%; bottom: auto; right: 12px; transform: translateY(-50%); width: 230px; }
  .ts-card-rows { grid-template-columns: 1fr; gap: 3px; }
  .ts-card-rows span { flex-direction: row; padding: 3px 8px; }
  .ts-card-head { padding: 4px; } .ts-card-head b { font-size: 20px; }
  .ts-logo { transform: scale(.8); transform-origin: top left; }
  .ts-bar { left: 14px; transform: none; }
}
.style-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.style-row button { padding: 6px 12px; border-radius: 12px; background: #fff; border: 2px solid #e3ebf5; font-weight: 700; font-size: 13px; color: var(--navy); }
.style-row button.on { border-color: var(--gold); background: #fff6dc; }
/* v0.8 world map realm signs */
.v3-world .map-label { z-index: 2; padding: 5px 14px; border-radius: 10px; background: linear-gradient(#c58d55, #8a5a32); border: 2px solid #e9c48a; box-shadow: 0 3px 0 #4a2c17; color: #fff3d6; font: 800 11px var(--sans); font-style: normal; letter-spacing: 2px; text-shadow: none; opacity: 1; }
.v3-world .label-mortal { left: 3%; top: 44%; } .v3-world .label-sea { left: 41%; top: 86%; } .v3-world .label-sky { left: 61%; top: 7%; } .v3-world .label-under { left: 84%; top: 62%; }
.v3-world .label-under { background: linear-gradient(#7a64b8, #4a3a7a); border-color: #c9b8ff; box-shadow: 0 3px 0 #2d2548; }
.v3-world .label-sky { background: linear-gradient(#fff, #f0e4ff); color: #7a5ab8; border-color: #ffd86a; box-shadow: 0 3px 0 #c9b8f0; }
.v3-world .label-sea { background: linear-gradient(#5fc8ec, #2a8fc0); border-color: #bff0ff; box-shadow: 0 3px 0 #1f6a90; }

/* v0.9 town hub */
.town-screen { position: relative; height: 100dvh; overflow: hidden; background: #bfe6ff; touch-action: none; user-select: none; }
#town-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: pointer; }
.town-name { position: absolute; z-index: 3; top: 84px; left: 50%; transform: translateX(-50%); padding: 6px 26px; text-align: center; border-radius: 14px; background: linear-gradient(#c58d55, #8a5a32); border: 3px solid #e9c48a; box-shadow: 0 4px 0 #4a2c17, var(--shadow-sm); color: #fff3d6; pointer-events: none; }
.town-name small { display: block; font: 800 10px var(--sans); letter-spacing: 3px; color: #ffe08a; }
.town-name strong { font: 900 22px var(--serif); letter-spacing: 2px; }
.town-bubble { position: absolute; z-index: 4; left: 50%; top: 150px; transform: translateX(-50%); min-width: 260px; max-width: 420px; padding: 12px 18px; border-radius: 18px; background: #fffdf6; border: 3px solid #e9c48a; box-shadow: 0 6px 0 #c9a06a, var(--shadow); text-align: center; pointer-events: none; animation: bubble-pop .18s ease-out; }
.town-bubble::after { display: none; }
.town-bubble strong { display: block; font: 900 16px var(--serif); color: var(--navy); }
.town-bubble span { display: block; margin-top: 3px; font-size: 13px; color: #5a4a3a; }
.town-bubble em { display: inline-block; margin-top: 6px; padding: 2px 10px; border-radius: 8px; background: #ffd06a; color: #6a3e00; font: 800 11px var(--sans); font-style: normal; }
.town-dock { left: 50%; transform: translateX(-50%); bottom: 16px; }
.town-pad { position: absolute; z-index: 4; left: 16px; bottom: 110px; display: none; gap: 10px; }
.town-actions { position: absolute; z-index: 4; right: 16px; bottom: 110px; display: none; gap: 10px; align-items: flex-end; }
.town-actions .act-key.ready { border-color: var(--gold); box-shadow: 0 5px 0 #c18a24, 0 0 22px #ffd06a; animation: pulse 1s infinite; }
.town-help { position: absolute; z-index: 3; right: 18px; bottom: 112px; margin: 0; padding: 6px 12px; border-radius: 10px; background: rgba(30,42,68,.65); color: #fff; font-size: 12px; font-weight: 600; pointer-events: none; }
@keyframes bubble-pop { from { transform: translateX(-50%) scale(.8); opacity: 0; } }
@media (hover: none), (max-width: 900px) { .town-pad, .town-actions { display: flex; } .town-help { display: none; } .town-bubble { top: 118px; } }
@media (max-width: 760px) { .town-dock { left: 8px; right: 8px; transform: none; overflow-x: auto; } .town-name { top: 70px; } }
