:root {
  color-scheme: dark;
  --ink: #e8eee7;
  --muted: #9aa69d;
  --faint: #68756c;
  --canvas: #111914;
  --panel: #19231d;
  --panel-raised: #202c24;
  --line: rgba(219, 233, 219, 0.12);
  --lime: #d7f06b;
  --orange: #f08b55;
  --green: #a7df9c;
  --red: #f29c87;
  --display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --body: "Avenir Next", Avenir, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 75% 0%, rgba(111, 142, 78, 0.16), transparent 38rem),
    radial-gradient(ellipse at 8% 44%, rgba(185, 100, 55, 0.075), transparent 32rem),
    var(--canvas);
  font-family: var(--body);
  font-size: 14px;
  letter-spacing: 0.01em;
}

button, input, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.12;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
}

.topbar, main, footer {
  width: min(1120px, calc(100% - 64px));
  margin-inline: auto;
}

.topbar {
  height: 76px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.16em;
  text-decoration: none;
}

.brand i, footer i { color: var(--orange); font-style: normal; }

.brand-mark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(215, 240, 107, 0.65);
  border-radius: 50%;
  color: var(--lime);
  font-family: var(--display);
  font-size: 16px;
  font-weight: 600;
}

.privacy, footer {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.privacy { display: flex; align-items: center; gap: 9px; }
.privacy-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px rgba(167, 223, 156, 0.7); }

main { padding-bottom: 70px; }

.hero {
  position: relative;
  display: flex;
  min-height: 300px;
  justify-content: space-between;
  align-items: center;
  padding: 48px 0 51px;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  top: -72px;
  right: 34px;
  width: 310px;
  height: 310px;
  border: 1px solid rgba(215, 240, 107, 0.12);
  border-radius: 50%;
  box-shadow: 0 0 0 27px rgba(215, 240, 107, 0.025), 0 0 0 55px rgba(215, 240, 107, 0.02);
  pointer-events: none;
}

.hero-copy { position: relative; z-index: 1; max-width: 670px; animation: rise-in 650ms both; }
.eyebrow { margin: 0 0 11px; color: var(--lime); font-size: 9px; font-weight: 800; letter-spacing: 0.2em; }
.hero .eyebrow span { margin-right: 9px; color: var(--orange); }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 14px; font-family: var(--display); font-size: clamp(54px, 7vw, 82px); font-weight: 500; line-height: 0.93; letter-spacing: -0.055em; }
h1 em { color: var(--lime); font-weight: 500; }
.intro { max-width: 455px; margin: 0; color: #b4c0b5; font-size: 14px; line-height: 1.75; }

.hero-stamp {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin: 3px 62px 0 20px;
  transform: rotate(8deg);
}

.stamp-ring {
  display: grid;
  width: 94px;
  height: 94px;
  align-content: center;
  justify-items: center;
  border: 1px solid rgba(240, 139, 85, 0.65);
  border-radius: 50%;
  color: var(--orange);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.2em;
  line-height: 1.5;
}

.stamp-ring b { color: var(--ink); font-family: var(--display); font-size: 27px; font-weight: 500; }
.stamp-caption { color: var(--muted); font-size: 8px; font-weight: 750; letter-spacing: 0.13em; white-space: nowrap; }
.stamp-caption b { padding: 0 5px; color: var(--orange); }

.workbench, .results, .export-panel {
  border: 1px solid var(--line);
  background: linear-gradient(140deg, rgba(31, 44, 35, 0.94), rgba(22, 31, 25, 0.96));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.16);
}

.workbench { padding: 29px 34px 25px; border-top: 2px solid var(--lime); }
.section-heading { display: flex; align-items: center; gap: 15px; }
.step {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(215, 240, 107, 0.4);
  border-radius: 50%;
  color: var(--lime);
  font-size: 10px;
  font-weight: 750;
}
.section-heading .eyebrow { margin-bottom: 4px; color: var(--faint); }
h2 { margin: 0; font-family: var(--display); font-size: 26px; font-weight: 500; letter-spacing: -0.025em; }

.url-form { display: flex; gap: 10px; margin-top: 24px; }
.url-field {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 12px;
  height: 52px;
  padding: 0 15px;
  border: 1px solid rgba(219, 233, 219, 0.16);
  background: rgba(8, 13, 10, 0.32);
  transition: border-color 180ms ease, background 180ms ease;
}
.url-field:focus-within { border-color: rgba(215, 240, 107, 0.72); background: rgba(8, 13, 10, 0.55); }
.link-icon { color: var(--orange); font-size: 18px; }
.url-field input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 13px; }
.url-field input::placeholder { color: #69786c; }

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 0 18px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.025em;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, opacity 160ms ease;
}
.button:hover:not(:disabled) { transform: translateY(-2px); }
.button:disabled { cursor: not-allowed; opacity: 0.4; }
.button-primary { min-width: 154px; color: #171c12; background: var(--lime); }
.button-primary:hover:not(:disabled) { background: #e6fa91; }
.microcopy { margin: 12px 0 0 47px; color: var(--faint); font-size: 10px; }
.status { min-height: 0; margin: 0 0 0 47px; color: var(--orange); font-size: 12px; }
.status:not(:empty) { margin-top: 10px; }

.results, .export-panel { margin-top: 20px; padding: 27px 30px 24px; animation: rise-in 400ms both; }
.results-heading { margin-bottom: 20px; }
.text-link { margin-left: auto; color: var(--muted); font-size: 10px; text-decoration-color: rgba(154, 166, 157, 0.5); text-underline-offset: 4px; }
.text-link:hover { color: var(--lime); }

.character-card {
  display: flex;
  min-height: 80px;
  align-items: center;
  gap: 17px;
  padding: 13px 18px;
  border: 1px solid var(--line);
  background: rgba(8, 13, 10, 0.28);
}
.character-emblem { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border: 1px solid rgba(240, 139, 85, 0.4); border-radius: 50%; color: var(--orange); font-size: 17px; }
.character-field { display: flex; min-width: 110px; flex-direction: column; gap: 5px; }
.character-field span, .sim-stat span { color: var(--faint); font-size: 8px; font-weight: 800; letter-spacing: 0.15em; }
.character-field input { width: 100%; padding: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-family: var(--display); font-size: 18px; }
.character-field input:focus { color: var(--lime); }
.character-divider { width: 1px; height: 33px; background: var(--line); }
.sim-stat { display: flex; flex-direction: column; gap: 6px; margin-left: auto; text-align: right; }
.sim-stat strong { color: var(--lime); font-family: var(--display); font-size: 19px; font-weight: 500; }

.list-toolbar { display: flex; align-items: center; gap: 18px; margin: 21px 0 12px; }
.check-control { display: inline-flex; align-items: center; gap: 9px; color: #c1cbc1; font-size: 11px; cursor: pointer; white-space: nowrap; }
.check-control input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.custom-check { display: grid; width: 15px; height: 15px; place-items: center; border: 1px solid #69766b; }
.check-control input:checked + .custom-check { border-color: var(--lime); background: var(--lime); }
.check-control input:checked + .custom-check::after { content: "✓"; color: #182014; font-size: 11px; font-weight: 900; }
.check-control input:focus-visible + .custom-check { outline: 2px solid var(--orange); outline-offset: 2px; }
.search-field { display: flex; width: 220px; height: 34px; align-items: center; gap: 7px; padding: 0 10px; border-bottom: 1px solid var(--line); color: var(--faint); }
.search-field input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 10px; }
.search-field input::placeholder { color: #6e7b71; }
.selection-count { margin-left: auto; color: var(--muted); font-size: 10px; }

.table-wrap { max-height: 430px; overflow: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); scrollbar-color: #465448 transparent; scrollbar-width: thin; }
.items-table { width: 100%; border-collapse: collapse; text-align: left; }
.items-table thead { position: sticky; top: 0; z-index: 1; background: #1b261f; }
.items-table th { height: 37px; color: var(--faint); font-size: 8px; font-weight: 800; letter-spacing: 0.14em; }
.items-table th, .items-table td { padding: 0 13px; }
.items-table th:first-child, .items-table td:first-child { width: 38px; padding-left: 14px; }
.items-table th:last-child, .items-table td:last-child { padding-right: 18px; }
.items-table td { height: 47px; border-top: 1px solid rgba(219, 233, 219, 0.065); color: #bcc7bd; font-size: 11px; }
.items-table tbody tr { transition: background 120ms ease; }
.items-table tbody tr:hover { background: rgba(215, 240, 107, 0.045); }
.items-table td input[type="checkbox"], .items-table th input[type="checkbox"] { width: 14px; height: 14px; accent-color: var(--lime); cursor: pointer; }
.items-table .item-link { color: var(--ink); font-size: 12px; font-weight: 700; text-decoration: none; }
.items-table .item-link img { width: 22px; height: 22px; margin-right: 8px; vertical-align: middle; border: 1px solid rgba(219, 233, 219, 0.18); }
.items-table .item-link ins { text-decoration: none; }
.items-table .item-link:hover { color: var(--lime); }
.items-table .quality-1 { color: #fff; }
.items-table .quality-2 { color: #1eff00; }
.items-table .quality-3 { color: #0070dd; }
.items-table .quality-4 { color: #a335ee; }
.items-table .quality-5 { color: #ff8000; }
.items-table .quality-6 { color: #e6cc80; }
.items-table .quality-7 { color: #00ccff; }
.item-note { display: block; margin-top: 3px; color: var(--faint); font-size: 8px; }
.items-table .slot-cell { color: #9eaaa0; }
.dungeon-row td {
  height: 40px;
  border-top: 1px solid rgba(215, 240, 107, 0.2);
  background: rgba(215, 240, 107, 0.07);
}
.dungeon-row:hover, .boss-row:hover { background: transparent; }
.group-title { color: var(--lime); font-family: var(--display); font-size: 15px; font-weight: 600; }
.group-count { float: right; padding-top: 2px; color: var(--faint); font-size: 8px; font-weight: 800; letter-spacing: 0.13em; }
.boss-row td {
  height: 30px;
  padding-left: 42px;
  border-top: 1px solid rgba(219, 233, 219, 0.055);
  background: rgba(8, 13, 10, 0.22);
  color: #c0cbbf;
}
.boss-row .group-title { color: #c0cbbf; font-family: var(--body); font-size: 9px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.delta { text-align: right; font-variant-numeric: tabular-nums; font-weight: 750; white-space: nowrap; }
.delta.positive { color: var(--green); }
.delta.negative { color: var(--red); }
.delta-column { text-align: right; }
.empty-items { padding: 28px; color: var(--muted); text-align: center; font-size: 12px; }

.build-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-top: 19px; }
.build-row p { margin: 0; color: var(--muted); font-size: 10px; }
.build-spark { margin-right: 7px; color: var(--orange); }
.button-accent { min-height: 42px; color: #1d1710; background: var(--orange); }
.button-accent:hover:not(:disabled) { background: #ffa875; }

.export-panel { border-top: 2px solid var(--orange); }
.export-panel .section-heading { margin-bottom: 18px; }
.export-panel .step { border-color: rgba(240, 139, 85, 0.55); color: var(--orange); }
.export-box { display: flex; gap: 10px; align-items: stretch; }
.export-box textarea { min-height: 89px; flex: 1; resize: vertical; padding: 12px; border: 1px solid var(--line); outline: 0; color: #cad7c6; background: rgba(8, 13, 10, 0.48); font-family: "Cascadia Code", Consolas, monospace; font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
.button-copy { min-width: 120px; align-self: flex-start; color: var(--ink); border-color: rgba(219, 233, 219, 0.25); background: var(--panel-raised); }
.button-copy:hover { border-color: var(--lime); }
.copy-status { min-height: 0; margin: 9px 0 0; color: var(--green); font-size: 10px; }
.export-panel .microcopy { margin-left: 0; }

footer { display: flex; justify-content: space-between; padding: 22px 0 27px; border-top: 1px solid var(--line); font-size: 8px; }

.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 rise-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 760px) {
  .topbar, main, footer { width: min(100% - 36px, 600px); }
  .topbar { height: 64px; }
  .privacy { max-width: 140px; font-size: 7px; line-height: 1.6; }
  .hero { min-height: 270px; padding: 45px 0 38px; }
  .hero-stamp { margin-right: 18px; }
  .hero::after { right: -90px; }
  .stamp-ring { width: 72px; height: 72px; }
  .stamp-caption { font-size: 7px; }
  .workbench { padding: 23px 20px 20px; }
  .results, .export-panel { padding: 22px 18px; }
  .url-form { flex-direction: column; }
  .button-primary { width: 100%; }
  .character-card { flex-wrap: wrap; gap: 12px; }
  .character-emblem { width: 30px; height: 30px; }
  .character-field { min-width: 90px; flex: 1; }
  .character-divider { display: none; }
  .sim-stat { min-width: 100%; flex-direction: row; align-items: center; justify-content: space-between; margin-left: 43px; text-align: left; }
  .list-toolbar { flex-wrap: wrap; gap: 12px; }
  .search-field { order: 3; width: 100%; }
  .selection-count { margin-left: auto; }
  .table-wrap { margin-inline: -8px; }
  .items-table th, .items-table td { padding-inline: 8px; }
  .items-table th:first-child, .items-table td:first-child { width: 31px; padding-left: 9px; }
  .items-table th { font-size: 7px; letter-spacing: 0.08em; }
  .items-table td { height: 45px; font-size: 10px; }
  .items-table .item-link { font-size: 11px; }
  .item-note { font-size: 7px; }
  .build-row { align-items: stretch; flex-direction: column; }
  .build-row .button { width: 100%; }
}

@media (max-width: 430px) {
  .topbar, main, footer { width: calc(100% - 28px); }
  .brand { gap: 7px; font-size: 9px; letter-spacing: 0.12em; }
  .brand-mark { width: 25px; height: 25px; }
  .privacy { max-width: 105px; font-size: 6px; }
  .hero-stamp { display: none; }
  .hero { min-height: 250px; }
  .intro { max-width: 310px; font-size: 13px; }
  h2 { font-size: 22px; }
  .text-link { max-width: 95px; font-size: 8px; text-align: right; }
  .items-table th:nth-child(3), .items-table td:nth-child(3) { display: none; }
  .items-table th:nth-child(4), .items-table td:nth-child(4) { white-space: nowrap; }
  .export-box { flex-direction: column; }
  .button-copy { width: 100%; }
  footer { gap: 12px; font-size: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
