.cb-hero,
.cb-detail-hero {
  border-bottom: 3px solid var(--mc-outline);
}

.cb-detail-hero {
  background:
    linear-gradient(90deg, rgba(227, 169, 44, 0.1) 1px, transparent 1px),
    linear-gradient(rgba(227, 169, 44, 0.08) 1px, transparent 1px),
    #23272c;
  background-size: 24px 24px;
}

.cb-hero {
  position: relative;
  overflow: hidden;
  background: #090d10;
}

.cb-hero::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(7, 10, 12, 0.96) 0%, rgba(7, 10, 12, 0.88) 32%, rgba(7, 10, 12, 0.58) 56%, rgba(7, 10, 12, 0.14) 82%),
    linear-gradient(0deg, rgba(4, 6, 7, 0.52), transparent 52%);
  content: "";
}

.cb-hero__media,
.cb-hero__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.cb-hero__media img {
  max-width: none;
  object-fit: cover;
  object-position: center;
}

.cb-hero__inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: center;
  min-height: 390px;
  padding-top: clamp(48px, 8vw, 92px);
  padding-bottom: clamp(48px, 8vw, 92px);
}

.cb-hero__copy {
  max-width: 760px;
}

.cb-hero h1,
.cb-detail-hero h1 {
  margin: 0.12em 0 0.25em;
  color: #fff;
  font-family: var(--font-ui);
  font-size: clamp(2.5rem, 7vw, 5.4rem);
  line-height: 1;
  letter-spacing: -0.045em;
  text-shadow: 4px 4px 0 #111;
}

.cb-hero h1 {
  font-size: clamp(2.5rem, 5.3vw, 4.6rem);
}

@media (min-width: 761px) {
  .cb-hero h1 { white-space: nowrap; }
}

.cb-hero__copy > p:last-child,
.cb-detail-hero__grid > div:first-child > p:last-child {
  max-width: 68ch;
  margin-bottom: 0;
  color: #cbd1d7;
  font-size: clamp(1.05rem, 2vw, 1.2rem);
}

.cb-directory,
.cb-detail {
  padding-top: 48px;
  padding-bottom: 72px;
}

.cb-start-here {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 32px;
  align-items: center;
  margin-bottom: 56px;
  padding: clamp(24px, 3vw, 34px);
  border-left: 10px solid var(--mc-gold);
}

.cb-start-here h2,
.cb-section-heading h2,
.cb-requirements h2,
.cb-result h2,
.cb-chain-map h2,
.cb-troubleshoot h2 {
  margin: 0.1em 0 0;
  font-family: var(--font-ui);
  line-height: 1.25;
}

.cb-start-here ol {
  margin: 0;
  padding-left: 1.5rem;
}

.cb-start-here code {
  overflow-wrap: anywhere;
}

.cb-section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.7fr);
  gap: 32px;
  align-items: end;
  margin-bottom: 24px;
}

.cb-section-heading > p {
  margin: 0;
  color: var(--color-text-muted);
}

.cb-filters {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(170px, 0.5fr) minmax(190px, 0.6fr);
  gap: 14px;
  padding: 18px;
  border: 3px solid var(--mc-outline);
  background: #292d32;
}

.cb-filter-field {
  margin-bottom: 0;
  min-width: 0;
}

.cb-filter-field label {
  color: #d8dde1;
}
.cb-result-count { min-height: 1.6em; margin: 14px 0; color: var(--color-text-muted); }

.cb-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.cb-use-card {
  min-width: 0;
}

.cb-use-card[hidden],
.cb-empty[hidden] { display: none; }

.cb-category {
  margin: 0;
}
.cb-difficulty { color: #222; }
.cb-difficulty--beginner { background: #cfe8bd; }
.cb-difficulty--intermediate { background: #f3d795; }
.cb-difficulty--advanced { background: #e8aaa4; }
.cb-empty { text-align: center; }

.cb-detail-header__grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: end; }
.cb-detail-summary { max-width: 780px; margin-bottom: 0; }

.cb-edition-switch {
  min-width: 310px;
}

.cb-edition-switch > span,
.cb-edition-switch small { display: block; color: var(--color-text-muted); }
.cb-edition-switch > span { font-family: var(--font-ui); font-size: 0.9rem; font-weight: 700; }
.cb-edition-switch > div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 6px 0; }
.cb-edition-switch .btn { width: 100%; }

.cb-detail { padding-top: 28px; padding-bottom: 56px; }
.cb-detail__intro { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.cb-info-card { padding: 20px; }
.cb-info-card h2 { margin-top: 4px; }
.cb-requirements { border-top: 6px solid var(--mc-aqua); }
.cb-result { border-top: 6px solid var(--mc-grass-deep); }
.cb-requirements ul { margin-bottom: 0; }

.cb-chain-map {
  display: grid;
  grid-template-columns: minmax(240px, 0.7fr) minmax(0, 1.3fr);
  gap: 32px;
  align-items: center;
  margin-top: 24px;
  padding: 20px;
}

.cb-chain-map__rail { display: flex; align-items: center; justify-content: center; min-width: 0; overflow-x: auto; padding: 16px 4px; }
.cb-chain-node { display: grid; flex: 0 0 120px; min-height: 84px; place-content: center; border: 3px solid #151515; box-shadow: var(--bevel-raised); color: #1b1c1e; font-family: var(--font-ui); text-align: center; }
.cb-chain-node b { font-size: 1.25rem; }
.cb-chain-node--impulse { background: #d59a71; }
.cb-chain-node--repeat { background: #a58ac1; }
.cb-chain-node--chain { background: #85b592; }
.cb-chain-arrow { flex: 0 0 42px; color: #333; font-family: var(--font-pixel); font-size: 2rem; text-align: center; }

.cb-steps { margin-top: 48px; }
.cb-step { padding: 20px; }
.cb-step + .cb-step { margin-top: 24px; }
.cb-step__heading { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 16px; align-items: start; max-width: 900px; margin-bottom: 18px; }
.cb-step__heading > span { display: grid; width: 52px; height: 52px; place-items: center; border: 3px solid #101112; box-shadow: var(--bevel-raised); background: var(--mc-gold); color: #17191b; font-family: var(--font-ui); font-size: 1.35rem; font-weight: 700; }
.cb-step__heading h3 { margin: 0; font-family: var(--font-ui); font-size: 1.35rem; }
.cb-step__heading p { margin: 4px 0 0; color: var(--color-text-muted); }

.cb-game-ui { overflow: hidden; border: 4px solid #0d0e0f; box-shadow: 10px 10px 0 rgba(0, 0, 0, 0.28); font-family: var(--font-ui); }
.cb-game-ui code { font-family: var(--font-pixel); }

.cb-game-ui--bedrock { background: #050505; color: #f4f4f4; }
.cb-bedrock__title { position: relative; padding: 14px 50px; border-bottom: 4px solid #111; background: #c6c6c6; color: #494949; font-size: 1.55rem; text-align: center; }
.cb-bedrock__title span { position: absolute; right: 18px; top: 5px; font-size: 2rem; }
.cb-bedrock__body { display: grid; grid-template-columns: minmax(270px, 0.72fr) minmax(0, 1.28fr); min-height: 590px; }
.cb-bedrock__settings { display: flex; flex-direction: column; gap: 8px; padding: 20px; border-right: 4px solid #151515; background: #080808; }
.cb-bedrock__settings label,
.cb-bedrock__command > label { font-size: 1.08rem; }
.cb-game-field,
.cb-game-select { display: flex; min-height: 58px; align-items: center; padding: 10px 14px; border: 3px solid #242424; box-shadow: var(--bevel-raised); background: #c6c6c6; color: #4a4a4a; }
.cb-game-field--muted { min-height: 68px; background: #666; color: #e8e8e8; }
.cb-game-select { justify-content: space-between; }
.cb-game-select--impulse { color: #e87936; }
.cb-game-select--repeat { color: #8b62b3; }
.cb-game-select--chain { color: #397c4b; }
.cb-mini-block { width: 38px; height: 38px; margin-right: 10px; border: 2px solid #333; background: currentColor; box-shadow: inset 5px 5px 0 rgba(255, 255, 255, 0.3); }
.cb-game-toggle { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.cb-game-toggle span { position: relative; width: 56px; height: 30px; border: 3px solid #222; background: #585858; }
.cb-game-toggle span::after { position: absolute; top: -3px; left: -3px; width: 24px; height: 30px; border: 3px solid #333; background: #c7c7c7; content: ""; }
.cb-game-toggle.is-on span { background: #4b8b56; }
.cb-game-toggle.is-on span::after { right: -3px; left: auto; }
.cb-game-toggle b { font-size: 0.75rem; }

.cb-bedrock__command { min-width: 0; padding: 20px; background: #030303; }
.cb-command-input { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 7px; }
.cb-command-input code,
.cb-java__command code { display: block; min-width: 0; overflow-x: auto; padding: 16px; border: 3px solid #2b2b2b; background: #666; color: #fff; white-space: nowrap; }
.cb-command-input button,
.cb-java__command button { min-height: 52px; padding: 8px 16px; border: 3px solid #222; box-shadow: var(--bevel-raised); background: #c6c6c6; color: #232323; cursor: pointer; }
.cb-command-input button:hover,
.cb-java__command button:hover { background: #e1e1e1; }
.cb-selector-help { display: grid; gap: 2px; margin: 18px 14px; font-size: 0.96rem; }
.cb-previous-output { display: grid; grid-template-columns: auto 1fr; gap: 8px 10px; align-items: center; }
.cb-previous-output > div { grid-column: 1 / -1; min-height: 112px; padding: 12px; border: 3px solid #292929; background: #666; }
.cb-output-check { display: inline-block; width: 30px; height: 30px; border: 3px solid #222; background: #656565; }
.cb-output-check.is-on::after { display: block; margin: 1px 0 0 6px; color: #fff; content: "✓"; font-size: 1.1rem; }
.cb-bedrock__summary { margin: 14px 0 0; }
.cb-bedrock__summary div { display: flex; gap: 5px; }
.cb-bedrock__summary dt { font-weight: 400; }
.cb-bedrock__summary dd { margin: 0; color: #e88745; }

.cb-game-ui--java { padding: clamp(28px, 6vw, 64px); background: repeating-linear-gradient(0deg, #5f5f5f 0 4px, #656565 4px 8px); color: #222; }
.cb-java__window { max-width: 820px; margin: 0 auto; padding: 18px; border: 4px solid #1b1b1b; box-shadow: var(--bevel-raised); background: #c6c6c6; }
.cb-java__title { margin-bottom: 14px; font-size: 1.25rem; text-align: center; }
.cb-java__label { display: block; margin-bottom: 5px; }
.cb-java__command { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.cb-java__command code { background: #111; color: #fff; }
.cb-java__hint { margin: 8px 0 18px; color: #4a4a4a; font-size: 0.82rem; }
.cb-java__output { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.cb-java__output code { min-width: 0; min-height: 38px; overflow-x: auto; padding: 6px 10px; border: 2px solid #333; background: #777; color: #eee; }
.cb-java__options,
.cb-java__actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 18px; }
.cb-java-button,
.cb-java__actions span { display: grid; min-height: 48px; place-items: center; padding: 8px; border: 3px solid #242424; box-shadow: var(--bevel-raised); background: #bcbcbc; text-align: center; }
.cb-java-button--impulse { color: #a44f1d; }
.cb-java-button--repeat { color: #714394; }
.cb-java-button--chain { color: #2f7042; }
.cb-java__actions { grid-template-columns: 1fr 1fr; }

.cb-warning { margin-top: 14px; padding: 10px 16px; border-left: 6px solid var(--mc-gold); background: #342c1d; }
.cb-warning p { margin: 0; }
.cb-troubleshoot { display: grid; grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr); gap: 26px 40px; margin-top: 40px; padding: 24px; border-top: 8px solid var(--mc-redstone); }
.cb-troubleshoot ol { margin: 0; }
.cb-troubleshoot > a { grid-column: 2; justify-self: start; }

@media (max-width: 980px) {
  .cb-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cb-detail-header__grid { grid-template-columns: minmax(0, 1fr); }
  .cb-edition-switch { width: min(100%, 520px); min-width: 0; }
  .cb-bedrock__body { grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.2fr); }
}

@media (max-width: 760px) {
  .cb-hero__inner,
  .cb-start-here,
  .cb-section-heading,
  .cb-detail__intro,
  .cb-chain-map,
  .cb-troubleshoot { grid-template-columns: minmax(0, 1fr); }
  .cb-hero__inner {
    min-height: 500px;
  }
  .cb-hero__media img { object-position: 58% center; }
  .cb-hero::after {
    background:
      linear-gradient(90deg, rgba(7, 10, 12, 0.9), rgba(7, 10, 12, 0.62)),
      linear-gradient(0deg, rgba(4, 6, 7, 0.74), rgba(4, 6, 7, 0.24) 62%);
  }
  .cb-filters { grid-template-columns: minmax(0, 1fr); }
  .cb-card-grid { grid-template-columns: minmax(0, 1fr); }
  .cb-bedrock__body { grid-template-columns: minmax(0, 1fr); }
  .cb-bedrock__settings { border-right: 0; border-bottom: 4px solid #151515; }
  .cb-troubleshoot > a { grid-column: 1; }
}

@media (max-width: 520px) {
  .cb-hero__inner {
    align-items: end;
    min-height: 520px;
    padding-top: 110px;
    padding-bottom: 42px;
  }
  .cb-hero__media img { object-position: 57% center; }
  .cb-hero::after {
    background:
      linear-gradient(90deg, rgba(7, 10, 12, 0.88), rgba(7, 10, 12, 0.5)),
      linear-gradient(0deg, rgba(4, 6, 7, 0.94) 0%, rgba(4, 6, 7, 0.58) 58%, rgba(4, 6, 7, 0.2));
  }
  .cb-start-here { padding: 22px 18px; }
  .cb-card-grid { gap: 18px; }
  .cb-directory,
  .cb-detail { padding-top: 30px; }
  .cb-command-input,
  .cb-java__command { grid-template-columns: minmax(0, 1fr); }
  .cb-command-input button,
  .cb-java__command button { width: 100%; }
  .cb-game-ui--java { padding: 16px 8px; }
  .cb-java__options { grid-template-columns: minmax(0, 1fr); }
  .cb-java__output { grid-template-columns: minmax(0, 1fr) auto; }
  .cb-java__output > span:first-child { grid-column: 1 / -1; }
  .cb-chain-map__rail { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .cb-command-input button,
  .cb-java__command button { transition: none; }
}
