:root { --hud-row: 76px; }
html { scrollbar-gutter: stable; }
.shell { width: 100%; margin: 0; padding: 0; position: relative; }
.hud {
  position: fixed; z-index: 12; inset: 0 0 auto; min-height: var(--hud-height);
  grid-template-columns: minmax(155px, 1fr) auto minmax(155px, 1fr); gap: 14px;
  padding: 10px clamp(14px, 3.25vw, 52px); color: var(--cream);
  background: linear-gradient(180deg, #181120f5 0%, #181120db 68%, #18112000 100%);
}
.hud .wordmark h1 { font-size: clamp(18px, 2.1vw, 27px); }
.scene-nav {
  position: static; align-self: center; gap: clamp(3px, .6vw, 10px); padding: 0;
  border: 0; border-radius: 0; background: none; box-shadow: none;
}
.scene-nav button {
  padding: 5px 9px 8px; border-width: 0 0 2px; border-radius: 0; border-color: transparent;
  box-shadow: none; font-size: 14px; background: transparent;
}
.scene-nav button[aria-pressed="true"] { background: none; border-color: #ffd180; color: #ffe6ac; box-shadow: none; }
.scene-nav .pixel { width: 17px; height: 17px; }
.hud-tools { gap: 10px; }
.hud-tools .save-state { display: none; }
.hud-tools .icon-button { background: #271a37a6; border-color: #a17baa8c; }
.site-sign-in {
  display: inline-flex; align-items: center; min-height: 40px; padding: 4px 11px;
  border: 1px solid #ffe9b2; border-radius: 10px; background: var(--gold); color: var(--ink);
  font-size: 13px; font-weight: 800; text-decoration: none; white-space: nowrap;
}
.site-sign-in:focus-visible { outline: 3px solid #ead0ff; outline-offset: 3px; }
#account-open {
  display: block; min-width: 0; max-width: clamp(108px, 18vw, 180px); min-height: 40px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.account-dialog { width: min(360px, calc(100% - 32px)); padding: 18px; color: var(--cream); }
.account-dialog::backdrop { background: #150d20bd; }
.account-dialog form { display: grid; gap: 8px; }
.account-dialog label { margin-top: 4px; }
.account-dialog input { font-size: 16px; }
#account-error { color: var(--red); }
#account-error:empty { margin-top: -8px; }
.account-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.game { min-height: 100svh; }
.scene { border: 0; border-radius: 0; box-shadow: none; }
.forge { position: relative; min-height: 100svh; }
.forge-world { height: max(100svh, 610px); }
.forge-art::after {
  background: linear-gradient(0deg, #140d20d4, transparent 25%),
    radial-gradient(ellipse 57% 63% at 0% 0%, #201227bc, transparent 88%);
}
.forge .scene-title, .tavern .scene-title {
  top: calc(var(--hud-height) + 26px); left: clamp(18px, 4vw, 64px);
  font-size: clamp(29px, 4vw, 58px); letter-spacing: -.058em;
}
.gold-hud {
  position: absolute; top: calc(var(--hud-height) + 96px); left: clamp(18px, 4vw, 64px); z-index: 4;
  min-height: 58px; border-color: #c19ab581; background: #251831d4; box-shadow: 0 5px 15px #10071c48;
}
body:is([data-scene="inventar"], [data-scene="truhen"], [data-scene="markt"], [data-scene="rangliste"], [data-scene="auftraege"]) :is(.gold-hud,.logbook) { display: none; }
.upgrade-shelf {
  position: absolute; inset: auto 0 0; border: 0; box-shadow: none;
  background: linear-gradient(0deg, #1b1026f0, #22142cd9 55%, transparent);
  padding-bottom: 24px; padding-top: 21px;
}
.workshop-improvements {
  position: relative; z-index: 3; width: max-content; margin: 0 auto 4px;
}
.workshop-improvements > summary {
  display: flex; align-items: center; gap: 7px; list-style: none; cursor: pointer;
  min-height: 35px; padding: 5px 10px; border: 1px solid #ac789c;
  border-radius: 8px; background: #30203de8; color: #fff0d0; font-size: 13px; font-weight: 800;
  box-shadow: 0 3px #180f24;
}
.workshop-improvements > summary::-webkit-details-marker { display: none; }
.workshop-improvements > summary::after {
  content: ""; width: 6px; height: 6px; margin-left: 3px;
  border: solid #ffd487; border-width: 1.5px 1.5px 0 0; transform: rotate(-45deg) translate(-1px, 1px);
}
.workshop-improvements[open] > summary::after { transform: rotate(135deg) translate(-1px, 1px); }
.workshop-improvements > summary .pixel { width: 17px; height: 17px; }
#improvements-ready {
  min-width: 18px; padding: 1px 4px; border-radius: 9px; background: #ffd487;
  color: #30213c; text-align: center; font-size: 11px;
}
.improvements-panel {
  position: absolute; bottom: calc(100% + 9px); left: 50%; translate: -50% 0;
  width: min(440px, calc(100vw - 38px)); max-height: min(50svh, 390px); overflow: auto;
  padding: 14px; border: 1px solid #b588aa; border-radius: 14px;
  background: linear-gradient(155deg, #392543, #23182f 75%); box-shadow: 0 12px 32px #130a20be;
}
.improvements-panel h3 { margin: 0 0 4px; color: #ffdea2; font-size: 24px; line-height: 1; }
.improvements-panel > p { margin: 0 0 11px; color: #e2cde7; font-size: 12px; }
.improvements-list { display: grid; gap: 5px; }
.improvement-row {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 8px;
  min-height: 62px; padding: 5px 7px; border: 1px solid #75577b; border-radius: 8px; background: #281b35;
}
.improvement-row[data-state="ready"] {
  border-color: #ae8257; background: linear-gradient(100deg, #42304a, #322137);
}
.improvement-row[data-state="complete"] { border-color: #738158; }
.improvement-row .shop-sprite { width: 44px; height: 42px; }
.improvement-info { display: grid; gap: 1px; line-height: 1.15; }
.improvement-info small { color: #d7bde3; font-size: 10px; }
.improvement-info strong { color: #fff1d7; font-size: 14px; }
.improvement-info span { color: #eacb9f; font-size: 11px; }
.improvement-row .improvement-buy { min-height: 34px; padding: 5px 8px; font-size: 11px; white-space: nowrap; }
.improvement-buy[aria-disabled="false"] { background: #ffd487; border-color: #ffe5b3; color: #30213c; }
.improvement-buy[aria-disabled="true"] { cursor: default; color: #d4bdd9; box-shadow: none; }
.improvement-row[data-state="locked"] .improvement-buy {
  background: #24182e; border-style: dashed; color: #e4cee6;
}
.tavern-world { height: max(100svh, 710px); }
.tavern-mode {
  top: calc(var(--hud-height) + 162px); left: clamp(18px, 4vw, 64px);
}
.logbook { position: absolute; z-index: 6; right: clamp(12px, 3vw, 48px); bottom: 10px; margin: 0; }
.logbook[open] { max-height: min(470px, 70svh); overflow: auto; background: #281c39; border-radius: 12px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}
@media (hover:hover) and (pointer:fine) {
  .scene-nav button:hover { color: #ffe1a0; background: #26183570; }
  .forge-world:has(.anvil:hover) .forge-glow { opacity: .24; }
}
@media (max-width: 830px) {
  .wordmark .pixel { width: 25px; height: 25px; }
}
@media (max-width: 620px) {
  .gold-hud { width: auto; }
  .tavern-world { height: auto; min-height: 780px; padding-top: 305px; }
  .tavern-world:has(.party-tavern:not([hidden])) { min-height: 820px; }
  .party-entry { bottom: 8%; }
}
