@font-face {
  font-family: SerifTC;
  src: url("/assets/fonts/serif-tc-400.woff2?v=alpha02a") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: SerifTC;
  src: url("/assets/fonts/serif-tc-700.woff2?v=alpha02a") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: SerifTC;
  src: url("/assets/fonts/serif-tc-bestiary-400.woff2?v=bestiary1") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+4F9D, U+542B, U+5982, U+5C0B, U+641C, U+67E5, U+7D71, U+8A62, U+9451;
}
@font-face {
  font-family: SerifTC;
  src: url("/assets/fonts/serif-tc-bestiary-700.woff2?v=bestiary1") format("woff2");
  font-weight: 700;
  font-display: swap;
  unicode-range: U+4F9D, U+542B, U+5982, U+5C0B, U+641C, U+67E5, U+7D71, U+8A62, U+9451;
}
@font-face {
  font-family: SerifTC;
  src: url("/assets/fonts/serif-tc-warehouse-400.woff2?v=warehouse1") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+5009;
}
@font-face {
  font-family: SerifTC;
  src: url("/assets/fonts/serif-tc-warehouse-700.woff2?v=warehouse1") format("woff2");
  font-weight: 700;
  font-display: swap;
  unicode-range: U+5009;
}
@font-face {
  font-family: SerifTC;
  src: url("/assets/fonts/serif-tc-first-class-400.woff2?v=firstclass1") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+5177, U+523A, U+5BA2, U+5C71, U+5E2B, U+5EF6, U+5F13, U+5F37, U+6458, U+66F8, U+6728, U+6797, U+68EE, U+6A01, U+72FC, U+76AE, U+76DC, U+7A3B, U+7ACA, U+8001, U+8349, U+85CD, U+88FD, U+8C6C, U+8CAC, U+8CCA, U+9053, U+91CE, U+9F20;
}
@font-face {
  font-family: SerifTC;
  src: url("/assets/fonts/serif-tc-first-class-700.woff2?v=firstclass1") format("woff2");
  font-weight: 700;
  font-display: swap;
  unicode-range: U+5177, U+523A, U+5BA2, U+5C71, U+5E2B, U+5EF6, U+5F13, U+5F37, U+6458, U+66F8, U+6728, U+6797, U+68EE, U+6A01, U+72FC, U+76AE, U+76DC, U+7A3B, U+7ACA, U+8001, U+8349, U+85CD, U+88FD, U+8C6C, U+8CAC, U+8CCA, U+9053, U+91CE, U+9F20;
}
@font-face {
  font-family: SerifTC;
  src: url("/assets/fonts/serif-tc-enhancement-400.woff2?v=enhancement1") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+5377, U+62C6, U+6703, U+7686, U+770B, U+8AD6, U+8CEA;
}
@font-face {
  font-family: SerifTC;
  src: url("/assets/fonts/serif-tc-enhancement-700.woff2?v=enhancement1") format("woff2");
  font-weight: 700;
  font-display: swap;
  unicode-range: U+5377, U+62C6, U+6703, U+7686, U+770B, U+8AD6, U+8CEA;
}
@font-face {
  font-family: SerifTC;
  src: url("/assets/fonts/serif-tc-scrolls-400.woff2?v=scrolls1") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+8863, U+978B;
}
@font-face {
  font-family: SerifTC;
  src: url("/assets/fonts/serif-tc-scrolls-700.woff2?v=scrolls1") format("woff2");
  font-weight: 700;
  font-display: swap;
  unicode-range: U+8863, U+978B;
}
:root {
  --paper: #f5f2e9;
  --ink: #294b3d;
  --gold: #b6a47d;
  --green: #426346;
  --muted: #7f7969;
  --hp: #bc5b50;
  --mp: #4687a8;
  --line: #d5cbb5;
  color-scheme: light;
  font-family: SerifTC, "Noto Serif TC", serif;
  color: var(--ink);
  background: var(--paper);
  font-size: 16px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
a,
input,
select {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.45;
}
button,
select,
input[type="number"],
input[type="text"] {
  border: 1px solid var(--gold);
  border-radius: 3px;
  background: transparent;
  padding: 8px 12px;
}
button:hover:not(:disabled) {
  background: #e7ebdf;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #658361;
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h2 {
  font-size: 20px;
  line-height: 1.5;
}
h3 {
  font-size: 18px;
}
a {
  color: inherit;
}
strong {
  font-weight: 700;
}
small,
.muted {
  color: var(--muted);
  font-size: 14px;
}
.app-shell {
  max-width: 1560px;
  margin: auto;
  padding: 0 26px 24px;
}
.site-header {
  display: flex;
  align-items: center;
  gap: 26px;
  min-height: 76px;
  border-bottom: 1px solid var(--gold);
}
.brand {
  font-size: 42px;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 3px;
}
.online {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-size: 14px;
}
.online i,
#connection-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #aaa;
}
.online.available i,
#connection-dot.online {
  background: #539566;
}
.site-header nav {
  display: flex;
  margin: auto;
  gap: 20px;
}
.quiet {
  border: 0;
  background: none;
  padding: 6px 10px;
}
.nav-button {
  border: 0;
  border-radius: 0;
  font-size: 20px;
  padding: 22px 12px;
}
.nav-button.active {
  box-shadow: inset 0 -2px var(--ink);
}
.account-button {
  white-space: nowrap;
}
.location-heading {
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 84px;
}
.location-heading h1 {
  font-size: 34px;
}
.breadcrumb {
  color: var(--muted);
  font-size: 17px;
}
#fullscreen-button {
  margin-left: auto;
  color: var(--muted);
  font-size: 14px;
}
.paper-panel {
  border: 1px solid var(--gold);
  border-radius: 3px;
  padding: 18px 20px;
  background: transparent;
}
.paper-panel > h2,
.panel-title {
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.panel-title h2 {
  border: 0;
  margin: 0;
  padding: 0;
}
.battle-layout {
  display: grid;
  grid-template-columns: minmax(0, 3.1fr) minmax(280px, 1fr);
  gap: 14px;
}
.battle-column {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(260px, 1fr);
  gap: 12px;
}
.action-panel h2 {
  border: 0;
  margin-bottom: 10px;
  padding: 0;
  font-size: 22px;
}
.cast-line {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.cast-line .meter {
  flex: 1;
}
.cast-line output {
  font-size: 14px;
  min-width: 84px;
  text-align: right;
}
.meter {
  height: 13px;
  border: 1px solid var(--gold);
  border-radius: 3px;
  padding: 2px;
  overflow: hidden;
}
.meter > div {
  height: 100%;
  width: 0;
  background: var(--green);
  border-radius: 1px;
}
#cast-progress.waiting {
  background: #8b908c;
}
.hp > div {
  background: var(--hp);
}
.mp > div {
  background: var(--mp);
}
.xp > div {
  background: #9ba66a;
}
.enemy-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.enemy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 4px;
  padding: 7px 9px;
  font-size: 14px;
  border: 1px solid var(--line);
  min-height: 31px;
}
.enemy-row.target {
  background: #e6ebdf;
  border-color: #8ca28a;
}
.enemy-row .meter {
  height: 9px;
}
.enemy-row .meter > div {
  background: #bc5752;
}
.enemy-row > span {
  overflow-wrap: anywhere;
}
.enemy-row output {
  min-width: 0;
  text-align: right;
}
.journal-panel {
  min-height: 260px;
}
.combat-log {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  max-height: 300px;
  min-height: 225px;
  line-height: 1.85;
  font-size: 15px;
  scrollbar-width: thin;
}
.combat-log li {
  display: flex;
  gap: 12px;
}
.combat-log time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.log-death {
  color: #a13d35;
}
.log-kill {
  font-weight: 700;
}
.status-list {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  font-size: 14px;
}
.status-list:empty {
  display: none;
}
.status-list > span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.character-panel {
  display: flex;
  flex-direction: column;
}
.character-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 0 20px;
}
.character-heading strong {
  font-size: 26px;
}
.resources {
  display: grid;
  gap: 18px;
}
.resource-row {
  display: grid;
  grid-template-columns: 35px 1fr;
  align-items: center;
  gap: 5px 10px;
}
.resource-row output {
  grid-column: 2;
  text-align: right;
  font-size: 14px;
}
.attributes {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-block: 1px solid var(--line);
  padding: 20px 0;
  margin: 20px 0;
}
.attributes > div {
  text-align: center;
  border-right: 1px solid var(--line);
}
.attributes > div:last-child {
  border: 0;
}
.attributes span {
  font-size: 13px;
  display: block;
}
.attributes strong {
  display: block;
  margin-top: 8px;
  font-size: 19px;
}
.primary {
  background: var(--green);
  color: #fff;
  border: 1px solid var(--green);
  padding: 10px 18px;
}
.primary:hover:not(:disabled) {
  background: #345638;
  color: #fff;
}
.secondary {
  background: #e9eddf;
}
.hunt-button {
  width: 100%;
  font-size: 23px;
  margin-top: auto;
  padding: 14px;
}
.bonus-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  font-size: 14px;
}
.bonus-row output {
  font-variant-numeric: tabular-nums;
}
.toggle {
  position: relative;
  display: inline-block;
  border: 0;
  border-radius: 20px;
  width: 43px;
  height: 24px;
  padding: 0;
  background: #aaa393;
  flex-shrink: 0;
}
.toggle:after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--paper);
}
.toggle[aria-checked="true"] {
  background: #668163;
}
.toggle[aria-checked="true"]:after {
  left: 22px;
}
.controls-layout {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 14px;
  margin-top: 14px;
}
.skill-cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.action-cell {
  min-width: 0;
  text-align: center;
  padding: 10px 4px;
  border: 1px solid var(--line);
  border-radius: 2px;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 5px;
  min-height: 91px;
  font-size: 14px;
}
.action-cell.current {
  border-color: #7a9b7b;
  background: #e4ecdf;
}
.action-cell.past {
  color: var(--muted);
}
.action-cell small {
  font-size: 12px;
}
.pixel-icon {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  vertical-align: middle;
}
.pixel-icon img {
  image-rendering: pixelated;
  width: 32px;
  height: 32px;
  object-fit: contain;
}
.pixel-icon .icon-fallback {
  font-size: 11px;
  line-height: 1.1;
  max-height: 30px;
  overflow: hidden;
  text-align: center;
}
.supply-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 51px;
}
.potion-button {
  padding: 0;
  min-width: 32px;
}
.supply-row label {
  font-size: 14px;
  white-space: nowrap;
  min-width: 75px;
}
.supply-row output {
  margin-left: 8px;
}
.threshold {
  width: 100%;
  min-width: 50px;
  accent-color: #6f8863;
}
.threshold.hp {
  accent-color: var(--hp);
}
.threshold.mp {
  accent-color: var(--mp);
}
.loot-panel {
  display: flex;
  gap: 24px;
  align-items: center;
  margin-top: 14px;
  min-height: 66px;
}
.loot-panel h2 {
  border: 0;
  padding: 0;
  margin: 0;
}
.loot-panel > span {
  white-space: nowrap;
}
#loot-slots {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
#loot-slots .bag-cell {
  width: 56px;
  min-height: 56px;
}
.notice {
  padding: 16px;
  border: 1px solid #a37a45;
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.page-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 16px;
}
.page-stack {
  display: grid;
  gap: 16px;
}
.stat-list {
  display: grid;
  gap: 9px;
}
.stat-row {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
}
.stat-row strong {
  margin-left: auto;
}
.stat-row button {
  padding: 3px 12px;
}
.stat-row [title] {
  cursor: help;
}
.summary-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 20px;
  margin-top: 18px;
  font-size: 14px;
}
.summary-list > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.equipment-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.equipment-slot {
  min-height: 82px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 13px;
}
.equipment-slot.empty {
  color: var(--muted);
  border-style: dashed;
}
.tabs {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.tabs button {
  padding: 6px 13px;
  border-color: var(--line);
}
.tabs button.selected {
  border-color: var(--ink);
  background: #e4ecdf;
}
.skills-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.skills-table td,
.skills-table th {
  text-align: left;
  padding: 13px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.skill-name {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.skill-description {
  line-height: 1.7;
  min-width: 150px;
}
.skill-description small {
  display: block;
}
.bag-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  max-width: 470px;
}
.bag-cell {
  position: relative;
  aspect-ratio: 1;
  min-height: 57px;
  border-color: var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px;
}
.bag-cell.empty {
  border-style: dashed;
  opacity: 0.6;
}
.bag-cell.selected {
  border-color: var(--ink);
  background: #e4ecdf;
}
.bag-cell .quantity {
  position: absolute;
  right: 5px;
  bottom: 2px;
  font-size: 12px;
  line-height: 1;
}
.bag-cell .no-icon-name {
  font-size: 12px;
  line-height: 1.4;
}
.item-detail {
  min-height: 130px;
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 15px;
  line-height: 1.8;
  font-size: 14px;
}
.item-detail h3 {
  margin-bottom: 5px;
}
.item-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
  flex-wrap: wrap;
}
.item-actions input {
  max-width: 85px;
}
.item-list {
  display: grid;
  gap: 0;
}
.shop-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 13px 0;
}
.shop-row .item-caption {
  flex: 1;
  min-width: 0;
}
.item-caption strong,
.item-caption small {
  display: block;
}
.shop-row input {
  width: 68px;
  padding: 6px;
}
.shop-row button {
  padding: 7px 10px;
}
.sale-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 15px;
}
.empty-message {
  color: var(--muted);
  padding: 25px 0;
  text-align: center;
}
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--gold);
  padding-bottom: 12px;
  margin-bottom: 18px;
}
dialog {
  background: var(--paper);
  border: 1px solid var(--gold);
  border-radius: 4px;
  color: var(--ink);
  padding: 24px;
  max-width: 720px;
  width: calc(100vw - 32px);
  max-height: 88vh;
}
dialog::backdrop {
  background: #20392c66;
}
.dialog-heading button {
  font-size: 25px;
  line-height: 1;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 22px;
}
.form-field {
  display: grid;
  gap: 9px;
  margin: 16px 0;
}
.form-field input {
  width: 100%;
}
.character-slots {
  display: grid;
  gap: 12px;
}
.character-slot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  padding: 14px;
}
.preset-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.skill-order-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 8px 0;
}
.skill-order-row select {
  flex: 1;
  min-width: 90px;
}
.skill-order-row button {
  padding: 5px 9px;
}
.cycle-summary {
  padding: 12px 0;
  line-height: 1.8;
}
.sale-confirm {
  width: 100%;
  border-collapse: collapse;
}
.sale-confirm td,
.sale-confirm th {
  text-align: left;
  padding: 9px 5px;
  border-bottom: 1px solid var(--line);
}
.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  background: var(--ink);
  color: #fff;
  padding: 12px 20px;
  border-radius: 3px;
  z-index: 10;
}
.toast.error {
  background: #8e463d;
}
noscript {
  display: block;
  padding: 24px;
}
@media (min-width: 1400px) {
  .resource-row {
    grid-template-columns: 32px 1fr auto;
  }
  .resource-row output {
    grid-column: auto;
    min-width: 68px;
  }
  .character-panel {
    padding: 20px;
  }
  .journal-panel {
    min-height: 320px;
  }
  .combat-log {
    max-height: 330px;
  }
}
@media (max-width: 1000px) {
  .app-shell {
    padding: 0 16px 20px;
  }
  .site-header {
    gap: 12px;
  }
  .site-header nav {
    gap: 4px;
  }
  .nav-button {
    padding: 23px 9px;
    font-size: 18px;
  }
  .brand {
    font-size: 34px;
  }
  .battle-layout {
    grid-template-columns: minmax(0, 2.2fr) minmax(230px, 1fr);
  }
  .controls-layout {
    grid-template-columns: 1fr;
  }
  .skill-cards {
    max-width: none;
  }
  .character-heading strong {
    font-size: 23px;
  }
  .page-columns {
    grid-template-columns: 1fr 1fr;
  }
  .paper-panel {
    padding: 15px;
  }
  .shop-row {
    flex-wrap: wrap;
  }
  .shop-row .item-caption {
    min-width: 100px;
  }
}
@media (max-width: 700px) {
  .app-shell {
    padding: 0 12px 16px;
  }
  .site-header {
    flex-wrap: wrap;
    gap: 14px;
    padding-top: 10px;
    min-height: 0;
  }
  .brand {
    font-size: 32px;
  }
  .online {
    font-size: 12px;
  }
  .account-button {
    margin-left: auto;
  }
  .site-header nav {
    order: 4;
    width: 100%;
    justify-content: space-between;
    gap: 0;
  }
  .nav-button {
    padding: 10px 8px;
    font-size: 18px;
  }
  .location-heading {
    min-height: 94px;
    flex-wrap: wrap;
    gap: 4px 10px;
    padding: 13px 0;
  }
  .location-heading h1 {
    font-size: 27px;
    width: 100%;
  }
  .breadcrumb {
    font-size: 14px;
    padding: 4px 0;
  }
  #fullscreen-button {
    font-size: 12px;
  }
  .battle-layout {
    grid-template-columns: 1fr;
  }
  .battle-column {
    grid-template-rows: auto auto;
  }
  .character-panel {
    display: block;
  }
  .character-heading {
    padding: 0 0 14px;
  }
  .resources {
    gap: 12px;
  }
  .resource-row {
    grid-template-columns: 32px 1fr 80px;
  }
  .resource-row output {
    grid-column: auto;
    font-size: 14px;
  }
  .attributes {
    padding: 13px 0;
    margin: 16px 0;
  }
  .hunt-button {
    padding: 11px;
  }
  .bonus-row {
    display: inline-flex;
    min-width: 45%;
    margin-right: 3%;
    font-size: 13px;
  }
  .combat-log {
    font-size: 13px;
    max-height: 230px;
    min-height: 180px;
  }
  .combat-log li {
    gap: 8px;
  }
  .enemy-row {
    grid-template-columns: minmax(0, 1fr);
    font-size: 12px;
    gap: 6px;
    padding: 5px;
  }
  .enemy-row output {
    min-width: 0;
  }
  .enemy-row .meter {
    height: 8px;
  }
  .action-panel h2 {
    font-size: 18px;
  }
  .journal-panel {
    min-height: 230px;
  }
  .cast-line output {
    font-size: 12px;
    min-width: 65px;
  }
  .paper-panel {
    padding: 13px;
  }
  .skill-cards {
    gap: 5px;
  }
  .action-cell {
    font-size: 12px;
    padding: 8px 2px;
    min-height: 87px;
  }
  .action-cell small {
    font-size: 10px;
  }
  .supply-row {
    gap: 8px;
  }
  .loot-panel {
    gap: 12px;
    flex-wrap: wrap;
  }
  .loot-panel h2 {
    font-size: 18px;
  }
  .page-columns {
    grid-template-columns: 1fr;
  }
  .bag-grid {
    max-width: none;
  }
  .bag-cell {
    min-height: 56px;
  }
  .skills-table {
    font-size: 12px;
  }
  .skills-table th,
  .skills-table td {
    padding: 10px 4px;
  }
  .skill-name {
    white-space: normal;
    gap: 5px;
    min-width: 73px;
    flex-wrap: wrap;
  }
  .skill-description {
    min-width: 0;
  }
  .skills-table button {
    padding: 5px 7px;
  }
  .skills-table .pixel-icon {
    width: 32px;
  }
  .summary-list {
    font-size: 13px;
    gap: 8px 12px;
  }
  .skill-order-row {
    gap: 4px;
  }
  .skill-order-row button {
    padding: 5px 6px;
  }
  .skill-order-row select {
    padding: 6px;
  }
  .notice {
    font-size: 14px;
    align-items: center;
  }
  .tabs {
    gap: 5px;
  }
  .tabs button {
    font-size: 14px;
    padding: 7px 10px;
  }
}
.bestiary-note {
  color: var(--muted);
  line-height: 1.7;
}
.bestiary-enemy {
  border-top: 1px solid var(--line);
  padding: 16px 0;
}
.bestiary-enemy summary {
  cursor: pointer;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.bestiary-enemy .summary-list {
  margin: 16px 0;
}
.bestiary-drop {
  min-width: 0;
}
.bestiary-drops .bag-cell {
  width: 100%;
  min-height: 0;
  padding: 4px;
}
.bestiary-drop-chance {
  display: block;
  margin-top: 4px;
  text-align: center;
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
#bestiary-search {
  display: block;
  width: 100%;
  margin: 8px 0 16px;
}
.bestiary-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.bestiary-items [aria-pressed="true"] {
  border-color: var(--green);
  font-weight: 700;
}
.bestiary-items button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}

.page-stack {
  margin-top: 16px;
}
.bag-grid {
  max-width: 360px;
  margin-top: 10px;
}
@media (min-width: 1400px) {
  .combat-log {
    max-height: 230px;
  }
  .journal-panel {
    min-height: 300px;
  }
}
@media (min-width: 1400px) {
  .journal-panel {
    min-height: 250px;
  }
  .combat-log {
    min-height: 180px;
    max-height: 180px;
  }
}
@media (max-width: 700px) {
  .skills-table,
  .skills-table tbody {
    display: block;
  }
  .skills-table thead {
    display: none;
  }
  .skills-table tr {
    display: grid;
    grid-template-columns: minmax(90px, 1fr) 55px 55px;
    gap: 10px 6px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
  }
  .skills-table td {
    display: block;
    border: 0;
    padding: 0;
    font-size: 14px;
  }
  .skills-table td:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
  }
  .skills-table td:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
    white-space: nowrap;
    align-self: center;
  }
  .skills-table td:nth-child(3) {
    grid-column: 1/-1;
    grid-row: 2;
  }
  .skills-table td:nth-child(4) {
    grid-column: 3;
    grid-row: 1;
    align-self: center;
  }
  .skills-table button {
    white-space: nowrap;
    font-size: 14px;
    padding: 6px 8px;
  }
  .skills-table .skill-name {
    flex-wrap: nowrap;
  }
  .skill-description small {
    font-size: 13px;
  }
}

.warehouse-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.warehouse-columns .item-actions input { width: 6em; }
.enhancement-columns { grid-template-columns: minmax(300px, 1fr) minmax(0, 2fr); align-items: start; }
.enhancement-columns .bag-cell { min-width: 0; min-height: 0; padding: 4px; }
.enhancement-columns .bag-cell .no-icon-name { max-height: 2.6em; overflow: hidden; font-size: 11px; line-height: 1.3; }
.enhancement-equipped { position: absolute; top: 2px; left: 2px; padding: 1px 2px; font-size: 10px; line-height: 1.2; background: var(--paper); color: var(--ink); }
.enhancement-quality { white-space: nowrap; color: #45664a; font-weight: 700; }
.enhancement-preview > .muted { margin-bottom: 18px; }
.enhancement-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.enhancement-summary span, .enhancement-summary strong { display: block; }
.enhancement-summary strong { margin-top: 5px; font-size: 17px; overflow-wrap: anywhere; }
.enhancement-summary span { font-size: 13px; }
.enhancement-stats { width: 100%; border-collapse: collapse; margin: 20px 0; text-align: left; font-size: 14px; }
.enhancement-stats caption { text-align: left; color: var(--muted); margin-bottom: 12px; }
.enhancement-stats th, .enhancement-stats td { padding: 10px 5px; border-bottom: 1px solid var(--line); }
.enhancement-stats thead th { font-weight: 400; color: var(--muted); }
.enhancement-stats small { display: block; font-size: 12px; }
.enhancement-after { color: #45664a; font-weight: 700; }
.enhancement-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.enhancement-result { margin: 18px 0 0; padding: 12px; background: #ece5d9; border-left: 3px solid var(--gold); }
.enhancement-result.success { background: #e4ecdf; border-left-color: #45664a; }
@media (max-width: 1000px) {
  .enhancement-columns { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .warehouse-columns { grid-template-columns: minmax(0, 1fr); }
  .enhancement-summary { gap: 8px; }
  .enhancement-summary strong { font-size: 15px; }
  .enhancement-stats { font-size: 13px; }
  .enhancement-stats th, .enhancement-stats td { padding: 10px 2px; }
  .nav-button { font-size: 16px; padding: 10px 5px; min-height: 44px; }
}

.money {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
}
.money .pixel-icon, .money img {
  width: 20px;
  height: 20px;
  min-width: 20px;
}
.held-money { margin: 0 0 12px; }
.shop-row > .bag-cell {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  min-height: 56px;
  padding: 7px;
}
.bag-cell[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.sale-confirm input { width: 5em; max-width: 100%; }
.warehouse-side.drop-target { outline: 2px solid var(--green); outline-offset: -2px; background: #e6ebdf; }
.bag-cell[draggable="true"] { cursor: grab; }
.bag-cell[draggable="true"]:active { cursor: grabbing; }
.item-tooltip {
  position: fixed;
  inset: auto;
  margin: 0;
  width: max-content;
  max-width: min(340px, calc(100vw - 16px));
  max-height: calc(100dvh - 16px);
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fffdf6;
  color: var(--ink);
  box-shadow: 0 6px 24px #292e2633;
  font-size: 14px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.tooltip-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
