/* Dominion's visual language: dark stone, parchment, old gold and ember light. */
:root {
  --bg: #0c1012;
  --panel: #141b1d;
  --line: #303b3c;
  --muted: #a5afad;
  --text: #f0eadf;
  --green: #dcb873;
  --gold: #edc580;
  --accent: #d8aa5e;
  --sans: Arial, Helvetica, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}
body {
  background:
    radial-gradient(ellipse at 85% 0, #18252566, transparent 48%), var(--bg);
  font: 14px/1.5 var(--sans);
}
button,
input,
select,
textarea {
  font-family: var(--sans);
}
button {
  min-height: 42px;
  border-radius: 4px;
  transition:
    background 0.18s,
    border-color 0.18s,
    transform 0.18s;
}
button:hover:not(:disabled) {
  background: #273332;
  border-color: #788580;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}
button:disabled {
  opacity: 0.5;
}
.primary,
.gold-button {
  background: linear-gradient(135deg, #efd39a, #c5964d);
  color: #201b12;
  border-color: #e3bf79;
  box-shadow:
    inset 0 1px #fff4,
    0 3px 0 #6f522b;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.primary:hover:not(:disabled),
.gold-button:hover:not(:disabled) {
  background: linear-gradient(135deg, #f8e2b5, #ddb064);
  border-color: #f3d59d;
  color: #17120c;
  transform: translateY(-1px);
}
.gold-button {
  background: #30291f;
  color: #e9c78e;
  box-shadow: none;
}
.gold-button span {
  color: inherit;
}
.text-button {
  font-size: 13px;
  color: var(--gold);
  min-height: 40px;
}
.subtle {
  font-size: 12px;
  color: #d1d8d3;
  background: #141c1d;
}
.eyebrow {
  font-size: 10px;
  line-height: 1.5;
  letter-spacing: 2px;
  color: #bfa77a;
}
.skip-link {
  position: fixed;
  top: 10px;
  left: 15px;
  z-index: 100;
  transform: translateY(-160%);
  padding: 12px;
  background: var(--gold);
  color: #111;
}
.skip-link:focus {
  transform: none;
}
.topbar {
  height: 78px;
  gap: 48px;
  padding: 0 max(28px, 4vw);
  background: #0c1214f5;
  border-bottom: 1px solid #d4b37525;
  position: relative;
  z-index: 5;
}
.brand {
  gap: 14px;
  letter-spacing: 3px;
  font-size: 17px;
}
.brand b {
  color: #e9ce97;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 400;
}
.brand small {
  font-size: 7px;
  letter-spacing: 4px;
  color: #a8aba2;
  margin-top: 1px;
}
.brand-mark {
  width: 34px;
  height: 34px;
  color: #edc580;
  border-color: #b18b4d;
  font: 32px var(--serif);
}
.topbar nav {
  gap: 28px;
}
.nav-button {
  min-height: 44px;
  color: #b7bebb;
  font-size: 13px;
}
.nav-button.active {
  color: var(--gold);
}
.nav-button.active:after {
  background: var(--gold);
  height: 2px;
}
.nav-button:hover:not(:disabled) {
  background: transparent;
  color: #fff;
  border: 0;
}
.account {
  gap: 12px;
}
.account > span {
  font-size: 10px;
  letter-spacing: 1px;
}
.account button {
  padding: 9px 13px;
}
.account .sound-toggle {
  font-size: 11px;
  color: var(--muted);
  min-width: 44px;
}
.sound-mix {
  position: fixed;
  z-index: 90;
  width: min(180px, calc(100vw - 16px - env(safe-area-inset-left) - env(safe-area-inset-right)));
  max-height: calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow: auto;
  display: grid;
  gap: 8px;
  padding: 12px;
  background: #12191b;
  border: 1px solid #8d754c;
  border-radius: 6px;
  box-shadow: 0 12px 32px #000a;
}
.sound-mix label { display: grid; gap: 4px; font-size: 11px; color: #c8c3b4; }
.sound-mix input { width: 100%; min-height: 44px; }
.sound-mix button { min-height: 44px; min-width: 44px; }
.canvas-wrap { position: relative; }
#hall-notices {
  position: absolute;
  z-index: 6;
  top: 52px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
  max-width: min(92%, 28rem);
}
#hall-notices p {
  margin: 0;
  padding: 8px 14px;
  border: 1px solid #b08a4a;
  border-radius: 6px;
  background: #120e0ae6;
  color: #f4efe2;
  font: 16px/1.3 Georgia, serif;
  text-align: center;
}
#raider-rank {
  color: #c0c9c0;
}
h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 400;
}
h1 em,
h2 em {
  color: var(--gold);
  font-weight: 400;
}
.home-screen {
  overflow: hidden;
}
.home-hero {
  position: relative;
  isolation: isolate;
  min-height: 650px;
  height: min(760px, calc(100svh - 78px));
  background: #0d181a url("./assets/experience/vault-gateway.webp") 65% 50% /
    cover no-repeat;
  display: flex;
  align-items: center;
  padding: 65px max(28px, 8vw);
  border-bottom: 1px solid #bb965c3b;
}
.home-hero:before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, #071013dd 0%, #0912158c 35%, transparent 69%),
    linear-gradient(0deg, #0c1012 0%, transparent 25%);
}
.hero-copy {
  max-width: 590px;
}
.hero-copy > .eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 10px;
  letter-spacing: 2.5px;
  color: #d7be90;
}
.hero-spark {
  color: var(--gold);
  font-size: 20px;
}
.hero-copy h1 {
  font-size: clamp(56px, 5.6vw, 88px);
  line-height: 1.08;
  letter-spacing: -2px;
  color: #f3eee2;
  margin: 28px 0;
}
.hero-copy h1 em {
  color: #edc580;
}
.hero-copy > p {
  font-size: 17px;
  line-height: 1.8;
  color: #c5cfcc;
  margin: 0 0 32px;
}
.hero-actions {
  display: flex;
  gap: 14px;
  align-items: center;
}
.hero-actions button {
  font-size: 14px;
  min-height: 54px;
  padding: 14px 26px;
}
.hero-actions span {
  margin-left: 20px;
}
.hero-play,
.hero-build {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  width: 220px;
  height: 54px;
  min-height: 54px;
  max-height: 54px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2px;
  line-height: 1;
  white-space: nowrap;
  border-width: 1px;
  border-style: solid;
  box-shadow: inset 0 1px #fff4, 0 3px 0 #6f522b;
}
.hero-play {
  background: linear-gradient(135deg, #c4493a, #8d241c);
  color: #fff6ee;
  border-color: #e7a094;
}
.hero-build {
  background: linear-gradient(135deg, #efd39a, #c5964d);
  color: #201b12;
  border-color: #e3bf79;
}
.hero-play span,
.hero-build span { margin-left: 8px; font-size: 14px; }
.hero-assurance {
  display: flex;
  gap: 10px;
  align-items: center;
  color: #a6b5b0;
  font-size: 11px;
  margin-top: 20px;
}
.hero-assurance i {
  width: 3px;
  height: 3px;
  background: #b8965e;
  border-radius: 50%;
}
.hero-caption {
  position: absolute;
  right: 5vw;
  bottom: 38px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #dfcba6;
  font-size: 10px;
  letter-spacing: 2px;
  line-height: 2;
}
.hero-caption small {
  color: #99aaa6;
  font-size: 11px;
  letter-spacing: 0.4px;
}
.caption-rule {
  width: 40px;
  height: 1px;
  background: #b18b4d;
}
.home-path {
  max-width: 1440px;
  margin: auto;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: 42px;
  padding: 65px max(28px, 5vw) 60px;
}
.path-intro h2 {
  font-size: 31px;
  line-height: 1.2;
  margin: 15px 0;
}
.path-intro p,
.home-path article p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
  margin: 16px 0;
}
.home-path article {
  padding-top: 8px;
  border-top: 1px solid #a78d573b;
}
.path-number {
  font-size: 10px;
  letter-spacing: 2px;
  color: #b8a079;
}
.home-path h3 {
  font-size: 25px;
  margin: 20px 0 10px;
}
.home-path article .text-button {
  font-size: 12px;
}
.home-path .text-button span {
  margin-left: 12px;
}
.path-footnote {
  display: block;
  font: italic 13px/1.8 var(--serif);
  color: #ad9875;
}
.home-footer {
  max-width: 1280px;
  margin: auto;
  padding: 26px 30px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.home-footer > span {
  font: 16px var(--serif);
  letter-spacing: 2px;
  color: var(--gold);
}
.home-footer small {
  font: 9px var(--sans);
  letter-spacing: 2px;
  color: var(--muted);
}
.home-footer p {
  font-size: 11px;
  color: var(--muted);
}
.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  margin: 0;
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
  text-align: center;
  font: 12px/1.4 var(--sans);
  letter-spacing: 0.06em;
  color: var(--muted);
  background: linear-gradient(#0c101200, #0c1012f2 45%);
  pointer-events: none;
}
.site-footer a {
  pointer-events: auto;
  color: var(--gold);
  text-decoration: none;
  padding: 8px 2px;
}
.site-footer a:hover,
.site-footer a:focus-visible {
  text-decoration: underline;
}
body[data-mode="raid"] .site-footer,
body[data-view="build"] .site-footer {
  display: none;
}
/* A focused workshop with a bounded, independently scrolling palette. */
#workspace {
  grid-template-columns: 270px minmax(0, 1fr);
  min-height: calc(100dvh - 78px);
}
.sidebar {
  padding: 25px 20px;
  background: #11181a;
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  height: calc(100dvh - 1px);
  max-height: 1050px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #58615b #141b1d;
}
.sidebar h1 {
  font-size: 36px;
  line-height: 1.12;
  margin: 14px 0;
}
.sidebar .intro {
  font-size: 12px;
  line-height: 1.7;
  margin: 0 0 22px;
}
.sidebar > .eyebrow {
  font-size: 9px;
}
.sidebar-bottom {
  display: none;
}
.tool-tabs {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #111a1c;
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  margin-bottom: 14px;
}
.builder-history { display: inline-flex; gap: 6px; }
.builder-history[hidden] { display: none; }
.tool-tabs button {
  flex: 1;
  font-size: 11px;
  padding: 8px 4px;
  min-height: 38px;
  border-color: transparent;
  color: var(--muted);
}
.tool-tabs button[aria-pressed="true"] {
  background: #302a20;
  border-color: #80663d;
  color: #efd09b;
}
#builder-tools {
  display: block !important;
}
#builder-tools > .section-label {
  display: none !important;
}
#builder-tools .tools {
  display: none !important;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin: 0 0 15px;
}
#builder-tools[data-category="terrain"] #terrain-tools,
#builder-tools[data-category="hazard"] #hazard-tools,
#builder-tools[data-category="decor"] #decor-tools {
  display: grid !important;
}
body[data-guided="1"] #builder-tools .tool:not([hidden]) {
  display: flex !important;
  min-width: 0;
}
body[data-guided="1"] #builder-tools {
  display: block;
}
body[data-guided="1"] #all-tools {
  display: none;
}
.tool,
.tool.wide {
  background: #182122;
  height: 65px;
  width: auto;
  min-width: 0;
  flex-shrink: 1;
  padding: 9px;
  gap: 8px;
  border-color: #34403c;
}
.tool span:last-child {
  font-size: 11px;
  line-height: 1.3;
}
.tool small {
  font-size: 9px;
  line-height: 1.4;
  color: #a6b1aa;
}
.tool.selected {
  background: #302a20;
  border-color: #d1ad65;
  color: #efcf96;
  box-shadow: inset 3px 0 #d4b06e;
}
.tool img {
  width: 28px;
}
.tool .tool-icon {
  color: #cbb88c;
}
.palette-note {
  font-size: 10px;
  color: var(--muted);
  padding-bottom: 15px;
}
.theme-picker,
#decor-tools > label {
  grid-column: 1/-1;
  font-size: 11px;
  color: var(--muted);
}
.theme-picker select,
#decor-tools > label select {
  display: block;
  margin: 8px 0 0;
  width: 100%;
}
.advanced-builder {
  border-top: 1px solid var(--line);
  padding: 14px 0;
  margin-top: 8px;
}
.advanced-builder summary,
.workshop-drafts summary {
  cursor: pointer;
  font-size: 13px;
  color: #dcc18c;
  min-height: 38px;
  line-height: 38px;
}
.advanced-builder summary span {
  float: right;
  font-size: 10px;
  color: var(--muted);
}
.guard-relic p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}
.relic-picks label {
  border-color: var(--line);
  background: #151f20;
}
.practice-upgrades {
  margin: 15px 0;
  border-color: var(--line);
  background: #131c1e;
}
.practice-upgrades p {
  font-size: 11px;
  line-height: 1.6;
}
.practice-upgrades .section-label {
  font-size: 10px;
  color: #c1ac82;
}
.practice-upgrades-actions button {
  font-size: 11px;
}
.workshop-drafts {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 12px;
}
.workshop-drafts .dungeon-cards {
  display: block;
  margin: 0;
}
.workshop-drafts .dungeon-card {
  margin-top: 12px;
}
.workshop-drafts .dungeon-card-art {
  height: 100px;
}
.workshop-drafts .dungeon-card h3 {
  font-size: 20px;
}
.workshop-drafts .dungeon-card button {
  font-size: 11px;
}
.main-panel {
  padding: 24px 28px 0;
}
.journey {
  background: linear-gradient(110deg, #27302b, #182123);
  border-color: #a38a4d61;
  padding: 16px 20px;
  gap: 12px;
  margin-bottom: 22px;
}
.journey strong {
  font-size: 22px;
  color: #e9d4aa;
}
.journey p {
  font-size: 12px;
  color: #b6c1b9;
  line-height: 1.6;
}
.journey-actions button {
  font-size: 11px;
}
.mastery {
  border-color: #bb9c5e30;
  padding-top: 3px;
}
.mastery summary {
  font-size: 11px;
  font-weight: 400;
  color: #bfb08e;
  line-height: 28px;
  min-height: 28px;
}
.mastery li {
  border-color: var(--line);
  background: #131d1e;
}
.panel-heading {
  margin-bottom: 16px;
}
.name-label input {
  font-size: 29px;
  width: 360px;
  max-width: 100%;
  padding-top: 6px;
}
.panel-heading .eyebrow {
  font-size: 9px;
}
.heading-actions button {
  padding: 10px 12px;
}
.stats {
  background: #151e1f;
  border-color: #43504b66;
  padding: 14px 20px;
  min-height: 76px;
  gap: 32px;
}
.stats > div > span {
  font-size: 9px;
  letter-spacing: 1px;
  color: #a8b2a9;
}
.stats strong {
  font-size: 19px;
  margin-top: 4px;
}
.stats strong small {
  color: var(--muted);
}
.stats strong.amber {
  color: var(--gold);
  font-size: 13px;
  margin-top: 6px;
}
.status-chip > span {
  font-size: 10px !important;
  color: #a4b2a6;
}
.canvas-wrap {
  border-color: #43504b88;
  height: clamp(350px, calc(100dvh - 430px), 720px);
  background: #0a1113;
}
.map-badge {
  left: 16px;
  top: 16px;
  border-color: #a08a5055;
  color: #d8c69e;
  background: #0b1415e6;
  font-size: 9px;
  letter-spacing: 1.3px;
  padding: 8px 10px;
}
.zoom-controls {
  background: #101b1de8;
  border-color: #58645a;
  right: 12px;
  bottom: 12px;
}
.zoom-controls button {
  min-height: 36px;
  padding: 4px 12px;
  color: var(--gold);
}
#pan-map{display:inline-flex;align-items:center;justify-content:center;padding:4px 8px}
#pan-map svg{display:block;width:18px;height:18px}
#pan-map[aria-pressed="true"]{background:#302a20;border-color:#d8b578;color:#f0d7a4}
body[data-panning="armed"] #game{cursor:grab}
body[data-panning="grabbing"] #game{cursor:grabbing}
body[data-mode="raid"] #pan-map{display:none}
.zoom-controls span {
  font-size: 10px;
}
.map-coordinates {
  font-size: 9px;
  color: #9dab9e;
  left: 16px;
  bottom: 16px;
}
.map-footer {
  font-size: 11px;
  color: #a4b2a9;
  padding: 11px 0;
  line-height: 1.6;
}
.footer-shortcut {
  font-size: 10px;
  color: #8c9b91;
}
.publish-strip {
  margin-top: 8px;
  padding: 17px 0;
  border-color: var(--line);
}
.publish-strip p {
  font-size: 12px;
  color: #bac4bb;
  line-height: 1.5;
}
.publish-strip .eyebrow {
  font-size: 9px;
}
.publish-strip > div:last-child {
  gap: 8px;
}
.publish-strip button,
.publish-strip #publish {
  font-size: 11px;
}
.publish-strip #publish {
  min-height: 44px;
}
.publish-strip #publish span {
  font-size: 10px;
  margin-left: 6px;
}
/* Discovery: artwork carries the atmosphere; metadata carries the decision. */
#dungeon-browser {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 35px 50px;
  min-height: calc(100dvh - 78px);
}
.browser-heading {
  position: relative;
  isolation: isolate;
  margin: 0 -35px;
  padding: 46px 35px 40px;
  border-bottom: 1px solid #ba985938;
  overflow: hidden;
  background: #101b1e;
}
.browser-heading:before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, #101b1e 20%, #101b1e44),
    url("./assets/dominion/isometric/game-sprites/cover-base.webp") right 48%/650px auto no-repeat;
  opacity: 0.55;
}
.browser-heading h1 {
  font-size: 62px;
  margin: 15px 0;
}
.browser-heading p {
  font-size: 14px;
  color: #bfcac4;
}
.browser-note {
  font-size: 11px;
  color: #b6a27f;
}
.browser-controls {
  margin: 26px 0;
  gap: 20px;
  font-size: 12px;
}
.browser-controls select {
  font-size: 12px;
  margin-left: 8px;
}
#dungeon-browser h2 {
  font-size: 26px;
  margin: 28px 0 20px;
}
#dungeon-browser h2 small {
  font-size: 11px;
  color: #a8b5ad;
}
.dungeon-cards {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 22px;
  margin-bottom: 32px;
}
.dungeon-card {
  padding: 0 20px 20px;
  overflow: hidden;
  background: linear-gradient(145deg, #1b2526, #111a1c);
  border: 1px solid #48514880;
  border-radius: 6px;
  position: relative;
}
.dungeon-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px #0005;
  border-color: #ae8c51;
}
.dungeon-card-art {
  aspect-ratio: 16 / 9;
  height: auto;
  margin: 0 -20px 20px;
  position: relative;
  overflow: hidden;
  background: #152224;
}
.dungeon-card-art:after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(0deg, #172123 1%, transparent 65%);
  pointer-events: none;
}
.dungeon-card-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 70% 44%;
  transition: transform 0.4s;
}
.dungeon-card:hover .dungeon-card-art img {
  transform: scale(1.04);
}
.dungeon-card-art > span {
  position: absolute;
  top: 15px;
  left: 15px;
  z-index: 3;
  border: 1px solid #d2af6c66;
  padding: 5px 8px;
  background: #10191ce0;
  color: #e7cb92;
  font-size: 9px;
  letter-spacing: 1.5px;
}
.dungeon-card > .eyebrow {
  font-size: 9px;
}
.dungeon-card h3 {
  font-size: 25px;
  margin: 10px 0;
  color: #eddfc6;
}
.dungeon-card p {
  font-size: 12px;
  line-height: 1.8;
  color: #adbdb5;
  min-height: 42px;
}
.dungeon-card button {
  min-height: 42px;
  font-size: 12px;
}
.dungeon-card .watch-button {
  background: transparent !important;
  color: #b9c5bc !important;
  border-color: #394943;
  box-shadow: none;
  font-size: 11px;
}
.dungeon-card .card-gold {
  font: 26px var(--serif);
  margin: 15px 0;
  color: #efc775;
}
.dungeon-card .card-gold-label {
  font-size: 16px;
  color: #c9b48a;
}
.empty-state {
  grid-column: 1/-1;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 24px;
  border: 1px dashed #5a655c;
  background: #121b1d;
  border-radius: 5px;
  min-height: 125px;
}
.empty-state-icon {
  font-size: 32px;
  color: #b89a65;
}
.empty-state h3 {
  font: 22px var(--serif);
  margin: 0 0 6px;
}
.empty-state p {
  font-size: 12px;
  color: #a5b4ab;
  margin: 0;
  line-height: 1.7;
}
.empty-state button {
  margin-left: auto;
  white-space: nowrap;
}
.browser-controls input {
  accent-color: var(--gold);
}
#list-message {
  color: #edc580;
  font-size: 13px;
}
.growth-badge,
#mastery-track {
  background: #1a2828;
  border-color: #546252;
  color: #c6cbb3;
  font-size: 11px;
}
/* Dialogs are readable on every device, with a clear next action. */
dialog {
  background: linear-gradient(150deg, #1c2829, #10191c);
  border: 1px solid #8d754c;
  padding: 30px;
  border-radius: 7px;
  max-height: calc(100dvh - 28px);
  overflow: auto;
  color: var(--text);
  scrollbar-width: thin;
}
/* Opening the loadout focuses the dialog and its scrolling body. The browser
   draws that focus as a light inner outline on top of the dialog border. */
#loadout-dialog:focus,
#loadout-dialog:focus-visible,
#loadout-dialog .loadout-scroll,
#loadout-dialog .loadout-scroll:focus,
#loadout-dialog .loadout-scroll:focus-visible {
  outline: none;
}
dialog::backdrop {
  background: #03090cce;
  backdrop-filter: blur(7px);
}
dialog h2 {
  font-size: 34px;
  margin: 16px 0;
  line-height: 1.15;
  color: #eddfc7;
}
dialog p {
  font-size: 13px;
  line-height: 1.75;
  color: #b4c0b8;
}
dialog label {
  font-size: 12px;
  color: #bcc7c1;
}
dialog input,
dialog select {
  background: #0e181b;
  border-color: #42524c;
  color: #eee6d8;
}
dialog .dialog-close {
  min-width: 44px;
  min-height: 44px;
  color: #bcc8c0;
}
dialog .dialog-actions {
  gap: 10px;
}
dialog .primary {
  font-size: 13px;
}
#auth-error,
#loadout-error {
  color: #f2ae92;
}
#auth-form > .primary {
  margin-top: 18px;
}
.loadout-intro {
  margin-bottom: 12px;
}
#loadout-dialog {
  max-width: 600px;
}
#loadout-balance {
  font-size: 12px;
  color: #c2b291;
  padding: 10px 12px;
  background: #0b1517;
  border-left: 2px solid #bc9859;
}
.weapon-row {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: none !important;
  border: none !important;
  padding: 0 !important;
}
.weapon-row label {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 6px;
  position: relative;
  border: 1px solid #46564d;
  background: #142022;
  padding: 15px;
  margin: 0;
  border-radius: 5px;
  cursor: pointer;
}
.weapon-row label:has(:checked) {
  border-color: #d8b16d;
  background: #2b2b24;
  box-shadow: inset 0 0 0 1px #d8b16d33;
}
.weapon-row input {
  width: 16px !important;
  margin: 7px 0 0 !important;
  accent-color: #d8b16d;
}
.weapon-row strong {
  font: 21px var(--serif);
  color: #f1dfbd;
  grid-column: 2;
  grid-row: 1;
}
.weapon-row .gear-art {
  grid-column: 1;
  grid-row: 2;
  font: 22px var(--serif);
  color: #d9bc80;
}
.weapon-row label > span:last-child {
  grid-column: 2;
  font-size: 11px;
  line-height: 1.6;
  color: #b3c1b7;
}
.gear-row:not(.weapon-row) {
  margin: 12px 0;
  background: #131f20;
  border: 1px solid #35443e;
  padding: 12px;
  gap: 12px;
  display: flex;
}
.gear-row strong {
  color: #dfcfad;
  white-space: nowrap;
  font-size: 12px;
}
.gear-row > span {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
}
.potion-row {
  border-color: #35453f;
  padding: 13px 0;
  gap: 12px;
}
.potion-row strong {
  font-size: 13px;
  color: #e6dcc9;
}
#loadout-dialog .unlock-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #241e16;
  color: #a89878;
  font: 600 11px/1.3 Arial, sans-serif;
  letter-spacing: .2px;
  vertical-align: 3px;
  white-space: nowrap;
}
.potion-row small {
  font-size: 11px;
  color: #adbbb1;
  margin-top: 4px;
}
.stepper button {
  min-width: 40px;
  min-height: 40px;
  background: #1c2c2c;
  border-color: #52634f;
  font-size: 19px;
}
.stepper output {
  font-size: 15px;
  color: #e7d4aa;
  min-width: 24px;
  text-align: center;
}
.loadout-relics {
  margin-top: 16px;
  border: 1px solid #455048;
  border-radius: 4px;
  padding: 0 14px;
}
.loadout-relics summary {
  min-height: 48px;
  padding: 13px 0;
  cursor: pointer;
  color: #e1c58d;
  font-size: 13px;
}
.loadout-relics summary small {
  float: right;
  color: #a5b5ab;
  font-size: 11px;
}
.relic-picks label {
  font-size: 12px;
  line-height: 1.5;
}
.relic-picks label input {
  accent-color: #d8b16d;
}
.relic-picks select {
  font-size: 11px;
  max-width: 130px;
}
.relic-picks label:has(:checked) {
  border-color: #c4a467;
  background: #302c22;
}
#loadout-slots {
  font-size: 12px;
  color: #c8b48a;
  margin: 18px 0 0;
}
#loadout-form > .dialog-actions {
  position: sticky;
  bottom: -30px;
  background: #111c1f;
  border-top: 1px solid #485244;
  padding: 16px 0 6px;
  margin-top: 14px;
  z-index: 2;
}
#loadout-form > .dialog-actions .primary {
  flex: 1;
  max-width: 260px;
}
#loadout-relic-note {
  font-size: 12px;
}
.dialogue-copy h2 {
  font-size: 21px;
}
.object-dialogue {
  background: #111f22f5;
  border-color: #c2a36c;
}
.dialogue-copy p {
  font-size: 13px;
  color: #d4ddd5;
}
.dialogue-copy button {
  min-height: 44px;
}
/* Raids occupy the viewport. Controls support the game rather than framing it. */
body[data-mode="raid"] #workspace {
  display: block;
  min-height: 0;
}
body[data-mode="raid"] .topbar {
  height: 58px;
  min-height: 58px;
}
body[data-mode="raid"] .sidebar {
  display: none;
}
body[data-mode="raid"] .main-panel {
  max-width: 1600px;
  padding: 12px 24px 0;
  width: 100%;
  margin: auto;
}
body[data-mode="raid"] .panel-heading {
  margin-bottom: 10px;
}
body[data-mode="raid"] .name-label input {
  font-size: 25px;
}
body[data-mode="raid"] .stats {
  background: #142022;
  border-color: #4c5b4b;
  min-height: 76px;
  padding: 5px 16px;
  gap: 26px;
}
body[data-mode="raid"] .canvas-wrap {
  height: calc(100dvh - 310px);
  min-height: 280px;
}
body[data-mode="raid"] .resource-orb {
  width: 58px;
  height: 72px;
}
.orb-number {
  font-size: 11px;
}
.orb-number strong {
  font-size: 15px !important;
}
.orb-number span {
  color: #d3d7cc;
}
body[data-mode="raid"] #raid-controls:not([hidden]) {
  position: relative;
  display: flex !important;
  min-height: 68px;
  height: 68px;
  margin: 0;
  padding: 10px 0;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: #dce0d2;
}
#raid-controls .controller-label {
  display: none;
}
#raid-controls .hotbar {
  display: flex;
  gap: 6px;
  order: 2;
  margin: 0;
}
#raid-controls .dpad {
  display: none;
}
#raid-controls .action-buttons {
  display: flex !important;
  order: 1;
  gap: 6px;
  max-width: none;
}
#raid-controls .action-buttons button,
#raid-controls .action-buttons button:last-child {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: auto;
  height: 44px;
  min-width: 95px;
  margin: 0;
  padding: 6px 10px;
  border-radius: 4px;
  background: #1b2a2a;
  border: 1px solid #59634e;
  box-shadow: none;
  color: #e8d7b6;
  font-size: 19px;
}
#raid-controls .action-buttons small {
  font: 11px var(--sans);
  margin: 0;
  white-space: nowrap;
}
#raid-controls kbd {
  font: 10px var(--sans);
  min-width: 18px;
  height: 19px;
  margin-left: 4px;
  background: #0c1719;
  color: #b3c4b8;
  border-color: #42524c;
}
#raid-controls .hotbar button {
  background: #142023;
  border: 1px solid #49594f;
  box-shadow: none;
  width: 44px;
  height: 44px;
  padding: 3px;
  margin: 0;
  min-height: 0;
  color: #e2d4b9;
}
#raid-controls .hotbar button.empty {
  opacity: 0.45;
}
#raid-controls .hotbar button small {
  font-size: 9px;
  line-height: 1.2;
  margin: 0;
}
#raid-controls .hotbar button b {
  font-size: 12px;
  line-height: 1.2;
}
#leave-at-entrance,
#raid-controls > .leave-button {
  order: 3;
  font-size: 11px !important;
  width: auto !important;
  height: 40px !important;
  min-height: 40px;
  background: transparent !important;
  border: 1px solid #4b5950 !important;
  box-shadow: none !important;
  padding: 7px 12px !important;
  color: #c2cabe !important;
}
#raid-controls button:disabled {
  transform: none;
}
body[data-mode="raid"] .map-footer {
  font-size: 11px;
  padding: 4px 0 10px;
  min-height: 30px;
}
.result-actions {
  background: linear-gradient(120deg, #27302a, #142022);
  border-color: #b09356;
  padding: 20px;
  margin: 12px 0 24px;
  gap: 12px;
}
.result-actions > strong {
  font: 26px var(--serif);
  color: #eed1a0;
}
.result-actions .death-message {
  font: 14px/1.7 var(--sans);
  color: #bfcbc1;
  max-width: 60ch;
}
.result-medal {
  font-size: 12px;
  color: #e2c088;
}
#raid-banner {
  max-width: min(90%, 540px);
  font-size: 21px;
  line-height: 1.5;
  padding: 15px 20px;
  background: #0a1619eb;
  border-color: #bc9c5e;
  color: #ead19e;
  top: 22px;
  z-index: 3;
}
#raid-banner .death-message {
  font: 13px/1.6 var(--sans);
  color: #c6cec4;
}
#raid-banner #practice-death-note {
  font: 12px/1.6 var(--sans);
  color: #a9b8ac;
}
.loading-screen {
  background: #0c1619 url("./assets/dominion/isometric/game-sprites/cover-base.webp") center/cover
    no-repeat;
  isolation: isolate;
}
.loading-screen:before {
  content: "";
  position: absolute;
  inset: 0;
  background: #071012dc;
  z-index: -1;
}
.loading-screen h1 {
  font-size: 44px;
  letter-spacing: 8px;
}
.loading-screen p {
  color: #b9c9be;
}
.loading-orb {
  border-color: #5b5848;
  border-top-color: #e2bf7e;
}
.loading-screen progress {
  accent-color: #d5ad69;
}
#toast {
  background: #1c2b2b;
  border-color: #b59861;
  color: #e7ddc6;
  font-size: 12px;
  z-index: 20;
}
@media (max-width: 1100px) {
  .topbar {
    gap: 24px;
    padding: 0 24px;
  }
  .topbar nav {
    gap: 18px;
  }
  .account {
    gap: 8px;
  }
  .account > span {
    font-size: 9px;
  }
  #workspace {
    grid-template-columns: 230px minmax(0, 1fr);
  }
  .sidebar {
    padding: 22px 15px;
  }
  .sidebar h1 {
    font-size: 32px;
  }
  .tool {
    padding: 8px 6px;
    gap: 5px;
  }
  .tool span:last-child {
    font-size: 10px;
  }
  .main-panel {
    padding: 20px;
  }
  .journey {
    padding: 14px;
  }
  .journey-actions {
    gap: 6px;
  }
  .journey-actions button {
    padding: 10px;
  }
  .home-path {
    gap: 25px;
    padding: 45px 30px;
  }
  .home-path h3 {
    font-size: 22px;
  }
  .hero-copy h1 {
    font-size: 70px;
  }
  .hero-copy > p {
    font-size: 15px;
  }
  .hero-copy {
    max-width: 480px;
  }
  .stats {
    gap: 22px;
  }
  .publish-strip {
    flex-wrap: wrap;
  }
  .publish-strip > div:last-child {
    margin-left: auto;
  }
  #raid-controls:not([hidden]) {
    gap: 12px;
  }
  #raid-controls .action-buttons button {
    min-width: 80px;
  }
  .account .sound-toggle {
    padding: 8px;
  }
}
@media (max-width: 760px) {
  .topbar {
    height: 104px;
    min-height: 104px;
    gap: 6px 16px;
    padding: 12px 18px;
    flex-wrap: wrap;
  }
  .brand {
    font-size: 13px;
    gap: 10px;
  }
  .brand b {
    font-size: 18px;
    letter-spacing: 2px;
  }
  .brand small {
    display: block;
    font-size: 6px;
    letter-spacing: 2.6px;
  }
  .brand-mark {
    width: 27px;
    height: 27px;
    font-size: 26px;
  }
  .account {
    gap: 7px;
    margin-left: auto;
  }
  .account > span,
  #raider-rank {
    display: none;
  }
  .account button {
    font-size: 11px;
    padding: 7px 10px;
    min-height: 36px;
  }
  .account #connect-wallet {
    display: none;
  }
  .account .sound-toggle {
    padding: 7px 8px;
    font-size: 10px;
  }
  .topbar nav {
    order: 3;
    width: 100%;
    height: 33px;
    justify-content: flex-start;
    gap: 25px;
    padding-left: 0;
  }
  .nav-button {
    font-size: 12px;
    min-height: 33px;
    padding: 0;
  }
  .nav-button.active:after {
    bottom: -5px;
  }
  .home-hero {
    height: auto;
    min-height: 650px;
    padding: 235px 25px 45px;
    align-items: flex-end;
    background-position: 69% top;
    background-size: auto 650px;
  }
  .home-hero:before {
    background: linear-gradient(
      0deg,
      #0c1012 1%,
      #0b1316ed 23%,
      #0b1316aa 50%,
      #0b131618 85%
    );
  }
  .hero-copy {
    max-width: 100%;
  }
  .hero-copy > .eyebrow {
    font-size: 8px;
    letter-spacing: 1.7px;
    gap: 8px;
  }
  .hero-spark {
    font-size: 17px;
  }
  .hero-copy h1 {
    font-size: 53px;
    line-height: 1.09;
    letter-spacing: -1.6px;
    margin: 15px 0 19px;
  }
  .hero-copy > p {
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 25px;
  }
  .hero-actions {
    gap: 10px;
    flex-wrap: wrap;
  }
  .hero-actions button {
    min-height: 50px;
    padding: 12px 16px;
    font-size: 12px;
  }
  .hero-actions span {
    margin-left: 12px;
  }
  .hero-play,
  .hero-build {
    min-width: 0;
    width: calc(50% - 6px);
    height: 48px;
    min-height: 48px;
    max-height: 48px;
    flex: 1 1 calc(50% - 6px);
    padding: 0 8px;
    font-size: 12px;
    letter-spacing: 0;
    white-space: nowrap;
  }
  .hero-assurance {
    font-size: 10px;
    margin-top: 20px;
    gap: 8px;
  }
  .hero-caption {
    display: none;
  }
  .home-path {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 24px 25px 35px;
  }
  .path-intro {
    padding-bottom: 6px;
  }
  .path-intro h2 {
    font-size: 30px;
  }
  .path-intro h2 br {
    display: none;
  }
  .path-intro p {
    display: none;
  }
  .home-path article {
    padding: 20px 0 0;
  }
  .home-path h3 {
    font-size: 25px;
    margin: 12px 0;
  }
  .home-path article p {
    font-size: 13px;
    margin: 10px 0;
  }
  .home-footer {
    padding: 24px 25px;
    flex-wrap: wrap;
    gap: 10px;
  }
  .home-footer > span {
    font-size: 14px;
  }
  .home-footer p {
    order: 3;
    margin: 0;
  }
  #workspace {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  .main-panel {
    padding: 15px 12px 0;
  }
  .sidebar {
    order: 2;
    position: relative !important;
    top: auto;
    bottom: auto !important;
    height: auto;
    max-height: none !important;
    overflow: visible !important;
    padding: 15px 12px !important;
    border-top: 1px solid #4b584c;
    background: #111a1c !important;
  }
  .sidebar > h1,
  .sidebar > .eyebrow,
  .sidebar > .intro {
    display: none;
  }
  #builder-tools {
    display: block !important;
  }
  .tool-tabs {
    position: sticky;
    top: 0;
    background: #111a1c;
    z-index: 2;
    gap: 5px;
    margin-bottom: 10px;
    padding: 5px 0 10px;
  }
  .tool-tabs button {
    font-size: 12px;
    min-height: 42px;
  }
  #builder-tools .tools {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    max-width: 100%;
    margin: 0 0 10px;
  }
  .tool,
  .tool.wide {
    width: auto;
    height: 62px;
    min-width: 0;
    padding: 7px;
    grid-column: span 1;
    gap: 6px;
  }
  .tool img,
  .tool.wide img {
    width: 24px;
    height: 28px;
  }
  .tool .tool-icon {
    width: 24px;
    font-size: 22px;
  }
  .tool span:last-child {
    font-size: 10px;
  }
  .tool small {
    font-size: 8px;
    line-height: 1.4;
  }
  .palette-note {
    display: none;
  }
  #decor-tools .theme-picker,
  #decor-tools > label {
    grid-column: 1/-1;
  }
  .advanced-builder {
    margin-top: 14px;
  }
  .practice-upgrades-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .workshop-drafts .dungeon-cards {
    display: grid;
    grid-template-columns: 1fr;
  }
  .journey {
    padding: 12px;
    margin-bottom: 15px;
    gap: 8px;
  }
  .journey > div:first-child {
    min-width: 0;
    flex-basis: 100%;
  }
  .journey strong {
    font-size: 20px;
  }
  .journey p {
    font-size: 11px;
    line-height: 1.6;
    margin: 6px 0;
  }
  .journey-actions {
    flex-wrap: wrap;
    gap: 7px;
  }
  .journey-actions button {
    font-size: 11px;
    min-height: 42px;
    padding: 9px 11px;
  }
  .mastery {
    margin-top: 2px;
  }
  .mastery summary {
    font-size: 10px;
    min-height: 28px;
  }
  .panel-heading {
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
  }
  .panel-heading > div:first-child {
    min-width: 0;
    flex: 1;
  }
  .name-label input {
    font-size: 24px;
    max-width: 100%;
    width: 240px;
  }
  .panel-heading .eyebrow {
    font-size: 8px;
  }
  .heading-actions {
    position: static !important;
    background: none !important;
    gap: 6px;
    flex-wrap: nowrap;
  }
  .heading-actions button {
    font-size: 10px;
    padding: 8px 9px;
    min-height: 40px;
  }
  .heading-actions #save {
    display: none;
  }
  .stats {
    min-height: 68px;
    padding: 12px;
    gap: 22px;
  }
  .stats > div > span {
    font-size: 8px;
    letter-spacing: 0.6px;
  }
  .stats strong {
    font-size: 17px;
  }
  .stats strong.amber {
    font-size: 11px;
  }
  .meter {
    width: 80px;
  }
  .status-chip {
    display: none;
  }
  .canvas-wrap,
  body[data-mode="builder"] .canvas-wrap {
    height: 44dvh;
    min-height: 280px;
  }
  .map-badge {
    font-size: 8px;
    top: 10px;
    left: 10px;
    padding: 7px 8px;
  }
  .map-coordinates {
    left: 10px;
    font-size: 8px;
    bottom: 14px;
  }
  .zoom-controls {
    right: 8px;
    bottom: 8px;
  }
  .zoom-controls button {
    min-height: 36px;
    padding: 4px 10px;
  }
  .zoom-controls span {
    font-size: 9px;
    min-width: 32px;
  }
  .map-footer {
    padding: 8px 0;
    min-height: 40px;
    font-size: 10px;
  }
  .publish-strip {
    gap: 12px;
    align-items: flex-start;
    padding: 14px 0;
    margin-top: 0;
  }
  .publish-strip > div:first-child {
    max-width: none;
    width: 100%;
  }
  .publish-strip p {
    font-size: 11px;
    max-width: none;
    margin-top: 5px;
  }
  .publish-strip .eyebrow {
    font-size: 8px;
  }
  .publish-strip > div:last-child {
    margin: 0;
    width: 100%;
    display: flex;
    justify-content: flex-start;
    gap: 8px;
  }
  .publish-strip #new-dungeon {
    display: block;
    font-size: 10px;
    padding: 8px;
  }
  .publish-strip #publish {
    font-size: 10px;
    padding: 8px;
  }
  .publish-strip #publish span {
    font-size: 9px;
    margin: 2px 0 0;
    display: block;
  }
  #dungeon-browser {
    padding: 0 18px 35px;
  }
  .browser-heading {
    margin: 0 -18px;
    padding: 32px 22px;
  }
  .browser-heading:before {
    background-size: 540px auto;
    background-position: 65% 48%;
    opacity: 0.35;
  }
  .browser-heading h1 {
    font-size: 45px;
    margin: 15px 0;
  }
  .browser-heading p {
    font-size: 13px;
    max-width: 260px;
    line-height: 1.7;
  }
  .browser-note {
    font-size: 10px;
  }
  .browser-controls {
    margin: 20px 0;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 11px;
  }
  .browser-controls select {
    font-size: 11px;
    padding: 9px 6px;
  }
  .browser-controls button {
    font-size: 11px;
  }
  #dungeon-browser h2 {
    font-size: 25px;
    margin: 24px 0 15px;
  }
  #dungeon-browser h2 small {
    display: block;
    margin: 6px 0 0;
    font-size: 11px;
  }
  .dungeon-cards {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .dungeon-card-art {
    height: 165px;
  }
  .dungeon-card h3 {
    font-size: 25px;
  }
  .dungeon-card p {
    font-size: 12px;
  }
  .empty-state {
    flex-wrap: wrap;
    padding: 22px;
    gap: 15px;
  }
  .empty-state-icon {
    display: none;
  }
  .empty-state button {
    margin: 0;
  }
  .empty-state h3 {
    font-size: 22px;
  }
  .empty-state p {
    font-size: 12px;
  }
  dialog {
    padding: 24px 20px;
    width: calc(100% - 24px);
    max-height: calc(100dvh - 24px);
  }
  dialog h2 {
    font-size: 30px;
    margin-top: 15px;
  }
  dialog p {
    font-size: 12px;
  }
  dialog label {
    font-size: 12px;
  }
  dialog .primary {
    font-size: 12px;
    min-height: 44px;
  }
  .weapon-row {
    gap: 8px;
  }
  .weapon-row label {
    padding: 12px 9px;
    gap: 5px;
  }
  .weapon-row strong {
    font-size: 19px;
  }
  .weapon-row label > span:last-child {
    font-size: 10px;
  }
  .gear-row:not(.weapon-row) {
    display: block;
  }
  .gear-row > span {
    display: block;
    margin-top: 5px;
  }
  .potion-row {
    gap: 8px;
  }
  .potion-row strong {
    font-size: 12px;
  }
  .potion-row small {
    font-size: 10px;
    line-height: 1.5;
    max-width: 180px;
  }
  .stepper button {
    min-width: 36px;
    min-height: 38px;
    padding: 4px;
  }
  .loadout-relics {
    padding: 0 10px;
  }
  .loadout-relics summary {
    font-size: 12px;
  }
  .loadout-relics summary small {
    font-size: 10px;
  }
  #loadout-form > .dialog-actions {
    bottom: -24px;
    padding-bottom: 6px;
  }
  .relic-picks label {
    padding: 10px;
    font-size: 11px;
  }
  .relic-picks select {
    max-width: 110px;
    font-size: 10px;
  }
  #loadout-slots {
    font-size: 11px;
  }
  .object-dialogue {
    left: 8px;
    right: 8px;
    bottom: 8px;
    padding: 12px;
    gap: 10px;
  }
  .dialogue-copy h2 {
    font-size: 18px;
  }
  .dialogue-copy p {
    font-size: 12px;
  }
  .dialogue-copy button {
    min-height: 40px;
    padding: 8px;
  }
  body[data-mode="raid"] .topbar {
    height: 44px;
    min-height: 44px;
    padding: 4px 12px;
    flex-wrap: nowrap;
  }
  body[data-mode="raid"] .topbar nav {
    display: none;
  }
  body[data-mode="raid"] .brand-mark {
    width: 23px;
    height: 23px;
    font-size: 22px;
  }
  body[data-mode="raid"] .brand b {
    font-size: 14px;
  }
  body[data-mode="raid"] .brand small {
    display: none;
  }
  body[data-mode="raid"] .account {
    gap: 6px;
  }
  body[data-mode="raid"] .account .sound-toggle {
    font-size: 9px;
    min-height: 30px;
    padding: 5px;
  }
  body[data-mode="raid"] .account #account-button {
    display: none;
  }
  body[data-mode="raid"] .main-panel {
    padding: 6px 8px 0;
  }
  body[data-mode="raid"] .panel-heading {
    margin-bottom: 6px;
    flex-wrap: nowrap;
  }
  body[data-mode="raid"] .name-label input {
    font-size: 20px;
    width: 215px;
  }
  body[data-mode="raid"] .panel-heading .eyebrow {
    font-size: 7px;
  }
  body[data-mode="raid"] #return-builder {
    font-size: 10px;
    min-height: 34px;
    padding: 6px 10px;
  }
  body[data-mode="raid"] .stats {
    padding: 3px 8px;
    min-height: 63px;
    gap: 16px;
  }
  body[data-mode="raid"] .orb-hud {
    gap: 5px;
  }
  body[data-mode="raid"] .resource-orb {
    width: 46px;
    height: 59px;
  }
  body[data-mode="raid"] .resource-orb > small {
    font-size: 6px;
    letter-spacing: 0.8px;
  }
  body[data-mode="raid"] .orb-number {
    font-size: 9px;
    bottom: 10px;
  }
  body[data-mode="raid"] .orb-number strong {
    font-size: 12px !important;
  }
  body[data-mode="raid"] .orb-rim {
    bottom: 13px;
  }
  body[data-mode="raid"] .stats > div > span {
    font-size: 7px;
  }
  body[data-mode="raid"] .stats strong {
    font-size: 13px;
  }
  body[data-mode="raid"] .stats strong.amber {
    font-size: 10px;
  }
  body[data-mode="raid"] .canvas-wrap {
    height: calc(100dvh - 334px);
    min-height: 180px;
  }
  body[data-mode="raid"] .map-badge {
    max-width: 55%;
    font-size: 7px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    padding: 5px 7px;
    left: 8px;
    top: 8px;
  }
  body[data-mode="raid"] .zoom-controls {
    bottom: 6px;
    right: 6px;
  }
  body[data-mode="raid"] .zoom-controls button {
    min-height: 30px;
    padding: 2px 8px;
    font-size: 16px;
  }
  body[data-mode="raid"] .zoom-controls span {
    min-width: 24px;
    font-size: 8px;
  }
  body[data-mode="raid"] #raid-controls:not([hidden]) {
    height: 142px;
    min-height: 142px;
    display: grid !important;
    grid-template-columns: 120px 1fr;
    grid-template-rows: 36px 88px;
    gap: 6px 12px;
    padding: 6px 3px;
    margin: 0;
    background: #101c1e;
    border: 1px solid #394b43;
    border-top: 0;
    border-radius: 0 0 6px 6px;
    box-shadow: none;
  }
  #raid-controls .hotbar {
    grid-column: 1/-1;
    grid-row: 1;
    justify-content: center;
    gap: 6px;
    order: 0;
  }
  #raid-controls .hotbar button {
    width: 36px;
    height: 34px;
    border-radius: 4px;
    padding: 2px;
    min-height: 0;
  }
  #raid-controls .hotbar button small {
    font-size: 7px;
  }
  #raid-controls .hotbar button b {
    font-size: 10px;
  }
  #raid-controls .dpad {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    grid-column: 1;
    grid-row: 2;
    width: 120px;
    margin: 0;
  }
  #raid-controls .dpad > div {
    display: flex;
  }
  #raid-controls .dpad button {
    width: 38px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    margin: 1px;
    background: #1e3031;
    border: 1px solid #5b6c5e;
    color: #e0d5bb;
    box-shadow: 0 2px #071113;
    border-radius: 5px;
    font-size: 18px;
  }
  #raid-controls .action-buttons {
    grid-column: 2;
    grid-row: 2;
    justify-content: flex-end;
    gap: 6px;
    width: auto;
    max-width: none;
    order: 0;
    align-self: center;
  }
  #raid-controls .action-buttons button,
  #raid-controls .action-buttons button:last-child {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    width: 58px;
    height: 58px;
    min-height: 44px;
    padding: 4px;
    margin: 0;
    border: 1px solid #9b8052;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 20%, #3f3c2d, #1e2927);
    font-size: 22px;
    box-shadow: 0 3px #070e10;
  }
  #raid-controls .action-buttons button:last-child {
    width: 50px;
    height: 48px;
    border-color: #4f665c;
    background: #1b2c2c;
    font-size: 17px;
  }
  #raid-controls .action-buttons small {
    font-size: 8px;
    line-height: 1.3;
  }
  #raid-controls .action-buttons kbd {
    display: none;
  }
  #leave-at-entrance,
  #raid-controls > .leave-button {
    position: absolute;
    left: 8px;
    top: 8px;
    min-height: 30px !important;
    height: 30px !important;
    font-size: 8px !important;
    padding: 3px 6px !important;
    max-width: 85px;
  }
  body[data-mode="raid"] .map-footer {
    font-size: 9px;
    min-height: 34px;
    padding: 5px 0;
    line-height: 1.4;
  }
  body[data-mode="raid"] .map-footer .key-hint {
    display: none;
  }
  .result-actions {
    margin: 10px 0 16px;
    padding: 15px;
    gap: 10px;
  }
  .result-actions > strong {
    font-size: 23px;
    flex-basis: 100%;
  }
  .result-actions .death-message {
    font-size: 12px;
  }
  .result-actions button {
    min-height: 44px;
    font-size: 12px;
  }
  .result-medal {
    font-size: 11px;
  }
  .raid-status {
    font-size: 17px;
  }
  #raid-banner {
    font-size: 16px;
    padding: 12px;
    top: 45px;
    width: 85%;
    max-width: 85%;
  }
  #raid-banner .death-message {
    font-size: 11px;
  }
  #raid-banner #practice-death-note {
    font-size: 10px;
  }
  #toast {
    font-size: 11px;
    padding: 12px 16px;
    bottom: 18px;
    max-width: 94%;
  }
}
@media (max-width: 370px) {
  .hero-copy h1 {
    font-size: 47px;
  }
  .hero-actions button {
    padding: 12px;
    font-size: 11px;
  }
  .hero-play,
  .hero-build {
    width: 100%;
    min-width: 0;
    height: 48px;
    min-height: 48px;
    max-height: 48px;
    font-size: 13px;
    white-space: nowrap;
  }
  .topbar {
    padding-left: 16px;
    padding-right: 16px;
  }
  .stats {
    gap: 15px;
  }
  .stats > div > span {
    font-size: 7px;
  }
  .stats strong {
    font-size: 15px;
  }
  #raid-controls .action-buttons {
    gap: 4px;
  }
  #raid-controls .action-buttons button {
    width: 50px;
    height: 54px;
  }
  #raid-controls .action-buttons button:last-child {
    width: 44px;
  }
  .publish-strip #new-dungeon {
    display: none;
  }
  body[data-mode="raid"] .name-label input {
    width: 180px;
    font-size: 18px;
  }
}
@media (max-height: 550px) and (orientation: landscape) {
  body[data-mode="raid"] .topbar {
    display: none;
  }
  body[data-mode="raid"] .panel-heading {
    margin-bottom: 3px;
  }
  body[data-mode="raid"] .main-panel {
    padding: 4px 8px;
  }
  body[data-mode="raid"] .stats {
    min-height: 48px;
  }
  body[data-mode="raid"] .resource-orb {
    width: 36px;
    height: 45px;
  }
  body[data-mode="raid"] .canvas-wrap {
    height: calc(100dvh - 170px);
    min-height: 120px;
  }
  body[data-mode="raid"] #raid-controls:not([hidden]) {
    height: 62px;
    min-height: 62px;
    display: flex !important;
    padding: 4px;
    gap: 12px;
  }
  #raid-controls .dpad {
    flex-direction: row;
    width: auto;
  }
  #raid-controls .dpad button {
    width: 32px;
    height: 32px;
    min-height: 32px;
  }
  #raid-controls .action-buttons button,
  #raid-controls .action-buttons button:last-child {
    width: 42px;
    height: 42px;
    min-height: 42px;
  }
  #raid-controls .hotbar {
    margin-left: auto;
  }
  body[data-mode="raid"] .map-footer {
    display: none;
  }
  #leave-at-entrance,
  #raid-controls > .leave-button {
    position: static;
    max-width: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .dungeon-card:hover,
  .primary:hover {
    transform: none;
  }
}
/* Keep the final skin above legacy ID-specific layout rules. */
.brand-mark {
  transform: none;
  border: 0;
  width: 38px;
  height: 38px;
}
.brand-mark svg {
  width: 100%;
  height: 100%;
  stroke: #dfb86b;
  stroke-width: 1.2;
}
#loadout-dialog .weapon-row strong {
  font: 21px var(--serif);
}
#loadout-dialog .weapon-row label > span:last-child {
  font-size: 11px;
}
#loadout-dialog .potion-row {
  background: transparent;
  padding: 14px 0;
  border-width: 0 0 1px;
  border-radius: 0;
}
#loadout-dialog .potion-row small {
  font-size: 11px;
}
#raid-controls .action-buttons button {
  min-width: 90px;
}
body[data-mode="raid"] #canvas-wrap {
  height: calc(100dvh - 310px);
  min-height: 280px;
}
body[data-mode="builder"] #canvas-wrap {
  height: clamp(350px, calc(100dvh - 430px), 720px);
}
.builder-bar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:0 0 8px;position:relative;z-index:7}
.dungeon-switch{display:inline-flex;align-items:center;gap:8px;max-width:min(280px,46vw);min-height:36px;padding:6px 12px;background:#172426;border-color:#8e7546;color:#ead7b2;font:600 14px/1.2 var(--serif)}
.dungeon-switch span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dungeon-switch::after{content:"▾";font:11px/1 var(--sans);color:#d8b578}
.builder-floor-slot{display:flex;min-width:0}
.builder-bar .floor-tabs{display:flex;flex-wrap:wrap;gap:4px;grid-template-columns:none}
.builder-bar .floor-tabs button{width:auto;min-height:36px;padding:6px 10px}
.builder-bar .floor-tabs button:disabled{background:#12181a;border-color:#3a4442;color:#8d9894;box-shadow:none;cursor:default;opacity:1}
.builder-bar .floor-tabs small{display:none}
.builder-bar .floor-tabs strong{font-size:13px}
.builder-bar .floor-panel-footer{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:0 0 0 auto}
.builder-bar #builder-level{display:none}
.builder-bar .floor-space{display:flex;align-items:center;gap:8px}
.builder-bar #floor-depth{display:none}
body[data-mode="builder"] .main-panel{display:flex;flex-direction:column;position:relative}
body[data-mode="builder"] .main-panel>*{order:8}
body[data-mode="builder"] #builder-bar{order:1;flex:none}
body[data-mode="builder"] #canvas-wrap{order:2;flex:1 1 auto;height:auto!important;min-height:240px}
body[data-mode="builder"] .panel-heading{order:3;flex:none}
body[data-mode="builder"] .stats{order:4;flex:none}
body[data-mode="builder"] .map-footer{order:5;flex:none}
body[data-mode="builder"] .publish-strip{order:6;flex:none}
body[data-mode="builder"] #live-upgrades,body[data-mode="builder"] #practice-upgrades{order:7;flex:none}
body[data-mode="builder"] #builder-floors,#mobile-upgrades-dialog #builder-floors{display:none!important}
body[data-mode="builder"] #workshop-drafts{display:none;position:absolute;z-index:30;left:0;right:0;top:48px;max-height:min(52dvh,420px);overflow:auto;margin:0}
body[data-mode="builder"] #workshop-drafts.is-open{display:block}
body[data-mode="builder"] .tool.wide {
  grid-column: span 2;
}
@media (max-width: 760px) {
  .brand-mark {
    width: 30px;
    height: 30px;
  }
  body[data-mode="raid"] #canvas-wrap {
    height: calc(100dvh - 325px);
    min-height: 180px;
  }
  body[data-mode="builder"] #canvas-wrap {
    height: 44dvh;
    min-height: 280px;
  }
  body[data-mode="builder"] .tool.wide {
    grid-column: span 1;
  }
  #raid-controls .hotbar {
    justify-content: flex-end;
    padding-right: 3px;
    gap: 4px;
  }
  #raid-controls .hotbar button {
    width: 34px;
  }
  #raid-controls .action-buttons button {
    min-width: 0;
  }
  #loadout-dialog .weapon-row strong {
    font-size: 19px;
  }
  #loadout-dialog .weapon-row label > span:last-child {
    font-size: 10px;
  }
  #loadout-dialog .potion-row small {
    font-size: 10px;
  }
}
@media (max-height: 550px) and (orientation: landscape) {
  body[data-mode="raid"] #canvas-wrap {
    height: calc(100dvh - 170px);
    min-height: 120px;
  }
  #raid-controls .action-buttons button {
    min-width: 42px;
  }
}
.gear-art svg {
  width: 25px;
  height: 25px;
  display: block;
  color: #d8b578;
}
#raid-controls .action-buttons > button > span svg {
  width: 22px;
  height: 22px;
  display: block;
}
#raid-controls .action-buttons > button:last-child > span svg {
  width: 19px;
  height: 19px;
}
#mobile-tools-open,
#mobile-upgrades-open,
.mobile-palette-heading {
  display: none;
}
body[data-mode="raid"] #workspace #canvas-wrap {
  height: calc(100dvh - 310px);
  min-height: 280px;
}
@media (max-width: 760px) {
  #mobile-tools-open,
  #mobile-upgrades-open {
    display: block;
  }
  body[data-mode="raid"] #mobile-tools-open,
  body[data-mode="raid"] #mobile-upgrades-open {
    display: none;
  }
  body[data-mode="raid"] #workspace #canvas-wrap {
    height: calc(100dvh - 350px);
    min-height: 180px;
  }
  #mobile-tools-dialog {
    position: fixed;
    inset: auto 0 0;
    margin: 0;
    width: 100%;
    max-width: 100%;
    max-height: min(70dvh, 560px);
    padding: 0;
    border-radius: 12px 12px 0 0;
    border-bottom: 0;
    overflow: hidden;
    background: #111a1c;
  }
  #mobile-tools-dialog[open] {
    display: flex;
    flex-direction: column;
  }
  #mobile-tools-dialog .sidebar {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto !important;
    display: block;
    position: static !important;
    max-height: none !important;
    height: auto !important;
    padding: 0 16px 22px !important;
    border: 0;
  }
  .mobile-palette-heading {
    display: flex;
    flex: 0 0 auto;
    position: sticky;
    top: 0;
    z-index: 3;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #111a1c;
    border-bottom: 1px solid var(--line);
  }
  .mobile-palette-heading strong {
    font: 23px var(--serif);
    color: #e2c38a;
  }
  #mobile-tools-close {
    min-width: 44px;
    font-size: 24px;
    padding: 0;
    border: 0;
    color: #c4cfc6;
  }
  #mobile-tools-dialog .tool-tabs {
    margin-top: 10px;
  }
  #mobile-tools-dialog .sidebar .eyebrow,
  #mobile-tools-dialog .sidebar h1,
  #mobile-tools-dialog .sidebar .intro {
    display: none;
  }
  #mobile-tools-dialog .workshop-drafts .dungeon-cards {
    grid-template-columns: 1fr;
  }
}
@media (max-height: 550px) and (orientation: landscape) {
  body[data-mode="raid"] #workspace #canvas-wrap {
    height: calc(100dvh - 170px);
    min-height: 120px;
  }
}
#builder-tools>.theme-picker{display:block;margin:0 0 16px;padding:12px;border:1px solid var(--line);border-radius:5px;font-size:12px;color:var(--muted)}
#builder-tools>.theme-picker select{width:100%;margin:8px 0}
#builder-level{display:block;font-size:11px;color:var(--gold)}
#cut-live-floor{width:100%;margin-top:8px}
.danger-button{color:#e5aaa0;border-color:#704b46;background:transparent;font-size:11px}
.danger-button:hover:not(:disabled){color:#ffe2db;border-color:#c98071;background:#422823}
.dungeon-card>.danger-button{margin-top:10px}
.main-panel>.workshop-drafts{border:1px solid #7d68483d;background:#121d20;border-radius:6px;margin:0 0 22px;padding:18px 20px}
.workshop-heading{display:flex;align-items:center;justify-content:space-between;gap:16px}
.workshop-heading h2{font-size:26px;margin:5px 0 0;color:#ead5b0}
.main-panel>.workshop-drafts .dungeon-cards{display:flex;gap:12px;overflow-x:auto;margin:16px 0 0;padding-bottom:8px;scrollbar-width:thin}
.main-panel>.workshop-drafts .dungeon-card{flex:0 0 260px;display:grid;grid-template-columns:1fr 1fr;gap:7px;align-content:start;margin:0;padding:14px;min-height:0}
.main-panel>.workshop-drafts .dungeon-card-art{display:none}
.main-panel>.workshop-drafts .dungeon-card>.eyebrow,.main-panel>.workshop-drafts .dungeon-card>h3,.main-panel>.workshop-drafts .dungeon-card>p,.main-panel>.workshop-drafts .dungeon-card>.growth-badge,.main-panel>.workshop-drafts .dungeon-card>.primary{grid-column:1/-1}
.main-panel>.workshop-drafts .dungeon-card h3{font-size:22px;margin:2px 0}
.main-panel>.workshop-drafts .dungeon-card p{font-size:11px;min-height:0;margin:0}
.main-panel>.workshop-drafts .dungeon-card button{font-size:11px;min-height:36px;margin:0!important;padding:7px}
.main-panel>.workshop-drafts .empty-state{flex:1;min-width:0;min-height:90px;padding:16px}
@media(max-width:760px){.main-panel>.workshop-drafts{padding:14px;margin-bottom:15px}.workshop-heading h2{font-size:24px}.workshop-heading .eyebrow{font-size:8px}.main-panel>.workshop-drafts .dungeon-card{flex-basis:250px}.main-panel>.workshop-drafts .empty-state{min-width:100%}.publish-strip #delete-current{font-size:10px;padding:8px}}
.live-upgrades{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:15px;padding:14px 18px;background:#172426;border:1px solid #8e754650;border-radius:5px;margin-bottom:14px}
.live-upgrades strong,.live-upgrades small{display:block}.live-upgrades strong{font:20px Georgia,serif;color:var(--gold);margin:4px 0}.live-upgrades small{font-size:11px;color:var(--muted)}.live-upgrades>div:last-child{display:flex;gap:8px;flex-wrap:wrap}.live-upgrades button{font-size:11px}
.builder-floors{border:1px solid #8a75474d;background:linear-gradient(120deg,#192a29,#101c1d);border-radius:6px;padding:20px;margin:0 0 22px}.floor-panel-heading{display:flex;justify-content:space-between;align-items:center;gap:15px}.floor-panel-heading h2{font:28px Georgia,serif;color:#e1d4b7;margin:8px 0}.builder-floors>p{font-size:12px;line-height:1.8;color:#a2b7aa;margin:10px 0 18px;max-width:850px}.floor-tabs{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:9px}.floor-tabs button{padding:14px 10px;text-align:left;min-width:0;background:#132221;border-color:#4c65514d}.floor-tabs button[aria-pressed=true]{border-color:#d3ac65;background:#2a3428;box-shadow:inset 0 2px #d3ac65}.floor-tabs strong{display:block;font:19px Georgia,serif;color:#e3d5b5}.floor-tabs small{display:block;font-size:10px;line-height:1.5;color:#9fb5a6;margin-top:6px}.builder-floors .theme-picker{margin-top:16px;flex-wrap:wrap;gap:10px}.builder-floors .theme-picker select{max-width:220px}.raid-stairs-controls{display:flex;align-items:center;gap:10px;padding:10px;background:#10211e;border:1px solid #66815955}.raid-stairs-controls span{font-size:11px;color:#d2c59b;margin-right:auto}.raid-stairs-controls button{font-size:11px;min-height:42px}@media(max-width:760px){.builder-floors{padding:15px}.floor-panel-heading{align-items:start;flex-direction:column}.floor-tabs{grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}.floor-tabs button{padding:11px 8px}.floor-tabs strong{font-size:17px}.floor-tabs small{font-size:9px}.raid-stairs-controls{flex-wrap:wrap}.raid-stairs-controls span{width:100%}.raid-stairs-controls button{flex:1}}
.floor-panel-footer{margin-top:14px;color:#bba475;font-size:11px}
.theme-picker .theme-note{display:block;font-size:10px;line-height:1.5;color:#8fa392;margin-top:2px;text-transform:none}

/* One expedition image per card. The tag stays above the picture. */
.dungeon-card-art canvas,
.dungeon-card-own{width:100%;height:100%;display:block;object-fit:cover;pointer-events:none}
/* The keeper's crest is a small badge in the corner, not a second cover: outrank the full-bleed canvas rule above. */
.dungeon-card-art canvas.dungeon-card-crest{position:absolute;right:12px;top:12px;z-index:2;width:52px;height:52px;pointer-events:none;filter:drop-shadow(0 2px 4px #000c)}
.explore-feature{display:flex;flex-direction:column;justify-content:center;gap:8px;min-height:220px;padding:28px;border:1px solid #8d73464d;background:linear-gradient(160deg,#172426,#10181a);border-radius:6px}
.explore-feature h3{font:28px var(--serif);color:#ead7b2;margin:0}
.explore-feature p{margin:0;color:#a9b8ae;font-size:13px;line-height:1.7;max-width:36ch}
#live-list.explore-wide{grid-template-columns:repeat(auto-fit,minmax(min(100%,420px),1fr))}

.topbar{z-index:80}
#raid-loading{position:fixed;inset:0;z-index:70;display:grid;place-content:center;justify-items:center;gap:14px;background:#070c0ee6;color:#f3e6c8;font:22px Georgia,serif}
#raid-loading[hidden]{display:none!important}
#raid-loading progress{width:min(280px,70vw);height:6px;accent-color:#d5ad69}
#loadout-dialog{width:min(640px,94vw);height:min(760px,88dvh);max-height:min(760px,88dvh);overflow:auto}
.hotbar button.empty{opacity:.72}
.hotbar button.empty b{font-size:10px;font-weight:600;letter-spacing:0}
body[data-mode="raid"] #game{touch-action:none;cursor:crosshair}
#canvas-wrap.raid-fade{animation:raid-fade .45s ease}
@keyframes raid-fade{from{opacity:0}to{opacity:1}}
body[data-mode="raid"]{overflow:hidden;height:100dvh}
body[data-mode="raid"] #workspace{height:calc(100dvh - 58px);min-height:0;overflow:hidden}
body[data-mode="raid"] #workspace .main-panel{max-width:none;width:100%;height:100%;margin:0;padding:8px 12px 10px;display:flex;flex-direction:column;min-height:0}
body[data-mode="raid"] #workspace #canvas-wrap{flex:1 1 auto;height:auto!important;min-height:0;max-height:none}
body[data-mode="raid"] .panel-heading,body[data-mode="raid"] .map-footer{flex:none}
@media (min-width: 1100px) and (min-height: 700px) {
  body[data-mode="builder"] .main-panel { min-height: calc(100dvh - 80px); }
  body[data-mode="builder"] #canvas-wrap {
    flex: 1 1 auto;
    min-height: min(760px, calc(100dvh - 280px));
    height: auto !important;
  }
}
.raid-start-hint {
  position: absolute; z-index: 8; left: 12px; right: 12px; top: 12px;
  display: flex; gap: 10px; align-items: center; justify-content: space-between;
  margin: 0; padding: 8px 10px; background: #12181ae6; color: #f3eee2;
  border: 1px solid #8e7546; border-radius: 6px; font-size: 13px;
}
.raid-start-hint button, #raid-rules { min-height: 32px; padding: 4px 10px; }
#raid-rules {
  position: absolute; z-index: 8; left: 12px; bottom: 12px;
  background: #172023; color: #efd09b; border-color: #8e7546;
}
@media (orientation: landscape) and (max-height: 520px) {
  body[data-mode="raid"] #raid-rules { left: auto; right: 12px; bottom: 12px; }
}
/* Play and Build stay one line and one height. The pair is the welcome screen
   (title and signed-in Home share #welcome-start and #welcome-build). */
.hero-actions .hero-play,
.hero-actions .hero-build {
  height: 54px;
  min-height: 54px;
  max-height: 54px;
  white-space: nowrap;
}
@media (max-width: 760px) {
  .hero-actions .hero-play,
  .hero-actions .hero-build {
    height: 48px;
    min-height: 48px;
    max-height: 48px;
    padding: 0 8px;
    font-size: 12px;
    letter-spacing: 0;
  }
}
.share-card {
  margin-top: 10px; padding: 12px; border: 1px solid #8e7546; border-radius: 6px; background: #12181ae6;
}
.share-card strong { display: block; margin-bottom: 8px; color: #efd09b; }
.share-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.share-card-note { margin: 8px 0 0; color: #d8b578; font-size: 13px; }
.skeleton-card { min-height: 148px; display: grid; gap: 10px; padding: 14px; background: #1a2628; border: 1px solid #8e7546aa; }
.skeleton-card .sk { display: block; border-radius: 4px; background: linear-gradient(90deg, #2c3c3e, #6d6250, #2c3c3e); background-size: 200% 100%; animation: sk-shimmer 1.2s ease-in-out infinite; }
.skeleton-card .sk-art { height: 72px; }
.skeleton-card .sk-line { height: 14px; }
.skeleton-card .sk-line.short { width: 60%; }
@keyframes sk-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.replay-poster { display: block; width: min(100%, 420px); height: 160px; object-fit: cover; border-radius: 6px; border: 1px solid #8e7546; background: #0e120f; }
#canvas-wrap:fullscreen{width:100vw;height:100vh;background:#070b0d;border-radius:0}
#canvas-wrap:fullscreen canvas{width:100%;height:100%}
.result-actions{position:relative;z-index:2}
.run-summary{color:#e7d3a4;font-size:13px}
@media (min-width:761px){
  body[data-mode="builder"]{overflow:hidden;height:100dvh}
  body[data-mode="builder"] #workspace{height:calc(100dvh - 78px);overflow:hidden;align-items:stretch;grid-template-rows:minmax(0,1fr)}
  body[data-mode="builder"] #builder-sidebar,body[data-mode="builder"] .sidebar{overflow-y:auto;overscroll-behavior:contain;max-height:100%;min-height:0}
  body[data-mode="builder"] .main-panel{overflow-y:auto;overscroll-behavior:contain;max-height:100%;min-height:0}
  body[data-mode="builder"] .panel-heading{position:sticky;top:0;z-index:6;background:#121411f2;padding-bottom:8px}
/* Relics and home are ordinary full pages: the builder's document lock must not cut them off. */
@media (min-width:761px){
  body[data-mode="builder"][data-view="relics"],body[data-mode="builder"][data-view="home"]{overflow:visible auto;height:auto;min-height:100dvh}
}
/* Explore is its own page. The builder locks the document, so this list scrolls on its own. */
body[data-view="list"]{overflow:hidden;height:100dvh}
body[data-view="list"] #dungeon-browser{height:calc(100dvh - 94px);max-height:calc(100dvh - 94px);overflow:auto;overscroll-behavior:contain;scroll-padding-bottom:40px}
@media (max-width:760px){body[data-view="list"] #dungeon-browser{height:calc(100dvh - 64px);max-height:calc(100dvh - 64px)}}
}

/* Owner signature: compact two-column editor with a true-proportion preview. */
.owner-editor{border:1px solid var(--line);border-radius:6px;background:linear-gradient(180deg,#151d1fcc,#10161899);padding:18px 20px 20px;margin:4px 0 36px;display:grid;grid-template-columns:minmax(0,1fr) minmax(260px,400px);gap:14px 28px;align-items:center}
.owner-editor legend{padding:0 8px;margin-left:-8px;font:600 10px/1 var(--sans);letter-spacing:2px;text-transform:uppercase;color:var(--gold)}
.owner-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 14px}
.owner-editor label{display:grid;gap:6px;font-size:10px;letter-spacing:1.2px;text-transform:uppercase;color:var(--muted)}
.owner-editor .owner-taunt-field{grid-column:1/-1;order:4}
.owner-editor input,.owner-editor select{width:100%;max-width:100%;box-sizing:border-box;margin:0;background:#0d1314;color:var(--text);border:1px solid var(--line);border-radius:4px;padding:9px 10px;font-size:13px;letter-spacing:0;text-transform:none}
.owner-editor input::placeholder{color:#6f7a78;font-style:italic}
.owner-editor input:focus,.owner-editor select:focus{border-color:var(--accent);outline:none;box-shadow:0 0 0 2px #d8aa5e33}
#owner-preview{position:relative;display:flex;align-items:center;gap:10px;min-height:0;padding:10px 12px;border-radius:4px;background:radial-gradient(ellipse at 60% 50%,#24302f,#0b1011 75%)}
#owner-preview canvas:first-child{flex:0 0 64px;width:64px;height:64px}
#owner-preview canvas:nth-child(2){flex:1 1 auto;min-width:0;width:100%;height:auto;aspect-ratio:320/100}
#owner-preview .owner-preview-name{left:calc(12px + 64px + 10px + 12%);right:calc(12px + 12%);top:50%;transform:translateY(-50%);font-size:15px;color:#efdfc5;text-shadow:0 1px 2px #000;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media (max-width:1100px){.owner-editor{grid-template-columns:1fr}#owner-preview{max-width:440px}}
@media (max-width:620px){.owner-fields{grid-template-columns:1fr}.owner-editor{padding:14px}}
/* Live dungeon card: the fallen, then what waits inside by kind. */
.card-facts{display:grid;gap:6px;margin:4px 0 14px}
.card-facts-row{display:flex;flex-wrap:wrap;gap:6px}
.card-fact{padding:4px 9px;border:1px solid #39423f;border-radius:3px;background:#0b0f0ecc;font-size:11px;line-height:1.4;color:#cdd3cf;white-space:nowrap}
.card-fact.monster{border-color:#5a3b32;color:#e3b8a6}
.card-fact.trap{border-color:#4a4636;color:#d9c8a2}
.card-fact.fallen{border-color:#5b2a26;color:#e7a39a}
.card-fact.none{color:#7d8784;border-style:dashed}
/* Raid archive: Share and Close share the bottom row. */
#replay-dialog .replay-actions{display:flex;gap:10px;justify-content:space-between;align-items:center;margin-top:10px}
#replay-dialog .replay-actions .replay-share{min-width:170px}

/* Defend and Decorate tools as stat cards (hazard-cards.js): art, name and cost on top, then the
   numbers that decide a fight and what else the kind does. */
#builder-tools .tool.card:not([hidden]) {
  grid-column: 1 / -1 !important;
  height: auto !important;
  display: grid !important;
  grid-template-columns: 46px minmax(0, 1fr);
  grid-template-areas: "art head" "body body";
  align-items: center;
  gap: 8px 10px;
  padding: 10px 11px 11px;
  text-align: left;
}
#builder-tools .tool.card > img,
#builder-tools .tool.card > canvas,
#builder-tools .tool.card > .tool-icon {
  grid-area: art;
  width: 46px;
  height: 46px;
  object-fit: contain;
  font-size: 26px;
  line-height: 46px;
}
#builder-tools .tool.card > span:not(.card-body):not(.tool-icon) {
  grid-area: head;
  font: 600 14px/1.2 var(--serif);
  color: #efe3c8;
}
#builder-tools .tool.card > span:not(.card-body):not(.tool-icon) small {
  margin-top: 3px;
  font: 600 10px/1.3 var(--sans);
  color: #d9b56f;
  letter-spacing: 0.02em;
}
#builder-tools .tool.card .card-body {
  grid-area: body;
  display: grid;
  gap: 7px;
  font-size: 11px;
}
.tool.card .card-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
}
.tool.card-monster .card-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.tool.card .card-stat {
  display: grid;
  gap: 1px;
  padding: 5px 6px;
  border: 1px solid #2c3633;
  border-radius: 3px;
  background: #0f1617;
  min-width: 0;
}
.tool.card .card-stat i {
  font: normal 600 8.5px/1.2 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8f9a93;
}
.tool.card .card-stat b {
  font: 600 11.5px/1.25 var(--sans);
  color: #eee4cf;
  overflow-wrap: anywhere;
}
.tool.card-monster .card-stat b {
  font: 700 15px/1.15 var(--serif);
}
.tool.card .card-stat.lethal {
  border-color: #6d2a22;
  background: #24100d;
}
.tool.card .card-stat.lethal b {
  color: #ff8a6e;
}
.tool.card .card-notes {
  display: grid;
  gap: 3px;
}
.tool.card .card-notes span {
  position: relative;
  padding-left: 11px;
  font-size: 10.5px;
  line-height: 1.4;
  color: #c9c0aa;
}
.tool.card .card-notes span::before {
  content: "◆";
  position: absolute;
  left: 0;
  top: 0;
  font-size: 7px;
  line-height: 15px;
  color: #b88f4a;
}
.relic-chamber-hint {
  grid-column: 1 / -1;
  margin: 0 0 8px;
  font: 13px/1.4 var(--sans);
  color: var(--muted);
}
.relic-chamber-hint[hidden] { display: none !important; }
.tool.card .card-footer {
  font: italic 9.5px/1.4 var(--sans);
  color: #8d968f;
}
.tool.card.selected .card-stat {
  border-color: #6b5530;
}

/* Floors have no limit: the tabs scroll sideways once there are more than fit. */
#floor-tabs.floor-tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(150px, 1fr);
  grid-template-columns: none;
  overflow-x: auto;
  scroll-snap-type: x proximity;
}
#floor-tabs.floor-tabs > button {
  scroll-snap-align: start;
}
.floor-space {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
  font-size: 12px;
  color: #d9c79e;
}
.floor-space button {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 12px;
}

/* The dungeon's cover in the share dialog: what the link preview shows. */
.invite-image {
  display: block;
  width: 100%;
  aspect-ratio: 574 / 248;
  object-fit: cover;
  margin: 4px 0 12px;
  border: 1px solid #8d754c66;
  border-radius: 5px;
  background: #0b0f10;
}

/* The logo is the home tab: on the main page it carries the same gold mark as a selected tab. */
.brand {
  position: relative;
}
.brand.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -14px;
  height: 2px;
  background: var(--gold);
}
.brand.active b {
  color: var(--gold);
}

/* Phone top bar: two even rows. Brand and account actions on top; the tabs and the rank and
   gold chips share the second row, so no chip floats on a row of its own. */
@media (max-width: 760px) {
  body:not([data-mode="raid"]) .topbar {
    height: auto;
    min-height: 0;
    padding: 10px 16px 0;
    gap: 8px 10px;
    align-items: center;
  }
  body:not([data-mode="raid"]) .account {
    display: contents;
  }
  body:not([data-mode="raid"]) .brand {
    order: 0;
    margin-right: auto;
  }
  body:not([data-mode="raid"]) .account > button:not(.hud-chip) {
    order: 1;
    min-height: 32px;
    padding: 6px 10px;
    font-size: 11px;
  }
  body:not([data-mode="raid"]) .topbar nav {
    order: 2;
    flex: 1 0 auto;
    width: auto;
    height: 44px;
    gap: 20px;
  }
  body:not([data-mode="raid"]) .nav-button {
    min-height: 44px;
  }
  body:not([data-mode="raid"]) .nav-button.active:after {
    bottom: 0;
  }
  body:not([data-mode="raid"]) .account > .hud-chip {
    order: 3;
  }
  /* The logo's tab underline belongs under the tabs on desktop; on a phone it cut across the chips. */
  .brand.active::after {
    display: none;
  }
}
/* Both rank badges on a phone, each a round crest centered in its button. */
@media (max-width: 760px) {
  body:not([data-mode="raid"]) #raider-rank {
    display: inline-flex;
  }
  body:not([data-mode="raid"]) .account > .rank-chip {
    justify-content: center;
    width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    gap: 0;
  }
  body:not([data-mode="raid"]) .rank-chip .chip-text {
    display: none;
  }
  body:not([data-mode="raid"]) .topbar nav {
    gap: 16px;
  }
}

/* Item and weapon icons in the loadout and on the hotbar. */
.item-icon {
  width: 36px;
  height: 36px;
  flex: none;
}
.weapon-row label {
  grid-template-columns: 40px 1fr;
  column-gap: 10px;
}
.weapon-row input {
  justify-self: center;
}
.weapon-row .gear-art .item-icon {
  display: block;
  width: 40px;
  height: 40px;
}
.potion-row > div:not(.stepper) {
  flex: 1;
}
.gear-row:not(.weapon-row) .item-icon {
  width: 28px;
  height: 28px;
}
.hotbar button.has-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hotbar button.has-icon .slot-icon {
  /* A share of the slot, so the key number and count corners stay clear at every HUD size. */
  width: calc(var(--slot, 54px) * 0.48);
  height: calc(var(--slot, 54px) * 0.48);
  pointer-events: none;
}
.hotbar button.has-icon small {
  position: absolute;
  font-size: 9px;
  line-height: 1;
  text-shadow: 0 1px 1px #000;
}
.hotbar button.has-icon small:first-child {
  top: 2px;
  left: 3px;
}
.hotbar button.has-icon small:last-child {
  right: 3px;
  bottom: 2px;
}
@media (max-width: 760px) {
  .hotbar button.has-icon small {
    font-size: 7px;
  }
}
#level-card {
  position: absolute;
  z-index: 8;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  width: min(420px, calc(100% - 24px));
  max-height: min(70vh, 520px);
  overflow: auto;
  padding: 16px 16px 18px;
  border: 1px solid var(--gold);
  border-radius: 6px;
  background: #14110e;
  color: var(--text);
  box-shadow: 0 16px 40px #000a;
  pointer-events: auto;
}
#level-card .level-kicker {
  margin: 0 44px 0 0;
  font: 600 11px/1 var(--sans);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
}
#level-card h2 {
  margin: 6px 44px 12px 0;
  font: 28px/1.1 var(--serif);
  color: var(--gold);
}
#level-card .level-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid var(--gold);
  background: #221c16;
  color: var(--gold);
  font-size: 11px;
}
#level-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}
#level-card li {
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: #1c1814;
}
#level-card strong,
#level-card span {
  display: block;
}
#level-card span {
  color: var(--muted);
  font-size: 13px;
}
