/* ============================================================
   BUILD TOOLS - page styles for /plugins/build-tools.html
   Layered on style.css + ranks/rank-pages.css + plugin-pages.css.
   Gold site accent; each grade carries its own tint (--g).
   ============================================================ */

.bt-page {
  --bt-ground: #0c0f16;
  --bt-strip: #12151d;
  --bt-gold: #ffd964;
  --bt-text: #f1f3f8;
  --bt-muted: #b7becf;
  --bt-line: #353945;
  --bt-info: #74d9ff;
  --bt-bad: #ff5c48;
}
.bt-page [data-grade="0"] { --g: #d9b77e; --g-dim: rgba(217, 183, 126, 0.14); }
.bt-page [data-grade="1"] { --g: #d08a4c; --g-dim: rgba(208, 138, 76, 0.14); }
.bt-page [data-grade="2"] { --g: #aeb8c6; --g-dim: rgba(174, 184, 198, 0.14); }
.bt-page [data-grade="3"] { --g: #e0764a; --g-dim: rgba(224, 118, 74, 0.14); }
.bt-page [data-grade="4"] { --g: #93a6d6; --g-dim: rgba(147, 166, 214, 0.15); }

/* ---------- Hero crest: grade tiles orbit ---------- */
.bt-crest { width: clamp(190px, 24vw, 280px); }
.bt-crest .bt-crest-tiles image { transition: opacity 0.4s ease; }
.bt-crest .bt-crest-ring { transform-origin: 100px 100px; animation: bt-spin 60s linear infinite; }
@keyframes bt-spin { to { transform: rotate(360deg); } }

/* ---------- Grade ladder ---------- */
.bt-ladder {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.9rem;
  margin: 0 0 1.4rem;
  counter-reset: none;
}
.bt-ladder::before {
  content: "";
  position: absolute;
  left: 6%;
  right: 6%;
  top: 44%;
  height: 2px;
  background: linear-gradient(90deg, #d9b77e, #d08a4c, #aeb8c6, #e0764a, #93a6d6);
  opacity: 0.35;
  pointer-events: none;
}
.bt-rung {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  padding: 0.95rem 0.6rem 0.85rem;
  font: inherit;
  color: var(--text, #f1f3f8);
  text-align: center;
  cursor: pointer;
  background: linear-gradient(180deg, var(--rk-panel-2), var(--rk-panel));
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.bt-rung:hover,
.bt-rung:focus-visible {
  transform: translateY(-4px);
  border-color: var(--g);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--g), 0 0 26px var(--g-dim);
  outline: none;
}
.bt-rung.is-active {
  background: linear-gradient(180deg, var(--g-dim), var(--rk-panel) 80%);
  border-color: var(--g);
  box-shadow: 0 0 0 1px var(--g), 0 0 30px var(--g-dim);
}
.bt-rung-key {
  position: absolute;
  top: 0.5rem;
  left: 0.55rem;
  min-width: 1.6rem;
  padding: 0.1rem 0.35rem;
  font-family: Consolas, Menlo, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--g);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--g-dim);
  border-radius: 6px;
}
.bt-rung-tile {
  position: relative;
  width: min(100%, 118px);
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: #0b0d12;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 8px 18px rgba(0, 0, 0, 0.5);
}
.bt-rung-tile img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.bt-rung:hover .bt-rung-tile img { transform: scale(1.07); }
.bt-rung-tile::after {
  content: "";
  position: absolute;
  inset: -40%;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.22) 50%, transparent 60%);
  transform: translateX(-60%);
  transition: transform 0.7s ease;
  pointer-events: none;
}
.bt-rung:hover .bt-rung-tile::after { transform: translateX(60%); }
.bt-rung-name {
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--g);
}
.bt-rung-cmd { font-size: 0.8rem; color: var(--muted); }
.bt-rung-cmd .cmd { font-family: Consolas, Menlo, monospace; }

/* ---------- Steps ---------- */
.bt-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 0 0 1.4rem;
}
.bt-step {
  position: relative;
  padding: 1.15rem 1.15rem 1.1rem 1.15rem;
  background: linear-gradient(180deg, var(--rk-panel-2), var(--rk-panel));
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.bt-step::before {
  content: attr(data-step);
  position: absolute;
  right: 0.6rem;
  top: -0.9rem;
  font-family: "Cinzel", serif;
  font-size: 4.6rem;
  font-weight: 700;
  line-height: 1;
  color: rgba(230, 200, 74, 0.08);
  pointer-events: none;
}
.bt-step h3 {
  margin: 0 0 0.45rem;
  font-family: "Cinzel", serif;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  color: var(--rk-accent-bright);
}
.bt-step p { margin: 0; font-size: 0.93rem; color: var(--muted); line-height: 1.55; }
.bt-step p + p { margin-top: 0.45rem; }

/* ---------- Simulator ---------- */
.bt-sim {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 0;
  margin: 0 0 1rem;
  border: 1px solid var(--rk-accent-line);
  border-radius: 16px;
  overflow: hidden;
  background: #07090e;
  box-shadow: 0 0 40px rgba(230, 200, 74, 0.08), 0 18px 50px rgba(0, 0, 0, 0.55);
}
.bt-stage {
  position: relative;
  min-height: 470px;
  overflow: hidden;
  isolation: isolate;
  background: #0a0c10;
}
.bt-stage-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.bt-stage-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 45%;
  filter: saturate(0.8) brightness(0.62) blur(1.5px);
  transform: scale(1.04);
}
.bt-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 70% 55% at 50% 35%, transparent 30%, rgba(5, 7, 13, 0.55) 100%),
    linear-gradient(180deg, rgba(5, 7, 13, 0.1) 40%, rgba(5, 7, 13, 0.75) 100%);
}
.bt-stage-tag {
  position: absolute;
  top: 0.75rem;
  left: 0.85rem;
  padding: 0.25rem 0.55rem;
  font-family: Consolas, Menlo, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bt-gold);
  background: rgba(12, 15, 22, 0.8);
  border: 1px solid rgba(255, 217, 100, 0.3);
  border-radius: 6px;
}

/* the build: blocks placed in a row */
.bt-build {
  position: absolute;
  left: 50%;
  top: 17%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(6, 54px);
  gap: 6px;
  perspective: 700px;
}
.bt-slot {
  width: 54px;
  height: 78px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.02);
}
.bt-block {
  position: relative;
  width: 54px;
  height: 78px;
  border-radius: 4px;
  background-size: 120px 120px;
  background-position: center;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5), 0 6px 14px rgba(0, 0, 0, 0.55);
  animation: bt-drop 0.35s cubic-bezier(0.2, 1.4, 0.4, 1);
  transform-origin: 50% 100%;
}
.bt-block.is-upgrading { animation: bt-upgrade 0.55s ease; }
.bt-block.is-upgrading::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 8px;
  box-shadow: 0 0 0 2px var(--g), 0 0 22px var(--g);
  animation: bt-flash 0.6s ease forwards;
}
@keyframes bt-drop { from { transform: translateY(-26px) scale(0.9); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes bt-upgrade { 0% { transform: rotateY(0); } 50% { transform: rotateY(90deg); } 100% { transform: rotateY(0); } }
@keyframes bt-flash { from { opacity: 1; } to { opacity: 0; } }
.bt-float {
  position: absolute;
  left: 50%;
  top: -0.2rem;
  transform: translate(-50%, 0);
  white-space: nowrap;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px #000;
  pointer-events: none;
  animation: bt-rise 1.4s ease forwards;
}
@keyframes bt-rise { from { opacity: 0; transform: translate(-50%, 0); } 15% { opacity: 1; } to { opacity: 0; transform: translate(-50%, -34px); } }

/* in-game UI recreation (spec: 416x180 window, 72x92 badge, 1920x1080 reference) */
.bt-hud {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 416px;
  max-width: calc(100% - 16px);
}
.bt-win {
  width: 416px;
  max-width: 100%;
  margin-bottom: 10px;
  background: var(--bt-line);
  padding: 1px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  transform-origin: 50% 100%;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.bt-win[hidden] { display: block; visibility: hidden; opacity: 0; transform: translateY(8px) scale(0.98); }
.bt-win-in { background: rgba(12, 15, 22, 0.96); border-top: 3px solid var(--bt-gold); }
.bt-win-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 36px;
  padding: 0 8px 0 14px;
  background: rgba(18, 21, 29, 0.92);
  border-bottom: 1px solid var(--bt-line);
}
.bt-win-title {
  font-family: "Roboto Condensed", "Arial Narrow", "Inter", sans-serif;
  font-stretch: condensed;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--bt-gold);
}
.bt-x {
  display: grid;
  place-items: center;
  width: 28px;
  height: 24px;
  padding: 0;
  cursor: pointer;
  color: #ffb0a6;
  background: rgba(255, 92, 72, 0.18);
  border: 0;
}
.bt-x:hover { background: rgba(255, 92, 72, 0.34); }
.bt-x svg { width: 14px; height: 14px; }
.bt-tiles {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding: 10px 14px;
}
.bt-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 2px 5px;
  font: inherit;
  cursor: pointer;
  color: var(--bt-text);
  background: rgba(255, 255, 255, 0.03);
  border: 0;
  border-bottom: 3px solid transparent;
}
.bt-tile:hover { background: rgba(255, 255, 255, 0.07); }
.bt-tile img { width: 44px; height: 44px; display: block; border-radius: 4px; background: rgba(12, 15, 22, 0.6); }
.bt-tile span {
  font-family: "Roboto Condensed", "Arial Narrow", "Inter", sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.02em;
}
.bt-tile.is-on { background: rgba(255, 217, 100, 0.16); border-bottom-color: var(--bt-gold); }
.bt-tile.is-on span { color: var(--bt-gold); }
.bt-tile.is-locked { cursor: default; background: rgba(255, 255, 255, 0.015); }
.bt-tile.is-locked img { filter: grayscale(0.9) brightness(0.55) sepia(0.15) hue-rotate(180deg); opacity: 0.6; }
.bt-tile.is-locked span { color: rgba(183, 190, 207, 0.5); }
.bt-tile.is-locked::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 12px;
  height: 12px;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b7becf' stroke-width='2.4' stroke-linecap='round'%3E%3Crect x='4' y='11' width='16' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E");
}
.bt-win-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 32px;
  padding: 0 14px;
  border-top: 1px solid var(--bt-line);
  background: rgba(18, 21, 29, 0.92);
  font-family: "Share Tech Mono", Consolas, Menlo, monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--bt-muted);
}
.bt-win-foot b { color: var(--bt-text); font-weight: 400; }

.bt-badge {
  width: 72px;
  height: 92px;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: var(--bt-gold);
  background: var(--bt-line);
  border: 0;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.55);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.bt-badge-in {
  display: flex;
  flex-direction: column;
  height: calc(100% - 2px);
  margin: 1px;
  background: rgba(12, 15, 22, 0.94);
  border-top: 3px solid var(--bt-gold);
}
.bt-badge-in > span:first-child { flex: 1; display: grid; place-items: center; }
.bt-badge img { width: 44px; height: 44px; display: block; border-radius: 4px; }
.bt-badge-name {
  display: block;
  height: 27px;
  line-height: 27px;
  font-family: "Roboto Condensed", "Arial Narrow", "Inter", sans-serif;
  font-weight: 700;
  font-size: 12px;
  background: rgba(18, 21, 29, 0.92);
  border-top: 1px solid var(--bt-line);
}
.bt-badge:hover { transform: translateY(-2px); }
.bt-badge.is-off { opacity: 0; transform: translateY(6px); pointer-events: none; }
.bt-hotbar {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  width: 100%;
  margin-top: 12px;
}
.bt-hotbar span {
  box-sizing: border-box;
  height: 42px;
  min-width: 0;
  display: grid;
  place-items: center;
  padding: 4px;
  overflow: hidden;
  background: rgba(190, 190, 180, 0.13);
}
.bt-hotbar picture { display: contents; }
.bt-hotbar img {
  display: block;
  width: auto;
  height: 34px;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}
.bt-hotbar span.is-held { background: rgba(120, 170, 230, 0.22); box-shadow: inset 0 0 0 2px rgba(120, 170, 230, 0.8); }

/* console side */
.bt-console {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-left: 1px solid var(--rk-accent-line);
  background: linear-gradient(180deg, #0e1118, #090b10);
}
.bt-console-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 0.95rem;
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  color: var(--rk-accent-bright);
  border-bottom: 1px solid var(--line);
}
.bt-console-head i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7fe3a3;
  box-shadow: 0 0 8px #7fe3a3;
}
.bt-console-head small { margin-left: auto; font-family: Inter, sans-serif; font-weight: 500; font-size: 0.72rem; letter-spacing: 0; color: var(--muted); }
.bt-chat {
  flex: 1;
  min-height: 190px;
  max-height: 260px;
  margin: 0;
  padding: 0.7rem 0.95rem;
  overflow-y: auto;
  list-style: none;
  font-family: "Roboto Condensed", "Arial Narrow", "Inter", sans-serif;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #d8d8d8;
  scrollbar-width: thin;
}
.bt-chat li { padding: 0.12rem 0; animation: bt-in 0.25s ease; text-shadow: 0 1px 2px #000; }
.bt-chat li.is-you { color: #9fb3c8; }
.bt-chat li.is-you b { color: #5fb7ff; }
@keyframes bt-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.bt-chat .c-pre { color: #f1c40f; }
.bt-chat .c-g { color: #2ecc71; }
.bt-chat .c-t { color: #d8bfd8; }
.bt-chat .c-err { color: #e74c3c; }
.bt-chat .c-warn, .bt-chat .c-cmd { color: #f1c40f; }
.bt-chat .c-req { color: #e67e22; }
.bt-chat .c-q { color: #fff; }
.bt-form {
  display: flex;
  gap: 0.45rem;
  padding: 0.6rem 0.95rem;
  border-top: 1px solid var(--line);
}
.bt-form label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.bt-form input {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.65rem;
  font-family: Consolas, Menlo, monospace;
  font-size: 0.9rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.bt-form input:focus { outline: none; border-color: var(--rk-accent-line); box-shadow: 0 0 0 3px var(--rk-accent-dim); }
.bt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.45rem 0.8rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--rk-accent-bright);
  background: var(--rk-accent-dim);
  border: 1px solid var(--rk-accent-line);
  border-radius: 8px;
  transition: background 0.2s ease, transform 0.15s ease;
}
.bt-btn:hover { background: rgba(230, 200, 74, 0.24); }
.bt-btn:active { transform: translateY(1px); }
.bt-btn.is-big {
  width: 100%;
  padding: 0.7rem 1rem;
  font-family: "Cinzel", serif;
  font-size: 0.98rem;
  letter-spacing: 0.05em;
  color: #1a1405;
  background: linear-gradient(180deg, #ffe38a, #e6c84a 55%, #b8962a);
  border-color: #ffe38a;
  box-shadow: 0 6px 18px rgba(230, 200, 74, 0.25);
}
.bt-btn.is-big:hover { filter: brightness(1.07); }
.bt-btn svg { width: 16px; height: 16px; }
.bt-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0 0.95rem 0.7rem;
}
.bt-quick button {
  padding: 0.22rem 0.55rem;
  font-family: Consolas, Menlo, monospace;
  font-size: 0.8rem;
  cursor: pointer;
  color: #e6c84a;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.bt-quick button:hover { border-color: var(--rk-accent-line); background: var(--rk-accent-dim); }
.bt-controls {
  display: grid;
  gap: 0.6rem;
  padding: 0.8rem 0.95rem 0.95rem;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
}

/* ---------- Rules it keeps ---------- */
.bt-rules {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.75rem;
  margin: 0 0 1.2rem;
}
.bt-rule {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  padding: 0.85rem 0.95rem;
  background: linear-gradient(180deg, var(--rk-panel-2), var(--rk-panel));
  border: 1px solid var(--line);
  border-radius: 10px;
}
.bt-rule svg { flex: 0 0 auto; width: 22px; height: 22px; margin-top: 0.1rem; color: var(--rk-accent); }
.bt-rule b { display: block; margin-bottom: 0.15rem; color: var(--text, #f1f3f8); font-size: 0.95rem; }
.bt-rule span { font-size: 0.86rem; color: var(--muted); line-height: 1.5; }

/* ---------- Cost calculator ---------- */
.bt-calc {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  margin: 0 0 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--rk-panel-2), var(--rk-panel));
}
.bt-calc-in { display: grid; gap: 0.9rem; padding: 1.1rem 1.2rem; }
.bt-field { display: grid; gap: 0.35rem; }
.bt-field > span { font-size: 0.76rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--rk-accent); }
.bt-field select,
.bt-field input {
  width: 100%;
  padding: 0.55rem 0.7rem;
  font: inherit;
  font-size: 0.95rem;
  color: var(--text, #f1f3f8);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.bt-field select:focus, .bt-field input:focus { outline: none; border-color: var(--rk-accent-line); box-shadow: 0 0 0 3px var(--rk-accent-dim); }
.bt-count { display: flex; align-items: center; gap: 0.6rem; }
.bt-count input[type="range"] { flex: 1; padding: 0; accent-color: #e6c84a; background: none; border: 0; box-shadow: none; }
.bt-count output { min-width: 3ch; font-family: Consolas, Menlo, monospace; font-weight: 700; font-size: 1.05rem; color: var(--rk-accent-bright); text-align: right; }
.bt-chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.4rem; }
.bt-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.4rem 0.2rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.bt-chip img { width: 34px; height: 34px; border-radius: 5px; }
.bt-chip:hover { color: var(--g); border-color: var(--g); }
.bt-chip[aria-pressed="true"] { color: var(--g); border-color: var(--g); background: var(--g-dim); }
.bt-calc-out {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.8rem;
  padding: 1.2rem 1.3rem;
  border-left: 1px solid var(--line);
  background:
    radial-gradient(ellipse 80% 70% at 100% 0%, var(--g-dim, rgba(230, 200, 74, 0.1)), transparent 70%),
    rgba(0, 0, 0, 0.25);
  overflow: hidden;
}
.bt-calc-out::after {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -30px;
  width: 170px;
  height: 170px;
  border-radius: 24px;
  background: var(--bt-tile) center / cover no-repeat;
  opacity: 0.13;
  transform: rotate(-12deg);
  pointer-events: none;
}
.bt-calc-label { margin: 0; font-size: 0.76rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.bt-cost { display: grid; gap: 0.45rem; margin: 0; padding: 0; list-style: none; position: relative; z-index: 1; }
.bt-cost li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0.7rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.bt-cost li span { font-size: 0.88rem; color: var(--muted); }
.bt-cost li b { font-family: Consolas, Menlo, monospace; font-size: 1.12rem; color: var(--text, #f1f3f8); white-space: nowrap; }
.bt-cost li.is-total { border-color: var(--g, var(--rk-accent-line)); background: var(--g-dim, var(--rk-accent-dim)); }
.bt-cost li.is-total b { color: var(--g, var(--rk-accent-bright)); font-size: 1.3rem; }
.bt-cost li.is-total span { color: var(--text, #f1f3f8); font-weight: 600; }
.bt-calc-free { position: relative; z-index: 1; margin: 0; font-size: 0.84rem; color: var(--muted); }
.bt-calc-free b { color: var(--bt-info); }

/* ---------- FAQ ---------- */
.bt-faq { display: grid; gap: 0.55rem; margin: 0 0 1rem; }
.bt-faq details {
  background: linear-gradient(180deg, var(--rk-panel-2), var(--rk-panel));
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.bt-faq summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1rem;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  color: var(--text, #f1f3f8);
}
.bt-faq summary::-webkit-details-marker { display: none; }
.bt-faq summary::after {
  content: "";
  width: 9px;
  height: 9px;
  margin-left: auto;
  border-right: 2px solid var(--rk-accent);
  border-bottom: 2px solid var(--rk-accent);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}
.bt-faq details[open] summary::after { transform: rotate(225deg); }
.bt-faq details[open] summary { color: var(--rk-accent-bright); }
.bt-faq .bt-faq-body { padding: 0 1rem 0.9rem; font-size: 0.93rem; line-height: 1.6; color: var(--muted); }
.bt-faq .bt-faq-body ul { margin: 0.3rem 0 0; padding-left: 1.2rem; }
.bt-faq .bt-faq-body li { margin: 0.2rem 0; }

/* ---------- Rank tag on the ladder ---------- */
.bt-rung-rank {
  position: absolute;
  top: 0.5rem;
  right: 0.55rem;
  padding: 0.1rem 0.4rem;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rk-accent-bright);
  background: var(--rk-accent-dim);
  border: 1px solid var(--rk-accent-line);
  border-radius: 999px;
}

/* ---------- In game screenshots ---------- */
.bt-shots {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
  grid-template-areas: "win badge" "chat chat";
  gap: 1rem;
  margin: 0 0 1rem;
}
.bt-shot {
  position: relative;
  display: flex;
  flex-direction: column;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--rk-accent-line);
  border-radius: 12px;
  background:
    radial-gradient(ellipse 70% 60% at 50% 40%, rgba(230, 200, 74, 0.08), transparent 70%),
    linear-gradient(180deg, #0b0e15, #07090e);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}
.bt-shot > a,
.bt-shot > picture {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 1.4rem;
}
.bt-shot img {
  display: block;
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.7));
  transition: transform 0.35s ease;
}
.bt-shot a:hover img { transform: scale(1.03); }
.bt-shot figcaption {
  padding: 0.65rem 1rem;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
}
.bt-shot figcaption b {
  display: block;
  margin-bottom: 0.1rem;
  font-family: "Cinzel", serif;
  letter-spacing: 0.04em;
  color: var(--rk-accent-bright);
}
.bt-shot-win { grid-area: win; }
.bt-shot-badge { grid-area: badge; }
.bt-shot-badge img { width: 110px; }
.bt-shot-chat { grid-area: chat; flex-direction: row; align-items: stretch; }
.bt-shot-chat > picture { justify-content: start; padding: 1rem 1.4rem; background: url("/images/plugins/build-tools/build-tools-hero.webp") center 70% / cover; position: relative; }
.bt-shot-chat > picture::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(5, 7, 13, 0.55), rgba(5, 7, 13, 0.25)); }
.bt-shot-chat img { position: relative; }
.bt-shot-chat figcaption { flex: 0 0 34%; display: flex; flex-direction: column; justify-content: center; border-top: 0; border-left: 1px solid var(--line); }

/* ---------- Demo rank picker ---------- */
.bt-rankpick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
}
.bt-rankpick > span {
  margin-right: 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.bt-rankpick button {
  padding: 0.28rem 0.6rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.bt-rankpick button:hover { color: var(--rk-accent-bright); border-color: var(--rk-accent-line); }
.bt-rankpick button[aria-pressed="true"] { color: #1a1405; background: var(--rk-accent-bright); border-color: var(--rk-accent-bright); }

/* ---------- Rank tiers ---------- */
.bt-tiers {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0 0 1.1rem;
}
.bt-tier {
  --t: #b7becf;
  --t-dim: rgba(183, 190, 207, 0.1);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.05rem 1rem 1rem;
  color: inherit;
  text-decoration: none;
  background:
    radial-gradient(ellipse 90% 60% at 50% 0%, var(--t-dim), transparent 70%),
    linear-gradient(180deg, var(--rk-panel-2), var(--rk-panel));
  border: 1px solid var(--line);
  border-top: 3px solid var(--t);
  border-radius: 12px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
a.bt-tier:hover { transform: translateY(-3px); border-color: var(--t); box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45), 0 0 22px var(--t-dim); }
.bt-tier.is-vip { --t: #7cc0ff; --t-dim: rgba(124, 192, 255, 0.12); }
.bt-tier.is-vet { --t: #b48cff; --t-dim: rgba(180, 140, 255, 0.13); }
.bt-tier.is-champ { --t: #ffd964; --t-dim: rgba(230, 200, 74, 0.14); }
.bt-tier.is-top { --t: #ff9f5c; --t-dim: rgba(255, 159, 92, 0.13); }
.bt-tier-name small a { color: inherit; text-decoration: underline; text-decoration-color: rgba(183, 190, 207, 0.4); }
.bt-tier-name small a:hover { color: var(--t); }
.bt-tier p { margin: 0; }
.bt-tier-name {
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: 1.08rem;
  letter-spacing: 0.04em;
  color: var(--t);
}
.bt-tier-name small { display: block; font-family: Inter, sans-serif; font-size: 0.72rem; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.bt-tier-grades { display: flex; gap: 4px; }
.bt-tier-grades img {
  flex: 1 1 0;
  min-width: 0;
  width: 100%;
  max-width: 40px;
  height: auto;
  aspect-ratio: 1;
  border-radius: 5px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.bt-tier-grades img.is-locked { filter: grayscale(1) brightness(0.4); opacity: 0.5; }
.bt-tier-grades img.is-new { box-shadow: 0 0 0 2px var(--t), 0 0 12px var(--t-dim); }
.bt-tier-time { font-size: 0.85rem; color: var(--muted); }
.bt-tier-time b {
  margin-right: 0.15rem;
  font-family: "Cinzel", serif;
  font-size: 2rem;
  line-height: 1;
  color: var(--text, #f1f3f8);
}
.bt-tier-time::before {
  content: "Auto disable";
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.bt-tier-note { font-size: 0.86rem; color: var(--muted); }
.bt-tier-note b { color: var(--t); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .bt-sim { grid-template-columns: 1fr; }
  .bt-console { border-left: 0; border-top: 1px solid var(--rk-accent-line); }
  .bt-calc { grid-template-columns: 1fr; }
  .bt-calc-out { border-left: 0; border-top: 1px solid var(--line); }
  .bt-tiers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bt-tier.is-top { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .bt-ladder { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bt-ladder::before { display: none; }
  .bt-steps { grid-template-columns: 1fr; }
  .bt-shots { grid-template-columns: minmax(0, 1fr); grid-template-areas: "win" "badge" "chat"; }
  .bt-shot-chat { flex-direction: column; }
  .bt-shot-chat figcaption { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 520px) {
  .bt-ladder { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
  .bt-stage { min-height: 430px; }
  .bt-build { grid-template-columns: repeat(6, 40px); gap: 4px; top: 12%; }
  .bt-slot, .bt-block { width: 40px; height: 58px; }
  .bt-hud { transform: translateX(-50%) scale(0.8); transform-origin: 50% 100%; bottom: 4px; max-width: none; }
  .bt-chips { grid-template-columns: repeat(2, 1fr); }
  .bt-tiers { grid-template-columns: minmax(0, 1fr); }
  .bt-tier.is-top { grid-column: auto; }
  .bt-shot > a, .bt-shot > picture { padding: 0.9rem; }
}
@media (prefers-reduced-motion: reduce) {
  .bt-crest .bt-crest-ring,
  .bt-block,
  .bt-block.is-upgrading,
  .bt-block.is-upgrading::after,
  .bt-float,
  .bt-chat li { animation: none; }
  .bt-rung, .bt-rung-tile img, .bt-rung-tile::after, .bt-tier, .bt-shot img { transition: none; }
}
