/* Tasteprint
   Look: a fan-made tool, not a startup page. Neutral dark like TierMaker so covers carry the colour;
   the tier spectrum is the only accent. Crisp 1px lines, small radii, covers flush edge to edge.
   Type: M PLUS 2 for everything; Dela Gothic One only for the logo and the tier letters. */
:root {
  --bg: #19191d;
  --bg2: #202025;
  --panel: #26262c;
  --panel2: #2f2f36;
  --line: #34343c;
  --line2: #484852;
  --board: #111114;
  --text: #ececf1;
  --muted: #a3a3ae;
  --faint: #74747f;
  --t-s: #ff7f7f;
  --t-a: #ffbf7f;
  --t-b: #ffdf7f;
  --t-c: #ffff7f;
  --t-d: #bfff7f;
  --t-f: #7fbfff;
  --ink: #18181b;
  --primary: #ffdf7f;
  --good: #8ce99a;
  --warn: #ffd25a;
  --bad: #ff7f7f;
  --tile: 80px;
  --topbar: 52px;
  --r: 6px;
  --font: "M PLUS 2", "Segoe UI", system-ui, -apple-system, sans-serif;
  --display: "Dela Gothic One", "M PLUS 2", "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2,.8,.2,1);
}
* { box-sizing: border-box; }
html { scroll-padding-top: 110px; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.5; }
body { min-height: 100vh; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--t-b); }
h1, h2, h3 { letter-spacing: -.01em; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
kbd { font: 700 11px/1 var(--font); border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 4px; padding: 2px 5px; background: var(--panel); color: var(--text); }

/* ---------- top bar ---------- */
#topbar { display: flex; align-items: center; gap: 16px; padding: 0 20px; height: var(--topbar); background: var(--bg); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 60; }
#logo { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--text); }
#logo .word { font-family: var(--display); font-size: 19px; }
.mark { display: inline-flex; flex-direction: column; gap: 2px; }
.mark i { display: block; height: 4px; border-radius: 1px; }
.mark i:nth-child(1) { width: 18px; background: var(--t-s); }
.mark i:nth-child(2) { width: 14px; background: var(--t-a); }
.mark i:nth-child(3) { width: 10px; background: var(--t-b); }
.mark i:nth-child(4) { width: 6px; background: var(--t-f); }
#mockBadge { font-size: 12px; padding: 1px 8px; border-radius: 3px; background: #3b3112; color: var(--warn); }
.topnav { display: flex; gap: 2px; }
.navlink { background: none; border: 0; color: var(--muted); padding: 6px 10px; border-radius: 4px; cursor: pointer; font-weight: 500; }
.navlink:hover { color: var(--text); background: var(--bg2); }
.spacer { flex: 1; }
#backToBoard { display: none; }
body[data-view="h2hView"] #backToBoard { display: inline-block; }

/* ---------- buttons & inputs ---------- */
.btn { background: var(--panel); border: 1px solid var(--line2); border-radius: var(--r); padding: 7px 14px; cursor: pointer; white-space: nowrap; font-weight: 600; transition: background .1s, border-color .1s; }
.btn:hover { background: var(--panel2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--ink); font-weight: 800; }
.btn.primary:hover { background: #ffe89d; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--bg2); border-color: var(--line); }
.btn:disabled { opacity: .4; cursor: default; transform: none; }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btn.icon { width: 32px; padding: 4px 0; text-align: center; font-size: 15px; }
.btn.big { padding: 0 24px; font-size: 16px; }
input[type=text], input[type=search], input[type=number], select.sel, .numin { background: var(--bg2); border: 1px solid var(--line2); border-radius: var(--r); padding: 7px 10px; outline: none; }
input[type=text]:focus, input[type=search]:focus, select.sel:focus, .numin:focus { border-color: var(--primary); }
input[type=checkbox], input[type=range] { accent-color: var(--primary); }
.err { color: var(--bad); margin-top: 8px; min-height: 22px; }

/* ---------- home ---------- */
#home { max-width: 1160px; margin: 0 auto; padding: 0 24px 80px; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; padding: 52px 0 36px; }
.hero h1 { font-weight: 800; font-size: clamp(34px, 4.4vw, 52px); line-height: 1.06; margin: 0 0 14px; letter-spacing: -.025em; max-width: 13ch; }
.hero .lead { color: var(--muted); font-size: 16.5px; margin: 0 0 24px; max-width: 54ch; }
.pastebox { display: flex; gap: 8px; }
.searchwrap { position: relative; flex: 1; min-width: 0; }
.pastebox input { width: 100%; font-size: 16px; padding: 14px 16px; background: var(--bg2); border: 1px solid var(--line2); border-radius: var(--r); }
.pastebox input:focus { border-color: var(--primary); }
.quick { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 12px; font-size: 14px; }
.quick .lbl { color: var(--faint); }
.chip { background: none; border: 0; padding: 0; font-size: 14px; cursor: pointer; color: var(--muted); text-decoration: underline; text-decoration-color: var(--line2); text-underline-offset: 3px; }
.chip:hover { color: var(--text); text-decoration-color: var(--muted); }
#moreEx { margin-top: 12px; color: var(--muted); font-size: 14px; }
#moreEx summary { cursor: pointer; width: max-content; }
#moreEx summary:hover { color: var(--text); }
.exgroup { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; }
.exgroup .gl { font-size: 13px; color: var(--faint); width: 132px; flex: 0 0 132px; }

/* suggestions under the search box */
#suggest { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 80; background: var(--panel); border: 1px solid var(--line2); border-radius: var(--r); box-shadow: 0 18px 40px -12px rgba(0,0,0,.7); max-height: min(70vh, 520px); overflow-y: auto; padding: 4px 0; }
.sugg-head { font-size: 12px; color: var(--faint); padding: 8px 12px 2px; font-weight: 700; }
.sugg { display: flex; align-items: center; gap: 10px; padding: 5px 12px; cursor: pointer; }
.sugg.on { background: var(--panel2); }
.sugg img, .sugg-icon { width: 32px; height: 44px; flex: 0 0 32px; object-fit: cover; border-radius: 2px; background: var(--bg2); }
.sugg-icon { display: grid; place-items: center; color: var(--muted); font-weight: 800; }
.sugg-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.sugg-t b { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sugg-alt, .sugg-meta { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sugg-meta { color: var(--faint); }
.sugg-note { padding: 8px 12px; color: var(--faint); font-size: 13px; }

/* the start page's live tier list (this season's trending anime) */
.hero-art { min-width: 0; }
.livelist { border: 1px solid var(--line); background: var(--board); }
.livelist .lrow { display: flex; border-bottom: 1px solid #000; min-height: 76px; }
.livelist .lrow:last-child { border-bottom: 0; }
.livelist .lab { width: 58px; flex: 0 0 58px; display: grid; place-items: center; font-family: var(--display); font-size: 22px; color: var(--ink); }
.livelist .lt { display: flex; flex-wrap: wrap; flex: 1; min-width: 0; }
.livelist .lt img { width: 57px; height: 76px; object-fit: cover; display: block; }
.livelist .lt i { width: 57px; height: 76px; display: block; background: var(--panel); border-right: 1px solid var(--board); }
.livecap { font-size: 12.5px; color: var(--faint); margin-top: 6px; }

.modes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); margin-top: 8px; }
.mode { text-align: left; background: none; border: 0; border-right: 1px solid var(--line); padding: 18px 18px 20px; cursor: pointer; color: var(--text); display: flex; flex-direction: column; gap: 4px; }
.mode:first-child { padding-left: 0; }
.mode:last-child { border-right: 0; }
.mode:hover b { text-decoration: underline; text-underline-offset: 3px; }
.mode .sw { width: 22px; height: 4px; background: var(--c); margin-bottom: 6px; }
.mode b { font-size: 16px; font-weight: 800; }
.mode span:last-child { color: var(--muted); font-size: 14px; }

#recent { margin-top: 36px; }
#recent h2 { font-size: 18px; font-weight: 800; margin: 0 0 12px; }
.recent-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.recent-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; text-align: left; }
.recent-item:hover { border-color: var(--line2); }
.recent-item .covers { display: flex; flex: 0 0 auto; }
.recent-item .covers img { width: 30px; height: 40px; object-fit: cover; margin-right: 2px; }
.recent-item .t { flex: 1; min-width: 0; padding-left: 4px; display: flex; flex-direction: column; }
.recent-item .t b { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-item .prog { height: 3px; background: var(--panel2); margin-top: 6px; overflow: hidden; }
.recent-item .prog i { display: block; height: 100%; background: var(--t-b); }
.recent-item .x { opacity: .45; padding: 4px 8px; border-radius: 4px; }
.recent-item .x:hover { opacity: 1; color: var(--bad); background: var(--panel2); }

/* ---------- setup ---------- */
#setup { max-width: 740px; margin: 0 auto; padding: 40px 24px 80px; }
#setup h2 { margin: 0 0 4px; font-size: 26px; font-weight: 800; }
#setup .src { color: var(--muted); margin-bottom: 14px; }
.peek { display: flex; align-items: flex-end; gap: 2px; margin: 0 0 24px; flex-wrap: wrap; }
.peek img { width: 46px; height: 62px; object-fit: cover; display: block; background: var(--panel); }
.peek span { margin-left: 8px; }
.field { margin-bottom: 22px; }
.field > label, .field > .lbl { display: block; font-weight: 700; margin-bottom: 8px; }
.field .hint { color: var(--muted); font-size: 13px; margin-top: 7px; max-width: 70ch; }
.seg { display: inline-flex; background: var(--bg2); border: 1px solid var(--line2); border-radius: var(--r); padding: 2px; flex-wrap: wrap; gap: 2px; }
.seg button { background: transparent; border: 0; padding: 6px 12px; border-radius: 4px; cursor: pointer; color: var(--muted); font-weight: 600; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--text); color: var(--ink); }
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.checks label { display: flex; align-items: center; gap: 6px; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r); padding: 5px 10px; cursor: pointer; font-size: 14px; }
.numin { width: 90px; }
.setup-actions { display: flex; gap: 8px; margin-top: 28px; }
.charbox { border-left: 3px solid var(--t-a); padding-left: 16px; margin-top: 4px; }

/* ---------- loading ---------- */
#loading { max-width: 560px; margin: 0 auto; padding: 110px 24px; text-align: center; }
#loading h2 { font-weight: 800; }
.bar { height: 8px; background: var(--bg2); overflow: hidden; border: 1px solid var(--line); margin: 20px 0 12px; }
.bar > div { height: 100%; width: 0; background: var(--t-b); transition: width .25s; }
#loadNote { color: var(--muted); font-size: 14px; min-height: 40px; }
.load-actions { margin-top: 16px; display: flex; gap: 8px; justify-content: center; }

/* ---------- board ---------- */
#boardBar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 20px; position: sticky; top: var(--topbar); z-index: 50; background: var(--bg); border-bottom: 1px solid var(--line); }
#boardTitle { font-size: 18px; font-weight: 800; background: transparent; border: 1px solid transparent; border-radius: 4px; padding: 3px 6px; min-width: 160px; max-width: 420px; flex: 0 1 auto; }
#boardTitle:hover, #boardTitle:focus { border-color: var(--line2); outline: none; }
.tabs { display: inline-flex; gap: 2px; background: var(--bg2); border: 1px solid var(--line2); border-radius: var(--r); padding: 2px; }
.tabs button { background: transparent; border: 0; padding: 4px 12px; border-radius: 4px; cursor: pointer; color: var(--muted); font-weight: 700; }
.tabs button.on { background: var(--text); color: var(--ink); }
#groupBadge { font-size: 13px; padding: 3px 10px; border-radius: 4px; background: rgba(140,233,154,.1); color: var(--good); border: 1px solid rgba(140,233,154,.3); cursor: pointer; }
.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); background: var(--panel); border: 1px solid var(--line2); border-radius: var(--r); padding: 12px; display: flex; flex-direction: column; gap: 10px; min-width: 250px; z-index: 70; box-shadow: 0 18px 40px -12px rgba(0,0,0,.7); }
.menu-pop label { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.menu-pop input[type=range] { flex: 1; }
.menu-actions { display: flex; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }

/* The tier list itself: as plain as TierMaker. Black lines, coloured labels, covers edge to edge. */
#board { margin: 16px 20px 8px; border: 1px solid #000; background: var(--board); }
#exportHead { display: none; padding: 14px 16px 10px; font-size: 22px; font-weight: 800; color: var(--text); background: var(--board); }
#board.exporting #exportHead { display: block; }
#board.exporting .rowtools, #board.exporting .refuse { display: none !important; }
.row { display: flex; min-height: calc(var(--tile) * 4 / 3); border-bottom: 2px solid #000; background: var(--board); }
.row:last-child { border-bottom: 0; }
.row .label { width: 100px; flex: 0 0 100px; display: flex; align-items: center; justify-content: center; text-align: center; font-family: var(--display); font-size: 24px; color: var(--ink); padding: 4px; word-break: break-word; line-height: 1.1; }
.row .label .txt { outline: none; min-width: 20px; }
.row .label .txt[contenteditable="true"]:focus { background: rgba(255,255,255,.45); }
.row .items { flex: 1; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 0; min-height: calc(var(--tile) * 4 / 3); }
.row .rowtools { width: 30px; flex: 0 0 30px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: #000; opacity: .6; }
.row:hover .rowtools { opacity: 1; }
.rowtools button { background: transparent; border: 0; color: var(--muted); cursor: pointer; padding: 3px 5px; border-radius: 3px; font-size: 12px; line-height: 1; }
.rowtools button:hover { color: var(--text); background: var(--panel2); }
.row.refuse { background: repeating-linear-gradient(45deg, var(--board), var(--board) 10px, #19191d 10px, #19191d 20px); }
.row.refuse .label { color: var(--muted); font-family: var(--font); font-size: 13px; font-weight: 700; background: transparent !important; }
.row.drop-hover .items { background: rgba(255,255,255,.04); }
body.has-selection .row:hover .items { background: rgba(255,255,255,.04); cursor: pointer; }

.after-rows { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 20px; }
.after-rows .keys { margin-left: auto; color: var(--faint); font-size: 12.5px; }

/* tiles: the cover, with its name written over the bottom in white with a black outline */
.tile { width: var(--tile); position: relative; overflow: hidden; background: var(--panel); cursor: grab; user-select: none; -webkit-user-select: none; touch-action: none; flex: 0 0 auto; }
.tile img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block; pointer-events: none; background: var(--panel); }
.tile .cap {
  position: absolute; left: 0; right: 0; bottom: 3px; padding: 0 4px; text-align: center; pointer-events: none;
  font-size: 11px; line-height: 1.15; font-weight: 800; color: #fff;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000, 0 -1px 0 #000, 0 1px 0 #000, -1px 0 0 #000, 1px 0 0 #000, 0 0 3px #000;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word;
}
body.nocaps .tile .cap { display: none; }
.tile:hover { filter: brightness(1.12); }
body.dragging, body.dragging * { cursor: grabbing !important; }
body.dragging .tile:hover { filter: none; }
.tile.selected { outline: 3px solid var(--primary); outline-offset: -3px; }
.tile .badge { position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,.8); color: #fff; font-size: 10px; padding: 0 5px; border-radius: 2px; font-weight: 800; }
.tile.slot { background: rgba(255,255,255,.08); outline: 1px dashed rgba(255,255,255,.35); outline-offset: -1px; }
.tile.slot > * { visibility: hidden; }
.tile.ghost { position: fixed; left: 0; top: 0; z-index: 1000; pointer-events: none; margin: 0; will-change: transform; opacity: .75; }
.tile.dragsrc { opacity: .3; }
.drop-line { position: fixed; z-index: 999; width: 3px; margin-left: -1px; border-radius: 2px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.5); pointer-events: none; display: none; }
.tile.flying { z-index: 5; }

/* tier strip shown while the rows are scrolled away */
#dock { position: fixed; left: 50%; transform: translateX(-50%); z-index: 55; display: flex; gap: 4px; padding: 6px; background: #000; border: 1px solid var(--line2); border-top: 0; opacity: 0; pointer-events: none; transition: opacity .12s; }
#dock.show { opacity: 1; pointer-events: auto; }
.dock-chip { min-width: 56px; height: 44px; background: var(--rc); color: var(--ink); display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0 10px; }
.dock-chip b { font-family: var(--display); font-weight: 400; font-size: 20px; }
.dock-chip span { font-size: 11px; font-weight: 800; opacity: .6; }
.dock-chip.drop-hover { outline: 3px solid #fff; outline-offset: -3px; }

/* pool: part of the page, one scroll for everything */
#pool { margin: 16px 20px 60px; border: 1px solid var(--line); background: var(--bg2); }
#pool.drop-hover { border-color: var(--muted); }
#poolBar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
#poolCount { font-size: 15px; }
#poolBar input[type=search] { width: 200px; padding: 5px 9px; }
#poolBar select.sel { padding: 5px 8px; }
#poolItems { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 0; padding: 0; min-height: 120px; background: var(--board); }

/* ---------- head to head ---------- */
#h2hView { max-width: 1000px; margin: 0 auto; padding: 24px 24px 80px; }
#h2hView h2 { margin: 0 0 6px; font-weight: 800; }
.opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0 20px; }
.opt { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; cursor: pointer; }
.opt.on { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.opt b { display: block; margin-bottom: 4px; }
.opt span { color: var(--muted); font-size: 13px; }
.arena { display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px; align-items: center; margin-top: 18px; }
.fighter { background: var(--bg2); border: 2px solid var(--line); border-radius: var(--r); padding: 12px; text-align: center; cursor: pointer; transition: border-color .1s; }
.fighter:hover { border-color: var(--primary); }
.fighter img { width: 100%; max-width: 260px; aspect-ratio: 3/4; object-fit: cover; }
.fighter .nm { font-weight: 800; font-size: 17px; margin-top: 10px; min-height: 44px; }
.mid { display: flex; flex-direction: column; gap: 8px; align-items: stretch; width: 150px; }
.mid .btn { text-align: center; }
.kbd { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; margin-left: 4px; }
.h2h-progress { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }
.h2h-progress .bar { flex: 1; margin: 0; }
.kindtag { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 3px; background: var(--panel2); color: var(--muted); margin-top: 10px; min-height: 20px; }
.results h3 { margin: 26px 0 8px; font-weight: 800; }
.shapes { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.shape { padding: 5px 10px; border-radius: var(--r); background: var(--bg2); border: 1px solid var(--line); font-size: 14px; }
.shape.hit { border-color: var(--t-a); color: var(--t-a); }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.stat { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; }
.stat .v { font-size: 26px; font-weight: 800; line-height: 1.2; }
.stat .k { color: var(--muted); font-size: 13px; }
.ranklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px; }
.rankrow { display: flex; align-items: center; gap: 8px; background: var(--bg2); padding: 4px 8px; font-size: 14px; }
.rankrow img { width: 30px; height: 40px; object-fit: cover; }
.rankrow .n { width: 30px; color: var(--muted); text-align: right; }
.rankrow .span { margin-left: auto; color: var(--muted); font-size: 12px; }
.loop { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; background: var(--bg2); padding: 8px 10px; margin-bottom: 6px; }
.loop img { width: 34px; height: 46px; object-fit: cover; }
.loop .arrow { color: var(--t-a); }
.explain { color: var(--muted); font-size: 14px; max-width: 760px; }

/* ---------- compare ---------- */
#compareView { padding: 24px 20px 80px; }
#compareForm { max-width: 900px; margin: 0 auto 10px; }
#compareForm h2 { font-size: 26px; font-weight: 800; margin: 6px 0 6px; }
#compareForm > p { margin: 0 0 16px; max-width: 75ch; }
#compareForm .row2 { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
#compareForm input[type=text] { padding: 11px 13px; flex: 1; min-width: 200px; }
#cmpOut { max-width: 1240px; margin: 0 auto; }
.match { max-width: 980px; margin: 18px auto 8px; display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 22px; }
.match .pct { font-size: 58px; font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.match .pct small { font-size: 24px; }
.match h3 { margin: 0 0 4px; font-size: 18px; }
.match p { margin: 0; color: var(--muted); }
.meter { height: 6px; background: var(--panel2); margin-top: 10px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--t-d); }
.cmp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.cmp-col h3 { margin: 0 0 8px; font-weight: 800; }
.cmp-col .row .label { width: 56px; flex-basis: 56px; font-size: 22px; }
.tile.d0 { box-shadow: inset 0 0 0 3px var(--good); }
.tile.d1 { box-shadow: inset 0 0 0 3px var(--warn); }
.tile.d2 { box-shadow: inset 0 0 0 3px var(--bad); }
.tile.dim { opacity: .25; }
.tile.twin { outline: 3px solid #fff; outline-offset: -3px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 10px; }
.legend i { display: inline-block; width: 12px; height: 12px; margin-right: 5px; vertical-align: -2px; }
.disagree, .recs { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 6px; }
.dis { display: flex; align-items: center; gap: 10px; background: var(--bg2); padding: 6px 10px; }
.dis img { width: 36px; height: 48px; object-fit: cover; }
.dis .t { flex: 1; font-size: 14px; }
.dis .sc { font-weight: 800; }
.cmp-section { margin: 0 auto; }
.cmp-section h3 { margin: 28px 0 8px; font-weight: 800; }

/* ---------- group ---------- */
#groupView { max-width: 1100px; margin: 0 auto; padding: 28px 24px 80px; }
#groupView h2 { font-size: 26px; font-weight: 800; margin: 0 0 6px; }
.group-head { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; justify-content: space-between; }
.sharebox { display: flex; gap: 8px; align-items: center; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 6px 6px 12px; max-width: 100%; }
.sharebox code { font-family: var(--font); font-weight: 700; color: var(--good); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46ch; }
.people { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0; }
.person { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: var(--r); background: var(--bg2); border: 1px solid var(--line); font-size: 14px; }
.person .av { width: 24px; height: 24px; border-radius: 3px; display: grid; place-items: center; font-weight: 800; color: var(--ink); font-size: 12px; }
.person.me { border-color: var(--line2); }
.person .done { color: var(--muted); font-size: 12px; }
.tile .spread { position: absolute; left: 2px; top: 2px; display: flex; gap: 2px; }
.tile .spread i { width: 7px; height: 7px; box-shadow: 0 0 0 1px rgba(0,0,0,.6); }
.pairs { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px; }
.pair { background: var(--bg2); border: 1px solid var(--line); padding: 8px 12px; display: flex; justify-content: space-between; gap: 8px; }
.pair b { font-weight: 800; }
.empty { text-align: center; color: var(--muted); padding: 48px 20px; border: 1px dashed var(--line2); }

/* ---------- modal + toast ---------- */
#modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 200; display: flex; align-items: center; justify-content: center; }
#modalBox { background: var(--panel); border: 1px solid var(--line2); border-radius: var(--r); padding: 20px; width: min(480px, 92vw); box-shadow: 0 30px 60px -20px rgba(0,0,0,.8); }
#modalBox h3 { margin: 0 0 10px; font-size: 20px; font-weight: 800; }
#modalBox input[type=text] { width: 100%; }
#toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--ink); font-weight: 600; padding: 9px 16px; border-radius: var(--r); z-index: 300; opacity: 0; transition: opacity .15s; pointer-events: none; max-width: min(640px, 90vw); text-align: center; }
#toast.show { opacity: 1; }
.colors { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 14px; }
.colors button { width: 30px; height: 30px; border: 2px solid transparent; cursor: pointer; }
.colors button.on { border-color: #fff; }

body.blur18 .tile.nsfw img, body.blur18 .fighter.nsfw img, body.blur18 .nsfwimg { filter: blur(14px) saturate(.6); }
.sitebadge { font-size: 10px; position: absolute; left: 2px; top: 2px; background: rgba(0,0,0,.7); color: #ddd; padding: 0 4px; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 28px; padding-top: 32px; }
  .modes { grid-template-columns: 1fr 1fr; }
  .mode { padding-left: 0; }
  .mode:nth-child(2) { border-right: 0; }
  .mode:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .topnav { display: none; }
  .cmp-grid { grid-template-columns: 1fr; }
  .after-rows .keys { display: none; }
  .row .label { width: 64px; flex-basis: 64px; font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ---------- other ways to get characters (start page) ---------- */
.otherways { margin-top: 36px; }
.otherways h2 { font-size: 18px; font-weight: 800; margin: 0 0 4px; }
.otherways > p { margin: 0 0 14px; max-width: 70ch; }
.ow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.ow-item { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px 18px 18px 0; }
.ow-item + .ow-item { border-left: 1px solid var(--line); padding-left: 18px; }
.ow-item b { font-weight: 800; }
.ow-item span { color: var(--muted); font-size: 14px; max-width: 52ch; }
.ow-item .btn { margin-top: 6px; }
.bookmarklet { text-decoration: none; cursor: grab; border-style: dashed; }
body.dropping #home::after { content: 'Drop the game folder to read its characters'; position: fixed; inset: 12px; border: 2px dashed var(--primary); border-radius: 10px; background: rgba(17,17,20,.85); display: grid; place-items: center; font-size: 22px; font-weight: 800; z-index: 90; pointer-events: none; }

/* ---------- picker ---------- */
#pickerView { max-width: 1180px; margin: 0 auto; padding: 28px 24px 120px; }
.picker-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.picker-head h2 { margin: 0 0 4px; font-size: 26px; font-weight: 800; }
.picker-head p { margin: 0; max-width: 70ch; }
.picker-actions { display: flex; gap: 6px; }
.picker-name { margin: 18px 0 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.picker-name .lbl { font-weight: 700; }
.picker-title { min-width: 280px; }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 10px; }
.pick { position: relative; display: flex; flex-direction: column; gap: 4px; }
.pick-img { position: relative; padding: 0; border: 0; background: var(--panel); cursor: pointer; aspect-ratio: 3 / 4; overflow: hidden; outline: 2px solid transparent; outline-offset: -2px; border-radius: var(--r); }
.pick-img img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .35; filter: grayscale(.7); transition: opacity .12s, filter .12s; }
.pick.on .pick-img { outline-color: var(--primary); }
.pick.on .pick-img img { opacity: 1; filter: none; }
.pick-check { position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 4px; background: rgba(0,0,0,.6); color: transparent; font-size: 13px; font-weight: 900; display: grid; place-items: center; }
.pick.on .pick-check { background: var(--primary); color: var(--ink); }
.pick-alt { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border: 0; border-radius: 4px; background: rgba(0,0,0,.65); color: #fff; cursor: pointer; }
.pick input[type=text] { padding: 5px 7px; font-size: 13px; width: 100%; }
.picker-foot { position: fixed; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 10px; padding: 12px 24px; background: rgba(25,25,29,.96); border-top: 1px solid var(--line); z-index: 40; }

/* tiles that have other pictures: a small corner mark */
.tile.has-alts::after { content: ''; position: absolute; top: 0; right: 0; border: 5px solid transparent; border-top-color: rgba(255,255,255,.55); border-right-color: rgba(255,255,255,.55); pointer-events: none; }
@media (max-width: 760px) { .ow { grid-template-columns: 1fr; } .ow-item + .ow-item { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); } }
