/* =========================================================================
   Draft Helper — page styles (uses tokens from ../assets/theme.css)
   ========================================================================= */

.draft { padding-top: 34px; }

/* ---------- mode bar ---------- */

.modebar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding: 0 0 4px;
}

.mode-extra { display: flex; align-items: center; gap: 8px; }

.mode-label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- turn bar ---------- */

.turnbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 2px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 179, 71, .35);
  border-radius: var(--radius);
  background: rgba(255, 179, 71, .07);
}

.turn-info { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }

.turn-step {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.turn-what { font-size: 14px; font-weight: 700; }

.turn-actions { display: flex; gap: 7px; }

/* ---------- teams ---------- */

.teams {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 14px;
}

.team {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .015));
  box-shadow: var(--shadow);
}

.team--enemy {
  background: linear-gradient(160deg, rgba(255, 122, 107, .06), rgba(255, 255, 255, .012));
}

.team-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 11px;
}

.team-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 400;
}

.count {
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.slots {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
}

.slot {
  position: relative;
  appearance: none;
  padding: 0;
  aspect-ratio: 16 / 10;
  border: 1.5px dashed var(--line);
  border-radius: 3px;
  background: var(--paper-2);
  overflow: hidden;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: border-color .12s, background .12s;
}

.slot:hover:not([disabled]) { border-color: var(--line-strong); background: rgba(255, 255, 255, .09); }
.slot[disabled] { cursor: default; }

.slot--filled {
  border: 1px solid var(--line-strong);
  background: var(--paper-2);
}

.slot--target {
  border: 1px solid var(--amber);
  background: rgba(255, 179, 71, .1);
  box-shadow: 0 0 0 3px rgba(255, 179, 71, .14);
}

.slot--locked { opacity: .45; }

.slot-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  display: block;
}

.slot-name {
  position: absolute;
  inset: auto 0 0 0;
  padding: 12px 3px 3px;
  background: linear-gradient(180deg, transparent, rgba(25, 21, 16, .92));
  color: #fff8ee;
  font-size: 9.5px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slot-x {
  position: absolute;
  top: 2px;
  right: 5px;
  font-size: 11px;
  color: #fff;
  opacity: 0;
  transition: opacity .12s;
  text-shadow: 0 1px 3px #000;
}

.slot--filled:hover .slot-x { opacity: .95; }
.slot--filled:hover .slot-img { filter: brightness(.55); }

.slot-plus { font-size: 17px; opacity: .55; }

/* ---------- bans ---------- */

.ban-strip { margin-top: 11px; }

.ban-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
}

.ban-slots { display: flex; flex-wrap: wrap; gap: 5px; }

.ban {
  position: relative;
  appearance: none;
  padding: 0;
  width: 36px;
  height: 24px;
  border: 1.5px dashed var(--line);
  border-radius: 3px;
  background: var(--paper-2);
  overflow: hidden;
  color: var(--muted);
  cursor: default;
  display: grid;
  place-items: center;
}

.ban img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  filter: grayscale(1) brightness(.62);
  display: block;
}

.ban--filled { border: 1px solid var(--line-strong); }

.ban--filled::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    transparent 45%,
    rgba(255, 122, 107, .9) 45%,
    rgba(255, 122, 107, .9) 55%,
    transparent 55%
  );
}

.ban--target {
  border: 1px solid var(--amber);
  box-shadow: 0 0 0 3px rgba(255, 179, 71, .14);
  cursor: pointer;
}

.ban--add { cursor: pointer; font-size: 12px; }
.ban--add:hover { border-color: var(--ink); color: var(--ink); }

/* ---------- filters ---------- */

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 24px 0 16px;
}

.toggles { display: flex; flex-wrap: wrap; gap: 16px; }

.toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.toggle:hover { color: var(--ink); }
.toggle input { margin: 0; width: 15px; height: 15px; accent-color: var(--accent); }

/* ---------- results ---------- */

.results { min-height: 140px; }

.result-head { margin-bottom: 12px; }

.result-head h3 {
  margin: 0 0 2px;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 400;
}

.result-head p { margin: 0; font-size: 12.5px; color: var(--muted); }

.summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.tag {
  padding: 2px 9px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-soft);
}

.tabs {
  display: flex;
  gap: 2px;
  margin: 16px 0 12px;
  border-bottom: 1.5px solid var(--line);
}

.tab {
  appearance: none;
  padding: 8px 13px;
  border: 0;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -1.5px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }

.rows { display: flex; flex-direction: column; gap: 6px; }

.row {
  display: grid;
  grid-template-columns: 24px 238px 76px 1fr;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border: 1.5px solid var(--line);
  border-radius: 3px;
  background: var(--card);
  transition: border-color .12s, box-shadow .12s, transform .12s;
}

.row:hover {
  border-color: rgba(255, 179, 71, .45);
  transform: translateY(-1px);
}

.row--best { border-left: 4px solid var(--good); }
.row--worst { border-left: 4px solid var(--bad); }
.row--ban { border-left: 4px solid var(--accent); }

.row-rank {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.row-hero { display: flex; align-items: center; gap: 9px; min-width: 0; }
.row-hero > div { min-width: 0; }

.row-hero img {
  width: 44px;
  height: 28px;
  flex: none;
  object-fit: cover;
  object-position: center 22%;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: var(--paper-2);
}

.row-name {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-meta {
  display: block;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-score { text-align: right; font-variant-numeric: tabular-nums; }

.row-score b {
  display: block;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: -.01em;
}

.row-score span {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

.row-vs { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; }

.vs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px 2px 3px;
  border: 1.5px solid var(--line);
  border-radius: 3px;
  background: var(--paper-2);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.vs img {
  width: 20px;
  height: 20px;
  object-fit: cover;
  object-position: center 22%;
  border-radius: 2px;
}

.vs b { font-weight: 700; }
.vs em { font-style: normal; font-size: 10.5px; font-weight: 700; }
.vs em.up { color: var(--good); }
.vs em.down { color: var(--bad); }
.vs em.flat { color: var(--muted); }
.vs--none { opacity: .5; }
.vs--thin { border-style: dashed; }

/* ---------- drawer ---------- */

.drawer {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  justify-content: flex-end;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 3, 7, .72);
  animation: fade .15s ease;
}

.drawer-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  height: 100%;
  background: var(--bg-deep);
  border-left: 1px solid var(--line-strong);
  animation: slide .18s ease;
}

@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(26px); opacity: .5; } }

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .04);
}

.drawer-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 400;
}

.drawer-tools {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1.5px solid var(--line);
}

#hero-search {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--line);
  border-radius: 3px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
}

#hero-search:focus { outline: none; border-color: var(--accent); }

.hero-grid {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 6px;
}

.grid-group {
  margin: 0 0 7px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}

.grid-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.hero-card {
  position: relative;
  appearance: none;
  padding: 0;
  aspect-ratio: 16 / 11;
  border: 1.5px solid var(--line);
  border-radius: 3px;
  background: var(--paper-2);
  overflow: hidden;
  cursor: pointer;
  color: var(--ink);
  font: inherit;
  text-align: left;
  transition: border-color .12s, transform .1s, box-shadow .1s;
}

.hero-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  display: block;
}

.hero-card span {
  position: absolute;
  inset: auto 0 0 0;
  padding: 12px 4px 3px;
  background: linear-gradient(180deg, transparent, rgba(25, 21, 16, .93));
  color: #fff8ee;
  font-size: 9.5px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-card:hover {
  border-color: rgba(255, 179, 71, .6);
  box-shadow: var(--shadow-sm);
}

.hero-card.is-picked { opacity: .3; cursor: not-allowed; }
.hero-card.is-picked:hover { transform: none; box-shadow: none; border-color: var(--line); }

.hero-card.in-pool::after {
  content: "★";
  position: absolute;
  top: 1px;
  left: 4px;
  font-size: 11px;
  color: var(--mark);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .85);
}

.drawer-hint {
  margin: 0;
  padding: 10px 16px 14px;
  border-top: 1.5px solid var(--line);
  font-size: 11.5px;
  color: var(--muted);
  background: var(--card);
}

/* ---------- team analysis ---------- */

.analysis {
  margin-top: 26px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .015));
  box-shadow: var(--shadow);
}

.analysis-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.analysis-intro { max-width: 62ch; }

.analysis-intro h2 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -.01em;
}

.analysis-intro p { margin: 0; font-size: 12.5px; color: var(--muted); }

.chance {
  min-width: 200px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 179, 71, .35);
  border-radius: var(--radius);
  background: rgba(255, 179, 71, .07);
}

.chance-num {
  display: block;
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.chance-label {
  display: block;
  margin-top: 5px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
}

.chance-track {
  display: block;
  height: 5px;
  margin-top: 9px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .12);
  overflow: hidden;
}

.chance-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--copper), var(--amber));
}

.chance-foot {
  display: block;
  margin-top: 7px;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--muted);
}

.analysis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.analysis-team {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.analysis-team--enemy {
  background: linear-gradient(160deg, rgba(255, 122, 107, .07), rgba(255, 255, 255, .012));
}

.analysis-team header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.analysis-team h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
}

.analysis-team header span {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .1em;
  color: var(--muted);
}

.analysis-rows {
  margin: 0 0 11px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.analysis-rows li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 6px;
  border-bottom: 1px dashed rgba(246, 241, 233, .09);
  font-size: 12px;
  color: var(--muted);
}

.analysis-rows li:last-child { border-bottom: 0; padding-bottom: 0; }

.analysis-rows b {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.analysis-rows b.up { color: var(--good); }
.analysis-rows b.down { color: var(--bad); }

.analysis-tags { display: flex; flex-wrap: wrap; gap: 5px; }

.pos-badges { display: inline-flex; gap: 3px; }

.pos-badge {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--ink-soft);
}

.pos-badge.is-missing {
  border-color: rgba(255, 122, 107, .6);
  border-style: dashed;
  color: var(--bad);
}

.analysis-counters {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.analysis-counters header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.analysis-counters h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
}

.analysis-counters header span {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: right;
}

.counter-list { display: flex; flex-direction: column; gap: 8px; }

.counter-item {
  display: grid;
  grid-template-columns: 172px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.counter-item:first-child { border-top: 0; padding-top: 0; }

.counter-target {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 12.5px;
  font-weight: 600;
}

.counter-target img {
  width: 38px;
  height: 24px;
  flex: none;
  object-fit: cover;
  object-position: center 22%;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: var(--paper-2);
}

.counter-target span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.counter-suggest { display: flex; flex-wrap: wrap; gap: 6px; }

.counter-pick {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px 3px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}

.counter-pick:hover:not([disabled]) {
  border-color: rgba(255, 179, 71, .55);
  color: var(--accent);
}

.counter-pick[disabled] { opacity: .45; cursor: not-allowed; }

.counter-pick img {
  width: 24px;
  height: 15px;
  object-fit: cover;
  object-position: center 22%;
  border-radius: 2px;
}

.counter-pick b {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--good);
}

.analysis-empty { font-size: 12px; color: var(--muted); }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .teams { grid-template-columns: 1fr; }
  .row { grid-template-columns: 22px 1fr auto; row-gap: 8px; }
  .row-vs { grid-column: 1 / -1; justify-content: flex-start; }
  .analysis-grid { grid-template-columns: 1fr; }
  .counter-item { grid-template-columns: 144px minmax(0, 1fr); }
}

@media (max-width: 560px) {
  .draft { padding-top: 22px; }
  .slot-name { font-size: 8.5px; }
  .toggles { width: 100%; }
  .page-actions { width: 100%; }
  .analysis { padding: 14px; }
  .counter-item { grid-template-columns: 1fr; align-items: start; }
  .chance { width: 100%; }
  .analysis-counters header { flex-direction: column; align-items: flex-start; gap: 2px; }
  .analysis-counters header span { text-align: left; }
}
