:root {
  --atlas-copper: #a84b2c;
  --atlas-bronze: #c77943;
  --atlas-gold: #efbf82;
  --atlas-ivory: #f4d9b1;
  --atlas-crystal: #ee2d42;
  --atlas-glow: rgba(238, 45, 66, 0.5);
  --atlas-ink: #08090b;
  --atlas-panel: rgba(12, 10, 11, 0.94);
  --atlas-line: rgba(177, 83, 49, 0.44);
}

.skill-atlas-view {
  position: relative;
  min-height: calc(100dvh - 72px);
  padding: 12px 14px 92px;
  overflow: auto;
  color: #ead4bb;
  background:
    radial-gradient(circle at 50% 34%, rgba(108, 24, 32, 0.16), transparent 35%),
    linear-gradient(145deg, rgba(85, 34, 22, 0.08), transparent 28%),
    #07090c;
}

.skill-atlas-view::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.28;
  background-image:
    linear-gradient(115deg, transparent 0 48%, rgba(194, 105, 61, 0.08) 49% 50%, transparent 51%),
    linear-gradient(25deg, transparent 0 48%, rgba(194, 105, 61, 0.05) 49% 50%, transparent 51%);
  background-size: 92px 92px;
  mask-image: linear-gradient(to bottom, black, transparent 88%);
}

.skill-atlas-stage {
  position: relative;
  width: min(1880px, 100%);
  margin: 0 auto;
  min-height: calc(100dvh - 112px);
}

.skill-atlas-stage:not(.ds-panel-plaque) {
  border: 1px solid rgba(153, 56, 33, 0.8);
  background: linear-gradient(180deg, rgba(14, 11, 12, 0.98), rgba(6, 8, 11, 0.98));
  box-shadow: inset 0 0 0 1px rgba(245, 171, 102, 0.05), 0 18px 70px rgba(0, 0, 0, 0.38);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}

.skill-atlas-stage:not(.ds-panel-plaque)::before,
.skill-atlas-stage:not(.ds-panel-plaque)::after {
  content: "";
  position: absolute;
  z-index: 2;
  pointer-events: none;
}

.skill-atlas-stage:not(.ds-panel-plaque)::before {
  inset: 9px;
  border-top: 1px solid rgba(231, 139, 75, 0.25);
  border-bottom: 1px solid rgba(231, 139, 75, 0.12);
}

.skill-atlas-stage:not(.ds-panel-plaque)::after {
  width: 84px;
  height: 3px;
  top: 8px;
  left: 24px;
  background: linear-gradient(90deg, var(--atlas-crystal), transparent);
  box-shadow: calc(100vw - 154px) 0 0 rgba(238, 45, 66, 0.32);
}

.skill-atlas-topbar {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(190px, 0.7fr) 1.5fr minmax(230px, 0.7fr);
  align-items: center;
  min-height: 106px;
  padding: 19px 28px 17px;
  border-bottom: 1px solid rgba(137, 57, 37, 0.62);
  background:
    linear-gradient(90deg, rgba(80, 27, 19, 0.2), transparent 24%, transparent 76%, rgba(80, 27, 19, 0.2)),
    rgba(9, 8, 10, 0.86);
}

.skill-atlas-topbar::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 110px;
  height: 9px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--atlas-copper) 22% 78%, transparent);
  clip-path: polygon(0 45%, 42% 45%, 50% 0, 58% 45%, 100% 45%, 92% 55%, 58% 55%, 50% 100%, 42% 55%, 8% 55%);
}

.skill-atlas-back,
.skill-atlas-categories button,
.skill-constellation-footer button,
.skill-dialog-actions button {
  font: inherit;
}

.skill-atlas-back {
  justify-self: start;
  border: 1px solid rgba(166, 79, 45, 0.72);
  padding: 10px 14px;
  color: #d8b38f;
  background: rgba(15, 11, 12, 0.86);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  cursor: pointer;
  transition: 160ms ease;
}

.skill-atlas-back:hover,
.skill-atlas-back:focus-visible {
  color: #ffe0b5;
  border-color: var(--atlas-bronze);
  box-shadow: 0 0 22px rgba(199, 121, 67, 0.16);
  outline: none;
}

.skill-atlas-back span {
  margin-right: 8px;
  color: var(--atlas-crystal);
}

.skill-atlas-title {
  min-width: 0;
  text-align: center;
}

.skill-atlas-title > span,
.skill-atlas-title small {
  display: block;
  color: #a97658;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.skill-atlas-title h1 {
  margin: 3px 0 0;
  color: var(--atlas-ivory);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 2.7vw, 44px);
  font-weight: 700;
  letter-spacing: 0.045em;
  text-shadow: 0 2px 22px rgba(218, 91, 55, 0.15);
}

.skill-atlas-resources {
  justify-self: end;
  display: flex;
  gap: 8px;
}

.skill-atlas-resources > span {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  column-gap: 7px;
  min-width: 88px;
  padding: 8px 12px;
  border: 1px solid rgba(136, 67, 45, 0.68);
  background: rgba(8, 7, 9, 0.86);
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
}

.skill-atlas-resources i {
  grid-row: 1 / 3;
  align-self: center;
  width: 12px;
  height: 22px;
  background: linear-gradient(155deg, #ff6d75, #9b071d 70%);
  clip-path: polygon(50% 0, 100% 35%, 78% 100%, 22% 100%, 0 35%);
  filter: drop-shadow(0 0 6px var(--atlas-glow));
}

.skill-atlas-resources b {
  color: #ffe0b9;
  font-size: 19px;
  line-height: 1;
}

.skill-atlas-resources small {
  color: #9d806d;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.skill-atlas-message {
  position: relative;
  z-index: 5;
  margin: 10px 18px -2px;
  padding: 9px 13px;
  border-left: 2px solid;
  font-size: 13px;
}

.skill-atlas-message.success { color: #dbc49e; border-color: #79b889; background: rgba(39, 91, 59, 0.17); }
.skill-atlas-message.error { color: #ffc0b3; border-color: #df4c47; background: rgba(106, 30, 31, 0.2); }

.skill-atlas-workspace {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(620px, 1fr) minmax(320px, 390px);
  gap: 12px;
  padding: 12px;
}

.skill-constellation-frame,
.skill-node-detail {
  position: relative;
  border: 1px solid rgba(142, 63, 41, 0.62);
  background: rgba(8, 8, 10, 0.92);
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}

.skill-constellation-frame {
  min-height: 826px;
  overflow: hidden;
}

.skill-constellation-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 84%, rgba(181, 54, 54, 0.13), transparent 17%),
    radial-gradient(circle at 50% 35%, rgba(111, 46, 31, 0.12), transparent 50%),
    repeating-radial-gradient(circle at 50% 84%, transparent 0 72px, rgba(148, 69, 45, 0.07) 73px 74px, transparent 75px 122px);
}

.skill-constellation-heading {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
  padding: 14px 18px 10px;
  border-bottom: 1px solid rgba(139, 62, 40, 0.38);
  background: linear-gradient(90deg, rgba(83, 30, 21, 0.18), transparent);
}

.skill-constellation-heading div span,
.skill-detail-path span,
.skill-detail-fiction > span {
  display: block;
  color: #9f6f54;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.skill-constellation-heading div strong {
  display: block;
  margin-top: 3px;
  color: #e7bf91;
  font-size: 14px;
}

.skill-constellation-heading p {
  max-width: 440px;
  margin: 0;
  color: #856f64;
  font-size: 11px;
  line-height: 1.45;
  text-align: right;
}

.skill-constellation {
  position: relative;
  height: 720px;
  isolation: isolate;
  background:
    radial-gradient(circle at 20% 23%, rgba(232, 188, 116, 0.16) 0 1px, transparent 2px),
    radial-gradient(circle at 73% 31%, rgba(232, 188, 116, 0.12) 0 1px, transparent 2px),
    radial-gradient(circle at 84% 72%, rgba(232, 188, 116, 0.1) 0 1px, transparent 2px),
    radial-gradient(circle at 38% 81%, rgba(232, 188, 116, 0.08) 0 1px, transparent 2px);
  background-size: 113px 97px, 137px 121px, 91px 107px, 149px 131px;
}

.skill-constellation::before,
.skill-constellation::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 84%;
  z-index: -1;
  border: 1px solid rgba(157, 72, 47, 0.12);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.skill-constellation::before { width: 430px; height: 430px; }
.skill-constellation::after { width: 285px; height: 285px; border-style: dashed; }

.skill-constellation-lines {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 0 4px rgba(140, 55, 36, 0.3));
}

.skill-constellation-lines line {
  stroke: rgba(126, 61, 44, 0.55);
  stroke-width: 0.34;
  stroke-dasharray: 1.2 0.8;
  vector-effect: non-scaling-stroke;
}

.skill-constellation-lines line.lit {
  stroke: #d48047;
  stroke-width: 0.58;
  stroke-dasharray: none;
  filter: drop-shadow(0 0 3px rgba(255, 87, 68, 0.55));
}

.skill-constellation-lines line.ready {
  stroke: rgba(209, 137, 77, 0.78);
  stroke-width: 0.48;
  stroke-dasharray: 1.2 0.55;
}

.skill-constellation-lines line.broken {
  stroke: #a93f43;
  stroke-width: 0.58;
  stroke-dasharray: 0.8 0.7;
  filter: drop-shadow(0 0 3px rgba(215, 54, 63, 0.5));
}

.skill-constellation-node,
.skill-constellation-hero {
  position: absolute;
  left: var(--node-x);
  top: var(--node-y);
  transform: translate(-50%, -50%);
}

.skill-constellation-node {
  z-index: 3;
  width: 118px;
  min-height: 112px;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  overflow: visible;
}

.skill-node-orbit {
  position: absolute;
  left: 50%;
  top: 0;
  width: 70px;
  height: 70px;
  border: 1px solid rgba(136, 73, 51, 0.75);
  border-radius: 50%;
  transform: translateX(-50%) rotate(0deg);
  box-shadow: inset 0 0 0 5px rgba(31, 17, 17, 0.88), 0 0 0 1px rgba(236, 151, 85, 0.04);
  transition: 180ms ease;
}

.skill-node-orbit::before,
.skill-node-orbit::after {
  content: "";
  position: absolute;
  background: var(--atlas-bronze);
  opacity: 0.55;
}

.skill-node-orbit::before { width: 8px; height: 1px; left: -5px; top: 34px; box-shadow: 72px 0 0 var(--atlas-bronze); }
.skill-node-orbit::after { width: 1px; height: 8px; left: 34px; top: -5px; box-shadow: 0 72px 0 var(--atlas-bronze); }

.skill-node-icon {
  position: absolute;
  left: 50%;
  top: 9px;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  transform: translateX(-50%);
  overflow: hidden;
  background: #120e11;
  filter: grayscale(0.55) brightness(0.68);
  transition: 180ms ease;
}

.skill-node-icon img { width: 100%; height: 100%; object-fit: cover; }

.skill-node-cost {
  position: absolute;
  left: 50%;
  top: 61px;
  z-index: 2;
  min-width: 34px;
  padding: 2px 6px;
  border: 1px solid rgba(112, 57, 43, 0.82);
  color: #aa826e;
  background: #0a090b;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  transform: translateX(-50%);
}

.skill-node-copy {
  position: absolute;
  left: 50%;
  top: 80px;
  width: 150px;
  transform: translateX(-50%);
  text-align: center;
}

.skill-node-copy strong,
.skill-node-copy small { display: block; }
.skill-node-copy strong { color: #b69b89; font-size: 12px; line-height: 1.15; }
.skill-node-copy small { margin-top: 3px; color: #665953; font-size: 8px; letter-spacing: 0.12em; text-transform: uppercase; }

.skill-node-lock {
  position: absolute;
  left: calc(50% + 23px);
  top: 2px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid #78372e;
  border-radius: 50%;
  color: #c66753;
  background: #100b0d;
  font-size: 12px;
}

.skill-padlock-icon,
.skill-inline-padlock {
  position: relative;
  display: inline-block;
  width: 9px;
  height: 8px;
  border: 1px solid currentColor;
  border-radius: 1px;
  box-sizing: border-box;
}

.skill-padlock-icon::before,
.skill-inline-padlock::before {
  content: "";
  position: absolute;
  left: 1px;
  top: -6px;
  width: 5px;
  height: 6px;
  border: 1px solid currentColor;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  box-sizing: border-box;
}

.skill-inline-padlock {
  margin-right: 6px;
  vertical-align: -1px;
}

.skill-constellation-node.available .skill-node-orbit,
.skill-constellation-node.insufficient .skill-node-orbit {
  border-color: rgba(213, 128, 73, 0.88);
}

.skill-constellation-node.available .skill-node-icon,
.skill-constellation-node.insufficient .skill-node-icon { filter: grayscale(0.05) brightness(0.9); }
.skill-constellation-node.available .skill-node-copy strong { color: #e4b786; }

.skill-constellation-node.owned .skill-node-orbit {
  border-color: #e45649;
  box-shadow: inset 0 0 0 5px rgba(54, 14, 20, 0.88), 0 0 17px rgba(236, 58, 67, 0.36);
}

.skill-constellation-node.owned .skill-node-icon { filter: none; }
.skill-constellation-node.owned .skill-node-cost { color: #ffd2a1; border-color: #c64a3e; }
.skill-constellation-node.owned .skill-node-copy strong { color: #f3c394; }

.skill-constellation-node.selected .skill-node-orbit,
.skill-constellation-node:hover .skill-node-orbit,
.skill-constellation-node:focus-visible .skill-node-orbit {
  transform: translateX(-50%) scale(1.08) rotate(45deg);
  border-color: #ff7b5e;
  box-shadow: inset 0 0 0 5px rgba(48, 16, 19, 0.9), 0 0 22px rgba(236, 58, 67, 0.43);
}

.skill-constellation-node:focus-visible { outline: none; }
.skill-constellation-node.insufficient { opacity: 0.72; }
.skill-constellation-node.locked { opacity: 0.48; }
.skill-constellation-node.path-locked { opacity: 0.55; }
.skill-constellation-node.level-locked { opacity: 0.62; }

.skill-constellation-node.owned-gap .skill-node-orbit {
  border-color: #b64a45;
  border-style: dashed;
  box-shadow: inset 0 0 0 5px rgba(54, 14, 20, 0.8), 0 0 14px rgba(190, 53, 58, 0.28);
}

.skill-constellation-node.owned-gap .skill-node-icon { filter: saturate(0.65) brightness(0.78); }
.skill-constellation-node.owned-gap .skill-node-copy strong { color: #c88776; }

.skill-constellation-hero {
  z-index: 4;
  width: 156px;
  height: 162px;
  margin: 0;
  text-align: center;
}

.skill-hero-crystal {
  position: absolute;
  left: 50%;
  top: 44px;
  width: 140px;
  height: 140px;
  border: 1px solid rgba(204, 96, 58, 0.42);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 40px rgba(135, 30, 37, 0.2), inset 0 0 34px rgba(105, 35, 31, 0.15);
}

.skill-hero-crystal::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px dashed rgba(233, 135, 73, 0.32);
  border-radius: 50%;
  transform: rotate(22deg);
}

.skill-hero-portrait {
  position: absolute;
  left: 50%;
  top: 44px;
  width: 94px;
  height: 94px;
  transform: translate(-50%, -50%);
  overflow: hidden;
  border: 2px solid #c37143;
  border-radius: 50%;
  background: #130d10;
  box-shadow: 0 0 0 5px rgba(20, 10, 12, 0.95), 0 0 24px rgba(236, 52, 64, 0.36);
}

.skill-hero-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center 16%; }

.skill-constellation-hero figcaption {
  position: absolute;
  top: 105px;
  left: 50%;
  width: 210px;
  transform: translateX(-50%);
}

.skill-constellation-hero strong,
.skill-constellation-hero small { display: block; }
.skill-constellation-hero strong { color: #f2c698; font-family: Georgia, serif; font-size: 15px; }
.skill-constellation-hero small { margin-top: 2px; color: #9b755f; font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; }

.skill-constellation-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 42px;
  padding: 8px 14px;
  border-top: 1px solid rgba(126, 56, 39, 0.42);
  background: rgba(7, 7, 9, 0.9);
  color: #846e61;
  font-size: 9px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.skill-constellation-footer span { display: flex; align-items: center; gap: 5px; }
.skill-constellation-footer i { width: 7px; height: 7px; border: 1px solid; border-radius: 50%; }
.skill-constellation-footer i.owned { border-color: #e45649; box-shadow: 0 0 5px #e45649; }
.skill-constellation-footer i.available { border-color: #d58049; }
.skill-constellation-footer i.locked { border-color: #5f514c; }

.skill-constellation-footer button {
  margin-left: auto;
  border: 0;
  color: #b76554;
  background: transparent;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.skill-node-detail {
  min-height: 826px;
  padding: 22px 22px 18px;
  background:
    linear-gradient(180deg, rgba(66, 23, 19, 0.16), transparent 28%),
    var(--atlas-panel);
}

.skill-node-detail::before {
  content: "";
  position: absolute;
  top: 0;
  right: 18px;
  width: 68px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--atlas-crystal));
}

.skill-detail-path {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 11px;
  border-bottom: 1px solid rgba(126, 61, 43, 0.42);
}

.skill-detail-path b { color: #bc8a69; font-size: 10px; font-weight: 700; }

.skill-detail-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
}

.skill-detail-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  padding: 5px;
  border: 1px solid #9f4a35;
  border-radius: 50%;
  box-shadow: inset 0 0 0 4px #150e10, 0 0 16px rgba(218, 59, 56, 0.24);
  overflow: hidden;
}

.skill-detail-icon img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.skill-detail-title small { color: #a67659; font-size: 9px; letter-spacing: 0.15em; text-transform: uppercase; }
.skill-detail-title h2 { margin: 3px 0 0; color: #f0c798; font-family: Georgia, serif; font-size: 25px; line-height: 1.05; }

.skill-detail-fiction {
  margin: 18px 0 0;
  padding: 13px 14px;
  border-left: 2px solid #8f442f;
  color: #c0a594;
  background: rgba(60, 25, 20, 0.14);
  font-size: 12px;
  line-height: 1.5;
}

.skill-detail-fiction-label {
  display: block;
  margin-bottom: 4px;
}

.skill-detail-fiction > p { margin: 0; }

.skill-detail-stake {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 7px;
  margin-top: 9px !important;
  padding-top: 9px;
  border-top: 1px solid rgba(143, 68, 47, 0.32);
  color: #b99a87;
}

.skill-detail-stake strong {
  color: #d49a70;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.skill-detail-stake-price strong { color: #d8b35c; }

.skill-detail-facts {
  margin: 14px 0 0;
}

.skill-detail-facts div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(108, 64, 48, 0.34);
}

.skill-detail-facts dt { color: #806d62; font-size: 10px; }
.skill-detail-facts dd { margin: 0; color: #d6b392; font-size: 10px; text-align: right; }

.skill-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 12px;
}

.skill-detail-tags span {
  padding: 4px 7px;
  border: 1px solid rgba(127, 66, 47, 0.58);
  color: #a98268;
  background: rgba(38, 18, 17, 0.38);
  font-size: 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.skill-runtime-truth {
  margin-top: 14px;
  padding: 12px 13px;
  border: 1px solid rgba(114, 72, 52, 0.44);
  background: rgba(5, 9, 13, 0.68);
}

.skill-runtime-truth strong { color: #c29574; font-size: 10px; }
.skill-runtime-truth p { margin: 5px 0 0; color: #87776f; font-size: 10px; line-height: 1.5; }

.skill-detail-state {
  margin-top: 14px;
  padding: 10px 12px;
  border-left: 2px solid #725142;
  background: rgba(42, 25, 22, 0.3);
}

.skill-detail-state span { color: #d4a57d; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.skill-detail-state p { margin: 4px 0 0; color: #8f776a; font-size: 10px; line-height: 1.4; }
.skill-detail-state.owned { border-color: #d45b45; }
.skill-detail-state.available { border-color: #bd8d4a; }
.skill-detail-state.locked { opacity: 0.72; }
.skill-detail-state.path-locked { border-color: #70594c; opacity: 0.82; }
.skill-detail-state.level-locked { border-color: #9b633f; opacity: 0.9; }
.skill-detail-state.owned-gap { border-color: #a63f43; }

.skill-purchase-button,
.skill-open-school-button {
  width: 100%;
  margin-top: 12px;
  min-height: 43px;
  border: 1px solid #ba4d36;
  color: #ffe0b5;
  background: linear-gradient(180deg, rgba(137, 32, 39, 0.92), rgba(78, 19, 26, 0.96));
  box-shadow: inset 0 0 18px rgba(255, 113, 75, 0.08), 0 5px 18px rgba(0, 0, 0, 0.25);
  clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 8px 100%, 0 50%);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.skill-purchase-button:disabled { border-color: #5c4439; color: #76645c; background: #161215; cursor: not-allowed; }

.skill-owned-seal {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 9px;
  margin-top: 14px;
  padding: 11px 12px;
  border: 1px solid rgba(174, 70, 51, 0.52);
  background: rgba(73, 23, 23, 0.17);
}

.skill-owned-seal > span { grid-row: 1 / 3; align-self: center; color: #ee725d; font-size: 22px; }
.skill-owned-seal strong { color: #dbb18c; font-size: 11px; }
.skill-owned-seal small { margin-top: 2px; color: #816e64; font-size: 9px; line-height: 1.35; }
.skill-owned-seal.broken { border-color: rgba(190, 61, 66, 0.64); background: rgba(86, 19, 26, 0.2); }

/* Atlas list + detail */
.skill-atlas-topbar.atlas-header { grid-template-columns: 76px 1fr minmax(120px, 0.4fr); }
.skill-atlas-mark { color: #df4d49; font-size: 32px; text-align: center; filter: drop-shadow(0 0 10px rgba(232, 56, 64, 0.45)); }

.skill-atlas-browser {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(360px, 470px) minmax(440px, 1fr);
  gap: 12px;
  padding: 12px;
}

.skill-school-list-panel,
.skill-school-preview {
  min-height: 650px;
  border: 1px solid rgba(137, 61, 41, 0.58);
  background: rgba(8, 8, 10, 0.94);
}

.skill-school-list-panel { padding: 16px; }
.skill-atlas-search span { display: block; margin-bottom: 6px; color: #99735e; font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; }
.skill-atlas-search input {
  width: 100%;
  min-height: 38px;
  border: 1px solid #663828;
  padding: 8px 11px;
  color: #e4c5a7;
  background: #0c0a0c;
  outline: none;
}
.skill-atlas-search input:focus { border-color: #bb6840; box-shadow: 0 0 0 2px rgba(187, 104, 64, 0.12); }

.skill-atlas-categories { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 11px; }
.skill-atlas-categories button {
  border: 1px solid #573327;
  padding: 6px 9px;
  color: #8f7769;
  background: #100d0f;
  font-size: 9px;
  text-transform: uppercase;
  cursor: pointer;
}
.skill-atlas-categories button.active { border-color: #bd633f; color: #efbe8b; background: #2a1414; }

.skill-school-list {
  display: grid;
  gap: 6px;
  max-height: 540px;
  margin-top: 13px;
  padding-right: 4px;
  overflow: auto;
  scrollbar-color: #79402e #0d0b0d;
}

.skill-school-list-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  border: 1px solid rgba(91, 52, 39, 0.65);
  padding: 7px 9px;
  color: inherit;
  background: rgba(18, 13, 14, 0.72);
  text-align: left;
  cursor: pointer;
}

.skill-school-list-item:hover,
.skill-school-list-item.selected { border-color: #ae5a3d; background: linear-gradient(90deg, rgba(102, 34, 27, 0.3), rgba(18, 13, 14, 0.82)); }
.skill-school-list-item:focus-visible { outline: 1px solid #df8550; outline-offset: 1px; }

.skill-school-glyph {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid #70412f;
  border-radius: 50%;
  color: #d07b4b;
  background: #130e10;
}

.skill-school-glyph.school-magic { color: #e65052; box-shadow: inset 0 0 12px rgba(175, 36, 49, 0.18); }
.skill-school-list-item > span:nth-child(2) { min-width: 0; }
.skill-school-list-item strong,
.skill-school-list-item small { display: block; }
.skill-school-list-item strong { color: #d7b18f; font-size: 12px; }
.skill-school-list-item small { margin-top: 3px; color: #796960; font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.skill-school-list-item > b { color: #9a755e; font-size: 8px; letter-spacing: 0.08em; text-transform: uppercase; }
.skill-school-list-item > b.open { color: #d97056; }
.skill-school-list-item > b.locked { color: #765e57; }

.skill-school-preview {
  position: relative;
  padding: 18px clamp(26px, 4vw, 70px);
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 20%, rgba(130, 38, 39, 0.16), transparent 28%),
    rgba(8, 8, 10, 0.95);
}

.skill-school-preview::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(131, 57, 39, 0.22);
  pointer-events: none;
  clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px);
}

.skill-school-preview-orbit {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  margin: 0 auto 10px;
  border: 1px solid rgba(187, 91, 56, 0.52);
  border-radius: 50%;
  box-shadow: 0 0 38px rgba(146, 32, 39, 0.18), inset 0 0 30px rgba(132, 38, 34, 0.13);
}

.skill-school-preview-orbit::before { content: ""; position: absolute; inset: 10px; border: 1px dashed rgba(206, 119, 71, 0.4); border-radius: 50%; transform: rotate(30deg); }
.skill-school-preview-orbit span { color: #e15c50; font-size: 38px; filter: drop-shadow(0 0 10px rgba(236, 57, 64, 0.42)); }
.skill-school-preview-kind { display: block; color: #9f7058; font-size: 9px; letter-spacing: 0.2em; text-align: center; text-transform: uppercase; }
.skill-school-preview h2 { margin: 3px 0 12px; color: #f0c89a; font-family: Georgia, serif; font-size: clamp(26px, 3vw, 36px); text-align: center; }

.skill-school-access { max-width: 680px; margin: 0 auto; padding: 11px 14px; border-left: 2px solid #8d4a32; background: rgba(55, 24, 20, 0.2); }
.skill-school-access strong { color: #d5a77d; font-size: 11px; }
.skill-school-access p { margin: 4px 0 0; color: #8c776b; font-size: 10px; line-height: 1.45; }
.skill-school-access.open { border-color: #cf6846; }
.skill-school-access.locked { opacity: 0.75; }

.skill-school-statline { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 9px 0; }
.skill-school-statline span { padding: 6px 9px; border: 1px solid rgba(111, 63, 46, 0.55); color: #987b68; font-size: 9px; text-transform: uppercase; }
.skill-school-statline b { color: #e0b17f; }

.skill-school-runtime-list { max-width: 680px; margin: 0 auto; border-top: 1px solid rgba(118, 55, 38, 0.44); }
.skill-school-runtime-list header { display: flex; justify-content: space-between; padding: 7px 0; color: #99745d; font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; }
.skill-school-runtime-list > div { display: flex; align-items: center; gap: 9px; padding: 5px 0; border-top: 1px solid rgba(92, 58, 44, 0.28); }
.skill-school-runtime-list img { width: 32px; height: 32px; border: 1px solid #77432f; border-radius: 50%; object-fit: cover; }
.skill-school-runtime-list strong,
.skill-school-runtime-list small { display: block; }
.skill-school-runtime-list strong { color: #ceb094; font-size: 11px; }
.skill-school-runtime-list small { margin-top: 2px; color: #73655e; font-size: 9px; }
.skill-school-preview .skill-open-school-button { display: block; max-width: 420px; margin: 10px auto 0; }
.skill-school-slice-note { max-width: 680px; margin: 15px auto 0; padding: 10px 12px; border: 1px dashed rgba(116, 62, 45, 0.48); color: #7f7069; font-size: 10px; line-height: 1.5; text-align: center; }

.skill-atlas-no-results { color: #85736a; font-size: 11px; text-align: center; }

/* Confirmations */
.skill-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(3, 3, 5, 0.82);
  backdrop-filter: blur(5px);
}

.skill-dialog {
  position: relative;
  width: min(460px, 100%);
  border: 1px solid #9e4632;
  padding: 26px 28px 24px;
  color: #cbb09b;
  background:
    radial-gradient(circle at 50% 0, rgba(127, 33, 37, 0.22), transparent 42%),
    #0d0a0c;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.7), inset 0 0 0 1px rgba(237, 142, 84, 0.05);
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
  text-align: center;
}

.skill-dialog::before { content: ""; position: absolute; left: 22px; right: 22px; top: 8px; height: 1px; background: linear-gradient(90deg, transparent, #b75538, transparent); }
.skill-dialog-crystal { display: grid; place-items: center; width: 72px; height: 72px; margin: 0 auto 12px; border: 1px solid #a24a34; border-radius: 50%; box-shadow: 0 0 26px rgba(221, 55, 59, 0.25); overflow: hidden; }
.skill-dialog-crystal img { width: 100%; height: 100%; object-fit: cover; }
.skill-dialog-kicker { color: #a46f54; font-size: 9px; font-weight: 800; letter-spacing: 0.19em; }
.skill-dialog h2 { margin: 6px 0 10px; color: #efc392; font-family: Georgia, serif; font-size: 26px; }
.skill-dialog > p { margin: 0; color: #8f7c72; font-size: 11px; line-height: 1.55; }
.skill-dialog-balance { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 17px; }
.skill-dialog-balance span { padding: 9px; border: 1px solid rgba(114, 62, 46, 0.5); color: #846f63; font-size: 9px; }
.skill-dialog-balance b { display: block; margin-top: 3px; color: #ddb083; font-size: 14px; }
.skill-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.skill-dialog-actions button { min-height: 38px; border: 1px solid #674032; padding: 8px 14px; color: #a68a79; background: #151013; cursor: pointer; }
.skill-dialog-actions button.confirm { border-color: #b64936; color: #f1c497; background: #541922; }
.skill-dialog-actions button.danger { color: #ffc0ad; }
.skill-dialog-actions button:disabled { opacity: 0.6; cursor: wait; }

.skill-atlas-empty {
  width: min(760px, calc(100% - 24px));
  margin: 10vh auto;
  border: 1px solid #78402e;
  padding: 42px;
  color: #9e8678;
  background: #0d0a0c;
  text-align: center;
}
.skill-atlas-empty > span { color: #a87054; font-size: 9px; letter-spacing: 0.2em; }
.skill-atlas-empty h1 { color: #ebc091; font-family: Georgia, serif; }
.skill-atlas-empty button { border: 1px solid #9f4b34; padding: 9px 14px; color: #deb18a; background: #251215; cursor: pointer; }

@media (max-width: 1180px) {
  .skill-atlas-workspace { grid-template-columns: 1fr; }
  .skill-node-detail { min-height: auto; }
  .skill-atlas-browser { grid-template-columns: 360px minmax(420px, 1fr); }
}

@media (max-width: 820px) {
  .skill-atlas-view { padding: 8px 8px 88px; }
  .skill-atlas-stage:not(.ds-panel-plaque) { clip-path: none; }
  .skill-atlas-topbar { grid-template-columns: auto 1fr; gap: 10px; padding: 15px; }
  .skill-atlas-title { text-align: left; }
  .skill-atlas-resources { grid-column: 1 / -1; justify-self: stretch; }
  .skill-atlas-resources > span { flex: 1; }
  .skill-atlas-workspace { padding: 8px; }
  .skill-constellation-frame { min-height: 690px; }
  .skill-constellation { height: 690px; transform: scale(0.78); transform-origin: center top; }
  .skill-constellation-heading { display: block; }
  .skill-constellation-heading p { margin-top: 5px; text-align: left; }
  .skill-constellation-footer { gap: 8px; flex-wrap: wrap; }
  .skill-atlas-browser { grid-template-columns: 1fr; padding: 8px; }
  .skill-school-list-panel,
  .skill-school-preview { min-height: auto; }
  .skill-school-list { max-height: 360px; }
}

@media (prefers-reduced-motion: reduce) {
  .skill-constellation-node *,
  .skill-atlas-back { transition: none !important; }
}
