:root {
  --bg: #07090d;
  --panel: #0e1218;
  --card: #141922;
  --line: #1f2632;
  --line-2: #2e3746;
  --text: #eef2f6;
  --muted: #8691a3;
  --lime: #b6ff3b;
  --cyan: #36e2f5;
  --lime-soft: rgba(182, 255, 59, .1);
  --cyan-soft: rgba(54, 226, 245, .1);
  --on-accent: #0b1200;
  --good: #4ade80;
  --warn: #facc15;
  --bad: #f87171;
  --radius: 12px;
  --display: 'Chakra Petch', system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; } /* nothing may push the page sideways */
@supports not (overflow: clip) { html { overflow-x: hidden; } }
body {
  margin: 0; min-height: 100vh; color: var(--text); background-color: var(--bg);
  background-image:
    radial-gradient(700px 420px at 85% -80px, rgba(54, 226, 245, .12), transparent 70%),
    radial-gradient(600px 380px at 5% 0, rgba(182, 255, 59, .08), transparent 70%),
    linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px);
  background-size: auto, auto, 44px 44px, 44px 44px;
  background-attachment: fixed;
  font: 15px/1.5 Inter, system-ui, sans-serif;
}
a { color: var(--cyan); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.pill:focus-visible, .seg button:focus-visible, .close:focus-visible { outline-offset: -2px; }
.search input:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 max(24px, env(safe-area-inset-right)) 0 max(24px, env(safe-area-inset-left)); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.label { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

/* Header */
.wrap.top { padding-top: calc(20px + env(safe-area-inset-top, 0px)); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lib-pill { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 999px; background: var(--cyan-soft); border: 1px solid rgba(54, 226, 245, .55); color: var(--cyan); font-size: 13px; font-weight: 600; transition: border-color .15s, box-shadow .15s; }
@media (hover: hover) { .lib-pill:hover { border-color: var(--cyan); box-shadow: 0 0 18px rgba(54, 226, 245, .2); } }
.lib-pill svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; flex: none; }
.logo { display: inline-flex; align-items: center; gap: 8px; font: 700 20px var(--display); color: var(--text); text-decoration: none; letter-spacing: .3px; }
.logo-mark {
  flex: none; width: 28px; height: 28px; border-radius: 8px;
  background: var(--lime); box-shadow: 0 0 18px rgba(182, 255, 59, .45);
}
.logo-mark svg { display: block; width: 100%; height: 100%; fill: var(--on-accent); }
/* Trim the font's built-in space so the capitals centre exactly on the mark. */
.logo-word { line-height: 1; text-box: trim-both cap alphabetic; }

/* Hero */
.hero { padding: 36px 0 28px; }
.kicker { margin: 0 0 12px; font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--cyan); }
.hero-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.hero h1 { font: 700 clamp(34px, 5vw, 56px)/1.02 var(--display); letter-spacing: -.5px; margin: 0; text-transform: uppercase; }
.hero h1 em { font-style: normal; color: var(--lime); text-shadow: 0 0 28px rgba(182, 255, 59, .35); }
.quick { display: grid; gap: 10px; width: 210px; flex: none; }
.hero-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; }
.search { position: relative; flex: 0 1 460px; }
.search svg { position: absolute; left: 14px; top: 50%; width: 17px; transform: translateY(-50%); fill: var(--muted); }
.search input {
  width: 100%; height: 42px; padding: 0 14px 0 40px; font-size: 15px; outline: none;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); transition: border-color .15s, box-shadow .15s;
}
.search input:focus { border-color: var(--lime); box-shadow: 0 0 0 3px var(--lime-soft); }
.search input::placeholder { color: var(--muted); }

.quick-btn {
  display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 18px 0 10px; white-space: nowrap;
  font: 700 15px var(--display); letter-spacing: .2px;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); transition: transform .15s, border-color .15s, box-shadow .15s;
}
.qt-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; font-size: 17px; }
.quick-btn.roll { background: var(--lime); border-color: var(--lime); color: var(--on-accent); box-shadow: 0 0 22px rgba(182, 255, 59, .22); }
.roll .qt-icon { background: rgba(11, 18, 0, .14); }
.squad .qt-icon, .lib .qt-icon { background: var(--cyan-soft); box-shadow: inset 0 0 0 1px rgba(54, 226, 245, .35); }
@media (hover: hover) { .roll:hover { box-shadow: 0 0 30px rgba(182, 255, 59, .4); transform: translateY(-2px); } }
@media (hover: hover) { .squad:hover, .lib:hover { border-color: var(--cyan); box-shadow: 0 0 24px rgba(54, 226, 245, .15); transform: translateY(-2px); } }

/* Sort tabs (under the search row) */
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.seg[hidden] { display: inline-flex; visibility: hidden; }
.seg button { white-space: nowrap; padding: 6px 14px; border: 0; border-radius: 7px; background: none; color: var(--muted); font-size: 13px; font-weight: 600; }
@media (hover: hover) { .seg button:hover { color: var(--text); } }
.seg button.on { background: var(--lime); color: var(--on-accent); }

/* Browse: filter sidebar + results */
.browse { display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 28px; align-items: start; }
.filters {
  position: sticky; top: 71px; max-height: calc(100vh - 87px); overflow-y: auto; scrollbar-width: thin;
  display: grid; gap: 18px; padding: 16px;
  background: rgba(14, 18, 24, .7); border: 1px solid var(--line); border-radius: 14px;
}
.f-body { display: grid; gap: 18px; }
.f-block { display: grid; gap: 8px; }
.f-toggle { display: none; }
.vibes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.vibe {
  display: flex; align-items: center; gap: 7px; min-width: 0; height: 36px; padding: 0 8px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; font-size: 12.5px; font-weight: 600; white-space: nowrap;
  transition: border-color .12s, background .12s;
}
.vibe .vi { font-size: 15px; line-height: 1; flex: none; }
@media (hover: hover) { .vibe:hover { border-color: var(--line-2); } }
.vibe.on { border-color: var(--lime); background: var(--lime-soft); box-shadow: inset 0 0 0 1px var(--lime); }
.pills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; padding: 3px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.pill { min-width: 0; white-space: nowrap; padding: 6px 2px; border: 0; border-radius: 7px; background: none; color: #c3cad6; font-size: 13px; font-weight: 600; }
@media (hover: hover) { .pill:hover { color: var(--text); background: var(--card); } }
.pill.on { background: var(--cyan); color: #00161a; }
#players { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.link-btn { justify-self: start; background: none; border: 0; color: var(--muted); text-decoration: underline; font-size: 13px; padding: 0; }
@media (hover: hover) { .link-btn:hover { color: var(--text); } }
.results h2 { font: 700 22px var(--display); margin: 0 0 14px; text-transform: uppercase; letter-spacing: .3px; line-height: 1.2; }

/* Sticky mini bar (appears once the hero search scrolls away) */
.minibar {
  position: fixed; inset: 0 0 auto; z-index: 20; padding: calc(8px + env(safe-area-inset-top, 0px)) 0 8px;
  background: rgba(7, 9, 13, .86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  transform: translateY(-100%); opacity: 0; transition: transform .2s, opacity .2s;
}
.minibar.show { transform: none; opacity: 1; }
.minibar-in { display: flex; align-items: center; gap: 14px; }
.minibar .logo { font-size: 17px; }
.minibar .logo-mark { width: 24px; height: 24px; box-shadow: 0 0 12px rgba(182, 255, 59, .4); }
.search--mini { flex: 0 1 380px; margin-left: auto; }
.search--mini input { height: 38px; font-size: 14px; }
.mini-roll { height: 38px; padding: 0 14px 0 6px; font-size: 14px; gap: 8px; }
.mini-roll .qt-icon { width: 26px; height: 26px; font-size: 14px; border-radius: 7px; }
#browse { scroll-margin-top: 72px; }

/* Back to top: the logo's play mark, pointed up */
.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 15;
  display: flex; align-items: center; gap: 9px; height: 44px; padding: 0 16px 0 8px;
  font: 700 13px var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--text);
  background: rgba(14, 18, 24, .92); backdrop-filter: blur(8px); border: 1px solid var(--line-2); border-radius: 12px;
  opacity: 0; transform: translateY(12px); transition: opacity .2s, transform .2s, border-color .15s, box-shadow .15s;
}
.to-top.show { opacity: 1; transform: none; }
.tt-mark {
  flex: none; width: 28px; height: 28px; border-radius: 8px;
  background: var(--lime); color: var(--on-accent); box-shadow: 0 0 14px rgba(182, 255, 59, .45);
}
.tt-mark svg { display: block; width: 100%; height: 100%; fill: var(--on-accent); }
@media (hover: hover) { .to-top:hover { border-color: var(--lime); box-shadow: 0 0 22px rgba(182, 255, 59, .2); } }
@media (hover: hover) { .to-top:hover .tt-mark { animation: nudge .5s ease-in-out infinite alternate; } }
@keyframes nudge { to { transform: translateY(-3px); } }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.card {
  display: flex; flex-direction: column; padding: 0; text-align: left; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; transition: transform .18s, border-color .18s, box-shadow .18s;
}
.card:focus-visible { border-color: var(--line-2); box-shadow: 0 14px 30px rgba(0, 0, 0, .5); }
@media (hover: hover) { .card:hover { border-color: var(--line-2); box-shadow: 0 14px 30px rgba(0, 0, 0, .5); } }
/* The wrapper lifts, so the bookmark beside the card moves with it. */
.card-wrap { position: relative; display: flex; transition: transform .18s; }
.card-wrap > .card { flex: 1; min-width: 0; transition: border-color .18s, box-shadow .18s; }
.card-wrap:has(.card:focus-visible) { transform: translateY(-3px); }
@media (hover: hover) { .card-wrap:has(.card:hover) { transform: translateY(-3px); } }
.save { position: absolute; top: 2px; left: 2px; z-index: 2; width: 44px; height: 44px; display: grid; place-items: center; background: none; border: 0; padding: 0; }
.save-dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .7); color: var(--text); transition: background .15s, color .15s; }
@media (hover: hover) { .save:hover .save-dot { background: rgba(0, 0, 0, .9); color: var(--lime); } }
.save svg, .save-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; flex: none; }
.save.saved .save-dot { background: var(--lime); color: var(--on-accent); }
.save.saved svg, .save-btn.saved svg { fill: currentColor; }
.save-btn.saved { border-color: var(--lime); color: var(--lime); }
.lib-count { margin-left: 2px; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--lime); color: var(--on-accent); font: 700 12px var(--display); text-align: center; }
.minibar .lib-count { display: none; }

/* Library dialog */
.lib-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; padding-right: 40px; }
.lib-tab { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line-2); color: #c3cad6; font-size: 13px; font-weight: 600; }
@media (hover: hover) { .lib-tab:hover { color: var(--text); border-color: var(--muted); } }
.lib-tab.on { background: var(--cyan); border-color: var(--cyan); color: #00161a; }
.lib-n { flex: none; font-size: 12px; opacity: .75; }
.lib-tab { max-width: 100%; }
.lib-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-add { border-style: dashed; background: none; color: var(--muted); }
.lib-tools { display: flex; gap: 16px; margin: -4px 0 8px; }
.lib-tools .link-btn { min-height: 36px; }
@media (hover: hover) { .lib-del:hover { color: var(--bad); } }
.lib-form { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.lib-input { flex: 1 1 180px; min-width: 0; height: 40px; padding: 0 12px; font-size: 16px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; outline: none; }
.lib-input:focus { border-color: var(--lime); box-shadow: 0 0 0 3px var(--lime-soft); }
.lib-form .btn, .lib-confirm .btn { height: 40px; justify-content: center; }
.lib-err { margin: 0 0 8px; font-size: 13px; color: var(--bad); }
.lib-confirm { margin: 0 0 8px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--card); }
.lib-confirm p { margin: 0 0 10px; font-size: 14px; overflow-wrap: anywhere; }
.lib-confirm-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.lib-danger { border-color: var(--bad); color: var(--bad); }
.lib-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 0; border-top: 1px solid var(--line); }
.lib-open { flex: 1 1 220px; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 0; background: none; border: 0; text-align: left; color: var(--text); }
.lib-art { flex: none; width: 72px; height: 48px; border-radius: 8px; background: #1a202b center / cover no-repeat; }
.lib-text { min-width: 0; display: grid; gap: 2px; }
.lib-text b { font: 700 15px/1.25 var(--display); overflow-wrap: anywhere; }
.lib-text small { font-size: 12.5px; color: var(--muted); }
@media (hover: hover) { .lib-open:hover b { color: var(--lime); } }
.lib-ctl { display: flex; align-items: center; gap: 12px; }
.lib-rm { min-height: 40px; padding: 0 4px; }
.lib-io { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.lib-io .btn { height: 40px; justify-content: center; }
.lib-note { margin: 12px 0 0; font-size: 12.5px; color: var(--muted); }
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 100; transform: translate(-50%, 12px);
  max-width: min(92vw, 420px); padding: 10px 16px; border-radius: 12px; background: var(--card); border: 1px solid var(--lime);
  color: var(--text); font-size: 13.5px; text-align: center; opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.art { aspect-ratio: 16 / 10; background: #1a202b center / cover no-repeat; position: relative; display: flex; align-items: flex-end; }
.art-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(7, 9, 13, .92)); }
.art .card-title { position: relative; z-index: 1; padding: 0 12px; margin-bottom: 10px; }
.card-title { font: 700 17px/1.2 var(--display); margin: 0; letter-spacing: .2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.badges { position: absolute; top: 8px; right: 8px; z-index: 1; display: flex; gap: 4px; }
.score, .free-tag { font: 700 12px var(--display); padding: 2px 7px; border-radius: 6px; background: rgba(0, 0, 0, .75); }
.score.g { color: var(--good); } .score.y { color: var(--warn); } .score.r { color: var(--bad); }
.free-tag { background: var(--lime); color: var(--on-accent); }
.card-body { padding: 10px 12px 12px; display: grid; gap: 8px; }
.card-meta { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mode-txt { color: var(--cyan); }
.plat { font-size: 10.5px; font-weight: 600; padding: 2px 6px; border-radius: 5px; background: #1e2531; color: #aab3c4; }

.skeleton .art, .skeleton .sk { background: linear-gradient(90deg, #12161e 0%, #1c222d 50%, #12161e 100%); background-size: 200% 100%; animation: sh 1.2s infinite; }
.skeleton .art::after { display: none; }
.skeleton .sk { height: 12px; border-radius: 6px; }
@keyframes sh { to { background-position: -200% 0; } }
.sentinel { height: 1px; }
.message { text-align: center; padding: 50px 20px; color: var(--muted); }
.message h3 { color: var(--text); font: 700 20px var(--display); margin: 0 0 6px; }
.foot { padding: 50px 24px 30px; color: var(--muted); font-size: 13px; text-align: center; }
.foot-note { margin: 8px auto 0; max-width: 560px; font-size: 12px; line-height: 1.5; }

/* Modals */
.modal {
  width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0;
  background: var(--panel); color: var(--text); border: 1px solid var(--line-2); border-radius: 18px; overflow: auto;
}
.modal--small { width: min(480px, calc(100vw - 32px)); }
.modal--mid { width: min(680px, calc(100vw - 32px)); }
.modal::backdrop { background: rgba(3, 4, 6, .8); backdrop-filter: blur(4px); }
.modal[open] { animation: pop .18s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.close {
  position: sticky; float: right; top: 12px; margin: 12px 12px -48px 0; z-index: 3;
  width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); font-size: 15px;
}
.m-pad { padding: 24px; }
.m-title { font: 700 22px var(--display); margin: 0 0 16px; text-transform: uppercase; }

.d-hero { aspect-ratio: 16 / 7; background: var(--card) center / cover; position: relative; }
.d-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 40%, var(--panel)); }
.d-main { padding: 0 26px 26px; margin-top: -40px; position: relative; }
.d-main h2 { font: 700 30px/1.1 var(--display); margin: 0 0 6px; }
.d-sub { color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; font-size: 14px; }
.modes { display: flex; flex-wrap: wrap; gap: 5px; }
.mode { font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; border: 1px solid rgba(54, 226, 245, .4); color: var(--cyan); }
.d-desc { color: #c5ccd8; margin: 14px 0 18px; }
.d-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px 22px; margin: 0 0 20px; }
.d-facts dt { margin-bottom: 4px; }
.d-facts dd { margin: 0; }
.d-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 10px;
  background: var(--card); border: 1px solid var(--line-2); color: var(--text); text-decoration: none; font-weight: 600; font-size: 13px;
}
@media (hover: hover) { .btn:hover { border-color: var(--muted); } }
.btn.primary { background: var(--lime); border-color: var(--lime); color: var(--on-accent); }

/* Roll */
.r-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.r-filters select, .lib-move {
  width: 100%; height: 40px; padding: 0 28px 0 12px; border-radius: 10px; appearance: none; font-size: 13px;
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238691a3' stroke-width='2' fill='none'/%3E%3C/svg%3E") no-repeat right 10px center;
  border: 1px solid var(--line-2); color: var(--text);
}
#rResult:empty { display: none; }
#rResult { margin-bottom: 14px; }
#rResult.stale .card { opacity: .45; filter: grayscale(.7); box-shadow: none; border-color: var(--line-2); transition: opacity .15s, filter .15s; }
#rResult .card { width: 100%; border-color: var(--lime); box-shadow: 0 0 30px rgba(182, 255, 59, .12); animation: pop .25s ease-out; }
#rResult .card-title { font-size: 22px; }
.r-share { width: 100%; justify-content: center; margin-top: 8px; }
.hint { font-size: 12px; color: var(--lime); font-weight: 600; }
.btn-roll {
  width: 100%; height: 50px; border: 0; border-radius: 12px; font: 700 17px var(--display); letter-spacing: .5px; text-transform: uppercase;
  background: var(--lime); color: var(--on-accent); box-shadow: 0 0 24px rgba(182, 255, 59, .3);
}
.btn-roll:disabled { opacity: .6; cursor: wait; }

/* Squad */
.t-progress { display: flex; gap: 6px; margin: 0 48px 20px 0; }
.t-progress i { flex: 1; height: 4px; border-radius: 4px; background: var(--line-2); }
.t-progress i.on { background: var(--cyan); box-shadow: 0 0 10px rgba(54, 226, 245, .5); }
.squad-q { font: 700 24px/1.2 var(--display); margin: 0 0 4px; }
.lead { color: var(--muted); margin: 0 0 18px; }
.t-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.t-opt { padding: 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card); text-align: left; transition: border-color .12s, transform .12s; }
@media (hover: hover) { .t-opt:hover { border-color: var(--cyan); transform: translateY(-2px); } }
.t-opt .e { font-size: 22px; display: block; margin-bottom: 4px; }
.t-opt b { display: block; }
.t-opt small { color: var(--muted); }
.t-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 20px; }
.t-picks { display: grid; gap: 10px; }
.t-picks .card { display: grid; grid-template-columns: 180px 1fr; }
.t-picks .art { aspect-ratio: auto; min-height: 104px; }
.t-picks .art::after { display: none; }
.t-picks .card-wrap:first-child .card { border-color: var(--cyan); box-shadow: 0 0 24px rgba(54, 226, 245, .15); }
.intro { color: var(--text); font-size: 14px; margin: -8px 0 18px; }
.pick-note { display: block; font-size: 12px; color: var(--muted); line-height: 1.35; }
.top-pick { font-size: 12px; font-weight: 700; color: var(--cyan); text-transform: uppercase; letter-spacing: .12em; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--line-2); border-top-color: var(--lime); border-radius: 50%; animation: spin .8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .browse { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .filters { position: static; max-height: none; overflow: visible; }
  .filters { padding: 0; gap: 0; }
  .f-toggle {
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; text-align: left;
    background: none; border: 0; border-radius: 14px;
  }
  .f-summary { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; }
  .f-caret { color: var(--muted); transition: transform .15s; }
  .filters.open .f-caret { transform: rotate(180deg); }
  .f-body { display: none; padding: 4px 14px 14px; }
  .filters.open .f-body { display: grid; }
  .vibes { display: flex; flex-wrap: wrap; }
  .vibe { flex: 0 1 auto; }
  .pills, #players { display: inline-flex; flex-wrap: wrap; justify-self: start; }
  .pill { padding: 5px 11px; }
}
@media (max-width: 760px) {
  .hero { padding: 28px 0 22px; }
  .hero-top { flex-direction: column; align-items: stretch; gap: 18px; margin-bottom: 14px; }
  .quick { width: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-btn { justify-content: center; }
  .hero-tools .search { flex-basis: 100%; }
}
@media (max-width: 600px) {
  .wrap { padding: 0 max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left)); }
  /* iPhones zoom the page when a text box under 16px gets focus, and stay zoomed (sideways scroll). */
  input, select, textarea { font-size: 16px !important; }
  .wrap.top { padding-top: calc(16px + env(safe-area-inset-top, 0px)); padding-bottom: 4px; }
  .quick-btn { height: 48px; font-size: 14px; }
  .minibar-in { gap: 10px; }
  .minibar .logo-word, .mini-label, .lib-label { display: none; }
  .lib-pill { min-width: 44px; justify-content: center; padding: 0 12px; }
  .search--mini { flex: 1; }
  .mini-roll { height: 38px; padding: 0 6px; }
  .to-top { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); }
  .seg { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); width: 100%; }
  .seg[hidden] { display: grid; }
  .seg button { padding: 6px 2px; font-size: 12.5px; }
  .pills, #players { display: grid; justify-self: stretch; }
  .pill { padding: 6px 2px; }
  .vibe { height: 34px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .card-title { font-size: 14px; }
  .card-body { padding: 8px 10px 10px; }
  .r-filters { grid-template-columns: 1fr; }
  .t-options { grid-template-columns: 1fr 1fr; }
  .t-picks .card { grid-template-columns: 120px 1fr; }
  .d-main { padding: 0 18px 20px; }
  .d-main h2 { font-size: 24px; }
}
@media (pointer: coarse), (max-width: 600px) {
  .seg button, .pill { min-height: 44px; }
  .vibe, .mini-roll { height: 44px; }
  .lib-tab, .lib-open, .lib-pill { min-height: 44px; }
  .lib-tools .link-btn, .lib-input, .lib-form .btn, .lib-confirm .btn, .lib-io .btn { min-height: 44px; }
  .lib-move { height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .spinner { animation: spin 2.4s linear infinite !important; }
}

/* Crossplay tag (Squad pick) */
.xp { display: inline-block; margin-top: 6px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--cyan); border: 1px solid rgba(54, 226, 245, .45); }

/* Group room */
.xp-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.xp-chip { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card); font-weight: 600; }
.xp-chip.on { border-color: var(--cyan); color: var(--cyan); }
.field { width: 100%; height: 44px; margin: 6px 0 16px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--card); color: var(--text); font: inherit; }
.field:focus { outline: 2px solid var(--cyan); outline-offset: 1px; }
.room-error { min-height: 1.3em; margin: 12px 0 0; color: #ff6b6b; font-size: 14px; }
.room-code, .room-code-sm { font-family: var(--display); letter-spacing: .12em; color: var(--cyan); }
.room-link { display: flex; gap: 8px; align-items: flex-start; }
.room-link .field { flex: 1; min-width: 0; }
.room-link .btn { height: 44px; margin-top: 6px; white-space: nowrap; }
.room-players { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.room-players li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--card); }
.room-players li > b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-players li > small, .room-players .top-pick { flex: none; }
.room-players .pick-note { margin-left: auto; flex: none; }
.room-wait { margin: 16px 0 0; color: var(--muted); }

/* Voting */
.room-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 16px 0 4px; }
.room-actions .room-wait { margin: 0; width: 100%; }
.vote-send { width: 100%; margin-top: 16px; }
.vote-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 4px; }
.vote-card { display: grid; grid-template-columns: 110px 1fr; gap: 0; text-align: left; padding: 0; overflow: hidden; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card); color: var(--text); transition: border-color .12s, transform .12s; }
@media (hover: hover) { .vote-card:not(:disabled):hover { border-color: var(--cyan); transform: translateY(-2px); } }
.vote-card:disabled { cursor: default; }
.vote-card img, .vote-noimg { width: 110px; height: 100%; min-height: 72px; object-fit: cover; background: var(--line-2); }
.vote-body { display: grid; gap: 6px; align-content: center; padding: 10px 14px; min-width: 0; }
.vote-body b { overflow-wrap: anywhere; }
.vote-body small { color: var(--muted); }
.vote-bar { display: block; height: 6px; border-radius: 6px; background: var(--line-2); overflow: hidden; }
.vote-bar i { display: block; height: 100%; background: var(--cyan); transition: width .25s; }
.vote-card.mine { border-color: var(--cyan); box-shadow: 0 0 20px rgba(54, 226, 245, .15); }
.vote-card.won { border-color: var(--lime); box-shadow: 0 0 24px rgba(182, 255, 59, .25); }
.vote-card.won .vote-bar i { background: var(--lime); }

/* Squad Pick mode chooser */
.mode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-top: 4px; }
.mode-card { display: grid; gap: 6px; align-content: start; text-align: left; padding: 16px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--card); color: var(--text); transition: border-color .12s, transform .12s, box-shadow .12s; }
@media (hover: hover) { .mode-card:hover { border-color: var(--cyan); transform: translateY(-2px); box-shadow: 0 0 24px rgba(54, 226, 245, .15); } }
.mode-card b { font: 700 18px var(--display); }
.mode-card small { color: var(--muted); font-size: 14px; line-height: 1.35; }
.mode-ico { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 4px; border-radius: 10px; color: var(--cyan); background: var(--cyan-soft); box-shadow: inset 0 0 0 1px rgba(54, 226, 245, .35); }


/* Touch: no double-tap delay or grey tap flash; a pressed state so a tap answers instantly. */
button, a, input, select, summary, [role="button"], [role="radio"] { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.btn:active, .quick-btn:active, .lib-pill:active, .t-opt:active, .mode-card:active, .vote-card:not(:disabled):active,
.xp-chip:active, .pill:active, .seg button:active, .save:active, .to-top:active, .lib-tab:active, .card:active { transform: scale(.97); transition-duration: .06s; }
.btn[disabled], .btn.is-busy { opacity: .6; pointer-events: none; }

@media (max-width: 360px) {
  .wrap { padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); }
}
