@import url("https://fonts.googleapis.com/css2?family=Alegreya+Sans:wght@400;500;700&family=Cinzel:wght@600;700;800&display=swap");

:root {
  color-scheme: dark;
  --bg-deep: #090506;
  --bg-blood: #17070a;
  --panel: rgba(23, 12, 15, 0.88);
  --panel-soft: rgba(34, 18, 23, 0.82);
  --border: rgba(215, 165, 84, 0.32);
  --border-bright: rgba(244, 201, 124, 0.72);
  --text: #f6ead1;
  --muted: #d5c2a4;
  --soft: #a88e70;
  --gold: #f4c97c;
  --crimson: #b63a34;
  --success: #7ecf97;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Alegreya Sans", "Trebuchet MS", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(182, 58, 52, 0.18), transparent 30%),
    radial-gradient(circle at 20% 20%, rgba(244, 201, 124, 0.12), transparent 28%),
    linear-gradient(180deg, #231015 0%, #0c0709 46%, #080405 100%);
  position: relative;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0) 0,
      rgba(255, 255, 255, 0) 72px,
      rgba(244, 201, 124, 0.025) 73px,
      rgba(244, 201, 124, 0) 74px
    ),
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0) 0,
      rgba(255, 255, 255, 0) 72px,
      rgba(244, 201, 124, 0.02) 73px,
      rgba(244, 201, 124, 0) 74px
    );
  opacity: 0.55;
}

body::after {
  background:
    radial-gradient(circle at 15% 50%, rgba(244, 201, 124, 0.08), transparent 18%),
    radial-gradient(circle at 80% 15%, rgba(182, 58, 52, 0.08), transparent 24%);
  animation: emberFloat 18s ease-in-out infinite alternate;
  opacity: 0.95;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

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

button {
  border: 0;
  background: none;
  cursor: pointer;
}

.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: min(1180px, calc(100vw - 2rem));
  margin: 0 auto;
}

.site-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(10, 5, 7, 0.78);
  border-bottom: 1px solid rgba(244, 201, 124, 0.14);
  transition: background-color 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.site-topbar.is-scrolled {
  background: rgba(12, 6, 8, 0.92);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
  border-bottom-color: rgba(244, 201, 124, 0.24);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.95rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 18px;
  border: 1px solid var(--border-bright);
  background:
    radial-gradient(circle at top, rgba(244, 201, 124, 0.18), transparent 55%),
    linear-gradient(180deg, rgba(135, 34, 31, 0.95), rgba(38, 10, 14, 0.95));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 8px 25px rgba(0, 0, 0, 0.35);
  color: var(--gold);
  font-family: "Cinzel", serif;
  font-size: 1rem;
  letter-spacing: 0.12em;
}

.brand-copy {
  display: flex;
  flex-direction: column;
}

.brand-copy strong,
.site-nav a,
h1,
h2,
h3 {
  font-family: "Cinzel", Georgia, serif;
}

.brand-copy strong {
  font-size: 1rem;
  letter-spacing: 0.05em;
}

.brand-copy small {
  color: var(--soft);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-nav a {
  padding: 0.7rem 1rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  transition: transform 140ms ease, color 140ms ease, border-color 140ms ease, background 140ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a.is-active {
  color: var(--text);
  background: linear-gradient(180deg, rgba(145, 43, 42, 0.25), rgba(36, 14, 18, 0.35));
  border-color: rgba(244, 201, 124, 0.26);
  transform: translateY(-1px);
}

main.container {
  padding-top: 2rem;
  padding-bottom: 3rem;
  flex: 1;
}

.hero,
.page-intro,
.panel,
.toolbar-panel,
.cta-banner {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(31, 16, 20, 0.88), rgba(17, 9, 12, 0.94)),
    linear-gradient(135deg, rgba(182, 58, 52, 0.08), transparent 55%);
  box-shadow: var(--shadow);
}

.hero::before,
.page-intro::before,
.panel::before,
.toolbar-panel::before,
.cta-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(244, 201, 124, 0.08), transparent 25%),
    linear-gradient(315deg, rgba(182, 58, 52, 0.08), transparent 28%);
  pointer-events: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.85fr);
  gap: 1.4rem;
  padding: 2rem;
  align-items: stretch;
  animation: riseIn 650ms ease both;
}

.hero-copy,
.hero-card,
.page-intro,
.panel,
.toolbar-panel,
.cta-banner,
.summary-item {
  position: relative;
  z-index: 1;
}

.eyebrow,
.panel-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.9rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.82rem;
}

.eyebrow::before,
.panel-kicker::before {
  content: "";
  width: 1.75rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.1;
}

h1 {
  font-size: clamp(2.6rem, 6vw, 4.65rem);
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin-bottom: 0.85rem;
}

h3 {
  font-size: 1.08rem;
  margin-bottom: 0.45rem;
}

p,
li,
label span {
  font-size: 1.08rem;
  line-height: 1.6;
  color: var(--muted);
}

.quote-stack {
  display: grid;
  gap: 0.75rem;
  max-width: 62ch;
}

.quote-stack p {
  margin: 0;
}

.hero-callout {
  color: var(--text);
  font-weight: 700;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.6rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.85rem 1.35rem;
  border-radius: 999px;
  border: 1px solid rgba(244, 201, 124, 0.18);
  font-family: "Cinzel", serif;
  font-size: 0.92rem;
  letter-spacing: 0.05em;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background 140ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
}

.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.button-primary {
  color: #1d1306;
  border-color: rgba(244, 201, 124, 0.6);
  background: linear-gradient(180deg, #f4d08d 0%, #c58733 100%);
}

.button-secondary {
  color: var(--text);
  background: linear-gradient(180deg, rgba(124, 30, 33, 0.75), rgba(46, 14, 17, 0.9));
  border-color: rgba(244, 201, 124, 0.26);
}

.button-small {
  min-height: 2.65rem;
  padding: 0.7rem 1rem;
  font-size: 0.84rem;
}

.hero-card,
.panel,
.toolbar-panel,
.page-intro,
.cta-banner {
  padding: 1.35rem;
}

.value-list {
  display: grid;
  gap: 0.7rem;
  margin: 1rem 0 0;
  padding-left: 1rem;
}

.value-list li {
  color: var(--text);
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.section-heading {
  margin: 2.6rem 0 1.1rem;
}

.section-heading h2 {
  max-width: 13ch;
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.spec-card {
  position: relative;
  padding: 1.15rem 1.1rem;
  border-radius: 22px;
  border: 1px solid rgba(244, 201, 124, 0.18);
  background:
    linear-gradient(180deg, rgba(27, 13, 17, 0.96), rgba(17, 9, 12, 0.96)),
    linear-gradient(135deg, rgba(244, 201, 124, 0.06), transparent 35%);
  box-shadow: var(--shadow);
}

.spec-card p {
  margin: 0;
}

.spec-rank {
  display: inline-flex;
  margin-bottom: 0.8rem;
  color: var(--gold);
  font-family: "Cinzel", serif;
  letter-spacing: 0.08em;
}

.cta-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
}

.site-footer {
  border-top: 1px solid rgba(244, 201, 124, 0.12);
  background: rgba(10, 5, 7, 0.74);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.25rem 0 1.7rem;
}

.footer-inner p {
  margin: 0;
  font-size: 0.95rem;
}

.summary-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 1.4rem;
}

.summary-item {
  padding: 1rem 1.1rem;
  border-radius: 20px;
  border: 1px solid rgba(244, 201, 124, 0.18);
  background: rgba(21, 11, 14, 0.82);
  box-shadow: var(--shadow);
}

.summary-item span {
  display: block;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--soft);
  margin-bottom: 0.35rem;
}

.summary-item strong {
  display: block;
  font-family: "Cinzel", serif;
  font-size: 1.05rem;
}

.toolbar-panel {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.class-selector {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.class-pill {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.8rem 0.95rem;
  border-radius: 18px;
  border: 1px solid rgba(244, 201, 124, 0.16);
  background: linear-gradient(180deg, rgba(40, 19, 24, 0.86), rgba(18, 9, 12, 0.94));
  color: var(--text);
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.class-pill img {
  width: 3rem;
  height: 3rem;
  border-radius: 14px;
  border: 1px solid rgba(244, 201, 124, 0.25);
}

.class-pill strong,
.class-pill small {
  display: block;
}

.class-pill strong {
  font-family: "Cinzel", serif;
  font-size: 0.96rem;
}

.class-pill small {
  color: var(--soft);
  font-size: 0.88rem;
}

.class-pill.is-active,
.class-pill:hover,
.class-pill:focus-visible {
  border-color: color-mix(in srgb, var(--class-accent, var(--gold)) 45%, white 18%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--class-accent, var(--gold)) 34%, transparent);
  transform: translateY(-1px);
}

.share-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.share-input,
.field input,
.field select,
.field textarea {
  width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(244, 201, 124, 0.18);
  background: rgba(10, 7, 8, 0.78);
  color: var(--text);
  padding: 0.9rem 1rem;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.share-input {
  flex: 1 1 18rem;
}

.share-input:focus-visible,
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  border-color: rgba(244, 201, 124, 0.45);
  box-shadow: 0 0 0 3px rgba(244, 201, 124, 0.12);
  background: rgba(13, 8, 10, 0.92);
}

.calculator-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.8fr);
  gap: 1rem;
  margin-top: 1rem;
  align-items: start;
}

.trees-shell {
  display: grid;
  gap: 1rem;
}

.tree-card {
  padding: 0;
}

.tree-banner {
  min-height: 8rem;
  background-position: center;
  background-size: cover;
  border-bottom: 1px solid rgba(244, 201, 124, 0.14);
}

.tree-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 1rem 1rem 0.65rem;
}

.tree-title {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.tree-title img {
  width: 3rem;
  height: 3rem;
  border-radius: 14px;
  border: 1px solid rgba(244, 201, 124, 0.28);
}

.tree-title p,
.tree-title h2 {
  margin: 0;
}

.tree-points {
  color: var(--gold);
  font-family: "Cinzel", serif;
  font-size: 1rem;
}

.tree-meta {
  color: var(--soft);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.tree-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.95rem 0.75rem;
  padding: 0.95rem 1rem 1rem;
}

.talent-cell {
  min-height: 6rem;
}

.talent-empty {
  width: 100%;
  height: 100%;
  border-radius: 18px;
  border: 1px dashed rgba(244, 201, 124, 0.08);
  background: rgba(9, 6, 7, 0.22);
}

.talent-card {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(244, 201, 124, 0.22);
  background: rgba(11, 7, 8, 0.76);
  padding: 0;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease, filter 120ms ease;
}

.talent-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.talent-card:hover,
.talent-card:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(244, 201, 124, 0.48);
  box-shadow: 0 14px 25px rgba(0, 0, 0, 0.3);
}

.talent-card.is-selected {
  box-shadow: 0 0 0 2px rgba(244, 201, 124, 0.48), 0 18px 30px rgba(0, 0, 0, 0.34);
}

.talent-card.is-locked {
  filter: grayscale(1) brightness(0.5);
}

.talent-card.is-maxed {
  border-color: rgba(126, 207, 151, 0.65);
  box-shadow: 0 0 0 1px rgba(126, 207, 151, 0.38);
}

.talent-counter {
  position: absolute;
  right: 0.4rem;
  bottom: 0.4rem;
  min-width: 2.2rem;
  padding: 0.15rem 0.35rem;
  border-radius: 999px;
  background: rgba(6, 5, 6, 0.9);
  border: 1px solid rgba(244, 201, 124, 0.35);
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 700;
}

.detail-panel {
  position: sticky;
  top: 6.25rem;
}

.detail-art {
  border-radius: 20px;
  overflow: hidden;
  min-height: 10rem;
  margin-bottom: 1rem;
  background-position: center;
  background-size: cover;
  border: 1px solid rgba(244, 201, 124, 0.18);
}

.detail-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0.9rem 0 1rem;
}

.meta-pill {
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(10, 7, 8, 0.7);
  border: 1px solid rgba(244, 201, 124, 0.16);
  color: var(--muted);
  font-size: 0.88rem;
}

.detail-copy {
  display: grid;
  gap: 0.75rem;
}

.detail-copy p {
  margin: 0;
}

.detail-copy ul {
  margin: 0;
  padding-left: 1rem;
}

.detail-copy li {
  color: var(--muted);
}

.detail-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.detail-status {
  margin-top: 0.85rem;
  color: var(--soft);
  font-size: 0.95rem;
}

.notice-strip {
  padding: 0.95rem 1rem;
  margin-top: 1rem;
  border-radius: 18px;
  border: 1px solid rgba(244, 201, 124, 0.18);
  background: rgba(16, 9, 10, 0.82);
  color: var(--muted);
}

.chat-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(280px, 0.9fr) minmax(0, 1.2fr);
  gap: 1rem;
  margin-top: 1rem;
  align-items: start;
}

.chat-panel {
  display: grid;
  gap: 1rem;
}

.chat-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.form-stack,
.field,
.message-composer {
  display: grid;
  gap: 0.65rem;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.feedback-text {
  min-height: 1.2rem;
  margin: 0;
  color: var(--gold);
}

.active-banner {
  padding: 0.85rem 0.95rem;
  border-radius: 18px;
  background: rgba(10, 7, 8, 0.72);
  border: 1px solid rgba(244, 201, 124, 0.15);
  color: var(--muted);
  margin-bottom: 0.95rem;
}

.roster-list {
  display: grid;
  gap: 0.75rem;
}

.roster-item {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  text-align: left;
  width: 100%;
  padding: 0.85rem;
  border-radius: 18px;
  border: 1px solid rgba(244, 201, 124, 0.16);
  background: rgba(12, 8, 9, 0.7);
  transition: border-color 140ms ease, transform 140ms ease, background 140ms ease;
}

.roster-item:hover,
.roster-item:focus-visible,
.roster-item.is-active {
  border-color: rgba(244, 201, 124, 0.34);
  transform: translateY(-1px);
  background: rgba(20, 10, 12, 0.86);
}

.avatar-token {
  flex: none;
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #140a06;
  font-family: "Cinzel", serif;
  font-size: 1rem;
  letter-spacing: 0.08em;
  background: linear-gradient(180deg, var(--token-color, #f4c97c), color-mix(in srgb, var(--token-color, #f4c97c) 60%, #63201b));
}

.roster-copy {
  display: grid;
  gap: 0.25rem;
}

.roster-copy strong {
  font-family: "Cinzel", serif;
  font-size: 0.95rem;
}

.roster-copy small {
  color: var(--soft);
  font-size: 0.88rem;
}

.message-list {
  display: grid;
  gap: 0.85rem;
  max-height: 35rem;
  overflow: auto;
  padding-right: 0.35rem;
}

.message {
  padding: 0.95rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(244, 201, 124, 0.14);
  background: rgba(11, 8, 9, 0.76);
}

.message.is-system {
  border-style: dashed;
  background: rgba(18, 11, 11, 0.8);
}

.message-head {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.55rem;
  align-items: flex-start;
}

.message-author {
  display: flex;
  gap: 0.7rem;
  align-items: center;
}

.message-author strong {
  font-family: "Cinzel", serif;
  font-size: 0.95rem;
}

.message-meta {
  color: var(--soft);
  font-size: 0.88rem;
}

.message-body {
  margin: 0;
  color: var(--text);
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.class-badge {
  display: inline-flex;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: rgba(10, 7, 8, 0.72);
  border: 1px solid rgba(244, 201, 124, 0.14);
  color: var(--muted);
  font-size: 0.84rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes emberFloat {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(0, -1.2%, 0) scale(1.02);
  }
}

@media (max-width: 1080px) {
  .hero,
  .calculator-layout,
  .chat-layout,
  .section-grid,
  .spec-grid,
  .summary-bar,
  .class-selector {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    position: static;
  }

  .cta-banner,
  .footer-inner,
  .topbar-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .container {
    width: min(100vw - 1rem, 100%);
  }

  main.container {
    padding-top: 1rem;
    padding-bottom: 2rem;
  }

  .hero,
  .page-intro,
  .panel,
  .toolbar-panel,
  .cta-banner {
    padding: 1rem;
  }

  h1 {
    font-size: 2.3rem;
  }

  .field-row,
  .detail-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .share-row {
    align-items: stretch;
  }

  .share-row .button,
  .detail-actions .button {
    width: 100%;
  }
}
