@font-face {
  font-family: CastleSerif;
  src: local("Baskerville"), local("Palatino Linotype"), local("Georgia");
  font-display: swap;
}
:root {
  --ink: #0d1411;
  --panel: rgba(14, 23, 19, 0.94);
  --gold: #c7aa70;
  --gold-bright: #ead6a4;
  --paper: #ece9dc;
  --muted: #a4aca0;
  --line: rgba(190, 177, 137, 0.2);
  --green: #83a78e;
  --red: #c77c68;
  --blue: #6fa5be;
  font-family: Inter, "Avenir Next", system-ui, sans-serif;
  color: var(--paper);
  background: var(--ink);
  color-scheme: dark;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  overflow: hidden;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  color: inherit;
  cursor: pointer;
}
button {
  border: 0;
  background: none;
}
button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
canvas:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 4px;
}
button:hover:not(:disabled) {
  color: var(--gold-bright);
}
a {
  color: var(--gold);
}
svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}
span[data-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  font-family: CastleSerif, Georgia, serif;
  font-weight: 400;
}
kbd {
  font: 10px system-ui;
  color: #b8beaf;
  border: 1px solid #b6c7ab30;
  border-radius: 3px;
  padding: 2px 5px;
  background: #ffffff05;
}
small {
  color: var(--muted);
}
.hidden {
  display: none !important;
}
.eyebrow {
  font-size: 9px;
  letter-spacing: 2.3px;
  font-weight: 600;
  color: var(--gold);
  line-height: 1.7;
}
.rune {
  font-size: 35px;
  color: var(--gold);
  font-family: Georgia, serif;
  font-weight: 400;
  line-height: 1;
}
.icon-button {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #0a110f60;
}
.text-button {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  font-size: 12px;
  padding: 8px 0;
}
.text-button svg {
  width: 16px;
  height: 16px;
}
.primary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 42px;
  padding: 17px 23px;
  background: #d3bb84;
  color: #172019 !important;
  border: 1px solid #ecd4a1;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 20px #0002;
  transition:
    background 0.2s,
    transform 0.2s;
}
.primary:hover {
  background: #e9d4a5;
  transform: translateY(-1px);
}
.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  background: #b8bc9d08;
  font-size: 12px;
}
.secondary:hover {
  background: #b8bc9d12;
}
.danger {
  color: #dc9b85;
  border-color: #a15e4b66;
}
.title-screen {
  position: absolute;
  inset: 0;
  min-height: 540px;
  overflow: auto;
}
.title-art {
  position: absolute;
  inset: 0;
  background: #172821 url("/assets/castle-title.webp") center/cover;
}
.title-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      90deg,
      rgba(8, 18, 15, 0.88) 0%,
      rgba(8, 18, 15, 0.57) 37%,
      rgba(8, 18, 15, 0.06) 73%
    ),
    linear-gradient(
      0deg,
      #0a1412e6,
      transparent 34%,
      transparent 77%,
      #0a14127a
    );
}
.wordmark {
  position: absolute;
  top: 40px;
  left: 5%;
  display: flex;
  align-items: center;
  gap: 15px;
  text-decoration: none;
  color: #e7e3d0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 3.2px;
}
.title-settings {
  position: absolute;
  right: 5%;
  top: 38px;
}
.title-content {
  position: absolute;
  left: 11%;
  top: 50%;
  transform: translateY(-46%);
  max-width: 660px;
}
.title-content .eyebrow {
  display: flex;
  align-items: center;
  gap: 13px;
  font-size: 10px;
  letter-spacing: 2.8px;
}
.title-content .eyebrow > span {
  width: 30px;
  height: 1px;
  background: var(--gold);
}
.title-content h1 {
  font-size: clamp(60px, 7.5vw, 112px);
  line-height: 1.01;
  letter-spacing: -2.6px;
  margin: 27px 0 25px;
  text-shadow: 0 3px 25px #0002;
}
.title-content p {
  color: #d0d3c3;
  line-height: 1.9;
  font-size: 14px;
}
.title-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 15px;
  margin-top: 34px;
}
.title-actions > .text-button {
  font-size: 12px;
  color: #c2c7b7;
}
.title-actions .primary:not(.hidden) + .primary {
  background: #0e1b15b0;
  color: #e1cf9e !important;
  border-color: #c6b78050;
  padding: 12px 23px;
}
.title-footer {
  position: absolute;
  bottom: 28px;
  left: 5%;
  right: 5%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font-size: 8px;
  letter-spacing: 1.7px;
  color: #a6b0a0;
}
.title-footer .text-button {
  font-size: 10px;
  letter-spacing: 0.4px;
}
.version {
  opacity: 0.6;
}
.save-summary {
  font-size: 10px;
  color: #a4b4a2;
  margin-top: 14px;
}
.ambient-particles {
  pointer-events: none;
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.ambient-particles i {
  position: absolute;
  width: 2px;
  height: 2px;
  background: #e2c78b;
  box-shadow: 0 0 7px #dba85b;
  animation: float 10s linear infinite;
  opacity: 0;
}
@keyframes float {
  0% {
    transform: translate(0, 40px);
    opacity: 0;
  }
  25% {
    opacity: 0.5;
  }
  80% {
    opacity: 0.3;
  }
  100% {
    transform: translate(60px, -160px);
    opacity: 0;
  }
}
.game-screen {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #101713;
}
#world {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  outline: none;
}
.world-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 80px 8px #03090670;
}
.game-toolbar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: calc(5px + env(safe-area-inset-top))
    max(6px, env(safe-area-inset-right)) 5px max(6px, env(safe-area-inset-left));
  background: #101b16f5;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 3px 16px #0005;
}
.toolbar-scroll {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: #73846b #101b16;
  touch-action: pan-x;
}
.toolbar-settings {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
}
.utility-bar,
.quickbar {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 3px;
}
.quickbar {
  border-left: 1px solid var(--line);
  padding-left: 8px;
}
.utility-bar button,
.spell-slot {
  width: 44px;
  height: 46px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  position: relative;
  border: 1px solid #b6bd9426;
  background: linear-gradient(150deg, #ffffff08, #0002);
  color: #c1c7b5;
  touch-action: manipulation;
}
.utility-bar button:hover,
.spell-slot:hover,
.spell-slot.selected {
  border-color: #d4b978;
  background: #c8ad7020;
}
.utility-bar svg {
  width: 17px;
  height: 17px;
  color: var(--gold);
}
.utility-bar small,
.spell-slot small {
  max-width: 40px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 8.5px;
  line-height: 1.2;
}
.spell-slot > span[data-icon] {
  color: var(--spell-color, #d7c9a5);
  filter: drop-shadow(0 0 4px var(--spell-color, #d7c9a5));
}
.spell-slot svg {
  width: 19px;
  height: 19px;
  stroke-width: 1.2;
}
.spell-slot > kbd {
  position: absolute;
  top: 2px;
  left: 3px;
  border: 0;
  background: none;
  font-size: 6px;
  padding: 0;
  color: #acb2a1;
}
.spell-slot .mana-cost {
  position: absolute;
  top: 2px;
  right: 3px;
  font-size: 6px;
  color: #82afbc;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.target-banner {
  position: absolute;
  top: calc(var(--toolbar-height, 54px) + 10px);
  width: max-content;
  max-width: calc(100vw - 24px);
  left: 50%;
  transform: translateX(-50%);
  padding: 11px 18px;
  border: 1px solid #c8b06f66;
  background: #17231be8;
  color: #e3cf99;
  font-size: 11px;
  text-align: center;
  box-shadow: 0 2px 20px #0005;
}
.target-banner kbd {
  margin-left: 12px;
}
.hover-card {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  padding: 9px 15px;
  background: #0d1813e8;
  border: 1px solid var(--line);
  font-size: 10px;
  pointer-events: none;
  color: #d3d8c6;
  white-space: nowrap;
}
.hover-card strong {
  color: var(--gold-bright);
  font-weight: 500;
}
.notification {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  background: #1c2a20f7;
  border: 1px solid #aaad7b70;
  box-shadow: 0 4px 25px #0007;
  padding: 12px 21px;
  z-index: 30;
  font-size: 12px;
  max-width: 90vw;
  text-align: center;
  color: #e1d5b3;
}
dialog {
  padding: 0;
  border: 1px solid #bca7735e;
  background: #111b16;
  color: var(--paper);
  max-width: min(850px, calc(100vw - 40px));
  width: 760px;
  max-height: calc(100dvh - 80px);
  box-shadow: 0 30px 130px #000b;
  overflow: auto;
}
dialog::backdrop {
  background: #030b08b8;
  backdrop-filter: blur(6px);
}
.modal-shell {
  padding: 30px;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
  margin-bottom: 23px;
  gap: 20px;
}
.modal-header h2 {
  font-size: 30px;
  margin-top: 6px;
}
.modal-header .eyebrow {
  font-size: 8px;
}
.modal-header .icon-button {
  flex-shrink: 0;
}
.modal-copy {
  font-size: 13px;
  line-height: 1.9;
  color: #b8c4b0;
}
.modal-copy p + p {
  margin-top: 13px;
}
.modal-copy a {
  white-space: normal;
}
.form-field {
  display: block;
  margin: 20px 0;
}
.form-field > span {
  display: block;
  font-size: 10px;
  color: #b9c4af;
  letter-spacing: 1px;
  margin-bottom: 9px;
}
.form-field input,
.form-field select {
  width: 100%;
  padding: 13px;
  background: #09130f;
  border: 1px solid #bcc39930;
  border-radius: 0;
  color: #e4e5d4;
  font-size: 13px;
}
.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 23px;
}
.tabs {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  padding-bottom: 13px;
  margin-bottom: 20px;
}
.tabs button {
  padding: 7px 12px;
  font-size: 11px;
  color: #a9b69f;
  border: 1px solid transparent;
}
.tabs button.active {
  color: var(--gold-bright);
  border: 1px solid #c6b37e44;
  background: #c6b37e0a;
}
.item-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.item-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 11px;
  background: #afba9c06;
  border: 1px solid #b0b5901b;
}
.item-icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 38px;
  height: 42px;
  color: var(--gold);
  background: radial-gradient(ellipse, #c1b37a12, transparent);
  border: 1px solid #a9b89b1a;
}
.item-row .item-info {
  flex: 1;
  min-width: 0;
}
.item-name {
  font-family: CastleSerif, Georgia, serif;
  font-size: 15px;
  line-height: 1.4;
}
.item-name.enchanted,
.item-name.rare {
  color: #a2bbdb;
}
.item-name.legendary {
  color: #dec27d;
}
.item-description {
  font-size: 9px;
  line-height: 1.7;
  color: #97a78f;
  margin-top: 3px;
}
.item-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 160px;
}
.item-actions button {
  padding: 6px 9px;
  border: 1px solid #b4b59430;
  font-size: 9px;
}
.item-actions button:hover {
  background: #c1b77b10;
}
.empty-message {
  padding: 25px 5px;
  color: #9cae95;
  font-size: 12px;
  line-height: 1.8;
}
.section-caption {
  font-size: 10px;
  color: #93a88e;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  line-height: 1.7;
}
.spell-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.spell-card {
  padding: 16px;
  border: 1px solid #b3ba9430;
  background: linear-gradient(135deg, #b4c29d09, transparent);
  display: flex;
  gap: 14px;
  text-align: left;
  align-items: flex-start;
}
.spell-card > span:first-child {
  color: var(--spell-color, var(--gold));
  display: inline-flex;
  filter: drop-shadow(0 0 9px #91b1e444);
}
.spell-card > span:first-child svg {
  width: 30px;
  height: 30px;
}
.spell-card h3 {
  font-size: 18px;
}
.spell-card p {
  color: #9eb096;
  font-size: 10px;
  line-height: 1.8;
  margin-top: 6px;
}
.spell-card small {
  font-size: 8px;
  color: var(--gold);
  display: block;
  margin-top: 7px;
}
.spell-card.locked {
  opacity: 0.34;
}
.map-large {
  width: 100%;
  height: auto;
  max-height: 55vh;
  image-rendering: pixelated;
  object-fit: contain;
  background: #08110e;
  border: 1px solid var(--line);
}
.map-legend {
  display: flex;
  justify-content: center;
  gap: 20px;
  font-size: 9px;
  color: #a8b7a0;
  margin-top: 15px;
}
.map-legend i {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 6px;
}
.journal-entry {
  position: relative;
  padding: 0 0 24px 25px;
  margin-left: 4px;
  border-left: 1px solid #a9b39330;
  font-size: 12px;
  line-height: 1.9;
  color: #b5c1ac;
}
.journal-entry:before {
  content: "";
  position: absolute;
  left: -4px;
  top: 7px;
  width: 6px;
  height: 6px;
  transform: rotate(45deg);
  background: var(--gold);
}
.journal-entry:last-child {
  border-color: transparent;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 20px;
}
.stat-card {
  padding: 15px 10px;
  border: 1px solid var(--line);
  text-align: center;
}
.stat-card strong {
  font: 25px Georgia;
  color: var(--gold-bright);
  display: block;
}
.stat-card small {
  font-size: 8px;
  letter-spacing: 1px;
  display: block;
  margin-top: 7px;
  text-transform: uppercase;
}
.character-top {
  display: flex;
  align-items: center;
  gap: 25px;
}
.character-top img {
  width: 105px;
  height: 135px;
  object-fit: cover;
  border: 1px solid var(--line);
}
.character-top h3 {
  font-size: 27px;
}
.character-top p {
  color: #a5b59c;
  font-size: 12px;
  line-height: 1.8;
  margin-top: 8px;
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.settings-row small {
  display: block;
  font-size: 10px;
  line-height: 1.8;
  margin-top: 4px;
}
.settings-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--gold);
  flex-shrink: 0;
}
.settings-row input[type="range"] {
  width: 140px;
  accent-color: var(--gold);
}
.help-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
}
.help-grid h3 {
  font-size: 20px;
  margin: 0 0 12px;
}
.key-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin: 10px 0;
  font-size: 11px;
  color: #b4c1a9;
}
.key-row kbd {
  font-size: 9px;
}
.help-note {
  padding: 17px;
  border: 1px solid var(--line);
  background: #d0b97906;
  margin-top: 22px;
  font-size: 11px;
  line-height: 1.8;
  color: #adbea4;
}
.shop-services {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.shop-services button {
  font-size: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
}
.end-state {
  text-align: center;
  padding: 15px 20px 22px;
}
.end-state > .rune {
  font-size: 65px;
  display: block;
  margin: 0 auto 20px;
}
.end-state h3 {
  font-size: 36px;
  margin-bottom: 16px;
}
.end-state p {
  font-size: 13px;
  color: #afbea4;
  line-height: 1.9;
}
.end-state .button-row {
  justify-content: center;
}
.muted {
  color: var(--muted);
}
@media (max-width: 800px) {
  .title-content {
    left: 8%;
    top: 48%;
  }
  .title-content h1 {
    font-size: 72px;
  }
  .title-content p {
    font-size: 12px;
  }
  .title-footer > span:first-child {
    max-width: 150px;
    line-height: 1.8;
  }
  .title-footer .version {
    display: none;
  }
  .title-art {
    background-position: 60% center;
  }
  .modal-shell {
    padding: 22px;
  }
  dialog {
    max-height: calc(100dvh - 30px);
    max-width: calc(100vw - 24px);
  }
  .modal-header h2 {
    font-size: 27px;
  }
  .spell-grid {
    grid-template-columns: 1fr;
  }
  .item-actions {
    max-width: 110px;
  }
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .help-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .title-footer {
    bottom: 20px;
  }
}
@media (max-width: 420px) {
  .title-content h1 {
    font-size: 62px;
  }
  .title-content .eyebrow {
    font-size: 8px;
    letter-spacing: 1.7px;
  }
  .wordmark {
    font-size: 10px;
    letter-spacing: 2px;
    top: 27px;
  }
  .title-settings {
    top: 27px;
  }
  .title-content p {
    max-width: 285px;
  }
  .desktop-break {
    display: none;
  }
  .title-footer .text-button {
    max-width: 130px;
    text-align: right;
    font-size: 8px;
  }
  .item-row {
    gap: 8px;
    padding: 8px;
  }
  .item-name {
    font-size: 13px;
  }
  .item-icon {
    width: 28px;
  }
  .item-actions {
    max-width: 85px;
  }
  .item-actions button {
    font-size: 8px;
    padding: 5px;
  }
  .character-top img {
    width: 80px;
    height: 110px;
  }
  .character-top {
    gap: 15px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .ambient-particles {
    display: none;
  }
}
.item-art {
  display: block;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  background-image: url("/assets/items.webp");
  background-size: 400% 400%;
  background-repeat: no-repeat;
}
.item-icon {
  width: 46px;
  height: 46px;
}
.item-icon:has(.item-art) {
  border: 0;
  background: none;
}

dialog[data-view="new"] {
  width: 1040px;
  max-width: calc(100vw - 36px);
}
dialog[data-view="inventory"],
dialog[data-view="shop"] {
  width: 1180px;
  max-width: calc(100vw - 36px);
}
.creation-steps {
  display: flex;
  list-style: none;
  gap: 30px;
  padding: 0;
  margin: 0 0 26px;
  font-size: 11px;
  color: var(--muted);
}
.creation-steps li {
  display: flex;
  gap: 9px;
  align-items: center;
}
.creation-steps b {
  font:
    18px CastleSerif,
    Georgia,
    serif;
  color: #6f7b6b;
}
.creation-steps .current,
.creation-steps .current b {
  color: var(--gold-bright);
}
.creation-steps .complete b {
  color: var(--green);
}
.creation-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 34px;
}
.creation-identity {
  border-right: 1px solid var(--line);
  padding-right: 25px;
  text-align: center;
}
.creation-portrait-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 0.86;
  border: 1px solid #baa77370;
  background: radial-gradient(ellipse at 50% 40%, #384332, #111a14);
  overflow: hidden;
}
.creation-portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.creation-portrait-rune {
  position: absolute;
  bottom: 4px;
  left: 0;
  right: 0;
  color: var(--gold-bright);
  font-size: 32px;
  text-shadow: 0 2px 9px #000;
}
.creation-identity h3 {
  font-size: 23px;
  margin: 14px 0 4px;
  overflow-wrap: anywhere;
}
.creation-identity > p,
.creation-note {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}
.creation-gender {
  border: 0;
  padding: 0;
  margin: 20px 0 10px;
  display: flex;
  justify-content: center;
  gap: 7px;
}
.creation-gender legend {
  font-size: 10px;
  margin-bottom: 10px;
  color: var(--muted);
}
.creation-gender label {
  border: 1px solid var(--line);
  padding: 9px 12px;
  display: flex;
  gap: 6px;
  cursor: pointer;
  font-size: 11px;
}
.creation-gender label:has(:checked) {
  border-color: var(--gold);
  background: #cab27712;
}
.creation-gender input {
  accent-color: var(--gold);
  margin: 0;
}
.creation-identity .creation-note {
  font-size: 9px;
}
.custom-icon-upload {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  padding: 10px 6px;
  margin-top: 18px;
  font-size: 10px;
  color: var(--gold);
  cursor: pointer;
}
.custom-icon-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.custom-icon-upload:focus-within {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}
#icon-filename {
  font-size: 9px;
  line-height: 1.7;
  display: block;
  color: var(--muted);
  margin-top: 8px;
  overflow-wrap: anywhere;
}
#clear-custom-icon {
  margin-top: 10px;
  font-size: 9px;
}
.creation-name {
  margin: 0 0 24px;
}
.creation-name input {
  font-size: 18px;
  font-family: CastleSerif, Georgia, serif;
}
.creation-section-title {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.creation-section-title h3 {
  font-size: 23px;
}
.creation-section-title span {
  font-size: 9px;
  color: var(--muted);
}
.attribute-bars {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 17px;
}
.attribute-column {
  text-align: center;
  min-width: 0;
}
.attribute-column output {
  display: block;
  color: var(--gold-bright);
  font:
    26px CastleSerif,
    Georgia,
    serif;
  margin-bottom: 8px;
}
.attribute-meter {
  width: 43px;
  height: 155px;
  position: relative;
  margin: auto;
  border: 1px solid #c4b58266;
  background:
    repeating-linear-gradient(
      to top,
      transparent 0,
      transparent calc(25% - 1px),
      #b8b99325 calc(25% - 1px),
      #b8b99325 25%
    ),
    #0b1510;
}
.attribute-meter i {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: var(--fill, 0%);
  background: linear-gradient(0deg, #6b8b75, #bfca9e);
  pointer-events: none;
  box-shadow: 0 0 18px #97bc9215;
}
.attribute-meter input {
  writing-mode: vertical-lr;
  direction: rtl;
  width: 100%;
  height: 100%;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: ns-resize;
  position: relative;
  display: block;
}
.attribute-meter input::-webkit-slider-thumb {
  appearance: none;
  height: 6px;
  width: 51px;
  border: 1px solid var(--gold-bright);
  background: #ead6a4;
  box-shadow: 0 2px 8px #0008;
}
.attribute-meter input::-moz-range-thumb {
  height: 5px;
  width: 49px;
  border: 1px solid var(--gold-bright);
  border-radius: 0;
  background: var(--gold-bright);
}
.available-meter {
  opacity: 0.9;
}
.available-meter i {
  background: linear-gradient(0deg, #7f693d, #d9be7e);
}
.attribute-column > label,
.attribute-column > strong {
  display: block;
  font-size: 11px;
  font-weight: 500;
  margin-top: 12px;
}
.attribute-column > span {
  display: block;
  font-size: 9px;
  color: var(--muted);
  line-height: 1.65;
  margin-top: 7px;
}
.creation-stat-preview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 20px 0 24px;
  padding: 13px 0;
  border-block: 1px solid var(--line);
  text-align: center;
}
.creation-stat-preview strong {
  display: block;
  font:
    22px CastleSerif,
    Georgia,
    serif;
}
.creation-stat-preview span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  margin-top: 4px;
}
.difficulty-options {
  border: 0;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.difficulty-options legend {
  font:
    21px CastleSerif,
    Georgia,
    serif;
  margin-bottom: 13px;
}
.difficulty-card {
  position: relative;
  text-align: center;
  padding: 15px 8px 12px;
  border: 1px solid var(--line);
  cursor: pointer;
}
.difficulty-card input {
  position: absolute;
  top: 9px;
  left: 9px;
  accent-color: var(--gold);
  width: 12px;
  height: 12px;
}
.difficulty-card:has(:checked) {
  border-color: var(--gold);
  background: #c7aa7010;
}
.difficulty-symbol {
  display: block;
  width: 19px;
  height: 19px;
  margin: 0 auto 10px;
  background: #7da26c;
}
.difficulty-symbol.easy {
  border-radius: 50%;
}
.difficulty-symbol.intermediate {
  background: #7ca9c3;
}
.difficulty-symbol.difficult {
  transform: rotate(45deg);
  background: #a89ac1;
}
.difficulty-symbol.expert {
  background: #d5ad60;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.difficulty-card strong {
  display: block;
  font-size: 10px;
  font-weight: 500;
}
.difficulty-card small {
  display: block;
  font-size: 8px;
  line-height: 1.7;
  margin-top: 5px;
  color: var(--muted);
}
.creation-advanced {
  margin-top: 18px;
  color: var(--muted);
  font-size: 10px;
}
.creation-advanced summary {
  cursor: pointer;
}
.creation-advanced summary span {
  opacity: 0.7;
  margin-left: 6px;
}
.creation-footer {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 22px;
  margin-top: 26px;
  position: sticky;
  bottom: 0;
  background: #111b16;
  z-index: 2;
  padding-bottom: 6px;
  box-shadow: 0 -12px 20px #111b16;
}
dialog[data-view="new"] .modal-header {
  padding-bottom: 16px;
  margin-bottom: 18px;
}
dialog[data-view="new"] .creation-steps {
  margin-bottom: 20px;
}
dialog[data-view="new"] .creation-name {
  margin-bottom: 18px;
}
.allocation-note {
  font-size: 9px;
  line-height: 1.7;
  color: var(--muted);
  margin: 12px 0 0;
}
.creation-footer > p {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.8;
  max-width: 400px;
}
.creation-footer .primary {
  white-space: nowrap;
  font-size: 11px;
  padding: 16px 22px;
}
.first-spell-intro {
  display: flex;
  align-items: center;
  gap: 17px;
  margin-bottom: 26px;
}
.first-spell-intro img {
  width: 60px;
  height: 70px;
  object-fit: cover;
  border: 1px solid var(--line);
}
.first-spell-intro h3 {
  font-size: 24px;
}
.first-spell-intro p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
  margin-top: 5px;
  max-width: 650px;
}
.first-spell-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.first-spell-card {
  position: relative;
  display: flex;
  gap: 19px;
  padding: 25px 22px;
  border: 1px solid var(--line);
  cursor: pointer;
  min-height: 134px;
}
.first-spell-card:has(:checked) {
  border-color: var(--spell-color);
  background: linear-gradient(120deg, #bfcea015, transparent);
  box-shadow: inset 0 0 32px #b3b5dd08;
}
.first-spell-card input {
  position: absolute;
  top: 12px;
  right: 12px;
  accent-color: var(--spell-color);
}
.spell-choice-sigil {
  color: var(--spell-color);
  padding-top: 4px;
}
.spell-choice-sigil svg {
  width: 33px;
  height: 33px;
}
.first-spell-card strong {
  display: block;
  font:
    22px CastleSerif,
    Georgia,
    serif;
}
.first-spell-card small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
  margin: 7px 0;
  padding-right: 10px;
}
.first-spell-card em {
  color: var(--spell-color);
  font-style: normal;
  font-size: 10px;
}
.inventory-workspace {
  display: grid;
  grid-template-columns: minmax(330px, 0.95fr) minmax(340px, 1.05fr);
  gap: 25px;
}
.paperdoll {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: repeat(6, 80px);
  gap: 5px;
  position: relative;
}
.paperdoll-slot {
  border: 1px solid var(--line);
  background: #aabb9607;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5px;
  font-size: 8px;
  gap: 4px;
  position: relative;
}
.paperdoll-slot > small {
  font-size: 7px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}
.paperdoll-slot > strong {
  font-size: 8px;
  line-height: 1.35;
  font-weight: 400;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.paperdoll-slot > .item-art {
  width: 32px;
  height: 32px;
}
.equipment-art {
  width: 40px;
  height: 40px;
}
.paperdoll-slot > .equipment-art {
  width: 32px;
  height: 32px;
}
.paperdoll-slot.selected {
  border-color: var(--gold-bright);
  background: #d8bb7820;
}
.paperdoll-slot.drop-ready {
  border-color: #acd5ad;
  box-shadow: inset 0 0 16px #a1c6a12a;
}
.paperdoll-slot.empty > svg {
  opacity: 0.25;
  width: 24px;
  height: 24px;
}
.paperdoll-body {
  grid-column: 2 / 5;
  grid-row: 2 / 7;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: radial-gradient(ellipse, #829a6726, transparent 70%);
  pointer-events: none;
}
.paperdoll-body > svg,
.paperdoll-body > img {
  width: 95%;
  height: auto;
  max-height: 260px;
  object-fit: contain;
  filter: drop-shadow(0 12px 10px #0008);
}
.paperdoll-body h3 {
  font-size: 23px;
  margin: 15px 0 4px;
  text-align: center;
  overflow-wrap: anywhere;
  max-width: 100%;
}
.paperdoll-body p {
  font-size: 9px;
  color: var(--muted);
  text-align: center;
  line-height: 1.8;
  padding: 0 10px;
}
.paperdoll-side-note {
  font-size: 10px;
  line-height: 1.8;
  color: var(--muted);
  margin: 15px 0;
}
.inventory-carry {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 16px;
  font-size: 11px;
  color: var(--muted);
}
.inventory-carry strong {
  color: var(--gold-bright);
  font-weight: 500;
}
.container-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.container-tabs button {
  font-size: 10px;
  padding: 9px;
  border: 1px solid var(--line);
}
.container-tabs .active {
  border-color: var(--gold);
  color: var(--gold-bright);
  background: #c7aa7010;
}
.container-capacity {
  display: flex;
  gap: 12px;
  font-size: 10px;
  color: var(--muted);
  padding: 11px;
  border: 1px solid var(--line);
  margin-bottom: 12px;
}
.item-row[draggable="true"] {
  cursor: grab;
}
.item-row.selected {
  border-color: var(--gold);
}
.inventory-item-inspector {
  border: 1px solid var(--line);
  padding: 16px;
  margin-top: 15px;
  background: #0b1610;
}
.inventory-item-inspector h3 {
  font-size: 21px;
}
.inventory-item-inspector p {
  font-size: 11px;
  line-height: 1.8;
  color: var(--muted);
  margin: 7px 0;
}
.inventory-item-inspector .button-row {
  margin-top: 12px;
}
.item-move-label {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 10px;
  color: var(--muted);
  margin-top: 12px;
}
.item-move-label select,
.spell-shortcut-select {
  color: var(--paper);
  border: 1px solid var(--line);
  background: #0c1711;
  padding: 8px;
  max-width: 100%;
  font-size: 10px;
}
.spell-card-wrap {
  border: 1px solid var(--line);
}
.spell-card-wrap .spell-card {
  border: 0;
  width: 100%;
}
.spell-card-wrap .item-move-label {
  border-top: 1px solid var(--line);
  margin: 0;
  padding: 8px 12px;
}
.spell-card-wrap .item-move-label select {
  margin-left: auto;
}
.spell-learning-intro,
.directory-intro,
.shop-description {
  margin-bottom: 24px;
}
.learn-pending {
  margin-bottom: 20px;
}
.stock-heading {
  font-size: 24px;
  margin-bottom: 15px;
}
.rename-item-form input {
  min-width: 0;
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  color: var(--paper);
  background: #101c14;
  font-size: 10px;
}
.rename-item-form .secondary {
  padding: 8px;
  font-size: 10px;
}
.item-info > button.item-name {
  text-align: left;
  padding: 0;
}
.shop-workspace .shop-stock {
  max-height: 590px;
  overflow: auto;
  padding-right: 5px;
}
.shop-pack {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
.shop-pack h3 {
  font-size: 22px;
  margin-bottom: 14px;
}
.village-directory {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.village-place {
  text-align: left;
  padding: 20px;
  border: 1px solid var(--line);
  display: flex;
  gap: 15px;
  align-items: center;
}
.village-place strong {
  display: block;
  font:
    21px CastleSerif,
    Georgia,
    serif;
}
.village-place small {
  display: block;
  color: var(--muted);
  margin-top: 7px;
  line-height: 1.7;
  font-size: 10px;
}
.village-place > svg {
  color: var(--gold);
  flex-shrink: 0;
}
.spell-slot.empty {
  color: #89927c;
}
.spell-slot.empty .slot-empty-mark {
  font-size: 22px;
  font-weight: 200;
}
@media (max-width: 800px) {
  dialog[data-view="new"],
  dialog[data-view="inventory"],
  dialog[data-view="shop"] {
    max-width: calc(100vw - 20px);
  }
  .creation-layout {
    grid-template-columns: 1fr;
    gap: 23px;
  }
  .creation-identity {
    display: grid;
    grid-template-columns: 90px 1fr;
    column-gap: 18px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0 0 20px;
    text-align: left;
  }
  .creation-portrait-frame {
    grid-row: 1 / 6;
    width: 90px;
    height: 120px;
  }
  .creation-portrait-rune {
    display: none;
  }
  .creation-identity h3 {
    margin: 0 0 4px;
    font-size: 22px;
  }
  .creation-gender {
    justify-content: flex-start;
    margin: 7px 0;
  }
  .creation-gender legend {
    display: none;
  }
  .creation-gender label {
    padding: 7px 10px;
  }
  .creation-identity .creation-note {
    display: none;
  }
  .custom-icon-upload {
    margin: 4px 0 0;
    padding: 8px 5px;
    font-size: 9px;
  }
  #icon-filename {
    font-size: 8px;
  }
  .creation-steps {
    gap: 15px;
    font-size: 9px;
  }
  .creation-steps b {
    font-size: 15px;
  }
  .attribute-bars {
    gap: 9px;
  }
  .attribute-meter {
    width: 32px;
    height: 130px;
  }
  .attribute-meter input::-webkit-slider-thumb {
    width: 39px;
  }
  .attribute-column > label,
  .attribute-column > strong {
    font-size: 9px;
  }
  .attribute-column > span {
    font-size: 8px;
  }
  .creation-section-title {
    gap: 6px;
  }
  .creation-section-title h3 {
    font-size: 21px;
  }
  .creation-section-title span {
    font-size: 8px;
  }
  .creation-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .creation-footer .primary {
    justify-content: center;
  }
  .difficulty-options {
    grid-template-columns: repeat(2, 1fr);
  }
  .difficulty-card small {
    font-size: 9px;
  }
  .first-spell-grid {
    gap: 8px;
  }
  .first-spell-card {
    padding: 22px 10px 12px;
    display: block;
    min-height: 155px;
  }
  .spell-choice-sigil {
    display: block;
    margin-bottom: 10px;
  }
  .spell-choice-sigil svg {
    width: 24px;
    height: 24px;
  }
  .first-spell-card strong {
    font-size: 18px;
  }
  .first-spell-card small {
    font-size: 10px;
    padding: 0;
  }
  .first-spell-intro p {
    font-size: 10px;
  }
  .inventory-workspace {
    grid-template-columns: 1fr;
  }
  .paperdoll {
    grid-template-rows: repeat(6, 67px);
  }
  .paperdoll-slot > small {
    font-size: 6px;
    letter-spacing: 0;
  }
  .paperdoll-slot > strong {
    font-size: 7px;
  }
  .paperdoll-slot > .item-art {
    width: 27px;
    height: 27px;
  }
  .paperdoll-body h3 {
    font-size: 21px;
  }
  .paperdoll-body > svg,
  .paperdoll-body > img {
    max-height: 210px;
  }
  .village-directory {
    grid-template-columns: 1fr;
  }
}
