/* Copyright (c) 2026 Blink (Cloudia Archive). All rights reserved.
   Part of the Cloudia Archive's own animation & effect engine, written from scratch for this site.
   Not open source and not licensed for any use: copying, reuse or re-hosting of this code is not permitted. See viewer/LICENSE.txt.
   (Game content shown by the site belongs to AIDIS Inc.; this notice covers only the site's own code.) */
/* Fonts, served from this site (viewer/fonts/) instead of Google Fonts: Inter and Cinzel, both under the SIL Open
   Font License 1.1 (viewer/fonts/OFL-*.txt). Split by script like Google serves them, so a browser only downloads
   the parts the page's text uses. */
/* Cinzel latin-ext */
@font-face { font-family: 'Cinzel'; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/cinzel-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
/* Cinzel latin */
@font-face { font-family: 'Cinzel'; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/cinzel-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
/* Inter cyrillic-ext */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(fonts/inter-cyrillic-ext.woff2) format('woff2'); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
/* Inter cyrillic */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(fonts/inter-cyrillic.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
/* Inter greek-ext */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(fonts/inter-greek-ext.woff2) format('woff2'); unicode-range: U+1F00-1FFF; }
/* Inter greek */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(fonts/inter-greek.woff2) format('woff2'); unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }
/* Inter vietnamese */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(fonts/inter-vietnamese.woff2) format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
/* Inter latin-ext */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(fonts/inter-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
/* Inter latin */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(fonts/inter-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root {
  --bg: #0e1016;
  --bg2: #151924;
  --panel: #1a1f2c;
  --panel2: #212839;
  --line: #2b3348;
  --text: #e8ebf3;
  --muted: #8d96ad;
  --accent: #e7b35a;
  --accent2: #6fb3ff;
  --radius: 12px;
  --text2: #c7cddb;
  --glass: rgba(20,23,30,.96);
  --glass-top: rgba(14,16,22,.92);
  --pos: #8fe3b0;
  --neg: #ff8f8f;
  --shadow: rgba(0,0,0,.45);
}
:root[data-theme="light"] {
  --bg: #f3f4f8; --bg2: #ffffff; --panel: #ffffff; --panel2: #eceff5; --line: #d7dbe5;
  --text: #1a1e29; --muted: #5c6477; --accent: #8c5a0e; --accent2: #2c68c9;
  --text2: #343b4b; --glass: rgba(255,255,255,.97); --glass-top: rgba(255,255,255,.92);
  --pos: #18884a; --neg: #c23838; --shadow: rgba(30,40,60,.18);
}
:root[data-theme="light"] .checker, :root[data-theme="light"] .bg-checker { filter: none; }
:root[data-theme="light"] img.skico, :root[data-theme="light"] .sr-ico, :root[data-theme="light"] .thumb { background: #e6e9f0; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 Inter, system-ui, sans-serif; }
a { color: inherit; text-decoration: none; }
button, select, input { font: inherit; color: inherit; }

.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 12px 20px; background: var(--glass-top); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; gap: 8px; align-items: center; font-family: Cinzel, serif; font-size: 18px; letter-spacing: .5px; }
.brand-mark { color: var(--accent); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a { padding: 7px 14px; border-radius: 999px; color: var(--muted); font-weight: 500; }
.tabs a:hover { color: var(--text); background: var(--panel); }
.tabs a.on { color: #1a1306; background: var(--accent); }
.search-wrap { margin-left: auto; }
#search { width: 260px; max-width: 70vw; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); outline: none; }
#search:focus { border-color: var(--accent); }

main { padding: 20px; max-width: 1600px; margin: 0 auto; }

.toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; color: var(--muted); }
.toolbar h1 { margin: 0; font-size: 22px; color: var(--text); font-weight: 700; }
.toolbar .count { font-size: 13px; }
.toolbar label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.toolbar select { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 8px;
  transition: transform .12s, border-color .12s, background .12s; text-align: center; min-width: 0;
}
.card:hover { transform: translateY(-2px); border-color: var(--accent); background: var(--panel2); }
.card .thumb { width: 96px; height: 96px; display: grid; place-items: center; border-radius: 10px; background: var(--bg2); overflow: hidden; }
.card .thumb img { max-width: 100%; max-height: 100%; image-rendering: auto; }
.card .thumb .ph { font-family: Cinzel, serif; font-size: 34px; color: var(--line); }
.card .nm { font-weight: 600; font-size: 13px; line-height: 1.25; overflow-wrap: anywhere; }
.card .id { color: var(--muted); font-size: 12px; }
.badges { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.badge { font-size: 10.5px; padding: 1px 7px; border-radius: 999px; background: var(--bg2); color: var(--muted); border: 1px solid var(--line); }
.badge.ill { color: var(--accent); border-color: rgba(231,179,90,.4); }
.badge.bat { color: var(--accent2); border-color: rgba(111,179,255,.4); }

.empty { color: var(--muted); padding: 40px; text-align: center; }

/* detail */
.detail-head { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.detail-head .back { padding: 7px 12px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); }
.detail-head .back:hover { color: var(--text); }
.detail-head img.icon { width: 64px; height: 64px; border-radius: 10px; background: var(--bg2); }
.detail-head h1 { margin: 0; font-size: 24px; }
.detail-head .sub { color: var(--muted); font-size: 13px; }
.detail-head .nav { margin-left: auto; display: flex; gap: 6px; }
.detail-head .nav a { padding: 7px 12px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); }
.detail-head .nav a:hover { border-color: var(--accent); }

.section { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 18px; overflow: hidden; }
.section > h2 { margin: 0; padding: 12px 16px; font-size: 15px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.section > h2 .hint { color: var(--muted); font-weight: 400; font-size: 12px; }
.section .body { padding: 14px 16px; }

.stage-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 260px; min-height: 520px; }
.stage { position: relative; height: 620px; cursor: grab; min-width: 0; overflow: hidden; }
.stage:active { cursor: grabbing; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.stage .status { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); pointer-events: none; text-align: center; padding: 20px; }
.stage .status.err { color: var(--neg); }
.ctrl { border-left: 1px solid var(--line); padding: 14px; display: flex; flex-direction: column; gap: 12px; background: var(--bg2); }
.ctrl label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.ctrl select, .ctrl input[type=range] { width: 100%; }
.ctrl select { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; color: var(--text); }
.ctrl .row { display: flex; gap: 6px; flex-wrap: wrap; }
.ctrl button { flex: 1; padding: 7px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; }
.ctrl button:hover { border-color: var(--accent); }
.ctrl button.on { background: var(--accent); color: #1a1306; border-color: var(--accent); }
.ctrl label[hidden] { display: none; }
.ctrl .chk { flex-direction: row; align-items: center; gap: 8px; color: var(--text); cursor: pointer; }
.ctrl .chk input { width: auto; }
.ctrl .layers { display: flex; flex-direction: column; gap: 4px; max-height: 160px; overflow: auto; }
.ctrl .tip { font-size: 11.5px; color: var(--muted); line-height: 1.4; }

.bg-dark { background: #0b0d12; }
.bg-grey { background: #5b6170; }
.bg-light { background: #e9ecf2; }
.checker, .bg-checker {
  background-color: #2a2f3b;
  background-image: linear-gradient(45deg, #353b49 25%, transparent 25%), linear-gradient(-45deg, #353b49 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #353b49 75%), linear-gradient(-45deg, transparent 75%, #353b49 75%);
  background-size: 24px 24px; background-position: 0 0, 0 12px, 12px -12px, -12px 0;
}

.tex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.tex { border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--bg2); cursor: zoom-in; display: flex; flex-direction: column; min-width: 0; }
.tex:hover { border-color: var(--accent); }
.tex .im { height: 120px; display: grid; place-items: center; padding: 6px; }
.tex .im img { max-width: 100%; max-height: 100%; }
.tex .cap { font-size: 11px; color: var(--muted); padding: 5px 8px; border-top: 1px solid var(--line); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pixel img, img.pixel { image-rendering: pixelated; }

.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.icon-grid .tex .im { height: 76px; }

.files { columns: 3 240px; font-size: 12.5px; color: var(--muted); margin: 0; padding-left: 18px; }

details.more > summary { cursor: pointer; padding: 12px 16px; font-weight: 600; list-style: none; }
details.more > summary::before { content: "▸ "; color: var(--accent); }
details.more[open] > summary::before { content: "▾ "; }

.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(5,6,10,.85); display: grid; place-items: center; padding: 24px; }
.lightbox[hidden] { display: none; }
.lb-inner { max-width: 96vw; max-height: 94vh; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.lb-bar { display: flex; gap: 14px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.lb-bar span { font-weight: 600; overflow-wrap: anywhere; }
.lb-bar a { color: var(--accent2); margin-left: auto; font-size: 13px; }
.lb-bar button { background: none; border: 0; cursor: pointer; font-size: 18px; color: var(--muted); }
.lb-img { overflow: auto; display: grid; place-items: center; }
.lb-img img { max-width: 94vw; max-height: 84vh; }

@media (max-width: 860px) {
  .stage-wrap { grid-template-columns: 1fr; }
  .ctrl { border-left: 0; border-top: 1px solid var(--line); }
  .stage { height: 420px; }
  main { padding: 16px; }
  .search-wrap { margin-left: 0; width: 100%; }
  #search { width: 100%; max-width: none; }
}

/* ---- voices ---- */
.badge.voi { color: var(--pos); border-color: rgba(143,227,176,.4); }
.vlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 8px; }
.vline { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); }
.play { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel2); cursor: pointer; font-size: 12px; display: grid; place-items: center; }
.play:hover, .chip:hover { border-color: var(--accent); }
.play.on, .chip.on { background: var(--accent); color: #1a1306; border-color: var(--accent); }
.vtag { font-size: 11.5px; color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.vtext { margin-top: 2px; line-height: 1.45; }
.vsub { margin: 16px 0 8px; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.vgrid { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg2); cursor: pointer; font-size: 12.5px; }

/* ---- profile / skills / lore ---- */
.info-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; align-items: start; }
.kvs { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.kv { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kv span, .kvl span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.kv b { font-weight: 600; overflow-wrap: anywhere; }
.stars { color: var(--accent); letter-spacing: 2px; }
.stats { width: 100%; border-collapse: collapse; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.stats th, .stats td { padding: 7px 12px; text-align: right; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.stats th:first-child, .stats td:first-child { text-align: left; color: var(--muted); }
.stats th { font-size: 11px; color: var(--muted); text-transform: uppercase; font-weight: 600; }
.stats tr:last-child td { border-bottom: 0; }
.kvl { margin-top: 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px 18px; }
.kvl p { margin: 2px 0 0; }
.skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.skill { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.sk-h { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.skill p { margin: 6px 0 0; color: var(--text2); font-size: 13px; }
.lore { display: grid; gap: 18px; max-width: 860px; }
.lore h3 { margin: 0 0 6px; font-family: Cinzel, serif; font-size: 16px; color: var(--accent); }
.lore p { margin: 0 0 10px; color: var(--text2); line-height: 1.65; }

/* ---- media ---- */
.subtabs { display: flex; gap: 4px; flex-wrap: wrap; }
.subtabs a { padding: 6px 12px; border-radius: 999px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); font-size: 13px; }
.subtabs a span { opacity: .7; margin-left: 2px; }
.subtabs a.on { color: #1a1306; background: var(--accent); border-color: var(--accent); }
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.vid { margin: 0; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.vid video { width: 100%; display: block; background: #000; aspect-ratio: 3 / 4; object-fit: contain; }
.vid figcaption { padding: 8px 10px; display: flex; flex-direction: column; gap: 1px; }
.vid figcaption span, .track .tt span { font-size: 11.5px; color: var(--muted); }
.tracks { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.track { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); }
.track .tt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.track .tt b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track a { color: var(--muted); font-size: 16px; padding: 0 4px; }
.track a:hover { color: var(--accent); }

@media (max-width: 860px) {
  .info-grid { grid-template-columns: 1fr; }
  .vlist, .skills, .tracks, .video-grid { grid-template-columns: 1fr; }
}

/* ---- video posters ---- */
.vid.blank video { opacity: .35; }
.blank-note { font-size: 11.5px; color: var(--muted); padding: 6px 10px 0; }

/* ---- unit detail ---- */
.muted { color: var(--muted); }
.ico, .sico, .rico, .tico, .cico, .skico { display: inline-block; vertical-align: middle; object-fit: contain; }
.sico { width: 34px; height: 34px; }
.rico { width: 20px; height: 20px; }
.tico { width: 16px; height: 16px; margin-right: 3px; }
.cico { width: 30px; height: 30px; }
.skico { width: 48px; height: 48px; flex: none; border-radius: 8px; background: var(--panel2); }
.skico.ph { display: inline-block; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.stat { display: flex; gap: 10px; align-items: center; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.stat span { display: block; font-size: 11px; color: var(--muted); letter-spacing: .4px; }
.stat b { font-variant-numeric: tabular-nums; font-size: 15px; }
.stat b i { font-style: normal; color: var(--muted); font-weight: 400; margin: 0 2px; }
.misc { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 12px 0 4px; font-size: 13px; }
.misc em { font-style: normal; color: var(--muted); margin-right: 4px; }
.res-row { margin-top: 12px; }
.res-h { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; font-weight: 600; margin-bottom: 6px; }
.res { display: flex; flex-wrap: wrap; gap: 6px; }
.rchip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px; border-radius: 999px; background: var(--bg2); border: 1px solid var(--line); font-size: 13px; }
b.pos { color: var(--pos); } b.neg { color: var(--neg); }
.sk-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 10px; }
.skc { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; min-width: 0; }
.skc-h { display: flex; gap: 10px; align-items: center; }
.skc-t { min-width: 0; }
.skc-t b { font-size: 14.5px; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tags .badge { display: inline-flex; align-items: center; }
.skc p { margin: 8px 0 0; color: var(--text2); font-size: 13px; line-height: 1.5; }
.skc p em { color: var(--accent); font-style: normal; font-weight: 600; margin-right: 4px; }
.ups { margin-top: 8px; }
.ups > summary { cursor: pointer; font-size: 12.5px; color: var(--accent2); }
.ctab { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 13px; }
.ctab th { text-align: left; font-size: 11px; color: var(--muted); text-transform: uppercase; font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.ctab td { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; font-variant-numeric: tabular-nums; }
.ctab tr:last-child td { border-bottom: 0; }
.ctab td.lvl { white-space: nowrap; color: var(--accent); font-weight: 600; width: 1%; }
.ctab.aw td, .ctab.aw th { text-align: center; } .ctab.aw td:last-child { text-align: left; }
.udesc { color: var(--text2); font-size: 12.5px; margin-bottom: 4px; }
.costs { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.cost { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; }
.cost b { font-variant-numeric: tabular-nums; }
.cost .cname { font-size: 12px; color: var(--muted); }
.cost.zel b { color: var(--accent); }
.unl { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; }
.unl-i { display: flex; gap: 10px; align-items: flex-start; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.unl-i .skico { width: 40px; height: 40px; }
.lva { display: flex; flex-direction: column; gap: 6px; }
.lva-i { display: flex; gap: 10px; align-items: flex-start; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.lva-i .unl-t p { margin: 2px 0 4px; }
.lva-lv { flex: none; width: 40px; height: 40px; border-radius: 9px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; line-height: 1; color: var(--accent2); border: 1px solid rgba(111,179,255,.35); background: rgba(111,179,255,.08); }
.lva-lv.late { color: var(--accent); border-color: rgba(231,179,90,.4); background: rgba(231,179,90,.08); }
.lva-lv small { font-size: 9px; font-weight: 600; opacity: .75; margin-bottom: 2px; text-transform: uppercase; }
.lva-g { display: flex; flex-wrap: wrap; gap: 4px; font-size: 11.5px; }
.unl-t { min-width: 0; flex: 1; }
.unl-t p { margin: 3px 0 6px; font-size: 12.5px; color: var(--text2); }
.eqp { margin-top: 6px; font-size: 12.5px; color: var(--text2); }
@media (max-width: 860px) { .sk-list, .unl { grid-template-columns: 1fr; } }

/* ---- detail tabs & overview ---- */
.dtabs { position: sticky; top: 61px; z-index: 10; display: flex; gap: 4px; flex-wrap: wrap; padding: 8px 0 12px; margin-bottom: 6px; background: var(--bg); border-bottom: 1px solid var(--line); }
.dtabs a { padding: 7px 14px; border-radius: 8px; color: var(--muted); font-weight: 500; border: 1px solid transparent; }
.dtabs a:hover { color: var(--text); background: var(--panel); }
.dtabs a.on { color: var(--text); background: var(--panel2); border-color: var(--accent); }
.hchip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; margin-right: 4px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-size: 12px; color: var(--text); }
.hchip.stars, .stars { color: var(--accent); }
.stars.sm { font-size: 11px; letter-spacing: 1px; }
.ov { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: start; margin-bottom: 4px; }
.ov > .ov-info > .ud > .section:first-child, .ov > .ov-info > .section:first-child { margin-top: 0; }
.section.compact .stage-wrap { grid-template-columns: minmax(0, 1fr) 200px; min-height: 0; }
.section.compact .stage { height: 560px; }
.section.compact .ctrl { padding: 10px; gap: 9px; }
.section.compact .ctrl .tip, .section.compact .ctrl .chk:has(.pma) { display: none; }
.ov-info .stat-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.more-link { margin-left: auto; font-size: 12.5px; font-weight: 500; color: var(--accent2); }
.section > h2 { flex-wrap: wrap; }
.sk-mini { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 8px; }
.skm { display: flex; gap: 10px; align-items: flex-start; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.skm .skico { width: 40px; height: 40px; }
.skm-h { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.skm p { margin: 3px 0 0; font-size: 12.5px; color: var(--text2); line-height: 1.45; }
.kv-line { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
td.eff { font-size: 12px; color: var(--text2); text-align: left !important; }
.lead { color: var(--text2); line-height: 1.6; margin-top: 0; }
.ulink { display: inline-flex; align-items: center; gap: 4px; color: var(--accent2); font-weight: 600; }

/* ---- list filters ---- */
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin: -6px 0 12px; }
.chips-l { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; font-weight: 600; width: 64px; }
.fchip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-size: 12.5px; }
.fchip:hover { border-color: var(--accent); }
.fchip.on { background: var(--accent); color: #1a1306; border-color: var(--accent); }
.fchip.on .muted { color: #5a4313; }
.sortl { display: inline-flex; align-items: center; gap: 6px; }
.card { position: relative; }
.card-top { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; justify-content: space-between; align-items: center; }
.metric { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---- equipment ---- */
.eq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.eqc { display: flex; flex-direction: column; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px; transition: border-color .12s, transform .12s; }
.eqc:hover { border-color: var(--accent); transform: translateY(-1px); }
.eqc-h { display: flex; gap: 10px; align-items: center; }
.eqico { width: 52px; height: 52px; flex: none; object-fit: contain; border-radius: 8px; background: var(--bg2); }
.eqico.ph { display: inline-block; }
.eqc-t { min-width: 0; } .eqc-t b { font-size: 13.5px; line-height: 1.25; display: block; }
.eqc-s { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.eqc-s span { display: inline-flex; align-items: center; gap: 2px; }
.eqc-u { font-size: 11.5px; color: var(--accent2); }
.detail-head img.icon { object-fit: contain; }

@media (max-width: 980px) { .ov { grid-template-columns: 1fr; } .dtabs { top: 0; position: static; } }
@media (max-width: 860px) { .section.compact .stage-wrap { grid-template-columns: 1fr; } .section.compact .stage { height: 420px; } .sk-mini { grid-template-columns: 1fr; } }
@media (max-width: 860px) { .top { position: static; } }

/* glossary of named effects shown under descriptions */
.terms { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.term { display: block; font-size: 11.5px; line-height: 1.4; color: var(--muted); padding: 3px 8px; border-left: 2px solid rgba(111,179,255,.45); background: rgba(111,179,255,.06); border-radius: 0 6px 6px 0; }
.term b { color: var(--text); font-weight: 600; margin-right: 6px; }
.term i { font-style: normal; font-size: 9.5px; text-transform: uppercase; letter-spacing: .4px; padding: 0 5px; border-radius: 999px; border: 1px solid var(--line); margin-right: 6px; }

/* ---------- v12: sliders, totals, search, glossary, compare, tray, players ---------- */
.lvslider { display: flex; align-items: center; gap: 10px; margin: 2px 0 10px; font-size: 12.5px; }
.lvslider > span:first-child { color: var(--muted); text-transform: uppercase; font-size: 11px; font-weight: 600; letter-spacing: .4px; }
.lvslider input { flex: 1; min-width: 120px; accent-color: var(--accent); }
.lvslider b { font-variant-numeric: tabular-nums; min-width: 28px; text-align: right; font-size: 15px; }
.stat em.smin { display: block; font-style: normal; font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.bonus-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0 0 10px; font-size: 12.5px; }
.bonus-row select { background: var(--bg2); border: 1px solid var(--line); border-radius: 7px; padding: 3px 6px; max-width: 220px; }
.lva-i.locked { opacity: .45; }
.lva-i.locked .lva-lv { filter: grayscale(1); }
a.term { text-decoration: none; transition: background .12s; }
a.term:hover { background: rgba(111,179,255,.14); }
.effrow input { flex: 1; min-width: 220px; max-width: 560px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; color: var(--text); }
.btnlink, .cmpbtn, .ownbtn { display: inline-flex; align-items: center; gap: 4px; padding: 5px 11px; border-radius: 8px; border: 1px solid rgba(231,179,90,.45); color: var(--accent); background: rgba(231,179,90,.07); font-size: 13px; cursor: pointer; text-decoration: none; }
.cmpbtn.on { background: rgba(231,179,90,.2); }
#tray { position: fixed; left: 50%; transform: translateX(-50%); bottom: 14px; z-index: 40; display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; background: var(--glass); border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; box-shadow: 0 10px 30px var(--shadow); max-width: calc(100vw - 24px); }
#tray[hidden] { display: none; }
.tray-g { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tray-l { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; font-weight: 600; }
.tray-i { position: relative; width: 36px; height: 36px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: var(--bg2); border: 1px solid var(--line); }
.tray-i img { width: 100%; height: 100%; object-fit: cover; border-radius: 7px; }
.tray-i button { position: absolute; top: -6px; right: -6px; width: 16px; height: 16px; border-radius: 50%; font-size: 9px; line-height: 14px; padding: 0; border: 1px solid var(--line); background: var(--panel); color: var(--muted); cursor: pointer; display: none; }
.tray-i:hover button { display: block; }
.tray-go { color: var(--accent); font-weight: 600; font-size: 13px; margin-left: 4px; }
.tray-clr { background: none; border: none; color: var(--muted); font-size: 12px; cursor: pointer; }
body.has-tray main { padding-bottom: 90px; }
.sr-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.sr { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); text-decoration: none; color: inherit; min-width: 0; }
.sr:hover { border-color: rgba(231,179,90,.5); }
.sr > div { min-width: 0; }
.sr b { margin-right: 6px; }
.sr p { margin: 3px 0 0; font-size: 12px; color: var(--text2); line-height: 1.45; overflow-wrap: anywhere; }
.sr mark { background: rgba(231,179,90,.3); color: inherit; border-radius: 3px; padding: 0 1px; }
.sr-ico { width: 38px; height: 38px; flex: none; border-radius: 8px; object-fit: cover; }
.sr-ico.ph { display: inline-flex; align-items: center; justify-content: center; background: var(--panel); border: 1px solid var(--line); color: var(--muted); }
.sr-more { margin-top: 10px; }
.gl-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; }
.gl { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.gl.focus { grid-column: 1 / -1; }
.gl-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gl-h a { color: var(--text); text-decoration: none; }
.gl-h .muted { margin-left: auto; font-size: 11.5px; }
.gl p { margin: 5px 0 0; font-size: 13px; color: var(--text2); }
.gl-by { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; }
.gl-by .chips-l { width: 100%; }
.gl-l { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px 3px 3px; border-radius: 8px; background: var(--bg2); border: 1px solid var(--line); font-size: 12px; color: inherit; text-decoration: none; }
.gl-l img { width: 26px; height: 26px; border-radius: 6px; object-fit: cover; }
.gl-l:hover { border-color: rgba(231,179,90,.5); }
.cmp-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.cmp { border-collapse: collapse; width: 100%; min-width: 640px; font-size: 13px; }
.cmp th, .cmp td { border-bottom: 1px solid var(--line); padding: 8px 10px; vertical-align: top; text-align: left; }
.cmp th { width: 130px; color: var(--muted); font-weight: 600; font-size: 12px; white-space: nowrap; background: var(--bg2); position: sticky; left: 0; z-index: 1; }
.cmp td { min-width: 200px; }
.cmp tr.sub td, .cmp tr.sub th { padding-top: 4px; padding-bottom: 4px; }
.cmp .best { color: var(--pos); font-weight: 700; }
.cmp .neg { color: var(--neg); }
.cmp-head td { position: relative; }
.cmp-h { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; padding-right: 18px; }
.cmp-x { position: absolute; top: 6px; right: 6px; background: none; border: none; color: var(--muted); cursor: pointer; }
.cmp-sk { margin-bottom: 7px; }
.cmp-sk p, .cmp td p { margin: 2px 0 0; font-size: 12px; color: var(--text2); }
.pl-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
#nowplaying { margin-left: 6px; font-size: 13px; }
#miniplayer { position: fixed; right: 14px; bottom: 14px; z-index: 41; display: flex; align-items: center; gap: 4px; background: var(--glass); border: 1px solid var(--line); border-radius: 12px; padding: 6px 8px 6px 12px; box-shadow: 0 10px 30px var(--shadow); font-size: 12.5px; max-width: calc(100vw - 28px); }
#miniplayer[hidden] { display: none; }
#miniplayer .mp-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; margin-right: 6px; }
#miniplayer button { background: var(--bg2); border: 1px solid var(--line); border-radius: 7px; color: var(--text); cursor: pointer; padding: 3px 8px; }
body.has-tray #miniplayer { bottom: 76px; }
.rec.on { color: var(--neg); border-color: rgba(255,143,143,.5); }
.grid .card, .eq-grid .eqc { content-visibility: auto; contain-intrinsic-size: 150px 210px; }

/* ---------- mobile pass ---------- */
.track { min-width: 0; }
.track .tt { min-width: 0; overflow: hidden; }
.track .tt b, .track .tt span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 860px) {
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; width: 100%; padding-bottom: 2px; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { flex: none; }
  .ctab, .stats { display: block; overflow-x: auto; max-width: 100%; }
  .ctab td.eff { min-width: 260px; }
  .sr-list, .gl-list { grid-template-columns: 1fr; }
  #tray { left: 8px; right: 8px; transform: none; bottom: 8px; padding: 6px 8px; gap: 8px; }
  .tray-i { width: 30px; height: 30px; }
  #miniplayer { right: 8px; left: 8px; bottom: 8px; }
  #miniplayer .mp-t { flex: 1; max-width: none; }
  body.has-tray #miniplayer { bottom: 64px; }
  .bonus-row select { max-width: 100%; }
  .effrow input { min-width: 0; width: 100%; }
  .detail-head .nav { flex-wrap: wrap; }
  .cmp th { width: 92px; white-space: normal; }
  .cmp td { min-width: 160px; }
}

/* ---------- live search dropdown ---------- */
.search-wrap { position: relative; }
#sdrop { position: absolute; right: 0; top: calc(100% + 8px); width: 440px; max-width: calc(100vw - 24px); max-height: min(72vh, 680px); overflow-y: auto; z-index: 60;
  background: var(--glass); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 50px var(--shadow); padding: 6px; }
#sdrop[hidden] { display: none; }
.sd-g + .sd-g { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }
.sd-h { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 4px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; color: var(--muted); }
.sd-h a { color: var(--accent); text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 11.5px; }
.sd-h em { font-style: normal; font-weight: 500; }
.sd-i { display: flex; align-items: center; gap: 10px; padding: 5px 8px; border-radius: 9px; color: inherit; text-decoration: none; min-width: 0; }
.sd-i:hover, .sd-i.on { background: rgba(231,179,90,.12); }
.sd-i .sr-ico { width: 34px; height: 34px; }
.sd-t { min-width: 0; display: flex; flex-direction: column; }
.sd-t b { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-t small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-t mark, .sd-t small mark { background: rgba(231,179,90,.32); color: inherit; border-radius: 3px; padding: 0 1px; }
.sd-all { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 6px; padding: 9px; border-radius: 9px; border-top: 1px solid var(--line); color: var(--accent); font-size: 13px; font-weight: 600; text-decoration: none; }
.sd-all:hover { background: rgba(231,179,90,.1); }
.sd-all kbd { font-family: inherit; font-size: 10.5px; padding: 1px 6px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); }
.sd-empty { padding: 14px; color: var(--muted); font-size: 13px; text-align: center; }
@media (max-width: 860px) { #sdrop { left: 0; right: 0; width: auto; max-width: none; } }

/* ---------- skill icons: ability art is a wide banner (266x122), the rest are square ---------- */
.skico { width: 56px; height: 56px; border-radius: 10px; object-fit: contain; }
img.skico[src*="skill_icon_abl"] { width: 112px; height: 52px; object-fit: cover; border-radius: 8px; box-shadow: 0 0 0 1px var(--line); }
.unl-i .skico, .skm .skico { width: 46px; height: 46px; }
.unl-i img.skico[src*="skill_icon_abl"], .skm img.skico[src*="skill_icon_abl"] { width: 96px; height: 44px; }
img.skico[src*="ui_game"] { padding: 8px; }                       /* tiny weapon-type icon used for regular attacks */
img.tico[src*="skill_icon_abl"] { width: 35px; height: 16px; object-fit: cover; border-radius: 3px; }
.skc-h { align-items: center; }
.skm { align-items: flex-start; }
@media (max-width: 520px) {
  img.skico[src*="skill_icon_abl"] { width: 88px; height: 40px; }
  .unl-i img.skico[src*="skill_icon_abl"], .skm img.skico[src*="skill_icon_abl"] { width: 78px; height: 36px; }
}

/* theme toggle */
.theme-btn { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; width: 34px; height: 34px; cursor: pointer; display: grid; place-items: center; font-size: 15px; flex: none; }
.theme-btn:hover { border-color: var(--accent); }
.favbtn { background: none; border: none; cursor: pointer; font-size: 22px; line-height: 1; color: var(--muted); padding: 0 4px; vertical-align: 2px; }
.favbtn:hover { color: var(--accent); }
.favbtn.on { color: #f5c04a; }
.card-fav { position: absolute; top: 6px; right: 8px; color: #f5c04a; font-size: 14px; z-index: 2; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.eqc { position: relative; }
.sknums { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px; }
.sn { display: inline-flex; flex-direction: column; padding: 4px 9px; border-radius: 8px; background: var(--panel2); border: 1px solid var(--line); line-height: 1.25; }
.sn em { font-style: normal; font-size: 10px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 600; }
.sn b { font-size: 13px; font-variant-numeric: tabular-nums; }
.sn b i { font-style: normal; color: var(--muted); font-weight: 400; }

/* ---------- monsters / items / summons / team ---------- */
a.cost { text-decoration: none; color: inherit; cursor: pointer; }
a.cost:hover { border-color: var(--accent); background: rgba(231,179,90,.08); }
.drop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; }
.drop { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 9px; background: var(--bg2); border: 1px solid var(--line); color: inherit; text-decoration: none; min-width: 0; }
.drop:hover { border-color: var(--accent); }
.drop > div { min-width: 0; display: flex; flex-direction: column; }
.drop b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drop small { color: var(--muted); font-size: 11.5px; }
.drop .cico, .drop .sr-ico { width: 34px; height: 34px; flex: none; }
.qlist { display: flex; flex-wrap: wrap; gap: 5px; }
.qchip { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--bg2); border: 1px solid var(--line); }
.qchip i { font-style: normal; color: var(--muted); margin-left: 4px; }
.need-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 6px; }
.need { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border-radius: 9px; background: var(--bg2); border: 1px solid var(--line); min-width: 0; }
.need .gl-l { border: none; background: none; padding: 0; flex: none; max-width: 52%; }
.need .gl-l span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.need .muted { font-size: 11.5px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.need b { font-variant-numeric: tabular-nums; }
.beast-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.beast { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); color: inherit; text-decoration: none; transition: border-color .12s, transform .12s; }
.beast:hover { border-color: var(--accent); transform: translateY(-2px); }
.beast img { width: 110px; height: 110px; object-fit: contain; flex: none; }
.beast p { margin: 4px 0 0; font-size: 12.5px; color: var(--text2); }
.beast-ov { display: flex; gap: 18px; align-items: flex-start; }
.beast-art { width: 220px; max-width: 40%; flex: none; object-fit: contain; }
.bb-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 10px; }
.bb { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.bb-h { display: flex; justify-content: space-between; align-items: center; }
.team-slots { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.tslot { background: var(--panel); border: 1px dashed var(--line); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 170px; justify-content: center; text-align: center; }
.tslot.ark { border-color: rgba(231,179,90,.45); }
.tslot a { display: flex; flex-direction: column; align-items: center; gap: 6px; color: inherit; text-decoration: none; }
.tslot > a > img { width: 84px; height: 84px; object-fit: cover; border-radius: 12px; }
.tslot b { font-size: 13px; }
.tslot input { width: 100%; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-size: 12.5px; }
.tslot-m { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; }
.tx { background: none; border: none; color: var(--muted); font-size: 11.5px; cursor: pointer; }
.tx:hover { color: var(--neg); }
.rchip.dim { opacity: .45; }
.teambtn.on { background: rgba(231,179,90,.2); }
@media (max-width: 980px) { .team-slots { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .team-slots { grid-template-columns: repeat(2, minmax(0, 1fr)); } .beast-ov { flex-direction: column; } .beast-art { max-width: 100%; } }

/* ---------- tier list maker ---------- */
.tier-bar { gap: 8px; }
.tier-title { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-weight: 600; min-width: 220px; color: var(--text); }
.tier-bar select, .tier-sub select { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; max-width: 260px; }
.tier-sp { flex: 1; }
.tier-sub { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: -6px 0 12px; font-size: 12.5px; }
.tiers { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--panel); }
.trow { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); min-height: 92px; }
.trow:last-child { border-bottom: none; }
.tlabel { width: 120px; flex: none; position: relative; display: flex; align-items: center; justify-content: center; padding: 6px; color: #1a1e29; text-align: center; }
.tl-t { font-weight: 800; font-size: 22px; line-height: 1.1; outline: none; overflow-wrap: anywhere; max-width: 100%; padding: 2px 4px; border-radius: 4px; cursor: text; }
.tl-t:focus { background: rgba(255,255,255,.5); }
.tl-c { position: absolute; right: 4px; bottom: 4px; width: 14px; height: 14px; border-radius: 50%; overflow: hidden; border: 2px solid rgba(0,0,0,.35); cursor: pointer; opacity: .55; }
.tl-c:hover { opacity: 1; }
.tl-c input { opacity: 0; width: 30px; height: 30px; margin: -8px; cursor: pointer; }
.tzone { flex: 1; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 4px; padding: 6px; min-height: 92px; background: var(--bg2); transition: background .1s; }
.tzone.over { background: rgba(231,179,90,.14); }
body.tier-picking .tzone { cursor: copy; }
body.tier-picking .tzone:hover { background: rgba(231,179,90,.08); }
.ti { width: 76px; height: 76px; border-radius: 10px; object-fit: cover; cursor: grab; background: var(--panel2); border: 2px solid transparent; transition: transform .1s; user-select: none; -webkit-user-drag: element; }
.ti:hover { transform: translateY(-2px); border-color: var(--line); }
.ti.sel { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(231,179,90,.4); }
.ti.dragging { opacity: .35; }
.tctl { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 4px; background: var(--panel); flex: none; }
.tctl button { background: none; border: 1px solid transparent; border-radius: 6px; color: var(--muted); cursor: pointer; font-size: 11px; width: 26px; height: 20px; }
.tctl button:hover { border-color: var(--line); color: var(--text); }
.tier-actions { display: flex; gap: 8px; align-items: center; margin: 10px 0 16px; flex-wrap: wrap; }
.tq { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; min-width: 160px; color: var(--text); }
.tpool { border-radius: 10px; min-height: 120px; }
.tpool .ti { width: 64px; height: 64px; }
@media (max-width: 700px) {
  .tlabel { width: 70px; } .tl-t { font-size: 16px; }
  .ti { width: 56px; height: 56px; } .tpool .ti { width: 52px; height: 52px; }
  .trow, .tzone { min-height: 70px; }
  .tier-title { min-width: 0; width: 100%; }
}

/* ---------- light theme fixes ---------- */
:root[data-theme="light"] { --on-accent: #ffffff; }
:root[data-theme="light"] .tabs a.on, :root[data-theme="light"] .ctrl button.on, :root[data-theme="light"] .play.on,
:root[data-theme="light"] .chip.on, :root[data-theme="light"] .subtabs a.on, :root[data-theme="light"] .fchip.on { color: #fff; }
/* the game's weapon / armour type glyphs are white — darken them on light backgrounds */
:root[data-theme="light"] img[src*="item_type_"] { filter: brightness(0.28) contrast(1.15); }
:root[data-theme="light"] .skico[src*="item_type_"] { background: var(--panel2); }
:root[data-theme="light"] .fchip.on .muted, :root[data-theme="light"] .fchip.on span { color: rgba(255,255,255,.85); }
:root[data-theme="light"] .ph, :root[data-theme="light"] .thumb .ph { color: var(--muted); }
:root[data-theme="light"] .stars, :root[data-theme="light"] .hchip.stars { color: #b07a10; }

/* ---------- timeline ---------- */
.tl-ctl .tq { margin-left: 6px; }
.tl-on { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin-left: 8px; }
.tl-on input { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; color: var(--text); color-scheme: dark; }
:root[data-theme="light"] .tl-on input { color-scheme: light; }
.tl-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; margin: 0 0 12px; color: var(--text2); }
.tl-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.tlwrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); margin-bottom: 16px; }
.tlchart { min-width: 1100px; padding: 0 0 8px; position: relative; }
.tlmonths { position: relative; height: 30px; border-bottom: 1px solid var(--line); background: var(--bg2); position: sticky; top: 0; z-index: 2; }
.tlm { position: absolute; top: 0; height: 30px; line-height: 30px; padding-left: 6px; font-size: 11.5px; font-weight: 600; color: var(--muted); border-left: 1px solid var(--line); }
.tlsec { padding: 6px 0 0; }
.tlsec-h { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; font-weight: 700; color: var(--muted); padding: 4px 10px; }
.tllanes { position: relative; }
.tllanes > i { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); opacity: .6; }
.tllane { position: absolute; left: 0; right: 0; height: 26px; }
.tlbar { position: absolute; top: 0; height: 26px; border-radius: 6px; border: 1px solid color-mix(in srgb, var(--c) 70%, #000); background: color-mix(in srgb, var(--c) 28%, var(--panel)); color: var(--text);
  display: flex; align-items: center; gap: 4px; padding: 0 5px; overflow: hidden; white-space: nowrap; font-size: 11.5px; cursor: pointer; text-align: left; min-width: 6px; }
.tlbar span { overflow: hidden; text-overflow: ellipsis; }
.tlbar img { width: 20px; height: 20px; border-radius: 4px; object-fit: cover; flex: none; }
.tlbar:hover, .tlbar.sel { background: color-mix(in srgb, var(--c) 55%, var(--panel)); z-index: 3; box-shadow: 0 0 0 2px var(--c); }
.tlbar.approx { border-style: dashed; }
.tlmark { position: absolute; top: -4px; bottom: 0; width: 2px; background: #ff5d6c; z-index: 4; pointer-events: none; }
.tlmark span { position: absolute; top: -2px; left: 4px; font-size: 10px; font-weight: 700; color: #ff5d6c; white-space: nowrap; background: var(--panel); padding: 0 3px; border-radius: 3px; }
.tlmark.on { background: var(--accent); } .tlmark.on span { color: var(--accent); }
.tlmonth-h { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin: 12px 0 6px; }
.tlmonth-h:first-child { margin-top: 0; }
.tllist { display: flex; flex-direction: column; gap: 4px; }
.tlrow { display: grid; grid-template-columns: 12px 200px minmax(0, 1fr) auto; gap: 10px; align-items: center; text-align: left; padding: 6px 10px; border-radius: 9px; background: var(--bg2); border: 1px solid var(--line); cursor: pointer; color: inherit; font: inherit; }
.tlrow:hover { border-color: var(--accent); }
.tlrow b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 13px; }
.tlrow .muted { font-size: 11.5px; white-space: nowrap; }
.tldot { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.tlr-d { font-size: 12px; color: var(--text2); font-variant-numeric: tabular-nums; }
.tl-det h2 { display: flex; align-items: center; gap: 8px; }
@media (max-width: 700px) {
  .tlrow { grid-template-columns: 10px minmax(0, 1fr); }
  .tlrow .tlr-d { grid-column: 2; } .tlrow b { grid-column: 2; } .tlrow .muted { grid-column: 2; white-space: normal; }
  .tl-on { margin-left: 0; }
}

.tlwrap { cursor: grab; }
.tlwrap.dragging, .tlwrap.dragging .tlbar { cursor: grabbing; user-select: none; }
.tlwrap .tlbar { cursor: pointer; }

/* timeline: end-date states */
.tlbar.st-unknown { border-style: dashed; -webkit-mask-image: linear-gradient(to right, #000 60%, rgba(0,0,0,.15)); mask-image: linear-gradient(to right, #000 60%, rgba(0,0,0,.15)); }
.tlbar.st-live { border-style: dashed; border-right-width: 0; -webkit-mask-image: linear-gradient(to right, #000 75%, rgba(0,0,0,.35)); mask-image: linear-gradient(to right, #000 75%, rgba(0,0,0,.35)); }
.tlbar.st-live::after { content: "▶"; position: absolute; right: 3px; font-size: 9px; color: var(--c); }
.tlbar.st-perm { border-style: dotted; -webkit-mask-image: linear-gradient(to right, #000 40%, rgba(0,0,0,.1)); mask-image: linear-gradient(to right, #000 40%, rgba(0,0,0,.1)); }
.tlbar.st-set { border-style: solid; box-shadow: inset 0 -2px 0 var(--c); }
.tl-key { display: inline-flex; align-items: center; gap: 5px; }
.tl-key i { width: 22px; height: 10px; border-radius: 3px; border: 1px dashed var(--muted); }
.tl-key i.k-unknown { background: linear-gradient(to right, var(--muted), transparent); opacity: .7; }
.tl-key i.k-live { background: linear-gradient(to right, var(--accent), transparent); }
.tl-key i.k-perm { border-style: dotted; background: linear-gradient(to right, var(--accent2), transparent); }
.tl-setend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 4px; padding: 8px 10px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); font-size: 12.5px; }
.tl-setend input { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; color: var(--text); color-scheme: dark; }
:root[data-theme="light"] .tl-setend input { color-scheme: light; }

/* ---------- footer + about page ---------- */
.site-foot { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: space-between; align-items: center; max-width: 1600px; margin: 28px auto 0; padding: 16px 20px 26px;
  border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.site-foot a { color: var(--accent); }
body.has-tray .site-foot { padding-bottom: 90px; }
.about { max-width: 880px; }
.about .section p { margin: 0 0 10px; line-height: 1.6; color: var(--text2); }
.about .section p:last-child { margin-bottom: 0; }
.about .lead { font-size: 15px; }
.ab-strong { font-weight: 600; color: var(--text) !important; }
.ab-hero { border-color: rgba(231,179,90,.45); }
.ab-takedown { border-color: rgba(111,179,255,.4); }
.ab-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 7px; color: var(--text2); line-height: 1.55; }
.ab-contacts { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.ab-c { display: inline-flex; gap: 8px; align-items: center; padding: 7px 12px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); color: var(--text); font-size: 13.5px; text-decoration: none; }
a.ab-c:hover { border-color: var(--accent); }
.ab-c b { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .4px; }
.ab-c code { font-size: 13.5px; }
.ab-warn { padding: 9px 12px; border-radius: 10px; border: 1px dashed var(--neg); color: var(--neg); background: rgba(255,143,143,.06); margin: 4px 0 12px; font-size: 13px; }

/* ===== loading placeholders ===== */
.sk { display: block; border-radius: 8px; background: linear-gradient(90deg, var(--panel) 0%, var(--panel2) 40%, var(--panel) 80%); background-size: 300% 100%; animation: sk-shine 1.4s ease-in-out infinite; }
@keyframes sk-shine { 0% { background-position: 100% 0; } 100% { background-position: -50% 0; } }
@media (prefers-reduced-motion: reduce) { .sk, .card .thumb:not(:has(img.ld)), .stage.loading::before { animation: none; } }
.sk-line { height: 12px; margin: 6px 0; } .sk-line.tall { height: 22px; }
.w20 { width: 20%; } .w25 { width: 25%; } .w40 { width: 40%; } .w70 { width: 70%; }
.sk-card { pointer-events: none; } .sk-card .sk-line { margin: 6px auto; }
.sk-thumb { width: 96px; height: 96px; border-radius: 10px; margin: 0 auto 6px; }
.sk-ico { width: 64px; height: 64px; border-radius: 14px; flex: none; }
.sk-col { flex: 1; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.sk-tab { width: 92px; height: 32px; }
.sk-block { height: 220px; border-radius: var(--radius); } .sk-block.tall { height: 560px; } .sk-block.short { height: 120px; }
.card .thumb img { opacity: 0; transition: opacity .25s; }
.card .thumb img.ld { opacity: 1; }
.card .thumb:not(:has(img.ld)):has(img) { background: linear-gradient(90deg, var(--bg2) 0%, var(--panel2) 40%, var(--bg2) 80%); background-size: 300% 100%; animation: sk-shine 1.4s ease-in-out infinite; }
.stage.loading::before { content: ""; position: absolute; inset: 18% 30%; border-radius: 50%; background: radial-gradient(closest-side, var(--panel2), transparent); animation: sk-pulse 1.4s ease-in-out infinite; }
@keyframes sk-pulse { 50% { opacity: .35; } }
.lazy-sentinel { grid-column: 1 / -1; height: 1px; }
.fuzzy-note { margin: 0 0 12px; padding: 8px 12px; border-radius: 8px; background: var(--panel2); color: var(--text2); font-size: 13px; border-left: 3px solid var(--accent); }

/* ===== viewer: timeline bar, fullscreen ===== */
.stage-col { display: flex; flex-direction: column; min-width: 0; }
.vbar { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-top: 1px solid var(--line); background: var(--bg2); }
.vb { flex: none; min-width: 30px; height: 28px; padding: 0 7px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; font-size: 12px; line-height: 1; }
.vb:hover { border-color: var(--accent); }
.vb.on { background: var(--accent); color: var(--on-accent, #1a1306); border-color: var(--accent); }
.vtl { flex: 1; min-width: 60px; accent-color: var(--accent); }
.vtl.ranged { background: linear-gradient(90deg, transparent var(--a), color-mix(in srgb, var(--accent) 35%, transparent) var(--a), color-mix(in srgb, var(--accent) 35%, transparent) var(--b), transparent var(--b)); border-radius: 6px; }
.vtt { flex: none; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 92px; text-align: right; }
.stage-wrap:fullscreen { background: var(--bg); height: 100vh; min-height: 0; }
.stage-wrap:fullscreen .stage, .stage-wrap.pseudo-fs .stage { height: auto; flex: 1; }
.stage-wrap:fullscreen .ctrl { overflow: auto; }
.stage-wrap.pseudo-fs { position: fixed; inset: 0; z-index: 1000; background: var(--bg); height: 100dvh; grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
.stage-wrap.pseudo-fs .ctrl { max-height: 38dvh; overflow: auto; }
.ctrl .row select { flex: 1; width: auto; min-width: 0; }
.ctrl button:disabled { opacity: .6; cursor: progress; }
@media (max-width: 560px) { .vtt { min-width: 0; font-size: 11px; } .vb { min-width: 26px; padding: 0 5px; } }

/* mini viewer (skill preview): canvas + timeline bar only */
.section.mini .stage-wrap { grid-template-columns: 1fr; min-height: 0; }
.section.mini .ctrl { display: none; }
.section.mini .stage { height: 340px; }
.section.mini .vab, .section.mini .vlp { display: none; }
.skwrap { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 16px; align-items: start; }
.skwrap-prev { position: sticky; top: 118px; }
@media (max-width: 980px) { .skwrap { grid-template-columns: 1fr; } .skwrap-prev { position: static; } }
.skprev { margin-left: auto; flex: none; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); cursor: pointer; font-size: 12.5px; font-weight: 600; }
.skprev:hover:not(:disabled) { border-color: var(--accent); }
.skprev.on { background: var(--accent); color: var(--on-accent, #1a1306); border-color: var(--accent); }
.skprev:disabled { color: var(--muted); cursor: default; font-weight: 400; }

/* ===== what's new ===== */
.wn-b { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.wn-b:last-child { border-bottom: 0; }
.wn-d { font-weight: 600; color: var(--accent); }
.wn-g + .wn-g { margin-top: 10px; }
.wn-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.wn-e { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px 4px 4px; border-radius: 9px; background: var(--panel2); border: 1px solid var(--line); color: var(--text); font-size: 13px; cursor: pointer; }
.wn-e:hover { border-color: var(--accent); }
.wn-e .sr-ico { width: 28px; height: 28px; }
.wn-s { padding: 10px 0; border-bottom: 1px solid var(--line); }
.wn-s:last-child { border-bottom: 0; }
.wn-st { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; color: var(--text); }
.wn-st:hover b { color: var(--accent); }
@media (max-width: 640px) { .wn-b { grid-template-columns: 1fr; gap: 6px; } }
.ctrl .row select.exs { flex: 0 0 58px; }
.ctrl .row select.exf { flex: 1 1 auto; }
@media (max-width: 560px) { .vbar { flex-wrap: wrap; row-gap: 6px; } .vtl { order: -1; flex: 1 0 100%; } .vtt { margin-left: auto; } }

/* ===== volume ===== */
@media (max-width: 860px) { .top { position: relative; } }
.vol-btn { position: relative; }
.vol-btn.muted { border-color: var(--neg); }
#volpop { position: absolute; z-index: 60; top: calc(100% - 4px); right: 16px; width: 290px; padding: 12px 14px; border-radius: 12px; background: var(--glass); border: 1px solid var(--line); box-shadow: 0 14px 40px var(--shadow); display: flex; flex-direction: column; gap: 10px; }
#volpop[hidden] { display: none; }
.vp-h { display: flex; align-items: center; justify-content: space-between; }
.vp-h .fchip.on { background: var(--neg); border-color: var(--neg); color: #fff; }
.vrow { display: grid; grid-template-columns: 96px minmax(0, 1fr) 40px; align-items: center; gap: 8px; font-size: 13px; color: var(--text2); }
.vrow.master span { font-weight: 600; color: var(--text); }
.vrow input, .volctl input { width: 100%; accent-color: var(--accent); }
.vrow .vol-v, .volctl .vol-v { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; font-weight: 500; }
.vrow.off input, .volctl.off input { accent-color: var(--muted); opacity: .7; }
.vp-tip { font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.volctl { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; background: var(--bg2); border: 1px solid var(--line); font-size: 13px; cursor: default; }
.volctl input { width: 110px; }
.volctl .vol-v { min-width: 34px; }
#miniplayer .volctl { padding: 2px 8px; margin: 0 2px; }
#miniplayer .volctl input { width: 80px; }
.skvol { padding: 8px 10px; border-top: 1px solid var(--line); background: var(--bg2); }
.skvol .volctl { display: flex; } .skvol .volctl input { flex: 1; width: auto; }
.vid-vol { margin-bottom: 12px; }
@media (max-width: 560px) { #volpop { left: 8px; right: 8px; width: auto; } .volctl input { width: 90px; } #miniplayer .volctl input { width: 56px; } }

/* ===== rewards / costs chips ===== */
.thing { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 3px; border-radius: 8px; background: var(--panel2); border: 1px solid var(--line); color: var(--text); font-size: 12.5px; }
a.thing:hover { border-color: var(--accent); }
.thing .cico { width: 24px; height: 24px; border-radius: 6px; object-fit: contain; flex: none; }
.thing .cico.ph { display: grid; place-items: center; background: var(--bg2); color: var(--muted); font-size: 11px; }
.thing b { color: var(--accent); font-weight: 600; }
.thing i { font-style: normal; font-size: 11px; color: var(--muted); }
.things { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }

/* ===== where to get ===== */
.src-list { display: flex; flex-direction: column; gap: 8px; }
.src { padding: 8px 10px; border-radius: 9px; background: var(--bg2); border: 1px solid var(--line); }
.src-h { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.src-m { font-size: 12.5px; margin-top: 4px; }

/* ===== quests ===== */
.qarea + .qarea { margin-top: 12px; }
.qdun { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.qdun a { padding: 5px 10px; border-radius: 8px; background: var(--panel2); border: 1px solid var(--line); color: var(--text); font-size: 13px; }
.qdun a:hover { border-color: var(--accent); }
.qres { display: flex; flex-direction: column; gap: 4px; max-height: 520px; overflow: auto; }
.qr { display: flex; gap: 10px; align-items: baseline; padding: 6px 8px; border-radius: 8px; color: var(--text); }
.qr:hover { background: var(--panel2); }
.qcard.focus { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.qcard h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.tbadge { margin-left: auto; }
.qmis { display: flex; flex-direction: column; gap: 4px; margin: 4px 0 10px; }
.qm { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 8px; border-radius: 8px; background: var(--bg2); font-size: 13px; }
.qm .thing { flex: none; }

/* ===== guide ===== */
.ggrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.gcard { padding: 12px 14px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.gcard-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.gcard p { margin: 4px 0 8px; color: var(--text2); font-size: 13.5px; line-height: 1.45; }
.gcard .ulink { display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
.trait-pool { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.title-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.ttl { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--line); font-size: 13px; }
.ttl b { font-size: 14px; }
.ttl.tier-2 { border-left-color: #8fb3d9; } .ttl.tier-3 { border-left-color: var(--accent); } .ttl.tier-4 { border-left-color: #c084fc; } .ttl.tier-5 { border-left-color: #f472b6; }

/* ===== banner details ===== */
.gslots { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; margin-top: 6px; }
.gslot { padding: 10px 12px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); }
.gslot-h { font-weight: 600; margin-bottom: 8px; }
.gfeat { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.gf { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gf b { color: var(--accent); font-variant-numeric: tabular-nums; }
.gpools { display: flex; flex-wrap: wrap; gap: 6px; }
.gdraws td { vertical-align: top; }
.gdraws .things { margin: 0; }
.brand-logo { width: 26px; height: 26px; flex: none; display: block; filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); }

/* ===== header menu: groups (desktop) + drawer (phones) ===== */
.menu-btn { display: none; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; width: 38px; height: 38px; font-size: 18px; cursor: pointer; flex: none; color: var(--text); }
.nav-home { display: none; }
.ngroup { position: relative; display: flex; }
.ngroup-b { padding: 7px 14px; border-radius: 999px; color: var(--muted); font-weight: 500; background: none; border: 0; cursor: pointer; font: inherit; }
.ngroup-b::after { content: " \25BE"; font-size: 10px; opacity: .8; }
.ngroup-b:hover, .ngroup.open .ngroup-b { color: var(--text); background: var(--panel); }
.ngroup.on .ngroup-b { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.ngroup-m { display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 50; min-width: 190px; padding: 6px; border-radius: 12px; background: var(--glass); border: 1px solid var(--line); box-shadow: 0 14px 40px var(--shadow); flex-direction: column; gap: 2px; }
.ngroup.open .ngroup-m { display: flex; }
.ngroup-m a { padding: 8px 12px; border-radius: 8px; color: var(--text2); white-space: nowrap; }
.ngroup-m a:hover { background: var(--panel2); color: var(--text); }
.ngroup-m a.on { background: var(--accent); color: var(--on-accent, #1a1306); }
body.no-scroll { overflow: hidden; }
@media (max-width: 860px) {
  .menu-btn { display: grid; place-items: center; }
  .top { gap: 10px; }
  .brand { margin-right: auto; }
  .tabs { display: none; }
  .top.menu-open .tabs { display: flex; position: fixed; left: 0; right: 0; top: var(--hdr-h, 62px); bottom: 0; z-index: 60; flex-direction: column; flex-wrap: nowrap; gap: 2px;
    overflow-y: auto; padding: 12px 16px 40px; background: var(--bg); border-top: 1px solid var(--line); width: auto; }
  .top.menu-open .tabs > a, .top.menu-open .ngroup-m a { padding: 11px 14px; border-radius: 10px; font-size: 15px; }
  .top.menu-open .nav-home { display: block; }
  .top.menu-open .ngroup { flex-direction: column; margin-top: 10px; }
  .top.menu-open .ngroup-b { padding: 4px 14px; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; cursor: default; background: none; box-shadow: none; text-align: left; }
  .top.menu-open .ngroup-b::after { content: ""; }
  .top.menu-open .ngroup-m { display: flex; position: static; box-shadow: none; border: 0; background: none; padding: 0; min-width: 0; }
  .search-wrap { order: 5; }
}

/* ===== collection ===== */
.card.owned { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--pos) 70%, transparent); }
.card.owned::after { content: "\2713"; position: absolute; top: 6px; left: 6px; width: 20px; height: 20px; border-radius: 50%; background: var(--pos); color: #0e1016; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.cgrid .card:not(.owned) { opacity: .62; }
.cgrid .card:not(.owned):hover { opacity: 1; }
.cgrid.editing .card { cursor: copy; }
.ownbtn.on { background: color-mix(in srgb, var(--pos) 22%, var(--panel)); border-color: var(--pos); color: var(--text); }
.cbar { height: 8px; border-radius: 999px; background: var(--panel2); overflow: hidden; flex: 1; min-width: 60px; }
.cbar span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--pos)); border-radius: 999px; }
.cbar.big { height: 12px; margin-top: 8px; }
.cstat { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(0, 2fr); gap: 18px; padding: 14px 16px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); margin-bottom: 12px; }
.cstat-main b { font-size: 34px; font-weight: 700; }
.cstat-main span { color: var(--muted); margin-left: 8px; }
.cgroups { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 16px; align-content: center; }
.cg { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.cg > span { min-width: 74px; display: inline-flex; align-items: center; gap: 4px; }
.cg b { font-variant-numeric: tabular-nums; min-width: 52px; text-align: right; font-weight: 500; color: var(--text2); }
.cio { margin-left: auto; display: inline-flex; gap: 6px; flex-wrap: wrap; }
.cio label.fchip { cursor: pointer; }
.cnote { margin: 4px 0 12px; font-size: 13px; }
@media (max-width: 760px) { .cstat { grid-template-columns: 1fr; } .cio { margin-left: 0; } }

/* ===== home ===== */
.hero { display: flex; gap: 22px; align-items: center; padding: 26px 24px; border-radius: 18px; margin-bottom: 14px;
  background: radial-gradient(ellipse at 12% 50%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%), var(--panel); border: 1px solid var(--line); }
.hero-logo { width: 84px; height: 84px; flex: none; filter: drop-shadow(0 6px 16px rgba(0,0,0,.4)); }
.hero-t { flex: 1; min-width: 0; }
.hero h1 { font-family: Cinzel, serif; font-size: 34px; margin: 0 0 6px; letter-spacing: .5px; }
.hero p { margin: 0 0 14px; color: var(--text2); max-width: 720px; line-height: 1.5; }
.hero-search { display: flex; gap: 8px; flex-wrap: wrap; max-width: 720px; }
.hero-search input { flex: 1; min-width: 200px; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); font: inherit; }
.hero-search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.hstats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 14px; }
.hstat { display: flex; flex-direction: column; padding: 12px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); color: var(--text); }
.hstat:hover { border-color: var(--accent); }
.hstat b { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.hstat span { color: var(--muted); font-size: 13px; }
#hq { display: contents; }
.hcoll { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: center; padding: 12px 16px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); color: var(--text); margin-bottom: 14px; }
.hcoll .cbar { grid-column: 1 / -1; }
.hcoll:hover { border-color: var(--pos); }
.hlive { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hl { display: flex; gap: 10px; align-items: center; padding: 7px 4px; border-bottom: 1px solid var(--line); color: var(--text); }
.hl:last-child { border-bottom: 0; }
.hl:hover b { color: var(--accent); }
.hl img, .hl-i { width: 36px; height: 36px; border-radius: 8px; flex: none; object-fit: cover; background: var(--bg2); display: grid; place-items: center; color: var(--muted); }
.hl-t { display: flex; flex-direction: column; min-width: 0; }
.hl-t b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hl-t small { color: var(--muted); }
.hsec { font-size: 18px; margin: 22px 0 10px; }
.hgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.hcard { display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto; gap: 2px 12px; padding: 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); color: var(--text); }
.hcard:hover { border-color: var(--accent); }
.hcard-i { grid-row: 1 / 3; width: 40px; height: 40px; border-radius: 10px; background: var(--panel2); display: grid; place-items: center; font-size: 20px; }
.hcard > span:last-child { color: var(--muted); font-size: 13px; line-height: 1.4; }
@media (max-width: 760px) { .hero { flex-direction: column; text-align: center; padding: 20px 16px; } .hero h1 { font-size: 27px; } .hero-search { justify-content: center; } .hlive { grid-template-columns: 1fr; } }

/* ===== not found ===== */
.nf { max-width: 560px; margin: 50px auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.nf h1 { margin: 6px 0 0; font-size: 30px; }
.nf-search { width: 100%; justify-content: center; margin-top: 6px; }
.nf-links { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
#datadate { font-size: 12.5px; }
@media (max-width: 560px) { .top { padding: 10px 12px; gap: 8px; } .brand { font-size: 15px; gap: 6px; } .brand-logo { width: 22px; height: 22px; } .top .theme-btn { width: 32px; height: 32px; } .menu-btn { width: 34px; height: 34px; } }
@media (max-width: 860px) { .top.menu-open { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); } }
@media (max-width: 860px) { .top.menu-open .tabs > a:not(.on), .top.menu-open .ngroup-m a:not(.on) { color: var(--text2); } }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 90; max-width: min(560px, calc(100vw - 24px)); padding: 10px 14px; border-radius: 12px; background: var(--glass); border: 1px solid var(--line); box-shadow: 0 10px 30px var(--shadow); font-size: 13.5px; }

/* ===== accessibility ===== */
.skip { position: absolute; left: 12px; top: -60px; z-index: 200; padding: 8px 14px; border-radius: 10px; background: var(--accent); color: #1a1306; font-weight: 600; }
.skip:focus { top: 10px; }
#app:focus { outline: none; }
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }
.linkbtn:hover { text-decoration: underline; }
.foot-links { display: inline-flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; justify-content: center; }
/* calm motion: a chosen "start paused" (or the device's reduce-motion setting) also stops decorative movement */
html.calm *, html.calm *::before, html.calm *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; scroll-behavior: auto !important; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ===== data saver gate on animation stages ===== */
.vgate { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 0; cursor: pointer; color: var(--text);
  background: color-mix(in srgb, var(--bg) 55%, transparent); font: inherit; }
.vgate b { font-size: 16px; padding: 10px 18px; border-radius: 999px; background: var(--accent); color: #1a1306; }
.vgate small { color: var(--text2); max-width: 300px; text-align: center; }
.vgate:hover b { filter: brightness(1.08); }

/* ===== settings ===== */
.settings { display: grid; gap: 12px; max-width: 880px; }
.setrow { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); }
.setrow:last-child { border-bottom: 0; }
.setrow.btns { gap: 8px; }
.setl { min-width: 200px; flex: 0 1 260px; display: flex; flex-direction: column; gap: 2px; font-weight: 500; }
.setl small { font-weight: 400; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.settings .vrow { display: flex; align-items: center; gap: 12px; padding: 6px 0; max-width: 520px; }
.settings .vrow span { min-width: 120px; }
.settings .vrow input { flex: 1; }
.setsum { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.setsum span { padding: 6px 10px; border-radius: 10px; background: var(--panel2); font-size: 13px; color: var(--text2); }
.setsum b { color: var(--text); }
.fchip.danger { border-color: color-mix(in srgb, var(--neg) 60%, var(--line)); color: var(--neg); }
.fchip.danger:hover { background: color-mix(in srgb, var(--neg) 14%, var(--panel)); }
.muted.small { font-size: 12.5px; }

/* ===== report dialog ===== */
dialog.report { border: 1px solid var(--line); border-radius: 16px; padding: 0; background: var(--bg2, var(--panel)); color: var(--text); width: min(560px, calc(100vw - 32px)); box-shadow: 0 20px 60px var(--shadow); }
dialog.report::backdrop { background: rgba(0,0,0,.55); }
.rp-in { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; }
.rp-in h2 { margin: 0; font-size: 20px; }
.rp-in p { margin: 0; }
.rp-l { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.rp-l input, .rp-l textarea { font: inherit; font-size: 14px; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; resize: vertical; }
.rp-how { font-size: 13px; color: var(--text2); }
.rp-b { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.rp-b .fchip { font-size: 13.5px; padding: 6px 14px; }
.reportbtn.cmpbtn { min-width: 0; }

/* ===== site updates / shared team ===== */
.upd ul { margin: 4px 0 0; padding-left: 20px; line-height: 1.6; }
.note { padding: 10px 14px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent) 10%, var(--panel)); margin-bottom: 12px; font-size: 14px; }

/* credit for the site's own engine: on every player, on Home and on About */
.stage-credit { position: absolute; left: 10px; bottom: 8px; z-index: 2; padding: 3px 8px; border-radius: 999px; font-size: 11px; letter-spacing: .02em;
  color: rgba(255,255,255,.82); background: rgba(10,12,18,.55); border: 1px solid rgba(255,255,255,.14); text-decoration: none; pointer-events: auto;
  backdrop-filter: blur(3px); opacity: .8; transition: opacity .15s; user-select: none; }
.stage-credit:hover { opacity: 1; color: #fff; }
.hengine { display: flex; gap: 12px; align-items: flex-start; margin: 4px 0 18px; padding: 12px 16px; border-radius: 12px; text-decoration: none;
  color: var(--text2); background: var(--panel, rgba(255,255,255,.03)); border: 1px solid rgba(231,179,90,.45); line-height: 1.55; font-size: 13.5px; }
.hengine b { color: var(--text); }
.hengine:hover { border-color: rgba(231,179,90,.8); }
.hengine-i { color: #e7b35a; font-size: 18px; line-height: 1.2; }
.ab-engine { border-color: rgba(231,179,90,.45); }
#codenote a { color: var(--accent); }

/* ---------- phones: compact unit / ark / monster page header, so the art shows sooner ---------- */
@media (max-width: 600px) {
  .detail-head { gap: 8px 12px; margin-bottom: 10px; }
  /* row 1: icon + name (full width); row 2: back link + action buttons */
  .detail-head img.icon { width: 52px; height: 52px; }
  .detail-head > div:not(.nav) { flex: 1 1 calc(100% - 64px); min-width: 0; }
  .detail-head .back { order: 2; flex: none; padding: 5px 10px; font-size: 13px; }
  .detail-head h1 { font-size: 21px; overflow-wrap: anywhere; }
  /* action buttons: one row that scrolls sideways instead of wrapping onto two or three */
  .detail-head .nav { order: 3; flex: 1 1 0; min-width: 0; margin-left: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .detail-head .nav::-webkit-scrollbar { display: none; }
  .detail-head .nav > * { flex: none; white-space: nowrap; }
  .detail-head .nav a, .detail-head .nav .cmpbtn, .detail-head .nav .ownbtn { padding: 5px 10px; font-size: 13px; }
  /* page tabs: one sideways-scrolling row */
  .dtabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 6px 0 8px; }
  .dtabs::-webkit-scrollbar { display: none; }
  .dtabs a { flex: none; white-space: nowrap; padding: 6px 12px; }
}
