:root {
  color-scheme: light;
  --bg: #edf0e8;
  --panel: #fbfaf4;
  --panel-soft: #e5ece5;
  --line: #c8d3ca;
  --line-soft: rgba(27, 43, 38, 0.08);
  --text: #17231f;
  --muted: #65736d;
  --accent: #c88d22;
  --accent-strong: #e0a83a;
  --accent-2: #278f82;
  --danger: #ba4e3f;
  --good: #4f9b53;
  --shadow: 0 24px 70px rgba(36, 55, 48, 0.18);
  --shadow-soft: 0 14px 34px rgba(36, 55, 48, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 16% 8%, rgba(224, 168, 58, 0.22), transparent 24rem),
    radial-gradient(circle at 86% 18%, rgba(39, 143, 130, 0.18), transparent 26rem),
    linear-gradient(90deg, rgba(23, 35, 31, 0.045) 1px, transparent 1px),
    linear-gradient(0deg, rgba(23, 35, 31, 0.04) 1px, transparent 1px),
    linear-gradient(140deg, #f3f1e7 0%, #e5eee8 48%, #efe4cf 100%);
  background-size: auto, auto, 64px 64px, 64px 64px, auto;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 44px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  padding: 14px 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2.25rem, 5vw, 4.75rem);
  line-height: 0.9;
  letter-spacing: 0;
}

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

.language {
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(251, 250, 244, 0.88);
  box-shadow: var(--shadow-soft);
}

.lang-button,
.group-tab {
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  min-height: 38px;
  padding: 0 14px;
  font-weight: 800;
}

.lang-button.active {
  color: #ffffff;
  background: var(--accent);
}

.workspace {
  display: grid;
  gap: 18px;
}

.tabs {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(251, 250, 244, 0.96), rgba(232, 239, 232, 0.96));
  box-shadow: var(--shadow-soft);
  position: relative;
  z-index: 30;
}

.tool-picker {
  padding: 14px;
}

.tool-groups {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.active-tool-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.active-tool-pill {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  color: var(--text);
  background: rgba(251, 250, 244, 0.86);
  font-size: 0.86rem;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(36, 55, 48, 0.06);
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease, background 150ms ease;
}

.active-tool-pill:hover,
.active-tool-pill.active {
  border-color: rgba(200, 141, 34, 0.46);
  background: #fff8e8;
  box-shadow: 0 14px 28px rgba(36, 55, 48, 0.12);
  transform: translateY(-1px);
}

.active-tool-pill.active {
  color: #ffffff;
  background: linear-gradient(180deg, var(--accent-strong), var(--accent));
}

.tool-menu {
  position: relative;
  min-width: 0;
}

.group-tab {
  display: grid;
  align-content: center;
  gap: 2px;
  width: 100%;
  min-height: 56px;
  border: 1px solid var(--line);
  background: rgba(251, 250, 244, 0.84);
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.group-tab:hover {
  color: var(--text);
  border-color: rgba(200, 141, 34, 0.42);
  background: rgba(255, 252, 242, 0.98);
}

.tool-menu::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 18px;
}

.tool-menu.active .group-tab,
.tool-menu:hover .group-tab,
.tool-menu:focus-within .group-tab {
  color: #14120d;
  border-color: rgba(224, 168, 58, 0.92);
  background: linear-gradient(180deg, var(--accent-strong), var(--accent));
}

.group-tab span {
  font-size: 0.94rem;
}

.group-tab small {
  color: #6e7a75;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.tool-menu.active .group-tab small,
.tool-menu:hover .group-tab small,
.tool-menu:focus-within .group-tab small {
  color: rgba(20, 18, 13, 0.72);
}

.tool-dropdown {
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  display: grid;
  gap: 10px;
  width: min(430px, 88vw);
  max-height: min(460px, calc(100vh - 180px));
  overflow-y: auto;
  padding: 14px;
  border: 1px solid rgba(200, 141, 34, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(251, 250, 244, 0.99), rgba(232, 240, 233, 0.99));
  box-shadow:
    0 32px 90px rgba(36, 55, 48, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.7) inset;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -2px) scale(0.98);
  transform-origin: top center;
  transition: opacity 170ms ease, transform 170ms ease;
}

.tool-dropdown::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -7px;
  width: 12px;
  height: 12px;
  border-left: 1px solid rgba(200, 141, 34, 0.2);
  border-top: 1px solid rgba(200, 141, 34, 0.2);
  background: rgba(251, 250, 244, 0.99);
  transform: translateX(-50%) rotate(45deg);
}

.tool-menu:nth-child(4) .tool-dropdown,
.tool-menu:nth-child(5) .tool-dropdown {
  right: 0;
  left: auto;
  transform: translate(0, -2px) scale(0.98);
  transform-origin: top right;
}

.tool-menu:nth-child(4) .tool-dropdown::before,
.tool-menu:nth-child(5) .tool-dropdown::before {
  left: auto;
  right: 32px;
}

.tool-menu:hover .tool-dropdown,
.tool-menu:focus-within .tool-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0) scale(1);
}

.tool-menu:nth-child(4):hover .tool-dropdown,
.tool-menu:nth-child(5):hover .tool-dropdown,
.tool-menu:nth-child(4):focus-within .tool-dropdown,
.tool-menu:nth-child(5):focus-within .tool-dropdown {
  transform: translate(0, 0) scale(1);
}

.tool-option {
  position: relative;
  display: grid;
  gap: 5px;
  width: 100%;
  min-height: 74px;
  border: 1px solid rgba(27, 43, 38, 0.08);
  border-radius: 7px;
  padding: 13px 14px 13px 16px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 252, 242, 0.94), rgba(235, 243, 236, 0.94));
  text-align: left;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.035) inset;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.tool-option::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 99px 99px 0;
  background: transparent;
}

.tool-option:hover,
.tool-option:focus,
.tool-option.active {
  border-color: rgba(200, 141, 34, 0.36);
  background:
    linear-gradient(180deg, rgba(255, 250, 235, 1), rgba(228, 241, 233, 1));
  box-shadow:
    0 18px 34px rgba(36, 55, 48, 0.14),
    0 0 0 1px rgba(200, 141, 34, 0.08) inset;
  transform: translateY(-1px);
}

.tool-option:hover::before,
.tool-option:focus::before,
.tool-option.active::before {
  background: var(--accent-strong);
}

.tool-option span {
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 900;
  line-height: 1.2;
}

.tool-option small {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.45;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(320px, 0.72fr) minmax(360px, 1fr);
  gap: 0;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(120deg, rgba(251, 250, 244, 0.96), rgba(229, 238, 232, 0.94));
  box-shadow: var(--shadow);
}

.map-visual {
  position: relative;
  min-height: 250px;
  background:
    linear-gradient(35deg, rgba(39, 143, 130, 0.16) 0 2px, transparent 2px 72px),
    linear-gradient(145deg, rgba(224, 168, 58, 0.16) 0 2px, transparent 2px 82px),
    linear-gradient(135deg, #d5e5dd, #e8f0eb 64%, #eadfca);
  border-right: 1px solid var(--line);
}

.map-visual::before {
  content: "";
  position: absolute;
  inset: 20px;
  border: 1px solid rgba(23, 35, 31, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(23, 35, 31, 0.07) 1px, transparent 1px),
    linear-gradient(0deg, rgba(23, 35, 31, 0.07) 1px, transparent 1px);
  background-size: 42px 42px;
}

.route {
  position: absolute;
  height: 3px;
  border-radius: 99px;
  background: rgba(23, 35, 31, 0.45);
  transform-origin: left center;
  box-shadow: 0 0 18px rgba(39, 143, 130, 0.16);
}

.route-a {
  width: 56%;
  left: 20%;
  top: 43%;
  transform: rotate(14deg);
}

.route-b {
  width: 42%;
  left: 38%;
  top: 62%;
  transform: rotate(-28deg);
  background: rgba(200, 141, 34, 0.82);
}

.keep,
.marker {
  position: absolute;
  display: block;
  border: 2px solid rgba(23, 35, 31, 0.5);
}

.keep {
  width: 58px;
  height: 58px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 18px 42px rgba(36, 55, 48, 0.14);
}

.keep-a {
  left: 16%;
  top: 24%;
}

.keep-b {
  right: 14%;
  bottom: 18%;
  border-color: rgba(200, 141, 34, 0.9);
}

.marker {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--danger);
}

.marker-a {
  left: 48%;
  top: 38%;
}

.marker-b {
  right: 26%;
  top: 28%;
  background: var(--accent-2);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 250px;
  padding: 34px;
}

.hero-copy h2 {
  margin-bottom: 12px;
  max-width: 620px;
  font-size: clamp(1.65rem, 3.6vw, 3.2rem);
  line-height: 0.98;
}

.hero-copy p {
  margin-bottom: 0;
  max-width: 560px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 24px;
  max-width: 560px;
}

.hero-metrics span {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(251, 250, 244, 0.72);
}

.hero-metrics strong,
.hero-metrics small {
  display: block;
}

.hero-metrics strong {
  color: var(--accent-strong);
  font-size: 1.05rem;
}

.hero-metrics small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.tool-section {
  display: none;
}

.tool-section.active {
  display: block;
}

.tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
  gap: 18px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(251, 250, 244, 0.97), rgba(239, 246, 241, 0.97));
  box-shadow: var(--shadow);
}

.calculator {
  padding: 24px;
}

.panel-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-soft);
}

.panel-heading h2 {
  margin-bottom: 6px;
  font-size: 1.45rem;
  line-height: 1.15;
}

.panel-heading p,
.note {
  color: var(--muted);
  line-height: 1.55;
}

.split,
.three-cols {
  display: grid;
  gap: 14px;
}

.split {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three-cols {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 0;
}

.battle-fields {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.battle-fields label:nth-child(8) {
  margin-bottom: 12px;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(239, 246, 242, 0.72);
}

legend {
  padding: 0 8px;
  color: var(--accent);
  font-weight: 900;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 0;
  color: #475751;
  font-size: 0.82rem;
  font-weight: 850;
}

label:last-child {
  margin-bottom: 0;
}

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid #cbd8d2;
  border-radius: 7px;
  padding: 0 12px;
  color: var(--text);
  background: #fffdf7;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

input[type="number"] {
  appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

textarea {
  width: 100%;
  min-height: 260px;
  resize: vertical;
  border: 1px solid #cbd8d2;
  border-radius: 7px;
  padding: 14px;
  color: var(--text);
  background: #fffdf7;
  line-height: 1.55;
  outline: none;
}

.choice-picker-field {
  position: relative;
  z-index: 10;
}

.choice-picker {
  position: relative;
}

.choice-picker-button {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 46px;
  border: 1px solid #cbd8d2;
  border-radius: 7px;
  padding: 0 38px 0 12px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.98), rgba(235, 243, 237, 0.98));
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.choice-picker-button::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: translateY(-65%) rotate(45deg);
  transition: transform 160ms ease;
}

.choice-picker.open .choice-picker-button::after {
  transform: translateY(-35%) rotate(225deg);
}

.choice-picker-button:hover,
.choice-picker.open .choice-picker-button {
  border-color: rgba(200, 141, 34, 0.56);
  box-shadow:
    0 0 0 3px rgba(200, 141, 34, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.choice-picker-button strong {
  overflow: hidden;
  font-size: 0.9rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.choice-picker-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  display: grid;
  gap: 7px;
  max-height: min(320px, 55vh);
  overflow-y: auto;
  padding: 10px;
  border: 1px solid rgba(200, 141, 34, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(251, 250, 244, 0.99), rgba(232, 240, 233, 0.99));
  box-shadow:
    0 26px 70px rgba(36, 55, 48, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.8) inset;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px) scale(0.985);
  transform-origin: top center;
  transition: opacity 160ms ease, transform 160ms ease;
}

.choice-picker.open .choice-picker-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.choice-option {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(27, 43, 38, 0.08);
  border-radius: 7px;
  padding: 0 12px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 252, 242, 0.94), rgba(235, 243, 236, 0.94));
  text-align: left;
  font-weight: 900;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease, background 150ms ease;
}

.choice-option:hover,
.choice-option:focus,
.choice-option.active {
  border-color: rgba(200, 141, 34, 0.36);
  background:
    linear-gradient(180deg, rgba(255, 250, 235, 1), rgba(228, 241, 233, 1));
  box-shadow: 0 14px 26px rgba(36, 55, 48, 0.12);
  transform: translateY(-1px);
}

.troop-picker-field {
  position: relative;
  z-index: 12;
}

.troop-picker {
  position: relative;
}

.troop-picker-button {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 58px;
  border: 1px solid #cbd8d2;
  border-radius: 7px;
  padding: 10px 38px 10px 12px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.98), rgba(235, 243, 237, 0.98));
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.troop-picker-button::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: translateY(-65%) rotate(45deg);
  transition: transform 160ms ease;
}

.troop-picker.open .troop-picker-button::after {
  transform: translateY(-35%) rotate(225deg);
}

.troop-picker-button:hover,
.troop-picker.open .troop-picker-button {
  border-color: rgba(200, 141, 34, 0.56);
  box-shadow:
    0 0 0 3px rgba(200, 141, 34, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.troop-picker-button strong,
.troop-picker-button small {
  display: block;
}

.troop-picker-button strong {
  overflow: hidden;
  font-size: 0.92rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.troop-picker-button small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.troop-picker-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 10px);
  display: grid;
  gap: 12px;
  max-height: min(520px, 65vh);
  overflow-y: auto;
  padding: 14px;
  border: 1px solid rgba(200, 141, 34, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(251, 250, 244, 0.99), rgba(232, 240, 233, 0.99));
  box-shadow:
    0 30px 80px rgba(36, 55, 48, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.8) inset;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px) scale(0.985);
  transform-origin: top center;
  transition: opacity 160ms ease, transform 160ms ease;
}

.troop-picker.open .troop-picker-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.troop-picker-group {
  display: grid;
  gap: 6px;
}

.troop-picker-group p {
  position: sticky;
  top: -14px;
  z-index: 1;
  margin: 0;
  padding: 8px 2px 7px;
  color: var(--accent-strong);
  background: rgba(239, 246, 241, 0.96);
  font-size: 0.76rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.troop-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  border: 1px solid rgba(27, 43, 38, 0.08);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 252, 242, 0.94), rgba(235, 243, 236, 0.94));
  text-align: left;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease, background 150ms ease;
}

.troop-option:hover,
.troop-option:focus,
.troop-option.active {
  border-color: rgba(200, 141, 34, 0.36);
  background:
    linear-gradient(180deg, rgba(255, 250, 235, 1), rgba(228, 241, 233, 1));
  box-shadow: 0 16px 30px rgba(36, 55, 48, 0.12);
  transform: translateY(-1px);
}

.troop-option span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.troop-option strong {
  overflow: hidden;
  font-size: 0.86rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.troop-option small {
  width: fit-content;
  max-width: 100%;
  border: 1px solid rgba(85, 182, 166, 0.28);
  border-radius: 999px;
  padding: 2px 8px;
  color: #1d756b;
  background: rgba(39, 143, 130, 0.1);
  font-size: 0.7rem;
  font-weight: 900;
}

.troop-option em {
  flex: 0 0 auto;
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 950;
}

.equipment-builder .three-cols {
  margin-top: 18px;
}

.equipment-loadout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 220px;
  gap: 18px;
  align-items: stretch;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 80% 18%, rgba(39, 143, 130, 0.12), transparent 14rem),
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(239, 247, 243, 0.88));
}

.equipment-slots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.equipment-slot {
  display: grid;
  gap: 4px;
  min-height: 74px;
  border: 1px solid rgba(27, 43, 38, 0.1);
  border-radius: 8px;
  padding: 12px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(241, 247, 244, 0.96));
  text-align: left;
  box-shadow: 0 8px 20px rgba(36, 55, 48, 0.08);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.equipment-slot:hover,
.equipment-slot.active {
  border-color: rgba(200, 141, 34, 0.42);
  box-shadow: 0 18px 34px rgba(36, 55, 48, 0.14);
  transform: translateY(-2px);
}

.equipment-slot.active {
  background:
    linear-gradient(180deg, rgba(255, 248, 232, 0.98), rgba(246, 238, 215, 0.98));
}

.equipment-slot span {
  font-weight: 950;
}

.equipment-slot small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.commander-figure {
  position: relative;
  min-height: 260px;
  border: 1px solid rgba(39, 143, 130, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(39, 143, 130, 0.07) 1px, transparent 1px),
    linear-gradient(0deg, rgba(39, 143, 130, 0.07) 1px, transparent 1px),
    rgba(255, 255, 255, 0.58);
  background-size: 28px 28px;
  overflow: hidden;
}

.commander-figure::before {
  content: "Commander";
  position: absolute;
  left: 16px;
  top: 14px;
  color: rgba(23, 35, 31, 0.38);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.figure-head,
.figure-body,
.figure-arm,
.figure-leg {
  position: absolute;
  left: 50%;
  background:
    linear-gradient(180deg, rgba(39, 143, 130, 0.28), rgba(200, 141, 34, 0.18));
  border: 1px solid rgba(39, 143, 130, 0.26);
  box-shadow: 0 14px 34px rgba(36, 55, 48, 0.1);
}

.figure-head {
  top: 54px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  transform: translateX(-50%);
}

.figure-body {
  top: 112px;
  width: 86px;
  height: 88px;
  border-radius: 28px 28px 18px 18px;
  transform: translateX(-50%);
}

.figure-arm {
  top: 122px;
  width: 28px;
  height: 84px;
  border-radius: 99px;
}

.figure-arm.left {
  transform: translateX(-74px) rotate(10deg);
}

.figure-arm.right {
  transform: translateX(46px) rotate(-10deg);
}

.figure-leg {
  top: 196px;
  width: 30px;
  height: 70px;
  border-radius: 99px;
}

.figure-leg.left {
  transform: translateX(-42px);
}

.figure-leg.right {
  transform: translateX(12px);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200, 141, 34, 0.16);
}

.copy-button {
  width: 100%;
  min-height: 46px;
  margin-top: 12px;
  border: 0;
  border-radius: 7px;
  color: #ffffff;
  background: linear-gradient(180deg, var(--accent-strong), var(--accent));
  font-weight: 900;
  box-shadow: 0 12px 28px rgba(200, 141, 34, 0.18);
}

.result-card {
  position: sticky;
  top: 18px;
  padding: 24px;
  border-color: rgba(200, 141, 34, 0.24);
}

.result-label {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result-card h3 {
  margin-bottom: 18px;
  font-size: clamp(1.7rem, 3vw, 2.15rem);
  line-height: 1.05;
  color: var(--accent-strong);
}

dl {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
}

dl div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(239, 246, 241, 0.78);
}

dt {
  color: var(--muted);
  font-size: 0.9rem;
}

dd {
  margin: 0;
  font-weight: 900;
  text-align: right;
}

.positive {
  color: var(--good);
}

.negative {
  color: var(--danger);
}

@media (max-width: 860px) {
  .shell {
    width: min(100% - 22px, 680px);
    padding-top: 18px;
  }

  .topbar,
  .hero-panel,
  .tool-picker,
  .tool-grid,
  .split,
  .battle-fields,
  .three-cols {
    grid-template-columns: 1fr;
  }

  .tool-groups {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tool-menu {
    position: static;
  }

  .tool-dropdown {
    left: 12px;
    right: 12px;
    width: auto;
    transform: translateY(-2px) scale(0.98);
    transform-origin: top center;
  }

  .tool-dropdown::before {
    display: none;
  }

  .tool-menu:hover .tool-dropdown,
  .tool-menu:focus-within .tool-dropdown,
  .tool-menu:nth-child(4):hover .tool-dropdown,
  .tool-menu:nth-child(5):hover .tool-dropdown,
  .tool-menu:nth-child(4):focus-within .tool-dropdown,
  .tool-menu:nth-child(5):focus-within .tool-dropdown {
    transform: translateY(0) scale(1);
  }

  .topbar {
    display: grid;
  }

  .language {
    justify-self: start;
  }

  .hero-copy {
    min-height: auto;
    padding: 24px;
  }

  .map-visual {
    min-height: 190px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .equipment-loadout {
    grid-template-columns: 1fr;
  }

  .commander-figure {
    min-height: 220px;
  }

  .result-card {
    position: static;
  }
}

@media (max-width: 520px) {
  .shell {
    width: calc(100% - 16px);
  }

  h1 {
    font-size: 2.2rem;
  }

  .eyebrow {
    font-size: 0.72rem;
  }

  .calculator,
  .result-card {
    padding: 16px;
  }

  .tool-picker {
    padding: 10px;
  }

  .tool-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .group-tab {
    min-height: 40px;
    padding: 0 10px;
  }

  .group-tab small {
    display: none;
  }

  .tool-option small {
    display: none;
  }

  .equipment-slots {
    grid-template-columns: 1fr;
  }

  .tool-option {
    min-height: 48px;
    padding: 11px 12px;
  }

  .hero-copy h2 {
    font-size: 1.75rem;
  }

  dl div {
    display: grid;
    gap: 5px;
  }

  dd {
    text-align: left;
  }
}
