/* Star Me Up — "system window" skin.
   Loaded after style.css and overrides its look. Layout stays in style.css; this file is the paint.
   The world: the summoner looks at everything through the System — a cold holographic interface over a dying night sky.
   Cyan is the System's own light, violet its depth, gold is kept for stars (rarity, the tower's star, currency),
   and the only warm, soft shapes on screen are the heroes' own words. */
:root {
  --night: #04050d;
  --night-2: #080b1c;
  --panel: #0b1024;
  --panel-2: #121a3a;
  --well: #060916;
  --line: #5fe1ff30;
  --line-2: #5fe1ff70;
  --ink: #eaf6ff;
  --muted: #a3b8d8;
  --dim: #7389b0;
  --sys: #5fe1ff;
  --sys-ink: #03131c;
  --violet: #a98bff;
  --gold: #ffc857;
  --gold-ink: #1c1300;
  --coral: #ff5c8a;
  --mint: #4dffb4;
  --danger: #ff5470;
  --r3: #62b6ff;
  --r4: #b594ff;
  --r5: #ffc857;
  --paper: #f3f1ea;
  --inkline: #5fe1ff55;
  --display: "Chakra Petch", "IBM Plex Sans Thai", "Leelawadee UI", Tahoma, system-ui, sans-serif;
  --body: "IBM Plex Sans Thai", "Leelawadee UI", Tahoma, system-ui, sans-serif;
  --radius: 3px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}
body { background: var(--night); }
:focus-visible { outline: 2px solid var(--sys); outline-offset: 2px; }
::selection { background: #5fe1ff55; color: #fff; }
* { scrollbar-width: thin; scrollbar-color: #5fe1ff44 transparent; }

/* the void: nebula haze, then a faint scan texture over the star canvas */
.sky { background:
  radial-gradient(1100px 620px at 82% -12%, #2a2f8a66 0%, transparent 62%),
  radial-gradient(900px 560px at -8% 108%, #5a2a8a40 0%, transparent 60%),
  radial-gradient(700px 420px at 50% 120%, #0f5a7a33 0%, transparent 65%),
  var(--night); }
.sky::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, #ffffff05 0 1px, transparent 1px 3px), radial-gradient(ellipse at 50% 50%, transparent 55%, #02030899 100%); }

h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: .01em; }
.num, .cur b, .odds b, .floorpick .now { font-family: var(--display); font-variant-numeric: tabular-nums; }
.head h2, .basehead h2 { font-size: 1.6rem; font-weight: 700; }
.head p, .hint, .sub { color: var(--muted); }

/* ---------- the cut-corner shape every window and button shares ----------
   Top-left and bottom-right corners are sliced off; the two diagonal edges are drawn by the corner gradients. */
.btn, .panel, .sheet, .title-card, .chatbox, .toast, .dock button, .plate, .card .frame, .rpanel, .ppanel, .banner.stage, .buildopt, .dtier, .odds {
  --c: 12px; --bw: 1px; --edge: var(--line-2); --fill: var(--panel);
  border: var(--bw) solid var(--edge); border-radius: 0;
  background:
    linear-gradient(135deg, var(--edge) 0 calc(var(--c) * .7071 + var(--bw)), transparent 0),
    linear-gradient(315deg, var(--edge) 0 calc(var(--c) * .7071 + var(--bw)), transparent 0),
    var(--fill) !important; /* style.css paints some of these with its own background; here the fill is always --fill */
  background-origin: border-box;
  clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
}
/* an outline would be clipped away with the corners, so focus is drawn inside */
.btn:focus-visible, .dock button:focus-visible, .plate:focus-visible, .buildopt:focus-visible { outline-offset: -4px; }

/* ---------- buttons ---------- */
.btn { --c: 9px; --edge: #5fe1ff8c; --fill: linear-gradient(180deg, #5fe1ff1f, #5fe1ff0a), #0a1126; padding: 9px 18px; color: var(--ink); font-family: var(--display); font-weight: 600; letter-spacing: .02em; box-shadow: none; transition: transform .12s var(--ease), filter .2s, color .2s; }
.btn:hover:not(:disabled) { --edge: var(--sys); --fill: linear-gradient(180deg, #5fe1ff40, #5fe1ff1a), #0a1126; border-color: var(--sys); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.985); }
.btn.primary { --edge: #c9f6ff; --fill: linear-gradient(180deg, #9af0ff 0%, #5fe1ff 46%, #33bfe8 100%); color: var(--sys-ink); font-weight: 700; box-shadow: none; }
.btn.primary:hover:not(:disabled) { --fill: linear-gradient(180deg, #c4f7ff 0%, #7de9ff 46%, #45cdf2 100%); filter: none; }
.btn.primary:active:not(:disabled) { box-shadow: none; transform: translateY(1px) scale(.985); }
.btn.coral { --edge: #e2d4ff; --fill: linear-gradient(180deg, #cdb8ff 0%, #a98bff 50%, #8463ec 100%); color: #130a33; font-weight: 700; box-shadow: none; }
.btn.blue { --edge: var(--sys); --fill: linear-gradient(180deg, #5fe1ff38, #5fe1ff14), #0a1126; }
.btn.green { --edge: #c4ffe6; --fill: linear-gradient(180deg, #8dffd0, #4dffb4 50%, #2ed896); color: #03231a; font-weight: 700; }
.btn.ghost { --edge: #5fe1ff40; --fill: #070b1acc; color: var(--muted); }
.btn.ghost:hover:not(:disabled) { color: var(--ink); }
.btn:disabled, .btn.primary:disabled, .btn.coral:disabled, .btn.blue:disabled, .btn.green:disabled { opacity: 1; --edge: #6f7f9c55; --fill: #0c1020; color: #6f7f9c; filter: none; }
.btn.big { --c: 12px; font-size: 1.12rem; padding: 13px 22px; }
.btn.sm { --c: 6px; padding: 5px 12px; font-size: .84rem; }
.btn small { font-family: var(--body); font-weight: 500; opacity: .82; letter-spacing: 0; }
.btn .gi { width: 18px; height: 18px; }

.iconbtn { border-radius: 2px; border: 1px solid var(--line-2); background: #0a1126e6; color: var(--ink); font-family: var(--display); transition: border-color .2s, background .2s, color .2s; }
.iconbtn:hover { border-color: var(--sys); background: #5fe1ff24; color: #fff; }
.backbtn { border-radius: 2px; border: 1px solid var(--line-2); background: #0a1126; font-family: var(--display); font-weight: 600; padding: 7px 14px 7px 10px; transition: border-color .2s, background .2s; }
.backbtn i { color: var(--sys); }
.backbtn:hover { border-color: var(--sys); background: #5fe1ff1f; }
.screen-name { font-family: var(--display); font-weight: 700; font-size: 1.15rem; letter-spacing: .04em; }
.screen-name:not(:empty)::before { content: "◈"; margin-right: 8px; color: var(--sys); font-size: .8em; vertical-align: .08em; }

.chip { border-radius: 2px; border: 1px solid var(--line); background: #0a1126; color: var(--muted); font-family: var(--display); font-weight: 500; padding: 4px 12px; transition: border-color .2s, color .2s, background .2s; }
button.chip:hover { border-color: var(--line-2); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--sys); color: var(--sys-ink); border-color: var(--sys); font-weight: 600; }

/* ---------- top bar & wallet ---------- */
.top { background: #04050de0; backdrop-filter: blur(12px); border-bottom: 1px solid transparent; border-image: linear-gradient(90deg, transparent, var(--line-2) 18%, var(--line-2) 82%, transparent) 1; }
@media (max-width: 760px) { .top { backdrop-filter: none; background: #04050df5; } }
.cur { border-radius: 2px; background: #080c1ce6; border: 1px solid var(--line); font-family: var(--display); font-weight: 600; padding: 5px 12px 5px 9px; }
.cur b { font-weight: 600; }
.cur.bump { animation: bump .5s var(--ease); }
@keyframes bump { 30% { transform: translateY(-2px); border-color: var(--sys); background: #5fe1ff2e; } }
body[data-view="home"] .cur, body[data-view="home"] .wallet .iconbtn { background: #080c1ce6; }
.ico.crystal { width: 12px; height: 16px; background: linear-gradient(160deg, #f1fdff, #5fe1ff 48%, #6f7dff); filter: drop-shadow(0 0 4px #5fe1ffaa); }
.ico.gold { width: 14px; height: 14px; background: radial-gradient(circle at 35% 30%, #fff6d0, #ffc857 58%, #b9781a); box-shadow: 0 0 6px #ffc85788; }
.ico.shard { background: linear-gradient(160deg, #fff3c4, #ffb86e 50%, #ff5c8a); filter: drop-shadow(0 0 4px #ffb86e88); }
.ico.ore { background: linear-gradient(150deg, #e8eeff, #8696d8 55%, #414c86); }
.ico.soul { box-shadow: 0 0 8px #9ff3ffcc; }
.plate { --c: 10px; --edge: var(--line-2); --fill: #080c1ce6; max-width: 280px; padding: 5px 16px 5px 6px; transition: filter .2s; }
.plate:hover { --edge: var(--sys); border-color: var(--sys); }
.plate-star { border-radius: 2px; background: linear-gradient(180deg, #ffe39a, #ffc857); color: var(--gold-ink); box-shadow: none; clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px); }
.plate-txt b { font-family: var(--display); font-weight: 600; }
.plate-txt small { color: var(--muted); font-family: var(--display); }

/* home dock & side rail */
.dock button { --c: 12px; --edge: var(--line-2); --fill: linear-gradient(180deg, #5fe1ff1c, transparent 60%), #080c1cf2; min-width: 86px; padding: 9px 10px 8px; color: var(--ink); font-family: var(--display); font-weight: 600; box-shadow: none; transition: transform .16s var(--ease), color .2s; }
.dock button i { color: var(--sys); }
.dock button:hover { --edge: var(--sys); border-color: var(--sys); transform: translateY(-3px); }
.dock button:active { transform: translateY(1px); box-shadow: none; }
.dock button.main { --edge: #c9f6ff; --fill: linear-gradient(180deg, #9af0ff 0%, #5fe1ff 46%, #33bfe8 100%); color: var(--sys-ink); font-weight: 700; box-shadow: none; }
.dock button.main i { color: var(--sys-ink); }
.dock button.main:active { box-shadow: none; }
.dock button.hot { --edge: var(--gold); border-color: var(--gold); animation: hot 1.1s ease-in-out infinite alternate; }
.dock button.hot i { color: var(--gold); }
@keyframes hot { to { transform: translateY(-4px); filter: brightness(1.35); } }
.railbtn { border-radius: 2px; border: 1px solid var(--line); background: #080c1ce0; font-family: var(--display); font-weight: 500; transition: border-color .2s, background .2s; }
.railbtn i { color: var(--sys); }
.railbtn:hover { border-color: var(--sys); background: #0e1836; }
.railbtn.quest { border-color: #ffc85788; }
.railbtn.quest i { color: var(--gold); }
.railbtn.quest.claim { background: var(--gold); color: var(--gold-ink); border-color: #fff0c2; }
.railbtn.quest.claim i { color: var(--gold-ink); }
.railbtn .dot, .chatpill .unread { border-radius: 2px; background: var(--coral); color: #2a0513; font-family: var(--display); font-weight: 700; }
.chatpill { border-radius: 2px; border: 1px solid var(--line-2); background: #080c1cf2; font-family: var(--display); font-weight: 600; box-shadow: 0 10px 24px -8px #000c; transition: border-color .2s, background .2s; }
.chatpill i { color: var(--sys); }
.chatpill:hover { background: #0e1836; color: var(--ink); border-color: var(--sys); }
.keep-ui .iconbtn { background: #080c1ce0; backdrop-filter: none; }
.keep-hint, .crewtag, .yardmore { border-radius: 2px; background: #05070fd9; border: 1px solid var(--line); color: var(--muted); font-family: var(--display); }

/* ---------- windows ---------- */
.panel { --c: 14px; --edge: #5fe1ff4d; --fill: linear-gradient(180deg, #5fe1ff0f, transparent 90px), #090d1fe6; padding: 18px; backdrop-filter: none; }
.panel h3 { font-size: 1.15rem; }
.sheet { --c: 18px; --edge: #5fe1ff99; --fill: linear-gradient(180deg, #5fe1ff1a 0, transparent 120px), #080b1c; box-shadow: none; }
.sheet.narrow { padding: 22px; }
.layer { background: #020308d9; backdrop-filter: blur(6px); }
.layer .sheet { animation: winopen .28s var(--ease); }
@keyframes winopen { from { opacity: 0; transform: scale(.97) translateY(8px); } }
.sheet .x { border-radius: 2px; }
/* the window's title strip */
.sys-tag { display: inline-flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 600; font-size: .74rem; letter-spacing: .16em; color: var(--sys); text-shadow: none; }
.sys-tag::after { content: ""; width: 54px; height: 1px; background: linear-gradient(90deg, var(--sys), transparent); }
.sysline { font-family: var(--display); font-weight: 500; font-size: .84rem; letter-spacing: .03em; color: var(--sys); }
.title-card { --c: 16px; --edge: #5fe1ff80; --fill: linear-gradient(180deg, #5fe1ff14 0, transparent 110px), #070a1af0; padding: 22px; gap: 12px; backdrop-filter: none; box-shadow: none; }
.title-card label, #devLogin label { font-family: var(--display); font-weight: 500; letter-spacing: .04em; color: var(--muted); }
#devLogin { border-top-color: var(--line); }

/* sunken wells inside windows */
.stat, .rates div, .statgrid div, .skill, .mail, .voy, .grave, .forge, .bonus, .lore article, .itemrow, .sealog p, .weekrow span, .slot, .codebox, .vital, .cquote, .mutelist li, .glist li, .gstats span, .ranklist li, .buildopt .bi {
  background: #05081480 !important; border: 1px solid #5fe1ff24 !important; border-radius: 2px;
}
.stat b, .voy b, .grave b, .dtier b, .buildopt b, .mail header b, .gearslot b, .lore article b, .ranklist .rn b, .ranklist .rv, .ranklist .rk, .fin b, .gnow b, .squad-info b { font-family: var(--display); font-weight: 600; }
input, .codebox { border-radius: 2px; border: 1px solid var(--line-2); background: #04060fe6; color: var(--ink); font-family: var(--body); transition: border-color .2s, box-shadow .2s; }
input::placeholder { color: var(--dim); }
input:focus-visible, .codebox:focus-visible { outline: none; border-color: var(--sys); box-shadow: inset 0 0 0 1px var(--sys), inset 0 0 18px #5fe1ff1f; }
.toggle input { accent-color: var(--sys); }
.buildopt { --c: 10px; --edge: var(--line); --fill: #0a0f24; padding: 10px 12px; transition: filter .2s; }
.buildopt:hover:not(:disabled) { --edge: var(--sys); border-color: var(--sys); }
.dtier { --c: 12px; --edge: var(--line); --fill: #080c1c; }
.odds { --c: 10px; --edge: var(--line); --fill: #05081a; }
.odds.deadly { --edge: var(--danger); }
.gearslot { border-radius: 2px; background: #05081480; border-color: var(--line); }
.gearslot:hover { border-color: var(--sys); }
.mail.new { border-color: var(--gold) !important; box-shadow: none; }
.sealog p.win, .sealog p.lose, .lore article, .itemrow { border-left-width: 1px !important; }
.sealog p.win { border-color: #4dffb466 !important; } .sealog p.lose { border-color: #ff547066 !important; }
.lore article { border-color: #ffc85755 !important; } .lore article.locked { border-color: #5fe1ff24 !important; }
.itemrow { border-color: color-mix(in srgb, var(--gc, #5fe1ff) 45%, transparent) !important; }
.mtag { border-radius: 2px; font-family: var(--display); font-weight: 600; background: #0a1126; border-color: var(--line); }
.weekrow span.on { background: var(--gold) !important; color: var(--gold-ink); border-color: var(--gold) !important; }
.guide { --edge: #ffc85780; --fill: linear-gradient(180deg, #ffc85714, transparent 90px), #090d1fe6; }
.gsteps i { border-radius: 2px; font-family: var(--display); background: #05081a; }
.gsteps i.cur { background: var(--gold); color: var(--gold-ink); }
.panel.nodock { --edge: var(--gold); }
.slot { border-style: dashed !important; font-family: var(--display); }
button.slot:hover { border-color: var(--sys) !important; color: var(--ink); }

/* bars */
.bar { height: 6px; border-radius: 0; background: #ffffff14; }
.bar > s { background: linear-gradient(90deg, #6f7dff, var(--sys)); box-shadow: 0 0 10px #5fe1ff88; }
.bar.fat { position: relative; height: 26px; overflow: hidden; border: 1px solid var(--line-2); background: #04060fcc; }
.bar.fat > s { background: linear-gradient(90deg, #6f7dff66, #5fe1ff8c); box-shadow: none; }
.bar.fat > span { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-weight: 600; font-size: .84rem; letter-spacing: .02em; color: #fff; }

/* toast: a system notice */
.toast { --c: 9px; --edge: var(--sys); --fill: #060a1af5; padding: 10px 20px; font-family: var(--display); font-weight: 500; box-shadow: none; animation: notice .3s var(--ease); }
.toast::before { content: "◈ "; color: var(--sys); }
@keyframes notice { from { opacity: 0; translate: 0 10px; } }

/* ---------- hero cards ---------- */
.card { border-radius: 0; }
.card .frame { --c: 12px; --bw: 2px; --edge: var(--rc); --fill: #080b1c; aspect-ratio: 2 / 3; box-shadow: none; transition: transform .22s var(--ease), filter .22s; }
.card.r5 .frame, .card.s6 .frame { box-shadow: none; }
.card .frame::after { background: linear-gradient(180deg, #04050d55 0%, transparent 24%, transparent 46%, #04050df2 100%), linear-gradient(0deg, color-mix(in srgb, var(--rc) 34%, transparent) 0, transparent 34%); }
/* a slow sweep of light across the rarest cards */
.card.r5 .frame::before, .card.s6 .frame::before { content: ""; position: absolute; z-index: 1; inset: -20% -60%; background: linear-gradient(105deg, transparent 42%, #ffffff66 50%, transparent 58%); mix-blend-mode: screen; animation: sweep 4.2s ease-in-out infinite; pointer-events: none; }
@keyframes sweep { 0%, 55% { transform: translateX(-55%); } 100% { transform: translateX(55%); } }
.card .meta { left: 9px; right: 9px; bottom: 8px; }
.card .meta b { font-family: var(--display); font-weight: 600; font-size: 1rem; text-shadow: 0 1px 6px #000; }
.card .meta span { font-family: var(--display); color: #dbe9ffcc; }
.card .badge { top: 0; left: 0; padding: 3px 9px 2px 16px; border-radius: 0; background: #04050dd9; color: var(--rc); font-family: var(--display); font-size: .7rem; letter-spacing: .04em; }
.card .cls { border-radius: 2px; background: #04050dd9; border: 1px solid color-mix(in srgb, var(--rc) 55%, transparent); }
.card .inteam { top: 36px; border-radius: 2px; background: var(--mint); color: #03231a; font-family: var(--display); font-weight: 700; }
.card .inteam.job { background: #0a1126; color: var(--ink); border: 1px solid var(--line-2); }
.card .status { border-radius: 2px; background: #04050dd9; }
.card.locked .frame { --edge: #5fe1ff33; filter: grayscale(1) brightness(.45); }
button.card:hover .frame, .grid.roster button.card:hover .frame { transform: translateY(-5px); filter: brightness(1.12); box-shadow: none; }
.featcard .card.locked .frame { --edge: var(--r5); }
.ava { border-width: 2px; background: #080b1c; }
.avabtn { font-family: var(--display); }
.avabtn:hover .ava { border-color: var(--sys); }
.cmood { border-radius: 0; height: 2px; }
.squad { --edge: #5fe1ff4d; }
.squad-info b { font-size: 1.4rem; color: var(--ink); }
/* class-tinted stand-ins for heroes without a picture yet */
.cls-tank    { background: linear-gradient(160deg, #24468f, #0a1230); }
.cls-warrior { background: linear-gradient(160deg, #8a2a4c, #1c0a1e); }
.cls-mage    { background: linear-gradient(160deg, #5a3fc0, #120a36); }
.cls-ranger  { background: linear-gradient(160deg, #1b7f78, #071c26); }
.cls-healer  { background: linear-gradient(160deg, #a8782c, #24160a); }
.cls-normal  { background: linear-gradient(160deg, #27305c, #080b1c); }
.cls-boss    { background: linear-gradient(160deg, #7a1840, #14040e); }
.fallback .glyph { font-family: var(--display); font-weight: 600; color: #ffffffd9; text-shadow: 0 2px 14px #000a; }
.fallback .glyph small { letter-spacing: .12em; color: #ffffffa6; }

/* ---------- title ---------- */
.title-art img { opacity: .82; }
.title-art::after { background: linear-gradient(180deg, #04050d33 0%, #04050d00 26%, #04050dd9 68%, var(--night) 100%), repeating-linear-gradient(0deg, #ffffff06 0 1px, transparent 1px 3px); }
.logo { letter-spacing: .06em; font-weight: 700; }
.logo span { font-size: clamp(3.4rem, 14vw, 5.6rem); color: #fff; font-weight: 700; text-shadow: 0 0 34px #5fe1ffaa, 0 0 2px #5fe1ff; }
.logo em { color: var(--sys); font-weight: 600; letter-spacing: .5em; margin-right: -.5em; padding-top: 10px; border-top: 1px solid var(--line-2); }
.tag { color: var(--muted); font-size: 1rem; text-shadow: 0 2px 12px #000; }

/* ---------- summon stage ---------- */
.stage-split { grid-template-columns: minmax(0, 1fr); gap: 18px; }
.banner.stage { --c: 24px; --edge: #5fe1ff80; --fill: #05060f; min-height: clamp(400px, 58vh, 580px); grid-template-columns: minmax(0, 1fr); }
.banner > .artbox { background: radial-gradient(circle at 60% 40%, #1c2a7a 0%, #0a1030 45%, #04050d 80%); }
.banner.stage::after { background: linear-gradient(90deg, #04050df2 0%, #04050db3 36%, transparent 68%), linear-gradient(0deg, #04050dcc, transparent 42%), repeating-linear-gradient(0deg, #ffffff05 0 1px, transparent 1px 3px); }
.banner.stage .in { align-self: center; min-width: 0; width: 100%; max-width: 540px; padding: 30px 34px; gap: 12px; z-index: 3; }
.outline.big { font-family: var(--display); font-weight: 700; font-size: clamp(2.1rem, 5vw, 3.2rem); line-height: 1.12; color: #fff; text-shadow: 0 0 30px #5fe1ff66; }
.outline.sub { font-family: var(--body); font-weight: 500; font-size: 1.02rem; color: var(--muted); }
.ribbon { justify-self: start; padding: 3px 14px 3px 12px; background: var(--gold); color: var(--gold-ink); font-family: var(--display); font-weight: 700; font-size: .84rem; letter-spacing: .06em; clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }
.banner.stage .pity { width: min(400px, 100%); max-width: 100%; margin-top: 2px; }
.banner.stage .pullrow { gap: 12px; margin-top: 6px; }
.pull { position: relative; }
.pullrow .btn.pull { flex: 0 1 180px; min-width: 0; }
.btn.pull { --c: 14px; font-size: 1.7rem; font-weight: 700; line-height: 1.05; padding: 12px 18px 12px; letter-spacing: .04em; }
.btn.pull small { font-size: .92rem; display: inline-flex; align-items: center; gap: 5px; font-family: var(--display); font-weight: 600; opacity: .9; }
.btn.beat { animation: beat 2s ease-in-out infinite; }
.sticker { position: absolute; top: 0; right: 0; padding: 1px 8px 1px 10px; background: #04050dd9; color: var(--gold); font-family: var(--display); font-weight: 600; font-size: .68rem; letter-spacing: .04em; clip-path: polygon(0 0, 100% 0, 100% 100%, 8px 100%); }
.btn:disabled .sticker { color: #6f7f9c; }
.banner.stage .rates { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.banner.stage .rates div { padding: 3px 12px; font-family: var(--display); font-weight: 600; font-size: .9rem; display: flex; gap: 7px; align-items: baseline; }
.rates div { font-family: var(--display); font-weight: 600; } .rates small { white-space: nowrap; color: var(--dim); font-weight: 500; }
.feathero { position: absolute; z-index: 2; right: 0; top: -2%; bottom: -6%; width: min(56%, 540px); animation: bob 5s ease-in-out infinite alternate; }
.feathero .artbox { position: absolute; inset: 0; background: none; mask: radial-gradient(ellipse 58% 68% at 55% 50%, #000 55%, transparent 100%); -webkit-mask: radial-gradient(ellipse 58% 68% at 55% 50%, #000 55%, transparent 100%); }
.feathero img { object-position: 50% 18%; }
.featname { position: absolute; z-index: 3; right: 26px; bottom: 22px; text-align: right; display: grid; font-family: var(--display); }
.featname b { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 700; text-shadow: 0 2px 18px #000, 0 0 2px #000; }
.featname small { font-weight: 600; letter-spacing: .14em; color: var(--gold); text-shadow: 0 2px 10px #000; }
/* the summoning array behind the guide star: turning rings of light instead of comic rays */
.motes .rays { position: absolute; right: 2%; top: 50%; width: min(62%, 600px); aspect-ratio: 1; translate: 0 -50%; border-radius: 50%;
  background: repeating-conic-gradient(#5fe1ff3d 0 .6deg, transparent .6deg 6deg), repeating-radial-gradient(circle, transparent 0 11%, #5fe1ff40 11% 11.4%, transparent 11.4% 17%);
  mask: radial-gradient(circle, transparent 20%, #000 34%, #000 60%, transparent 71%); -webkit-mask: radial-gradient(circle, transparent 20%, #000 34%, #000 60%, transparent 71%); animation: turn 60s linear infinite; }
.motes .mote { background: #dffaff; box-shadow: 0 0 8px var(--sys); }
.motes .sigil { border-color: #5fe1ff66; box-shadow: inset 0 0 40px #5fe1ff22, 0 0 50px #6f7dff33; }
@media (max-width: 700px) {
  .banner.stage { min-height: 540px; }
  /* the guide star stands above the banner's shade, so on a phone the text carries its own backdrop */
  .banner.stage .in { align-self: end; padding: 56px 18px 18px; background: linear-gradient(180deg, transparent 0, #04050de0 64px, #04050df7 100%); }
  .banner.stage::after { background: linear-gradient(0deg, #04050dfa 0%, #04050dfa 44%, #04050dcc 58%, transparent 80%); }
  .hud.collect { bottom: calc(104px + env(safe-area-inset-bottom)); }
  .feathero { width: 100%; top: -4%; bottom: 30%; }
  .featname { top: 16px; bottom: auto; right: 16px; }
  .btn.pull { font-size: 1.35rem; }
  .pullrow .btn.pull { flex: 1 1 0; }
}

/* ---------- motion ---------- */
@keyframes bob { from { transform: translateY(-5px); } to { transform: translateY(5px); } }
@keyframes beat { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.18); } }
#view.enter > * { animation: viewin .42s var(--ease) both; }
@keyframes viewin { from { opacity: 0; transform: translateY(14px); filter: blur(4px); } }
@media (prefers-reduced-motion: reduce) { .feathero, .btn.beat, .dock button.hot, .card .frame::before, .layer .sheet, .toast { animation: none !important; } }

/* ---------- the base: a keep adrift in the void, read through the System ---------- */
.keep { border: 1px solid var(--line); border-radius: 4px; background:
  radial-gradient(ellipse 70% 40% at 50% 104%, #2b3bb055 0%, transparent 70%),
  radial-gradient(ellipse 46% 34% at 78% 12%, #5a3fc02e 0%, transparent 70%),
  linear-gradient(180deg, #03040b 0%, #060a1e 46%, #0c1438 80%, #1a2360 100%); }
/* a faint survey grid on the horizon */
.keep-sky::before { content: ""; position: absolute; left: -30%; right: -30%; bottom: -6%; height: 44%; background: repeating-linear-gradient(90deg, #5fe1ff24 0 1px, transparent 1px 64px), repeating-linear-gradient(0deg, #5fe1ff24 0 1px, transparent 1px 34px); transform: perspective(520px) rotateX(64deg); transform-origin: 50% 100%; mask: linear-gradient(0deg, #000 0%, transparent 86%); -webkit-mask: linear-gradient(0deg, #000 0%, transparent 86%); }
.moon { background: radial-gradient(circle at 38% 34%, #ffffff, #cfeaff 52%, #7fa8e6); box-shadow: 0 0 0 1px #5fe1ff66, 0 0 0 14px #5fe1ff0d, 0 0 0 15px #5fe1ff26, 0 0 60px 14px #5fe1ff33; animation: none; }
.comet { background: linear-gradient(90deg, #dffaff, transparent); }
.cloud { filter: blur(5px); }
.cloud.far { opacity: .08; } .cloud.mid { opacity: .12; } .cloud.near { opacity: .14; }
.isle { background: linear-gradient(180deg, #2a8f9a 0 16%, #141c48 16%, #05060f); opacity: .7; }
.tower { width: 314px; border-left: 1px solid #5fe1ff80; border-right: 1px solid #5fe1ff80; background: #05070f; box-shadow: 0 0 70px #5fe1ff1f, 0 30px 60px -20px #000; }
.tower::before, .tower::after { content: ""; position: absolute; top: -6px; bottom: -6px; width: 5px; background: linear-gradient(180deg, #9af0ff, #2a3a8a 18%, #141c48 82%, #9af0ff); }
.tower::before { left: -6px; } .tower::after { right: -6px; }
.spire::before { width: 326px; height: 54px; background: linear-gradient(180deg, #2a3a8a, #0e1638 70%, #080c1c); }
.spire::after { width: 326px; height: 2px; background: var(--sys); opacity: 1; border-radius: 0; box-shadow: 0 0 14px var(--sys); }
.spire .star { color: var(--gold); text-shadow: 0 0 14px var(--gold), 0 0 36px #ffc857aa; }
.spire .beam { background: conic-gradient(from 0deg, #5fe1ff3d, transparent 9%, transparent 50%, #5fe1ff24 54%, transparent 62%); }
.spire .flag { background: linear-gradient(90deg, var(--sys), #6f7dff); }
.deck { border-top: 1px solid color-mix(in srgb, var(--rh) 60%, transparent); }
.deck > .artbox { background: radial-gradient(ellipse 70% 90% at 82% 60%, color-mix(in srgb, var(--rh) 26%, transparent), transparent 70%), linear-gradient(180deg, #0c1230 0%, #080c1c 62%, #04050d 100%); }
.deck::after { background: linear-gradient(90deg, #04050de6 0%, #04050d8c 46%, transparent 100%), linear-gradient(0deg, #04050dd9 0, transparent 26px), repeating-linear-gradient(0deg, #ffffff05 0 1px, transparent 1px 3px); }
.deck > .artbox .fallback .glyph { opacity: .5; filter: drop-shadow(0 0 14px var(--rh)); text-shadow: none; }
.deck .fin b { font-weight: 600; font-size: 1rem; }
.deck .fin b small { color: var(--rh); font-family: var(--display); }
.fno { background: #04050dd9; color: var(--rh); border-right: 1px solid color-mix(in srgb, var(--rh) 40%, transparent); font-family: var(--display); font-weight: 600; }
button.deck:hover, button.deck:focus-visible { box-shadow: inset 0 0 0 1px var(--rh), inset 0 0 30px color-mix(in srgb, var(--rh) 22%, transparent); }
.deck.ghost { border: 1px dashed var(--sys); border-bottom: 0; background: repeating-linear-gradient(135deg, #5fe1ff14 0 10px, transparent 10px 20px); }
.deck.ghost b { color: var(--sys); }
.deck.ghost.locked { border-color: var(--line); }
@keyframes ghost { from { box-shadow: inset 0 0 0 0 #5fe1ff00; } to { box-shadow: inset 0 0 26px 0 #5fe1ff44; } }
.ready { border-radius: 2px; background: #04050de6; border: 1px solid var(--gold); color: var(--gold); box-shadow: 0 0 14px #ffc85766; }
.crewtag::before { content: "◆ "; }
.yard::before { background: linear-gradient(180deg, #1a2456, #0a0f28); border-top: 1px solid var(--sys); box-shadow: 0 -1px 12px #5fe1ff66, 0 8px 16px #000a; border-radius: 0 0 3px 3px; }
.yard::after { background: linear-gradient(180deg, #ffffff, #9af0ff); box-shadow: 0 0 20px 5px #5fe1ff77; }
.lamp { background: #2a3a8a; }
.lamp::after { background: #dffaff; box-shadow: 0 0 16px 5px #5fe1ff88; }
#rockFill stop:nth-child(1) { stop-color: #1c2760; } #rockFill stop:nth-child(2) { stop-color: #0c1232; } #rockFill stop:nth-child(3) { stop-color: #04050d; }
#turfFill stop:nth-child(1), #turfFill stop:nth-child(3) { stop-color: #14606e; } #turfFill stop:nth-child(2) { stop-color: #37c8c0; }
#xtalFill stop:nth-child(1) { stop-color: #ffffff; } #xtalFill stop:nth-child(2) { stop-color: #5fe1ff; }
.rock .xtal path { filter: drop-shadow(0 0 8px #5fe1ff); }
.dust { background: #dffaff; box-shadow: 0 0 8px var(--sys); }
.spr-body::before, .spr-body::after { background: #141c48; }
button.spr:hover .ava, button.spr:focus-visible .ava { border-color: var(--sys); }
button.spr:hover .spr-in, button.spr:focus-visible .spr-in { filter: drop-shadow(0 0 6px var(--sys)); } /* the avatar is clipped to its circle, so the glow sits on the walker */

/* ---------- the heroes' voice: the only soft, warm shapes on screen ---------- */
.saybox p, .bub, .rsay, .hquote { --inkline: var(--paper); border: 0; border-radius: 12px; background: var(--paper); color: #1b2036; box-shadow: 0 10px 24px -10px #000c; font-weight: 500; }
.saybox p b { font-family: var(--display); font-weight: 600; color: #4a56a8; }
/* narration belongs to the System: a dark caption with a thin rule */
.rcap, .bcap, .pcap { background: #05070fe6; color: var(--ink); border: 0; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); border-radius: 0; box-shadow: none; text-align: center; }
.bcap small { font-family: var(--display); font-weight: 600; letter-spacing: .08em; color: var(--sys); }
.pcap { text-align: left; }

/* ---------- summoning ---------- */
.reveal { background: radial-gradient(circle at 50% 40%, #121a4af2, #04050dfa 70%); }
.reveal h2 { font-weight: 700; font-size: 1.6rem; }
.reveal .card .new { border-radius: 2px; background: var(--coral); color: #2a0513; font-family: var(--display); font-weight: 700; }
.reveal.scene { background: radial-gradient(circle at 50% 62%, color-mix(in srgb, var(--glow) 22%, #0a1030) 0, #04050d 58%, #020308 100%); }
.ring { border-width: 1px; box-shadow: 0 0 30px var(--glow), inset 0 0 30px color-mix(in srgb, var(--glow) 50%, transparent); }
.ring.r2 { border-width: 2px; }
.rpanel { --c: 22px; --bw: 1px; --edge: color-mix(in srgb, var(--glow) 80%, #fff); --fill: repeating-linear-gradient(0deg, #ffffff05 0 1px, transparent 1px 3px), linear-gradient(150deg, color-mix(in srgb, var(--glow) 26%, #080b1c), #05060f 70%); outline: 0; box-shadow: none; }
.tier5 .rpanel { outline: 0; }
.rfig { border-right: 1px solid color-mix(in srgb, var(--glow) 50%, transparent); background: repeating-conic-gradient(from 0deg at 50% 60%, color-mix(in srgb, var(--glow) 26%, transparent) 0 1deg, transparent 1deg 9deg); }
.tier5 .rfig { background: repeating-conic-gradient(from 0deg at 50% 60%, #ffc85755 0 1deg, transparent 1deg 9deg); }
.rinfo { padding: 22px; gap: 10px; }
.rinfo h2 { font-weight: 700; color: #fff; text-shadow: 0 0 26px color-mix(in srgb, var(--glow) 70%, transparent); }
.tier5 .rinfo h2 { color: var(--gold); }
.rmeta { font-family: var(--display); color: var(--muted); }
.rnote { border-radius: 2px; background: var(--coral); color: #2a0513; font-family: var(--display); font-weight: 700; }
.meteor { background: linear-gradient(180deg, transparent, var(--mc, #dffaff)); }
@media (max-width: 620px) { .rfig { border-right: 0; border-bottom: 1px solid color-mix(in srgb, var(--glow) 50%, transparent); } }
/* prologue */
.reveal.prologue { background: #020308; }
.ppanel { --c: 22px; --edge: var(--line-2); --fill: #080c1c; outline: 0; box-shadow: none; }
.pfig { border-right: 1px solid var(--line-2); }
.ppanel.hero { --fill: linear-gradient(150deg, #121a4a, #05060f 70%); }
.ppanel.sys { --fill: repeating-linear-gradient(0deg, #5fe1ff0a 0 1px, transparent 1px 4px), radial-gradient(circle at 50% 40%, #101a52, #04050d 75%); }
.pcount { font-family: var(--display); color: var(--dim); }
@media (max-width: 620px) { .pfig { border-right: 0; border-bottom: 1px solid var(--line-2); } }

/* ---------- hero page: the status window ---------- */
.hport { border-right: 1px solid var(--line-2); background: repeating-linear-gradient(0deg, #ffffff05 0 1px, transparent 1px 3px), radial-gradient(ellipse 90% 60% at 50% 100%, color-mix(in srgb, var(--rc, #5fe1ff) 42%, transparent), transparent 70%), linear-gradient(180deg, #0c1230, #05060f); }
.hnav { font-family: var(--display); font-weight: 600; }
.hnav .iconbtn { background: #04050dcc; }
.hsheet h2 { font-size: 2rem; font-weight: 700; }
.hsheet .body { padding: 24px; }
.awk i.on { color: var(--gold); text-shadow: 0 0 10px #ffc857aa; }
.vital b { font-family: var(--display); font-weight: 600; }
.hsheet .statgrid div { display: grid; gap: 0; padding: 8px 4px 9px; }
.hsheet .statgrid div b { font-family: var(--display); font-size: 1.35rem; font-weight: 700; }
.hsheet .statgrid div small { font-family: var(--display); font-weight: 500; letter-spacing: .04em; }
.hsheet .statgrid div:nth-child(1) small { color: var(--mint); } .hsheet .statgrid div:nth-child(2) small { color: var(--coral); }
.hsheet .statgrid div:nth-child(3) small { color: var(--r3); } .hsheet .statgrid div:nth-child(4) small { color: var(--gold); }
.skill b { font-family: var(--display); font-weight: 600; }
@media (max-width: 640px) { .hport { border-right: 0; border-bottom: 1px solid var(--line-2); } }

/* ---------- tower: the climbing path as a route plot ---------- */
.tmap { border-radius: 3px; border: 1px solid var(--line-2); background: repeating-linear-gradient(0deg, #5fe1ff12 0 1px, transparent 1px 34px), repeating-linear-gradient(90deg, #5fe1ff12 0 1px, transparent 1px 34px), linear-gradient(180deg, #101a48 0%, #080c1c 55%, #04050d 100%); }
.tmap::after { background: radial-gradient(ellipse at 50% 45%, transparent 40%, #04050dcc 100%); }
.tmap-fx .win { border-radius: 2px; background: linear-gradient(180deg, #5fe1ff55, #6f7dff1f); box-shadow: 0 0 22px #5fe1ff44; }
.tmap-fx .mote { background: #dffaff; box-shadow: 0 0 8px var(--sys); }
.tpath path { stroke: #ffffff40; stroke-width: 3px; stroke-dasharray: 1 9; }
.tpath path.open { stroke: var(--sys); }
.tpath path.done { stroke: #4dffb499; stroke-width: 2px; }
.tnode { border-radius: 4px; border: 1px solid var(--line-2); background: #0b1230; color: var(--muted); font-family: var(--display); font-weight: 600; box-shadow: 0 8px 16px -6px #000c; transition: transform .16s var(--ease), border-color .2s; }
.tnode b { font-weight: 600; }
.tnode:not(:disabled):hover { transform: translateY(-3px); border-color: var(--sys); }
.tnode:not(:disabled):active { transform: translateY(1px); box-shadow: 0 4px 10px -6px #000c; }
.tnode.done { border-color: #4dffb480; color: var(--mint); background: #082a2a; }
.tnode.boss { border-radius: 4px; border-color: var(--coral); background: #2a0a1e; color: #ffd0de; }
.tnode.boss.done { background: #082a2a; color: var(--mint); }
.tnode.cur { background: var(--sys); color: var(--sys-ink); border-color: #dffaff; box-shadow: 0 0 22px #5fe1ff88; }
.tnode.cur::after { border: 1px solid var(--sys); }
.tnode.locked { background: #070a18; color: var(--dim); }
.tnode .pip { border-radius: 0; rotate: 45deg; }
.tgate { border-radius: 2px; border: 1px solid var(--line); background: #04050dd9; font-family: var(--display); font-weight: 600; }
button.tgate:not(:disabled) { color: var(--sys); border-color: var(--line-2); }
button.tgate:not(:disabled):hover { background: #5fe1ff24; }
.foe .artbox { border-radius: 3px; border-color: var(--line-2); }
.foe.boss .artbox { border-color: var(--coral); box-shadow: 0 0 18px #ff5c8a44; }
.floorpick .now { font-weight: 700; }

/* ---------- cloud sea: a tactical chart ---------- */
.seamap { border: 1px solid var(--line-2); border-radius: 3px; background: #04050d; }
.sea-world { background:
  repeating-linear-gradient(0deg, #5fe1ff14 0 1px, transparent 1px 64px), repeating-linear-gradient(90deg, #5fe1ff14 0 1px, transparent 1px 64px),
  repeating-radial-gradient(circle at 50% 50%, transparent 0 191px, #5fe1ff1f 191px 192px),
  radial-gradient(circle at 50% 50%, #1c2a7a 0%, #101a52 26%, #0a1030 58%, #04050d 100%); }
.sea-world::before { opacity: .22; }
.sea-world::after { box-shadow: inset 0 0 140px 50px #020308e6; }
.sea-world .cloud { opacity: .1; }
.sea-routes line { stroke: var(--sys); stroke-width: 2px; stroke-dasharray: 2 8; filter: drop-shadow(0 0 4px var(--sys)); }
.sea-routes line.back { stroke: var(--mint); filter: drop-shadow(0 0 4px var(--mint)); }
.isle-rock { width: 56px; height: 26px; background: linear-gradient(180deg, var(--turf) 0 22%, #3a4a9a 22%, #1a2360 60%, #0a0f2a 100%); filter: drop-shadow(0 6px 6px #000a) drop-shadow(0 0 5px color-mix(in srgb, var(--turf) 60%, transparent)); }
.isle-ico { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--turf) 80%, transparent)); }
.tile.islet small { border-radius: 2px; padding: 0 8px; background: #04050de6; border: 1px solid color-mix(in srgb, var(--turf) 55%, transparent); color: var(--ink); font-family: var(--display); font-weight: 500; }
.tile.islet.home small { color: var(--gold); } .tile.islet.boss small { color: var(--coral); }
.tile.islet:hover, .tile.islet:focus-visible { filter: drop-shadow(0 0 10px var(--turf)); }
.tile.islet.home { --turf: #ffc857; } .tile.islet.ai { --turf: #62b6ff; } .tile.islet.camp { --turf: #ff8a5c; }
.tile.islet.ruin { --turf: #a3b8d8; } .tile.islet.ruin.mine { --turf: #4dffb4; --ring: #4dffb4; } .tile.islet.ruin.taken { --turf: #ff5c8a; }
.tile.islet.boss { --turf: #ff4d6d; --ring: #ff4d6d; } .tile.islet.player { --turf: #5fe1ff; --ring: #5fe1ff; } .tile.islet.ally { --turf: #a98bff; }
.tile.islet.home::before, .tile.islet.boss::before, .tile.islet.ruin.mine::before, .tile.islet.player::before { border-width: 1px; box-shadow: 0 0 16px var(--ring, var(--gold)), inset 0 0 10px var(--ring, var(--gold)); }
.sea-world .ship { filter: drop-shadow(0 0 6px var(--sys)) drop-shadow(0 3px 3px #000); }
.sea-ui [data-zoom="home"] { color: var(--gold); }
.voy span { color: var(--sys); font-family: var(--display); }

/* ---------- battle: a lit grid floor, standing portraits, segmented bars ---------- */
.battle { background: #04050d; }
.battle > .artbox { background: linear-gradient(180deg, #0c1438, #04050d); }
.battle > .artbox img { opacity: .38; filter: saturate(.8); }
.battle > .artbox::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, #ffffff05 0 1px, transparent 1px 3px), radial-gradient(ellipse at 50% 40%, transparent 30%, #04050dd9 100%); }
.bhead h2 { font-size: 1.15rem; font-weight: 700; letter-spacing: .03em; }
.bhead h2::before { content: "◈"; margin-right: 8px; color: var(--sys); font-size: .8em; }
.bfield::before { left: -30%; right: -30%; height: 58%; background: repeating-linear-gradient(90deg, #5fe1ff38 0 1px, transparent 1px 70px), repeating-linear-gradient(0deg, #5fe1ff38 0 1px, transparent 1px 36px), linear-gradient(0deg, #0a1030, transparent); transform: perspective(520px) rotateX(62deg); transform-origin: 50% 100%; mask: linear-gradient(0deg, #000 10%, transparent 92%); -webkit-mask: linear-gradient(0deg, #000 10%, transparent 92%); }
.unit .hp, .stage .unit .hp { height: 6px; border-radius: 0; background: #00000099; box-shadow: 0 0 0 1px #ffffff26; mask: repeating-linear-gradient(90deg, #000 0 9px, transparent 9px 10px); -webkit-mask: repeating-linear-gradient(90deg, #000 0 9px, transparent 9px 10px); }
.unit .hp s { background: linear-gradient(90deg, #2ed896, var(--mint)); }
.unit.enemy .hp s { background: linear-gradient(90deg, #e03058, var(--coral)); }
.unit .en { gap: 5px; margin: 1px 0; }
.unit .en i { width: 6px; height: 6px; border-radius: 0; rotate: 45deg; background: #ffffff2e; }
.unit .en i.on { background: var(--sys); box-shadow: 0 0 8px var(--sys); }
.unit .nm, .stage .unit .nm { color: var(--ink); font-family: var(--display); font-weight: 600; font-size: .74rem; text-shadow: 0 1px 6px #000; }
/* heroes stand as portrait panels on a ring of their class colour */
.stage .unit { width: clamp(68px, 17vw, 112px); }
.stage .hero .fig .ava, .xhero .ava { width: clamp(52px, 13vw, 88px); height: auto; aspect-ratio: 3 / 4; border-radius: 0; border: 0; box-shadow: none; background: #080b1c; clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px); }
.stage .hero .fig .ava::after, .xhero .ava::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 2px var(--rc, var(--sys)); background: linear-gradient(135deg, var(--rc, var(--sys)) 0 8px, transparent 0), linear-gradient(315deg, var(--rc, var(--sys)) 0 8px, transparent 0), linear-gradient(0deg, color-mix(in srgb, var(--hue, #5fe1ff) 50%, transparent), transparent 40%); pointer-events: none; }
.stage .hero .fig .ava .artbox img, .xhero .ava .artbox img { transform: scale(1.35); transform-origin: 50% 8%; }
.stage .hero .fig .spr-body, .xhero .spr-body { display: none; }
.fig::after, .xhero::after { left: 2%; right: 2%; bottom: -12px; height: 16px; background: radial-gradient(ellipse, color-mix(in srgb, var(--hue, #5fe1ff) 55%, transparent) 0, transparent 68%); border: 1px solid color-mix(in srgb, var(--hue, #5fe1ff) 80%, transparent); box-shadow: 0 0 14px color-mix(in srgb, var(--hue, #5fe1ff) 70%, transparent); }
.unit.enemy { --hue: #ff5c8a; }
.stage .enemy .fig .artbox, .xfoe .artbox { border-radius: 0; border: 0; background: #14040e; clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px)); }
.stage .enemy .fig { filter: drop-shadow(0 0 10px #ff5c8a66); }
.unit.boss .fig { filter: drop-shadow(0 0 18px #ff5c8aaa); }
.unit.guard .fig .ava, .unit.guard .artbox { box-shadow: none; }
.unit.guard .fig::before { content: ""; position: absolute; z-index: 2; inset: -8px -10px -4px; border: 1px solid var(--r3); background: linear-gradient(180deg, #62b6ff33, transparent 60%); clip-path: polygon(50% 0, 100% 16%, 100% 70%, 50% 100%, 0 70%, 0 16%); pointer-events: none; animation: glowbeat 1.3s ease-in-out infinite alternate; }
.stage .unit.hero.act { transform: translateX(34px) scale(1.1); }
.stage .unit.enemy.act { transform: translateX(-34px) scale(1.1); }
.unit { transition: transform .22s var(--ease), opacity .4s, filter .4s; }
.stage .unit.hero.dead .fig { transform: translateY(8px); filter: grayscale(1) brightness(.35); }
.stage .unit.hero.dead .fig::after { opacity: .2; }
.stage .unit.vip .fig .ava { width: clamp(42px, 10vw, 62px); height: auto; }
@keyframes flash { 0%, 50% { filter: brightness(2.6) saturate(.3); translate: 3px 0; } 100% { filter: none; } }
/* impact marks, added by the fight as each blow lands */
.fx { position: absolute; z-index: 5; left: 50%; top: 58%; width: 110%; aspect-ratio: 1; translate: -50% -50%; pointer-events: none; }
.fx.slash::before, .fx.slash::after { content: ""; position: absolute; left: -10%; right: -10%; top: 50%; height: 3px; background: linear-gradient(90deg, transparent, #fff 30%, #fff 70%, transparent); box-shadow: 0 0 12px 2px var(--fxc, #dffaff); rotate: -38deg; animation: slash .28s var(--ease) both; }
.fx.slash::after { rotate: 30deg; height: 2px; animation-delay: .07s; }
.fx.crit { --fxc: var(--gold); }
.fx.crit::before, .fx.crit::after { height: 5px; }
.fx.heal { border-radius: 50%; background: radial-gradient(circle, #4dffb466, transparent 65%); border: 1px solid var(--mint); animation: burst .6s var(--ease) both; }
@keyframes slash { from { clip-path: inset(-20px 100% -20px 0); opacity: 1; } 60% { clip-path: inset(-20px 0 -20px 0); opacity: 1; } to { clip-path: inset(-20px 0 -20px 100%); opacity: 0; } }
@keyframes burst { from { scale: .3; opacity: 1; } to { scale: 1.25; opacity: 0; } }
.battle.quake .bfield { animation: quake .3s linear; }
@keyframes quake { 20% { translate: -6px 3px; } 40% { translate: 5px -4px; } 60% { translate: -4px 2px; } 80% { translate: 3px -1px; } }
.float { font-family: var(--display); font-weight: 700; font-style: italic; font-size: 1.5rem; color: #fff; text-shadow: 0 2px 0 #04050d, 0 0 12px #04050d, 0 0 18px #5fe1ff88; }
.float.crit { color: var(--gold); font-size: 2.1rem; text-shadow: 0 2px 0 #04050d, 0 0 12px #04050d, 0 0 22px #ffc857cc; }
.float.heal { color: var(--mint); text-shadow: 0 2px 0 #04050d, 0 0 18px #4dffb488; }
@keyframes floatup { 0% { opacity: 0; transform: translate(-50%, 10px) scale(1.7); } 18% { opacity: 1; transform: translate(-50%, 0) scale(1); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -46px) scale(.96); } }
.blog { font-family: var(--display); font-weight: 600; font-size: 1.05rem; text-shadow: 0 2px 10px #000; }
.blog small { font-family: var(--display); color: var(--dim); letter-spacing: .08em; }
.bsys { font-family: var(--display); font-weight: 500; letter-spacing: .06em; color: var(--sys); text-shadow: 0 0 12px #5fe1ff66, 0 2px 6px #000; }
.cutin { border-top: 1px solid #fff; border-bottom: 1px solid #fff; box-shadow: 0 0 60px #5fe1ff55, 0 20px 50px #000c; background: repeating-linear-gradient(100deg, #ffffff24 0 1px, transparent 1px 18px), linear-gradient(90deg, #2a3ad0, #0a1030); }
.cutin.foe { background: repeating-linear-gradient(80deg, #ffffff24 0 1px, transparent 1px 18px), linear-gradient(270deg, #a8204c, #1c0612); box-shadow: 0 0 60px #ff5c8a55, 0 20px 50px #000c; }
.cutin .txt b { font-weight: 700; text-shadow: 0 0 26px #5fe1ffcc, 0 3px 10px #000; }
.cutin.foe .txt b { text-shadow: 0 0 26px #ff5c8acc, 0 3px 10px #000; }
.cutin .txt small { color: #dffaff; text-shadow: 0 2px 8px #000; font-family: var(--body); font-weight: 500; }
.bresult { background: #020308cc; backdrop-filter: blur(5px); }
.bresult .sheet { padding: 26px; animation: winopen .3s var(--ease); }
.bresult h2 { font-size: 2.8rem; font-weight: 700; letter-spacing: .04em; animation: stamp .5s var(--ease) both; }
.bresult.win h2 { color: #fff; text-shadow: 0 0 34px var(--sys), 0 0 2px var(--sys); }
.bresult.lose h2 { color: var(--danger); text-shadow: 0 0 30px #ff547088; }
.bresult .reward span { padding: 3px 12px; border-radius: 2px; background: #05081a; border: 1px solid var(--line); font-family: var(--display); font-weight: 600; }
.bresult .tips { color: var(--muted); }
.bresult.death .sheet { --edge: #ff547099; box-shadow: none; }
@keyframes stamp { from { transform: scale(1.6); opacity: 0; letter-spacing: .4em; filter: blur(6px); } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .bresult h2, .bresult .sheet, .fx, .battle.quake .bfield { animation: none !important; } .fx { display: none; } }

/* ---------- tower exploration ---------- */
.battle.explore { background: #04050d; }
.xview { border: 1px solid var(--line-2); outline: 0; border-radius: 3px; background: #04050d; }
.xroom { border-right: 2px solid #04050d; background: linear-gradient(180deg, color-mix(in srgb, var(--hue) 24%, #080c1c) 0%, color-mix(in srgb, var(--hue) 10%, #05060f) 62%, color-mix(in srgb, var(--hue) 60%, #fff) 62%, #04050d 62.6%, color-mix(in srgb, var(--hue) 16%, #080c1c) 100%); }
.xroom::before { opacity: .7; background: repeating-linear-gradient(90deg, transparent 0 11%, #00000059 11% 12%, color-mix(in srgb, var(--hue) 30%, transparent) 12% 12.3%, transparent 12.3% 25%), radial-gradient(ellipse 60% 70% at 50% 40%, color-mix(in srgb, var(--hue) 30%, transparent), transparent 70%); }
.xroom::after { background: linear-gradient(0deg, #04050dcc 0, transparent 30%), repeating-linear-gradient(0deg, #ffffff05 0 1px, transparent 1px 3px), radial-gradient(ellipse at 50% 50%, transparent 55%, #04050db3 100%); }
.xroom > .artbox .fallback .glyph { color: var(--hue); opacity: .3; filter: drop-shadow(0 0 20px var(--hue)); text-shadow: none; }
.xdoor { border-radius: 2px 2px 0 0; background: linear-gradient(0deg, color-mix(in srgb, var(--hue) 55%, #fff), color-mix(in srgb, var(--hue) 30%, #04050d) 70%); box-shadow: 0 0 0 1px color-mix(in srgb, var(--hue) 70%, #fff), 0 0 30px color-mix(in srgb, var(--hue) 60%, transparent); }
.xname { border-radius: 2px; background: #04050dd9; border: 1px solid color-mix(in srgb, var(--hue) 60%, transparent); font-family: var(--display); font-weight: 600; }
.xfoe { filter: brightness(.12) drop-shadow(0 0 10px #ff5c8a); }
.battle.contact .xfoe { filter: brightness(.8) drop-shadow(0 0 12px #ff5c8a); }
.xhero { width: clamp(42px, 10vw, 66px); }
.xhero .ava { width: clamp(36px, 8.6vw, 58px); }
.xhpbox small { color: var(--muted); font-family: var(--display); }
.xhpbox .bar { height: 8px; }
.xhpbox .bar > s { background: linear-gradient(90deg, #2ed896, var(--mint)); box-shadow: 0 0 10px #4dffb488; }
.xhpbox .bar.low > s { background: linear-gradient(90deg, #e03058, var(--coral)); box-shadow: 0 0 10px #ff5c8a88; }
.xhpbox b { font-family: var(--display); font-weight: 700; }

/* ---------- world chat ---------- */
.chatbox { --c: 14px; --edge: var(--line-2); --fill: #070a1af7; box-shadow: none; }
.chatbox header { border-bottom-color: var(--line); padding: 8px 10px 8px 18px; }
#chatForm { border-top-color: var(--line); }
.cm b { color: var(--sys); font-family: var(--display); }
.cm.me b { color: var(--mint); }
.cm.sys { color: #ffe0a0; background: #ffc85714; border-radius: 2px; }
.chead { display: flex; align-items: center; gap: 6px; }
.cm { position: relative; padding-right: 26px; }
.cmore { position: absolute; right: 0; top: 0; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 2px; background: none; color: var(--muted); font-weight: 700; line-height: 1; opacity: .55; }
.cm:hover .cmore, .cmore:focus-visible { opacity: 1; background: #5fe1ff24; color: #fff; }
@media (hover: none) { .cmore { opacity: 1; } }
.cquote { padding: 10px 12px; overflow-wrap: anywhere; }
.mutelist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 50dvh; overflow-y: auto; }
.mutelist li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; }
.mutelist .rn { display: grid; min-width: 0; } .mutelist small { color: var(--muted); }
.chtabs { display: flex; gap: 6px; }
.chtab { padding: 3px 12px; border-radius: 2px; border: 1px solid var(--line); background: #05081a; color: var(--muted); font-family: var(--display); font-weight: 600; }
.chtab[aria-pressed="true"] { background: var(--sys); color: var(--sys-ink); border-color: var(--sys); }
.ranklist li.me { box-shadow: inset 0 0 0 1px var(--gold); background: #ffc85714 !important; }

/* ---------- guilds ---------- */
.gtag { display: inline-block; padding: 0 7px; border-radius: 2px; background: var(--gold); color: var(--gold-ink); font-family: var(--display); font-weight: 700; font-size: .8rem; line-height: 1.5; vertical-align: 2px; }
.gtag.big { font-size: 1rem; padding: 1px 9px; }
.glist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 42dvh; overflow-y: auto; }
.glist li { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.glist li.me { box-shadow: inset 0 0 0 1px var(--gold); }
.glist .rn { display: grid; flex: 1; min-width: 0; } .glist .rn b { overflow-wrap: anywhere; font-family: var(--display); font-weight: 600; } .glist small { color: var(--muted); }
.glist .rv { font-family: var(--display); font-weight: 700; }
.glist .cmore { position: static; flex: none; }
.glist .empty { justify-content: center; color: var(--muted); }
.gact { display: flex; gap: 6px; flex: none; }
.grole { flex: none; min-width: 74px; text-align: center; padding: 1px 6px; border-radius: 2px; font-family: var(--display); font-size: .75rem; font-weight: 600; background: #0a1126; color: var(--muted); border: 1px solid var(--line); }
.grole.leader { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); } .grole.officer { background: var(--r3); color: #03131c; border-color: var(--r3); }
.gstats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.gstats span { display: grid; gap: 2px; padding: 8px 6px; text-align: center; font-size: .78rem; color: var(--muted); }
.gstats b { font-family: var(--display); font-size: 1.2rem; color: #fff; }
.gsearch { display: flex; gap: 8px; } .gsearch input { flex: 1; min-width: 0; }
.gform { display: grid; gap: 10px; } .gform label { display: grid; gap: 4px; font-family: var(--display); font-weight: 600; } .gform small { color: var(--muted); font-family: var(--body); font-weight: 400; }
.gform .gcheck { display: flex; align-items: center; gap: 8px; font-family: var(--body); font-weight: 400; }
.gmenu { display: grid; gap: 8px; }
@media (max-width: 520px) { .grole { min-width: 0; } .glist li { flex-wrap: wrap; } .gact { width: 100%; justify-content: flex-end; } }

/* ---------- the base as islands (angled view) ---------- */
.keep-world.iso { width: 680px; }
.keep-world.iso .keep-bob { animation: none; padding: 70px 20px 30px; }
.isles { display: grid; gap: 0; }
.isle-lv { position: relative; width: 640px; margin-top: -34px; animation: bob 7s ease-in-out infinite alternate; }
.isle-lv:nth-child(even) { animation-delay: -3.5s; }
.isle-lv svg { display: block; width: 100%; height: auto; overflow: visible; }
/* the island is a stack: ground and empty spots, then every building on a layer of its own, with the walkers between them by depth */
.isle-map { position: relative; }
.isle-map > svg.isle-ov { position: absolute; inset: 0; height: 100%; pointer-events: none; }
.isle-ov .bd { pointer-events: auto; }
.isle-tag { position: absolute; z-index: 2; left: 0; top: 6px; margin: 0; display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; max-width: 250px; padding: 4px 10px 5px; background: #05070fd9; border: 1px solid var(--line-2); font-size: .74rem; color: var(--muted); pointer-events: none; }
.isle-tag b { font-size: .95rem; color: var(--sys); letter-spacing: .04em; }
.isle-tag .need { color: var(--gold); font-family: var(--display); font-weight: 600; }
.isle-tag .bonus { color: var(--mint); font-weight: 700; }
.isle-tag .likes { flex-basis: 100%; }
.isle-lock { width: 420px; margin: 0 auto 44px; padding: 12px 14px; text-align: center; border: 1px dashed var(--line-2); background: #05070f99; color: var(--muted); font-size: .86rem; }
.isle-lock b { color: var(--sys); margin-right: 6px; }
.movebar { position: sticky; top: 0; z-index: 3; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; margin: 0 auto 10px; padding: 8px 12px; width: fit-content; max-width: 100%; background: #05070ff2; border: 1px solid var(--gold); color: var(--ink); font-size: .88rem; }
.movebar b { color: var(--gold); }
.bd, .spot[data-act] { cursor: pointer; outline: none; }
.bd image { transition: transform .15s var(--ease); transform-box: fill-box; transform-origin: 50% 100%; }
.bd:hover image, .bd:focus-visible image { transform: translateY(-4px) scale(1.05); }
.bd .shade { fill: #02030a; opacity: .4; }
.bd text, .spot text { font-family: var(--body); font-size: 11px; text-anchor: middle; fill: var(--ink); paint-order: stroke; stroke: #04050d; stroke-width: 3.5px; stroke-linejoin: round; pointer-events: none; }
.bd text.pd { fill: var(--gold); font-family: var(--display); font-weight: 600; }
.bd .coin { fill: var(--gold); stroke: #04050d; stroke-width: 2; animation: bob 1.2s ease-in-out infinite alternate; }
.bd text.coin-t { fill: #1c1300; stroke: none; font-size: 11px; }
.bd.lifting image { opacity: .45; }
.bd:focus-visible .shade { fill: var(--sys); opacity: .5; }
.spot polygon { fill: #04050d55; stroke: #ffffff77; stroke-width: 1.5; stroke-dasharray: 5 4; }
.spot text { font-size: 16px; fill: #ffffffcc; }
.spot.off { opacity: .28; }
.spot[data-act]:hover polygon, .spot[data-act]:focus-visible polygon { fill: #5fe1ff40; stroke: var(--sys); }
.spot.target polygon { fill: #ffc85733; stroke: var(--gold); stroke-width: 2; }
.spot.target text { fill: var(--gold); font-size: 12px; font-family: var(--display); font-weight: 700; }
.placeinfo { margin: 0; padding: 8px 10px; background: var(--well); border: 1px solid var(--line); color: var(--muted); font-size: .86rem; }
.placeinfo b { color: var(--mint); } .placeinfo small { color: var(--dim); }
.avabtn.locked { opacity: .5; cursor: not-allowed; } .avabtn.locked small { color: var(--coral); }
.buildopt .bi img { width: 44px; height: 44px; object-fit: contain; display: block; }
.buildopt .gain { display: block; font-style: normal; color: var(--mint); font-size: .8rem; font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .isle-lv, .bd .coin { animation: none; } }

/* ---------- portraits drawn from parts (portrait.js) ---------- */
.artbox.drawn > svg.art { width: 100%; height: 100%; display: block; }
/* in small round frames, show the face rather than the whole bust */
.ava .artbox.drawn > svg.art { transform: scale(1.45); transform-origin: 50% 30%; }

/* Running events: a thin strip under the top bar. Never in the way of taps. */
.evbar { display: flex; flex-direction: column; gap: 4px; align-items: center; padding: 6px 12px 0; pointer-events: none; }
body[data-view="home"] .evbar { position: fixed; z-index: 19; top: calc(var(--toph) + 2px); left: 56px; right: 56px; } /* between the two columns of side buttons */
.evbar[hidden] { display: none; }
.evbar span { background: #060a1ae6; border: 1px solid var(--gold); color: var(--gold); border-radius: 2px; padding: 2px 12px; font: 500 .82rem var(--display); text-align: center; }
.wavebox { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.wavebox h3 { color: var(--gold); }
.wavebox ~ .rates { grid-template-columns: repeat(2, 1fr); } /* four grades: two rows of two */

/* Server notices: closed for maintenance (covers everything), and "a new version is out" (a button, never forced). */
.maint { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px; background: #04050df2; }
.maint[hidden], .newver[hidden] { display: none; }
.maint-in { max-width: 420px; text-align: center; border: 1px solid var(--sys); background: #060a1a; padding: 28px 24px; }
.maint-in h2 { color: var(--sys); margin: 0 0 10px; }
.maint-in p { color: var(--ink); margin: 0 0 20px; }
.newver { position: fixed; z-index: 150; left: 50%; top: calc(var(--toph) + 8px); transform: translateX(-50%); background: var(--gold); color: var(--gold-ink); border: 0; border-radius: 2px; padding: 8px 16px; font: 600 .9rem var(--display); cursor: pointer; box-shadow: 0 6px 20px #0009; }

/* ---------- portraits stacked from painted parts (art/parts) ---------- */
.artbox.parts { position: relative; overflow: hidden; background: #0a0f22; width: 100%; height: 100%; min-height: inherit; }
.artbox.parts .pl { position: absolute; inset: 0; background-size: cover; background-position: 50% 0; background-repeat: no-repeat; }
/* hair is painted silver: the colour is multiplied over it, and the hair picture masks both */
.artbox.parts .ph { isolation: isolate; background-image: var(--m); -webkit-mask: var(--m) 50% 0 / cover no-repeat; mask: var(--m) 50% 0 / cover no-repeat; }
.artbox.parts .ph::after { content: ""; position: absolute; inset: 0; background: var(--c); mix-blend-mode: multiply; }
/* round frames: move in on the face */
/* Round avatars show the whole head. clip-path keeps the masked hair layer inside the circle even while a walker moves
   (border-radius + overflow alone can let a composited layer spill out). */
.ava .artbox.parts .pl { background-size: 150% auto; background-position: 50% 20%; }
.ava .artbox.parts .ph { -webkit-mask-size: 150% auto; mask-size: 150% auto; -webkit-mask-position: 50% 20%; mask-position: 50% 20%; }
.ava:not(.empty) { clip-path: circle(50%); }

/* the room sheet's picture: the building itself, whole, on a dark panel */
.artbox.bpic { background: radial-gradient(circle at 50% 60%, #1c2a7a55, transparent 70%), var(--well); }
.artbox.bpic > img.art { object-fit: contain; padding: 10px; }

/* Painted backdrop behind the menu screens (see backdrop() in main.js). Darkened toward the middle so panels stay readable. */
.backdrop { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0; transition: opacity .5s ease;
  background-color: var(--night); background-size: cover; background-position: center; }
.backdrop::after { content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 45%, #05060fcc 0%, #05060f99 55%, #05060f66 100%), linear-gradient(#05060f80, transparent 20%, transparent 80%, #05060fb3); }
.backdrop.on { opacity: 1; }
body[data-view="home"] .backdrop { display: none; }
main#view { z-index: 1; }
@media (prefers-reduced-motion: reduce) { .backdrop { transition: none; } }
