:root {
  color-scheme: dark;
  --bg: #071013;
  --panel: #111a1e;
  --panel-2: #17252a;
  --ink: #f4f0e8;
  --muted: #aebbc0;
  --line: rgba(244, 240, 232, 0.14);
  --teal: #64d4dd;
  --teal-bright: #8ff8ff;
  --gold: #f0b869;
  --gold-bright: #ffe3a2;
  --gold-dark: #9b5c21;
  --rose: #d56b8c;
  --green: #83d77f;
  --violet: #8f94ff;
  --rune: rgba(143, 148, 255, 0.34);
  --aether-line: rgba(100, 212, 221, 0.38);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  --glow: 0 0 26px rgba(100, 212, 221, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

* {
  box-sizing: border-box;
}

html,
body {
  overflow-x: hidden;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px) 0 0 / 72px 72px,
    linear-gradient(0deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px) 0 0 / 72px 72px,
    radial-gradient(circle at top left, rgba(100, 212, 221, 0.16), transparent 34rem),
    linear-gradient(135deg, #061014 0%, #10191f 44%, #241a28 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  position: relative;
  isolation: isolate;
  min-height: 2.5rem;
  border: 1px solid rgba(255, 227, 162, 0.68);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 247, 207, 0.7), transparent 18%),
    linear-gradient(180deg, #ffd887 0%, #e49b3f 46%, #a96524 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.52),
    inset 0 -2px 0 rgba(78, 41, 13, 0.42),
    0 8px 18px rgba(216, 149, 66, 0.16);
  color: #1b1008;
  font-weight: 900;
  cursor: pointer;
  text-shadow: 0 1px 0 rgba(255, 237, 181, 0.44);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
  overflow: hidden;
}

button::after {
  position: absolute;
  inset: -40% auto -40% -72%;
  z-index: -1;
  width: 34%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.44), transparent);
  content: "";
  transform: skewX(-18deg);
  transition: left 1200ms cubic-bezier(0.16, 0.76, 0.24, 1);
}

button:hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.58),
    inset 0 -2px 0 rgba(78, 41, 13, 0.42),
    0 0 0 1px rgba(255, 227, 162, 0.2),
    0 12px 26px rgba(216, 149, 66, 0.24);
  filter: brightness(1.08) saturate(1.08);
  transform: translateY(-1px);
}

button:hover::after {
  left: 128%;
}

button:active {
  transform: translateY(1px);
}

button.ghost {
  border-color: rgba(100, 212, 221, 0.26);
  background:
    linear-gradient(180deg, rgba(143, 148, 255, 0.11), transparent),
    rgba(9, 17, 21, 0.66);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 18px rgba(100, 212, 221, 0.06);
  color: var(--ink);
  text-shadow: none;
}

.shell {
  width: min(1500px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(190px, 0.54fr);
  gap: 20px;
  align-items: stretch;
  min-height: 208px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(240, 184, 105, 0.09), transparent 32%, rgba(100, 212, 221, 0.1)),
    linear-gradient(110deg, rgba(17, 26, 30, 0.96), rgba(23, 37, 42, 0.72)),
    url("assets/aetheryte-compass.svg") right -72px center / 344px no-repeat;
  box-shadow: var(--shadow), var(--glow);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(22px, 4vw, 51px);
  min-width: 0;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--teal-bright);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 100%;
  margin-bottom: 14px;
  font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: clamp(2.05rem, 4.7vw, 4.05rem);
  font-weight: 700;
  line-height: 0.96;
  letter-spacing: 0;
  white-space: nowrap;
  text-shadow: 0 0 22px rgba(100, 212, 221, 0.13), 0 2px 0 rgba(0, 0, 0, 0.22);
}

h2 {
  margin-bottom: 16px;
  font-size: 1.08rem;
}

h3 {
  margin-bottom: 0;
  font-size: 1rem;
}

.lede {
  max-width: 64ch;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.25vw, 1.18rem);
  line-height: 1.68;
  overflow-wrap: break-word;
}

.hero-art {
  display: grid;
  place-items: center;
  padding: 22px;
  min-width: 0;
}

.hero-art img {
  width: min(100%, 240px);
  filter:
    drop-shadow(0 0 18px rgba(143, 148, 255, 0.28))
    drop-shadow(0 22px 30px rgba(0, 0, 0, 0.36));
}

.dashboard-top,
.control-panel,
.stats,
.workspace {
  margin-top: 18px;
}

.dashboard-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 18px;
  align-items: stretch;
}

.current-card {
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--aether-line);
  border-radius: 8px;
  background:
    linear-gradient(120deg, rgba(100, 212, 221, 0.16), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    rgba(17, 26, 30, 0.92);
  box-shadow: var(--shadow), var(--glow);
}

.current-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  gap: 20px;
  align-items: start;
}

.current-summary > div:first-child {
  min-height: 174px;
}

.current-title-row {
  display: flex;
  gap: 10px;
  align-items: start;
  max-width: 100%;
  margin-bottom: 10px;
}

.current-card h2 {
  min-width: 0;
  margin-bottom: 0;
  font-size: clamp(1.7rem, 4vw, 3rem);
  line-height: 1.04;
}

.quest-source-link {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 76px;
  height: 34px;
  margin-top: 0.16em;
  border: 1px solid rgba(100, 212, 221, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(143, 148, 255, 0.11), transparent),
    rgba(9, 17, 21, 0.76);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 18px rgba(100, 212, 221, 0.08);
  color: var(--teal-bright);
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
}

.quest-source-link:hover {
  border-color: rgba(100, 212, 221, 0.72);
  color: var(--gold-bright);
  text-decoration: none;
  transform: translateY(-1px);
}

.current-description {
  max-width: 82ch;
  margin-bottom: 16px;
  color: var(--muted);
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.current-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 10px;
  margin: 16px 0 0;
}

.current-facts div {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(100, 212, 221, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(100, 212, 221, 0.06), transparent),
    rgba(255, 255, 255, 0.035);
}

.current-facts dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.current-facts dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.current-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(94px, 1fr));
  gap: 10px;
  align-self: start;
  margin-top: 144px;
}

button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.8) brightness(0.75);
  opacity: 0.58;
}

.control-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 16px;
  border: 1px solid rgba(240, 184, 105, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(240, 184, 105, 0.045), transparent),
    rgba(17, 26, 30, 0.86);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
}

label,
.stat-label,
.segment-era {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  margin-top: 7px;
  border: 1px solid rgba(100, 212, 221, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    #0c1518;
  color: var(--ink);
  outline: none;
}

input,
select {
  min-height: 2.6rem;
  padding: 0 12px;
}

textarea {
  min-height: 116px;
  padding: 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal-bright);
  box-shadow: 0 0 0 3px rgba(100, 212, 221, 0.16), 0 0 18px rgba(100, 212, 221, 0.14);
}

.actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(96px, 1fr));
  gap: 10px;
  align-content: end;
}

.actions > button,
.field-grid > label,
.stats article,
.current-card,
.side-panel,
.segment {
  min-width: 0;
}

.action-status {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.stats {
  display: grid;
  grid-template-columns:
    minmax(145px, 1.05fr)
    minmax(175px, 1.1fr)
    minmax(112px, 0.72fr)
    minmax(112px, 0.72fr)
    minmax(250px, 1.55fr);
  gap: 14px;
}

.stats article,
.questlines,
.side-panel {
  border: 1px solid rgba(244, 240, 232, 0.13);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent),
    rgba(17, 26, 30, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.stats article {
  display: grid;
  grid-template-rows: 20px minmax(52px, 1fr) 20px;
  align-content: start;
  height: 146px;
  min-width: 0;
  padding: 18px;
  overflow: hidden;
}

.stats strong {
  display: flex;
  align-items: center;
  min-width: 0;
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.3rem);
}

#nextTarget {
  --next-target-size: clamp(1.25rem, 2.1vw, 2rem);
  display: flex;
  align-items: center;
  height: 2.16em;
  font-size: var(--next-target-size);
  line-height: 1.08;
  overflow: hidden;
  white-space: normal;
  overflow-wrap: anywhere;
}

#nextTarget::before {
  content: "";
  display: block;
}

.stats small {
  align-self: end;
  color: var(--muted);
  height: 20px;
  line-height: 1.25;
  overflow: hidden;
}

.meter {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(100, 212, 221, 0.08);
  background: rgba(255, 255, 255, 0.09);
}

.meter span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--gold), var(--rose));
  box-shadow: 0 0 14px rgba(100, 212, 221, 0.28);
  transition: width 180ms ease;
}

.meter.small {
  height: 7px;
}

.workspace {
  display: block;
}

.questlines,
.side-panel {
  padding: 16px;
}

.section-heading {
  display: flex;
  gap: 18px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 12px;
}

.segment-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.segment {
  padding: 14px;
  border: 1px solid rgba(100, 212, 221, 0.13);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(100, 212, 221, 0.07), transparent 44%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.segment.complete {
  border-color: rgba(131, 215, 127, 0.46);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 0 18px rgba(131, 215, 127, 0.08);
}

.segment-top,
.segment-controls,
.segment-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.segment-era {
  margin-bottom: 4px;
  color: var(--teal-bright);
}

.complete-button {
  width: 88px;
  min-height: 2.15rem;
  padding: 0 10px;
  font-size: 0.78rem;
}

.segment-meta {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin: 12px 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.segment-meta span {
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(100, 212, 221, 0.1);
  background: rgba(255, 255, 255, 0.07);
}

.segment-controls {
  margin-bottom: 10px;
}

.progress-input {
  flex: 1;
  height: 18px;
  padding: 0;
  border: 0;
  background:
    linear-gradient(90deg, var(--teal-bright), var(--gold), var(--rose)) 0 50% / var(--range-progress, 0%) 7px no-repeat,
    linear-gradient(90deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.08)) 0 50% / 100% 7px no-repeat;
  cursor: pointer;
  appearance: none;
}

.progress-input::-webkit-slider-runnable-track {
  height: 18px;
  border-radius: 999px;
  background: transparent;
}

.progress-input::-webkit-slider-thumb {
  width: 20px;
  height: 20px;
  margin-top: -1px;
  border: 2px solid rgba(255, 255, 255, 0.86);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff 0 14%, var(--teal-bright) 15% 48%, #2fb2bd 49% 100%);
  box-shadow: 0 0 14px rgba(100, 212, 221, 0.42), 0 2px 8px rgba(0, 0, 0, 0.34);
  appearance: none;
}

.progress-input::-moz-range-track {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.progress-input::-moz-range-progress {
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal-bright), var(--gold), var(--rose));
}

.progress-input::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.86);
  border-radius: 50%;
  background: var(--teal-bright);
  box-shadow: 0 0 14px rgba(100, 212, 221, 0.42);
}

.number-input {
  width: 76px;
}

.side-panel {
  display: grid;
  gap: 22px;
}

.milestones {
  display: grid;
  gap: 10px;
}

.milestone {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.dot {
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border: 2px solid var(--teal-bright);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(100, 212, 221, 0.28);
}

.milestone.done .dot {
  border-color: var(--green);
  background: var(--green);
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 160px) minmax(120px, 160px) minmax(240px, auto);
  gap: 20px;
  align-items: center;
  margin-top: 22px;
  padding: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.footer-copy {
  display: grid;
  gap: 8px;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--gold);
  font-weight: 800;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.footer-actions {
  display: contents;
}

.support-link {
  display: inline-grid;
  align-items: center;
  place-items: center;
  justify-self: center;
  width: 150px;
  min-height: 60px;
  padding: 0 20px;
  border: 1px solid rgba(255, 227, 162, 0.68);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 247, 207, 0.7), transparent 18%),
    linear-gradient(180deg, #ffd887 0%, #e49b3f 46%, #a96524 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.52),
    inset 0 -2px 0 rgba(78, 41, 13, 0.42),
    0 8px 18px rgba(216, 149, 66, 0.16);
  color: #1b1008;
  font-size: 0.95rem;
  font-weight: 900;
  line-height: 1;
  overflow: hidden;
  position: relative;
  isolation: isolate;
  text-decoration: none;
  text-shadow: 0 1px 0 rgba(255, 237, 181, 0.44);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.site-footer .support-link {
  color: #1b1008;
}

.support-link::after {
  position: absolute;
  inset: -40% auto -40% -72%;
  z-index: -1;
  width: 34%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.44), transparent);
  content: "";
  transform: skewX(-18deg);
  transition: left 1200ms cubic-bezier(0.16, 0.76, 0.24, 1);
}

.support-link:hover::after {
  left: 128%;
}

.about-button {
  font-size: 0.95rem;
  font-weight: 900;
  line-height: 1;
}

.support-link:hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.58),
    inset 0 -2px 0 rgba(78, 41, 13, 0.42),
    0 0 0 1px rgba(255, 227, 162, 0.2),
    0 12px 26px rgba(216, 149, 66, 0.24);
  color: #1b1008;
  filter: brightness(1.08) saturate(1.08);
  text-decoration: none;
  transform: translateY(-1px);
}

.support-link:active {
  transform: translateY(1px);
}

.support-button {
  justify-self: end;
  min-height: 48px;
  min-width: 240px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 8, 10, 0.72);
  backdrop-filter: blur(8px);
}

.modal-backdrop[hidden] {
  display: none;
}

.about-modal {
  width: min(560px, 100%);
  padding: clamp(20px, 4vw, 30px);
  border: 1px solid var(--aether-line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(100, 212, 221, 0.12), transparent 48%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent),
    #111a1e;
  box-shadow: var(--shadow), 0 0 42px rgba(100, 212, 221, 0.18);
}

.modal-top {
  display: flex;
  gap: 14px;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.about-modal h2 {
  margin: 0;
  font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
}

.about-modal p {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.about-modal p:last-child {
  margin-bottom: 0;
}

.modal-close {
  min-width: 86px;
}

@media (max-width: 1120px) {
  .field-grid {
    grid-template-columns: 1fr 1fr;
  }

  .current-facts {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }
}

@media (max-width: 760px) {
  .shell {
    width: 100%;
    padding: 10px 10px 48px;
  }

  .hero,
  .dashboard-top,
  .current-summary,
  .current-facts,
  .control-panel,
  .field-grid,
  .stats,
  .segment-list {
    grid-template-columns: 1fr;
  }

  .current-actions {
    grid-template-columns: 1fr 1fr;
    width: 100%;
    margin-top: 0;
  }

  .hero {
    min-height: auto;
    background:
      linear-gradient(180deg, rgba(17, 26, 30, 0.96), rgba(23, 37, 42, 0.78)),
      url("assets/aetheryte-compass.svg") right -96px top -64px / 248px no-repeat;
  }

  .hero-copy {
    padding: 22px 18px 8px;
    justify-content: start;
    width: 100%;
    max-width: calc(100vw - 86px);
  }

  h1 {
    white-space: normal;
  }

  .lede {
    max-width: 100%;
    white-space: normal;
  }

  .hero-art {
    padding: 0 18px 19px;
    place-items: start;
  }

  .hero-art img {
    width: 120px;
  }

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

  .site-footer {
    grid-template-columns: 1fr;
  }

  .footer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
  }

  .support-link {
    justify-self: auto;
  }

  .support-button {
    justify-self: auto;
    min-width: 0;
  }

}

@media (max-width: 500px) {
  .actions {
    grid-template-columns: repeat(2, 1fr);
  }

  .section-heading,
  .segment-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .number-input {
    width: 100%;
  }
}
