:root {
  --bg: #f6f7f8;
  --panel: #ffffff;
  --panel-2: #f2f3f5;
  --text: #1c1e22;
  --muted: #6f757e;
  --line: #e4e6ea;
  --accent: #2f5fe0;
  --accent-strong: #2449b8;
  --accent-ink: #ffffff;
  --link: #2f5fe0;
  --gold: #a07d00;
  --shadow: 0 1px 2px rgba(20, 24, 34, .05);
  --radius: 12px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131417;
    --panel: #1b1d21;
    --panel-2: #24262b;
    --text: #e7e9ec;
    --muted: #999fa9;
    --line: #2b2e34;
    --accent: #7fa3f7;
    --accent-strong: #a7c0fa;
    --accent-ink: #10131c;
    --link: #8ab0ff;
    --gold: #d3b04a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "BIZ UDPGothic", "Yu Gothic UI", Meiryo, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 15px;
}
body.gacha-mode { height: 100dvh; overflow: hidden; overscroll-behavior: none; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }
input, select, button, textarea { font-family: inherit; font-size: 16px; }

svg.ic { width: 1.1em; height: 1.1em; fill: currentColor; vertical-align: -0.18em; flex: none; }

/* ============ lock screen ============ */
.lock {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
}
.lock-box {
  text-align: center; padding: 40px 30px; max-width: 400px; width: 92%;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow);
}
.lock-box h1 { margin: 0 0 18px; font-size: 24px; letter-spacing: .02em; }
.lock-q { font-size: 15px; font-weight: 600; margin: 0 0 16px; line-height: 1.7; }
.lock-box input {
  width: 100%; padding: 12px 14px; text-align: center;
  border: 1.5px solid var(--line); border-radius: 10px;
  background: var(--panel-2); color: var(--text); margin-bottom: 12px;
  transition: border-color .15s;
}
.lock-box input:focus { outline: none; border-color: var(--accent); }
.lock-box button {
  width: 100%; padding: 12px; border: 0; border-radius: 10px;
  background: var(--accent); color: var(--accent-ink); cursor: pointer;
  font-weight: 700; letter-spacing: .05em;
  transition: background .15s, opacity .15s;
}
.lock-box button:hover { background: var(--accent-strong); }
.lock-box button:disabled { opacity: .55; cursor: progress; }
.lock-msg { min-height: 1.4em; color: #d43a3a; font-size: 13px; margin: 10px 0 0; }

/* ============ layout ============ */
header {
  position: sticky; top: 0; z-index: 50;
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.nav {
  max-width: 1040px; margin: 0 auto; padding: 11px 16px;
  display: flex; align-items: center; gap: 16px;
}
.brand {
  font-weight: 900; font-size: 18px; color: var(--text);
  letter-spacing: .02em; display: inline-flex; align-items: center; gap: 8px;
}
.brand svg.ic { color: var(--accent); width: 1.25em; height: 1.25em; }
.brand:hover { text-decoration: none; }
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a {
  padding: 6px 13px; border-radius: 8px; color: var(--muted);
  font-weight: 600; font-size: 14px;
}
.nav-links a:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
.nav-links a.active { color: var(--accent); background: var(--panel-2); }

main { max-width: 1040px; margin: 0 auto; padding: 20px 16px 56px; }
body.gacha-mode main {
  width: 100%; max-width: none; height: calc(100dvh - var(--ndx-header-height, 58px));
  margin: 0; padding: 0; overflow: hidden;
}
body.gacha-mode footer { display: none; }
footer {
  max-width: 1040px; margin: 0 auto; padding: 16px;
  color: var(--muted); font-size: 12.5px;
  display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between;
  border-top: 1px solid var(--line);
}
footer a { color: var(--muted); }

.loading { text-align: center; color: var(--muted); padding: 70px 0; }
.error-box {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; text-align: center; color: var(--muted);
}
.error-box button {
  margin-top: 12px; padding: 9px 22px; border: 0; border-radius: 9px;
  background: var(--accent); color: var(--accent-ink); cursor: pointer; font-weight: 600;
}

/* ============ common ============ */
h2.page-title { font-size: 20px; margin: 4px 2px 14px; }
.count-note { color: var(--muted); font-size: 13px; margin: 10px 4px; }
.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: var(--panel-2); color: var(--muted);
  white-space: nowrap;
}
.badge.gold { color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, var(--panel)); }
.win-ic { color: var(--gold); }
.dexno {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: 12px; color: var(--muted); white-space: nowrap; letter-spacing: .02em;
}

/* ============ toolbar ============ */
.toolbar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 13px; margin-bottom: 12px;
}
.toolbar input[type="search"], .toolbar input[type="text"] {
  flex: 1 1 230px; padding: 9px 12px;
  border: 1.5px solid var(--line); border-radius: 9px;
  background: var(--panel-2); color: var(--text);
  transition: border-color .15s;
}
.toolbar input:focus, .toolbar select:focus { outline: none; border-color: var(--accent); }
.toolbar select {
  padding: 9px 8px; font-size: 14px;
  border: 1.5px solid var(--line); border-radius: 9px;
  background: var(--panel-2); color: var(--text); max-width: 100%;
}
.toolbar label.chk {
  font-size: 13.5px; display: inline-flex; align-items: center; gap: 5px;
  color: var(--muted); white-space: nowrap; cursor: pointer;
}
.toolbar label.chk input { accent-color: var(--accent); width: 16px; height: 16px; }
.toolbar .sep { flex-basis: 100%; height: 0; }

.dex-range {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 6px; align-items: center; min-width: 0;
}
.dex-range-label, .dex-range-sep {
  color: var(--muted); font-family: var(--mono); white-space: nowrap;
}
.dex-range input.dex-range-input {
  width: 100%; min-width: 0; font-family: var(--mono); text-align: center;
}
.toolbar .dex-range { flex: 0 1 360px; }
.toolbar .dex-range input[type="text"] { flex: none; }

/* ============ list rows ============ */
.rows { display: flex; flex-direction: column; overflow: hidden; }
.row, .row-n {
  border-top: 1px solid var(--line);
  color: var(--text); display: block;
}
.row:first-child, .row-n:first-child { border-top: 0; }
a.row:hover, .row-n:hover { background: var(--panel-2); text-decoration: none; }

.row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 16px; }
.row .tno { color: var(--muted); font-size: 12.5px; min-width: 44px; padding-top: 3px; font-family: var(--mono); }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 650; word-break: break-word; line-height: 1.55; }
.row .sub { color: var(--muted); font-size: 12px; word-break: break-word; margin-top: 1px; }
.row .side { color: var(--muted); font-size: 12.5px; white-space: nowrap; padding-top: 3px; }

.row-n {
  display: flex; align-items: stretch; min-height: 40px;
}
.row-n-main {
  display: flex; gap: 10px; align-items: center; min-width: 0; flex: 1;
  padding: 5px 4px 5px 16px; color: var(--text);
}
.row-n-main:hover { text-decoration: none; }
.row-n .title { font-weight: 650; word-break: break-word; line-height: 1.5; flex: 1; min-width: 0; }
.row-n .t-tag {
  align-self: flex-end; flex: 0 1 auto; max-width: 42%;
  text-align: right; color: var(--muted); font-size: 11px; line-height: 1.9;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.name-multi {
  display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; white-space: pre-line; word-break: break-word;
}
.fav-btn {
  flex: none; width: 34px; min-width: 34px; height: 34px; padding: 0;
  display: grid; place-items: center; align-self: center;
  border: 0; border-radius: 50%; background: transparent; color: var(--muted);
  font-size: 23px; line-height: 1; cursor: pointer; touch-action: manipulation;
  transition: color .12s, background .12s, transform .08s;
}
.fav-btn:hover { color: var(--gold); background: color-mix(in srgb, var(--gold) 10%, transparent); }
.fav-btn:active { transform: scale(.88); }
.fav-btn.active { color: var(--gold); }
.fav-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.row-fav { margin: 3px 7px 3px 0; }
.fav-only { color: var(--gold) !important; }
.empty-note { padding: 34px 16px; text-align: center; color: var(--muted); font-size: 14px; }

/* ============ pagination ============ */
.pager-nav {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center;
  margin: 14px 0;
}
.pager-nav button.pg {
  min-width: 36px; padding: 7px 10px; font-size: 13.5px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); color: var(--text); cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.pager-nav button.pg:hover { border-color: var(--accent); color: var(--accent); }
.pager-nav button.pg.cur {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700;
}
.pager-nav button.pg:disabled { opacity: .4; cursor: default; }
.pager-nav button.pg:disabled:hover { border-color: var(--line); color: var(--text); }
.pager-nav .ell { color: var(--muted); padding: 0 2px; }
.pager-jump { display: inline-flex; gap: 6px; align-items: center; margin-left: 10px; color: var(--muted); font-size: 12.5px; }
.pager-jump input {
  width: 74px; padding: 6px 8px; font-size: 14px; text-align: center;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel-2); color: var(--text); font-family: var(--mono);
}
.pager-jump button {
  padding: 6px 12px; font-size: 13px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); color: var(--text); cursor: pointer;
}
.pager-jump button:hover { border-color: var(--accent); color: var(--accent); }

/* ============ back to top ============ */
.back-top {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(18px, calc(env(safe-area-inset-bottom) + 12px));
  z-index: 45; width: 48px; height: 48px; padding: 0;
  display: grid; place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 75%, var(--line));
  border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 5px 18px rgba(20, 24, 34, .22);
  cursor: pointer; opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(8px) scale(.94);
  transition: opacity .16s, visibility .16s, transform .16s, background .15s;
}
.back-top.visible {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translateY(0) scale(1);
}
.back-top svg.ic { width: 24px; height: 24px; }
.back-top:hover { background: var(--accent-strong); }
.back-top:focus-visible { outline: 3px solid var(--accent-strong); outline-offset: 3px; }

/* ============ name detail ============ */
.dex-head { padding: 24px; margin-bottom: 12px; }
.dex-head-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dex-head .dexline {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  color: var(--muted); font-weight: 600; font-size: 15px; letter-spacing: .03em;
}
.detail-fav { width: 40px; min-width: 40px; height: 40px; font-size: 28px; }
.dex-head h2 {
  margin: 6px 0 0; font-size: clamp(20px, 4vw, 26px); line-height: 1.55;
  white-space: pre-wrap; word-break: break-word;
}
.detail-block { padding: 18px 24px; margin-bottom: 12px; }
.detail-block .attr-k {
  color: var(--muted); font-size: 12.5px; font-weight: 700; letter-spacing: .04em;
  margin: 14px 0 2px;
}
.detail-block .attr-k:first-child { margin-top: 0; }
.detail-block .attr-v {
  font-size: 15px; white-space: pre-wrap; word-break: break-word; line-height: 1.7;
}
.entry-tourn {
  padding: 12px 24px; margin-bottom: 12px; font-size: 12.5px; color: var(--muted);
  background: transparent;
}
.entry-tourn a { font-weight: 600; font-size: 13px; }
.entry-tourn .sub { margin-top: 1px; font-size: 12px; }
.dex-pager { display: flex; justify-content: space-between; margin-top: 16px; gap: 8px; }
.dex-pager a {
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--panel); font-size: 13px; font-family: var(--mono); color: var(--text);
  display: inline-flex; align-items: center; gap: 4px;
}
.dex-pager a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ============ tournament detail ============ */
.detail-head { padding: 20px 24px; margin-bottom: 12px; }
.detail-head .overline { color: var(--muted); font-size: 12.5px; font-family: var(--mono); }
.detail-head h2 {
  margin: 4px 0 6px; font-size: clamp(19px, 3.4vw, 23px); line-height: 1.5;
  white-space: pre-wrap; word-break: break-word;
}
.detail-head .badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; }
.kv { display: grid; grid-template-columns: 7.5em 1fr; gap: 5px 14px; margin: 12px 0 0; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; white-space: pre-wrap; }
.links-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.links-row a {
  padding: 7px 14px; border: 1px solid var(--line); border-radius: 9px;
  font-size: 13.5px; background: var(--panel); font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
}
.links-row a:hover { border-color: var(--accent); text-decoration: none; }
.section-title { font-size: 14px; font-weight: 700; margin: 20px 6px 8px; color: var(--muted); }
.winner-box { padding: 14px 24px; margin-bottom: 12px; }
.winner-box .overline {
  color: var(--gold); font-size: 12.5px; font-weight: 700; letter-spacing: .04em;
  display: inline-flex; align-items: center; gap: 5px;
}
.winner-box .w-name { font-weight: 700; font-size: 15.5px; margin-top: 5px; white-space: pre-wrap; word-break: break-word; }
.pager { display: flex; justify-content: space-between; margin-top: 16px; gap: 8px; }
.pager a {
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--panel); font-size: 13px; max-width: 48%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text);
}
.pager a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ============ home ============ */
.search-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 20px 0 12px; }
.search-card { padding: 18px; }
.search-card h3 {
  margin: 0 0 12px; font-size: 15px; display: flex; align-items: center; gap: 7px;
}
.search-card h3 svg.ic { color: var(--accent); }
.search-card form { display: flex; flex-direction: column; gap: 9px; }
.search-card .frow { display: flex; gap: 8px; }
.search-card input {
  width: 100%; padding: 10px 13px;
  border: 1.5px solid var(--line); border-radius: 9px;
  background: var(--panel-2); color: var(--text);
  transition: border-color .15s; min-width: 0;
}
.search-card input:focus { outline: none; border-color: var(--accent); }
.search-card button {
  padding: 10px 20px; border: 0; border-radius: 9px;
  background: var(--accent); color: var(--accent-ink); cursor: pointer; font-weight: 700;
  white-space: nowrap; transition: background .15s;
}
.search-card button:hover { background: var(--accent-strong); }
.search-card .hint { color: var(--muted); font-size: 12px; margin: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat { padding: 15px 12px; text-align: center; }
.stat .v { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.home-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.home-cols .panel { padding: 4px 0 6px; }
.home-cols h3 {
  font-size: 13.5px; margin: 12px 16px 6px; color: var(--muted); font-weight: 700;
  display: flex; align-items: center; gap: 6px;
}

/* ============ gacha ============ */
.gacha-shell {
  height: 100%; min-height: 0; padding: 8px max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  display: grid; grid-template-rows: 34px minmax(0, 1fr) 58px; gap: 8px;
  background:
    radial-gradient(circle at 10% 10%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 34%),
    var(--bg);
}
.gacha-tools {
  display: flex; justify-content: flex-end; align-items: center; gap: 6px;
}
.gacha-tools select {
  height: 32px; max-width: 120px; padding: 3px 26px 3px 9px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); color: var(--muted); font-size: 12.5px; font-weight: 650;
}
.gacha-grid {
  min-height: 0; display: grid;
  grid-template-columns: repeat(var(--gacha-cols, 4), minmax(0, 1fr));
  grid-template-rows: repeat(var(--gacha-rows, 3), minmax(0, 1fr));
  gap: 7px; overflow: hidden;
}
.gacha-item {
  position: relative; min-width: 0; min-height: 0; overflow: hidden;
  border: 1px solid var(--line); border-radius: 11px;
  background: var(--panel); box-shadow: var(--shadow);
}
.gacha-item-link {
  position: absolute; inset: 0; min-width: 0; min-height: 0;
  display: block; color: var(--text); border-radius: inherit;
}
.gacha-item-link:hover { text-decoration: none; }
.gacha-item:hover { border-color: color-mix(in srgb, var(--accent) 52%, var(--line)); }
.gacha-item-link:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.gacha-dex {
  position: absolute; top: 5px; left: 8px; z-index: 1;
  color: var(--muted); font-family: var(--mono); font-size: var(--gacha-meta-size, 9px);
  font-variant-numeric: tabular-nums; line-height: 1.2; letter-spacing: .02em;
}
.gacha-fav {
  position: absolute; top: 1px; right: 2px; z-index: 2;
  width: var(--gacha-star-box, 28px); min-width: var(--gacha-star-box, 28px);
  height: var(--gacha-star-box, 28px); font-size: var(--gacha-star-size, 20px);
}
.gacha-name-box {
  position: absolute; inset: var(--gacha-head-space, 22px) 7px 6px;
  display: grid; place-items: center; overflow: hidden;
}
.gacha-name {
  max-width: 100%; max-height: 100%; color: var(--text); font-weight: 750;
  line-height: 1.18; text-align: center; white-space: pre-wrap;
  overflow-wrap: anywhere; word-break: break-word;
}
.gacha-grid.layout-grid.style-text { gap: 2px 8px; }
.gacha-grid.style-text .gacha-item {
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  background: transparent; box-shadow: none;
}
.gacha-grid.style-text .gacha-dex { display: none; }
.gacha-grid.style-text .gacha-fav { top: 50%; right: 0; transform: translateY(-50%); }
.gacha-grid.style-text .gacha-fav:active { transform: translateY(-50%) scale(.88); }
.gacha-grid.layout-grid.style-text .gacha-name-box {
  inset: 3px calc(var(--gacha-star-box, 28px) + 4px) 3px 3px;
}
.gacha-grid.layout-list { grid-template-columns: 1fr; }
.gacha-grid.layout-list.style-text { gap: 0; }
.gacha-grid.layout-list.style-card { gap: 5px; }
.gacha-grid.layout-list .gacha-item-link {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px;
  padding: 0 calc(var(--gacha-star-box, 28px) + 8px) 0 7px;
}
.gacha-grid.layout-list.style-text .gacha-item-link { grid-template-columns: minmax(0, 1fr); gap: 0; }
.gacha-grid.layout-list .gacha-dex {
  position: static; font-size: var(--gacha-meta-size, 14px);
}
.gacha-grid.layout-list .gacha-name-box {
  position: static; display: flex; align-items: center; width: 100%; height: 100%;
  min-width: 0; min-height: 0; overflow: hidden;
}
.gacha-grid.layout-list .gacha-name {
  width: 100%; max-width: 100%; white-space: pre-wrap; text-align: left; line-height: 1.08;
  overflow-wrap: anywhere; word-break: break-word;
}
.gacha-grid.layout-list .gacha-fav { top: 50%; right: 2px; transform: translateY(-50%); }
.gacha-grid.layout-list .gacha-fav:active { transform: translateY(-50%) scale(.88); }
.gacha-grid.just-drawn .gacha-item { animation: gacha-pop .13s ease-out both; }
.gacha-grid.just-drawn .gacha-item:nth-child(3n+2) { animation-delay: 20ms; }
.gacha-grid.just-drawn .gacha-item:nth-child(3n) { animation-delay: 35ms; }
@keyframes gacha-pop {
  from { opacity: .3; transform: scale(.97); }
  to { opacity: 1; transform: scale(1); }
}
.gacha-draw {
  width: min(640px, 100%); height: 58px; justify-self: center; padding: 0 24px;
  border: 0; border-radius: 14px; background: var(--accent); color: var(--accent-ink);
  font-size: 18px; font-weight: 800; letter-spacing: .04em; cursor: pointer;
  box-shadow: 0 5px 16px color-mix(in srgb, var(--accent) 28%, transparent);
  touch-action: manipulation; transition: background .12s, transform .06s;
}
.gacha-draw:hover { background: var(--accent-strong); }
.gacha-draw:active { transform: scale(.985); }
.gacha-draw:focus-visible { outline: 3px solid var(--accent-strong); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .gacha-grid.just-drawn .gacha-item { animation: none; }
}

/* ============ about ============ */
.about-body { padding: 20px 24px; font-size: 14.5px; }
.about-body h3 { font-size: 15.5px; margin: 20px 0 6px; }
.about-body h3:first-child { margin-top: 0; }
.about-body ul { padding-left: 20px; margin: 6px 0; }
.about-body li { margin: 4px 0; }

/* ============ responsive ============ */
@media (max-width: 700px) {
  .nav { padding: 7px 12px 6px; flex-wrap: wrap; gap: 4px 8px; }
  .brand { font-size: 17px; line-height: 1.25; }
  .nav-links {
    flex: 1 0 100%; width: 100%; margin-left: 0; gap: 4px;
    justify-content: space-between;
  }
  .nav-links a {
    flex: 1; padding: 4px 6px; text-align: center;
    font-size: 12.5px; line-height: 1.35; white-space: nowrap;
  }
  .search-cards, .home-cols { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 6.2em 1fr; }
  .row { padding: 10px 12px; }
  .row-n {
    position: relative; display: flex; min-height: 58px; padding: 0;
  }
  .row-n-main {
    position: relative; display: block; width: 100%; min-width: 0;
    padding: 18px 38px 16px 8px;
  }
  .row-n .title { display: block; width: 100%; line-height: 1.45; }
  .row-n .dexno {
    position: absolute; top: 3px; left: 8px;
    font-size: 9px; line-height: 1.35;
  }
  .row-n .t-tag {
    position: absolute; right: 38px; bottom: 3px;
    max-width: 68%; font-size: 9px; line-height: 1.35;
  }
  .row-n-main > .win-ic {
    position: absolute; top: 3px; right: 38px;
    width: 11px; height: 11px;
  }
  .row-fav {
    position: absolute; top: 50%; right: 4px; z-index: 2;
    margin: 0; transform: translateY(-50%);
  }
  .row-fav:active { transform: translateY(-50%) scale(.88); }
  .row .side { display: none; }
  .dex-head, .detail-head, .detail-block { padding: 16px; }
  .entry-tourn, .winner-box { padding-left: 16px; padding-right: 16px; }
  main { padding-top: 14px; }
  .pager-jump { margin-left: 0; }
  .toolbar .dex-range { flex: 1 1 100%; }
  .gacha-shell { padding-top: 6px; gap: 6px; grid-template-rows: 32px minmax(0, 1fr) 54px; }
  .gacha-grid { gap: 5px; }
  .gacha-item { border-radius: 9px; }
  .gacha-draw { height: 54px; border-radius: 12px; font-size: 17px; }
}

@media (max-width: 380px) {
  .search-card .frow { flex-wrap: wrap; }
  .search-card .frow .dex-range { flex: 1 1 100%; }
  .search-card .frow button { width: 100%; }
}
