/* Apex Legends free tools (Batch 188) — tools/apex_rp.html, apex_reset.html, apex_party.html. Loaded after content.css
   and kit.css (EA's rank-badge pickers .kit-pick, .kit-chip, .kit-locked-note). Everything here is prefixed .apt-
   (shared) / .apr- (RP calculator, its climb strip reused by the reset page) / .aps- (split reset) / .app- (party)
   except the .tool-apex theme, which recolours the shared tool kit in Apex red. White text keeps 4.8:1 on the red
   (kit.accent_ink's rule), so filled buttons and selected chips use white ink. */
.tool-apex { --taccent: #da292a; --accent-hot: #ff5a4f; --accent: #da292a; --accent-rgb: 218,41,42; --accent-deep: #a91d1e;
  --accent-ink: #ffffff; --accent-btn: #da292a; }
.tool-apex .btn-primary:hover { background: #ee3a3a; color: #fff; }
.tool-apex .rut-tab.is-on { color: #fff; }
.tool-apex .fe-stat b { color: #ff6a5f; }

/* ---- shared */
.apt-form { display: grid; gap: 14px; }
.apt-lbl { display: block; margin: 0 0 8px; padding: 0; font: 700 12px/1.3 var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); }
.apt-hint { margin: 0; font-size: 12.5px; color: var(--text-faint); line-height: 1.5; }
.apt-hint b { color: var(--text-muted); }
.apt-go { justify-self: start; }
.apt-seg { margin: 0; padding: 0; border: 0; min-width: 0; }
.apt-seg-row { display: flex; flex-wrap: wrap; gap: 8px; }
.apt-role { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text-muted); font: 650 13.5px/1 var(--font); cursor: pointer;
  transition: border-color .15s, color .15s, background .15s; }
.apt-role input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.apt-role small { font-weight: 600; color: var(--text-faint); margin-left: 4px; }
.apt-role:hover { border-color: var(--border-strong); color: var(--text); }
.apt-role:has(input:checked) { border-color: var(--accent); color: var(--text); background: color-mix(in srgb, var(--accent) 16%, var(--bg)); }
.apt-role:has(input:focus-visible) { outline: 2px solid var(--accent-hot); outline-offset: 2px; }
.apt-size { min-width: 84px; justify-content: center; }
.apt-ranks { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 14px; border-radius: 14px; background: var(--bg); border: 1px solid var(--border); }
.apt-sep { padding-top: 14px; border-top: 1px dashed var(--border); }
.apt-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: end; }
.apt-planner { margin-top: 0; }
.apt-planner .apt-hint { margin-top: 10px; }
.apt-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: end; }
.apt-nums-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.apt-nums .bxc-num, .apt-pair .bxc-num { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.apt-check { display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; font-size: 13px; line-height: 1.45; color: var(--text-muted); cursor: pointer; }
.apt-check input[type=checkbox] { width: 18px; height: 18px; flex: none; margin: 1px 0 0; accent-color: var(--accent); }
.apt-check b { color: var(--text); }
.apt-maths { margin: 12px 0 0; padding: 11px 14px; border-radius: var(--radius-sm); background: var(--bg); border: 1px dashed var(--border-strong);
  font-size: 13.5px; line-height: 1.55; color: var(--text-muted); overflow-wrap: anywhere; }
.apt-maths[hidden] { display: none; }
.apt-maths b { color: var(--text); margin-right: 4px; font: 700 11px/1 var(--font); letter-spacing: .1em; text-transform: uppercase; }
.apt-meta { line-height: 1.55; }
.apt-meta.is-stuck { color: #ffb4a8; }
.apt-notes { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 7px; }
.apt-notes[hidden] { display: none; }
.apt-notes li { position: relative; padding: 9px 12px 9px 30px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border);
  font-size: 13px; line-height: 1.5; color: var(--text-muted); }
.apt-notes li::before { content: ""; position: absolute; left: 12px; top: 15px; width: 7px; height: 7px; border-radius: 2px; background: var(--accent-hot); transform: rotate(45deg); }
.apt-table td, .apt-table th { vertical-align: middle; }
.apt-table .kit-chip img { width: 24px; height: 24px; }
.apt-cap { caption-side: top; text-align: left; padding: 0 0 8px; font: 700 12px/1.3 var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); }
.apt-src { margin-top: 18px; padding-top: 12px; border-top: 1px dashed var(--border); font-size: 12.5px; line-height: 1.5; color: var(--text-faint); }
.apt-src b { color: var(--text-muted); }
.apt-src ul { margin: 6px 0 0; padding-left: 18px; }
.apt-src li { margin: 3px 0; }
.apt-src a { color: var(--text-muted); overflow-wrap: anywhere; }
.apt-locked { margin: 14px 0 0; }
.apt-locked[hidden] { display: none; }
.apt-locked a { color: #f2c75c; text-decoration: underline; text-underline-offset: 2px; }
.apt-timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid color-mix(in srgb, var(--accent) 45%, var(--border)); display: grid; gap: 10px; }
.apt-timeline li { position: relative; font-size: 14px; line-height: 1.55; color: var(--text-muted); }
.apt-timeline li::before { content: ""; position: absolute; left: -24px; top: 7px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent-hot); }
.apt-timeline b { color: var(--text); }
.apt-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.apt-two .table-wrap { margin: 0; }

/* the kit pickers inside the tool card (kit.css styles them; a little tighter here) */
.apt-card .kit-pick-head .lbl { font-size: 11.5px; }
.apt-card .kit-pick-now output { white-space: nowrap; }

/* ---- the worst-case / streak / reward cards */
.apt-minis { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-top: 12px; }
.apt-mini { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--bg); border: 1px solid var(--border); min-width: 0; }
.apt-mini[hidden] { display: none; }
.apt-mini-wide { margin-top: 12px; }
.apt-mini-k { display: block; font: 750 11px/1.3 var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); }
.apt-mini > b { display: block; margin-top: 4px; font: 800 22px/1.15 var(--font-display); color: var(--accent-hot); font-variant-numeric: tabular-nums; }
.apt-mini p { margin: 6px 0 0; font-size: 13px; line-height: 1.5; color: var(--text-muted); }

/* ---- booster box */
.apt-boost { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.apt-boost h3 { margin: 0; font-size: 17px; }
.apt-boost .bxc-span { margin-top: 6px; color: var(--text-muted); font-weight: 600; }
.apt-opts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.apt-opt .bxc-opt-h { color: var(--accent-hot); }
.apt-opt.is-main { border-color: rgba(218,41,42,.6); }
.apt-opt .bxc-opt-go { color: var(--accent-hot); }
.apt-min { font-weight: 600; font-size: 12px; color: var(--text-faint); }
.apt-etas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.apt-eta { display: grid; gap: 5px; padding: 13px 14px; border-radius: var(--radius-sm); background: var(--bg); border: 1px solid var(--border-strong); min-width: 0; }
.apt-eta span { font: 750 11.5px/1.3 var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--accent-hot); }
.apt-eta b { font: 800 19px/1.2 var(--font-display); color: var(--text); }
.apt-etas .bxc-err, .apt-opts .bxc-err { grid-column: 1 / -1; }
.apt-nopred { margin-top: 10px; }

/* ---- the climb (RP calculator) / the drop (reset): badge → badge and a division strip */
.apr-climb { --apc: #da292a; margin: 20px 0 4px; padding: 14px; border-radius: var(--radius);
  background: radial-gradient(80% 140% at 50% 0%, color-mix(in srgb, var(--apc) 16%, transparent), transparent 70%), var(--bg);
  border: 1px solid color-mix(in srgb, var(--apc) 30%, var(--border)); }
.apr-climb-row { display: flex; align-items: center; justify-content: center; gap: 16px; }
.apr-end { display: flex; align-items: center; gap: 10px; min-width: 0; }
.apr-end > span { display: grid; gap: 2px; min-width: 0; }
.apr-end b { font: 800 16px/1.15 var(--font-display); color: var(--text); white-space: nowrap; }
.apr-end small { font-size: 12px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.apr-em { width: 52px; height: 52px; flex: none; object-fit: contain; filter: drop-shadow(0 6px 12px rgba(0,0,0,.45)); }
.apr-em[hidden] { display: none; }
.apr-arrow { display: inline-flex; gap: 3px; flex: none; }
.apr-arrow i { width: 8px; height: 8px; border-top: 2px solid var(--apc); border-right: 2px solid var(--apc); transform: rotate(45deg); opacity: .45; }
.apr-arrow i:nth-child(2) { opacity: .7; }
.apr-arrow i:nth-child(3) { opacity: 1; }
.aps-climb .apr-arrow i { border-color: #ffb4a8; }
.aps-climb.is-none { --apc: #8b8f96; }
.apr-track { display: flex; gap: 3px; height: 10px; margin: 14px 4px 0; }
.apr-track:empty { display: none; }
.apr-track i { position: relative; flex: 1 1 0; min-width: 3px; border-radius: 3px; overflow: hidden;
  background: color-mix(in srgb, var(--c) 22%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 45%, transparent); }
.apr-track i span { position: absolute; inset: 0 auto 0 0; background: var(--c); }
.apr-break { margin: 14px 0 0; }
.apr-break[hidden] { display: none; }
.apr-break table { margin: 0; }
.apr-break td:not(:first-child) { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tool-apex .table-wrap { position: relative; }   /* keeps .sr-only cells inside the scroll box (no page-wide overflow) */

/* ---- party checker */
.app-players { display: grid; gap: 10px; }
.app-player { margin: 0; padding: 12px 14px 14px; border-radius: 14px; background: var(--bg); border: 1px solid var(--border); min-width: 0; }
.app-player[hidden] { display: none; }
.app-legend { display: flex; align-items: center; gap: 10px; padding: 0; margin: 0 0 10px; font: 700 13px/1.3 var(--font); color: var(--text-muted); width: 100%; }
.app-now { margin-left: auto; font: 800 15px/1.2 var(--font-display); color: var(--text); }
.app-num, .app-mk { display: inline-grid; place-items: center; border-radius: 50%; font: 800 13px/1 var(--font); color: #140808; background: var(--mk, #ff5a4f); }
.app-num { width: 26px; height: 26px; flex: none; }
.app-mk1 { --mk: #ff6a5f; } .app-mk2 { --mk: #5ec8f5; } .app-mk3 { --mk: #f2c75c; }
.app-tiers { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.app-tier { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px 7px; border-radius: 10px; min-width: 0;
  border: 1px solid var(--border); background: color-mix(in srgb, var(--tc) 6%, var(--panel)); cursor: pointer; transition: border-color .15s, background .15s; }
.app-tier input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.app-tier img { width: 34px; height: 34px; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0,0,0,.5)); }
.app-tier span { font: 700 11px/1.1 var(--font); color: var(--text-faint); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-tier:hover { border-color: var(--border-strong); }
.app-tier:has(input:checked) { border-color: var(--tc); background: color-mix(in srgb, var(--tc) 20%, var(--panel)); box-shadow: 0 0 0 1px var(--tc) inset; }
.app-tier:has(input:checked) span { color: var(--text); }
.app-tier:has(input:focus-visible) { outline: 2px solid var(--accent-hot); outline-offset: 2px; }
.app-result { --rc: #3ddc84; margin: 20px 0 0; padding: 16px 18px; border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--rc) 45%, var(--border));
  background: radial-gradient(120% 150% at 90% 0%, color-mix(in srgb, var(--rc) 13%, transparent), transparent 62%), var(--bg); }
.app-result.is-blocked { --rc: #ff5c5c; }
.app-verdict { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.app-verdict b { font: 800 24px/1.15 var(--font-display); color: var(--rc); }
.app-verdict small { font-size: 12.5px; font-weight: 650; color: var(--text-faint); }
.app-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--rc); box-shadow: 0 0 0 4px color-mix(in srgb, var(--rc) 22%, transparent); }
.app-reason { margin: 10px 0 0; font-size: 14.5px; line-height: 1.55; color: var(--text); }
.app-line { margin: 6px 0 0; font-size: 14px; line-height: 1.5; color: var(--text); }
.app-line[hidden], .app-fix[hidden] { display: none; }
.app-fix { margin: 8px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--text-muted); }
.app-notes li { background: color-mix(in srgb, var(--panel) 60%, var(--bg)); }
.app-strip { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; margin: 18px 0 0; padding: 12px; border-radius: var(--radius);
  background: var(--bg); border: 1px solid var(--border); }
.app-col { position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; padding: 8px 2px; border-radius: 8px;
  background: color-mix(in srgb, var(--tc) 7%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tc) 20%, transparent); }
.app-col.in { background: rgba(61,220,132,.22); box-shadow: inset 0 0 0 1px #3ddc84, 0 0 10px rgba(61,220,132,.25); }
.app-col.bans { border-top: 3px solid #ff5c5c; padding-top: 5px; }
.app-col img { width: 30px; height: 30px; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0,0,0,.5)); }
.app-col-n { font: 700 10px/1.1 var(--font); color: var(--text-faint); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-marks { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; min-height: 18px; }
.app-mk { width: 18px; height: 18px; font-size: 10.5px; }
.app-legend-note { margin: 8px 0 0; font-size: 12px; color: var(--text-faint); line-height: 1.45; }
.app-ctx { margin-top: 16px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--bg); border: 1px solid var(--border); }
.app-ctx-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 8px 0 8px; }
.app-ctx-row > div { display: grid; gap: 3px; min-width: 0; }
.app-ctx-row b { font: 800 22px/1.1 var(--font-display); color: var(--accent-hot); font-variant-numeric: tabular-nums; }
.app-ctx-row span { font-size: 12.5px; line-height: 1.4; color: var(--text-muted); }
.app-duo .muted { margin: 6px 0 12px; font-size: 14px; line-height: 1.55; }
table.data.app-matrix th, table.data.app-matrix td { text-align: center; padding: 7px 4px; }
.app-matrix thead th img { width: 24px; height: 24px; object-fit: contain; display: block; margin: 0 auto 3px; }
.app-mx-n { display: block; font-size: 10.5px; font-weight: 700; color: var(--text-faint); white-space: nowrap; }
table.data.app-matrix tbody th { text-align: left; white-space: nowrap; padding-left: 8px; }
.app-matrix tbody th .kit-chip img { width: 22px; height: 22px; }
.app-matrix td.is-ok { color: #3ddc84; font-weight: 800; background: rgba(61,220,132,.08); }
.app-matrix td.is-no { color: var(--text-faint); opacity: .6; }

@media (max-width: 860px) {
  .apt-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .apt-nums-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .apt-opts, .apt-etas { grid-template-columns: minmax(0, 1fr); }
  .apt-two { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .tool-apex .tool-body { padding-left: 16px; padding-right: 16px; }
  .apt-card { padding: 18px 14px 16px; }
  .apt-ranks { padding: 12px 10px; }
  .apt-pair, .apt-minis { grid-template-columns: minmax(0, 1fr); }
  .apt-nums-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .apt-nums-3 > :last-child { grid-column: 1 / -1; }
  .apr-climb { padding: 12px 8px; }
  .apr-climb-row { gap: 8px; }
  .apr-em { width: 40px; height: 40px; }
  .apr-end { gap: 7px; }
  .apr-end b { font-size: 14px; }
  .apr-arrow i { width: 6px; height: 6px; }
  .apr-track { margin: 12px 2px 0; gap: 2px; }
  .app-player { padding: 10px 10px 12px; }
  .app-tiers { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .app-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 10px 8px; }
  .app-ctx-row { grid-template-columns: minmax(0, 1fr); }
  .app-ctx-row > div { grid-template-columns: 76px minmax(0, 1fr); align-items: baseline; gap: 10px; }
  .app-ctx-row b { font-size: 20px; }
  .app-verdict b { font-size: 21px; flex: 1 1 0; min-width: 0; }
  .app-verdict small { flex-basis: 100%; }
  table.data.apt-table th, table.data.apt-table td { padding-left: 7px; padding-right: 7px; font-size: 12.5px; }
  table.data.apt-table .apt-wcol { display: none; }
  table.data.apt-table .kit-chip { gap: 6px; }
  .apr-break table { font-size: 13px; }
  table.data.app-matrix th, table.data.app-matrix td { padding: 6px 2px; font-size: 12px; }
  .app-mx-n { display: none; }
  .app-mx-rn { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .app-matrix tbody th .kit-chip { gap: 0; }
}
/* phones: the seven tier buttons become an icon grid — the chosen rank's name is in the picker head */
@media (max-width: 480px) {
  .apt-eta { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 11px 13px; }
  .apt-eta b { font-size: 16px; text-align: right; }
  .apt-etas { gap: 8px; }
  .apt-card .kit-tiers { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
  .apt-card .kit-tier { justify-content: center; padding: 6px 2px; font-size: 0; gap: 0; }
  .apt-card .kit-tier.has-ic { padding-left: 2px; }
  .apt-card .kit-tier img { width: 30px; height: 30px; margin: 0; }
  .apt-card .kit-divs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .apt-card .kit-div { min-width: 0; padding: 8px 0; }
  .apr-break th:nth-child(3), .apr-break td:nth-child(3) { display: none; }
  .tool-ref table.data.apt-table th, .tool-ref table.data.apt-table td { padding-left: 5px; padding-right: 5px; font-size: 12px; }
  .tool-ref table.data.apt-table .kit-chip { gap: 5px; }
  .tool-ref table.data.apt-table .kit-chip img { width: 20px; height: 20px; }
  .apr-break table.data th, .apr-break table.data td { padding-left: 6px; padding-right: 6px; }
  .apr-break table.data th { font-size: 10.5px; letter-spacing: .03em; }
}
@media (max-width: 400px) {
  .apr-em { width: 34px; height: 34px; }
  .apr-end b { font-size: 13.5px; }
  .apt-nums, .apt-nums-3 { gap: 10px; }
  .apt-card .kit-pick-now output { white-space: normal; }
  .app-tier span { font-size: 10px; }
}
@media (max-width: 360px) {
  .apr-end b { white-space: normal; overflow-wrap: anywhere; }
}
