:root { color-scheme:dark; --ink:#412b22; --cream:#fff2d2; --gold:#ffd583; --teal:#346a51; --blue:#18213b; --glass:#171a30ee; --edge:#e4ae61; font: 500 15px/1.3 system-ui,sans-serif; }
* { box-sizing:border-box; }
body { margin:0; min-height:100dvh; display:grid; place-items:center; color:var(--cream); background:radial-gradient(ellipse at 50% 30%,#365259,#18182b 60%,#11141c); }
button,input { font:inherit; }
button { cursor:pointer; color:inherit; }
button:focus-visible,a:focus-visible,canvas:focus-visible { outline:3px solid #afe6eb; outline-offset:2px; }
button:disabled { opacity:.63; cursor:default; }
.phone { display:flex; flex-direction:column; position:relative; isolation:isolate; width:min(100%,460px); height:100dvh; min-height:580px; max-height:915px; overflow:auto; background:#21263e;  box-shadow:0 28px 110px #0009,0 0 0 1px #ffed9f22; }
.phone::before { content:""; position:fixed; pointer-events:none; z-index:-1; inset:0; }
.phone.town::before { display:none; }
.screen-backdrop { position:absolute;inset:0;width:100%;height:100%;object-fit:cover;z-index:-1;pointer-events:none; }
.screen { display:flex; flex:1; min-height:0; flex-direction:column; }
header { position:relative; padding:13px 56px 12px; text-align:center; background:linear-gradient(#17182cfb,#1d1d31ed); border-bottom:1px solid #e4ae6166; box-shadow:0 6px 20px #10112355; z-index:2; }
header p { margin:4px 0 0; color:var(--gold); font-size:.83rem; }
h1,h2,h3 { margin:0; line-height:1.12; font-family:Georgia,"DejaVu Serif",serif; }
h1 { font-size:clamp(1.34rem,5.1vw,1.9rem); }
h2 { font-size:1.35rem; }
p { margin:.45rem 0; }
img { vertical-align:middle; }
.back { position:absolute; left:8px; top:6px; border:0; background:none; padding:3px; width:45px; height:45px; }
.back img,.icon img,.nav img { width:100%; height:100%; object-fit:contain; }
.content { padding:14px 17px; display:grid; align-content:start; gap:12px; }
.grow { flex:1; }
.bottom { margin-top:auto; padding:10px 17px max(13px,env(safe-area-inset-bottom)); display:grid; gap:8px; }
.panel { padding:14px; border:1px solid #b386526e; border-radius:16px; background:var(--glass); box-shadow:0 5px 17px #0b142957; }
.panel p { font-size:.92rem; }
.paper { background:#fff0d6; color:var(--ink); border:2px solid #ebc079; }
.gold { color:var(--gold); }
.paper .gold { color:#945117; }
.small { font-size:.8rem; }
.center { text-align:center; }
.btn { border:1px solid #e7b861; border-radius:33px; min-height:44px; padding:8px 14px; background:linear-gradient(#589b6f,#246049 72%); color:#fff7df; text-shadow:0 1px #102018; font-weight:800; box-shadow:0 4px 0 #221b29,0 0 0 1px #211d24; }
.btn:hover { filter:brightness(1.12); }
.btn.secondary { background:linear-gradient(#fff4d7,#e7bc80); color:#59351d; text-shadow:none; }
.btn.warn { background:linear-gradient(#bc545b,#6d2039); }
.btn.quiet { background:#1d223bed; border-color:#dcb47477; box-shadow:none; }
.actions { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
nav { display:grid; grid-template-columns:repeat(5,1fr); gap:1px; padding:5px 4px max(6px,env(safe-area-inset-bottom)); margin-top:auto; background:linear-gradient(#242039,#1c182b); border-top:1px solid #d7a966a0; z-index:2; }
.nav { position:relative; min-width:0; display:grid; justify-items:center; gap:1px; padding:4px 0; border:0; background:none; font-size:.69rem; font-weight:700; }
.nav .quest-notice { position:absolute;top:4px;left:calc(50% + 12px); }
.nav img { width:35px; height:34px; }
.nav[aria-current=true] { color:var(--gold); }
.nav[aria-current=true] img { transform:scale(1.13); filter:drop-shadow(0 0 6px #f3b74899); }
.hud { position:absolute; top:10px; left:9px; right:9px; display:flex; justify-content:space-between; align-items:center; gap:10px; z-index:2; }
.icon { border:0; background:none; width:52px; height:52px; padding:0; }
.wallet { margin-left:auto; padding:4px 8px; white-space:nowrap; color:#5b371f; background:#fff1cc; border:1px solid #d9a75c; border-radius:20px; font-weight:800; }
.wallet img { width:22px; height:22px; object-fit:contain; }
.town-copy { position:absolute;top:75px;left:14px;right:14px;z-index:1;pointer-events:none; }
.town-copy button { pointer-events:auto; }
.town-copy .resume { grid-column:1;justify-self:start;width:min(245px,100%); }
.lift { margin-top:auto; }
.route { flex:1; position:relative; min-height:350px; }
.pin { position:absolute; transform:translate(-50%,-50%); width:51px; height:51px; display:grid; place-items:center; font-weight:900; font-size:1.27rem; background:var(--pin) center/contain no-repeat; border:0; text-shadow:0 2px 3px #271f30; }
.cards { display:flex; gap:12px; overflow:auto; padding:18px 14px; scroll-snap-type:x mandatory; scrollbar-color:#c99457 #292034; }
.card { background:#242236; position:relative; overflow:hidden; flex:0 0 clamp(134px,44%,180px); min-height:235px; border:2px solid #d8a660; border-radius:18px; display:flex; flex-direction:column; justify-content:end; text-align:left; padding:12px; scroll-snap-align:center; box-shadow:0 5px 16px #0008; }
.card::before { content:"";position:absolute;z-index:1;inset:45% 0 0;background:linear-gradient(transparent,#15172cf7 56%); }
.card > :not(.card-art) { position:relative;z-index:2; }
.card > img.card-art { position:absolute;inset:0;width:100%;height:100%;margin:0;object-fit:cover;pointer-events:none; }
.card span { font-size:.75rem;color:var(--gold); }
.card img { align-self:center; width:90%; height:110px; margin-bottom:24px; object-fit:contain; }
.card.locked { filter:saturate(.46); }
.hero { display:block; width:min(58%,225px); max-height:247px; object-fit:contain; margin:0 auto; }
.character-wide { display:block; width:100%; max-height:310px; object-fit:contain; }
.quest { display:grid; grid-template-columns:52px 1fr; gap:11px; align-items:center; }
.quest img { width:52px;height:58px;object-fit:contain; }
.badge { display:inline-block; background:#40321ced; color:var(--gold); border:1px solid #b8854f88; border-radius:20px; padding:3px 9px; font-size:.76rem; }
.start-content { margin:auto 0 0; padding:40px 22px 32px; text-align:center; background:linear-gradient(transparent,#171428e9 60%); }
.brand { position:absolute;inset-block-start:8.3%;inset-inline:0;margin:0 auto;
  width:min(76%,238px,22.5dvh);pointer-events:none; }
.brand img { display:block;width:100%;height:auto;object-fit:contain;filter:drop-shadow(0 4px 13px #17102580); }
.start-content .btn { width:100%; margin-top:10px; }
.entry-account-note { margin:8px 0 0;color:#e9d7ee;font-size:.75rem; }
.start-content .entry-restore { margin-top:3px;min-height:32px;padding:4px 10px;font-size:.8rem; }
.arena { position:relative;min-height:0;flex:1;margin:5px 5px 0;border:1px solid #edc482aa;
  background:linear-gradient(#252451a8,#161e3fac); }
.battle-board { position:absolute;inset:0;overflow:hidden; }
.arena canvas { position:absolute;left:50%;transform:translateX(-50%);display:block;
  width:var(--battle-canvas-width);height:100%;touch-action:none;cursor:crosshair; }
.battle-launcher { position:absolute;z-index:2;left:50%;top:var(--launcher-y);transform:translate(-50%,-50%);
  width:56px;height:48px;border:0;border-radius:15px;padding:0;background:none;touch-action:none; }
.battle-head { flex:none;display:grid;grid-template-columns:clamp(58px,16vw,73px) minmax(0,1fr) 41px;
  grid-template-areas:"portrait title pause" "portrait status info";gap:2px 7px;align-items:center;
  padding:5px 8px 6px;text-align:left;background:linear-gradient(180deg,#191831f5,#211e43dc); }
.battle-opponent { grid-area:portrait;display:block;width:100%;aspect-ratio:1;overflow:hidden;
  border:1px solid #cfa464;border-radius:13px;background:#26223c;padding:2px; }
.battle-opponent img,.battle-pause img { display:block;width:100%;height:100%;object-fit:contain; }
.battle-heading { grid-area:title;min-width:0; }
.battle-heading h1 { font-size:clamp(.9rem,3.9vw,1.2rem);overflow-wrap:anywhere; }
.battle-heading p { margin-top:2px;font-size:.68rem; }
.battle .screen { position:relative;container-type:inline-size; --battle-meter-width:min(67cqw,calc(100cqw - clamp(58px,16vw,73px) - 74px)); }
.battle-meter { position:relative;display:flex;align-items:center;justify-content:center;isolation:isolate;
  width:var(--battle-meter-width);height:18px;border:1px solid #bc9b68;border-radius:12px;overflow:hidden;
  background:#141529;color:#fff0d5;font-size:.68rem;font-variant-numeric:tabular-nums;text-shadow:0 1px 2px #120e26; }
.battle-meter-fill { position:absolute;z-index:-1;inset:0 auto 0 0;width:var(--fill,0%);border-radius:inherit;
  background:linear-gradient(#ad5662,#752a43); }
.battle-vitals { grid-column:1/-1;grid-row:1;justify-self:center;align-self:start;pointer-events:none;position:relative;z-index:5; }
.battle-team-health .battle-meter-fill { background:linear-gradient(#489d99,#21576e); }
.battle-team-health strong { margin-inline:10px auto; }
.battle-meter-fill { transition:width .33s cubic-bezier(.2,.65,.4,1); }
.battle-meter-loss { position:absolute;z-index:-1;inset:0 auto 0 0;opacity:0;transform-origin:left;
  background:linear-gradient(#ffd19c,#e56248); }

.battle-damage { position:absolute;right:9px;bottom:calc(100% + 9px);z-index:1;padding:3px 9px;
  border:1px solid #ffac82;border-radius:9px;background:#641f30;color:#fff2d2;font-size:1rem;
  font-weight:900;font-variant-numeric:tabular-nums;text-shadow:0 2px 2px #3b1324; }
.battle .screen[data-phase=opponent] .battle-opponent { animation:counterattack-windup .245s ease-out; }
.counterattack-effect { position:absolute;inset:0;z-index:4;overflow:hidden;pointer-events:none; }
.counterattack-slash { position:absolute;left:50%;top:calc(var(--impact-y) - 145px);
  width:108%;height:112px;opacity:0;clip-path:polygon(0 76%,26% 50%,72% 0,100% 3%,78% 35%,22% 92%);
  background:linear-gradient(180deg,#ed523e00 11%,#f06b5288 25%,#ffe9ae 47%,#fbb36e 53%,#ba263f32 78%),
    linear-gradient(90deg,transparent 1%,#cc384ab3 33%,#f48356c2 92%); }
.counterattack-impact { position:absolute;left:50%;top:var(--impact-y);width:98%;height:146px;opacity:0;
  background:radial-gradient(ellipse,#fff0b1bd 0%,#e55a4d9c 22%,#c22a4643 48%,transparent 71%),
    radial-gradient(ellipse,#ffdc8a8f 1%,transparent 57%);
  transform:translate(-50%,-50%); }
.battle .screen[data-phase=impact] .counterattack-impact { animation:counterattack-impact .49s ease-out both; }
.battle-team-health[data-hit=true] { animation:counterattack-health .5s ease-out; }
.battle .screen[data-phase=impact] .battle-damage:not([hidden]) { animation:counterattack-damage .54s ease-out both; }
@keyframes counterattack-windup {
  0% { box-shadow:0 0 0 #f8815377; }
  60% { transform:scale(.95);box-shadow:0 0 22px #f88153cc; }
  100% { transform:scale(1);box-shadow:0 0 3px #f8815344; }
}
@keyframes counterattack-impact {
  0% { opacity:.88;transform:translate(-50%,-50%) scale(.66); }
  45% { opacity:.53; }
  100% { opacity:0;transform:translate(-50%,-50%) scale(1.24); }
}
@keyframes counterattack-health {
  0% { transform:translateX(-3px);box-shadow:0 0 14px 3px #fc8b69ba; }
  13% { transform:translateX(4px); }
  29% { transform:translateX(-2px); }
  43%,100% { transform:none; }
}
@keyframes counterattack-damage {
  0% { transform:translateY(7px) scale(.86); }
  24% { transform:translateY(-2px); }
  75% { opacity:1; }
  100% { transform:translateY(-12px);opacity:0; }
}
.counterattack-breakdown { display:grid;gap:3px;margin:8px 0 0; }
.counterattack-breakdown>div { display:flex;justify-content:space-between;gap:8px;padding:3px 6px;
  border-bottom:1px solid #bd8f5a38; }
.counterattack-breakdown dd { margin:0;font-weight:800;white-space:nowrap; }
.counterattack-breakdown>div:last-child { background:#f4dfb9;border-radius:5px; }
@media(prefers-reduced-motion:reduce) {
  .battle-meter-fill { transition:none; }
  .battle-team-health[data-hit=true],.battle .screen[data-phase=impact] .battle-damage:not([hidden]) { animation:none; }
}
.battle-pause,.battle-info-button { width:41px;height:39px;border:0;background:none;padding:4px; }
.battle-pause { grid-area:pause; }
.battle-info-button { grid-area:info;position:relative;isolation:isolate;
  color:#563719;font:900 italic 1.19rem Georgia,serif; }
.battle-info-button::before { content:"";position:absolute;inset:4px;z-index:-1;border-radius:50%;
  border:1px solid #f9d68b;background:linear-gradient(#fff0c7,#d99a5c);box-shadow:0 2px 5px #130d24b0; }
.battle-status { grid-area:status;display:grid;gap:2px;min-width:0;color:#f4dfbc; }
.battle-info-goal .battle-kit-line { color:#765032;font-size:.74rem;font-weight:700; }
.battle-info-mode { color:#875025;text-align:center;font-size:.85rem;font-weight:750;margin:5px 0 12px; }
.battle-info-goal { padding:11px 12px;background:#f9e5c3;border:1px solid #d5a164;border-radius:12px; }
.battle-info-goal h3 { font-size:1rem; }
.battle-info-goal p { font-size:.85rem;margin:5px 0 0; }
.battle-info-objective { font-weight:750; }
.battle-star-rules { width:100%;margin-top:10px;border-spacing:0 4px;font-size:.86rem;text-align:left; }
.battle-star-rules thead { color:#734b32; }
.battle-star-rules th,.battle-star-rules td { padding:5px 9px; }
.battle-star-rules tbody th,.battle-star-rules td { background:#f6dfb9; }
.battle-star-rules tbody th { width:39%;border-radius:8px 0 0 8px; }
.battle-star-rules td { border-radius:0 8px 8px 0;font-weight:750;font-variant-numeric:tabular-nums; }
.battle-star-rules .stars img { width:19px;height:19px;transform:none; }
.battle-info-note { font-size:.79rem;margin:4px 2px 0;color:#734b32; }
.battle-tip { position:absolute;left:12%;right:12%;bottom:14%;z-index:1;pointer-events:none;
 text-align:center;margin:0;color:#ffda89;font-size:.71rem;text-shadow:0 1px 3px #100d26; }
.win-art { margin:18px auto 0;width:min(68%,225px); height:164px;object-fit:contain; }
.fields { display:grid; gap:8px; }
.range-row { display:grid;grid-template-columns:1fr auto; gap:8px; }
.range-row input { grid-column:1/-1; width:100%; accent-color:#e1a950; }
.inventory { display:grid;grid-template-columns:repeat(5,1fr); gap:6px;padding:8px;background:#642f23d5;border:1px solid #cf9154;border-radius:14px; }
.cell { display:grid;place-items:center;aspect-ratio:1;background:#3b272a;border:1px solid #b37b4d;border-radius:9px;position:relative;min-width:0;padding:3px; }
.cell img { width:90%;aspect-ratio:1;object-fit:contain; }
.cell strong { position:absolute;bottom:2px;right:4px;font-size:.73rem; }
#overlay { width:min(calc(100% - 26px),384px); max-height:90dvh; overflow:auto; border:2px solid #e7b469; border-radius:20px; color:var(--ink); background:#fff1d7; padding:17px 17px 20px; box-shadow:0 15px 50px #0007; }
#overlay::backdrop { background:#171426bc; }
#overlay h2 { text-align:center; }
#overlay .btn { width:100%; margin-top:7px; }
.notice { color:#fbc190; }
.paper .notice { color:#8c2947; font-weight:700; }
[data-disabled] { opacity:.78; }
@media (min-width:490px) { .phone { height:min(94dvh,900px);border-radius:19px; } }

.album-grid { grid-template-columns:repeat(3,1fr); }
.reward-art { max-height:min(60dvh,610px); }
#overlay.art-unlock[open] { width:min(calc(100% - 16px),446px);height:min(95dvh,860px);max-height:none;
  display:grid;grid-template-rows:minmax(0,1fr) auto;overflow:hidden;padding:0;
  background:#191521;color:#fff0d4; }
#overlay.art-unlock::backdrop { background:#151120d9; }
#overlay.art-unlock.with-close h2 { position:absolute;top:10px;left:10px;z-index:1;
  padding:6px 10px;border:1px solid #e7b469a1;border-radius:14px;background:#191521e8;
  color:#ffe6b8;font:750 .76rem/1.2 system-ui,sans-serif; }
#overlay.art-unlock .round-close { z-index:1; }
.art-unlock-frame { min-width:0;min-height:0;margin:0;background:radial-gradient(ellipse,#38293d,#191521 75%); }
.art-unlock-image { display:block;width:100%;height:100%;object-fit:contain; }
.art-unlock-caption { padding:8px 12px 12px;text-align:center;border-top:1px solid #e7b46966; }
.art-unlock-caption h3 { font-size:clamp(.96rem,4vw,1.19rem);overflow-wrap:anywhere; }
.art-unlock-details { display:flex;align-items:center;justify-content:center;gap:9px;
  color:#e9c788;font-size:.76rem;margin-top:3px; }
.art-unlock-details p { margin:0; }
.art-unlock-details .stars img { width:17px;height:17px; }

.card.locked > img:not(.card-art) { filter:brightness(0) drop-shadow(0 1px 2px #fbded078); }

.gear-stage { display:grid;grid-template-columns:66px minmax(0,1fr) 66px;align-items:center;gap:1px;min-height:270px;padding:5px 13px 3px;background:#1517222c; }
.gear-side { display:grid;justify-items:center;gap:7px; }
.gear-slot { display:grid;justify-items:center;gap:2px; }
.gear-hero { width:100%;max-height:min(46dvh,380px);object-fit:contain;filter:drop-shadow(0 12px 11px #140f25bf); }
.gear-cell { aspect-ratio:1;width:60px;max-width:100%;padding:3px;display:grid;place-items:center;position:relative;
  border:2px solid #efa747;border-radius:13px;background:linear-gradient(#512b28ef,#231a23f7);box-shadow:inset 0 0 8px #ffc06866,0 2px 5px #0008; }
.gear-cell img { width:100%;height:100%;aspect-ratio:1;object-fit:contain; }
.gear-cell strong { position:absolute;right:3px;bottom:0;font-size:.7rem;text-shadow:0 1px 3px black;background:#573526db;border-radius:8px;padding:0 3px; }
.gear-empty { color:#ffd994;font-size:1.42rem;font-weight:bold; }
.gear-caption { font-size:.69rem;color:#fff0c5;text-shadow:0 1px 2px #0b1024; }
.gear-stats { display:grid;grid-template-columns:66px 1fr;gap:11px;align-items:center;padding:7px 10px; }
.gear-stats .gear-cell { width:44px; }
.gear-preview { width:84px;height:84px;object-fit:contain; }
.equipment .content { gap:5px;padding-top:3px;padding-bottom:2px; }

.stars { display:inline-flex;justify-content:center;gap:2px; pointer-events:none; }
.stars img { width:17px;height:17px;object-fit:contain; }
.pin-rating { position:absolute;top:-13px;left:50%;transform:translateX(-50%);min-width:54px; }
.pin:disabled .pin-rating { opacity:.8; }
.result-rating { display:flex;margin:3px auto 6px; }
.result-rating img { width:38px;height:38px;filter:drop-shadow(0 1px 4px #000b); }
.shop-balance { position:sticky;top:0;z-index:3;padding:7px;background:#251e31e5; }
.shop-wallet { display:flex;justify-content:center;gap:8px;margin:6px auto; }
.shop-wallet span { display:flex;gap:4px;min-width:74px;justify-content:center;align-items:center;
  padding:2px 9px;border:1px solid #d6a765;border-radius:19px;background:#fff0cf;color:#57341c;font-weight:800; }
.shop-wallet img { width:24px;height:24px;object-fit:contain; }
#overlay .gold { color:#805014; font-weight:800; }

.stars img:first-child { transform:translateY(1px) rotate(-13deg); }
.stars img:nth-child(2) { transform:translateY(-5px) scale(1.12); }
.stars img:nth-child(3) { transform:translateY(1px) rotate(13deg); }
.nav, .quest-tab, .mission-title { position:relative; }
.quest-notice { width:10px;height:10px;border-radius:100%;background:#fa3e55;border:1px solid #ffeae3;box-shadow:0 1px 5px #4d142bd1;display:inline-block;flex:none; }
.quest-tab .quest-notice { position:absolute;right:10px;top:7px; }
.mission-title { display:flex;align-items:center;justify-content:space-between;gap:8px; }
.mission-title .quest-notice { margin-right:2px; }
.arena { position:relative; }
.opponent-taunt { position:absolute;left:6%;right:6%;bottom:18%;pointer-events:none;z-index:1;min-height:42px;
 background:#fff2d8;color:#563625;border:1px solid #e5b96b;border-radius:17px;padding:9px 13px;text-align:center;
 font-weight:750;font-size:.84rem;box-shadow:0 5px 17px #170e2c92;animation:taunt 3.85s ease both; }
.opponent-taunt::after { content:"";position:absolute;bottom:-8px;left:38px;width:14px;height:14px;transform:rotate(45deg);background:#fff2d8;border-right:1px solid #e5b96b;border-bottom:1px solid #e5b96b; }
@keyframes taunt { 0% { opacity:0;transform:translateY(12px) scale(.93); } 7%,88% { opacity:1;transform:none; } 100% { opacity:0;transform:translateY(-7px); } }
@media (prefers-reduced-motion:reduce) { .opponent-taunt { animation:none; } }
.result-scene { display:grid;place-items:center;flex:1;padding:43px 7px 30px; }
.result-scene.is-victory { background:radial-gradient(ellipse at 50% 32%,#21543d77,#14152be8 82%); }
.result-scene.is-defeat { background:radial-gradient(ellipse at 50% 37%,#69264582,#180f26ed 82%); }
.result-card { position:relative;width:min(100%,394px);text-align:center;color:var(--ink);padding:61px 41px 43px;
 background:var(--paper) center/100% 100% no-repeat;filter:drop-shadow(0 14px 24px #0b0c22a9); }
.result-ribbon { position:absolute;top:-26px;left:7%;right:7%;height:111px;display:grid;place-items:center; }
.result-ribbon img { position:absolute;inset:0;width:100%;height:100%;object-fit:fill; }
.result-ribbon h1 { position:relative;color:white;font-size:1.69rem;text-shadow:0 2px 1px #3d2233; }
.result-detail { display:grid;gap:7px;justify-items:center; }
.result-detail h2 { font-size:1.21rem; }
.result-detail .result-rating { margin:1px auto 0; }
.result-detail .result-rating img { width:32px;height:32px;filter:drop-shadow(0 1px 3px #6c451a60); }
.result-detail .result-rating img:nth-child(2) { transform:translateY(-6px) scale(1.16); }
.result-seal { width:100%;height:86px;position:relative;margin:0 auto; }
.result-trails { position:absolute;width:100%;height:100%;left:0;top:0;object-fit:contain; }
.result-fragment { position:absolute;top:0;width:71px;height:84px;object-fit:contain; }
.result-fragment.left { right:50%; }
.result-fragment.right { left:48%; }
.result-emblem { width:88px;height:88px;object-fit:contain; }
.result-goal { display:flex;align-items:center;justify-content:center;gap:9px;margin:16px 0 8px;
 border:1px solid #c9914b;border-radius:19px;padding:5px 15px;background:#f7ca8e; }
.result-goal img { width:28px;height:28px; }
.reward-grid { width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;margin:3px auto; }
.reward-chip { min-width:0;display:flex;align-items:center;gap:4px;text-align:left;
 color:#5e3522;border:1px solid #ca9456;padding:4px;background:#f9dfb3;border-radius:9px; }
.reward-chip img { width:32px;height:32px;object-fit:contain;flex:none; }
.reward-chip div { min-width:0; }
.reward-chip strong { display:block;font-size:.88rem;line-height:1.09;overflow-wrap:anywhere; }
.reward-chip span { display:block;font-size:.71rem; }
.reward-chip-gear { grid-column:1/-1;gap:7px;padding:6px 8px; }
.reward-chip-gear img { width:43px;height:43px; }
.reward-chip .reward-sell.btn { width:auto;min-height:36px;margin-left:auto;padding:3px 8px;font-size:.75rem; }
.result-actions { display:grid;gap:7px;margin-top:13px; }
@media (max-width:360px) { .result-card { padding-left:32px;padding-right:32px; } }

.screen.with-nav { overflow:hidden;height:100%; }
.screen.with-nav > header, .screen.with-nav > nav { flex:0 0 auto; }
.screen.with-nav > nav { margin-top:0; }
.screen-scroller { flex:1 1 0;min-height:0;overflow:auto;overscroll-behavior-y:contain;display:flex;flex-direction:column; }
.screen-scroller > * { flex-shrink:0; }

.star-total { display:inline-flex;align-items:center;gap:4px;color:#ffdc8b;font-size:.78rem;font-weight:800;
 white-space:nowrap;padding:3px 7px;border:1px solid #b4854aae;border-radius:16px;background:#272039e8;align-self:flex-start; }
.star-total img { width:18px;height:18px;object-fit:contain;margin:0; }
.card .star-total { margin-top:5px;color:#ffdc8b; }
.map-star-total { position:absolute;z-index:2;right:10px;top:78px; }

#overlay.with-close h2 { padding:0 34px; }
.round-close { position:absolute;right:9px;top:9px;width:36px;height:36px;line-height:30px;padding:0;
 border:1px solid #af7844;border-radius:100%;background:linear-gradient(#fff5df,#e5bc83);
 color:#674122;font-weight:900;font-size:1.45rem; }

.selection-tiles { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;margin-top:9px; }
.selection-tile { display:grid;justify-items:center;min-width:0;border:1px solid #c18b52aa;border-radius:10px;
 background:#1d182de5;padding:5px 2px;font-size:.72rem;line-height:1.17; }
.selection-tile img { width:34px;height:34px;object-fit:contain; }
.selection-tile strong { color:var(--gold);font-size:.98rem; }
.basic-count { margin:0;white-space:nowrap; }

[data-rarity=common] { --rarity:#d7b48a;--rarity-bg:#3c2c32;--rarity-ink:#62412d; }
[data-rarity=uncommon] { --rarity:#70c891;--rarity-bg:#203d3b;--rarity-ink:#2d6045; }
[data-rarity=rare] { --rarity:#68b7fa;--rarity-bg:#203758;--rarity-ink:#28557b; }
[data-rarity=epic] { --rarity:#bd8af8;--rarity-bg:#3e2858;--rarity-ink:#6b3685; }
[data-rarity=legendary] { --rarity:#ffd363;--rarity-bg:#503821;--rarity-ink:#805313; }
[data-rarity=mythical] { --rarity:#ff7e9b;--rarity-bg:#55243f;--rarity-ink:#8a3059; }
.cell[data-rarity], .gear-cell[data-rarity] { border:2px solid var(--rarity);
 background:radial-gradient(var(--rarity-bg) 48%,#1b1728);box-shadow:inset 0 0 9px var(--rarity-bg); }
.reward-chip[data-rarity], .gear-detail[data-rarity] { border-color:var(--rarity); }
.gear-details-lead { display:grid;grid-template-columns:77px minmax(0,1fr);gap:7px;align-items:center;text-align:left; }
.gear-details-lead .gear-preview { width:73px;height:73px;border:1px solid var(--rarity);border-radius:12px;background:var(--rarity-bg); }
.gear-details-lead h2 { text-align:left !important;font-size:1.07rem; }
.rarity-label { display:inline-block;color:var(--rarity-ink);font-size:.78rem;font-weight:900;margin-top:4px; }
.item-stats { display:grid;gap:4px;margin-top:7px; }
.item-stat { display:grid;grid-template-columns:21px 1fr auto;gap:6px;align-items:center;text-align:left;
 padding:3px 6px;min-height:28px;border-radius:7px;background:#f0d7b467;font-size:.82rem; }
.item-stat img { width:20px;height:20px;object-fit:contain; }
.item-stat.is-locked { color:#796a68;background:#e4d3c3; }
.stat-lock { display:flex;align-items:center;gap:3px;font-size:.73rem; }
.stat-lock img { width:15px;height:15px; }
.rarity-effect { color:var(--rarity-ink);border-top:1px solid var(--rarity);padding-top:5px;font-weight:800; }

.quest-item-reward { display:flex;gap:7px;align-items:center;border:1px solid var(--rarity,#c58d53);border-radius:10px;
 padding:3px 6px;margin:5px 0;background:#2d203888;color:#ffe9c1;text-align:left;font-size:.81rem; }
.quest-item-reward img { width:31px;height:31px;object-fit:contain;flex:none; }
.result-detail .quest-item-reward { background:#f7deb5;color:#633a23; }
.drop-row { display:grid;grid-template-columns:34px minmax(0,1fr) 52px;align-items:center;gap:6px;margin:4px 0;
 border:1px solid var(--rarity,#d6a15d);border-radius:9px;padding:3px 5px; }
.drop-row img { width:31px;height:31px;object-fit:contain; }
.drop-row strong { text-align:right; }

.prepare-content { gap:9px;padding:10px 13px; }
.prepare-opponent { display:grid;grid-template-columns:clamp(56px,18vw,80px) minmax(0,1fr) 40px;gap:8px;align-items:center;padding:9px; }
.prepare-opponent > img { width:100%;aspect-ratio:1;object-fit:contain;border:1px solid #cc9c62;background:#271c34;border-radius:12px; }
.prepare-opponent h2 { font-size:clamp(1rem,4.9vw,1.28rem); }
.prepare-objective,.prepare-opponent-facts,.prepare-opponent-facts span { display:flex;align-items:center;gap:4px; }
.prepare-objective { color:var(--gold);font-size:.76rem;line-height:1.2;margin:5px 0; }
.prepare-objective img,.prepare-opponent-facts img { flex:none;width:17px;height:17px;object-fit:contain; }
.prepare-opponent-facts { flex-wrap:wrap; }
.prepare-opponent-facts span { padding:3px 5px;border:1px solid #97704b;border-radius:10px;background:#30243a;
  color:#ffeed0;font-size:.7rem;font-weight:800;font-variant-numeric:tabular-nums; }
.prepare-info.btn { width:40px;min-height:40px;padding:0;font:bold italic 1.17rem Georgia,serif;align-self:start;box-shadow:none; }
.prepare-affinity { display:flex;align-items:center;gap:8px;flex-wrap:wrap; }
.prepare-affinity > img { width:38px;height:38px;object-fit:contain; }
.prepare-affinity > div { flex:1 1 145px; }
.prepare-affinity h2,.prepare-affinity p { margin:0; }
.prepare-rewards { padding:9px; }
.prepare-reward-head,.prepare-training { display:flex;align-items:center;justify-content:space-between;gap:5px; }
.prepare-reward-head h2 { font-size:1.18rem; }
.prepare-reward-head .btn,.prepare-training .btn { min-height:36px;flex:none;padding:4px 9px;font-size:.74rem; }
.prepare-rewards p { margin:4px 0 2px;font-size:.74rem; }
.prepare-rewards .reward-chip img { width:28px;height:28px; }
.prepare-training p { margin:0;font-size:.79rem; }
.prepare .bottom { position:sticky;bottom:0;background:#211b2de8;z-index:2; }

.trial-members { position:absolute;z-index:2;top:74px;left:12px;display:flex;gap:4px; }
.trial-member { width:36px;height:36px;border:1px solid #efbd75;border-radius:50%;overflow:hidden;background:#2f2938; }
.trial-member img { width:100%;height:100%;object-fit:contain; }
.trial-member.is-locked img { filter:grayscale(1) brightness(.52); }
.trial-hint { margin:0;padding:4px 6px;text-align:center;font-size:.8rem;background:#261e34ea;border-radius:8px;color:var(--gold); }
.trial-route .map-star-total { top:77px; }
.map-screen { position:relative;isolation:isolate;display:flex;flex:1;min-height:0;flex-direction:column; }
.map-screen > .route { min-height:0; }
.map-screen > header,.map-screen > .bottom,.map-screen + nav { flex:0 0 auto; }
.map-screen + nav { margin-top:0; }
.elemental-route-note { position:absolute;z-index:2;top:78px;left:10px;display:flex;align-items:center;gap:5px;
  max-width:60%;padding:4px 6px;border:1px solid #b48b56;border-radius:9px;background:#27203aeb;color:#ffedcf; }
.elemental-route-note img { width:23px;height:23px;object-fit:contain; }
.elemental-route-note p { margin:0;font-size:.72rem; }
.screen:has(> .map-screen) { overflow:hidden;height:100%; }
.map-art { position:absolute;inset:0;width:100%;height:100%;object-fit:cover;z-index:-1;pointer-events:none; }
.map-screen:has(.expansion-pin) .map-art,.trial-route .map-art { object-fit:fill; }
.duet-map-portrait { width:60px;height:60px;position:absolute;left:13px;top:76px;z-index:2;
 border:1px solid #dca953;border-radius:15px;background:#241d34df;padding:2px; }
.duet-map-portrait img { width:100%;height:100%;object-fit:contain; }
.pin.pin-selected { outline:2px solid #ffe19b;outline-offset:3px;filter:drop-shadow(0 0 7px #37223c); }
.pin.pin-selected:disabled { opacity:1; }
.episode-summary { text-align:center;padding:9px 12px; }
.episode-summary h2 { font-size:1.04rem; }

.modes .screen-scroller,.stories .screen-scroller { scrollbar-width:none; }
.modes .screen-scroller::-webkit-scrollbar,.stories .screen-scroller::-webkit-scrollbar { display:none; }
.modes-grid { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;
 padding:14px 13px 21px;overflow:visible;scroll-snap-type:none; }
.modes-grid .card { width:100%;min-height:clamp(190px,30dvh,267px); }
.modes-grid .card[data-mode].locked { filter:none; }
.modes-grid .card[data-mode].locked .card-art { filter:grayscale(1) brightness(.67); }
.modes-grid .mode-lock { position:absolute;top:7px;right:7px;width:32px;height:32px;display:grid;place-items:center;
  border:1px solid #be9c6b;border-radius:50%;background:#201d32ed;box-shadow:0 1px 6px #1410219e; }
.modes-grid .mode-lock img { width:19px;height:19px;margin:0;object-fit:contain; }
.modes-grid .card:last-child:nth-child(odd) { grid-column:1/-1;justify-self:center;width:calc((100% - 12px)/2); }

.quest-card.is-claimable { border-color:#e3a86b;box-shadow:0 3px 13px #78364856; }
.quest-card.is-claimed { background:#353540ef;border-color:#827b894f;box-shadow:none;color:#cec9d1; }
.quest-card.is-claimed h2,.quest-card.is-claimed .gold { color:#c6bfca; }
.quest-card.is-claimed img { filter:saturate(.38); }
.quest-card.is-locked { border-color:#85748a70; }

.workshop-wallet { display:flex;justify-content:space-evenly;gap:5px;background:#241e32e8;border:1px solid #bd8d58;border-radius:13px;padding:6px; }
.workshop-wallet span { display:flex;align-items:center;white-space:nowrap;gap:4px;color:#ffdfae;font-weight:750;font-size:.79rem; }
.workshop-wallet img { width:28px;height:28px;object-fit:contain; }
.workshop-content { padding:10px 12px;gap:8px; }
.workshop-content .gear-detail,.workshop-action { padding:9px 11px; }
.workshop-content .gear-details-lead { grid-template-columns:58px minmax(0,1fr); }
.workshop-content .gear-preview { width:54px;height:54px; }
.workshop-content .gear-details-lead p { margin:2px 0 0; }
.workshop-action { display:grid;gap:6px; }
.workshop-action h2 { font-size:1rem; }
.workshop-action p { margin:0; }
.workshop-more-stats,.workshop-forge-odds { font-size:.81rem; }
.workshop-more-stats { margin-top:5px; }
.workshop-more-stats summary,.workshop-forge-odds summary { min-height:28px;align-content:center;cursor:pointer;font-weight:750; }
.workshop-forge-odds summary { color:#ffdfa8; }
.workshop-footer { flex:none;padding:6px 12px 9px;background:#251d31ec;border-top:1px solid #ac7d55; }
.workshop-pick.btn { display:flex;align-items:center;justify-content:center;gap:7px;width:100%;padding-block:4px; }
.workshop-pick img { width:26px;height:26px;object-fit:contain; }
.workshop-picker { display:grid;gap:8px;margin-top:8px; }
.workshop-picker-filters { display:grid;grid-template-columns:minmax(0,1fr) minmax(0,.62fr);gap:5px; }
.workshop-picker-filters input,.workshop-picker-filters select { min-width:0;min-height:42px;padding:5px 6px;
  color:#4d3226;background:#fff8e7;border:1px solid #b78b61;border-radius:7px;font:inherit;font-size:.8rem; }
.workshop-picker-items { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;padding:2px;
  max-height:58dvh;overflow:auto;overscroll-behavior:contain; }
.workshop-choice { display:grid;grid-template-columns:38px minmax(0,1fr);align-items:center;gap:4px;min-width:0;
  min-height:49px;padding:3px;border:1px solid var(--rarity,#d3a96f);border-radius:8px;background:#fae6c1;
  text-align:left;font-size:.71rem;line-height:1.12;overflow-wrap:anywhere; }
.workshop-choice[aria-pressed=true] { box-shadow:inset 0 0 0 1px #956638;background:#f1d29a; }
.workshop-choice-art { display:grid;place-items:center;width:38px;height:38px;position:relative;border-radius:6px;background:var(--rarity-bg); }
.workshop-choice-art img { width:100%;height:100%;object-fit:contain; }
.workshop-choice-art .gear-upgrade { top:0;right:0;min-width:0;line-height:13px;font-size:.58rem; }
.workshop-picker-empty { grid-column:1/-1;text-align:center; }
.workshop-grid { display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px;margin-top:8px; }
.workshop-grid .gear-cell { width:100%; }
.forge-selected { outline:2px solid #ffdf9a;outline-offset:1px; }
.forge-stats { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;margin:5px 0; }
.forge-stats .btn { display:flex;align-items:center;justify-content:center;gap:3px;padding:4px;font-size:.76rem; }
.forge-stats img { flex:none;width:18px;height:18px;object-fit:contain; }
.forge-odds { display:flex;flex-wrap:wrap;gap:4px;margin:7px 0; }

.purchase-art { width:104px;height:104px;object-fit:contain;display:block;margin:0 auto; }

.house-stage { position:relative;isolation:isolate;min-height:100%;display:flex;flex-direction:column;justify-content:end; }
.house-room { position:absolute;inset:0;z-index:-1;isolation:isolate; }
.room-background { position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center 53%; }
.guest-full { position:absolute;z-index:1;bottom:26%;left:50%;transform:translateX(-50%);max-width:42%;
 height:52%;object-fit:contain;object-position:bottom;filter:drop-shadow(0 7px 5px #352317be); }
.guest-bust { height:39%;bottom:29%;max-width:40%; }
.room-hotspot { position:absolute;z-index:2;display:flex;align-items:center;justify-content:center;gap:4px;
 min-height:36px;padding:3px 8px;border-radius:18px;border:1px solid #ecc780;background:#332822ed;color:#fff0c5;
 font-size:.74rem;font-weight:850;box-shadow:0 2px 7px #1f1428af; }
.room-hotspot img { width:26px;height:26px;object-fit:contain; }
.room-hotspot[data-furnished="false"] { background:#49382be5; }
.room-bed { right:4%;top:47%; }
.room-tea { left:12%;top:40%; }
.room-music { left:2%;top:27%; }
.house-controls { padding:22px 10px 10px;gap:7px;background:linear-gradient(transparent,#211a26e8 18%,#211a26f5);
 pointer-events:none; }
.house-controls button { pointer-events:auto; }
.house-controls .btn { min-height:38px; }
.home-status { display:flex;align-items:center;justify-content:space-between;gap:6px;color:#ffdfab; }
.home-status h2 { font-size:1.13rem; }
.home-status p { margin:3px 0 4px;font-size:.78rem; }
.home-invite-count,.guest-invite-balance { display:flex;align-items:center;gap:4px;white-space:nowrap;font-weight:800; }
.home-invite-count img,.guest-invite-balance img { width:37px;height:37px;object-fit:contain; }
.guest-invite-balance { justify-content:center; }
.decorate-option { display:grid;grid-template-columns:70px minmax(0,1fr);gap:8px;align-items:center;
 margin:8px 0;text-align:left; }
.decorate-option img { width:68px;height:68px;object-fit:contain; }
.guest-note { text-align:center; }
.guest-grid.collection-grid { padding-inline:0; }
.decor-wallet img { width:24px;height:24px; }

.shop-balance .actions { margin:0 6px 3px; }
.shop-balance .btn { min-height:37px;font-size:.81rem; }
.shop-balance .shop-tabs { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px; }
.shop-tabs .btn { min-width:0;padding-inline:4px; }

.market-grid { grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;padding:11px 11px 18px; }
.market-grid.market-sparks { grid-template-columns:repeat(2,minmax(0,1fr)); }
.market-cell { min-width:0;padding:5px;min-height:112px;display:grid;grid-template-rows:56px minmax(26px,auto) 22px;
 align-items:center;justify-items:center;gap:2px;text-align:center;border:1px solid var(--rarity,#bc8953);border-radius:12px;
 background:linear-gradient(#472f32f5,#2e2233f5);color:#fff0c8;box-shadow:0 3px 8px #19132080; }
.market-cell:hover,.market-cell:focus-visible { border-color:#ffdea0;background:#543b3e; }
.market-cell strong { font-size:clamp(.67rem,2.8vw,.81rem);line-height:1.08;overflow-wrap:anywhere; }
.market-item-art { width:58px;height:58px;max-width:94%;object-fit:contain; }
.market-cell[data-offer^="retry"] .market-item-art { width:67px;height:64px; }
.market-price { display:flex;align-items:center;gap:3px;font-size:.78rem;font-weight:850;color:#ffdb93; }
.market-price img { width:18px;height:18px;object-fit:contain; }

.gear-action-row,.gear-slot-filters { display:grid;gap:5px; }
.gear-action-row { grid-template-columns:repeat(3,minmax(0,1fr)); }
.gear-slot-filters { grid-template-columns:repeat(2,minmax(0,1fr));margin-bottom:6px; }
#overlay .gear-slot-action,#overlay .gear-slot-filters .btn { min-width:0;min-height:44px;padding:4px 2px;box-shadow:none; }
#overlay .gear-slot-action { display:flex;align-items:center;justify-content:center;gap:3px;
  border-radius:11px;font-size:clamp(.65rem,2.7vw,.77rem); }
.gear-slot-action i { font-style:normal;font-size:1.24rem;line-height:1; }
.gear-slot-action img { width:21px;height:21px;object-fit:contain; }
.gear-slot-filters .btn { font-size:.79rem; }
#overlay:has(.gear-picker-content)[open] { display:flex;flex-direction:column;overflow:hidden;padding:12px; }
#overlay:has(.gear-picker-content) > h2 { flex:none; }
.gear-picker-content { min-height:0;overflow:auto;overscroll-behavior:contain;padding:0 5px; }
.gear-picker-actions { flex:none;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;padding:0 5px 4px; }
#overlay .gear-picker-actions .btn { padding:5px 7px;font-size:.79rem; }
.gear-picker-actions .btn:only-child { grid-column:1/-1; }
.slot-options { grid-template-columns:repeat(4,minmax(0,1fr));max-height:min(215px,29dvh);overflow-y:auto;
  align-content:start;overscroll-behavior:contain;padding:4px;margin:3px 0 9px; }
.slot-options .gear-cell { height:auto;min-height:0;aspect-ratio:1.12; }
.slot-options .forge-selected { outline-color:#804f35; }
.gear-option-owner { position:absolute;bottom:1px;left:1px;right:1px;padding:2px;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background:#1f1429e8;color:#fff0d3;
  border-radius:4px;font-size:.59rem;font-weight:750;line-height:1.1; }
.gear-options-empty,.gear-worn-by { font-size:.79rem;color:#77523a;text-align:center; }
.gear-transfer-route { padding:7px;border-radius:7px;background:#f4d8ab;text-align:center;font-weight:800; }
.gear-compare-section { margin-top:7px; }
.gear-compare-section h3 { font-size:.92rem; }
.gear-compare-metrics td { width:18%;font-variant-numeric:tabular-nums; }
.gear-compare-metrics th { font-size:.72rem; }
.gear-compare-metrics tbody th { white-space:nowrap; }
.gear-compare-metrics thead th:not(:first-child) { text-align:center; }
.gear-compare-metrics th img { width:16px;height:16px;margin-right:3px; }
@media (max-width:350px) {
  #overlay .gear-slot-action { flex-direction:column;gap:1px; }
}
.comparison-pair { display:grid;grid-template-columns:1fr 1fr;gap:6px;text-align:center; }
.comparison-item { display:grid;justify-items:center;align-content:start;gap:3px;padding:5px;
 min-height:104px;border:1px solid var(--rarity,#b59680);background:#f4dbb5;border-radius:10px; }
.comparison-item img { width:43px;height:43px;object-fit:contain; }
.comparison-item strong { font-size:.82rem; }
.comparison-label { color:#6e5141;font-size:.72rem;font-weight:750; }
.comparison-table { width:100%;border-collapse:collapse;font-size:.78rem;margin:8px 0; }
.comparison-table th,.comparison-table td { padding:5px 2px;border-bottom:1px solid #caac88; }
.comparison-table th { text-align:left; }
.comparison-table td { width:24%;font-weight:800;text-align:center; }
.comparison-table th img { width:19px;height:19px;object-fit:contain;margin-right:4px; }
.comparison-table td img { width:15px;height:15px;object-fit:contain; }
.comparison-table .stat-up { color:#3a714d; }
.comparison-table .stat-down { color:#8e3d3e; }

.stat-bonus { color:#9a3047;font-weight:850;white-space:nowrap; }
.gear-stat-value { white-space:nowrap; }
.gear-upgrade { position:absolute;top:2px;right:2px;min-width:22px;padding:0 3px;line-height:17px;font-size:.68rem;
 font-weight:900;background:#56273e;color:#ffdeb1;border:1px solid #dcad72;border-radius:6px;box-shadow:0 1px 4px #211825ba; }

.wallet.resource-trigger { display:flex;align-items:center;gap:7px; }
.wallet.resource-trigger span { display:flex;align-items:center;gap:2px; }
.shop-wallet.resource-trigger { border:0;background:none;padding:0; }
@media (max-width:370px) {
  .town .hud { gap:6px; }
  .town .hud > .icon { flex:0 0 42px;width:42px;height:42px; }
  .town .wallet.resource-trigger { gap:4px;padding:3px 5px;font-size:.87rem; }
  .town .wallet img { width:18px;height:18px; }
}
.resource-grid { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;margin-top:9px; }
.resource-tile { display:grid;justify-items:center;gap:2px;text-align:center;padding:5px 2px;color:#5d3824;
 border:1px solid #cea46e;border-radius:10px;background:#f4d9b4; }
.resource-tile img { width:52px;height:52px;object-fit:contain; }
.resource-tile strong { font-size:.92rem; }
.resource-tile span { font-size:.69rem; }


.journal { display:flex;flex-direction:column;min-height:100%; }
.journal-tabs { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;position:sticky;top:0;z-index:1;
 background:#232034f5;padding:8px 8px 7px;border-bottom:1px solid #ca945e88; }
.quest-tab { display:grid;align-content:center;justify-items:center;gap:2px;min-width:0;min-height:52px;padding:3px 2px;
 border:1px solid #ad8154;border-radius:9px;background:#372c3d;color:#ffeac0;font-size:.7rem;font-weight:850; }
.quest-tab img { width:23px;height:23px;object-fit:contain; }
.quest-tab[aria-pressed="true"] { color:#52301d;background:linear-gradient(#fff0c8,#e6bc82);border-color:#ffdd96; }
.journal-content { padding:10px 9px; }
.journal-content > p { margin:0;color:#ffedc9;text-shadow:0 2px 4px #000; }
.journal-deck { display:grid;gap:7px; }
.journal-deck .quest-card { display:grid;gap:5px;padding:8px;background:#fff0d9;color:#4f3126;border-radius:12px; }
.journal-deck .quest-card.is-claimable { border:2px solid #daa74f; }
.journal-deck .quest-card.is-claimed,.journal-deck .quest-card.is-locked { background:#ded0c3;color:#554b4d; }
.journal-deck .quest-card.is-claimed h2 { color:#554b4d; }
.journal-main { display:grid;grid-template-columns:44px minmax(0,1fr);gap:6px;align-items:start; }
.journal-main > img { width:44px;height:44px;object-fit:contain;border:1px solid var(--rarity,#ac805a);border-radius:8px;background:#382c3c; }
.journal-main h2 { font-size:1.03rem; }
.journal-main p { margin:3px 0;font-size:.76rem; }
.journal-deck .journal-reward { font-size:.72rem;color:#74451f; }
.journal-claimed { margin:0 0 0 auto;font-size:.75rem!important; }
.journal-deck .btn { justify-self:end;min-height:34px;font-size:.76rem;padding:4px 12px; }
.journal-meter { display:flex;align-items:center;gap:7px;color:#6b3d22;font-size:.72rem; }
.journal-meter progress { width:min(100%,122px);height:10px;accent-color:#527c52; }
.achievements-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
.achievements-grid .journal-main { grid-template-columns:1fr; }
.achievements-grid .quest-card { align-content:start; }
.achievements-grid .btn { justify-self:stretch;padding:3px;font-size:.69rem; }

.bag-content { gap:8px; }
.bag-filter-panel { padding:5px 6px 4px;border:1px solid #c59a617d;border-radius:12px;background:#201a32ed; }
.bag-filter-bar { display:flex;align-items:center;gap:6px; }
.bag-filter-button.btn,.bag-filter-reset.btn { display:flex;align-items:center;gap:6px;min-height:32px;padding:3px 7px;
  border:1px solid #c59a617d;background:#432d34;border-radius:8px;color:var(--cream);font-size:.81rem; }
.bag-filter-reset.btn { background:transparent;font-size:.7rem; }
.bag-filter-button[hidden],.bag-filter-reset[hidden],.bag-filter-summary[hidden],.bag-filter-rows[hidden] { display:none; }
.bag-filter-count,.bag-filter-summary span { padding:2px 7px;border-radius:9px;
  border:1px solid #c6935b80;background:#382a42;color:#f8d98e;font-size:.71rem;font-weight:750; }
.bag-filter-count { margin-left:auto; }
.bag-filter-mark { width:15px;height:13px;flex:none;background:
  linear-gradient(currentColor,currentColor) center 1px/15px 2px no-repeat,
  linear-gradient(currentColor,currentColor) center 6px/10px 2px no-repeat,
  linear-gradient(currentColor,currentColor) center 11px/5px 2px no-repeat; }
.bag-filter-summary { display:flex;flex-wrap:wrap;gap:4px;margin:5px 0 1px; }
.bag-filter-group { margin:5px 0 4px; }
.bag-filter-group h3 { margin:0 0 2px 2px;color:#efca90;font:650 .65rem system-ui,sans-serif; }
.bag-filter-options { display:flex;gap:3px; }
.bag-filter-option { flex:1;display:grid;justify-items:center;align-content:center;gap:1px;min-width:0;min-height:34px;padding:2px 1px;
  border:1px solid #b883527b;border-radius:7px;color:#f5dfb5;background:#3b2a42;font-weight:650;font-size:.59rem;line-height:1.1; }
.bag-filter-option[aria-pressed=true] { border-color:#ffdc9c;background:#604534;color:#fff8df;box-shadow:inset 0 0 0 1px #f8cd80; }
.bag-filter-option img { width:24px;height:24px;object-fit:contain; }
[data-filter-group=type] .bag-filter-option { flex:1 1 auto;min-height:44px;white-space:nowrap; }
[data-filter-group=type] .bag-filter-option:first-child { min-width:32px; }
[data-filter-group=type] .bag-filter-option img { width:25px;height:25px; }
@media (max-width:345px) { .bag-content { padding-inline:10px; } }
.bag-rarity-icon,.collection-rarity-gem { width:14px;height:14px;background:var(--rarity);border:1px solid #fff6;
  border-radius:2px;transform:rotate(45deg);box-shadow:0 1px 4px #090810b0; }
.bag-filter-empty { margin:0;padding:16px 8px;border:1px solid #c59a616b;border-radius:12px;background:#211b32e5; }
.bag .inventory { grid-template-columns:repeat(5,minmax(0,1fr)); }
.bag .cell[data-consumable] { border:2px solid #a1a6b0;background:linear-gradient(#484956,#323442);
 box-shadow:inset 0 0 0 1px #c2c4cc36; }
.bag .cell:focus-visible,.bag .cell.loot-highlight { outline:2px solid #ffe0a2;outline-offset:2px; }
.bag .cell[data-consumable] strong { padding:1px 4px;background:#22232de8;color:#fff5d9;border-radius:6px;font-size:.69rem; }


.entry .screen { isolation:isolate;position:relative; }
.entry-art { position:absolute;inset:0;width:100%;height:100%;object-fit:cover;z-index:-1; }
.collection-grid { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;
 padding:9px 7px 12px;overflow:visible;scroll-snap-type:none; }
.collection-controls { display:grid;gap:7px;padding:9px 8px 0;background:#1b182bd9; }
.collection-status { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px; }
.collection-status .btn { min-height:40px;padding:4px;font-size:.82rem; }
.collection-status .btn[aria-pressed=true] { background:linear-gradient(#589b6f,#246049 72%);border-color:#f0d099; }
.collection-rarity-filter { padding:5px 6px 6px;border:1px solid #c59a6180;border-radius:9px;background:#252037; }
.collection-rarity-heading { display:flex;justify-content:space-between;gap:7px;margin:0 2px 4px;font-size:.74rem;color:#f0ce9a; }
.collection-rarity-heading strong { color:#ffeac7; }
.collection-rarity-filter .bag-filter-option { min-height:42px;font-size:.72rem; }
.locked-hero-details { display:grid;grid-template-columns:68px minmax(0,1fr);gap:10px;align-items:center;margin-top:9px; }
.locked-hero-portrait { display:block;width:68px;height:76px;object-fit:cover;object-position:center 17%;
  border:1px solid var(--rarity,#9a754c);border-radius:9px;background:#382c3d;filter:grayscale(1) brightness(.58); }
.locked-hero-details .rarity-label { color:#694d34;font-size:.84rem; }
.collection-empty { text-align:center;padding:20px;color:#ffe3b1; }
/* One portrait component for the collection, roster, starter and team pickers. */
.ally-card {
  --card-rim:var(--rarity,#aaa0b5);
  --card-highlight:var(--rarity-bg,#383247);
  position:relative;display:block;width:100%;height:auto;min-width:0;min-height:0;
  aspect-ratio:89 / 110;padding:0;border:0;border-radius:10px;overflow:hidden;
  container-type:inline-size;
  background:radial-gradient(ellipse at 50% 36%,var(--card-highlight),#1b1424 92%);
  box-shadow:0 2px 4px #140c1280;
}
.ally-card::after {
  content:"";position:absolute;inset:0;border:3px solid var(--card-rim);
  border-radius:inherit;pointer-events:none;
}
.ally-card > .ally-card-portrait {
  position:absolute;inset:2px 2px 3px;width:calc(100% - 4px);height:calc(100% - 5px);
  object-fit:cover;object-position:center;border-radius:7px;
}
.ally-card-progress {
  position:absolute;inset:auto 3px 7% 3px;min-height:12%;
  display:flex;align-items:center;justify-content:space-between;gap:1px;
  padding-inline:4px;background:#1f1426b3;
}
.ally-card-level,.ally-card-copies { font-weight:800;color:#fff1d6;text-shadow:0 1px 2px #11080e;line-height:1; }
.ally-card-level { font-size:clamp(7px,11cqw,12px); }
.ally-card-copies { position:absolute;left:5px;top:5px;padding:2px 4px;border-radius:4px;background:#48294c; }
.ally-card-tile { min-width:0;display:grid;align-content:start;gap:3px; }
.ally-card-caption { display:block;color:#ffeed3;font-size:.73rem;font-weight:750;line-height:1.16;
  text-align:center;overflow-wrap:anywhere; }
.hero-meta { display:flex;flex-wrap:wrap;align-items:center;gap:4px 6px; }
.hero-rarity-badge { display:inline-flex;align-items:center;justify-content:center;max-width:100%;
  background:var(--rarity);color:#211629;border-radius:5px;padding:2px 6px;font-size:.74rem;
  font-weight:900;line-height:1.15;white-space:nowrap; }
.hero-role-badge { display:inline-flex;align-items:center;gap:4px;border-radius:5px;
  background:#30283d;color:#ffecd3;padding:2px 5px;font-size:.74rem;font-weight:700; }
.hero-role-badge img { width:14px;height:14px;object-fit:contain; }
.ally-ranks { display:inline-flex;align-items:center;gap:.06em;white-space:nowrap;font-weight:800;line-height:1.1; }
.ally-ranks .current { color:#ffd978;text-shadow:0 1px 2px #24121c; }
.ally-ranks .earned { color:#f48aca;text-shadow:0 1px 2px #24121c; }
.ally-ranks .future { color:#c5a6b3; }
.ally-card-progress .ally-ranks { font-size:clamp(6px,12cqw,12px); }
.ally-profile-progress { display:flex;align-items:center;gap:8px;flex-wrap:wrap; }
.ally-profile-progress p { margin:0; }
.ally-card .collection-lock {
  position:absolute;inset:auto 0 10% 0;margin-inline:auto;z-index:1;
  width:clamp(16px,25%,23px);height:auto;aspect-ratio:1;object-fit:contain;
  filter:drop-shadow(0 1px 2px #050408) drop-shadow(0 0 4px #050408);
}
.ally-card.locked {
  --card-rim:#494653;
  background:#161520;
}
.ally-card.locked > .ally-card-portrait {
  filter:grayscale(1) brightness(.46);
  opacity:.46;
}
.ally-card-affinity { filter:grayscale(1);opacity:.52; }
.screen[data-screen="collection"] .ally-card.locked > strong { color:#d0c8cc; }
.ally-card-affinity { position:absolute;top:6px;right:6px;width:clamp(12px,21%,21px);height:auto;
  aspect-ratio:1;object-fit:contain;border-radius:50%;padding:1px;background:#261826cc; }
.ally-stats,.summon-odds { display:grid;gap:5px;margin:9px 0; }
.ally-stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
.ally-stats > div,.summon-odds > div { display:flex;align-items:center;gap:5px;border-radius:6px;
  padding:5px;background:#23141eb0; }
.ally-stats img { width:18px;height:18px;object-fit:contain; }
.ally-stats dd,.summon-odds dd { margin:0 0 0 auto;color:#ffe196;font-weight:700; }
.ally-stats dt { font-size:clamp(.58rem,2.45vw,.78rem);overflow-wrap:anywhere; }
.ally-stats dd { font-size:clamp(.65rem,2.65vw,.86rem);white-space:nowrap; }
.ally-stats .stat-bonus { color:#f9c48a;font-size:.72em; }
.paper .ally-stats > div { background:#f4dfb9; }
.paper .ally-stats dd,.paper .ally-stats .stat-bonus { color:#704527; }
.summon-odds dt,.rarity-label { color:var(--rarity,#ffe0a0); }
.team-preview { display:grid;grid-template-columns:repeat(var(--team-slots,4),minmax(0,1fr));gap:7px;margin:8px 0; }
.team-preview .team-member { min-width:0;width:100%; }
.team-preview .team-ineligible { border-color:#ff8f92;box-shadow:0 0 0 1px #872c46; }
.team-warning { padding:7px 8px;border-radius:8px; }
.team-warning p { margin:2px 0 0; }
.team-member.empty { aspect-ratio:89 / 110;min-height:0;display:grid;place-items:center;background:#321f29;color:#ffd983;
  border:1px solid #a67752;border-radius:8px;font-size:1.8rem; }
.portal-content { text-align:center; }
.portal-art { display:block;width:min(62%,240px);max-height:35vh;object-fit:contain;margin:0 auto 8px; }
.portal-panel { display:grid;gap:6px; }
.portal-actions { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px; }
.portal-actions .btn { min-width:0;min-height:44px;padding-inline:5px;white-space:nowrap; }
.spark-tiers { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px; }
.spark-tier { display:grid;grid-template-columns:auto 1fr;align-items:center;justify-items:center;
  gap:1px;padding:4px 3px;border:1px solid var(--rarity);border-radius:9px;background:var(--rarity-bg);color:#fff0d1; }
.spark-tier[aria-pressed=true] { outline:2px solid #fff1bf;outline-offset:-3px; }
.spark-tier img { width:36px;height:36px;object-fit:contain; }
.spark-tier strong { font-size:1.05rem; }
.spark-tier span { grid-column:1/-1;font-size:.66rem;line-height:1.25;text-align:center; }
.summon-result { text-align:center;border:2px solid var(--rarity);padding:9px;border-radius:11px;
  background:radial-gradient(var(--rarity-bg),#221523); }
.summon-result > img { width:140px;height:180px;object-fit:contain; }
.summon-result .hero-meta { justify-content:center; }

.album-hero { height:185px;margin-top:7px; }
.memory-button { display:flex;align-items:center;gap:7px; }
.memory-button img { width:34px;height:34px;object-fit:contain; }
.memory-panel { margin:0;border:2px solid #dfaf73;border-radius:13px;overflow:hidden;
 background:#2c2337e8;display:grid;grid-template-columns:90px minmax(0,1fr);min-height:140px;align-items:end; }
.memory-panel:nth-child(2) { grid-template-columns:minmax(0,1fr) 90px; }
.memory-panel:nth-child(2) img { grid-column:2;grid-row:1; }
.memory-panel:nth-child(2) figcaption { grid-column:1;grid-row:1; }
.memory-panel img { width:100%;height:133px;object-fit:contain;object-position:bottom; }
.memory-panel figcaption { margin:8px;padding:9px;background:#ffedce;color:#543321;border-radius:12px;align-self:center; }
.room-bureau { left:5%;top:62%; }
.room-hotspot[data-favorite="true"] { box-shadow:0 0 0 2px #f6c453,0 0 14px #624323; }

.difficulty-switch { display:flex;gap:6px; }
.difficulty-switch .quest-tab { flex:1;min-height:39px; }
.route-clear { margin:0;padding:7px;text-align:center;background:#232037dc;border-radius:10px;color:var(--gold); }
.charge-count { color:#98e0bf;font-weight:800;white-space:nowrap; }

.phone.entry { min-height:0;overflow:hidden; }
.entry-settings { position:absolute;z-index:1;top:max(10px,env(safe-area-inset-top));right:12px;height:43px;width:43px;
 border:0;padding:2px;background:none;display:grid;place-items:center; }
.entry-settings img { width:100%;height:100%;max-width:39px;max-height:39px;object-fit:contain; }
.player-avatar { width:51px;height:51px;border:2px solid #ffd382;border-radius:50%;overflow:hidden;
 padding:2px;background:radial-gradient(circle at 50% 45%,#e5b77b,#75512e);box-shadow:0 2px 6px #3d2a21b3; }
.player-avatar img { border-radius:50%;object-fit:cover; }
.chapters .screen-scroller,.expeditions .screen-scroller,.stories .screen-scroller { overflow-x:hidden; }
.campaign-grid { padding-bottom:14px; }
.settings-language .actions { margin-top:9px; }

.campaign-grid .card { gap:4px; }
.campaign-grid .card h2 { font-size:clamp(.85rem,4.2vw,1.25rem);overflow-wrap:anywhere;text-wrap:balance; }
.card .card-portrait { display:block;align-self:center;width:70px;height:70px;overflow:hidden;border-radius:50%;
 border:2px solid #ffd588;background:radial-gradient(circle,#d7ab72,#795037);margin:0 0 4px;
 box-shadow:0 3px 9px #281b32b9; }
.card .card-portrait img { width:100%;height:100%;margin:0;object-fit:cover;object-position:center; }
.card.locked .card-portrait img { filter:brightness(.42) saturate(.35); }


.calendar-button { display:flex;align-items:center;justify-content:center;gap:7px;min-height:38px; }
#overlay:has(.calendar-grid) { padding:12px 10px 13px;max-height:93dvh; }
#overlay:has(.calendar-grid) h2 { margin:5px 0;font-size:1.17rem; }
.calendar-summary { text-align:center;line-height:1.18;font-size:.78rem;color:#6a472d; }
.calendar-summary p { margin:4px 0; }
.calendar-grid { list-style:none;margin:7px 0;padding:0;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px; }
.calendar-cell { min-width:0;display:grid;justify-items:center;position:relative;padding:2px;color:#4d362c;
 background:#e7c8a3;border:1px solid #b58c63;border-radius:8px;font-size:.68rem;line-height:1.12; }
.calendar-cell img { width:clamp(24px,6.9vw,35px);height:clamp(24px,6.9vw,35px);object-fit:contain; }
.calendar-day { font-weight:850; }
.calendar-cell[data-state="ready"] { color:#294234;background:#e5efc4;border:2px solid #65936c; }
.calendar-cell[data-state="claimed"] { background:#d9dfbc;border-color:#a7b185; }
.calendar-cell[data-state="locked"] img { filter:saturate(.6); }
.calendar-cell:nth-child(7n),.calendar-cell:last-child { border-color:#b9873b; }
.calendar-check { position:absolute;top:2px;right:4px;color:#446545;font-weight:900; }
.calendar-reward { margin:3px 0 0;text-align:center;color:#6d3f1c;font-size:.78rem;font-weight:850; }


.progress-overview { display:grid;gap:8px;margin:0; }
.progress-overview div { display:flex;align-items:center;justify-content:space-between;gap:10px; }
.progress-overview dd { margin:0;color:var(--gold);font-weight:850;white-space:nowrap; }


.town-copy { display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px;align-items:start; }
.town-events { grid-column:2;grid-row:1;display:flex;gap:7px; }
.calendar-mail { display:inline-flex;align-items:center;justify-content:center;gap:8px; }
.calendar-mail img { width:25px;height:25px;object-fit:contain; }
.mail-list { margin:10px 0 3px;padding:0;display:grid;gap:6px;list-style:none;max-height:52dvh;overflow:auto; }
.mail-row { min-width:0;display:flex;gap:5px;align-items:center;padding:3px;border:1px solid #d8ac70;border-radius:10px;
  background:#f7e4bd; }
.mail-item { min-width:0;flex:1;display:grid;grid-template-columns:36px minmax(0,1fr) auto;align-items:center;gap:6px;
  padding:4px;color:#442c21;text-align:left; }
.mail-item-icon { display:grid;place-items:center;width:36px;height:36px;border-radius:8px;
  border:1px solid var(--rarity,#ceaa74);background:#fff2d7;overflow:hidden; }
.mail-item-icon img { width:31px;height:31px;object-fit:contain; }
.mail-item-icon[data-hero=true] img { width:100%;height:100%;object-fit:cover;object-position:center 22%; }
.mail-item-text strong,.mail-item-text small { display:block;overflow-wrap:anywhere; }
.mail-item-text strong { font-size:.82rem;line-height:1.18; }
.mail-item-text small { margin-top:3px;color:#754526;font-size:.7rem;text-decoration:underline; }
.mail-quantity { white-space:nowrap;font-variant-numeric:tabular-nums;font-size:.75rem;font-weight:750; }
.mail-preview { min-height:44px;border:0;border-radius:7px;background:transparent; }
.mail-preview:hover { background:#fff1d5; }
#overlay .mail-claim { width:auto;flex:none;min-height:44px;margin:0;padding:3px 9px;font-size:.74rem; }
.mail-contents > li { padding:5px 8px;border-radius:8px;background:#f7e4bd; }
.mail-body { white-space:pre-wrap;overflow-wrap:anywhere; }
.mail-empty { margin:16px 0 7px; }
.town-event { position:relative;display:grid;place-items:center;width:44px;height:44px;
 border:2px solid #ebc578;border-radius:50%;background:linear-gradient(#71516e,#402a50);box-shadow:0 3px 8px #24192abe; }
.town-event.town-journal { position:absolute;right:12px;bottom:16px;z-index:1; }
.town-event img { width:28px;height:28px;object-fit:contain; }
.town-event .quest-notice { position:absolute;right:-1px;top:0; }
.pin-prize { position:absolute;top:calc(100% - 1px);left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:3px;
 background:#2b2237e8;color:#ffdfa1;font-size:.75rem;line-height:1;padding:1px 4px;border:1px solid #dfb978;border-radius:8px;white-space:nowrap; }
.pin-prize img { height:20px;width:20px;object-fit:contain; }

.ally-gear-stage { grid-template-columns:62px minmax(0,1fr) 62px;min-height:0;padding:4px 12px 2px; }
.ally-gear-stage .gear-hero { display:block;height:clamp(218px,39dvh,337px);max-height:none;object-fit:contain; }
.ally-gear-stage .gear-side { gap:3px;align-self:start; }
.ally-gear-stage .gear-cell { width:clamp(40px, min(13vw,6.65dvh),56px); }
.ally-gear-stage .gear-caption { font-size:.65rem;line-height:1.1;white-space:nowrap; }
.gear-cell[data-two-handed=true] > img { opacity:.48; }
.gear-hand-lock { position:absolute;right:2px;bottom:2px;width:16px;height:16px; }
.v2-critical-charge { color:#eacfa1;text-align:center;font-size:.66rem;line-height:1.1;padding:1px 0; }
.v2-critical-charge[data-ready=true] { color:#ffe882;text-shadow:0 0 9px #f8bd52aa;font-weight:700; }
.prepare-auto { display:flex;flex-wrap:wrap;gap:7px; }
.prepare-auto button { flex:1 1 145px; }
.result-detail .result-auto { color:#5d3a23;font-weight:700; }
.result-detail .gold { color:#6e4826; }
.collection-portrait { position:relative;min-width:0; }
.album-shortcut { position:absolute;left:6px;bottom:18px;width:43px;height:43px;border:1px solid #f2c579;border-radius:50%;
  padding:6px;background:radial-gradient(#53405d,#2b1b32);box-shadow:0 2px 8px #1c112577; }
.collection-details { padding:6px 14px;gap:5px; }
.collection-details .ally-stats { margin:0; }
.ally-identity { display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;
  margin:6px 12px 0;padding:5px 8px;border-radius:9px;background:#1c192fdf; }
.ally-identity h2 { font-size:1.12rem;overflow-wrap:break-word; }
.ally-identity .ally-profile-progress { display:grid;justify-items:end;gap:1px; }
.ally-identity .ally-profile-progress p { white-space:nowrap; }
.ally-affinity { display:flex;align-items:center;gap:5px;margin:2px 0 0;color:var(--gold);font-size:.75rem; }
.ally-affinity img { width:21px;height:21px;object-fit:contain; }
.hero-stats { padding:7px; }
.hero-stats .ally-stats { grid-template-columns:repeat(auto-fit,minmax(min(100%,151px),1fr)); }
.hero-stats .ally-stats>div { min-width:0; }
.hero-stats .ally-stats dt { white-space:nowrap; }
.hero-stats .ally-stats dd { font-size:clamp(.61rem,2.35vw,.8rem); }
.ally-actions { display:flex;align-items:center;justify-content:space-between;gap:8px; }
.ally-actions .btn { min-height:37px;padding:4px 9px;font-size:.79rem; }
.hero-detail-toggle { position:absolute;top:7px;right:8px;width:44px;height:44px;display:grid;place-items:center;
  border:1px solid #ebc578;border-radius:50%;background:linear-gradient(#5b3c58,#2a233c);color:var(--gold); }
.hero-detail-toggle::before { content:"";width:10px;height:10px;border:solid currentColor;border-width:0 3px 3px 0;
  transform:translateY(2px) rotate(225deg); }
.hero-detail-toggle[aria-expanded=false]::before { transform:translateY(-2px) rotate(45deg); }
.collection-character[hidden] { display:none; }
.gear-proc-count { color:#925313;font-size:.8em;font-weight:850;white-space:nowrap; }
.gear-roster.collection-grid { padding:4px 8px 10px; }
.gear-roster .ally-card .quest-notice { position:absolute;top:5px;right:27px;z-index:2; }
.team-picker.collection-grid { background:#311e35;border-radius:11px;margin:7px 0; }
.team-member:disabled { cursor:default; }

.ally-card[aria-pressed=true] { box-shadow:0 0 0 1px #ffecbb,0 0 8px #f4c77882; }

.album-grid .scene-tile { display:grid;grid-template-rows:minmax(0,1fr) auto;justify-items:center;gap:3px;padding:3px;min-height:88px; }
.album-grid .scene-tile > img { width:100%;height:100%;max-height:55px;object-fit:cover; }
.scene-tile .scene-label { font-size:.57rem;font-weight:700;line-height:1.15;white-space:normal;align-self:end; }
.scene-locked { display:flex;align-items:center;justify-content:center;gap:4px;color:#e8c08d; }
.scene-locked img { width:19px;height:19px;object-fit:contain; }


#overlay.summon-theater { position:fixed;inset:0;margin:auto;width:min(100%,460px);height:min(100dvh,915px);
  max-width:none;max-height:none;border:0;border-radius:0;overflow:auto;padding:26px clamp(15px,5vw,31px) 26px;
  background:radial-gradient(ellipse at 50% 44%,#3d275b,#18182e 68%);color:#fff1d6; }
#overlay.summon-theater[open] { display:flex;flex-direction:column;gap:16px; }
#overlay.summon-theater::backdrop { background:#100c18d9; }
#overlay.summon-theater h2 { color:#fff0c9; }
#overlay.summon-theater .round-close { top:12px;right:12px; }
#overlay.summon-theater:not(.summon-casting) > .btn { margin-top:auto; }
#overlay.summon-casting { text-align:center;overflow:hidden; }
#overlay.summon-casting > .btn { margin:0 auto;width:min(84%,308px); }
.summon-opening { position:relative;display:grid;place-items:center;flex:1;min-height:0;isolation:isolate; }
.summon-opening-portal { width:min(78%,330px);height:min(51dvh,430px);object-fit:contain;
  animation:summon-portal-glow 1.35s ease-out both; }
.summon-opening-spark { position:absolute;z-index:2;width:clamp(60px,28%,120px);height:27%;object-fit:contain;
  filter:drop-shadow(0 0 17px var(--rarity));animation:summon-spark-rise 1.35s ease-out both; }
.summon-rays { position:absolute;inset:0;display:grid;place-items:center;pointer-events:none; }
.summon-rays i { grid-area:1/1;width:8px;height:54px;border-radius:70%;background:var(--rarity);
  box-shadow:0 0 13px var(--rarity);transform:rotate(var(--angle)) translateY(-24px);
  animation:summon-ray 1.08s ease-out var(--delay) both; }
#overlay.summon-theater .summon-result { padding:16px 6px 10px;background:radial-gradient(var(--rarity-bg),#211926 91%);
  animation:summon-card-reveal .42s ease-out both; }
#overlay.summon-theater .summon-result > img { width:min(88%,285px);height:min(45dvh,360px);object-fit:contain; }
#overlay.summon-theater .summon-result .rarity-label { color:var(--rarity); }
.summon-batch-grid { display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:9px 5px; }
.summon-batch-tile { min-width:0;display:grid;gap:3px;text-align:center; }
.summon-batch-tile .ally-card-caption { font-size:clamp(.56rem,2.8vw,.74rem); }
.summon-single-card .ally-card { width:min(34%,110px);margin:0 auto 8px; }
.summon-batch-state { color:#ddd0e4;font-size:.68rem;font-weight:750; }
.summon-batch-tile[data-result=new] .summon-batch-state { color:#a7ecc0; }
.summon-bonus h2 { margin:0 0 6px;font-size:.93rem; }
@media (max-width:375px) {
  .summon-batch-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@keyframes summon-portal-glow {
  0% { opacity:.35;transform:scale(.9);filter:drop-shadow(0 0 0 transparent); }
  55% { opacity:1;transform:scale(1);filter:drop-shadow(0 0 19px var(--rarity)); }
  100% { opacity:.7;transform:scale(1.1);filter:drop-shadow(0 0 31px var(--rarity)); }
}
@keyframes summon-spark-rise {
  0% { opacity:0;transform:translateY(40px) scale(.35); }
  53% { opacity:.9;transform:translateY(5px) scale(.81); }
  83% { opacity:1;transform:translateY(-14px) scale(1.2); }
  100% { opacity:0;transform:translateY(-25px) scale(1.6); }
}
@keyframes summon-ray {
  0%,36% { opacity:0;transform:rotate(var(--angle)) translateY(-29px) scale(.25); }
  66% { opacity:.78; }
  100% { opacity:0;transform:rotate(var(--angle)) translateY(clamp(-200px,-29dvh,-125px)) scale(1.2); }
}
@keyframes summon-card-reveal {
  from { opacity:0;transform:translateY(12px) scale(.965); }
  to { opacity:1;transform:none; }
}
@media (prefers-reduced-motion:reduce) {
  #overlay.summon-theater .summon-result { animation:none; }
}

.shot-color-line,.shot-colors { display:flex;align-items:center;gap:5px; }
.shot-color-line p { margin:0; }
.shot-colors i { width:10px;height:10px;flex:none;border-radius:50%;background:var(--shot-color);
  box-shadow:inset 0 1px 2px #fff9,0 0 0 1px #171224; }
.lineup-coverage { padding:7px;background:#241c38;border:1px solid #ad83577d;border-radius:9px;color:#f5e4c6; }
.lineup-coverage-head { display:flex;align-items:center;justify-content:space-between;gap:4px;margin:0 0 5px; }
.lineup-coverage-head h3 { font:750 .77rem system-ui,sans-serif; }
.lineup-coverage-head strong { flex:none;font-size:.68rem;color:#f9cd87;white-space:nowrap; }
.lineup-coverage ul { list-style:none;display:flex;gap:4px;margin:0;padding:0; }
.lineup-coverage-color { flex:1;display:grid;grid-template-columns:21px minmax(0,1fr) auto;align-items:center;gap:2px;
  min-width:0;min-height:29px;padding:2px 3px;border:1px solid #a47a48;border-radius:6px;background:#423048;
  font-size:.59rem;line-height:1.1;overflow-wrap:anywhere; }
.lineup-coverage-color img { width:21px;height:21px;object-fit:contain; }
.lineup-coverage-color[data-coverage=ally] { border-color:#84b498;background:#2e4a43; }
.lineup-coverage-color[data-coverage=missing] { border-color:#ba785d;background:#4c2f3a; }
.lineup-coverage-color b { color:#f2c883; }
.lineup-coverage-color[data-coverage=ally] b { color:#c1f3b8; }
.lineup-coverage-color[data-coverage=missing] b { color:#ffa39e; }
.lineup-shot-funding { display:flex;align-items:center;gap:5px;margin-top:5px;font-size:.72rem;color:#dbf0ba; }
.lineup-shot-funding:not([data-shortage="0"]) { color:#ffb487; }
.lineup-shot-funding img { width:19px;height:19px;object-fit:contain; }
.lineup-shot-funding strong { margin-left:auto; }
#overlay .lineup-coverage { margin-top:8px; }
.lineup-ammo-budget { display:grid;gap:3px;padding:5px 8px;background:#241c38;border:1px solid #ad83577d;border-radius:9px;color:#f5e4c6; }
.lineup-ammo-budget .lineup-shot-funding { margin-top:0; }
.lineup-ammo-budget summary { cursor:pointer;min-height:31px;list-style:none; }
.lineup-ammo-budget summary::-webkit-details-marker { display:none; }
.lineup-ammo-chevron { margin-left:3px;color:#f2c883; }
.lineup-ammo-budget[open] .lineup-ammo-chevron { transform:rotate(180deg); }
.lineup-ammo-budget .small { margin:0; }
.lineup-ammo-counts { display:flex;flex-wrap:wrap;gap:3px 12px; }
.lineup-ammo-buy { display:flex;align-items:center;justify-content:space-between;gap:6px;padding-top:2px; }
.lineup-ammo-buy .ammo-warning { margin:0; }
.lineup-ammo-buy .btn { min-height:36px;width:auto;padding:4px 9px;font-size:.73rem; }
.lineup-pick-note { color:#734b32;font-size:.75rem;margin:6px 1px 7px; }
.lineup-candidate-colors { display:flex;justify-content:center;min-height:24px;gap:3px;margin-top:3px; }
.lineup-candidate-color { position:relative;display:grid;place-items:center;width:21px;height:21px; }
.lineup-candidate-color img { width:18px;height:18px;object-fit:contain; }
.lineup-candidate-color[data-coverage=other] { opacity:.52; }
.lineup-candidate-color[data-coverage=adds] { border:1px solid #b6eaa7;border-radius:50%; }
.lineup-candidate-color b { position:absolute;bottom:-2px;right:-2px;width:12px;height:12px;border-radius:50%;
  color:#ebffdb;background:#306445;text-align:center;font:800 10px/12px system-ui,sans-serif; }
.lineup-candidate-color[data-coverage=unavailable] b { color:#ffe4d6;background:#973d53; }
.lineup-candidate-color[data-coverage=reserve] b { color:#4c2d1a;background:#ffcf78; }
.ally-colors { padding:2px 6px;color:#ffe9bf; }
.battle-dock { flex:none;min-height:clamp(130px,19.6dvh,166px);display:grid;
  grid-template-columns:minmax(68px,1fr) auto minmax(68px,1fr);grid-template-rows:18px minmax(0,1fr);
  gap:6px 5px;align-items:center;
  padding:6px 10px max(8px,env(safe-area-inset-bottom));background:linear-gradient(transparent,#1819329c); }
.battle-dock-side { grid-row:2;display:grid;align-items:center;min-height:84px; }
.battle-dock-roster { grid-column:1;justify-items:start; }
.battle-dock-boosters { grid-column:3;justify-items:end; }
.battle-strip { display:flex;gap:4px;min-width:0;overflow-x:auto;scrollbar-width:none;touch-action:none;overscroll-behavior-x:contain; }
.battle-ammo { min-width:0;grid-column:2;grid-row:2;padding-top:4px; }
.ammo-strip { padding:3px 2px;justify-content:center; }
.projectile-slot { flex:none;min-width:33px;min-height:37px;display:grid;gap:1px;place-items:center;padding:2px 3px;
  border:1px solid #b78e65;border-radius:19px;background:#221b3eec;box-shadow:inset 0 0 6px #17132a;color:#fff0cf; }
.projectile-slot[hidden] { display:none; }
.projectile-slot img { width:clamp(17px,5.4vw,24px);height:clamp(17px,5.4vw,24px);object-fit:contain; }
.projectile-slot strong { font-size:clamp(.58rem,2.15vw,.76rem); }
.projectile-slot:disabled { opacity:.45;pointer-events:none; }
.projectile-slot[aria-pressed=true] { border-color:#ffe5a0;background:#4b3457;
  box-shadow:inset 0 0 0 1px #ffe5a0,0 0 7px #ffd27d75; }
.booster-strip { display:grid;gap:4px;padding:3px 2px; }
.booster-strip .projectile-slot { grid-template-columns:26px minmax(15px,1fr);min-width:56px;min-height:29px;padding:1px 3px; }
.launcher-tools { display:flex;align-items:center;justify-content:center;gap:3px; }
.launcher-tools .charge-count { font-size:.57rem;white-space:nowrap;color:#ebc98c; }
.ammo-swap.btn { border:0;box-shadow:none;background:none;min-height:22px;padding:0 5px;color:#ffd582;font-size:.86rem;line-height:1; }
.battle-deck { position:relative;isolation:isolate;width:clamp(65px,17vw,78px); }
.battle-deck[data-stack=true]::before,.battle-deck[data-stack=true]::after { content:"";position:absolute;
  inset:2px -4px 0 4px;transform:rotate(7deg);transform-origin:85% 75%;background:#272139;
  border:1px solid #b18b61;border-radius:9px;z-index:-1; }
.battle-deck[data-stack=true]::after { inset:3px -7px 0 6px;transform:rotate(13deg);z-index:-2; }
.shooter-card { width:100%;height:clamp(79px,11.8dvh,102px);min-width:0;border-radius:9px; }
.shooter-card .ally-card-progress { bottom:14px; }
.shooter-card .ally-card-affinity { width:15px;height:15px; }
.shooter-card .ally-card-level,.shooter-card .ally-ranks { font-size:.48rem; }
.shooter-card .ally-card-copies { font-size:.55rem;top:3px; }
.shooter-position { position:absolute;z-index:1;bottom:2px;inset-inline:0;text-align:center;font-size:.55rem;color:#ffe1a0; }
.ammo-count { display:inline-flex;align-items:center;gap:3px;white-space:nowrap;font-size:.66rem;font-weight:700; }
.ammo-count[data-quantity="0"] { opacity:.64; }
.ammo-warning { color:#ffd4b0;background:#673640;border-radius:7px;padding:4px 6px; }

.identity-form { display:grid;gap:8px; }
.identity-form label { font-weight:750; }
.identity-form input { width:100%;min-height:44px;min-width:0;border:1px solid #af814f;border-radius:9px;
  padding:8px 10px;background:#332948;color:#fff0d6;font:inherit; }
.starter-cards { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:8px 0; }
.town-identity.btn { position:absolute;top:65px;left:10px;z-index:3;display:grid;justify-items:start;
  gap:4px;max-width:min(46%,172px);min-height:0;border:0;box-shadow:none;padding:0;background:none;text-align:left; }
.town-identity strong,.town-xp-badge { display:block;max-width:100%;padding:3px 7px;overflow:hidden;text-overflow:ellipsis;
  white-space:nowrap;border:1px solid #e9b973c2;border-radius:10px;background:#2b2240ef;color:#ffedcc;font-size:.73rem; }
.town-xp-badge { display:flex;align-items:center;gap:4px;background:#233d41;color:#d6ffca;font-variant-numeric:tabular-nums; }
.town-xp-badge img,.profile-starter img { width:20px;height:20px;object-fit:contain; }
.town-copy .resume { margin-top:46px; }
.town-spark-badges { position:absolute;z-index:1;right:3%;top:23%;display:grid;gap:6px; }
.town-spark-badge { position:relative;width:38px;height:38px;
  display:grid;place-items:center;border:2px solid var(--rarity,#ffd589);border-radius:50%;padding:3px;
  background:var(--rarity-bg,#342641);color:#fff3cb;box-shadow:0 3px 8px #25182c8a; }
.town-spark-badge img { width:23px;height:23px;object-fit:contain; }
.town-spark-badge strong { position:absolute;right:-3px;bottom:-5px;min-width:21px;padding:1px 4px;border-radius:8px;
  background:#2a213b;border:1px solid var(--rarity,#ffd589);font-size:.71rem; }
.profile-starter { display:flex;align-items:center;gap:8px;padding:8px; }
.profile-starter img { width:39px;height:39px;border-radius:9px; }
.account-profile,.account-form,.account-presets { display:grid;gap:8px; }
.account-card-heading { display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 10px; }
.account-card-heading h2 { margin:0; }
.account-origin { font-size:.78rem;overflow-wrap:anywhere; }
.account-id-row { display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px;align-items:center; }
.account-id-row .profile-player-id { min-width:0;width:100%;font-family:monospace;font-size:.77rem; }
.account-id-row .copy-player-id { min-height:36px;padding:4px 7px;font-size:.72rem; }
.account-form-error { color:#a33342;margin:0; }
.account-form-error:empty { display:none; }
.account-local-note { margin:10px 0 0; }
.account-demo-code { display:flex;justify-content:space-between;align-items:center;gap:10px;
  padding:8px 12px;background:#efe0c1;color:#5d3429;border:1px solid #ba9559;border-radius:8px; }
.account-demo-code strong,.account-code { letter-spacing:.14em;font-variant-numeric:tabular-nums; }
.xp-duration { font-variant-numeric:tabular-nums; }
.portal-list-head,.portal-list-foot { display:flex;align-items:center;justify-content:space-between;gap:5px; }
.portal-list-head .btn,.portal-list-foot .btn { min-height:36px;padding:4px 7px;font-size:.75rem; }
.portal-panel .spark-list { grid-template-columns:1fr;gap:5px; }
.spark-list .spark-tier { grid-template-columns:34px minmax(0,1fr) auto;justify-items:start;padding:4px 9px; }
.spark-list .spark-tier span { grid-column:2;text-align:left;font-size:.81rem; }
.spark-list .spark-tier strong { font-variant-numeric:tabular-nums; }
.ally-xp-levels { display:grid;grid-template-columns:repeat(20,minmax(0,1fr));gap:3px;margin:7px 0; }
.ally-xp-levels span { min-height:7px;border-radius:2px;background:#cdb397; }
.ally-xp-levels .earned { background:#bb8747; }
.ally-xp-levels .current { background:#764926; }
.ally-xp-progress progress { width:100%;height:11px;accent-color:#367b60; }
.ally-xp-progress p { text-align:right;font-variant-numeric:tabular-nums; }
.promotion-balances { display:flex;justify-content:space-between;gap:7px; }
.dungeon-progress { padding:9px 12px; }
.dungeon-floors { display:grid;gap:7px; }
.dungeon-floor { display:grid;grid-template-columns:50px minmax(0,1fr) auto 14px;align-items:center;gap:7px;
  text-align:left;border:1px solid #d49760;background:#231c34ee;padding:6px 8px;border-radius:11px; }
.dungeon-floor>img { width:48px;height:48px;object-fit:contain; }
.dungeon-floor div { min-width:0; }
.dungeon-floor div span { display:block;font-size:.72rem;color:#f6d392; }
.dungeon-floor .stars img { width:15px;height:15px; }
.dungeon-chevron { color:#ffd080;font-size:1.5rem; }
.dungeon-floor[data-locked=true] { border-color:#887895;background:#211c2cee; }
.dungeon-floor[data-locked=true]>img { opacity:.7; }
.dungeon-floor[data-locked=true] .dungeon-chevron { width:14px;height:14px;display:grid;place-items:center;
  border:1px solid #a997b6;border-radius:50%;color:#e0d1e9;font:700 10px/1 system-ui,sans-serif; }
.dungeon-lock-requirement { display:flex;align-items:center;gap:8px;margin:0 0 3px; }
#overlay .prepare-rewards h2 { padding:0 0 3px;color:#ffe3b3;font-size:1.05rem; }
.dungeon-lock-requirement img { width:36px;height:36px;object-fit:contain; }
.dungeon-drop-list { display:grid;gap:6px; }
.dungeon-drop-tier { background:#201a2e;border:1px solid var(--rarity,#a27c54);border-radius:9px;padding:5px 6px;color:#fff1d3; }
.dungeon-drop-heading { display:flex;justify-content:space-between;align-items:center;gap:5px;font-size:.82rem; }
.dungeon-drop-items { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px; }
.dungeon-drop-item { display:flex;align-items:center;gap:3px;font-size:.72rem;min-width:0;overflow-wrap:anywhere; }
.dungeon-drop-item img { width:26px;height:26px;object-fit:contain;flex:none; }
.market-timer { color:#ffe4a7;text-align:center;font-size:.76rem;margin-top:5px; }
.market-timer strong { font-variant-numeric:tabular-nums; }
#overlay.character-reveal[open] { width:min(calc(100% - 18px),416px);height:min(88dvh,720px);overflow:hidden;
  display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:8px;padding:12px;
  background:#211e39;color:#ffedce;border-color:#e6bc78; }
#overlay.character-reveal .round-close { z-index:2; }
#overlay.character-reveal h2 { align-self:center;font-size:clamp(1.1rem,5.5vw,1.7rem);padding:0 34px;min-height:34px;
  display:grid;place-items:center; }
.reveal-stage { position:relative;display:grid;grid-template-rows:minmax(0,1fr) auto auto;justify-items:center;
  min-height:0;border:1px solid #c6976880;border-radius:13px;overflow:hidden;padding:7px 7px 11px;
  background:linear-gradient(180deg,#21163710 68%,#17112ddd),var(--reveal-bg) center / cover; }
.reveal-character { display:block;min-height:0;width:100%;height:100%;object-fit:contain;
  filter:drop-shadow(0 12px 14px #141020a0); }
.reveal-caption { z-index:1;margin:4px 0 0;padding:4px 12px;border:1px solid #ddb572;border-radius:17px;
  background:#f3d09d;color:#573118;font-weight:750;text-align:center; }

.boss-readiness { display:grid;gap:4px;margin:8px 0; }
.boss-readiness>div { display:flex;justify-content:space-between;gap:8px;
  padding:5px 7px;border-radius:6px;background:#f4dbb5;font-size:.79rem; }
.boss-readiness dd { margin:0;font-variant-numeric:tabular-nums;font-weight:800;white-space:nowrap;color:#a43a42; }
.boss-readiness [data-met=true] dd { color:#246449; }

.bag-filter-group[data-filter-group=worn] .bag-filter-option { width:auto;min-width:65px;min-height:32px;padding:5px 8px; }
.reserve-shot-card .reserve-shot-icon { position:absolute;left:18%;top:6%;width:64%;height:61%;object-fit:contain; }
.reserve-shot-card>strong { position:absolute;inset:auto 4px 12px;text-align:center;
  color:#fff2d7;font-size:.61rem;white-space:normal;line-height:1; }

.team-card-slot { position:relative;min-width:0; }
.team-remove { position:absolute;z-index:2;top:-5px;left:-3px;display:grid;place-items:center;
  width:26px;height:26px;padding:0;border:1px solid #efb58b;border-radius:50%;
  background:#642b3d;color:#fff1da;font-size:1.2rem;line-height:1; }
.reveal-meta { z-index:1;justify-content:center;margin-top:5px; }
.team-card-slot:has(.team-remove) .ally-card-copies { top:22px; }

.combat-profile-pips { display:flex;flex-wrap:wrap;gap:2px 6px;align-items:center;font-size:.7rem;font-weight:800; }
.combat-profile-pips > span { display:inline-flex;align-items:center;gap:2px; }
.combat-profile-pips img,.prepare-paints img { width:17px;height:17px;object-fit:contain; }
.color-strong { color:#b6ecae; }
.color-weak { color:#ffc1c2; }
#overlay .color-strong { color:#2d694c; }
#overlay .color-weak { color:#9c3d52; }
.prepare-energy { padding:8px 9px; }
.prepare-energy-row { display:grid;grid-template-columns:25px 1fr auto;align-items:center;gap:6px; }
.prepare-energy-row > img { width:23px;height:23px;object-fit:contain; }
.prepare-energy-row .btn { min-height:38px;font-size:.74rem;padding:4px 8px; }
.prepare-paints { display:flex;align-items:center;gap:5px 9px;flex-wrap:wrap;margin-top:7px;
  font-size:.76rem;color:#ffe6ad; }
.prepare-paints span { display:flex;align-items:center;gap:3px; }
.campaign-lore { margin:8px 12px 0;padding:9px 10px;border:1px solid #b78b61a6;background:#211b34ea;
  border-radius:11px;color:#ffe8c1;font-size:.78rem; }
.ballworks .screen-backdrop { object-position:center 30%; }
.ballworks-content { padding:9px 11px 13px;gap:7px; }
.ballworks-scene { min-height:clamp(115px,23dvh,220px); }
.ballworks-wallet,.ballworks-deck { display:flex;align-items:center;justify-content:space-between;gap:6px;
  padding:6px 9px;border:1px solid #cb9b63a6;border-radius:11px;background:#261e36ed;color:#ffeac0; }
.ballworks-wallet span,.ballworks-deck span { display:inline-flex;align-items:center;gap:5px; }
.ballworks-wallet img,.ballworks-deck img,.ballworks-tabs img,.ballworks-controls img,.ballworks-paint button img {
  width:21px;height:21px;object-fit:contain; }
.ballworks-tabs { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px; }
.ballworks-tabs .btn,.ballworks-controls .btn,.ballworks-paint .btn { display:flex;align-items:center;justify-content:center;
  gap:4px;padding:4px 5px;min-width:0;font-size:.76rem; }
.ballworks-article,.ballworks-paint { padding:8px 10px;border-color:#c4925e;background:#211a30f5; }
.ballworks-article > .btn { width:100%; }
.ballworks-item { display:grid;grid-template-columns:36px minmax(0,1fr) auto;align-items:start;gap:6px; }
.ballworks-item > img { width:32px;height:32px;object-fit:contain; }
.ballworks-item p { margin:3px 0 5px;font-size:.76rem; }
.ballworks-controls,.ballworks-paints { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px; }
.ballworks-paint { display:grid;justify-items:center;gap:5px;text-align:center; }
.ballworks-paint > img { width:40px;height:40px;object-fit:contain; }
.ballworks-deck { justify-content:start; }

.combat-v2.screen { min-height:580px;overflow:hidden; }
.combat-v2 .v2-enemy-head { flex:none;background:#1d1934ec;padding:0 7px 5px;border-bottom:1px solid #98675680; }
.v2-enemy-head header { display:grid;grid-template-columns:minmax(0,1fr) auto 34px 35px;gap:4px;
  padding:5px 0;align-items:center;text-align:left;border:0;background:none;box-shadow:none; }
.v2-clock { min-width:42px;padding:3px 5px;border:1px solid #986756;border-radius:12px;
  color:#ffedba;text-align:center;font-size:.74rem;font-weight:700;font-variant-numeric:tabular-nums; }
.v2-heading h1 { font-size:clamp(1.04rem,4.7vw,1.40rem); }
.v2-heading p { margin:2px 0 0;font-size:.71rem; }
.v2-info.btn,.v2-pause { width:34px;height:34px;min-height:0;padding:0;box-shadow:none; }
.v2-info.btn { font:bold italic 1rem Georgia,serif; }
.v2-opponents,.v2-allies { display:grid;grid-auto-columns:minmax(74px,1fr);grid-auto-flow:column;gap:4px;
  overflow-x:auto;scrollbar-width:none;padding:1px 0; }
.v2-fighter { position:relative;display:flex;align-items:center;gap:4px;min-width:0;padding:3px;
  border:1px solid #b8845d8a;border-radius:8px;background:#2b233f;color:#ffe6bb;text-align:left; }
.v2-fighter-detail { display:flex;align-items:center;gap:6px;margin:7px 0; }
.v2-fighter-detail > img { width:25px;height:25px;object-fit:contain; }
.v2-fighter-detail .combat-profile-pips { margin-left:auto; }
#overlay .v2-fighter-detail + .ally-stats > div { background:#f4dfb9; }
#overlay .v2-fighter-detail + .ally-stats dd { color:#704527; }
.v2-fighter[data-active=true] { box-shadow:inset 0 0 0 1px #ffdd8f;border-color:#efc982;background:#394747; }
.v2-fighter[data-out=true] { filter:grayscale(1);opacity:.45; }
.v2-fighter-art { width:34px;height:38px;flex:none;border-radius:6px;object-fit:cover;object-position:center 15%; }
.v2-fighter[data-side=ally] .v2-fighter-art { border:2px solid var(--rarity,#aaa0b5);
  background:radial-gradient(var(--rarity-bg,#383247),#1b1424); }
.v2-fighter-copy { min-width:0;display:grid;grid-template-columns:1fr 14px;align-items:center;gap:1px; }
.v2-fighter-copy strong { white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:.72rem; }
.v2-fighter-copy small img { width:13px;height:13px;object-fit:contain; }
.v2-fighter-health { grid-column:1/-1;color:#ffdbad;font-size:.62rem;white-space:nowrap;font-variant-numeric:tabular-nums; }
.v2-fighter[data-side=enemy] { padding-right:25px; }
.v2-initiative { position:absolute;bottom:1px;left:3px;right:3px;height:2px;border-radius:4px;
  background:linear-gradient(90deg,#84d8ca 0 var(--ready),#5e5073 var(--ready)); }
.v2-fighter[data-side=enemy] .v2-initiative { background:linear-gradient(90deg,#e69796 0 var(--ready),#5e5073 var(--ready)); }
.v2-intent { position:absolute;right:4px;top:4px;display:grid;place-items:center;width:20px;height:20px;
  border:1px solid #c18b60;border-radius:50%;background:#462a3e; }
.v2-intent img { width:15px;height:15px;object-fit:contain; }
.v2-timeline { display:grid;grid-auto-columns:minmax(27px,46px);grid-auto-flow:column;justify-content:center;
  gap:6px;padding:4px 5px;flex:none; }
.v2-turn { height:32px;position:relative;border:1px solid #68bcbc;border-radius:6px;background:#26243d; }
.v2-turn[data-side=enemy] { border-color:#e18484; }
.v2-turn[data-current=true] { border-color:#ffe2a0;box-shadow:0 0 6px #fade90a8; }
.v2-turn > img:first-child { width:100%;height:100%;border-radius:5px;object-fit:cover;object-position:center 15%; }
.v2-turn .v2-turn-icon { position:absolute;right:0;bottom:0;width:12px;height:12px;object-fit:contain;background:#241c34;border-radius:50%; }
.v2-arena { position:relative;flex:1;min-height:235px;min-width:0;overflow:hidden;
  margin:0 5px;border:1px solid #bd965eaf;border-radius:8px;background:#17174183; }
.v2-arena canvas { display:block;width:var(--v2-canvas-width,100%);max-width:none;height:100%;
  position:absolute;top:0;left:50%;transform:translateX(-50%);touch-action:none;cursor:crosshair; }
.v2-battle-notice { position:absolute;z-index:1;left:6px;right:6px;top:44%;text-align:center;
  padding:6px;border-radius:7px;background:#302438ed;color:#ffedba;font-weight:800;font-size:.76rem;pointer-events:none; }
.v2-battle-notice[data-hit=true] { background:#54283bea;color:#ffe0cd; }
.v2-hit-bolt { position:absolute;z-index:1;top:0;left:48%;width:12px;height:110px;pointer-events:none;
  border-radius:50%;background:linear-gradient(transparent,#f04323bc,#ffd98d);box-shadow:0 13px 30px #f65e4788; }
.v2-dock { flex:none;display:grid;gap:4px;padding:4px 7px 6px;background:#122336d9; }
.v2-team-meters { display:grid;grid-template-columns:1.35fr 1fr;gap:5px; }
.v2-meter { display:flex;align-items:center;justify-content:center;gap:3px;height:16px;position:relative;
  isolation:isolate;overflow:hidden;border-radius:10px;border:1px solid #e3bd7d;
  text-align:center;background:#181833;color:#fff5de;font-size:.64rem;font-variant-numeric:tabular-nums; }
.v2-meter img { width:13px;height:13px;object-fit:contain; }
.v2-meter.enemy { margin-top:3px;--tone:#a23b66; }
.v2-boss-meters { display:flex;gap:6px;align-items:center; }
.v2-boss-meters .v2-meter { flex:1; }
.v2-seals { display:inline-flex;align-items:center;gap:2px;flex:none;margin-top:3px;padding:0 5px;
  border:1px solid #d7ae72;border-radius:8px;color:#ffe5b4;background:#362641;font-size:.69rem;font-weight:750; }
.v2-seals img,.boss-attributes-title > img { width:17px;height:17px;object-fit:contain; }
.boss-attributes { margin:7px 0;padding:7px;border:1px solid #dbb675;border-radius:9px;background:#fbdfb5; }
.boss-attributes h3 { font-size:1rem;margin:0 0 5px; }
.boss-attributes-title { display:flex;flex-wrap:wrap;align-items:center;gap:4px 6px;font-size:.83rem; }
.boss-attributes .ally-stats { margin:4px 0 7px; }
.boss-attributes .ally-stats > div { background:#f5d3a2; }
.boss-attributes .ally-stats dd { color:#704527; }
.dungeon-floor[data-boss=true]:not(:disabled) { border-color:#d9a66f; }
.dungeon-boss-label { margin-left:5px;padding:1px 4px;border-radius:5px;background:#624052;color:#ffdcac;font-size:.61rem; }
.v2-meter.ally { --tone:#368e7d; }
.v2-meter.armor { --tone:#7766a4; }
.v2-meter::before { position:absolute;inset:0 auto 0 0;content:"";z-index:-1;width:var(--fill);
  background:linear-gradient(#ffffff24,transparent 72%),var(--tone);transition:width .18s ease-out; }
.v2-handbar,.v2-arsenal,.v2-hand,.v2-shells,.v2-next-colors { display:flex;align-items:center;gap:4px;min-width:0; }
.v2-handbar { justify-content:space-between; }
.v2-handbar .btn,.v2-arsenal .btn { border-radius:8px;min-height:35px;padding:3px 5px;
  box-shadow:none;background:#25253e;text-shadow:none; }
.v2-handbar .btn[aria-pressed=true],.v2-arsenal .btn[aria-pressed=true] { background:#483f58;border-color:#ffdf97; }
.v2-color { display:inline-flex;align-items:center;gap:2px;font-size:.67rem;white-space:nowrap; }
.v2-color img { width:21px;height:21px;object-fit:contain; }
.v2-next-colors small { color:#f4d097;font-size:.62rem; }
.v2-next-colors img,.v2-shell img,.v2-energy img,.v2-swap img { width:18px;height:18px;object-fit:contain; }
.v2-swap,.v2-shell,.v2-energy { display:inline-flex;align-items:center;gap:3px;white-space:nowrap;font-size:.72rem; }
.v2-energy { padding:4px 6px;border:1px solid #a87957;border-radius:8px;background:#2d2440; }
.v2-shells { overflow-x:auto;scrollbar-width:none; }
.v2-pass { margin-left:auto;font-size:.72rem;white-space:nowrap; }
@media (max-width:370px) {
  .v2-fighter-art { width:28px;height:32px; }
  .ballworks-tabs .btn { gap:2px;font-size:.68rem; }
}

/* Rarity trials and the seasonal city */
.card[data-mode="epic-trial"] { border-color:#a983d5; }
.card[data-mode="legend-trial"] { border-color:#dfb46b; }
.card[data-mode="sealed-city"] .card-art { object-position:center 42%; }
.rarity-trial .dungeon-floor > img,.rarity-rule-crest img {
  border-radius:8px;object-fit:cover;aspect-ratio:1;
}
.rarity-trial .dungeon-floor { min-height:61px; }
.rarity-rule-crest {
  width:44px;height:44px;border:2px solid #bf91ff;border-radius:10px;overflow:hidden;flex:none;
}
.rarity-rule-crest[data-trial="legend-trial"] { border-color:#ebc36f; }
.rarity-rule-crest img { width:100%;height:100%; }
.rarity-rule h2 { font-size:1.04rem; }
.rarity-rule p { margin-top:3px; }

.sealed-city .screen { background:#151b2e; }
.sealed-city .screen > header { z-index:1; }
.sealed-city .screen > header h1 { font-size:clamp(1.3rem,5.3vw,1.8rem); }
.sealed-city .screen > header p { font-size:clamp(.65rem,2.8vw,.82rem); }
.city-scroll { min-height:0;overflow-x:hidden;touch-action:pan-y;scrollbar-width:none; }
.city-scroll::-webkit-scrollbar { display:none; }
.city-map { position:relative;width:100%;aspect-ratio:911/1727;min-height:685px;isolation:isolate; }
.city-map-art,.city-paths {
  position:absolute;display:block;inset:0;width:100%;height:100%;object-fit:fill;pointer-events:none;
}
.city-map-art { z-index:-1; }
.city-map-gate,.city-node-name {
  line-height:1.08;text-align:center;background:#17172cea;border:1px solid #cfa568;
  border-radius:7px;color:#fff4d8;box-shadow:0 2px 6px #170f2480;
  padding:4px 6px;font-size:.67rem;font-weight:800;
}
.city-map-gate { position:absolute;left:50%;top:86%;transform:translate(-50%,0);white-space:nowrap; }
.city-node {
  --pin-size:44px;position:absolute;left:var(--x);top:var(--y);transform:translate(-50%,-50%);
  display:grid;place-items:center;width:var(--pin-size);height:var(--pin-size);padding:0;
  border:0;background:none;color:inherit;text-shadow:0 1px 3px #201626;z-index:1;cursor:pointer;
}
.city-node[data-boss="true"] { --pin-size:52px; }
.city-node[data-city-node="tower"] { --pin-size:58px; }
.city-node-icon {
  display:grid;place-items:center;width:100%;height:100%;overflow:hidden;border:2px solid #f4c778;
  border-radius:50%;background:#27202c;box-shadow:0 0 0 2px #3b2338,0 3px 12px #29182eac;
}
.city-node-icon img { display:block;width:100%;height:100%;object-fit:cover; }
.city-node[data-state="open"] .city-node-icon { box-shadow:0 0 0 2px #5b3325,0 0 14px #f4ce7c91; }
.city-node[data-state="done"] .city-node-icon { border-color:#acdc9a; }
.city-node[data-state="locked"] .city-node-icon { border-color:#9c8b9b;background:#242538e8; }
.city-node[hidden] { display:none; }
.city-node[data-state="locked"]:not([data-boss="true"]) .city-node-icon { width:75%;height:75%; }
.city-node[data-state="locked"] .city-node-icon img { width:46%;height:46%;object-fit:contain;opacity:.72; }
.city-node[data-state="locked"]::before {
  content:"";position:absolute;inset:-25% -35%;z-index:-1;pointer-events:none;
  background:radial-gradient(ellipse,#d1d1eea5,#aca8ce75 40%,transparent 73%);
}
.city-node:focus-visible { z-index:4;outline:3px solid #fff4bd;border-radius:50%;outline-offset:3px; }
.city-node-name {
  position:absolute;top:calc(100% + 3px);left:50%;transform:translateX(-50%);
  min-width:max-content;max-width:100px;
}
.city-node[data-city-node="forge"] .city-node-name { transform:translateX(-58%); }
.city-node[data-state="locked"] .city-node-name { border-color:#938491;color:#e3d8e6; }
.city-node-stars {
  position:absolute;bottom:1px;left:50%;transform:translate(-50%,45%);
  border-radius:5px;background:#1f2332f5;border:1px solid #968453;padding:2px 3px;
  pointer-events:none;white-space:nowrap;display:flex;gap:1px;
}
.city-node-stars img { width:11px;height:11px; }
.city-node:has(.city-node-stars) .city-node-name { top:calc(100% + 8px); }
.city-season-progress {
  flex:none;display:flex;align-items:center;justify-content:space-between;gap:8px;
  padding:5px 10px 6px;background:#1c1c32;border-top:1px solid #b89459;color:#f8dfaa;
}
.city-season-progress strong { font-size:.75rem; }
.city-scroll-home {
  flex:none;display:grid;place-items:center;width:37px;height:37px;padding:4px;border-radius:50%;
  border:1px solid #b59665;background:#332637;
}
.city-scroll-home img { width:100%;height:100%;object-fit:contain; }
.city-sheet-opponent { display:flex;align-items:center;gap:10px; }
.city-sheet-opponent > img {
  width:63px;height:63px;flex:none;border:1px solid #c3945b;border-radius:11px;object-fit:cover;
}
.city-sheet-opponent > div { min-width:0; }
.city-sheet-opponent p { margin:2px 0; }
.city-sheet-meta { display:flex;align-items:center;gap:4px;font-size:.73rem;color:#ffe0a0; }
.city-sheet-meta img { width:21px;height:21px;object-fit:contain; }
.city-boss-perk { color:#f1d59d;font-size:.82rem;margin:10px 0 0; }
.city-final-status h2 { font-size:1.02rem; }
.city-defense-list { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px; }
.city-defense {
  display:flex;align-items:center;gap:6px;min-height:32px;font-size:.77rem;
  padding:3px 5px;border-radius:6px;background:#2d233c;color:#f7dca8;
}
.city-defense[data-cleared="true"] { background:#23463e;color:#b9e8af; }
.city-defense img,.city-defense > span[aria-hidden] { width:20px;height:20px;flex:none;object-fit:contain;font-weight:800; }
#overlay:has(.city-sheet)[open] {
  position:fixed;inset:auto 0 0;margin:0 auto;width:min(calc(100% - 12px),442px);
  max-height:72dvh;border-radius:20px 20px 10px 10px;color:#fff2d5;
  background:#1b1930;border-color:#cfa467;padding:12px 12px 15px;
}
#overlay:has(.city-sheet) .prepare-rewards { margin-top:9px; }
#overlay:has(.city-sheet) .city-final-status { margin-top:9px; }
