/* Tasteprint
   Night-indigo base; the tier spectrum (S→F) is the only colour, and it means something everywhere it appears.
   Dela Gothic One for the loud bits (logo, headlines, tier letters, big numbers); M PLUS 2 for everything else. */
:root {
  --bg: #15132b;
  --bg2: #1b1836;
  --panel: #221f42;
  --panel2: #2b2752;
  --line: #36316a;
  --line2: #4a4488;
  --text: #f4f1ff;
  --muted: #aaa4d2;
  --faint: #7d77a8;
  --t-s: #ff6b81;
  --t-a: #ff9f5a;
  --t-b: #ffd25a;
  --t-c: #e8f06a;
  --t-d: #8ce99a;
  --t-f: #74c0fc;
  --ink: #1b1530;
  --primary: var(--t-b);
  --good: #8ce99a;
  --warn: #ffd25a;
  --bad: #ff6b81;
  --tile: 84px;
  --topbar: 58px;
  --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: 120px; }
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); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
kbd { font: 600 11px/1 var(--font); border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 5px; padding: 2px 5px; background: var(--panel); color: var(--text); }

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

/* ---------- buttons & inputs ---------- */
.btn {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 9px; padding: 7px 14px;
  cursor: pointer; transition: background .12s, border-color .12s, transform .08s; white-space: nowrap; font-weight: 500;
}
.btn:hover { background: #352f63; border-color: var(--line2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--ink); font-weight: 800; }
.btn.primary:hover { background: #ffdc7e; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--panel); }
.btn:disabled { opacity: .4; cursor: default; transform: none; }
.btn.sm { padding: 5px 11px; font-size: 13px; }
.btn.icon { width: 32px; padding: 5px 0; text-align: center; font-size: 15px; }
.btn.big { padding: 0 26px; font-size: 17px; }
input[type=text], input[type=search], input[type=number], select.sel, .numin {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px; 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: 10px; min-height: 22px; }

/* ---------- home ---------- */
#home { max-width: 1120px; margin: 0 auto; padding: 0 28px 90px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr); gap: 56px; align-items: center; padding: 64px 0 40px; }
.hero h1 { font-family: var(--display); font-weight: 400; font-size: clamp(38px, 5.4vw, 64px); line-height: 1.04; margin: 0 0 18px; letter-spacing: -.5px; max-width: 12ch; }
.hero .lead { color: var(--muted); font-size: 17px; margin: 0 0 26px; max-width: 58ch; }
.pastebox { display: flex; gap: 10px; }
.pastebox input { flex: 1; min-width: 0; font-size: 16px; padding: 16px 18px; border-radius: 12px; background: var(--bg2); border: 1.5px solid var(--line2); }
.pastebox input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(255,210,90,.12); }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.chip { background: var(--panel); border: 1px solid var(--line); border-radius: 99px; padding: 5px 12px; font-size: 13px; cursor: pointer; color: var(--muted); }
.chip:hover { color: var(--text); border-color: var(--line2); }
#moreEx { margin-top: 14px; color: var(--muted); font-size: 14px; }
#moreEx summary { cursor: pointer; width: max-content; }
#moreEx summary:hover { color: var(--text); }
.exgroup { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.exgroup .gl { font-size: 13px; color: var(--faint); width: 128px; flex: 0 0 128px; }

/* the little tier list that fills itself in on the home page */
.hero-art { display: flex; justify-content: center; }
.mini { width: 100%; max-width: 330px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--bg2); box-shadow: 0 30px 60px -30px rgba(0,0,0,.6); }
.mrow { display: flex; min-height: 70px; border-bottom: 1px solid var(--line); }
.mrow:last-child { border-bottom: 0; }
.mrow b { width: 62px; flex: 0 0 62px; display: grid; place-items: center; font-family: var(--display); font-weight: 400; font-size: 26px; color: var(--ink); }
.mrow:nth-child(1) b { background: var(--t-s); }
.mrow:nth-child(2) b { background: var(--t-a); }
.mrow:nth-child(3) b { background: var(--t-b); }
.mrow:nth-child(4) b { background: var(--t-c); }
.mrow span { flex: 1; display: flex; gap: 5px; padding: 7px; align-items: flex-start; }
.mtile { display: block; flex: 0 0 auto; width: 42px; height: 56px; border-radius: 6px; background: linear-gradient(160deg, var(--a), var(--b)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
@media (prefers-reduced-motion: no-preference) {
  .mtile { animation: mdrop .55s var(--ease) both; animation-delay: var(--d); }
  @keyframes mdrop { from { transform: translate(var(--fx), -70px) rotate(-8deg); opacity: 0; } 60% { opacity: 1; } to { transform: none; opacity: 1; } }
}

.modes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 12px; }
.mode { text-align: left; background: none; border: 0; border-right: 1px solid var(--line); padding: 22px 22px 24px; cursor: pointer; color: var(--text); display: flex; flex-direction: column; gap: 6px; transition: background .15s; }
.mode:last-child { border-right: 0; }
.mode:hover { background: var(--bg2); }
.mode .sw { width: 34px; height: 6px; border-radius: 3px; background: var(--c); margin-bottom: 6px; }
.mode b { font-size: 17px; font-weight: 800; }
.mode span:last-child { color: var(--muted); font-size: 14px; }

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

/* ---------- setup ---------- */
#setup { max-width: 760px; margin: 0 auto; padding: 44px 24px 90px; }
#setup h2 { font-family: var(--display); font-weight: 400; margin: 0 0 6px; font-size: 30px; }
#setup .src { color: var(--muted); margin-bottom: 26px; }
.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; }
.seg { display: inline-flex; background: var(--bg2); border: 1px solid var(--line); border-radius: 11px; padding: 3px; flex-wrap: wrap; gap: 2px; }
.seg button { background: transparent; border: 0; padding: 7px 13px; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 500; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--panel2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line2); }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label { display: flex; align-items: center; gap: 6px; background: var(--bg2); border: 1px solid var(--line); border-radius: 9px; padding: 6px 11px; cursor: pointer; font-size: 14px; }
.numin { width: 90px; }
.setup-actions { display: flex; gap: 10px; margin-top: 30px; }
.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-family: var(--display); font-weight: 400; }
.bar { height: 10px; background: var(--bg2); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); margin: 20px 0 12px; }
.bar > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--t-s), var(--t-a), var(--t-b), var(--t-d), var(--t-f)); background-size: 400px 100%; transition: width .25s; }
#loadNote { color: var(--muted); font-size: 14px; min-height: 40px; }
.load-actions { margin-top: 16px; display: flex; gap: 10px; justify-content: center; }

/* ---------- board ---------- */
#boardBar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 22px;
  position: sticky; top: var(--topbar); z-index: 50; background: rgba(21,19,43,.94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
#boardTitle { font-family: var(--display); font-size: 20px; background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 3px 8px; min-width: 160px; max-width: 420px; flex: 0 1 auto; }
#boardTitle:hover, #boardTitle:focus { border-color: var(--line); outline: none; }
.tabs { display: inline-flex; gap: 2px; background: var(--bg2); border: 1px solid var(--line); border-radius: 11px; padding: 3px; }
.tabs button { background: transparent; border: 0; padding: 5px 12px; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 500; }
.tabs button.on { background: var(--panel2); color: var(--text); }
#groupBadge { font-size: 13px; padding: 4px 10px; border-radius: 99px; background: rgba(140,233,154,.12); color: var(--t-d); 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: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; min-width: 240px; z-index: 70; box-shadow: 0 20px 40px -12px rgba(0,0,0,.6); }
.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; }

#board { margin: 18px 22px 10px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--bg2); }
#exportHead { display: none; padding: 16px 18px 8px; font-family: var(--display); font-size: 24px; }
#board.exporting #exportHead { display: block; }
#board.exporting .rowtools, #board.exporting .refuse { display: none !important; }
.row { display: flex; min-height: calc(var(--tile) * 1.33 + 12px); border-bottom: 1px solid var(--line); transition: background .25s; }
.row:last-child { border-bottom: 0; }
.row .label {
  width: 104px; flex: 0 0 104px; display: flex; align-items: center; justify-content: center; text-align: center;
  font-family: var(--display); font-size: 26px; color: var(--ink); padding: 6px; 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,.4); border-radius: 4px; }
.row .items { flex: 1; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 5px; padding: 6px; min-height: 64px; transition: background .2s; }
.row .rowtools { width: 34px; flex: 0 0 34px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; background: rgba(0,0,0,.12); opacity: .55; transition: opacity .15s; }
.row:hover .rowtools { opacity: 1; }
.rowtools button { background: transparent; border: 0; color: var(--muted); cursor: pointer; padding: 3px 5px; border-radius: 5px; font-size: 13px; line-height: 1; }
.rowtools button:hover { color: var(--text); background: var(--panel2); }
.row.refuse { background: repeating-linear-gradient(45deg, var(--bg2), var(--bg2) 10px, #1f1c3c 10px, #1f1c3c 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: color-mix(in srgb, var(--rc) 15%, transparent); }
body.has-selection .row:hover .items { background: color-mix(in srgb, var(--rc) 8%, transparent); cursor: pointer; }

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

/* tiles */
.tile {
  width: var(--tile); position: relative; border-radius: 8px; overflow: hidden; background: var(--panel); cursor: grab;
  user-select: none; -webkit-user-select: none; touch-action: none; flex: 0 0 auto;
  transition: box-shadow .14s, translate .14s;
}
.tile:hover { translate: 0 -2px; box-shadow: 0 8px 18px -8px rgba(0,0,0,.7), 0 0 0 1px var(--line2); }
body.dragging, body.dragging * { cursor: grabbing !important; }
body.dragging .tile:hover { translate: none; box-shadow: none; }
.tile img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block; pointer-events: none; background: var(--panel2); }
.tile .cap {
  font-size: 11px; line-height: 1.25; padding: 3px 4px 4px; color: #e9e5ff; background: var(--panel);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 31px; text-align: center;
}
body.nocaps .tile .cap { display: none; }
.tile.selected { box-shadow: 0 0 0 3px var(--primary); translate: 0 -2px; }
.tile .badge { position: absolute; top: 3px; right: 3px; background: rgba(10,8,25,.78); color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 99px; font-weight: 700; }
/* the gap a dragged tile leaves (and where it will land) */
.tile.slot { background: color-mix(in srgb, var(--rc, #fff) 14%, transparent); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--rc, #fff) 55%, transparent); translate: none; }
.tile.slot > * { visibility: hidden; }
#poolItems .tile.slot { --rc: #aaa4d2; }
/* the tile in your hand */
.tile.ghost {
  position: fixed; left: 0; top: 0; z-index: 1000; pointer-events: none; margin: 0; translate: none;
  transition: scale .16s var(--ease), box-shadow .16s var(--ease);
  will-change: transform;
}
.tile.ghost.lifted { scale: 1.08; box-shadow: 0 22px 40px -10px rgba(0,0,0,.75), 0 0 0 2px rgba(255,255,255,.18); }
.tile.ghost.landing { transition: transform .2s var(--ease), scale .2s var(--ease), box-shadow .2s, opacity .2s; scale: 1; }
.tile.flying { z-index: 5; }
@keyframes land { 0% { scale: 1.07; box-shadow: 0 0 0 3px var(--rc, #fff); } 100% { scale: 1; box-shadow: 0 0 0 3px transparent; } }
.tile.landed { animation: land .5s var(--ease); }

/* tier strip shown while the rows are scrolled away */
#dock { position: fixed; left: 50%; transform: translate(-50%, -10px); z-index: 55; display: flex; gap: 6px; padding: 8px; border-radius: 0 0 14px 14px; background: rgba(27,24,54,.96); border: 1px solid var(--line2); border-top: 0; opacity: 0; pointer-events: none; transition: opacity .15s, transform .2s var(--ease); }
#dock.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.dock-chip { min-width: 58px; height: 46px; border-radius: 9px; background: var(--rc); color: var(--ink); display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0 10px; transition: scale .12s var(--ease); }
.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 { scale: 1.13; }
.dock-chip.took { animation: took .4s var(--ease); }
@keyframes took { 40% { scale: 1.22; } 100% { scale: 1; } }

/* pool: part of the page, one scroll for everything */
#pool { margin: 18px 22px 60px; border-radius: 14px; border: 1px dashed var(--line2); background: rgba(27,24,54,.5); transition: border-color .2s, background .2s; }
#pool.drop-hover { border-color: var(--muted); background: rgba(34,31,66,.7); }
#poolBar { display: flex; align-items: center; gap: 10px; padding: 12px 14px 4px; flex-wrap: wrap; }
#poolCount { font-size: 15px; }
#poolBar input[type=search] { width: 200px; padding: 6px 10px; }
#poolBar select.sel { padding: 6px 9px; }
#poolItems { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 5px; padding: 10px 14px 16px; min-height: 120px; }

/* ---------- head to head ---------- */
#h2hView { max-width: 1000px; margin: 0 auto; padding: 26px 24px 90px; }
#h2hView h2 { font-family: var(--display); font-weight: 400; margin: 0 0 6px; }
.opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 14px 0 20px; }
.opt { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; 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: 20px; }
.fighter { background: var(--bg2); border: 2px solid var(--line); border-radius: 18px; padding: 14px; text-align: center; cursor: pointer; transition: translate .12s var(--ease), border-color .12s, box-shadow .12s; }
.fighter:hover { border-color: var(--primary); translate: 0 -3px; box-shadow: 0 18px 30px -18px rgba(0,0,0,.8); }
.fighter:active { translate: 0 0; }
.fighter img { width: 100%; max-width: 260px; aspect-ratio: 3/4; object-fit: cover; border-radius: 11px; }
.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: 4px; 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 9px; border-radius: 99px; background: #2d2560; color: #cfc4ff; margin-top: 10px; min-height: 20px; }
.results h3 { font-family: var(--display); font-weight: 400; margin: 28px 0 8px; }
.shapes { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.shape { padding: 6px 12px; border-radius: 99px; 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: 10px; margin: 12px 0; }
.stat { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stat .v { font-size: 28px; font-family: var(--display); 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: 6px; }
.rankrow { display: flex; align-items: center; gap: 8px; background: var(--bg2); border-radius: 9px; padding: 5px 8px; font-size: 14px; }
.rankrow img { width: 30px; height: 40px; object-fit: cover; border-radius: 4px; }
.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); border-radius: 10px; padding: 8px 10px; margin-bottom: 6px; }
.loop img { width: 34px; height: 46px; object-fit: cover; border-radius: 4px; }
.loop .arrow { color: var(--t-a); }
.explain { color: var(--muted); font-size: 14px; max-width: 760px; }

/* ---------- compare ---------- */
#compareView { padding: 26px 22px 90px; }
#compareForm { max-width: 900px; margin: 0 auto 10px; }
#compareForm h2 { font-family: var(--display); font-weight: 400; font-size: 30px; margin: 6px 0 6px; }
#compareForm > p { margin: 0 0 16px; max-width: 75ch; }
#compareForm .row2 { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
#compareForm input[type=text] { padding: 12px 14px; flex: 1; min-width: 200px; }
.match { max-width: 980px; margin: 18px auto 8px; display: grid; grid-template-columns: auto 1fr; gap: 26px; align-items: center; background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; padding: 20px 24px; }
.match .pct { font-family: var(--display); font-size: 64px; line-height: 1; }
.match .pct small { font-size: 26px; }
.match h3 { margin: 0 0 4px; font-size: 18px; }
.match p { margin: 0; color: var(--muted); }
.meter { height: 8px; border-radius: 4px; background: var(--panel2); margin-top: 10px; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--t-s), var(--t-b), var(--t-d)); }
.cmp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.cmp-col h3 { font-family: var(--display); font-weight: 400; margin: 0 0 8px; }
.cmp-col .row .label { width: 60px; flex-basis: 60px; 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; border-radius: 3px; margin-right: 5px; vertical-align: -2px; }
.disagree, .recs { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; }
.dis { display: flex; align-items: center; gap: 10px; background: var(--bg2); border-radius: 10px; padding: 7px 10px; }
.dis img { width: 36px; height: 48px; object-fit: cover; border-radius: 5px; }
.dis .t { flex: 1; font-size: 14px; }
.dis .sc { font-family: var(--display); }
.cmp-section { margin: 0 auto; }
#cmpOut { max-width: 1240px; margin: 0 auto; }
.cmp-section h3 { font-family: var(--display); font-weight: 400; margin: 30px 0 6px; }

/* ---------- group ---------- */
#groupView { max-width: 1100px; margin: 0 auto; padding: 30px 24px 90px; }
#groupView h2 { font-family: var(--display); font-weight: 400; font-size: 30px; 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: 12px; padding: 8px 8px 8px 14px; max-width: 100%; }
.sharebox code { font-family: var(--font); font-weight: 700; color: var(--t-d); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46ch; }
.people { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.person { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 99px; background: var(--bg2); border: 1px solid var(--line); font-size: 14px; }
.person .av { width: 26px; height: 26px; border-radius: 50%; 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: 3px; bottom: 36px; display: flex; gap: 2px; }
.tile .spread i { width: 7px; height: 7px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.4); }
body.nocaps .tile .spread { bottom: 4px; }
.pairs { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.pair { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; display: flex; justify-content: space-between; gap: 8px; }
.pair b { font-family: var(--display); font-weight: 400; }
.empty { text-align: center; color: var(--muted); padding: 50px 20px; border: 1px dashed var(--line2); border-radius: 14px; }

/* ---------- modal + toast ---------- */
#modal { position: fixed; inset: 0; background: rgba(8,6,20,.62); z-index: 200; display: flex; align-items: center; justify-content: center; }
#modalBox { background: var(--panel); border: 1px solid var(--line2); border-radius: 16px; padding: 22px; width: min(480px, 92vw); box-shadow: 0 30px 60px -20px rgba(0,0,0,.8); }
#modalBox h3 { margin: 0 0 10px; font-family: var(--display); font-weight: 400; font-size: 22px; }
#modalBox input[type=text] { width: 100%; }
#toast { position: fixed; bottom: 32px; left: 50%; transform: translate(-50%, 8px); background: #2e2958; border: 1px solid var(--line2); padding: 10px 18px; border-radius: 12px; z-index: 300; opacity: 0; transition: opacity .2s, transform .2s var(--ease); pointer-events: none; max-width: min(640px, 90vw); text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.colors { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 14px; }
.colors button { width: 30px; height: 30px; border-radius: 8px; 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: 3px; top: 3px; background: rgba(0,0,0,.65); color: #ddd; padding: 0 4px; border-radius: 4px; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 30px; padding-top: 36px; }
  .hero-art { display: none; }
  .modes { grid-template-columns: 1fr 1fr; }
  .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; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
