.daemon-form {
  container-name: daemon-form;
  container-type: inline-size;
  margin-top: 22px;
  border: 1px solid var(--daemon-line);
  background: linear-gradient(150deg, rgba(4, 11, 17, .96), rgba(7, 15, 20, .88));
}
.daemon-form__intro {
  display: grid;
  grid-template-columns: minmax(520px, 620px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(30px, 5vw, 80px);
  min-height: 280px;
  padding: clamp(22px, 3.2vw, 46px);
  border-bottom: 1px solid var(--daemon-line);
}
.daemon-form__portraits {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2vw, 28px);
}
.daemon-form__native,
.daemon-form__art {
  border: 1px solid rgba(224, 183, 80, .58);
  border-radius: 50%;
  object-fit: cover;
  background: #05090d;
}
.daemon-form__native { width: clamp(96px, 10vw, 150px); height: clamp(96px, 10vw, 150px); view-transition-name: daemon-native-preview; }
.daemon-form__art { width: clamp(160px, 17vw, 256px); height: clamp(160px, 17vw, 256px); view-transition-name: daemon-form-preview; }
.daemon-soul-bridge { flex: 0 1 120px; width: clamp(68px, 8vw, 120px); height: 78px; overflow: visible; }
.daemon-soul-bridge__base,
.daemon-soul-bridge__glow { fill: none; stroke-linecap: round; }
.daemon-soul-bridge__base { stroke: rgba(215, 175, 76, .3); stroke-width: 2; }
.daemon-soul-bridge__glow {
  stroke: #75dff4;
  stroke-width: 2.5;
  stroke-dasharray: 7 9;
  filter: drop-shadow(0 0 5px rgba(104, 222, 245, .72));
  animation: daemon-soul-flow 1.8s linear infinite;
}
.daemon-soul-bridge__mote { fill: #ffe39a; filter: drop-shadow(0 0 5px #76dff4); }
.daemon-form__copy { display: grid; justify-items: start; gap: 14px; }
.daemon-form__class { color: var(--daemon-cyan); font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.daemon-form__copy h2 { color: #ffebbc; font-family: var(--font-display); font-size: var(--section-title-size); font-weight: 500; }
.daemon-form__unlock {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 5px 12px;
  border: 1px solid #d8ad47;
  color: #ffe6a2;
  background: rgba(118, 77, 13, .28);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.daemon-form__look-name { display: inline-flex; width: fit-content; margin-top: 2px; padding: 5px 10px; color: #8fe5f6; border-left: 2px solid #d6aa44; background: rgba(10, 43, 53, .5); font-size: .88rem; }
.daemon-form__copy p { color: #b9c1c5; line-height: 1.55; }
.daemon-form__gains { display: flex; flex-wrap: wrap; gap: 8px; }
.daemon-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 9px;
  border: 1px solid rgba(103, 199, 224, .32);
  border-radius: 999px;
  color: #aee8f5;
  background: rgba(24, 77, 92, .22);
  font-size: .76rem;
}
.daemon-chip--gain { border-color: rgba(216, 174, 70, .42); color: #f0d790; background: rgba(103, 72, 17, .2); }
.daemon-chip--stat { gap: 5px; }
.daemon-chip--stat svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.daemon-chip--life { color: #f28b86; }
.daemon-chip--mana { color: #74c9ff; }
.daemon-chip--armor { color: #e5c06a; }
.daemon-chip--damage { color: #f2a061; }
.daemon-chip--ranged { color: #7fe3f3; }
.daemon-text-link { color: #f0c65d; font-weight: 700; text-underline-offset: 4px; }
.daemon-skill-group,
.daemon-looks { padding: clamp(26px, 4vw, 52px); border-bottom: 1px solid rgba(196, 153, 65, .18); }
.daemon-skill-group > h3,
.daemon-looks > h3 { margin-bottom: 20px; color: #ffe8b5; font-family: var(--font-display); font-size: 1.45rem; font-weight: 500; }
.daemon-skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.daemon-skill {
  min-width: 0;
  display: grid;
  grid-template-columns: 64px 1fr;
  align-content: start;
  gap: 14px;
  min-height: 210px;
  padding: 18px;
  border: 1px solid rgba(164, 189, 197, .18);
  border-left: 3px solid #b78d38;
  background: rgba(1, 5, 8, .72);
}
.daemon-skill--strike { border-left-color: #cf6545; }
.daemon-skill--buff { border-left-color: #55b982; }
.daemon-skill--heal { border-left-color: #61c9e2; }
.daemon-skill--taunt { border-left-color: #db923a; }
.daemon-skill--guard { border-left-color: #718ee1; }
.daemon-skill__icon { width: 64px; height: 64px; border: 1px solid #af8431; border-radius: 6px; object-fit: cover; }
.daemon-skill__copy { min-width: 0; display: grid; align-content: start; gap: 10px; }
.daemon-skill__title { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: flex-start; gap: 8px; }
.daemon-skill__title h4 { color: #f3dfb2; font-size: 1rem; line-height: 1.25; }
.daemon-skill__help {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(113, 218, 241, .45);
  border-radius: 50%;
  color: #9ee8f7;
  background: rgba(18, 67, 81, .35);
  cursor: pointer;
}
.daemon-skill__help:hover,
.daemon-skill__help:focus-visible { border-color: #f2cc6a; color: #ffe8a7; outline: 0; box-shadow: 0 0 14px rgba(100, 218, 241, .25); }
.daemon-skill__popover {
  inset: auto;
  width: min(340px, calc(100vw - 24px));
  margin: 0;
  padding: 18px;
  border: 1px solid rgba(225, 185, 83, .65);
  color: #c9d0d2;
  background: linear-gradient(145deg, rgba(4, 12, 18, .98), rgba(8, 25, 31, .98));
  box-shadow: 0 18px 60px rgba(0, 0, 0, .65), inset 0 0 24px rgba(92, 202, 226, .06);
  opacity: 0;
  transform: translateY(8px) scale(.96);
  transition: opacity 180ms ease, transform 180ms ease, overlay 180ms allow-discrete, display 180ms allow-discrete;
}
.daemon-skill__popover:popover-open { opacity: 1; transform: none; }
.daemon-skill__popover h5 { margin: 0 0 8px; color: #ffe5a3; font-size: 1rem; }
.daemon-skill__popover p { margin: 0; font-size: .86rem; line-height: 1.5; }
.daemon-skill__popover ul { display: flex; flex-wrap: wrap; gap: 5px; margin: 12px 0 0; padding: 0; }
.daemon-skill__popover li { list-style: none; padding: 3px 7px; border: 1px solid rgba(107, 209, 232, .25); border-radius: 999px; color: #99dcea; font-size: .7rem; }
@supports (position-anchor: --daemon-help) {
  .daemon-skill__popover {
    position-area: block-start span-inline-end;
    position-try-fallbacks: flip-block, flip-inline;
    margin-block-end: 10px;
  }
}
@starting-style {
  .daemon-skill__popover:popover-open { opacity: 0; transform: translateY(8px) scale(.96); }
}
.daemon-skill__copy > p { grid-column: 1 / -1; color: #b7c0c3; font-size: .9rem; line-height: 1.48; }
.daemon-skill__meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; color: #8ed4e5; font-size: .72rem; }
.daemon-skill__meta li { list-style: none; padding: 3px 7px; border: 1px solid rgba(103, 199, 224, .2); border-radius: 999px; background: rgba(22, 67, 80, .16); }
.daemon-looks > p { margin: -10px 0 22px; max-width: 760px; color: #aeb6b9; line-height: 1.55; }
.daemon-looks__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.daemon-look { display: grid; grid-template-columns: 86px 1fr; align-items: center; gap: 4px 14px; padding: 12px; border: 1px solid rgba(164, 189, 197, .16); color: inherit; background: rgba(1, 5, 8, .62); text-align: left; cursor: pointer; }
.daemon-look:hover { border-color: rgba(112, 211, 235, .52); background: rgba(13, 52, 64, .38); }
.daemon-look:focus-visible { outline: 2px solid #efd073; outline-offset: 2px; }
.daemon-look.is-selected { border-color: #dfb94f; background: linear-gradient(135deg, rgba(102, 68, 14, .35), rgba(7, 35, 45, .65)); box-shadow: inset 0 0 0 1px rgba(255, 224, 136, .18); }
.daemon-look > img { grid-row: 1 / 3; width: 86px; height: 86px; border-radius: 50%; object-fit: cover; }
.daemon-look strong { color: #f1dfb9; }
.daemon-look span { color: #d3ad53; font-size: .86rem; }
.daemon-look .daemon-look__price { display: inline-flex; align-items: center; gap: 6px; }
.daemon-look .daemon-look__spark { width: 22px; height: 22px; object-fit: contain; filter: drop-shadow(0 0 7px rgba(93, 181, 255, .42)); }
.daemon-section--growth {
  min-height: 850px;
  background:
    linear-gradient(90deg, rgba(2, 7, 11, .1), rgba(2, 7, 11, .8) 62%, #05090d),
    linear-gradient(0deg, #05090d, transparent 55%),
    url('../../assets/img/daemon/daemon-soul-stones-v2.webp') top center / cover no-repeat;
}
.daemon-growth-grid { width: min(760px, 100%); margin-left: auto; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.daemon-growth-card { padding: 24px; border: 1px solid var(--daemon-line); background: rgba(2, 7, 11, .8); }
.daemon-growth-card strong { color: #f3d483; font-family: var(--font-display); font-size: 1.2rem; }
.daemon-growth-card p { margin-top: 10px; color: #b8c0c3; line-height: 1.55; }
.daemon-stones { width: min(760px, 100%); margin: 18px 0 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.daemon-stone { display: grid; grid-template-columns: 56px 1fr; align-items: center; gap: 2px 12px; padding: 14px; border: 1px solid rgba(114, 206, 230, .25); background: rgba(2, 10, 15, .82); }
.daemon-stone img { grid-row: 1 / 3; width: 56px; height: 56px; }
.daemon-stone strong { color: #e5e9e8; font-size: .9rem; }
.daemon-stone span { color: #77d3e9; font-size: .8rem; }
.daemon-facts { width: min(760px, 100%); margin: 24px 0 0 auto; display: grid; gap: 10px; }
.daemon-facts li { list-style: none; padding: 13px 16px 13px 42px; border-left: 2px solid #b99038; color: #c2c8ca; background: rgba(2, 7, 11, .76); line-height: 1.5; }
.daemon-facts li::before { content: '✦'; float: left; margin-left: -26px; color: #e2bb5b; }
.daemon-section--talents {
  min-height: 730px;
  background:
    linear-gradient(0deg, #05090d, rgba(2, 7, 11, .18) 60%, #05090d),
    url('../../assets/img/daemon/daemon-talents-v2.webp') top center / cover no-repeat;
}
.daemon-section--curve { background: linear-gradient(135deg, #07090d, #061119); }
.daemon-curve-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.daemon-curve-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.daemon-curve-controls button { min-width: 88px; padding: 9px 14px; border: 1px solid #6b592f; color: #d5d8d7; background: #090b0e; cursor: pointer; }
.daemon-curve-controls button.is-active { border-color: #e1b94e; color: #ffe69c; background: rgba(111, 75, 15, .28); }
.daemon-curve-controls button:focus-visible { outline: 2px solid #f1cf72; outline-offset: 2px; }
.daemon-curve-jump { display: grid; gap: 6px; color: #c9d2d5; font-size: .78rem; letter-spacing: .04em; }
.daemon-curve-jump input { width: 160px; min-height: 42px; padding: 8px 12px; color: #fff0c2; background: #05090d; border: 1px solid #7a6534; font: 700 1rem var(--font-body); }
.daemon-curve-jump input:focus-visible { outline: 2px solid #f1cf72; outline-offset: 2px; }
.daemon-curve-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 14px; border: 1px solid rgba(99, 175, 195, .28); background: rgba(2, 11, 16, .75); }
.daemon-curve-summary > * { padding: 11px 14px; color: #9eb7be; border-right: 1px solid rgba(99, 175, 195, .18); font-size: .82rem; }
.daemon-curve-summary > :last-child { color: #ffe08a; border-right: 0; }
.daemon-curve { max-height: 660px; overflow: auto; border: 1px solid var(--daemon-line); scrollbar-color: #8f702f #06090d; }
.daemon-curve__table { width: 100%; border-collapse: collapse; }
.daemon-curve__table th,
.daemon-curve__table td { padding: 13px 18px; border-bottom: 1px solid rgba(196, 153, 65, .12); text-align: right; }
.daemon-curve__table th { position: sticky; z-index: 2; top: 0; color: #e8c365; background: linear-gradient(#080c11, #05080c); box-shadow: 0 1px 0 #715a28, 0 10px 24px rgba(0, 0, 0, .38); }
.daemon-curve__table th > [aria-hidden] { margin-right: 6px; color: #63bfd3; }
.daemon-curve__table th:first-child,
.daemon-curve__table td:first-child { text-align: left; }
.daemon-curve__table tr:hover td { background: rgba(43, 110, 128, .1); }
.daemon-curve__table tr.is-milestone td { color: #f6dc91; background: linear-gradient(90deg, rgba(115, 76, 14, .25), rgba(13, 41, 49, .18)); border-bottom-color: rgba(225, 185, 78, .38); }
.daemon-curve__table tr.is-milestone td:first-child::after { content: attr(data-milestone); display: inline-block; margin-left: 12px; padding: 2px 8px; color: #8fdae8; border: 1px solid rgba(99, 191, 211, .4); font-size: .68rem; letter-spacing: .05em; text-transform: uppercase; }
.daemon-curve__table tr.is-target td { animation: daemon-curve-target 1.4s ease-out both; }
@keyframes daemon-curve-target { from { background: rgba(241, 197, 84, .52); } to { background: rgba(43, 110, 128, .1); } }
@keyframes daemon-soul-flow { to { stroke-dashoffset: -48; } }

::view-transition-group(daemon-native-preview),
::view-transition-group(daemon-form-preview) {
  animation-duration: 420ms;
  animation-timing-function: cubic-bezier(.2, .8, .2, 1);
}

@container daemon-form (max-width: 780px) {
  .daemon-form__intro { grid-template-columns: 1fr; }
  .daemon-skills { grid-template-columns: 1fr; }
}
@media (max-width: 1200px) {
  .daemon-form__intro { grid-template-columns: 1fr; }
  .daemon-skills { grid-template-columns: repeat(2, 1fr); }
  .daemon-looks__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .daemon-form__intro { padding: 24px 16px; }
  .daemon-form__portraits { gap: 8px; }
  .daemon-soul-bridge { flex-basis: 62px; height: 60px; }
  .daemon-skill-group,
  .daemon-looks { padding: 26px 14px; }
  .daemon-skills,
  .daemon-growth-grid,
  .daemon-stones,
  .daemon-paths { grid-template-columns: 1fr; }
  .daemon-skill { min-height: 0; grid-template-columns: 54px 1fr; padding: 14px; }
  .daemon-skill__icon { width: 54px; height: 54px; }
  .daemon-looks__grid { grid-template-columns: 1fr; }
  .daemon-look { grid-template-columns: 80px 1fr; }
  .daemon-look img { width: 80px; height: 80px; }
  .daemon-section--growth { min-height: 0; background-position: 32% top; }
  .daemon-growth-grid { margin-top: 72px; }
  .daemon-section--talents { min-height: 0; }
  .daemon-section--talents .daemon-section__head { padding: 18px; background: rgba(2, 8, 13, .78); backdrop-filter: blur(6px); }
  .daemon-curve-toolbar { align-items: stretch; flex-direction: column; }
  .daemon-curve-jump input { width: 100%; }
  .daemon-curve-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .daemon-curve-summary > * { border-bottom: 1px solid rgba(99, 175, 195, .18); }
  .daemon-curve { max-height: none; overflow: visible; border: 0; }
  .daemon-curve__table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .daemon-curve__table,
  .daemon-curve__table tbody { display: block; }
  .daemon-curve__table tr { display: grid; gap: 4px; margin-bottom: 10px; padding: 10px 14px; border: 1px solid rgba(196, 153, 65, .2); background: rgba(3, 10, 14, .86); }
  .daemon-curve__table td { display: flex; justify-content: space-between; gap: 14px; padding: 4px 0; border: 0; text-align: right; }
  .daemon-curve__table td::before { content: attr(data-label); color: #7f9ca4; font-size: .76rem; }
  .daemon-curve__table td:first-child { align-items: center; color: #f4d67d; }
  .daemon-curve__table tr.is-milestone td:first-child::after { margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .daemon-soul-bridge__glow { animation: none; }
  .daemon-skill__popover { transition: none; }
  .daemon-curve__table tr.is-target td { animation: none; }
}
