:root {
  color-scheme: dark;
  color: #eee9dc;
  background: #151817;
  --muted: #b2b1a8;
  --line: #45473f;
  --border: #45473f;
  --accent: #dcc991;
  --danger: #f1959d;
  --gold-edge: #968461;
  --surface: #202425;
  --field: #13191b;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}
body { background: #151817 url('/assets/game/ui-charcoal.png') repeat; }
.sidebar { background: #121615; border-right-color: #716449; }
.brand { color: #f0deb0; }
.brand-mark { background: #283839; color: #e0ca94; border: 1px solid #8d805e; border-radius: 4px; }
.nav-item { color: #c1c4b9; border-radius: 4px; border: 1px solid transparent; }
.nav-item:hover { background: #262b29; }
.nav-item.active { color: #f6e6b6; background: #203334; border-color: #8e8060; }
.nav-count { background: #37423c; color: #f0dca8; }
.topbar { background: #151b1c; border-bottom: 1px solid #8b7954; }
.breadcrumb, .breadcrumb > span:last-child, .identity, .identity > svg { color: #c2c5bd; }
.content { padding-top: 22px; }
.page-heading { margin: 22px 0; padding-bottom: 14px; border-bottom: 1px solid #86734d; }
h1 { font-size: 25px; font-weight: 600; color: #f0deb6; }
h2, h3 { color: #e4d4ae; }
.eyebrow { color: #b3ac96; }
.notice { background: #20352e; color: #cee3cf; border-color: #4e6d56; border-radius: 4px; margin-bottom: 20px; }
.notice.warning { background: #3c3020; color: #efd59e; border-color: #8e7443; }
.button { border-radius: 4px; }
.button.primary { background: #0b526d; color: #fff8e3; border-color: #b8a77a; box-shadow: inset 0 0 0 1px #3e7b8e; }
.button.primary:hover { background: #126b88; border-color: #e2d29c; }
.button.secondary { background: #292e2c; border-color: #8d805d; color: #ede1bf; }
.button.secondary:hover { background: #37403c; border-color: #cab88a; }
.button.danger { background: #783d43; color: #fff3e6; }
.icon-button { color: #c0b89d; border-radius: 4px; }
.icon-button:hover { color: #fff1bd; background: #343e37; border-color: #817753; }
.icon-button.destructive:hover { color: #ffd9d9; background: #653b3d; border-color: #a36a6a; }
button:focus-visible, a:focus-visible { outline-color: #74c7db; }
.metrics { background: #1d2424; border: 0; border-top: 1px solid #81754e; border-bottom: 1px solid #81754e; border-radius: 0; padding: 18px 0; }
.metrics strong { color: #f2dfaa; font-size: 25px; }
.metrics small, .secondary-text, .account-caption, .field-hint { color: #b3b4a8; }
.table-wrap { background: #1a2020; border-color: #5f604e; border-radius: 4px; }
thead { background: #263033; color: #d3c59f; }
th { color: #cfccb9; font-weight: 500; }
td { border-bottom-color: #3a413b; height: 76px; }
tbody tr:hover { background: #26312e; }
.account-avatar, .demo-avatar { color: #ebd596; background: #293a38; border: 1px solid #9d8b60; border-radius: 3px; }
.badge { background: #3a403a; color: #d2d0bc; }
.badge.ready, .badge.succeeded, .badge.already_claimed { background: #223c2d; color: #aed5ab; }
.badge.awaiting_validation, .badge.queued, .badge.retrying, .badge.running { background: #223d4a; color: #acd8ec; }
.badge.review, .badge.uncertain { background: #443a24; color: #efd39a; }
.badge.blocked, .badge.failed { background: #4a2b30; color: #f0b0b4; }
.empty { background: #1a2020; color: #bbbdb1; }
.filter, .filter select { color: #c7c9bd; }
.text-link { color: #a9d3ca; }
.footer, .version { color: #a7aa9e; }
dialog { background: #232826 url('/assets/game/ui-panel.png') repeat; color: #eee9dc; border: 2px solid #aa9469; border-radius: 6px; box-shadow: 0 24px 70px #000a; }
dialog::backdrop { background: #060a0cbd; backdrop-filter: blur(3px); }
.dialog-heading, .dialog-footer { background: #182223; border-color: #857451; }
.dialog-heading h2 { color: #f1dfb5; font-size: 18px; font-weight: 550; }
.dialog-body label:not(.switch-row):not(.checkbox-row):not(.file-field), legend { color: #d6d4c2; }
input:not([type=checkbox]):not([type=file]), select, textarea { background: #131a1c; color: #f0eee1; border-color: #757359; border-radius: 4px; }
input:focus, select:focus, textarea:focus { border-color: #7bc0cf; box-shadow: 0 0 0 2px #355e68; }
input::placeholder { color: #a1aaa5; }
input[type=checkbox] { accent-color: #3c9caa; }
.switch-row input { background: #565b56; border: 1px solid #7c7b65; }
.switch-row input:checked { background: #1d8190; }
.switch-row input:before { top: 2px; left: 2px; background: #f3e9ce; }
.segmented { background: #121b1d; border: 1px solid #62624d; }
.segmented button { color: #b9bfb4; }
.segmented button.active { background: #36524e; color: #f4e6bf; }
.file-field { background: #1b2424; border-color: #897e5d; color: #cad0bf; }
.demo-preview { background: #1c2928; }
.inline-error { background: #492c31; border-color: #a26465; color: #ffd1ce; }
#toast { background: #213c35; border-color: #9f9165; color: #f1e4ba; }
.admin-tabs [aria-selected=true], .inventory-tabs [aria-selected=true] { color: #f0d797; border-color: #c4ae70; }
.inventory-grid, .team-picker-grid { gap: 8px; }
.inventory-tile, .team-picker-item { background: #202828; border-color: #777054; border-radius: 3px; }
.inventory-tile:hover, .team-picker-item:hover { background: #2d3d37; border-color: #b9a575; }
.team-picker-item[aria-pressed=true] { background: #274444; border-color: #e2c98c; }
.item-picture { background: #101919; border: 1px solid #b3a26c; border-radius: 3px; }
.item-picture img { border-radius: 2px; }
.team-slot { background: #202624; border-color: #766c52; }
.team-member-button, .team-equipment-button { color: #eeecdc; }
.account-detail-dialog .dialog-heading, .team-picker-dialog .dialog-heading { background: #182223; }
.run-detail-dialog .dialog-heading { background: #182223; }
.inventory-view-toggle [aria-pressed=true] { background: #2b4640; color: #f0deb2; }
.inventory-tile-numbers strong { color: #f1dda3; }
.role-admin { background: #294637; color: #b9dcb0; }
.role-user { background: #343e40; color: #d1d7d2; }
.reward-events li.reward_skipped strong, .reward-events li.task_skipped strong,
.preserved-rewards summary::marker { color: #e2c891; }
.reward-events li.shop_claim_confirmed strong { color: #b9dcb0; }
.login-view > svg { color: #ddc58a; }
.currency-balances > div { border-color: #5c5d4c; }
.currency-balances strong { color: #eddaad; font-variant-numeric: tabular-nums; }
.reward-item, .loot-items, .preserved-rewards, .preserved-rewards > summary, .preserved-reward { background-color: #202827; border-color: #555b4d; }
.reward-item-copy, .reward-item-quantity { color: #e8e1c9; }
.farm-category-label[aria-current=page] { color: #f4dfaa; background: #2b403c; }
.farm-category-path [aria-current=page] { color: #f0dba4; }
.farm-resource-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 0; color: #d2c49e; font-size: 12px; }
#farm-inventory-warning { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; color: #f2ce88; }
#farm-inventory-warning .button { min-height: 30px; padding: 5px 9px; font-size: 12px; }
.farm-floor-open { background: transparent; border: 0; padding: 0; display: flex; gap: 10px; text-align: left; color: inherit; align-items: center; width: 100%; }
.farm-floor-open:hover strong { color: #f0d59b; text-decoration: underline; }
.farm-floor-open > .item-picture { width: 44px; height: 44px; flex: 0 0 44px; }
#farm-stamina-dialog, #farm-floor-dialog { width: min(620px, calc(100% - 28px)); }
#farm-stamina-form { display: flex; flex-direction: column; max-height: calc(100dvh - 40px); }
#farm-stamina-form .dialog-body { overflow: auto; min-height: 0; gap: 14px; }
#farm-stamina-form .dialog-heading, #farm-stamina-form .dialog-footer { flex-shrink: 0; }
.farm-potions { list-style: none; margin: 0; padding: 0; }
.farm-potion { display: grid; grid-template-columns: 22px 22px 38px minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.farm-potion .item-picture { width: 38px; height: 38px; }
.farm-potion strong { font-size: 12px; display: block; overflow-wrap: anywhere; }
.farm-potion small { display: block; color: var(--muted); font-size: 11px; }
.farm-potion-order { color: #e8cd8c; font-variant-numeric: tabular-nums; }
.farm-detail-heading { display: flex; gap: 14px; align-items: center; }
.farm-detail-heading .item-picture { width: 68px; height: 68px; flex: 0 0 68px; }
.farm-detail-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; }
.farm-detail-facts > div { border-bottom: 1px solid var(--line); padding-bottom: 8px; min-width: 0; }
.farm-detail-facts dt { color: var(--muted); font-size: 12px; }
.farm-detail-facts dd { margin: 4px 0 0; overflow-wrap: anywhere; }
#farm-floor-limits { padding-left: 20px; font-size: 13px; }
#farm-floor-limits li { padding: 3px 0; }
#farm-floor-experience { font-size: 13px; margin-top: 8px; }
@media(max-width:640px) {
  h1 { font-size: 23px; }
  .farm-settings .button { flex: 1; }
  .farm-potion { grid-template-columns: 18px 18px 34px minmax(0,1fr) auto; gap: 5px; }
  .farm-potion .item-picture { width: 34px; height: 34px; }
  .farm-potion .actions { flex-direction: column; }
  .farm-potion .icon-button { width: 29px; height: 29px; }
  .farm-detail-facts { gap: 10px; }
}
