:root {
  --bg: #f6f5fb;
  --surface: #ffffff;
  --surface-2: #f0eef8;
  --border: #e0dcef;
  --text: #1d1a2e;
  --muted: #6b6784;
  --accent: #4f7cff;
  --accent-soft: #e5ecff;
  --cute: #ff5fa8;
  --happy: #f5a300;
  --pure: #1ea8ff;
  --perf: #ff5f7e;
  --tech: #3d8bff;
  --sense: #f2b100;
  --star: #ffb400;
  --shadow: 0 1px 2px rgba(20, 16, 50, .06), 0 4px 16px rgba(20, 16, 50, .06);
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12111a;
    --surface: #1c1a27;
    --surface-2: #252233;
    --border: #34304a;
    --text: #ece9f7;
    --muted: #a19cba;
    --accent: #7b9bff;
    --accent-soft: #28304f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12111a;
  --surface: #1c1a27;
  --surface-2: #252233;
  --border: #34304a;
  --text: #ece9f7;
  --muted: #a19cba;
  --accent: #7b9bff;
  --accent-soft: #28304f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
mark { background: none; color: var(--accent); font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.hidden { display: none !important; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  padding: 10px 16px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { font-weight: 800; font-size: 17px; color: var(--text); white-space: nowrap; }
.brand span { color: var(--accent); }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.nav a { padding: 6px 10px; border-radius: 8px; color: var(--muted); white-space: nowrap; }
.nav a.active, .nav a:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.header-actions { display: flex; gap: 6px; }
.icon-btn {
  border: 1px solid var(--border); background: var(--surface); border-radius: 8px;
  padding: 5px 10px; min-width: 34px; min-height: 32px;
}
.icon-btn:hover { border-color: var(--accent); }

.container { max-width: 1440px; margin: 0 auto; padding: 16px; }

/* Layout: filters + results */
.db-layout { display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: start; }
.filters {
  position: sticky; top: 68px; max-height: calc(100vh - 84px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px; box-shadow: var(--shadow);
}
.filters h3 { margin: 14px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.filters h3:first-child { margin-top: 0; }
.filter-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.filter-head strong { font-size: 15px; }
.link-btn { border: 0; background: none; color: var(--accent); padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--border); background: var(--surface-2); border-radius: 999px;
  padding: 3px 10px; font-size: 12.5px; line-height: 1.5;
}
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.chip.attr-cute[aria-pressed="true"] { background: var(--cute); border-color: var(--cute); }
.chip.attr-happy[aria-pressed="true"] { background: var(--happy); border-color: var(--happy); }
.chip.attr-pure[aria-pressed="true"] { background: var(--pure); border-color: var(--pure); }
.talent-group { margin-bottom: 6px; }
.talent-group > .small { display: block; margin: 4px 0 3px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 5px 10px; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.select, .input {
  border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 6px 10px; min-height: 34px;
}
.input:focus, .select:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

.toolbar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow);
}
.toolbar .search { flex: 1 1 240px; min-width: 0; }
.toolbar .group { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.result-meta { display: flex; justify-content: space-between; align-items: center; margin: 4px 2px 10px; color: var(--muted); gap: 8px; flex-wrap: wrap; }
.filter-toggle { display: none; }

/* Card grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.grid.compact { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.tile {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); cursor: pointer; display: flex; flex-direction: column;
  transition: transform .12s ease, border-color .12s ease;
}
.tile:hover { transform: translateY(-2px); border-color: var(--accent); }
.tile:focus-visible { outline: 3px solid var(--accent); }
.tile-body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 2px; }
.tile-title { font-weight: 700; font-size: 13.5px; line-height: 1.3; }
.tile-talent { font-size: 12px; color: var(--muted); }
.grid.compact .tile-body { padding: 5px 7px 7px; }
.grid.compact .tile-title { font-size: 11.5px; }
.grid.compact .tile-stats, .grid.compact .tile-talent { display: none; }

.art {
  position: relative; aspect-ratio: 3 / 4; overflow: hidden;
  background: linear-gradient(145deg, var(--c1), var(--c2));
  display: flex; align-items: flex-end; justify-content: flex-start;
}
.art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.art .art-name {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center;
  font-weight: 900; font-size: 26px; color: rgba(255, 255, 255, .92); text-shadow: 0 2px 10px rgba(0, 0, 0, .35);
  padding: 8px; letter-spacing: .02em; word-break: break-word;
}
.art::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 80% 15%, rgba(255, 255, 255, .45), transparent 45%),
    linear-gradient(to top, rgba(0, 0, 0, .35), transparent 45%);
  pointer-events: none;
}
.grid.compact .art .art-name { font-size: 16px; }
.art .stars { position: relative; z-index: 1; margin: 6px 8px; color: var(--star); font-size: 14px; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); letter-spacing: -1px; }
.art .badges { position: absolute; top: 6px; left: 6px; right: 6px; z-index: 1; display: flex; gap: 4px; flex-wrap: wrap; }
.badge {
  display: inline-block; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px;
  background: rgba(0, 0, 0, .55); color: #fff; text-transform: uppercase; letter-spacing: .03em;
}
.badge.cute { background: var(--cute); }
.badge.happy { background: var(--happy); }
.badge.pure { background: var(--pure); }
.badge.limited { background: #7a3cff; }
.badge.new { background: #ff3b3b; }
.badge.announced { background: #111; border: 1px dashed #fff; }
.attr-text-cute { color: var(--cute); font-weight: 700; }
.attr-text-happy { color: var(--happy); font-weight: 700; }
.attr-text-pure { color: var(--pure); font-weight: 700; }

.own-btn {
  position: absolute; top: 6px; right: 6px; z-index: 2; border: 0; border-radius: 50%; width: 28px; height: 28px;
  background: rgba(0, 0, 0, .45); color: #fff; font-size: 14px; line-height: 28px; padding: 0;
}
.own-btn[aria-pressed="true"] { background: #22c55e; }
.tile.not-owned .art { filter: grayscale(.85) brightness(.9); }
.tile .art .badges { right: 40px; }

.tile-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; margin-top: 4px; font-size: 11.5px; text-align: center; }
.tile-stats div { background: var(--surface-2); border-radius: 6px; padding: 2px 0; }
.tile-stats b { display: block; font-size: 12px; }
.tile-stats .k { font-size: 10px; color: var(--muted); }
.sort-value { font-size: 11.5px; color: var(--accent); font-weight: 700; }

/* List view */
.list { display: flex; flex-direction: column; gap: 8px; }
.row {
  display: grid; grid-template-columns: 72px 1fr; gap: 12px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px; cursor: pointer; box-shadow: var(--shadow);
}
.row:hover { border-color: var(--accent); }
.row .art { border-radius: 8px; }
.row .art .art-name { font-size: 13px; }
.row .art .stars { font-size: 10px; margin: 3px 4px; }
.row-main { min-width: 0; }
.row-top { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; }
.row-skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 4px 12px; margin-top: 4px; font-size: 12.5px; }
.row-skills .lbl { font-weight: 700; font-size: 11px; text-transform: uppercase; color: var(--muted); margin-right: 4px; }

/* Table view */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td { padding: 7px 10px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
table.data th { position: sticky; top: 0; background: var(--surface-2); font-size: 12px; cursor: pointer; user-select: none; }
table.data th.num, table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data th[aria-sort="ascending"]::after { content: " ▲"; }
table.data th[aria-sort="descending"]::after { content: " ▼"; }
table.data tbody tr { cursor: pointer; }
table.data tbody tr:hover { background: var(--accent-soft); }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(10, 8, 25, .55); z-index: 50; display: flex; align-items: flex-start;
  justify-content: center; padding: 32px 16px; overflow-y: auto;
}
.modal {
  width: 100%; max-width: 980px; background: var(--surface); border-radius: 16px; border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35); position: relative;
}
.modal-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.modal-head .spacer { flex: 1; }
.modal-body { display: grid; grid-template-columns: 300px 1fr; gap: 20px; padding: 16px; }
.modal-body .art { border-radius: 12px; }
.modal-body .art .art-name { font-size: 34px; }
.detail-title { margin: 0; font-size: 22px; line-height: 1.25; }
.detail-sub { margin: 2px 0 10px; color: var(--muted); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: 13px; margin: 10px 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.section { margin-top: 18px; }
.section h4 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; background: var(--surface-2); border-radius: 10px; padding: 10px; }
.controls label { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.controls input[type="range"] { width: 160px; accent-color: var(--accent); }
.stat-bars { display: grid; gap: 6px; margin-top: 10px; }
.stat-bar { display: grid; grid-template-columns: 96px 1fr 70px; gap: 8px; align-items: center; font-size: 13px; }
.stat-bar .track { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.stat-bar .fill { height: 100%; border-radius: 999px; }
.stat-bar .v { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.skill { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.skill-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 4px; }
.skill-head strong { font-size: 13.5px; }
.pill { font-size: 11px; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.pill.on { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.skill-lv { font-size: 13px; }
.skill-lv + .skill-lv { margin-top: 4px; padding-top: 4px; border-top: 1px dashed var(--border); }
.skill-lv.dim { opacity: .5; }
.pot-list { margin: 0; padding-left: 18px; font-size: 13px; }
.pot-list li.done { color: var(--accent); font-weight: 600; }
.nav-arrow { font-size: 18px; }

/* Compare */
.compare-bar {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 40;
  display: flex; gap: 8px; align-items: center; background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25); padding: 8px 10px; border-radius: 999px; max-width: calc(100vw - 32px); overflow-x: auto;
}
.compare-bar .mini { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); font-size: 12px; white-space: nowrap; }
.compare-grid { display: grid; grid-template-columns: 150px repeat(var(--n), minmax(200px, 1fr)); gap: 0; font-size: 13px; overflow-x: auto; }
.compare-grid > div { padding: 8px; border-bottom: 1px solid var(--border); }
.compare-grid .lbl { font-weight: 700; color: var(--muted); font-size: 12px; }
.compare-grid .best { color: #16a34a; font-weight: 800; }

/* Home */
.hero {
  border-radius: 18px; padding: 28px; color: #fff; margin-bottom: 18px;
  background: linear-gradient(120deg, #4f7cff, #9b5cff 55%, #ff5fa8);
  box-shadow: var(--shadow);
}
.hero h1 { margin: 0 0 6px; font-size: 28px; }
.hero p { margin: 0; opacity: .92; max-width: 720px; }
.hero .cta { display: inline-block; margin-top: 14px; background: #fff; color: #4f3cff; font-weight: 700; padding: 8px 16px; border-radius: 999px; }
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.stat-card b { display: block; font-size: 26px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 18px; }
.panel h2 { margin: 0 0 12px; font-size: 18px; }
.banner-item { border-top: 1px solid var(--border); padding: 14px 0; }
.banner-item:first-of-type { border-top: 0; padding-top: 0; }
.banner-item h3 { margin: 0 0 2px; font-size: 16px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.banner-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 10px; }
.status { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; }
.status.live { background: #22c55e; color: #fff; }
.status.upcoming { background: #f59e0b; color: #fff; }
.status.ended { background: var(--surface-2); color: var(--muted); }

footer.site-footer { color: var(--muted); font-size: 12px; text-align: center; padding: 24px 16px 40px; }
.empty { text-align: center; padding: 60px 16px; color: var(--muted); }

@media (max-width: 900px) {
  .db-layout { grid-template-columns: 1fr; }
  .filters { position: fixed; inset: 0 auto 0 0; top: 0; width: min(320px, 88vw); max-height: none; z-index: 45; border-radius: 0; transform: translateX(-105%); transition: transform .2s ease; }
  .filters.open { transform: none; }
  .filter-toggle { display: inline-block; }
  .modal-body { grid-template-columns: 1fr; }
  .modal-body > .art-col { max-width: 260px; margin: 0 auto; width: 100%; }
  .modal-backdrop { padding: 0; }
  .modal { border-radius: 0; min-height: 100vh; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .stat-bar { grid-template-columns: 80px 1fr 60px; }
}
@media (max-width: 520px) {
  .site-header { flex-wrap: wrap; gap: 8px; }
  .nav { order: 3; flex-basis: 100%; }
  .header-actions { margin-left: auto; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .grid.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .art .art-name { font-size: 20px; }
}

/* ---------- My Data / Team pages ---------- */
.page-title { margin: 6px 0 4px; font-size: 24px; border-left: 4px solid var(--accent); padding-left: 10px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; }
.tab { padding: 8px 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); text-decoration: none; }
.tab:hover { text-decoration: none; color: var(--accent); }
a.chip { color: inherit; text-decoration: none; }
.my-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.my-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; }
.my-card.not-owned { opacity: .72; }
.my-card.not-owned .art { filter: grayscale(.8); }
.my-card-top { display: grid; grid-template-columns: 64px 1fr; gap: 10px; align-items: center; }
.my-card-top .art { border-radius: 8px; }
.my-card-top .art .art-name { font-size: 12px; }
.my-card-top .art .stars, .my-card-top .art .badges { display: none; }
.my-card-info { display: flex; flex-direction: column; min-width: 0; font-size: 13px; line-height: 1.3; }
.own-row { display: flex; gap: 6px; align-items: center; font-size: 13px; }
.slider-row { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); }
.slider-row b { color: var(--accent); }
.my-card input[type="range"], .rank-card input[type="range"] { width: 100%; accent-color: var(--accent); }
.lb-track { position: relative; }
.lb-dots { position: absolute; left: 8px; right: 8px; top: 50%; height: 0; pointer-events: none; }
.lb-dots i { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--muted); transform: translate(-50%, -50%); opacity: .7; }
.rank-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin-bottom: 12px; }
.rank-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; }
.rank-head { display: flex; gap: 10px; align-items: center; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 13px; flex: none; text-shadow: 0 1px 3px rgba(0,0,0,.4); }
.rank-ctl { display: flex; gap: 6px; align-items: center; }
.notice { border-left: 4px solid var(--accent); background: var(--accent-soft); padding: 10px 14px; border-radius: 8px; margin: 12px 0 16px; font-size: 13.5px; }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px; margin-bottom: 14px; box-shadow: var(--shadow); }
.step h2 { display: flex; align-items: center; gap: 10px; font-size: 17px; margin: 0 0 12px; }
.step .num { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; flex: none; }
.opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.opt-card { text-align: left; border: 1px solid var(--border); background: var(--surface-2); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.opt-card strong { font-size: 15px; }
.opt-card span { color: var(--muted); font-size: 13px; }
.opt-card:hover { border-color: var(--accent); }
.opt-card[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.opt-card:disabled { opacity: .5; cursor: not-allowed; }
.fresh { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; padding: 10px; border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.opt-rows { display: flex; flex-direction: column; gap: 10px; }
.opt-rows > div { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.opt-rows .lbl { min-width: 120px; color: var(--muted); font-size: 13px; }
.check { display: inline-flex; gap: 6px; align-items: center; font-size: 13.5px; margin-right: 12px; }
.song-picker { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.song-picker select { width: 100%; min-height: 120px; }
.run-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 6px 0 18px; }
.btn-primary { background: var(--accent); color: #fff; border: 0; border-radius: 10px; padding: 10px 20px; font-weight: 700; font-size: 15px; }
.btn-primary:disabled { opacity: .6; }
.progress { flex: 1 1 200px; height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress .bar { height: 100%; width: 0; background: var(--accent); transition: width .15s; }
.result { display: flex; flex-direction: column; gap: 12px; }
.result h3 { margin: 0; }
.result-head { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-end; }
.result-head .icon-btn { margin-left: auto; text-decoration: none; }
.big { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }
.team-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.team-slot { position: relative; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.team-slot .art { border-radius: 10px; }
.team-slot .art .art-name { font-size: 15px; }
.team-slot.leader .art { outline: 3px solid var(--star); outline-offset: -3px; }
.slot-label { position: absolute; top: 4px; left: 4px; z-index: 3; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; font-weight: 700; padding: 0 7px; border-radius: 999px; }
.team-slot .art .badges { display: none; }
.team-slot .small { line-height: 1.3; word-break: break-word; }
.small-table { max-width: 520px; }
.tile.picked { outline: 3px solid var(--accent); }
.details-layout { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
.method h2 { margin-top: 24px; }
.method code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
@media (max-width: 900px) {
  .details-layout { grid-template-columns: 1fr; }
  .team-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.details-layout > *, .song-picker, .song-picker select { min-width: 0; max-width: 100%; }
.panel { min-width: 0; overflow-wrap: anywhere; }
.select, .input { max-width: 100%; }
.board-wrap { overflow: auto; max-height: 60vh; border: 1px solid var(--border); border-radius: 12px; padding: 10px; background: var(--surface-2); }
.board-grid { display: grid; gap: 3px; width: max-content; margin: 0 auto; }
.tile-node { position: relative; width: 34px; height: 34px; border-radius: 50%; border: 2px solid transparent; font-size: 10.5px; font-weight: 800; padding: 0;
  color: #fff; opacity: .28; line-height: 1; }
.tile-node i { position: absolute; bottom: -3px; left: 50%; transform: translateX(-50%); font-size: 8px; font-style: normal; color: var(--star); }
.tile-node.on { opacity: 1; box-shadow: 0 0 0 2px #fff, 0 0 8px rgba(0,0,0,.25); }
.tile-node.can { opacity: .75; border: 2px dashed var(--text); }
.tile-node.t-leader { background: #e2455b; }
.tile-node.t-card { background: #3d7dff; }
.tile-node.t-all_member { background: #22a35a; }
.tile-node.t-content { background: #e0a500; }
.tile-node.t-connection { background: #8a8aa0; }
.board-eff { columns: 2 260px; font-size: 13px; padding-left: 18px; }

/* ---------- card art ---------- */
.art { aspect-ratio: 1 / 1; }
.art.has-img { background: #111; }
.art.has-img .art-name, .art.has-img .stars { display: none; }
.art.has-img::after { background: none; }
.art.has-img img { object-fit: cover; }
.art .badges { z-index: 2; }
.art.has-img .badge.cute, .art.has-img .badge.happy, .art.has-img .badge.pure { display: none; }
.art.has-img .badges { top: 6px; left: 34%; right: 6px; justify-content: flex-end; }
.tile .art.has-img .badges { right: 40px; }
.hero-art { width: 100%; aspect-ratio: 16 / 9; max-height: 440px; overflow: hidden; background: #111; }
.hero-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.grid.compact .art.has-img .badges { display: none; }

/* ---------- songs ---------- */
.jacket { position: relative; aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden;
  background: linear-gradient(135deg, hsl(var(--h) 70% 62%), hsl(calc(var(--h) + 60) 70% 45%)); flex: none; }
.jacket img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.jacket-fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 6px;
  color: #fff; font-weight: 800; font-size: 13px; text-shadow: 0 1px 4px rgba(0,0,0,.4); word-break: break-word; }
.jacket.xs { width: 36px; border-radius: 6px; }
.jacket.xs .jacket-fallback { font-size: 0; }
.jacket.sm { width: 56px; border-radius: 8px; }
.jacket.sm .jacket-fallback { font-size: 8px; }
.jacket.lg .jacket-fallback { font-size: 20px; }
.song-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.song-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; cursor: pointer; box-shadow: var(--shadow); }
.song-tile:hover { border-color: var(--accent); transform: translateY(-2px); }
.song-tile .jacket { border-radius: 0; }
.song-body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; line-height: 1.3; }
.lv-row { display: flex; gap: 4px; margin-top: 4px; }
.lv { display: inline-block; min-width: 26px; text-align: center; font-size: 11px; font-weight: 800; color: #fff; border-radius: 6px; padding: 1px 5px; }
.lv-easy { background: #37b24d; } .lv-normal { background: #1c7ed6; } .lv-hard { background: #f08c00; } .lv-expert { background: #e03131; }
.song-current { display: flex; gap: 10px; align-items: center; }
.song-list { overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.song-opt { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--border); background: none; padding: 4px 8px; font-size: 13px; line-height: 1.25; }
.song-opt:hover { background: var(--accent-soft); }
.song-opt.on { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.song-opt[hidden] { display: none; }
@media (max-width: 520px) { .song-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.board-layout { display: grid; grid-template-columns: 1fr 300px; gap: 12px; align-items: start; }
.tile-detail { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px; font-size: 13px; }
.tile-detail .row { display: flex; gap: 10px; align-items: flex-start; }
.tile-detail .tile-node { flex: none; }
.tile-node.sel { outline: 3px solid var(--text); outline-offset: 1px; opacity: 1; }
.tile-node.foot { box-shadow: 0 0 0 3px var(--star), 0 0 10px var(--star); }
.tile-node img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
@media (max-width: 900px) { .board-layout { grid-template-columns: 1fr; } }
.spread { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: 13px; background: var(--surface-2); border-radius: 10px; padding: 8px 12px; }
.spread-bar { position: relative; flex: 1 1 100%; height: 8px; background: var(--border); border-radius: 999px; }
.spread-bar i { position: absolute; top: 0; bottom: 0; background: var(--accent); opacity: .45; border-radius: 999px; }
.spread-bar b { position: absolute; top: -3px; width: 3px; height: 14px; background: var(--accent); border-radius: 2px; }
.event-songs { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin: 10px 0; }
.event-song { display: flex; gap: 10px; align-items: center; text-align: left; border: 1px solid var(--border); background: var(--surface-2); border-radius: 12px; padding: 8px; }
.event-song.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.jacket-stack { display: flex; gap: 2px; }
.bonus-box { border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; margin-top: 10px; }
.bonus-box.missing { border-color: #e2455b; } .bonus-box.missing p { color: #e2455b; font-weight: 700; margin: 0 0 8px; }
.bonus-box.have { border-color: #22a35a; } .bonus-box.have p { color: #22a35a; font-weight: 700; margin: 0 0 8px; }
.bonus-card { display: flex; gap: 12px; align-items: center; }
.bonus-card .art { width: 90px; border-radius: 10px; flex: none; }
.outfit-skill { background: var(--surface-2); border-radius: 10px; padding: 8px 12px; font-size: 13.5px; }
.breakdown { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 8px; }
.breakdown b { color: var(--text); font-weight: 700; }
.timeline svg { width: 100%; height: auto; display: block; background: var(--surface-2); border-radius: 10px; }
.tl-grid { stroke: var(--border); stroke-width: 1; }
.tl-axis { fill: var(--muted); font-size: 12px; text-anchor: middle; }
.tl-label { fill: var(--text); font-size: 13px; }
.tl-sp { fill: var(--star); font-size: 11px; font-weight: 800; }
.tl-details summary { cursor: pointer; font-weight: 700; margin: 4px 0; }
.plan { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.plan h3 { margin: 0; }
.plan-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.plan-head .icon-btn { margin-left: auto; }
.big-inline { font-size: 20px; }
.plan-board { border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px; }
.plan-board summary { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; cursor: pointer; }
.mini-board { display: grid; gap: 2px; width: max-content; margin: 8px auto; }
.mini-tile { width: 14px; height: 14px; border-radius: 50%; opacity: .22; position: relative; overflow: hidden; }
.mini-tile.on { opacity: 1; }
.mini-tile.added { box-shadow: 0 0 0 2px #22c55e; }
.mini-tile.removed { box-shadow: 0 0 0 2px #e2455b; opacity: .5; }
.mini-tile img { width: 100%; height: 100%; object-fit: cover; }
.mini-tile.t-leader { background: #e2455b; } .mini-tile.t-card { background: #3d7dff; } .mini-tile.t-all_member { background: #22a35a; }
.mini-tile.t-content { background: #e0a500; } .mini-tile.t-connection { background: #8a8aa0; }
.art.art-remote img { object-fit: cover; object-position: center 20%; }
.hero-art img[src*="img_card_vert"] { object-fit: contain; }

/* ---------- zoomable holomem board (boardview.js) ---------- */
.bv { position: relative; height: 520px; overflow: hidden; border-radius: 14px; border: 1px solid #22346a; cursor: grab; touch-action: none; user-select: none;
  background: radial-gradient(circle, rgba(140,170,255,.13) 1.2px, transparent 1.4px) 0 0 / 32px 32px, linear-gradient(160deg, #10204a, #0b1636 60%, #0a1330); }
.bv.dragging { cursor: grabbing; }
.bv-stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.bv-lines { position: absolute; left: 0; top: 0; overflow: visible; }
.bv-lines line { stroke: rgba(150,175,235,.35); stroke-width: 2.5; stroke-dasharray: 2 7; stroke-linecap: round; }
.bv-lines line.on { stroke: rgba(170,200,255,.8); stroke-width: 3; }
.bv-t { position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; padding: 0; display: grid; place-items: center;
  color: #fff; font: italic 800 17px/1 system-ui, sans-serif; border: 2px solid rgba(150,175,235,.35); background: rgba(20,36,80,.9); }
button.bv-t { cursor: pointer; }
.bv-t.big { width: 58px; height: 58px; margin: -29px 0 0 -29px; font-size: 22px; }
.bv-t b { text-shadow: 0 1px 2px rgba(0,0,0,.45); letter-spacing: -.5px; }
.bv-t b.sm { font-size: 13px; }
.bv-t em { position: absolute; top: 1px; right: 1px; font: 800 9px/1 system-ui, sans-serif; background: #fff; color: #1b2a55; border-radius: 6px; padding: 1px 2px; }
.bv-t i { position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); font-size: 9px; font-style: normal; color: #fff; text-shadow: 0 0 3px #000; white-space: nowrap; letter-spacing: -1px; }
.bv-t.off { color: rgba(190,205,240,.45); }
.bv-t.off i { color: rgba(190,205,240,.45); }
.bv-t.on.t-leader { background: radial-gradient(circle at 35% 30%, #ff8a73, #e2455b 70%); border-color: #ffb3a8; }
.bv-t.on.t-card { background: radial-gradient(circle at 35% 30%, #6fa8ff, #2f5fe0 70%); border-color: #a9c8ff; }
.bv-t.on.t-all_member { background: radial-gradient(circle at 35% 30%, #5fe0a6, #1aa36a 70%); border-color: #a5f0cc; }
.bv-t.on.t-content { background: radial-gradient(circle at 35% 30%, #ffd35c, #d99a00 70%); border-color: #ffe7a0; }
.bv-t.on.t-connection { background: radial-gradient(circle at 35% 30%, #b8c4e8, #6d7ba8 70%); border-color: #dfe6ff; }
.bv-t.off.t-leader { border-color: rgba(226,69,91,.45); }
.bv-t.off.t-card { border-color: rgba(61,125,255,.5); }
.bv-t.off.t-all_member { border-color: rgba(34,163,90,.5); }
.bv-t.off.t-content { border-color: rgba(224,165,0,.5); }
.bv-t.can { border-style: dashed; border-color: #fff; color: #fff; }
.bv-t.added { box-shadow: 0 0 0 3px #22c55e, 0 0 12px rgba(34,197,94,.7); }
.bv-t.removed { box-shadow: 0 0 0 3px #ff4d5e; opacity: .75; }
.bv-t.foot { box-shadow: 0 0 0 3px #ffd34d, 0 0 12px rgba(255,211,77,.8); }
.bv-t.sel { outline: 3px solid #fff; outline-offset: 3px; }
.bv-t img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 2px solid #fff; background: #fff; }
.bv-t .bv-name { position: absolute; top: 100%; margin-top: 7px; left: 50%; transform: translateX(-50%); white-space: nowrap; font: 700 11px/1.2 system-ui, sans-serif;
  color: #fff; background: rgba(8,16,40,.85); padding: 2px 6px; border-radius: 8px; z-index: 1; }
.bv-ctrl { position: absolute; right: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 8px; z-index: 2; }
.bv-ctrl button { width: 40px; height: 40px; border-radius: 10px; border: 1px solid rgba(170,200,255,.4); background: rgba(16,30,70,.9); color: #fff; font-size: 20px; cursor: pointer; }
.bv-ctrl button:hover { background: #2a4aa0; }
.bv-hint { position: absolute; left: 12px; bottom: 12px; font-size: 12px; color: #dfe6ff; background: rgba(8,16,40,.75); padding: 5px 10px; border-radius: 8px; pointer-events: none; }
.bv.bv-full { position: fixed; inset: 0; height: auto !important; z-index: 1000; border-radius: 0; }
body.bv-lock { overflow: hidden; }
.plan.only-changes .bv-t.same { opacity: .28; }
.plan.only-changes .plan-board.nochange { display: none; }
.mat-chip .gem { font-size: 15px; margin-right: 3px; }
.gem.leader { color: #ff5a6e; } .gem.card { color: #4d8dff; } .gem.content { color: #ffc21a; } .gem.allmember { color: #2bd07f; }
.con-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.con-card { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 4px 10px 4px 4px; font-size: 13px; }
.con-card .ic { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; flex: none; background: var(--surface); }
.con-card .ic img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 640px) { .bv { height: 420px; } .bv-hint { display: none; } }
.btn-sm { padding: 6px 14px; font-size: 13.5px; }
.bv-t.inline { position: relative; margin: 0; flex: none; }
.bv-t.has-card { width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 14px; }
.bv-t.has-card img { border-radius: 12px; }
.bv-t.has-card .bv-name { font-size: 12px; }
.bv-t.has-card .bv-name { top: auto; bottom: 2px; margin: 0; font-size: 10.5px; padding: 1px 5px; max-width: 60px; overflow: hidden; text-overflow: ellipsis; }
.rec-diff { font-weight: 400; margin-top: 4px; } .rec-diff s { color: var(--muted); }
.avatar { position: relative; overflow: hidden; }
.avatar.has-img { background: var(--surface-2) !important; box-shadow: inset 0 0 0 2px var(--border); }
.avatar.has-img b { display: none; }
.avatar img { width: 100%; height: 100%; object-fit: contain; }
.avatar.lg { width: 64px; height: 64px; font-size: 18px; }
