/* Final shared polish layer for every Flesh and Blood surface. */
html.fab-page {
  --fab-polish-line: rgba(216, 161, 81, 0.46);
  --fab-polish-line-strong: rgba(244, 213, 138, 0.78);
  --fab-polish-quiet: #cbbdb5;
  --fab-polish-shadow: 0 18px 42px rgba(5, 1, 1, 0.48);
  scrollbar-color: rgba(216, 161, 81, 0.72) rgba(19, 7, 7, 0.92);
  scrollbar-width: thin;
}

html.fab-page body {
  min-height: 100vh;
}

html.fab-page ::selection {
  background: rgba(180, 35, 40, 0.72);
  color: #fff8e9;
}

html.fab-page :is(.value, dd, td, .mono) {
  font-variant-numeric: tabular-nums;
}

html.fab-page :is(input[type="checkbox"], input[type="radio"]) {
  accent-color: #d8a151;
}

html.fab-page :is(button, .btn):disabled {
  cursor: not-allowed;
  filter: saturate(0.45);
  opacity: 0.56;
  transform: none;
}

html.fab-page .site-header {
  border-top: 0;
  border-bottom-color: rgba(216, 161, 81, 0.4);
}

html.fab-page .site-header .site-header-main {
  position: relative;
}

html.fab-page .site-header .site-header-main::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(180, 35, 40, 0.78) 18%,
    rgba(216, 161, 81, 0.9) 50%,
    rgba(180, 35, 40, 0.78) 82%,
    transparent
  );
  content: "";
  pointer-events: none;
}

html.fab-page .site-header .global-nav .nav-link {
  min-height: 40px;
  justify-content: center;
}

html.fab-page .site-footer {
  border-top-color: rgba(216, 161, 81, 0.4);
}

/* Set navigator */
html.fab-index .wrap {
  width: min(100% - 28px, 1180px);
  margin-inline: auto;
  padding-block: clamp(22px, 4vw, 46px);
}

html.fab-index main.wrap > .card:first-child {
  min-height: 250px;
  justify-content: center;
  padding: clamp(30px, 6vw, 64px);
  border-color: rgba(216, 161, 81, 0.62);
  background:
    linear-gradient(108deg, rgba(88, 13, 17, 0.62), transparent 48%),
    radial-gradient(
      circle at 84% 18%,
      rgba(216, 161, 81, 0.16),
      transparent 22rem
    ),
    repeating-linear-gradient(
      126deg,
      transparent 0 42px,
      rgba(180, 35, 40, 0.08) 43px 56px,
      transparent 57px 82px
    ),
    linear-gradient(145deg, rgba(31, 10, 11, 0.99), rgba(8, 4, 5, 0.99));
}

html.fab-index main.wrap > .card:first-child::before {
  inset: auto -100px -230px 54%;
  width: 580px;
  height: 480px;
  background: radial-gradient(
    circle,
    rgba(216, 161, 81, 0.14),
    transparent 68%
  );
}

html.fab-index main.wrap > .card:first-child::after {
  border-color: rgba(216, 161, 81, 0.72);
  opacity: 0.72;
}

html.fab-index .heading {
  width: 100%;
  max-width: none;
  gap: 14px;
}

html.fab-index h1 {
  color: #f4c873;
  background: linear-gradient(180deg, #fff8e1 0%, #f3cb78 48%, #c77a2b 100%);
  background-clip: text;
  font-family: "Cinzel", Georgia, "Times New Roman", serif;
  font-size: clamp(2.25rem, 4.8vw, 4.1rem);
  font-weight: 700;
  letter-spacing: 0.015em;
  line-height: 1.04;
  text-transform: none;
  text-wrap: balance;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 0 rgba(76, 24, 7, 0.92))
    drop-shadow(0 10px 18px rgba(0, 0, 0, 0.5));
  text-shadow: none;
}

html.fab-index .heading p {
  width: 100%;
  max-width: none;
  padding: 0 0 0 16px;
  border: 0;
  border-left: 3px solid rgba(216, 161, 81, 0.7);
  border-radius: 0;
  background: none;
  color: #eadfd8;
  font-size: clamp(0.98rem, 0.3vw + 0.92rem, 1.08rem);
  line-height: 1.62;
}

html.fab-index .set-navigator {
  gap: 18px;
  margin-top: clamp(16px, 3vw, 28px);
  padding: clamp(18px, 3vw, 28px);
  border-radius: 14px;
  background:
    radial-gradient(circle at 0 0, rgba(216, 161, 81, 0.08), transparent 28rem),
    linear-gradient(145deg, rgba(29, 12, 11, 0.98), rgba(13, 5, 6, 0.98));
}

html.fab-index .set-controls {
  gap: 10px;
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(216, 161, 81, 0.24);
  border-radius: 10px;
  background: rgba(9, 4, 4, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 242, 215, 0.04);
}

html.fab-index .set-control {
  gap: 7px;
}

html.fab-index .set-control span {
  color: #d7c8bf;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

html.fab-index .set-control :is(input, select) {
  min-height: 44px;
  border-color: rgba(216, 161, 81, 0.4);
  background: rgba(7, 3, 3, 0.9);
  color: #fff2d7;
  box-shadow: inset 0 1px 0 rgba(255, 242, 215, 0.05);
}

html.fab-index .set-rows {
  gap: 8px;
  margin-top: 0;
}

html.fab-index .set-row {
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 16px;
  min-height: 76px;
  padding: 10px 12px;
  border-color: rgba(216, 161, 81, 0.26);
  border-radius: 10px;
  background:
    linear-gradient(90deg, rgba(117, 16, 19, 0.18), transparent 28%),
    linear-gradient(152deg, rgba(31, 13, 12, 0.94), rgba(14, 6, 6, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 242, 215, 0.035);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

html.fab-index .set-row::before {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid rgba(216, 161, 81, 0.58);
  background: linear-gradient(
    145deg,
    rgba(126, 17, 20, 0.88),
    rgba(48, 7, 9, 0.95)
  );
  clip-path: polygon(10px 0, 100% 0, 100% 42px, 42px 100%, 0 100%, 0 10px);
  color: #f4d58a;
  content: attr(data-code);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

html.fab-index .set-row:hover,
html.fab-index .set-row:focus-within {
  border-color: rgba(244, 213, 138, 0.76);
  box-shadow:
    0 14px 28px rgba(9, 4, 4, 0.46),
    inset 3px 0 0 rgba(180, 35, 40, 0.8);
  transform: translateX(2px);
}

html.fab-index .set-row[hidden] {
  display: none;
}

html.fab-index .set-meta {
  max-width: none;
}

html.fab-index .set-title {
  color: #fff2d7;
  font-size: 1.02rem;
  font-weight: 720;
  line-height: 1.3;
}

html.fab-index .set-date {
  color: var(--fab-polish-quiet);
  font-size: 0.82rem;
}

html.fab-index .set-tools {
  justify-content: flex-end;
}

html.fab-index .set-tools .btn {
  min-width: 104px;
  min-height: 40px;
  justify-content: center;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(5, 1, 1, 0.34);
}

/* Preconstructed deck calculator */
html.fab-precon body {
  background:
    radial-gradient(
      circle at 14% 1%,
      rgba(143, 23, 27, 0.28),
      transparent 34rem
    ),
    radial-gradient(
      circle at 88% 8%,
      rgba(216, 161, 81, 0.13),
      transparent 30rem
    ),
    linear-gradient(180deg, #080303 0%, #100605 48%, #050202 100%);
}

html.fab-precon .wrap {
  max-width: 1280px;
  padding: clamp(20px, 3vw, 34px) clamp(14px, 2.5vw, 26px) 48px;
}

html.fab-precon .card {
  border-color: var(--fab-polish-line);
  border-radius: 14px;
  background:
    radial-gradient(circle at 0 0, rgba(216, 161, 81, 0.08), transparent 26rem),
    linear-gradient(145deg, rgba(32, 13, 12, 0.98), rgba(15, 6, 6, 0.98));
  box-shadow:
    var(--fab-polish-shadow),
    inset 0 1px 0 rgba(255, 242, 215, 0.04);
}

html.fab-precon .page-intro {
  gap: 10px;
  padding: clamp(26px, 4vw, 42px);
  border-color: rgba(216, 161, 81, 0.72);
  background:
    linear-gradient(112deg, rgba(74, 12, 15, 0.62), transparent 46%),
    radial-gradient(
      circle at 84% 16%,
      rgba(216, 161, 81, 0.13),
      transparent 22rem
    ),
    repeating-linear-gradient(
      128deg,
      transparent 0 38px,
      rgba(180, 35, 40, 0.1) 39px 54px,
      transparent 55px 78px
    ),
    linear-gradient(135deg, rgba(31, 10, 11, 0.99), rgba(8, 4, 5, 0.99));
}

html.fab-precon .page-intro h1 {
  max-width: 880px;
  margin: 0 0 6px;
  color: #fff2d7;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 4.7vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1;
  text-transform: none;
  text-wrap: balance;
}

html.fab-precon .page-intro > p {
  max-width: 86ch;
  margin: 0;
  color: #eadfd8;
  line-height: 1.58;
}

html.fab-precon .page-intro .intro {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(216, 161, 81, 0.24);
  color: #cfc1b9;
  font-size: 0.9rem;
}

html.fab-precon .sub,
html.fab-precon .pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

html.fab-precon .pill {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  margin: 0;
  padding: 5px 11px;
  border-color: rgba(216, 161, 81, 0.48);
  background: rgba(12, 6, 6, 0.74);
  color: #f8e7c0;
  box-shadow: inset 0 1px 0 rgba(255, 242, 215, 0.06);
}

html.fab-precon main.wrap > .card:not(.page-intro) {
  margin-top: 14px;
}

html.fab-precon .settings {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

html.fab-precon .settings .section {
  gap: 14px;
  padding: 18px;
  border-color: rgba(216, 161, 81, 0.34);
  border-radius: 10px;
  background: linear-gradient(
    145deg,
    rgba(25, 10, 10, 0.96),
    rgba(11, 5, 5, 0.96)
  );
  box-shadow: inset 0 1px 0 rgba(255, 242, 215, 0.04);
}

html.fab-precon .section h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff2d7;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
}

html.fab-precon .section h3::after {
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, rgba(216, 161, 81, 0.5), transparent);
  content: "";
}

html.fab-precon .section-body {
  display: grid;
  gap: 12px;
}

html.fab-precon .form-row {
  gap: 7px;
}

html.fab-precon .form-row > label,
html.fab-precon .tool-item > label {
  color: #d8cbc3;
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

html.fab-precon :is(input[type="number"], select) {
  border-color: rgba(216, 161, 81, 0.42);
  background: rgba(7, 3, 3, 0.88);
  color: #fff2d7;
}

html.fab-precon .section-actions {
  margin-top: auto;
}

html.fab-precon #calcEV {
  width: 100%;
  min-height: 48px;
  justify-content: center;
  border-color: rgba(244, 213, 138, 0.78);
  border-radius: 8px;
  background: linear-gradient(135deg, #9b1d22, #4c090c);
  color: #fff8e9;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

html.fab-precon .summary-card {
  gap: 16px;
}

html.fab-precon .summary-header {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(216, 161, 81, 0.24);
}

html.fab-precon .summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

html.fab-precon .summary-grid .box {
  min-width: 0;
  min-height: 116px;
  justify-content: center;
  padding: 14px;
  border-color: rgba(216, 161, 81, 0.3);
  border-radius: 9px;
  background: linear-gradient(
    145deg,
    rgba(36, 13, 13, 0.88),
    rgba(12, 5, 5, 0.92)
  );
  box-shadow: inset 3px 0 0 rgba(151, 25, 29, 0.58);
}

html.fab-precon .summary-grid .label {
  color: #cbbdb5;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

html.fab-precon .summary-grid .value {
  color: #f4d58a;
  font-size: clamp(1.25rem, 2vw, 1.7rem);
  font-weight: 850;
}

html.fab-precon .value-pair {
  display: grid;
  gap: 7px;
}

html.fab-precon .pair-row {
  display: flex;
  gap: 10px;
  align-items: baseline;
  justify-content: space-between;
}

html.fab-precon .sub-label {
  color: #cbbdb5;
  font-size: 0.72rem;
}

html.fab-precon #statusText {
  margin-top: 0;
  padding-top: 12px;
  border-top: 1px solid rgba(216, 161, 81, 0.18);
}

html.fab-precon .table-card {
  gap: 12px;
}

html.fab-precon .table-tools {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(216, 161, 81, 0.2);
}

html.fab-precon .check {
  min-height: 44px;
  color: #e8dcd4;
}

html.fab-precon .table-wrap {
  border: 1px solid rgba(216, 161, 81, 0.32);
  border-radius: 10px;
  background: rgba(7, 3, 3, 0.72);
}

html.fab-precon .main-table {
  min-width: 880px;
}

html.fab-precon .main-table tbody tr:hover td {
  background: rgba(216, 161, 81, 0.08);
}

/* Booster calculator finishing details */
html.fab-ev.fab-layout-a .fab-masthead > p:nth-of-type(3) {
  margin-top: 10px;
  padding: 9px 12px;
  border-left: 2px solid rgba(216, 161, 81, 0.58);
  background: linear-gradient(90deg, rgba(216, 161, 81, 0.08), transparent);
  color: #d8cbc3;
  font-size: 0.88rem;
}

html.fab-ev.fab-layout-a .fab-calculator-shell {
  border-color: rgba(216, 161, 81, 0.56);
}

html.fab-ev.fab-layout-a .fab-calculator-heading {
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(216, 161, 81, 0.22);
}

html.fab-ev.fab-layout-a .fab-calculator-shell .section h3 {
  display: flex;
  align-items: center;
  gap: 9px;
}

html.fab-ev.fab-layout-a .fab-calculator-shell .section h3::after {
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, rgba(216, 161, 81, 0.46), transparent);
  content: "";
}

html.fab-ev.fab-layout-a :is(input[type="number"], select) {
  border-color: rgba(216, 161, 81, 0.42);
  background: rgba(7, 3, 3, 0.86);
}

html.fab-ev.fab-layout-a .mini tbody tr:hover :is(th, td),
html.fab-ev.fab-layout-a #evTable tbody tr:hover td {
  background: rgba(216, 161, 81, 0.09);
}

html.fab-ev.fab-layout-a .fab-analysis-grid {
  align-items: stretch;
}

html.fab-ev.fab-layout-a
  .fab-analysis-grid
  > :is(.sim-chart, .fab-value-breakdown) {
  min-width: 0;
}

html.fab-ev.fab-layout-a .fab-value-breakdown {
  border-top-color: rgba(244, 213, 138, 0.76);
}

html.fab-ev.fab-layout-a .main-table {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-gutter: stable;
}

html.fab-ev.fab-layout-a .main-table > table {
  min-width: 920px;
}

html.fab-ev.fab-layout-a .table-tools {
  position: sticky;
  left: 0;
  width: 100%;
  min-width: 100%;
  padding: 10px;
  border-bottom: 1px solid rgba(216, 161, 81, 0.18);
  background: rgba(8, 4, 4, 0.84);
}

@media (max-width: 960px) {
  html.fab-precon .settings,
  html.fab-precon .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 799px) {
  html.fab-ev.fab-layout-a .main-table,
  html.fab-ev.fab-layout-a .table-card,
  html.fab-precon .table-card {
    display: block;
  }

  html.fab-precon .main-table {
    display: table;
  }
}

@media (max-width: 720px) {
  html.fab-index .wrap {
    width: min(100% - 18px, 1180px);
  }

  html.fab-index main.wrap > .card:first-child {
    min-height: 0;
    padding: 28px 20px;
  }

  html.fab-index .set-controls {
    padding: 10px;
  }

  html.fab-index .set-row {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 12px;
    padding: 11px;
  }

  html.fab-index .set-row::before {
    width: 46px;
    height: 46px;
    font-size: 0.7rem;
  }

  html.fab-index .set-tools {
    grid-column: 1 / -1;
    width: 100%;
  }

  html.fab-index .set-tools .btn {
    width: 100%;
  }

  html.fab-precon .page-intro {
    padding: 24px 18px;
  }

  html.fab-precon .settings,
  html.fab-precon .summary-grid {
    grid-template-columns: 1fr;
  }

  html.fab-precon .summary-grid .box {
    min-height: 96px;
  }

  html.fab-precon .table-tools {
    align-items: stretch;
  }

  html.fab-precon .tool-item {
    width: 100%;
  }

  html.fab-ev.fab-layout-a .table-tools {
    min-width: 100%;
  }
}

@media (max-width: 520px) {
  html.fab-index h1,
  html.fab-precon .page-intro h1 {
    font-size: clamp(2rem, 10.5vw, 2.7rem);
  }

  html.fab-index h1 {
    font-size: clamp(1.75rem, 9.8vw, 2.45rem);
    text-wrap: wrap;
  }

  html.fab-index .set-navigator {
    padding: 14px 10px;
  }

  html.fab-precon .sub,
  html.fab-precon .pill-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  html.fab-precon .pill {
    justify-content: center;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.fab-page *,
  html.fab-page *::before,
  html.fab-page *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
