/* MD:Rebirth site styles. One token set and one window shape for the whole site (README "Design").
   Identity: the SAO system UI. Glass windows with a pale cyan frame and two angled corners, white title strips with
   dark ink, round menu orbs that turn orange when selected, HP-gauge stat bars (green / yellow / red), "system
   message" notices, the game's own UI font for headings and numbers. Game art is never tinted or recoloured. */

@font-face {
  font-family: "SAO UI";
  src: url("/assets/fonts/saofont.woff2") format("woff2");
  font-display: swap; /* 4 KB and preloaded */
}
@font-face {
  font-family: "SAO UI Fallback";
  src: local("Arial Narrow"), local("Arial");
  size-adjust: 92%;
  ascent-override: 92%;
  descent-override: 22%;
}

:root {
  color-scheme: dark;
  --bg: #050912;
  --bg-2: #0a1222;
  --panel-solid: #0d1729;
  --panel-2: rgba(22, 38, 64, 0.72);
  --panel-3: rgba(34, 58, 94, 0.8);
  --rim: rgba(118, 214, 255, 0.22);
  --rim-2: rgba(118, 214, 255, 0.42);
  --frame: rgba(170, 236, 255, 0.85);
  --frame-line: rgba(190, 236, 255, 0.26);
  --sys: rgba(236, 244, 252, 0.94);
  --sys-ink: #26313f;
  --text: #e9f4ff;
  --muted: #a7bdd4;
  --faint: #8098b2;
  --cyan: #53d8ff;
  --orange: #ffa53a;
  --orange-2: #ff8a00;
  --menu-orb: #e8eef4;
  --hp: #8fe35a;
  --mp: #4fc3ff;
  --r1: #9aa3ad; --r2: #d79a68; --r3: #d3dce6; --r4: #f2c94c; --r5: #9fe8ff;
  --head: "SAO UI", "SAO UI Fallback", "Arial Narrow", system-ui, sans-serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fs-xs: 12px; --fs-sm: 13px; --fs-base: 15px; --fs-md: 17px; --fs-lg: 22px;
  --fs-h1: clamp(34px, 7vw, 60px);
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px; --sp-12: 48px;
  --max: 1240px;
  --gutter: 16px;
}
@media (min-width: 720px) { :root { --gutter: 28px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; scroll-padding-top: 100px; }
body {
  margin: 0; min-height: 100vh; overflow-x: clip;
  font: var(--fs-base)/1.55 var(--sans); color: var(--text);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(61, 123, 255, 0.16), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(83, 216, 255, 0.08), transparent 60%),
    linear-gradient(transparent 0 calc(100% - 1px), rgba(118, 214, 255, 0.035) 0) 0 0 / 100% 48px,
    linear-gradient(90deg, transparent 0 calc(100% - 1px), rgba(118, 214, 255, 0.035) 0) 0 0 / 48px 100%,
    var(--bg);
}
img { max-width: 100%; height: auto; }
a { color: var(--cyan); text-decoration: none; }
a:hover { color: #9be7ff; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--head); font-weight: 400; line-height: 1.1; margin: 0 0 var(--sp-3); letter-spacing: 0.03em; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-lg); }
h3 { font-size: 20px; }
p { margin: 0 0 var(--sp-3); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--orange); color: #111; padding: 8px 12px; }
.skip:focus { left: 8px; }
[hidden] { display: none !important; }

/* ---------- the SAO system window (one shape for panels, cards, rows) */
.panel, .card, .kv-list > li, .row-link, .news-item, .tile, .table-scroll, .filters, .new-item {
  --cut: 14px;
  position: relative;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  background:
    linear-gradient(135deg, transparent calc(var(--cut) * 0.7 - 1px), var(--frame) calc(var(--cut) * 0.7 - 1px) calc(var(--cut) * 0.7 + 1px), transparent calc(var(--cut) * 0.7 + 1px)) top left / calc(var(--cut) * 2) calc(var(--cut) * 2) no-repeat,
    linear-gradient(315deg, transparent calc(var(--cut) * 0.7 - 1px), var(--frame) calc(var(--cut) * 0.7 - 1px) calc(var(--cut) * 0.7 + 1px), transparent calc(var(--cut) * 0.7 + 1px)) bottom right / calc(var(--cut) * 2) calc(var(--cut) * 2) no-repeat,
    linear-gradient(180deg, rgba(24, 40, 68, 0.84), rgba(9, 17, 31, 0.9));
  border: 1px solid var(--frame-line);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.panel::before, .card::before {
  content: ""; position: absolute; left: var(--cut); right: 25%; top: 0; height: 2px; pointer-events: none; z-index: 3;
  background: linear-gradient(90deg, rgba(225, 248, 255, 0.95), rgba(83, 216, 255, 0.5) 45%, transparent);
}
.card:hover, .row-link:hover, .news-item:hover, .tile:hover, .new-item:hover, .card:focus-visible, .row-link:focus-visible, .tile:focus-visible {
  color: var(--text); --frame: var(--orange); --frame-line: rgba(255, 165, 58, 0.7);
}

/* ---------- header */
.topbar { position: sticky; top: 0; z-index: 40; background: rgba(5, 9, 18, 0.88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--rim); }
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--cyan) 30%, var(--orange) 70%, transparent); opacity: 0.6; }
.topbar-in { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); height: 68px; display: flex; align-items: center; gap: var(--sp-4); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); margin-right: auto; flex: none; }
.brand:hover { color: var(--text); }
.brand-mark { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--menu-orb); box-shadow: inset 0 0 0 4px var(--bg), inset 0 0 0 9px var(--orange); }
.brand-name { font-family: var(--head); font-size: 26px; letter-spacing: 0.05em; white-space: nowrap; }
.brand-name span { color: var(--orange); }
.nav { display: flex; align-items: center; gap: 6px; height: 100%; }
.nav-link { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 14px; color: var(--muted); font-family: var(--head); font-size: 19px; letter-spacing: 0.06em; white-space: nowrap; background: none; border: 0; cursor: pointer; border-radius: 0; }
.nav-link:hover, .nav-group.open > .nav-link { color: var(--text); }
.nav-link.is-on, .nav-group.is-on > .nav-link { color: var(--text); box-shadow: inset 0 -2px 0 var(--orange); }
.caret { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; transition: transform 0.15s; }
.nav-group.open .caret { transform: rotate(180deg); }
.nav-group { position: relative; height: 100%; display: flex; align-items: center; }
/* Dropdown = SAO vertical menu. The wrap starts flush under the bar (top: 100%) and its padding-top is the hover
   bridge, so moving the pointer from the button down onto the items never leaves the group. */
.menu-wrap { position: absolute; top: 100%; left: -10px; padding-top: 6px; display: none; z-index: 50; }
.nav-group.open > .menu-wrap { display: block; }
.menu { list-style: none; margin: 0; padding: 12px 10px; width: 330px; }
.menu.panel { background: linear-gradient(180deg, rgba(10, 18, 32, 0.97), rgba(6, 12, 22, 0.97)); }
.menu li + li { margin-top: 4px; }
.menu-item { display: flex; align-items: center; gap: 12px; padding: 5px 8px; color: var(--text); }
.menu-item:hover, .menu-item:focus-visible { color: var(--text); }
.menu-item:focus-visible { outline-offset: -2px; }
.menu-item:hover .menu-text, .menu-item:focus-visible .menu-text, .menu-item.is-on .menu-text { background: var(--sys); color: var(--sys-ink); }
.menu-item:hover .menu-text small, .menu-item:focus-visible .menu-text small, .menu-item.is-on .menu-text small { color: #4b5a6c; }
.menu-item:hover .menu-orb, .menu-item:focus-visible .menu-orb, .menu-item.is-on .menu-orb { background: var(--orange); box-shadow: 0 0 0 3px rgba(255, 165, 58, 0.25), 0 0 16px rgba(255, 165, 58, 0.45); }
.menu-text { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.25; padding: 6px 14px 6px 14px; clip-path: polygon(8px 0, 100% 0, 100% 100%, 8px 100%, 0 50%); background: rgba(236, 244, 252, 0.06); transition: background 0.12s; }
.menu-text b { font-family: var(--head); font-weight: 400; font-size: 18px; letter-spacing: 0.04em; }
.menu-text small { color: var(--faint); font-size: var(--fs-xs); }
.menu-orb { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--menu-orb); box-shadow: 0 0 0 3px rgba(232, 238, 244, 0.14); transition: background 0.15s, box-shadow 0.15s; overflow: hidden; }
.menu-orb img { width: 30px; height: 30px; }
.nav-actions { display: flex; align-items: center; gap: 8px; margin-left: 10px; }
.nav-cta { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 16px 0 13px; font-family: var(--head); font-size: 17px; letter-spacing: 0.06em; white-space: nowrap; color: var(--text); border: 1px solid var(--rim-2); background: var(--panel-2); clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px); }
.nav-cta .i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav-cta .i-fill { fill: currentColor; stroke: none; }
.nav-cta:hover, .nav-cta.is-on { color: var(--text); border-color: var(--orange); }
.nav-cta.primary { background: linear-gradient(180deg, #ffb457, var(--orange-2)); border-color: #ffc98a; color: #1a1006; }
.nav-cta.primary:hover, .nav-cta.primary.is-on { color: #1a1006; filter: brightness(1.08); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 40px; height: 40px; padding: 0 10px; border-radius: 20px; border: 1px solid var(--rim); background: var(--panel-2); color: var(--text); cursor: pointer; font: inherit; font-size: var(--fs-sm); flex: none; }
.icon-btn:hover { border-color: var(--orange); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.kbd { font-family: var(--head); color: var(--faint); border: 1px solid var(--rim); border-radius: 4px; padding: 0 5px; line-height: 18px; }
.nav-toggle { display: none; }
@media (max-width: 1239px) and (min-width: 1100px) {
  .topbar-in { gap: var(--sp-3); }
  .nav { gap: 2px; }
  .nav-link { padding: 0 11px; }
  .kbd { display: none; }
}
/* Below 1100 px the nav collapses behind the menu button; groups become titled sections, always open. */
@media (max-width: 1099px) {
  .nav-toggle { display: inline-flex; }
  .topbar-in { height: 60px; gap: var(--sp-3); }
  .kbd { display: none; }
  .nav { display: none; position: fixed; inset: 60px 0 auto 0; height: auto; max-height: calc(100vh - 60px); max-height: calc(100dvh - 60px); overflow-y: auto; flex-direction: column; align-items: stretch; gap: 0; padding: 10px var(--gutter) 20px; background: var(--bg); border-bottom: 1px solid var(--rim); }
  .nav.is-open { display: flex; }
  .nav-link { height: auto; padding: 12px 8px; font-size: 21px; }
  .nav-link.is-on, .nav-group.is-on > .nav-link { box-shadow: inset 3px 0 0 var(--orange); }
  .nav-group { display: block; height: auto; }
  .nav-btn { width: 100%; cursor: default; color: var(--faint); font-size: 15px; letter-spacing: 0.12em; text-transform: uppercase; padding: 14px 8px 6px; pointer-events: none; }
  .nav-group.is-on > .nav-btn { box-shadow: none; color: var(--orange); }
  .caret { display: none; }
  .menu-wrap, .nav-group.open > .menu-wrap { display: block; position: static; padding: 0; }
  .menu, .menu.panel { width: auto; padding: 0 0 6px 4px; background: none; border: 0; clip-path: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .menu::before { display: none; }
  .nav-actions { order: -1; margin: 6px 0 8px; gap: 10px; flex-wrap: wrap; }
  .nav-cta { flex: 1 1 130px; justify-content: center; height: 46px; font-size: 19px; }
}
@media (max-width: 359px) {
  .brand-name { font-size: 22px; }
  .brand { gap: 8px; }
}

/* ---------- search overlay */
.search-layer { position: fixed; inset: 0; z-index: 60; background: rgba(2, 5, 10, 0.72); display: flex; justify-content: center; align-items: flex-start; padding: 72px var(--gutter) 16px; }
.search-box { width: 100%; max-width: 640px; padding: 10px; }
.search-box.panel { background: linear-gradient(180deg, rgba(10, 18, 32, 0.98), rgba(6, 12, 22, 0.98)); }
.search-row { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-bottom: 1px solid var(--rim); }
.search-row svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--cyan); stroke-width: 2; }
.search-row input { flex: 1; min-width: 0; background: none; border: 0; color: var(--text); font: inherit; font-size: 18px; padding: 10px 4px; outline: none; }
.search-results { list-style: none; margin: 0; padding: 6px 0; max-height: min(60vh, 520px); overflow-y: auto; }
.search-results.full { max-height: none; }
.search-results li a { display: flex; align-items: center; gap: 10px; padding: 8px; color: var(--text); }
.search-results li a:hover, .search-results li a.is-active { background: var(--sys); color: var(--sys-ink); }
.search-results li a:hover small, .search-results li a.is-active small { color: #4b5a6c; }
.search-results .s-img { width: 40px; height: 40px; flex: none; object-fit: cover; background: var(--panel-2); }
.search-results .s-main { display: flex; flex-direction: column; min-width: 0; }
.search-results .s-main b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-results .s-main small { color: var(--faint); }
.search-results .s-kind { margin-left: auto; font-family: var(--head); font-size: 14px; color: var(--orange); letter-spacing: 0.06em; text-transform: uppercase; }
.search-results .s-none { padding: 12px 8px; color: var(--muted); }
.search-foot { margin: 6px 6px 0; font-size: var(--fs-sm); }

/* ---------- layout */
.main { min-height: 60vh; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) var(--sp-12); }
.wrap.narrow { max-width: 860px; }
.crumbs { max-width: var(--max); margin: 0 auto; padding: 12px var(--gutter) 0; font-size: var(--fs-sm); position: relative; z-index: 1; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; color: var(--faint); }
.crumbs li + li::before { content: "\25B8"; margin-right: 8px; color: var(--orange); font-size: 10px; }
.crumbs a { color: var(--muted); }
.crumbs [aria-current] { color: var(--text); max-width: 60vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.hero { position: relative; margin: 0 0 var(--sp-6); padding: var(--sp-8) 0 var(--sp-6); overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0; background: var(--hero-bg, none) center 35% / cover no-repeat; opacity: 0.35; -webkit-mask-image: linear-gradient(180deg, #000 45%, transparent); mask-image: linear-gradient(180deg, #000 45%, transparent); }
.hero-in { position: relative; z-index: 1; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.hero .lead { color: var(--muted); font-size: var(--fs-md); max-width: 680px; }
.home .hero { padding: clamp(28px, 6vw, 64px) 0 clamp(20px, 4vw, 40px); }
.home .hero h1 { font-size: clamp(48px, 11vw, 92px); text-shadow: 0 2px 18px rgba(0, 0, 0, 0.6); }
.hero-grid { display: grid; gap: var(--sp-6); align-items: center; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: 1fr 440px; gap: var(--sp-10); } }
/* the Aincrad window: the title screen art at its own size (1024 px wide source, srcset 640 / 1024), never stretched
   past it; on phones a landscape crop of the castle (CSS crop only, the file is untouched) */
.hero-art { --cut: 22px; margin: 0; padding: 8px; max-width: 520px; width: 100%; justify-self: center; }
.hero-art img { display: block; width: 100%; height: auto; aspect-ratio: 1024 / 1334; object-fit: cover; }
@media (max-width: 959px) { .hero-art { max-width: 640px; } .hero-art img { aspect-ratio: 16 / 10; object-position: 50% 28%; } }
.quick-links { display: flex; flex-wrap: wrap; gap: 8px; margin: var(--sp-4) 0 0; }
.quick-links a { padding: 6px 12px; font-size: var(--fs-sm); color: var(--text); border: 1px solid var(--rim-2); background: rgba(10, 20, 36, 0.7); clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px); }
.quick-links a:hover { border-color: var(--orange); color: var(--text); }
/* What's new: a strip of the newest dated things */
.whats-new { margin: 0 0 var(--sp-8); display: flex; align-items: stretch; gap: var(--sp-3); }
.new-h { flex: none; margin: 0; align-self: center; font-size: 18px; color: var(--orange); letter-spacing: 0.08em; text-transform: uppercase; }
.new-strip { list-style: none; margin: 0; padding: 2px 0 6px; display: flex; gap: var(--sp-2); overflow-x: auto; scrollbar-width: thin; min-width: 0; }
.new-strip li { flex: none; }
.new-item { --cut: 10px; display: grid; grid-template-columns: auto auto; gap: 0 10px; align-items: baseline; padding: 8px 14px; color: var(--text); max-width: 320px; }
.new-item b { grid-column: 1 / -1; order: 2; font-weight: 600; font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.new-kind { font-family: var(--head); font-size: 14px; letter-spacing: 0.08em; color: var(--cyan); text-transform: uppercase; }
.new-item time { font-size: var(--fs-xs); color: var(--faint); justify-self: end; }
@media (max-width: 640px) { .whats-new { flex-direction: column; gap: var(--sp-2); } .new-h { align-self: flex-start; } }
.hero-search { display: flex; gap: 8px; max-width: 560px; margin-top: var(--sp-4); }
.hero-search input { flex: 1; min-width: 0; padding: 12px 14px; border: 1px solid var(--rim-2); background: rgba(5, 10, 20, 0.85); color: var(--text); font: inherit; font-size: 16px; clip-path: polygon(10px 0, 100% 0, 100% 100%, 0 100%, 0 10px); }
.page-search { max-width: none; margin-bottom: var(--sp-4); }

/* section heads = white SAO window title strips */
.sec { margin: 0 0 var(--sp-10); }
.sec-head {
  display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-4); padding: 6px 22px 5px 14px;
  background: linear-gradient(90deg, var(--sys), rgba(236, 244, 252, 0.78) 65%, rgba(236, 244, 252, 0.3));
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 100%, 0 100%);
  box-shadow: inset 0 -2px 0 rgba(83, 216, 255, 0.7);
}
.sec-head h2 { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 23px; color: var(--sys-ink); }
.sec-head h2::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 3px rgba(255, 165, 58, 0.3); flex: none; }
.sec-head .more { margin-left: auto; font-size: 17px; font-family: var(--head); letter-spacing: 0.05em; color: #0f5f88; }
.sec-head .more::after { content: " \25B8"; }
.arc { font-size: 20px; color: var(--muted); margin: var(--sp-5) 0 var(--sp-3); letter-spacing: 0.12em; }
.two-col { display: grid; gap: 0 var(--sp-8); }
@media (min-width: 900px) { .two-col { grid-template-columns: 1fr 1fr; } }

/* ---------- buttons, chips, tags */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border: 0; background: linear-gradient(180deg, #ffbf6a, var(--orange-2)); color: #1a1205; font-family: var(--head); font-size: 19px; letter-spacing: 0.05em; cursor: pointer; clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); }
.btn:hover { color: #1a1205; filter: brightness(1.08); }
.btn.ghost { background: var(--sys); color: var(--sys-ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip, .tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; background: var(--panel-2); border: 1px solid var(--rim); font-size: var(--fs-xs); color: var(--muted); }
.tag { margin-left: 6px; color: var(--orange); border-color: rgba(255, 165, 58, 0.35); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: var(--sp-3) 0; }
.badge { padding: 4px 10px; font-size: var(--fs-sm); background: var(--panel-2); border: 1px solid var(--rim); color: var(--text); }
.badge.live { border-color: rgba(143, 227, 90, 0.5); }
.badge.live::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--hp); margin-right: 6px; box-shadow: 0 0 8px var(--hp); }
.rar { font-family: var(--head); font-size: 17px; letter-spacing: 0.02em; white-space: nowrap; color: var(--r1); }
.rar.r2 { color: var(--r2); } .rar.r3 { color: var(--r3); } .rar.r4 { color: var(--r4); } .rar.r5 { color: var(--r5); }
.rar.r6 { background: linear-gradient(90deg, #ffd1f2, #b9e2ff, #e2c6ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ic { vertical-align: middle; border-radius: 50%; }
.note { color: var(--faint); font-size: var(--fs-sm); }
.empty { color: var(--muted); padding: var(--sp-6); text-align: center; border: 1px dashed var(--rim); }
.sub { font-family: var(--head); color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; font-size: 16px; margin: var(--sp-3) 0 var(--sp-2); }
.mt { margin-top: var(--sp-3); }

/* ---------- filters */
.filters { --cut: 12px; display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-5); }
.fld { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-xs); color: var(--faint); min-width: 0; }
.fld > span { font-family: var(--head); font-size: 14px; letter-spacing: 0.1em; text-transform: uppercase; }
.fld input, .fld select { height: 38px; padding: 0 10px; border: 1px solid var(--rim); background: rgba(5, 10, 20, 0.85); color: var(--text); font: inherit; font-size: var(--fs-sm); min-width: 0; }
.fld-search { flex: 1 1 220px; }
.count { margin: 0 0 0 auto; align-self: center; color: var(--muted); font-size: var(--fs-sm); }
.count b { color: var(--text); font-family: var(--head); font-size: 20px; }
.filters-toggle { display: none; }
@media (max-width: 600px) {
  .filters { display: grid; grid-template-columns: 1fr 1fr; }
  .fld-search { grid-column: 1 / -1; }
  .count { margin: 0; }
  .filters-toggle { display: inline-flex; }
  .filters:not(.is-open) .fld:not(.fld-search), .filters:not(.is-open) button[type=reset] { display: none; }
}

/* ---------- cards + grids */
.grid { display: grid; gap: var(--sp-3); }
.unit-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.unit-grid.compact { grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); }
.gear-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.scout-grid, .event-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
@media (max-width: 400px) { .unit-grid, .unit-grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); } .gear-grid, .scout-grid, .event-grid { grid-template-columns: 1fr; } }
.card { display: flex; flex-direction: column; color: var(--text); overflow: hidden; min-width: 0; transition: transform 0.15s; --cut: 12px; }
.card:hover { transform: translateY(-2px); }
.card-body { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 10px; min-width: 0; }
.card-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-sub { color: var(--muted); font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 4px; }
.thumb { position: relative; display: block; aspect-ratio: 1; background: radial-gradient(circle at 50% 35%, rgba(83, 216, 255, 0.18), transparent 70%), var(--bg-2); }
.thumb img, .thumb .noart { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* unit portrait inside the game's own rarity frame (images/character/frame, 180 x 203), stars on the frame */
.uframe { position: relative; display: block; aspect-ratio: 180 / 203; margin: 10px 10px 0; }
.uframe .thumb-img, .uframe > .noart { position: absolute; left: 6.5%; top: 5.5%; width: 87%; height: auto; aspect-ratio: 1; object-fit: cover; }
.uframe .frame-img { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.uframe .rar { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0.5%; text-align: center; font-size: 15px; text-shadow: 0 1px 2px #000, 0 0 6px #000; }
.unit-card .card-body { padding-top: 6px; }
.gear-card { flex-direction: row; align-items: center; }
.gear-card .thumb { width: 78px; flex: none; margin: 6px; background: radial-gradient(circle, rgba(83, 216, 255, 0.2), transparent 70%); }
.gear-card .thumb img { object-fit: contain; }
.noart { display: block; background: repeating-linear-gradient(135deg, rgba(118, 214, 255, 0.06) 0 6px, transparent 6px 12px); }
.banner { display: block; aspect-ratio: 680 / 320; background: var(--bg-2); position: relative; }
.banner img, .banner .noart { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.event-card .banner { aspect-ratio: 680 / 300; }
.when { color: var(--orange); font-size: var(--fs-xs); }

/* ---------- SAO menu ring: the vertical round-button menu (home hero, database hub) */
.sao-menu { list-style: none; margin: 0; padding: 6px 0; position: relative; display: grid; gap: 10px; }
.sao-menu::before { content: ""; position: absolute; left: 27px; top: 24px; bottom: 24px; width: 2px; background: linear-gradient(180deg, transparent, rgba(232, 238, 244, 0.55), transparent); }
.sao-menu a { position: relative; display: flex; align-items: center; gap: 14px; color: var(--text); }
.sao-menu .menu-orb { width: 56px; height: 56px; position: relative; z-index: 1; }
.sao-menu .menu-orb img { width: 40px; height: 40px; }
.sao-menu .lbl { display: flex; flex-direction: column; flex: 1; padding: 7px 22px 7px 16px; min-width: 0; background: rgba(236, 244, 252, 0.1); border: 1px solid rgba(236, 244, 252, 0.18); clip-path: polygon(10px 0, 100% 0, 100% 100%, 10px 100%, 0 50%); transition: background 0.15s; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.sao-menu .lbl b { font-family: var(--head); font-weight: 400; font-size: 21px; letter-spacing: 0.04em; }
.sao-menu .lbl small { color: var(--muted); font-size: var(--fs-xs); }
.sao-menu a:hover .menu-orb, .sao-menu a:focus-visible .menu-orb { background: var(--orange); box-shadow: 0 0 0 4px rgba(255, 165, 58, 0.25), 0 0 20px rgba(255, 165, 58, 0.5); }
.sao-menu a:hover .lbl, .sao-menu a:focus-visible .lbl { background: var(--sys); color: var(--sys-ink); }
.sao-menu a:hover .lbl small, .sao-menu a:focus-visible .lbl small { color: #4b5a6c; }
.menu-cols { display: grid; gap: 10px 32px; }
@media (min-width: 760px) { .menu-cols { grid-template-columns: 1fr 1fr; } }

.tiles { display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.tile { display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-4); color: var(--text); }
.tile:hover .menu-orb { background: var(--orange); }
.tile b { display: block; font-family: var(--head); font-weight: 400; font-size: 21px; letter-spacing: 0.03em; }
.tile small { color: var(--muted); }

.row-list { display: grid; gap: var(--sp-2); }
.row-link { --cut: 10px; display: flex; align-items: center; gap: var(--sp-3); padding: 10px 14px; color: var(--text); }
/* chapter / quest number plates in the game font */
.row-no { display: inline-grid; place-items: center; min-width: 70px; padding: 2px 10px; font-family: var(--head); font-size: 19px; color: var(--sys-ink); background: var(--sys); clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%); white-space: nowrap; }
.row-main { display: flex; flex-direction: column; min-width: 0; }
.row-main small { color: var(--muted); }

.news-list { display: grid; gap: var(--sp-2); }
.news-item { --cut: 10px; display: grid; gap: 2px; padding: 12px 14px; color: var(--text); }
.news-item time { font-family: var(--head); color: var(--cyan); font-size: 16px; letter-spacing: 0.06em; }
.news-item span { color: var(--muted); font-size: var(--fs-sm); }

/* ---------- detail pages */
.detail { padding-top: var(--sp-4); }
.detail-hero { --cut: 20px; display: grid; gap: var(--sp-5); padding: var(--sp-5); margin-bottom: var(--sp-5); overflow: hidden; }
@media (min-width: 820px) { .detail-hero { grid-template-columns: minmax(260px, 400px) 1fr; padding: var(--sp-6); } .detail-hero.event { grid-template-columns: minmax(280px, 520px) 1fr; } .detail-hero.gear { grid-template-columns: 220px 1fr; } }
.detail-art { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-3); min-height: 280px; padding: var(--sp-3) 0; background: radial-gradient(circle at 50% 45%, rgba(83, 216, 255, 0.2), transparent 62%), linear-gradient(180deg, rgba(61, 123, 255, 0.1), transparent); }
.detail-art .art-view { width: 100%; display: flex; justify-content: center; align-items: center; flex: 1; }
.detail-art img.art { display: block; width: 100%; height: auto; max-height: 640px; object-fit: contain; }
.art-zoom { display: block; width: 100%; cursor: zoom-in; }
.detail-art .noart { width: 100%; height: 280px; }
.detail-art .art-note { margin: 0; padding: 0 var(--sp-3); color: var(--muted); font-size: var(--fs-sm, 14px); text-align: center; }
/* the framed icon: same layers as the list cards, centred, at most ~2x the source size */
.uframe.big { width: min(220px, 70%); margin: var(--sp-4) auto; }
.art-switch { display: inline-flex; padding: 3px; gap: 3px; border: 1px solid var(--rim-2); background: rgba(5, 10, 20, 0.7); clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); align-self: center; }
.art-switch button { font-family: var(--head); font-size: 17px; letter-spacing: 0.06em; padding: 5px 16px; border: 0; background: none; color: var(--muted); cursor: pointer; }
.art-switch button:hover { color: var(--text); }
.art-switch button[aria-pressed="true"] { background: var(--sys); color: var(--sys-ink); }
.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(2, 5, 10, 0.92); display: flex; align-items: center; justify-content: center; padding: 56px 12px 12px; }
.lightbox-img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.lightbox-close { position: absolute; top: 10px; right: 12px; }
.detail-art.sq { min-height: 0; aspect-ratio: 1; place-items: center; }
.detail-art.sq img.art { max-height: none; width: 100%; height: 100%; object-fit: contain; padding: 12px; }
.detail-art.sq::after { display: none; }
.detail-banner img, .detail-banner .noart { width: 100%; display: block; }
.detail-banner .noart { aspect-ratio: 680 / 320; }
.detail-info h1 { margin-bottom: var(--sp-3); overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--sp-2) var(--sp-4); margin: 0 0 var(--sp-4); }
.facts div { padding: 6px 0; border-bottom: 1px solid var(--rim); }
.facts dt { font-family: var(--head); font-size: 14px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.facts dd { margin: 2px 0 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.facts.small { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }

/* SAO HP gauge: green above half, yellow above a quarter, red below (share of the best value in the database) */
.bars { display: grid; gap: 9px; margin: var(--sp-2) 0; }
.bar { display: grid; grid-template-columns: 52px 1fr 70px; align-items: center; gap: 10px; }
.bar-label { font-family: var(--head); font-size: 16px; letter-spacing: 0.06em; background: var(--sys); color: var(--sys-ink); text-align: center; padding: 1px 0; clip-path: polygon(0 0, 100% 0, calc(100% - 6px) 100%, 0 100%); }
.bar-track { position: relative; height: 15px; background: rgba(2, 6, 12, 0.9); border: 1px solid rgba(255, 255, 255, 0.28); clip-path: polygon(0 0, 100% 0, calc(100% - 9px) 100%, 0 100%); }
.bar-fill { position: absolute; left: 0; top: 0; bottom: 0; clip-path: polygon(0 0, 100% 0, calc(100% - 9px) 100%, 0 100%); background: linear-gradient(180deg, #d4ff9a, #7fe050 55%, #4fae2c); }
.bar.mid .bar-fill { background: linear-gradient(180deg, #fff3a0, #f2d03b 55%, #c99a12); }
.bar.low .bar-fill { background: linear-gradient(180deg, #ffb3a0, #f0503b 55%, #b42416); }
.bar-mp .bar-fill, .bar-mp.mid .bar-fill, .bar-mp.low .bar-fill { background: linear-gradient(180deg, #c4efff, #4fc3ff 55%, #1f86c9); }
.bar-track::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(0, 0, 0, 0.5) calc(10% - 1px) 10%); pointer-events: none; }
.bar-num { font-family: var(--head); font-size: 19px; text-align: right; font-variant-numeric: tabular-nums; }

.toc { position: sticky; top: 60px; z-index: 5; display: flex; gap: 6px; overflow-x: auto; padding: 8px 0; margin: 0 0 var(--sp-5); background: linear-gradient(var(--bg) 70%, transparent); scrollbar-width: none; }
.toc a { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 4px 14px 4px 6px; border-radius: 18px; border: 1px solid var(--rim); background: rgba(10, 18, 32, 0.9); color: var(--muted); font-family: var(--head); font-size: 17px; letter-spacing: 0.04em; }
.toc a::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--menu-orb); }
.toc a:hover { color: var(--text); border-color: var(--orange); }
.toc a:hover::before { background: var(--orange); }

.skill-list { display: grid; gap: var(--sp-3); }
@media (min-width: 900px) { .skill-list { grid-template-columns: repeat(3, 1fr); } }
.skill { padding: var(--sp-4); }
.skill header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: var(--sp-2); }
.skill h3 { margin: 0; }
.skill-no { font-family: var(--head); font-size: 17px; color: #1a1205; background: var(--orange); padding: 0 7px; clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%); }
.skill-meta { display: flex; gap: 8px; margin-left: auto; }
.skill-meta span { font-family: var(--head); font-size: 17px; color: var(--mp); }
.feat { font-size: var(--fs-sm); color: var(--muted); border-left: 2px solid var(--orange); padding-left: 8px; }
.feat b { color: var(--text); }
.kv-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }
.kv-list > li { --cut: 8px; display: grid; gap: 2px 16px; padding: 10px 14px; }
@media (min-width: 720px) { .kv-list > li { grid-template-columns: minmax(180px, 280px) 1fr; } }
.kv-list > li > span { color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.levels { margin: 0; padding-left: 20px; color: var(--muted); }

.quest-list { display: grid; gap: var(--sp-3); }
.quest { padding: var(--sp-4); }
.quest header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: var(--sp-2); }
.quest h3 { margin: 0; }
.ticks { list-style: none; margin: 0 0 var(--sp-2); padding: 0; display: grid; gap: 4px; }
.ticks li::before { content: "\25C7"; color: var(--cyan); margin-right: 8px; }
.mini { display: inline-block; width: 36px; height: 36px; margin: 2px; overflow: hidden; background: var(--bg-2); vertical-align: middle; }
.mini img, .mini .noart { width: 100%; height: 100%; object-fit: cover; }

/* ---------- tables */
.table-scroll { --cut: 10px; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th { text-align: left; font-family: var(--head); font-weight: 400; font-size: 16px; letter-spacing: 0.06em; color: var(--sys-ink); background: var(--sys); padding: 8px 12px; white-space: nowrap; }
.table td { padding: 9px 12px; border-bottom: 1px solid var(--rim); vertical-align: top; }
.table tbody tr:hover td { background: rgba(83, 216, 255, 0.06); }
.table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.skills-table td:nth-child(4) { min-width: 240px; color: var(--muted); }
.skills-table td:nth-child(5) { min-width: 200px; }
.rates { max-width: 360px; }

/* ---------- tabs */
.tabs { display: flex; gap: 6px; margin-bottom: var(--sp-4); border-bottom: 1px solid var(--rim); }
.tabs button { background: none; border: 0; color: var(--muted); font-family: var(--head); font-size: 20px; letter-spacing: 0.04em; padding: 8px 14px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--text); border-color: var(--orange); }

/* ---------- articles / prose */
.article { --cut: 20px; padding: var(--sp-6); margin-bottom: var(--sp-5); }
@media (max-width: 600px) { .article { padding: var(--sp-4); } }
.article h1 { font-size: clamp(32px, 6vw, 48px); }
.prose { max-width: 72ch; }
.prose h2 { margin-top: var(--sp-8); padding-bottom: 6px; border-bottom: 1px solid var(--rim); font-size: 26px; }
.prose h3 { margin-top: var(--sp-6); color: var(--cyan); }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 var(--sp-3); }
.prose li { margin-bottom: 4px; }
.prose code { background: var(--panel-2); border: 1px solid var(--rim); padding: 0 5px; font-size: 0.92em; }
.prose blockquote { margin: 0 0 var(--sp-3); padding: 8px 14px; border-left: 3px solid var(--cyan); color: var(--muted); }
.prose hr { border: 0; border-top: 1px solid var(--rim); margin: var(--sp-6) 0; }
.prose figure { margin: var(--sp-4) 0; }
.prose figcaption { color: var(--faint); font-size: var(--fs-sm); }
.guide-wrap { display: grid; gap: var(--sp-5); max-width: 1100px; padding-top: var(--sp-4); }
@media (min-width: 980px) { .guide-wrap { grid-template-columns: 220px 1fr; align-items: start; } .guide-toc { position: sticky; top: 76px; } }
.guide-toc { padding: var(--sp-4); display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-sm); }
.guide-toc .l3 { padding-left: 12px; }
.guide-wrap > *, .guide-wrap .prose { min-width: 0; }
.prose { overflow-wrap: break-word; }
.prose .table-scroll { margin: 0 0 var(--sp-4); }
.prose img.md-img { display: block; max-width: 100%; height: auto; }
.prose .md-icon { display: inline-block; width: auto; height: 1.6em; vertical-align: -0.45em; margin: 0 4px 0 0; }
.prose td .md-icon { height: 26px; }
.guide-credit, .guide-related { margin-top: var(--sp-8); padding-top: var(--sp-4); border-top: 1px solid var(--rim); color: var(--muted); font-size: var(--fs-sm); }
.guide-credit p { margin: 0 0 var(--sp-2); }
.guide-chips { margin: 0 0 var(--sp-6); }
.guide-card time { display: block; margin-top: 4px; font-size: var(--fs-xs); color: var(--faint); }
.guide-cat .note { margin: 0 0 var(--sp-3); }
@media (max-width: 979px) { .guide-toc { display: none; } }

/* SAO "system message" window: pale panel, dark ink, coloured title strip */
.callout { position: relative; margin: 0 0 var(--sp-4); padding: 34px 16px 12px; color: var(--sys-ink); background: var(--sys);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); }
.callout::before { content: "System message"; position: absolute; left: 0; right: 0; top: 0; padding: 3px 16px; font-family: var(--head); font-size: 16px; letter-spacing: 0.14em; text-transform: uppercase; color: #fff; background: linear-gradient(90deg, #2f86c9, #58bde9); }
.callout-tip::before { content: "Tip"; background: linear-gradient(90deg, #45972a, #82cc4c); }
.callout-warning::before { content: "Warning"; background: linear-gradient(90deg, #d86d00, #ffa53a); }
.callout p { margin: 0; }
.callout a { color: #0d6aa0; font-weight: 600; }
.callout strong { color: #000; }

/* ---------- live note (system line above live lists) */
.live-note { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: var(--fs-sm); margin: calc(-1 * var(--sp-2)) 0 var(--sp-3); }
.live-note::before { content: "SYSTEM"; flex: none; font-family: var(--head); font-size: 14px; letter-spacing: 0.1em; color: var(--sys-ink); background: var(--sys); padding: 0 7px; }
.live-note.is-live::before { content: "LIVE"; background: var(--hp); }

/* ---------- footer */
.footer { border-top: 1px solid var(--rim); background: rgba(3, 6, 12, 0.9); margin-top: var(--sp-12); }
.footer-in { max-width: var(--max); margin: 0 auto; padding: var(--sp-8) var(--gutter); display: grid; gap: var(--sp-5); }
@media (min-width: 800px) { .footer-in { grid-template-columns: 1fr auto; } .footer-credit { grid-column: 1 / -1; } }
.footer-brand p { color: var(--faint); font-size: var(--fs-sm); max-width: 520px; margin-top: 6px; }
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-family: var(--head); font-size: 18px; letter-spacing: 0.04em; }
.footer-links a { color: var(--muted); }
.footer-credit { color: var(--faint); font-size: var(--fs-xs); margin: 0; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media (max-width: 819px) { .detail-art { min-height: 0; } .detail-art img.art { max-height: 340px; } .detail-art .noart { height: 200px; } }

/* ---------- download + discord */
.btn.big { padding: 14px 26px; font-size: 22px; gap: 10px; min-height: 58px; }
.btn .i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btn .i-fill { fill: currentColor; stroke: none; }
.btn.big > span { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; }
.btn.big b { font-weight: 400; }
.btn.big small { font-family: var(--sans); font-size: var(--fs-xs); letter-spacing: 0; opacity: 0.8; }
.btn.discord { background: linear-gradient(180deg, #7b86ff, #5865f2); color: #fff; }
.btn.discord:hover { color: #fff; }
.btn.is-off { background: var(--panel-3); color: var(--muted); cursor: default; filter: none; }
.btn.is-off:hover { color: var(--muted); filter: none; }
.dl-card { padding: var(--sp-6); margin: 0 0 var(--sp-8); }
.dl-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }
.dl-status { margin: var(--sp-4) 0 0; color: var(--muted); }
.platform-note { margin: 0 0 var(--sp-4); padding: 8px 12px; background: var(--sys); color: var(--sys-ink); font-weight: 600; }
.dl-facts { margin-top: var(--sp-5); }
.dl-hash { word-break: break-all; margin-top: var(--sp-3); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); }
.step { display: flex; gap: var(--sp-4); padding: var(--sp-4) var(--sp-5); align-items: flex-start; }
.step h3 { margin: 2px 0 6px; font-size: 21px; }
.step p { margin: 0; color: var(--muted); }
.step em { font-style: normal; color: var(--text); font-weight: 600; }
.step-no { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--menu-orb); color: var(--sys-ink); font-family: var(--head); font-size: 22px; box-shadow: 0 0 0 3px rgba(232, 238, 244, 0.14); }
@media (max-width: 480px) { .btn.big { width: 100%; justify-content: center; } .step { padding: var(--sp-4); gap: var(--sp-3); } }

/* rarity: the game's star sprites (filled = rarity, hollow = can be upgraded to) */
.rar.stars { display: inline-flex; align-items: center; gap: 0; line-height: 0; vertical-align: middle; background: none; color: inherit; }
.rar.stars img { display: block; flex: none; margin-right: -1px; }
.uframe .rar.stars { justify-content: center; bottom: 3%; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8)); }
.uframe .rar.stars img { width: 14px; height: auto; }
.card-tags .rar.stars img { width: 14px; height: auto; }
.unit-grid.compact .card-tags .rar.stars img { width: 12px; }
/* an item with no icon in the game files: the game's generic crystal, smaller and centred */
.thumb-img.generic, .art.generic { object-fit: contain; padding: 16%; background: radial-gradient(circle, rgba(255, 255, 255, 0.06), transparent 70%); }

/* ---------- SAO dropdown (src/js/list.js): button + listbox over a hidden native select */
.dd { position: relative; min-width: 0; }
.dd-native { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0; pointer-events: none; clip-path: inset(50%); }
.dd-btn { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 120px; height: 38px; padding: 0 10px 0 12px; border: 1px solid var(--rim-2); background: rgba(5, 10, 20, 0.85); color: var(--text); font: inherit; font-size: var(--fs-sm); text-align: left; cursor: pointer; clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }
.dd-btn:hover, .dd.open .dd-btn { border-color: var(--cyan); }
.dd.is-set .dd-btn { border-color: var(--orange); }
.dd-btn .caret { margin-left: auto; flex: none; }
.dd.open .dd-btn .caret { transform: rotate(180deg); }
.dd-val { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; white-space: nowrap; }
.dd-val .opt-text { overflow: hidden; text-overflow: ellipsis; }
.dd-list { display: none; position: absolute; z-index: 45; top: 0; left: 0; width: max-content; max-width: min(320px, 92vw); max-height: 340px; overflow-y: auto; margin: 0; padding: 6px; list-style: none; background: linear-gradient(180deg, rgba(10, 18, 32, 0.98), rgba(6, 12, 22, 0.98)); border: 1px solid var(--frame-line); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), inset 0 2px 0 rgba(160, 230, 255, 0.5); clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); outline: none; }
.dd-list.open { display: block; }
.dd-list [role=option] { display: flex; align-items: center; gap: 8px; padding: 7px 10px; color: var(--text); font-size: var(--fs-sm); cursor: pointer; white-space: nowrap; clip-path: polygon(6px 0, 100% 0, 100% 100%, 6px 100%, 0 50%); }
.dd-list [role=option].is-active { background: rgba(236, 244, 252, 0.12); }
.dd-list [role=option][aria-selected=true] { background: var(--sys); color: var(--sys-ink); }
.dd-tick { width: 16px; height: 16px; margin-left: auto; flex: none; fill: none; stroke: var(--orange-2); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; visibility: hidden; }
.dd-list [aria-selected=true] .dd-tick { visibility: visible; }
.opt-ic { width: 22px; height: 22px; flex: none; }
.opt-stars { display: inline-flex; line-height: 0; flex: none; }
.opt-stars img { width: 14px; height: auto; margin-right: -1px; }
.dd-sheet-head { display: none; }
/* phones: the list opens as a bottom sheet */
@media (max-width: 599px) {
  .dd-list.open.sheet { position: fixed; z-index: 70; left: 0; right: 0; top: auto; bottom: 0; width: auto; max-width: none; max-height: 65vh; padding: 8px 12px calc(14px + env(safe-area-inset-bottom)); clip-path: none; border-width: 1px 0 0; box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.6); }
  .dd-list [role=option] { padding: 12px 12px; font-size: 16px; }
  .dd-sheet-head { display: block; padding: 6px 4px 10px; font-family: var(--head); font-size: 15px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
  body.dd-sheet-open::after { content: ""; position: fixed; inset: 0; z-index: 69; background: rgba(2, 5, 10, 0.6); }
}

/* header lockup: the game's title logo + ":Rebirth" in the site font */
.brand { gap: 2px; }
.brand-logo { display: block; width: 168px; height: auto; flex: none; }
.brand-rebirth { font-size: 29px; line-height: 1; margin-top: 16px; color: var(--text); text-shadow: 0 0 12px rgba(83, 160, 255, 0.45); }
@media (max-width: 1099px) { .brand-logo { width: 118px; } .brand-rebirth { font-size: 23px; margin-top: 11px; } }
@media (max-width: 359px) { .brand-logo { width: 100px; } .brand-rebirth { font-size: 20px; margin-top: 9px; } }
/* desktop: a taller bar so the logo has clear space above and below; logo and ":Rebirth" centred on the nav */
@media (min-width: 1100px) {
  .topbar-in { height: 92px; }
  .brand { align-items: center; gap: 4px; }
  .brand-logo { width: 186px; }
  .brand-rebirth { margin-top: 0; font-size: 30px; }
}
@media (min-width: 1280px) { .brand-logo { width: 204px; } .brand-rebirth { font-size: 32px; } }

/* a scout with no banner art (weapon scouts): the game's generic icon + its kind, in the banner's shape */
.banner-fallback { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: radial-gradient(circle at 50% 40%, rgba(83, 216, 255, 0.18), transparent 65%), linear-gradient(135deg, rgba(24, 40, 68, 0.9), rgba(9, 17, 31, 0.95)); color: var(--muted); font-family: var(--head); font-size: 18px; letter-spacing: 0.08em; }
.banner-fallback img { width: 64px; height: 64px; }
.detail-banner .banner-fallback { position: relative; aspect-ratio: 680 / 320; }
.banner .banner-fallback img { position: static; inset: auto; width: 64px; height: 64px; object-fit: contain; }
