/* Draft Room: dark, sharp-edged, one accent. Radius is 0 everywhere. */
:root {
  --bg: #0c0e12;
  --panel: #12151b;
  --panel-2: #181c24;
  --line: #242a34;
  --line-2: #323a47;
  --text: #eceef2;
  --muted: #9099a8;
  --dim: #646d7c;
  --accent: #c9f23a;
  --accent-soft: rgba(201, 242, 58, .14);
  --accent-ink: #0c0e12;
  --danger: #ff6b5b;
  --display: "Archivo", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --gutter: clamp(16px, 3vw, 40px);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--display);
  font-variation-settings: "wdth" 100;
  font-size: 15px;
  line-height: 1.45;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
img { display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ph { line-height: 1; }

/* ---------- type ---------- */
.condensed { font-variation-settings: "wdth" 62; }
.mono { font-family: var(--mono); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border: 1px solid var(--line-2);
  font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: background .2s var(--ease), border-color .2s var(--ease), transform .1s;
}
.btn:hover { border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn:disabled { cursor: default; color: var(--muted); border-color: var(--line-2); background: none; transform: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.team-range { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.btn-primary:hover { background: #d8ff52; border-color: #d8ff52; }
.btn-ghost { border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); border-color: var(--line-2); }
.btn-danger { color: var(--danger); border-color: transparent; }
.btn-danger:hover { border-color: var(--danger); }
.icon-btn {
  width: 40px; height: 40px; display: inline-grid; place-items: center;
  color: var(--muted); border: 1px solid transparent; font-size: 18px;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-2); }

/* ---------- login ---------- */
.login {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 1fr);
}
.login-art {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 1fr; gap: 2px;
  background: var(--bg);
}
.login-art img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.1) brightness(.55); }
.login-art img.lit { filter: none; }
.login-art::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 55%, var(--bg));
}
.login-form {
  display: flex; flex-direction: column; justify-content: center;
  padding: var(--gutter); gap: 28px; max-width: 460px;
}
.login-form h1 {
  font-size: clamp(56px, 7vw, 96px); line-height: .9; font-weight: 900;
  font-variation-settings: "wdth" 62; letter-spacing: -.01em; text-transform: uppercase;
}
.login-form h1 span { color: var(--accent); }
.login-form p { color: var(--muted); max-width: 34ch; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 600; }
.input {
  height: 48px; padding: 0 14px; background: var(--panel); border: 1px solid var(--line-2);
  font-size: 16px; width: 100%;
}
.input::placeholder { color: var(--dim); }
.input:focus { outline: none; border-color: var(--accent); }
.error-text { color: var(--danger); font-size: 13px; min-height: 18px; }

/* ---------- shell ---------- */
.topbar {
  height: 64px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--gutter); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20; background: rgba(12, 14, 18, .92);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.wordmark {
  font-weight: 900; font-size: 26px; text-transform: uppercase; letter-spacing: .01em;
  font-variation-settings: "wdth" 62;
}
.wordmark span { color: var(--accent); }
.topbar-actions { display: flex; align-items: center; gap: 4px; }

main { padding: 0 var(--gutter) 80px; max-width: 1600px; margin: 0 auto; }

/* ---------- player strip ---------- */
.players {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
  border-bottom: 1px solid var(--line);
  margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter);
}
.ptab {
  text-align: left; padding: 22px 20px 18px 0; position: relative;
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.ptab::after {
  content: ""; position: absolute; left: 0; right: 20px; bottom: -1px; height: 3px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform .35s var(--ease);
}
.ptab[aria-selected="true"]::after { transform: scaleX(1); }
.ptab-name {
  font-size: 30px; font-weight: 800; line-height: 1; text-transform: uppercase;
  font-variation-settings: "wdth" 62; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--muted); transition: color .2s;
}
.ptab:hover .ptab-name, .ptab[aria-selected="true"] .ptab-name { color: var(--text); }
.ptab-meta { font-family: var(--mono); font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ptab-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ptab.has-medal { flex-direction: row; align-items: center; gap: 10px; }

/* rank medal: medal art with the star overlay stacked on the same canvas */
.medal { position: relative; width: 44px; height: 44px; flex-shrink: 0; display: inline-block; }
.medal img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.medal-xl { width: 96px; height: 96px; }
.ptab .medal { opacity: .55; transition: opacity .2s; }
.ptab:hover .medal, .ptab[aria-selected="true"] .medal { opacity: 1; }
.rank-preview { display: flex; align-items: center; gap: 18px; }
.rank-name { font-size: 34px; font-weight: 900; line-height: 1; text-transform: uppercase; font-variation-settings: "wdth" 62; margin-bottom: 6px; }
.medal-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.medal-opt {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px 8px;
  border: 1px solid var(--line-2); font-size: 12px; font-weight: 600; color: var(--muted); transition: all .15s;
}
.medal-opt .medal { width: 52px; height: 52px; }
.medal-opt:hover { color: var(--text); border-color: var(--muted); }
.medal-opt[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.players-add { display: flex; align-items: center; padding-left: 12px; }

/* ---------- view header ---------- */
.viewbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 28px 0 20px;
}
.viewbar h2 { font-size: 15px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.viewbar h2 strong { color: var(--text); }
.viewbar h2 { flex-wrap: wrap; }
.rename {
  display: inline-flex; align-items: center; gap: 6px; color: var(--dim); font-size: 13px; padding: 4px 8px;
  border: 1px solid transparent;
}
.rename:hover { color: var(--text); border-color: var(--line-2); }
.rename-input { height: 34px; width: 180px; font-size: 15px; }

/* ---------- role board ---------- */
.board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; border-left: 1px solid var(--line); }
.col { border-right: 1px solid var(--line); min-width: 0; display: flex; flex-direction: column; }
.col-head {
  padding: 4px 16px 16px; display: grid; grid-template-columns: auto 1fr; align-items: end; gap: 12px;
  border-bottom: 1px solid var(--line);
}
.col-num {
  font-size: 84px; font-weight: 900; line-height: .8; font-variation-settings: "wdth" 62;
  color: transparent; -webkit-text-stroke: 1.5px var(--line-2);
  transition: -webkit-text-stroke-color .3s;
}
.col:hover .col-num { -webkit-text-stroke-color: var(--accent); }
.col-label { display: flex; flex-direction: column; gap: 2px; padding-bottom: 4px; }
.col-label b { font-size: 17px; font-weight: 700; }
.col-label span { font-family: var(--mono); font-size: 12px; color: var(--dim); }
.col-body { padding: 12px 0 24px; display: flex; flex-direction: column; }
.tier-label {
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--dim); padding: 14px 16px 6px;
}
.tier-label.t3 { color: var(--accent); }

.hrow {
  display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 12px;
  padding: 6px 16px 6px 13px; border-left: 3px solid var(--line-2); text-align: left; width: 100%;
  transition: background .15s;
}
.hrow-wrap { position: relative; display: flex; align-items: center; }
.hrow-wrap .hrow { padding-right: 44px; }
.hrow-wrap:hover .hrow { background: var(--panel-2); }
.hrow-x {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; display: grid; place-items: center;
  color: var(--dim); border: 1px solid transparent; font-size: 14px; transition: color .15s, border-color .15s;
}
.hrow-wrap:hover .hrow-x { color: var(--muted); }
.hrow-x:hover, .hrow-x:focus-visible { color: var(--danger) !important; border-color: var(--danger); }
#toast { display: flex; align-items: center; gap: 14px; }
.toast-btn { font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.hrow.t3 { border-left-color: var(--accent); }
.hrow.t2 { border-left-color: rgba(201, 242, 58, .38); }
.hrow img { width: 64px; height: 36px; object-fit: cover; background: var(--panel-2); }
.hrow-text { min-width: 0; display: flex; flex-direction: column; }
.hrow-name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hrow.t1 .hrow-name { color: var(--muted); font-weight: 600; }
.hrow-sub { font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-empty { padding: 20px 16px; color: var(--dim); font-size: 13px; }
.col-empty button { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.col-empty button:hover { color: var(--accent); }

.empty-state {
  border: 1px dashed var(--line-2); padding: clamp(28px, 6vw, 64px);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center;
}
.empty-state h3 { font-size: clamp(28px, 4vw, 44px); font-weight: 900; line-height: 1; text-transform: uppercase; font-variation-settings: "wdth" 62; }
.empty-state p { color: var(--muted); margin-top: 10px; max-width: 52ch; }

/* skeleton */
.sk { background: linear-gradient(90deg, var(--panel) 0%, var(--panel-2) 50%, var(--panel) 100%); background-size: 200% 100%; animation: sk 1.4s infinite linear; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- overlays ---------- */
.scrim {
  position: fixed; inset: 0; background: rgba(5, 6, 8, .72); z-index: 40;
  opacity: 0; transition: opacity .25s var(--ease);
}
.scrim.open { opacity: 1; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); z-index: 50;
  background: var(--panel); border-left: 1px solid var(--line);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .4s var(--ease);
}
.drawer.open { transform: none; }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 12px 12px 24px; border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.drawer-head h3 { font-size: 15px; font-weight: 600; color: var(--muted); }
.drawer-body { overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.drawer-foot {
  display: flex; gap: 8px; justify-content: space-between; padding: 14px 24px;
  border-top: 1px solid var(--line); flex-shrink: 0; background: var(--panel);
}

/* editor */
.ed-hero { position: relative; }
.ed-hero img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.ed-title { padding: 18px 24px 0; }
.ed-title h2 { font-size: 48px; font-weight: 900; line-height: .95; text-transform: uppercase; font-variation-settings: "wdth" 62; }
.ed-title p { color: var(--dim); font-size: 13px; margin-top: 6px; }
.section { padding: 22px 24px; border-bottom: 1px solid var(--line); }
.section:last-child { border-bottom: 0; }
.section-title { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 14px; display: flex; justify-content: space-between; gap: 8px; }
.section-title span { font-family: var(--mono); font-weight: 400; color: var(--dim); font-size: 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  height: 34px; padding: 0 12px; border: 1px solid var(--line-2); font-size: 13px; font-weight: 600; color: var(--muted);
  transition: all .15s;
}
.chip:hover { color: var(--text); border-color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.posrow { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 0; }
.posrow + .posrow { border-top: 1px solid var(--line); }
.posnum { font-size: 30px; font-weight: 900; line-height: 1; font-variation-settings: "wdth" 62; color: var(--dim); }
.posrow.on .posnum { color: var(--accent); }
.posname { font-weight: 600; }
.seg { display: flex; border: 1px solid var(--line-2); }
.seg button {
  height: 34px; min-width: 52px; padding: 0 10px; font-size: 13px; font-weight: 600; color: var(--dim);
  transition: background .15s, color .15s;
}
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { color: var(--text); background: var(--panel-2); }
.seg button[data-tier="3"][aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.seg button[data-tier="2"][aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }

.intel-top { display: flex; gap: 28px; margin-bottom: 18px; }
.stat b { display: block; font-family: var(--mono); font-size: 22px; font-weight: 600; }
.stat span { font-size: 12px; color: var(--dim); }
.mlist { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 8px; margin-bottom: 18px; }
.mlist:last-child { margin-bottom: 0; }
.mitem { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mitem img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--panel-2); }
.mitem div { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; }
.mitem div span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.mitem .num { font-family: var(--mono); font-weight: 600; }
.num.pos { color: var(--accent); }
.num.neg { color: var(--danger); }
.intel-label { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 8px; }

/* picker */
.picker {
  position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column;
  background: var(--bg); opacity: 0; transform: translateY(12px);
  transition: opacity .25s var(--ease), transform .35s var(--ease);
}
.picker.open { opacity: 1; transform: none; }
.picker-head {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 14px var(--gutter); border-bottom: 1px solid var(--line);
}
.search { position: relative; }
.search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--dim); font-size: 18px; }
.search input { padding-left: 44px; height: 52px; font-size: 18px; }
.picker-tools { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; padding: 12px var(--gutter); border-bottom: 1px solid var(--line); }
.picker-for { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grid {
  overflow-y: auto; flex: 1; padding: 16px var(--gutter) 40px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px 10px; align-content: start;
}
.gcard { text-align: left; display: flex; flex-direction: column; gap: 6px; position: relative; }
.gcard img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--panel); transition: transform .3s var(--ease), filter .2s; }
.gcard:hover img { transform: translateY(-2px); }
.gcard span { font-size: 13px; font-weight: 600; color: var(--muted); }
.gcard:hover span { color: var(--text); }
.gcard.has span { color: var(--accent); }
.gcard.has img { outline: 2px solid var(--accent); outline-offset: -2px; }
.grid-empty { grid-column: 1 / -1; color: var(--dim); padding: 40px 0; }

/* data panel */
.big-number { font-family: var(--mono); font-size: 34px; font-weight: 600; line-height: 1; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 13px; }
.note-input { height: 42px; font-size: 15px; }

/* toast */
#toast {
  position: fixed; left: var(--gutter); bottom: 20px; z-index: 60;
  background: var(--text); color: var(--bg); padding: 10px 16px; font-weight: 600; font-size: 14px;
  transform: translateY(calc(100% + 40px)); visibility: hidden;
  transition: transform .35s var(--ease), visibility 0s .35s;
}
#toast.show { transform: none; visibility: visible; transition: transform .35s var(--ease); }
#toast.err { background: var(--danger); color: #1a0806; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .players { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .players-add { display: none; }
  .board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .col:nth-child(n + 4) { border-top: 1px solid var(--line); }
}
@media (max-width: 767px) {
  body { font-size: 15px; }
  .login { grid-template-columns: 1fr; }
  .login-art { height: 34vh; grid-template-columns: repeat(4, 1fr); }
  .login-art::after { background: linear-gradient(180deg, transparent 40%, var(--bg)); }
  .login-form { padding-top: 0; max-width: none; }
  .players { display: flex; overflow-x: auto; gap: 22px; scrollbar-width: none; }
  .players::-webkit-scrollbar { display: none; }
  .ptab { flex-shrink: 0; padding: 16px 0 14px; }
  .ptab::after { right: 0; }
  .ptab-name { font-size: 24px; }
  .board { grid-template-columns: 1fr; border-left: 0; }
  .col { border-right: 0; border-top: 1px solid var(--line); }
  .col-head { padding: 14px 0; }
  .col-num { font-size: 56px; }
  .hrow { padding-left: 13px; }
  .tier-label { padding-left: 0; }
  .col-empty { padding: 14px 0; }
  .empty-state { grid-template-columns: 1fr; }
  .drawer { top: 6dvh; width: 100vw; border-left: 0; border-top: 1px solid var(--line); transform: translateY(100%); }
  .ed-title h2 { font-size: 40px; }
  .viewbar { padding: 20px 0 12px; }
  .fab {
    position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 30;
    height: 52px; padding: 0 20px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  }
  .grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
  .topbar .label { display: none; }
}
@media (min-width: 768px) { .fab { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
}

/* ---------- page nav ---------- */
.topbar-left { display: flex; align-items: center; gap: 28px; min-width: 0; }
.pages { display: flex; gap: 2px; }
.page-tab {
  height: 36px; padding: 0 14px; font-weight: 700; font-size: 14px; color: var(--muted);
  border: 1px solid transparent; transition: color .15s, border-color .15s;
}
.page-tab:hover { color: var(--text); border-color: var(--line-2); }
.page-tab[aria-current="page"] { color: var(--accent-ink); background: var(--accent); }
.link { color: var(--text); text-decoration: underline; text-underline-offset: 3px; font-size: inherit; }
.link:hover { color: var(--accent); }

/* ---------- draft: setup ---------- */
.setup { max-width: 760px; padding: 36px 0 80px; display: flex; flex-direction: column; gap: 30px; }
.setup-title { font-size: clamp(56px, 8vw, 104px); font-weight: 900; line-height: .88; text-transform: uppercase; font-variation-settings: "wdth" 62; }
.setup-title span { color: var(--accent); }
.setup-block { display: flex; flex-direction: column; gap: 12px; }
.setup-block .section-title { margin-bottom: 0; }
.chip-lg { height: 52px; padding: 0 18px 0 8px; font-size: 16px; display: inline-flex; align-items: center; gap: 8px; }
.medal-sm { width: 36px; height: 36px; }
.seg-lg { align-self: flex-start; }
.seg-lg button { height: 46px; padding: 0 22px; font-size: 15px; }
.setup-go { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; padding-top: 6px; }
.btn-xl { height: 56px; padding: 0 28px; font-size: 17px; }
.btn-primary:disabled { opacity: .4; background: var(--accent); color: var(--accent-ink); }

/* ---------- draft: board ---------- */
.draft { padding-bottom: 60px; }
.dr-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding: 24px 0 18px; flex-wrap: wrap; }
.turn h1 { font-size: clamp(44px, 6vw, 84px); font-weight: 900; line-height: .9; text-transform: uppercase; font-variation-settings: "wdth" 62; }
.turn.us h1 { color: var(--accent); }
.turn .mono { font-size: 13px; display: block; margin-top: 8px; }
.dr-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.btn.armed { border-color: var(--danger); }
.btn:disabled.btn-ghost { border-color: transparent; }

.seq { list-style: none; display: flex; position: relative; align-items: flex-end; gap: 4px; overflow-x: auto; padding: 4px 2px 12px; scrollbar-width: thin; }
.cell {
  flex-shrink: 0; display: grid; place-items: center; background: var(--panel); position: relative;
  font-family: var(--mono); font-size: 11px; color: var(--dim);
}
.cell.pick { width: 46px; height: 46px; }
.cell.ban { width: 34px; height: 34px; }
.cell.gap { margin-left: 12px; }
.cell::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 3px; background: var(--line-2); }
.cell.us::after { background: var(--accent); }
.cell img { width: 100%; height: 100%; object-fit: cover; }
.cell.ban.filled img { filter: grayscale(1) brightness(.7); }
.cell.cur { outline: 2px solid var(--text); outline-offset: 2px; background: var(--panel-2); color: var(--text); }
.cell.cur.us { outline-color: var(--accent); }

.dr-grid {
  display: grid; grid-template-columns: 290px minmax(0, 1fr) 290px; grid-template-areas: "us center them";
  gap: 28px; margin-top: 22px; align-items: start;
}
.dr-center { grid-area: center; min-width: 0; transition: opacity .15s; }
.dr-center.stale .sugs { opacity: .45; pointer-events: none; }
.dr-side.us { grid-area: us; }
.dr-side.them { grid-area: them; }
.side-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 10px; }
.side-head h2 { font-size: 34px; font-weight: 900; text-transform: uppercase; font-variation-settings: "wdth" 62; line-height: 1; }
.dr-side.us .side-head h2 { color: var(--accent); }
.slots { display: flex; flex-direction: column; gap: 6px; }
.slot { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 12px; align-items: center; text-align: left; padding: 4px; border: 1px solid transparent; }
button.slot:hover { border-color: var(--line-2); background: var(--panel); }
.slot img, .slot-ph { width: 84px; height: 47px; object-fit: cover; background: var(--panel); display: block; }
.slot.empty .slot-ph { border: 1px dashed var(--line-2); background: none; }
.slot-text { display: flex; flex-direction: column; min-width: 0; }
.slot-text b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot-text span { font-size: 12px; color: var(--muted); }
.slot.empty .slot-text span { color: var(--dim); }
.bans { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.ban-icons { display: flex; flex-wrap: wrap; gap: 4px; }
.ban-icons img { width: 32px; height: 32px; filter: grayscale(1) brightness(.75); }
.waiting { margin-top: 12px; }
.enemies { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); padding-top: 14px; }
.enemy { display: flex; gap: 10px; align-items: flex-start; }
.enemy-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mini-heroes { display: flex; flex-wrap: wrap; gap: 4px; }
.mini { display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 10px; color: var(--muted); }
.mini img { width: 28px; height: 28px; }
.mini.gone { opacity: .35; }

.center-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.center-head h3 { font-size: 15px; font-weight: 700; color: var(--muted); }
.center-head-sub { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.sugs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sug {
  display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 14px; text-align: left; padding: 10px;
  border: 1px solid var(--line-2); background: var(--panel); transition: border-color .15s, transform .1s;
}
.sug:hover { border-color: var(--accent); }
.sug:active { transform: translateY(1px); }
.sug img { width: 112px; height: 63px; object-fit: cover; }
.sug-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sug-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.sug-top b { font-size: 18px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sug-who { font-size: 13px; color: var(--text); font-weight: 600; }
.sug-why { font-size: 12px; color: var(--muted); line-height: 1.35; }
.score { font-size: 13px; font-weight: 600; }
.score.pos { color: var(--accent); }
.score.neg { color: var(--danger); }

.dr-search .search input { height: 52px; font-size: 17px; }
.dgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px 8px; margin-top: 12px; max-height: 62vh; overflow-y: auto; padding-right: 4px; }
.dgcard { text-align: left; display: flex; flex-direction: column; gap: 4px; }
.dgcard img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--panel); }
.dgcard span { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dgcard:hover span { color: var(--text); }
.dgcard:first-child img { outline: 2px solid var(--accent); outline-offset: -2px; }

.assign { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 22px; border: 1px solid var(--line-2); padding: 18px; background: var(--panel); }
.assign img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.assign h3 { font-size: 30px; font-weight: 900; text-transform: uppercase; font-variation-settings: "wdth" 62; line-height: 1; margin-bottom: 14px; }
.assign-go { display: flex; gap: 8px; margin-top: 20px; }

.summary .lineup { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.lu { display: grid; grid-template-columns: 40px 112px minmax(0, 1fr); gap: 14px; align-items: center; }
.lu img { width: 112px; height: 63px; object-fit: cover; }
.lu-pos { font-size: 40px; font-weight: 900; font-variation-settings: "wdth" 62; color: var(--accent); line-height: 1; }
.edge { font-weight: 700; display: inline-flex; gap: 8px; align-items: baseline; }
.edge.pos { color: var(--accent); }
.edge.neg { color: var(--danger); }
.summary .btn { margin-top: 6px; }

/* lookup drawer */
.lookup { display: flex; gap: 8px; margin: 6px 0 10px; }
.lookup .input { height: 40px; font-size: 15px; }
.results { display: flex; flex-direction: column; gap: 4px; max-height: 300px; overflow-y: auto; }
.result { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; align-items: center; text-align: left; padding: 6px; border: 1px solid transparent; }
.result:hover { border-color: var(--accent); background: var(--panel-2); }
.result img, .avatar-ph { width: 36px; height: 36px; background: var(--panel-2); }
.result span { display: flex; flex-direction: column; min-width: 0; }
.result b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 0; }
.person-text { display: flex; flex-direction: column; min-width: 0; }
.random-slot { display: flex; flex-direction: column; gap: 4px; padding: 8px 0; }
.random-slot + .random-slot { border-top: 1px solid var(--line); }

@media (max-width: 1180px) {
  .dr-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "center center" "us them"; }
}
@media (max-width: 767px) {
  .topbar-left { gap: 12px; }
  .wordmark { font-size: 22px; }
  .page-tab { padding: 0 10px; }
  .dr-grid { grid-template-columns: 1fr; grid-template-areas: "center" "us" "them"; gap: 24px; }
  .sugs { grid-template-columns: 1fr; }
  .sug { grid-template-columns: 88px minmax(0, 1fr); }
  .sug img { width: 88px; height: 50px; }
  .assign { grid-template-columns: 1fr; }
  .dr-actions .label { display: none; }
  .dgrid { max-height: 55vh; }
}

/* ---------- game plan ---------- */
.summary-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }
.plan-note { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 18px; border: 1px dashed var(--line-2); }
.plan-writing { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border: 1px solid var(--line-2); background: var(--panel); margin-bottom: 14px; }
.pulse { width: 12px; height: 12px; background: var(--accent); flex-shrink: 0; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; transform: scale(.7); } }
.plan-stale { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border: 1px solid var(--accent); background: var(--accent-soft); margin-bottom: 18px; font-weight: 600; }
.plan-headline { font-size: clamp(22px, 2.4vw, 30px); font-weight: 800; line-height: 1.15; font-variation-settings: "wdth" 80; margin-bottom: 18px; max-width: 34ch; }
.plan-label { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); margin: 22px 0 10px; }
.readout { border-left: 3px solid var(--accent); padding: 4px 0 4px 16px; }
.readout .plan-label { margin-top: 0; }
.readout ol { list-style: none; counter-reset: r; display: flex; flex-direction: column; gap: 6px; }
.readout li { counter-increment: r; font-size: 17px; font-weight: 600; display: grid; grid-template-columns: 22px 1fr; }
.readout li::before { content: counter(r); font-family: var(--mono); color: var(--accent); font-size: 14px; padding-top: 2px; }
.lanes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.lane { border: 1px solid var(--line-2); padding: 14px; background: var(--panel); }
.lane-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.lane p, .threat p, .job p, .curve p { color: var(--muted); font-size: 14px; line-height: 1.45; }
.outlook { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding: 2px 6px; border: 1px solid var(--line-2); color: var(--muted); }
.outlook.favoured { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.outlook.tough { color: var(--danger); border-color: var(--danger); }
.threats, .jobs { display: flex; flex-direction: column; gap: 10px; }
.threat, .job { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; align-items: start; }
.threat-img, .job-img { width: 96px; aspect-ratio: 16 / 9; object-fit: cover; }
.threat b, .job b { font-size: 16px; }
.job-text { display: flex; flex-direction: column; gap: 2px; }
.items { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.items span { font-size: 12px; font-weight: 600; padding: 3px 8px; border: 1px solid var(--line-2); color: var(--text); }
.curve { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.avoid { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.avoid li { display: grid; grid-template-columns: 20px 1fr; gap: 8px; color: var(--muted); font-size: 14px; }
.avoid i { color: var(--danger); padding-top: 3px; }
.plan-meta { margin-top: 22px; }
@media (max-width: 767px) {
  .lanes, .curve { grid-template-columns: 1fr; }
  .threat, .job { grid-template-columns: 72px minmax(0, 1fr); }
  .threat-img, .job-img { width: 72px; }
}

/* ---------- result + history ---------- */
.result-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px; border: 1px solid var(--accent); background: var(--accent-soft); margin-bottom: 22px; font-weight: 700; }
.result-bar.set { border-color: var(--line-2); background: var(--panel); }
.seg-result button { min-width: 72px; height: 38px; font-size: 14px; }
.seg-result button.lost[aria-pressed="true"] { background: var(--danger); color: #1a0806; }

.hist { padding-bottom: 80px; }
.hist-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; padding: 32px 0 20px; }
.record { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.record-big { font-size: clamp(40px, 5vw, 64px); font-weight: 600; line-height: 1; color: var(--accent); }
.facts { display: flex; flex-wrap: wrap; gap: 10px 36px; padding: 16px 0 6px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.fact { display: flex; flex-direction: column; gap: 2px; }
.fact .mono { font-size: 22px; font-weight: 600; }
.hps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.hp { border: 1px solid var(--line-2); padding: 14px; background: var(--panel); display: flex; flex-direction: column; gap: 12px; }
.hp-top { display: flex; gap: 10px; align-items: center; }
.hp-top b { display: block; font-size: 18px; }
.hp-heroes { display: flex; flex-direction: column; gap: 6px; }
.hchip { display: inline-grid; grid-template-columns: 56px minmax(0, 1fr); gap: 10px; align-items: center; min-width: 0; }
.hchip img { width: 56px; height: 32px; object-fit: cover; }
.hchip > span { display: flex; flex-direction: column; min-width: 0; }
.hchip b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.hlist { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.hlist li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.rec { font-weight: 600; white-space: nowrap; }
.rec.pos { color: var(--accent); }
.rec.neg { color: var(--danger); }
.pair { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pair .hchip { grid-template-columns: 48px minmax(0, 1fr); }
.pair .hchip img { width: 48px; height: 27px; }
.plus { color: var(--dim); font-family: var(--mono); }
.matches { display: flex; flex-direction: column; gap: 10px; }
.match { border: 1px solid var(--line-2); border-left: 3px solid var(--line-2); padding: 14px 16px; background: var(--panel); display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.match.win { border-left-color: var(--accent); }
.match.loss { border-left-color: var(--danger); }
.match.pending { border-left-color: var(--text); }
.match-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; flex-wrap: wrap; }
.match-meta { display: flex; flex-direction: column; }
.match-actions { display: flex; gap: 6px; align-items: center; }
.match-teams { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; width: 100%; }
.mteam .plan-label { margin: 0 0 6px; display: block; }
.mteam > div { display: flex; gap: 6px; flex-wrap: wrap; }
.mh { display: flex; flex-direction: column; gap: 3px; width: 76px; }
.mh img { width: 76px; height: 43px; object-fit: cover; }
.mh span { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.match-plan { width: 100%; border-top: 1px solid var(--line); padding-top: 8px; }
@media (max-width: 1100px) { .hps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 767px) {
  .hps, .hist-cols, .match-teams { grid-template-columns: 1fr; }
  .record { align-items: flex-start; }
  .mh { width: 58px; } .mh img { width: 58px; height: 33px; }
}
