:root {
  --bg: #0b0908;
  --bg-2: #120f0c;
  --bg-elev: #181410;
  --bg-card: #1c1713;
  --bg-card-hover: #241e18;
  --ink: #f4eee6;
  --ink-dim: #cbbba6;
  --muted: #9a8b78;
  --gold: #e0b56a;
  --gold-2: #f0d19a;
  --copper: #c4844a;
  --ember: #d4522c;
  --blood: #b33b35;
  --sage: #86a576;
  --teal: #6bb3a8;
  --line: rgba(224, 181, 106, 0.16);
  --line-strong: rgba(224, 181, 106, 0.32);
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  --radius: 16px;
  --font-serif: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  --font-sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --header-h: 72px;
  --max: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  min-height: 100vh;
  text-rendering: optimizeLegibility;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(180, 60, 30, 0.16), transparent 55%),
    radial-gradient(900px 500px at -10% 20%, rgba(224, 181, 106, 0.07), transparent 50%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
}
img { max-width: 100%; }
a { color: var(--gold-2); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #fff; }
button, select, input { font-family: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.skip {
  position: absolute;
  left: 12px; top: -40px;
  background: var(--gold);
  color: #1a1208;
  padding: 8px 12px;
  z-index: 100;
  border-radius: 0 0 8px 8px;
}
.skip:focus { top: 0; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  backdrop-filter: blur(16px);
  background: rgba(11, 9, 8, 0.82);
  border-bottom: 1px solid var(--line);
}
.header-inner, .wrap {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}
.brand-mark {
  width: 40px; height: 40px;
  flex: none;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-kicker {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}
.brand-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 17px;
}
.nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav a {
  color: var(--ink-dim);
  text-decoration: none;
  padding: 8px 10px;
  font-size: 13px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.nav a:hover, .nav a[aria-current="true"] {
  color: var(--ink);
  background: rgba(224, 181, 106, 0.1);
}
.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  border-radius: 8px;
  padding: 8px 10px;
}

/* Hero */
.hero {
  position: relative;
  z-index: 1;
  padding: 72px 0 48px;
  border-bottom: 1px solid var(--line);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 40px;
  align-items: end;
}
.eyebrow {
  color: var(--gold);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 12px;
  margin: 0 0 12px;
}
.hero h1 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1.15;
  margin: 0 0 16px;
  letter-spacing: 0.01em;
}
.lede {
  font-size: 18px;
  color: var(--ink-dim);
  max-width: 42rem;
  margin: 0 0 28px;
}
.badge-row { display: flex; flex-wrap: wrap; gap: 8px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line-strong);
  background: rgba(224, 181, 106, 0.06);
  color: var(--gold-2);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  letter-spacing: 0.04em;
}
.badge strong { color: var(--ink); font-weight: 600; }
.hero-aside {
  background: linear-gradient(180deg, rgba(28, 23, 19, 0.9), rgba(16, 13, 11, 0.95));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 16px;
  box-shadow: var(--shadow);
}
.hero-aside h2 {
  font-family: var(--font-serif);
  font-size: 16px;
  margin: 0 0 12px;
  color: var(--gold-2);
}
.hero-aside p { margin: 0 0 12px; color: var(--ink-dim); font-size: 14px; }
.structure-list { list-style: none; margin: 0; padding: 0; }
.structure-list li {
  display: grid;
  grid-template-columns: minmax(5.6rem, 7.4rem) 1fr;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
  align-items: start;
}
.structure-list strong { color: var(--gold); display: block; line-height: 1.4; }
.structure-list .region { color: var(--ink-dim); }
.structure-list span { display: block; color: var(--muted); margin-top: 2px; }

/* Sections */
.section {
  position: relative;
  z-index: 1;
  padding: 72px 0;
  border-bottom: 1px solid var(--line);
}
.section-head { margin-bottom: 28px; max-width: 720px; }
.section-head h2 {
  font-family: var(--font-serif);
  font-size: clamp(28px, 4vw, 40px);
  margin: 0 0 10px;
  font-weight: 600;
}
.section-head p { margin: 0; color: var(--ink-dim); }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 24px;
  align-items: center;
}
.chip, .kind-filter {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink-dim);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
}
.chip:hover, .kind-filter:hover { color: var(--ink); border-color: var(--gold); }
.chip.is-active, .kind-filter.is-active {
  background: var(--gold);
  color: #1a1208;
  border-color: var(--gold);
  font-weight: 600;
}
.search {
  margin-left: auto;
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  min-width: 200px;
}

/* Boss cards */
.boss-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.boss-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 100%;
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
}
.boss-card:hover {
  border-color: var(--line-strong);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}
.card-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.kind {
  font-size: 11px;
  letter-spacing: 0.08em;
  border-radius: 999px;
  padding: 3px 8px;
  border: 1px solid;
  white-space: nowrap;
}
.kind-required { color: #f0c9a0; border-color: rgba(196, 132, 74, 0.45); }
.kind-act { color: #ffd9a0; border-color: var(--gold); background: rgba(224, 181, 106, 0.1); }
.kind-optional { color: var(--teal); border-color: rgba(107, 179, 168, 0.4); }
.kind-quest { color: #d7b4e2; border-color: rgba(180, 140, 200, 0.4); }
.boss-card h3 {
  font-family: var(--font-serif);
  font-size: 20px;
  margin: 0;
  line-height: 1.3;
}
.en { color: var(--muted); font-size: 12px; letter-spacing: 0.02em; }
.meta-line { color: var(--ink-dim); font-size: 13px; }
.watch, .reward { font-size: 14px; margin: 0; color: var(--ink-dim); }
.reward { color: var(--sage); }
.buff-pill {
  align-self: flex-start;
  font-size: 12px;
  color: var(--gold-2);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 4px 8px;
  background: rgba(224, 181, 106, 0.06);
}
.source-links { margin-top: auto; padding-top: 8px; font-size: 12px; }
.source-links a { color: var(--muted); margin-right: 8px; }
.empty-state { color: var(--muted); padding: 24px 0; }

/* Checklist / items */
.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}
.item-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}
.item-card input[type="checkbox"] {
  width: 18px; height: 18px;
  margin-top: 4px;
  accent-color: var(--gold);
}
.item-card h3 { margin: 0 0 4px; font-size: 16px; font-family: var(--font-serif); }
.item-card p { margin: 0; font-size: 13px; color: var(--ink-dim); }
.item-card.is-done { opacity: 0.55; }
.item-card.is-done h3 { text-decoration: line-through; }
.cat {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--gold);
  text-transform: uppercase;
}

/* Tips */
.tip-grid, .spike-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.tip-card, .route-card, .trial-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
}
.tip-card h3, .spike-card h3, .route-card h3, .trial-card h3 {
  font-family: var(--font-serif);
  margin: 0 0 8px;
  font-size: 18px;
}
.tip-card p, .spike-card p, .trial-card p { margin: 0; color: var(--ink-dim); font-size: 14px; }
.spike-card {
  background: linear-gradient(180deg, #22180f, #17130f);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 18px;
}
.route-list { display: grid; gap: 14px; }
.route-card ol { margin: 8px 0 0; padding-left: 18px; color: var(--ink-dim); }
.route-card li { margin: 0 0 6px; }

/* Ascendancy / builds */
.asc-grid, .build-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.asc-card, .build-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.asc-card h3, .build-card h3 {
  font-family: var(--font-serif);
  margin: 0;
  font-size: 22px;
  line-height: 1.3;
}
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(107, 179, 168, 0.12);
  color: var(--teal);
  border: 1px solid rgba(107, 179, 168, 0.25);
}
.class-line { color: var(--muted); font-size: 13px; }
.asc-card p, .build-card p { margin: 0; color: var(--ink-dim); font-size: 14px; }
.skill-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.skill-list li {
  background: var(--bg-elev);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
}
.skill-list strong { color: var(--gold-2); display: block; }
.link-row { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: auto; padding-top: 6px; font-size: 13px; }

/* Footer */
.site-footer {
  position: relative;
  z-index: 1;
  padding: 40px 0 60px;
  color: var(--muted);
  font-size: 13px;
}
.site-footer h2 { font-family: var(--font-serif); color: var(--ink-dim); font-size: 16px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px 18px; margin: 8px 0 20px; }
.disclaimer { max-width: 720px; }

.progress-bar {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
}
.progress-track {
  height: 6px;
  background: #2a221c;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--copper), var(--gold));
}

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .menu-toggle { display: inline-flex; }
  .nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    background: rgba(14, 11, 9, 0.96);
    border-bottom: 1px solid var(--line);
    padding: 12px 16px 16px;
    flex-direction: column;
  }
  .nav.is-open { display: flex; }
  .search { margin-left: 0; width: 100%; }
  .hero { padding-top: 40px; }
}
@media (max-width: 520px) {
  .brand-title { font-size: 15px; }
  .hero h1 { font-size: 32px; }
}

code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--gold-2); font-size: 0.92em; }


/* Language toggle + header actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.lang-toggle {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 2px;
  background: rgba(224, 181, 106, 0.04);
}
.lang-toggle button {
  border: 0;
  background: transparent;
  color: var(--ink-dim);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12px;
  letter-spacing: 0.08em;
  cursor: pointer;
  line-height: 1.2;
}
.lang-toggle button:hover { color: var(--ink); }
.lang-toggle button[aria-pressed="true"] {
  background: var(--gold);
  color: #1a1208;
  font-weight: 600;
}

.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
}
.header-inner .brand { grid-column: 1; margin-right: 0; }
.header-inner .nav { grid-column: 2; justify-self: end; }
.header-inner .header-actions { grid-column: 3; }

.structure-list li.is-interlude strong { color: var(--teal); }

.chip-interlude:not(.is-active) {
  border-color: rgba(107, 179, 168, 0.35);
  color: #b7d4ce;
}
.chip-reset { margin-left: auto; }

.subhead {
  margin: 40px 0 16px;
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 600;
}

/* Boss portraits */
.boss-card {
  padding: 0;
  overflow: hidden;
  gap: 0;
}
.boss-art {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 0;
  background: #100c0a;
  cursor: zoom-in;
  position: relative;
  overflow: hidden;
}
.boss-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  display: block;
  transition: transform 0.35s ease;
}
.boss-card:hover .boss-art img { transform: scale(1.04); }
.boss-art::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(12, 9, 7, 0.88));
}
.boss-art.is-placeholder {
  cursor: default;
  background:
    radial-gradient(60% 80% at 50% 40%, rgba(224, 181, 106, 0.12), transparent 70%),
    #14100c;
}
.boss-art.is-placeholder img { object-fit: contain; padding: 18%; opacity: 0.7; }
.boss-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.img-credit {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.img-credit a { color: var(--muted); }

/* Lightbox */
body.lightbox-open { overflow: hidden; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(5, 3, 2, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 20px 40px;
  backdrop-filter: blur(8px);
}
.lightbox[hidden] { display: none !important; }
.lightbox-close {
  position: absolute;
  top: 16px;
  right: 18px;
  border: 1px solid var(--line-strong);
  background: rgba(20, 16, 12, 0.8);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
}
.lightbox-frame { margin: 0; max-width: min(1280px, 92vw); text-align: center; }
.lightbox-frame img {
  max-width: min(1280px, 92vw);
  max-height: 78vh;
  border-radius: 10px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  border: 1px solid var(--line);
}
.lightbox-frame figcaption {
  margin-top: 10px;
  color: var(--ink-dim);
  font-size: 13px;
}
.lightbox-frame figcaption a { color: var(--gold-2); }

@media (max-width: 860px) {
  .header-inner {
    grid-template-columns: 1fr auto;
  }
  .header-inner .brand { grid-column: 1; }
  .header-inner .header-actions { grid-column: 2; }
  .header-inner .nav {
    grid-column: 1 / -1;
    justify-self: stretch;
  }
  .chip-reset { margin-left: 0; }
}

/* My Character */
.char-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 0 0 28px;
}
.char-panel {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
}
.char-panel h3 {
  font-family: var(--font-serif);
  margin: 0 0 10px;
  font-size: 20px;
}
.char-panel p { margin: 0 0 12px; color: var(--ink-dim); font-size: 14px; }
.char-field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 12px; font-size: 13px; color: var(--gold-2); }
.char-field input, .char-field select, .char-field textarea {
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  border-radius: 10px;
  padding: 8px 12px;
  font: inherit;
}
.char-field textarea { resize: vertical; min-height: 8rem; }
.char-note { color: var(--muted); font-size: 13px; }
.char-server-hint, .char-status, .char-oauth-state { font-size: 14px; margin: 0 0 16px; }
.char-status.is-error { color: #e07a6a; }
.char-demo-banner {
  border: 1px dashed var(--line-strong);
  background: rgba(224, 181, 106, 0.08);
  color: var(--gold-2);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
}
.file-chip { position: relative; overflow: hidden; cursor: pointer; }
.file-chip input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.char-view { display: grid; gap: 28px; }
.char-sheet-head h3 { font-family: var(--font-serif); font-size: 28px; margin: 0 0 6px; }
.char-meta, .char-source { margin: 0; color: var(--muted); font-size: 14px; }
.char-progress, .char-gear, .char-skills, .char-tree {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
}
.char-progress h4, .char-gear h4, .char-skills h4, .char-tree h4, .char-sets h4 {
  font-family: var(--font-serif);
  margin: 0 0 10px;
  font-size: 22px;
}
.char-counts { color: var(--gold-2); font-size: 14px; }
.char-act { margin-top: 16px; }
.char-act h5 { margin: 0 0 8px; color: var(--gold); font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase; }
.char-check { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.char-check li {
  display: grid;
  grid-template-columns: 7.2rem 1fr;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-elev);
  align-items: start;
}
.char-check li p { margin: 4px 0 0; font-size: 13px; color: var(--ink-dim); }
.char-flag {
  font-size: 11px;
  letter-spacing: 0.06em;
  border: 1px solid;
  border-radius: 999px;
  padding: 3px 8px;
  text-align: center;
  align-self: start;
}
.is-obtained .char-flag { color: var(--sage); border-color: rgba(134, 165, 118, 0.45); }
.is-missing .char-flag { color: #e07a6a; border-color: rgba(180, 70, 55, 0.45); }
.is-partial .char-flag { color: var(--gold-2); border-color: var(--line-strong); }
.is-unknown .char-flag { color: var(--muted); border-color: var(--line); }
.gear-grid, .skill-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}
.gear-card, .skill-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: var(--bg-elev);
}
.gear-card.is-unique { border-color: rgba(175, 95, 40, 0.7); }
.gear-card.is-rare { border-color: rgba(200, 180, 70, 0.45); }
.gear-card.is-magic { border-color: rgba(80, 120, 200, 0.5); }
.gear-icon { width: 44px; height: 44px; object-fit: contain; image-rendering: auto; }
.gear-slot, .gear-rarity { margin: 0; font-size: 11px; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }
.gear-card h5, .skill-card h5 { margin: 4px 0; font-family: var(--font-serif); font-size: 16px; }
.gear-mods, .skill-card ul, .notable-list { margin: 6px 0 0; padding-left: 16px; color: var(--ink-dim); font-size: 12px; }
.tree-canvas {
  width: 100%;
  height: 460px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #100c0a;
  touch-action: none;
  cursor: grab;
}
.tree-tools { display: flex; gap: 8px; margin: 0 0 10px; flex-wrap: wrap; }
.tree-tools a { text-decoration: none; }
.char-sets { margin-top: 18px; display: grid; gap: 12px; }
.char-raw { margin-top: 16px; color: var(--muted); font-size: 13px; }
.char-raw ul { margin: 8px 0 0; }
@media (max-width: 860px) {
  .char-panels { grid-template-columns: 1fr; }
  .char-check li { grid-template-columns: 1fr; }
  .tree-canvas { height: 360px; }
}


/* PoE2DB item / gem icons */
.gear-card {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 8px 12px;
  align-items: start;
}
.gear-icon, .gem-icon, .support-icon, .item-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
  background: rgba(22, 17, 12, 0.75);
  border: 1px solid rgba(224, 181, 106, 0.28);
  border-radius: 8px;
  padding: 3px;
  image-rendering: auto;
  flex: 0 0 auto;
}
.skill-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.skill-head h5 { margin: 0; }
.support-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.support-list li {
  display: flex;
  align-items: center;
  gap: 8px;
}
.support-icon {
  width: 28px;
  height: 28px;
  padding: 2px;
  border-radius: 6px;
}
.skill-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
}
.gem-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-top: 2px;
}
.gem-icon { width: 36px; height: 36px; }
.gem-icon-link { display: inline-flex; line-height: 0; }
.gem-icons-support .support-icon { width: 22px; height: 22px; }
.skill-supports-line {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 6px;
  color: var(--ink-dim);
  font-size: 13px;
}
.poe2db-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(224, 181, 106, 0.45);
}
.poe2db-link:hover { color: var(--gold-2); }
.icon-credit {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--ink-dim);
}
.icon-credit a { color: var(--gold-2); }
.gem-icon.is-placeholder, .gear-icon.is-placeholder { opacity: 0.85; }

/* Hash-routed pages */
.page { display: none; }
.page.is-active { display: block; }
.page.section { padding-top: 36px; min-height: calc(100vh - var(--header-h)); }
.page.hero.is-active { display: block; }
#credits.page { margin-top: 0; padding-bottom: 64px; }

/* Starters: class + ascendancy picker */
.class-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin: 8px 0 28px;
}
.class-tile, .asc-tile {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #120e0b;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  padding: 0;
  text-align: left;
  font: inherit;
}
.class-tile img, .asc-tile img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  object-position: top center;
  display: block;
  background: #0a0806;
}
.class-tile figcaption, .asc-tile figcaption {
  padding: 8px 10px 10px;
}
.class-tile strong, .asc-tile strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 15px;
}
.class-tile span, .asc-tile span {
  display: block;
  color: var(--ink-dim);
  font-size: 11px;
}
.class-tile.is-active, .asc-tile.is-active {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(224, 181, 106, 0.45);
}
.class-tile:hover, .asc-tile:hover, .class-tile:focus-visible, .asc-tile:focus-visible {
  border-color: var(--gold-2);
  outline: none;
}
.class-tile.is-all {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  background: linear-gradient(160deg, #1b1610, #0e0c0a);
}
.asc-grid-visual {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}
.asc-tile img {
  height: 150px;
  object-position: center 20%;
}
.asc-tile .badge-featured {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(20, 14, 8, 0.82);
  color: var(--gold-2);
  border: 1px solid rgba(224, 181, 106, 0.4);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
}
.asc-tile.has-build { }
.starter-detail {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #110e0b;
  margin-bottom: 40px;
}
.starter-banner {
  position: relative;
  min-height: 220px;
  background: #0a0806 center/cover no-repeat;
}
.starter-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8,6,5,0.1), rgba(8,6,5,0.88) 85%);
}
.starter-banner-copy {
  position: relative;
  z-index: 1;
  padding: 48px 24px 20px;
}
.starter-banner-copy h3 {
  margin: 0 0 4px;
  font-family: var(--font-serif);
  font-size: 32px;
  color: var(--gold-2);
}
.starter-banner-copy .class-line { color: var(--ink-dim); margin-bottom: 8px; }
.starter-body { padding: 8px 24px 28px; display: grid; gap: 22px; }
.starter-body h4 {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  color: var(--gold-2);
  font-size: 18px;
}
.starter-empty {
  color: var(--ink-dim);
  font-size: 14px;
}
.skill-board-starter { display: grid; gap: 10px; }
.skill-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
.skill-row .gem-icons { padding-top: 0; }
.tip-target {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: inherit;
  text-decoration: none;
  border-radius: 8px;
}
.tip-target:hover, .tip-target:focus-visible {
  outline: 1px solid rgba(224, 181, 106, 0.5);
  outline-offset: 2px;
}
.starter-links { display: flex; flex-wrap: wrap; gap: 8px; }
.starter-links a {
  color: var(--gold-2);
  text-decoration: none;
  border: 1px solid rgba(224, 181, 106, 0.3);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
}
.starter-links a:hover { background: rgba(224, 181, 106, 0.1); }
.starter-art-credit { font-size: 12px; color: var(--ink-dim); margin: 0; }

/* Tooltips — in-game PoE2 style, shown with Alt + hover */
[data-tip] { cursor: help; }

.poe-tooltip {
  position: fixed;
  z-index: 120;
  width: min(520px, calc(100vw - 16px));
  max-height: min(86vh, 760px);
  overflow: auto;
  background: #050606;
  border: 1px solid #161616;
  border-radius: 0;
  padding: 10px 16px 14px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.72);
  color: #f0f0f0;
  font-family: var(--font-sans), "Noto Sans TC", sans-serif;
  font-size: 13px;
  line-height: 1.4;
  pointer-events: none;
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}
.poe-tooltip.has-media { padding-right: 16px; }
.poe-tooltip-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  min-height: 28px;
  margin: 0 0 4px;
}
.poe-tooltip.has-media .poe-tooltip-titles,
.poe-tooltip.has-media .poe-tooltip-tags,
.poe-tooltip.has-media .poe-tooltip-props,
.poe-tooltip.has-media .poe-tooltip-req {
  padding-right: 148px;
}
.poe-tooltip-titles { min-width: 0; }
.poe-tooltip-top h3 {
  margin: 0;
  font-family: var(--font-sans), "Noto Sans TC", sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: #2ac4ba;
  letter-spacing: 0.01em;
  line-height: 1.25;
}
.poe-tooltip-type {
  margin: 1px 0 0;
  color: #a3a39c;
  font-size: 13px;
}
.poe-tooltip-media {
  position: absolute;
  top: 10px;
  right: 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  pointer-events: none;
}
.poe-tooltip-art {
  width: 92px;
  height: 92px;
  object-fit: cover;
  object-position: right center;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #1a1a1a;
  background: #0a0a0a;
}
.poe-tooltip-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
  image-rendering: auto;
}
.poe-tooltip-tags {
  margin: 0 0 8px;
  color: #8d8d86;
  font-size: 12px;
  letter-spacing: 0.01em;
}
.poe-tooltip-props { margin: 0 0 2px; }
.poe-tooltip-props p,
.poe-tooltip-req {
  margin: 0;
  color: #f2f2f2;
}
.poe-tooltip-num { color: #5ec8e8; }
.poe-tooltip-flavour {
  margin: 10px 8px 8px;
  color: #c4b48a;
  font-style: normal;
  text-align: center;
  line-height: 1.55;
}
.poe-tooltip-sec {
  margin: 8px 0 2px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: #d8d8e4;
  text-align: center;
}
.poe-tooltip-mod {
  margin: 0 0 1px;
  color: #8a8af8;
  text-align: center;
}
.poe-tooltip-mod.is-property {
  color: #f2f2f2;
  text-align: center;
}
.poe-tooltip-mod.is-property .poe-tooltip-num { color: #5ec8e8; }
.poe-tooltip-quality-label {
  margin: 8px 0 2px;
  color: #d8d0c0;
  font-size: 13px;
  letter-spacing: 0;
  text-align: center;
}
.poe-tooltip-mod.is-quality { color: #8a8af8; }
.poe-tooltip-footer {
  margin: 10px 0 0;
  color: #8a8a8a;
  font-size: 13px;
  text-align: center;
}
.poe-tooltip-en {
  margin: 4px 0 0;
  color: #8a8a8a;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-align: center;
  text-transform: uppercase;
}

@media (max-width: 720px) {
  .starter-banner-copy h3 { font-size: 24px; }
  .poe-tooltip { width: min(100vw - 12px, 520px); font-size: 12px; }
  .poe-tooltip-art { width: 72px; height: 72px; }
  .poe-tooltip-icon { width: 40px; height: 40px; }
  .poe-tooltip.has-media .poe-tooltip-titles,
  .poe-tooltip.has-media .poe-tooltip-tags,
  .poe-tooltip.has-media .poe-tooltip-props,
  .poe-tooltip.has-media .poe-tooltip-req { padding-right: 120px; }
  .class-tile img { height: 110px; }
}

.starter-picker-label { margin: 0 0 10px; font-family: var(--font-serif); font-size: 18px; color: var(--gold-2); }
