@font-face {
  font-family: "Expedition Sans";
  src: url("./assets/sans.woff") format("woff");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Expedition Sans";
  src: url("./assets/sans-bold.woff") format("woff");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Expedition Serif";
  src: url("./assets/serif.woff") format("woff");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Expedition Serif";
  src: url("./assets/serif-italic.woff") format("woff");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ink: #111612;
  --panel: #1a221a;
  --edge: #3b4636;
  --line: #313c2e;
  --text: #f2eadb;
  --muted: #bdc5b4;
  --gold: #e6ba76;
  --gold-light: #f6d6a0;
  --mint: #b5e3c2;
  --blue: #bbd7ee;
  --lilac: #d4c0ed;
  --rose: #edb0a2;
  --sans: "Expedition Sans", "Segoe UI", sans-serif;
  --serif: "Expedition Serif", Georgia, serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { width: 100%; height: 100%; overflow: hidden; }
body {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-width: 280px;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  background:
    radial-gradient(ellipse at 68% -18%, #303b29 0%, transparent 45rem),
    radial-gradient(ellipse at -14% 26%, #20291d 0%, transparent 38rem),
    var(--ink);
  font: 15px/1.44 var(--sans);
}
button, select, a { -webkit-tap-highlight-color: transparent; }
button, select { color: inherit; font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; }
svg { display: block; width: 1.16em; height: 1.16em; flex: none; }
img { display: block; }
button:focus-visible, select:focus-visible, a:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link:focus {
  inset: 6px auto auto 8px;
  z-index: 10;
  width: auto;
  height: auto;
  padding: 7px 10px;
  color: #20170c;
  background: var(--gold-light);
  clip-path: none;
}
.shell { width: min(1320px, calc(100% - 76px)); margin-inline: auto; }
.topbar { background: #121913eb; border-bottom: 1px solid #3a4233; }
.topbar-inner, .brand, .topbar-actions { display: flex; align-items: center; }
.topbar-inner { justify-content: space-between; min-height: 59px; gap: 10px; }
.brand { gap: 9px; white-space: nowrap; }
.brand > span:first-child { color: var(--gold); font-size: 26px; filter: drop-shadow(0 0 7px #e1aa5d4d); }
.brand-title { font: 22px/1 var(--serif); letter-spacing: -0.035em; }
.brand-caption {
  padding-left: 13px;
  margin-left: 4px;
  color: var(--muted);
  border-left: 1px solid #49523c;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.topbar-actions { gap: 6px; }
.utility-button, .icon-button {
  min-height: 37px;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 10px;
  color: #e9ebdf;
  background: #1c251b;
  border: 1px solid #46523c;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.utility-button svg { color: var(--gold); font-size: 13px; }
.utility-button:hover, .icon-button:hover:not(:disabled), .tab:hover, .option:hover { border-color: #928060; background: #303a2a; }
.icon-button { width: 39px; padding-inline: 0; }
.icon-button:disabled { opacity: 0.43; }
.restart-button { background: transparent; }

.main {
  display: grid;
  min-height: 0;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: clamp(8px, 1.7vh, 16px);
  padding-top: clamp(10px, 2.5vh, 26px);
  padding-bottom: max(clamp(10px, 2.1vh, 22px), env(safe-area-inset-bottom));
}
.intro { display: flex; align-items: end; justify-content: space-between; gap: 13px; }
.eyebrow { font-size: 10px; line-height: 1.24; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.intro-eyebrow { display: flex; align-items: center; gap: 8px; margin: 0 0 5px; color: var(--gold); }
.intro-eyebrow::before { content: ""; width: 19px; height: 1px; background: #b69459; }
.intro h1 {
  margin: 0;
  font: 400 clamp(33px, 4vw, 60px)/1.06 var(--serif);
  letter-spacing: -0.048em;
}
.intro h1 em { color: var(--gold-light); }
.segment-progress {
  flex: none;
  display: grid;
  gap: 5px;
  min-width: 112px;
  padding: 7px 10px;
  margin-bottom: 2px;
  color: #ecd8b5;
  border: 1px solid #65573c;
  border-radius: 6px;
  background: linear-gradient(125deg, #322d21, #1e261d);
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
}
.segment-bars { display: flex; gap: 4px; }
.segment-bars i { flex: 1; height: 2px; border-radius: 2px; background: #474c36; }
.segment-bars .filled { background: var(--gold); }

.phase-panel { overflow: hidden; border: 1px solid var(--edge); border-radius: 8px; background: #19201a; }
.phase-track { display: grid; grid-template-columns: repeat(var(--phase-count, 3), minmax(0, 1fr)); list-style: none; padding: 0; margin: 0; }
.phase {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 45px;
  min-width: 0;
  padding: 4px 2px;
  color: var(--muted);
  border-right: 1px solid #303b2e;
  font-size: 13px;
  font-weight: 700;
}
.phase:last-child { border: 0; }
.phase-icon {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  flex: none;
  color: #b0bda5;
  background: #252f23;
  border: 1px solid #465442;
  border-radius: 5px;
  font-size: 13px;
}
.phase.active { color: var(--gold-light); background: linear-gradient(145deg, #403621, #25281d); box-shadow: inset 0 -2px #d4a662; }
.phase.active .phase-icon { color: var(--gold-light); background: #4c3a22; border-color: #816a3c; }
.phase.done .phase-icon { color: var(--mint); background: #2a3e30; border-color: #536d53; }
.phase.phase-skipped .phase-icon { border-style: dashed; }
.small-name { display: none; }

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(340px, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "tabs guide" "companion guide";
  gap: 8px 12px;
  min-height: 0;
}
.work-tabs { display: flex; align-items: stretch; gap: 5px; min-width: 0; grid-area: tabs; }
.tab {
  flex: 1;
  min-height: 37px;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 6px;
  border: 1px solid #3d4936;
  border-radius: 6px;
  background: #1b241b;
  color: #d5dece;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
}
.tab svg { color: #aebaa2; }
.tab[aria-pressed="true"] { color: var(--gold-light); background: #322d20; border-color: #8d7244; }
.tab[aria-pressed="true"] svg { color: var(--gold); }
.guide-tab { display: none; }
.panel {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--edge);
  border-radius: 9px;
  background: var(--panel);
  box-shadow: 0 10px 22px #0003;
}
.guide-panel {
  grid-area: guide;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(11px, 2.2vh, 23px);
  padding-bottom: clamp(10px, 1.7vh, 17px);
  background: radial-gradient(ellipse at 92% -5%, #3d35215e, transparent 47%), linear-gradient(140deg, #262c20, #192219 67%);
}
.guide-panel::before {
  position: absolute;
  content: "";
  inset: 0 20% auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, #baa16a, transparent);
}
.guide-header { display: flex; align-items: center; gap: 8px; flex: none; }
.guide-portrait {
  width: 37px;
  height: 37px;
  flex: none;
  object-fit: cover;
  border: 1px solid #ad8a59;
  border-radius: 50%;
  box-shadow: 0 0 0 3px #d9ae6519;
}
.guide-header strong, .guide-header div span { display: block; }
.guide-header strong { color: #fff1dc; font-size: 14px; line-height: 1.1; }
.guide-header div span { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.14; }
.scene-label {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 6px;
  margin-left: auto;
  color: #d1c5a8;
  font-size: 11px;
  font-weight: 700;
}
.scene-label::before { content: ""; width: 5px; height: 5px; background: var(--gold); border-radius: 50%; }
.guide-panel h2 {
  flex: none;
  margin: clamp(9px, 1.9vh, 19px) 0 10px;
  color: #fbf2e3;
  font: 34px/1.13 var(--serif);
  letter-spacing: -0.036em;
}
.guide-panel h2:focus { outline: none; }
.page-window { position: relative; flex: 1; min-height: 0; overflow: hidden; overflow: clip; }
.page-stack { display: grid; align-content: start; gap: 7px; transform-origin: top left; }
.page-stack.measure { position: absolute; inset: 0 0 auto; visibility: hidden; pointer-events: none; }
.window-block { min-width: 0; }
.body-copy { margin: 0; color: #e2e6d8; font-size: 15px; line-height: 1.48; }
.info-card, .check-card {
  display: flex;
  align-items: start;
  gap: 9px;
  min-width: 0;
  padding: 8px 9px;
  color: #e8e6d8;
  background: #242d21;
  border: 1px solid #47533f;
  border-radius: 6px;
}
.info-icon {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  flex: none;
  color: var(--gold);
  background: #3d3523;
  border: 1px solid #695b3b;
  border-radius: 5px;
  font-size: 15px;
}
.info-card strong, .check-card strong { display: block; color: #f0ead9; font-size: 14px; line-height: 1.26; }
.info-card p, .check-card p, .formula p { margin: 3px 0 0; color: #cbd2c1; font-size: 13px; line-height: 1.34; }
.formula {
  padding: 8px 11px;
  border: 1px solid #675b40;
  border-left: 3px solid var(--tone);
  border-radius: 6px;
  background: linear-gradient(110deg, #3b3323, #262d22);
}
.formula > span { display: block; color: var(--tone); }
.formula > strong { display: block; color: var(--text); font: 24px/1.12 var(--serif); margin-top: 3px; }
.tone-gold { --tone: var(--gold); }
.tone-mint { --tone: var(--mint); }
.tone-blue { --tone: var(--blue); }
.tone-lilac { --tone: var(--lilac); }
.tone-rose { --tone: var(--rose); }
.tone-ivory { --tone: #f0ebdf; }
.die {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  color: var(--tone, var(--gold-light));
  border: 1px solid currentColor;
  border-radius: 7px;
  background: #172017;
  font: 23px/1 var(--serif);
}
.die-card { --tone: var(--gold-light); }
.check-card strong small { color: var(--tone); font-size: 11px; font-weight: 400; }
.check-card p b { color: var(--tone); font-weight: 700; }
.quiz { padding: 7px 9px; background: #211f17; border: 1px solid #625338; border-radius: 6px; }
.quiz > p { margin: 0 0 6px; font-size: 13px; line-height: 1.25; }
.quiz-actions { display: flex; gap: 5px; }
.option {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 7px;
  padding: 6px 9px;
  text-align: left;
  color: #e8eadc;
  border: 1px solid #54614b;
  border-radius: 6px;
  background: #222c21;
}
.option[aria-pressed="true"] { background: #3b3423; border-color: #ac8951; color: var(--gold-light); }
.choice-mark { display: grid; place-items: center; width: 17px; height: 17px; flex: none; border: 1px solid #97a08c; border-radius: 50%; color: var(--gold-light); font-size: 11px; }
.choice-option { min-height: 45px; }
.choice-option strong, .choice-option small { display: block; }
.choice-option strong { font-size: 13px; line-height: 1.2; }
.choice-option small { color: #d3dacb; font-size: 12px; line-height: 1.25; margin-top: 2px; }
.quiz-option { min-height: 34px; justify-content: center; font-size: 13px; }
.quiz-feedback { display: block; min-height: 1em; padding-top: 3px; color: var(--gold-light); font-size: 11px; line-height: 1.2; }

.guide-controls {
  display: grid;
  grid-template-columns: 39px auto minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  flex: none;
  margin-top: 7px;
  padding-top: 8px;
  border-top: 1px solid #44513b;
}
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  min-width: 0;
  padding: 5px 9px;
  color: #23190c;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.15;
  border: 1px solid #f2c581;
  border-radius: 6px;
  background: linear-gradient(#f2cb8e, #dfa95f);
  box-shadow: inset 0 1px #ffe9bd8a;
}
.primary-button:hover:not(:disabled) { filter: brightness(1.12); }
.primary-button:disabled { opacity: 0.52; }
.guide-controls .primary-button { justify-content: space-between; }
.page-count { color: #d2c6a8; font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.text-button {
  min-height: 33px;
  color: var(--gold-light);
  border: 1px solid #5d573f;
  border-radius: 5px;
  background: #24281e;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
}
.text-button:hover { border-color: var(--gold); }

.companion { grid-area: companion; }
.pane { display: flex; flex-direction: column; width: 100%; height: 100%; min-height: 0; }
.pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  flex: none;
  min-height: 53px;
  padding: 7px 10px;
  background: #1c241bd9;
  border-bottom: 1px solid var(--line);
}
.pane-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.pane-header-actions { display: flex; justify-content: flex-end; }
.pane-header-actions .location-chip { max-width: 100%; }
.pane-icon {
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  flex: none;
  color: var(--gold);
  background: #343020;
  border: 1px solid #655335;
  border-radius: 6px;
  font-size: 17px;
}
.pane-heading h2 { margin: 0; color: var(--text); font-size: 15px; line-height: 1.18; }
.pane-heading p { margin: 3px 0 0; color: var(--muted); font-size: 11px; line-height: 1.2; }
.location-chip {
  display: inline-flex;
  align-items: center;
  max-width: 51%;
  gap: 4px;
  padding: 4px 6px;
  color: #e8e0cb;
  background: #292d21;
  border: 1px solid #615b41;
  border-radius: 4px;
  font-size: 11px;
  line-height: 1.2;
}
.location-chip svg { color: var(--gold); }
.pane-controls {
  min-height: 39px;
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 3px 8px;
  border-top: 1px solid var(--line);
}
.pane-controls .icon-button { min-height: 29px; width: 33px; }
.pane-controls.single-page { visibility: hidden; }

.table-content {
  position: relative;
  display: grid;
  flex: 1;
  min-height: 0;
  padding: 9px;
  overflow: hidden;
  background: radial-gradient(ellipse at 55% 9%, #313d2b, #151e16 80%);
}
.welcome-art {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-direction: row-reverse;
  gap: 7px;
  overflow: hidden;
  min-height: 0;
  padding: clamp(12px, 3vh, 32px);
  background: linear-gradient(0deg, #101911, transparent 72%);
  border: 1px solid #687053;
  border-radius: 6px 6px 22px 6px;
}
.welcome-art .eyebrow { color: var(--gold-light); }
.welcome-art h3 { max-width: 100%; margin: 4px 0 0; font: 400 clamp(30px, 5vw, 66px)/1 var(--serif); letter-spacing: -0.052em; }
.welcome-emblem { color: var(--gold); font-size: clamp(30px, 5vw, 66px); }
.visual-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: clamp(6px, 1.3vh, 12px);
  min-height: 0;
}
.visual-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  padding: clamp(6px, 1.5vh, 19px);
  background: linear-gradient(140deg, #2d392a, #1b241c 80%);
  border: 1px solid #52614b;
  border-radius: 7px 7px 16px 7px;
}
.visual-tile > span { display: block; color: var(--tone); font-size: clamp(17px, 4vh, 33px); margin-bottom: 6px; }
.visual-tile strong { color: var(--text); font-size: clamp(13px, 2.5vh, 20px); line-height: 1.12; }
.visual-tile small { color: var(--muted); font-size: clamp(10px, 1.95vh, 13px); line-height: 1.21; margin-top: 3px; }

.board-diagram { display: grid; grid-template-columns: minmax(0, 1fr) minmax(82px, 22%); gap: 9px; align-items: stretch; min-height: 0; }
.quadrants {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
  min-height: 0;
}
.quadrants > div {
  display: grid;
  place-items: center;
  min-height: 0;
  background-image: linear-gradient(#131c136e, #1024198d), none;
  background-size: 200% 200%;
  border: 1px dashed #a8aa79;
  color: var(--gold-light);
  border-radius: 8px;
}
.quadrants > div:nth-child(2) { background-position: 100% 0; }
.quadrants > div:nth-child(3) { background-position: 0 100%; }
.quadrants > div:nth-child(4) { background-position: 100% 100%; }
.joined .quadrants { gap: 2px; }
.joined .quadrants > div { border: 1px solid #ab9971; border-radius: 4px; }
.quadrants span { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid #debb80; background: #1d281cdb; font: 25px/1 var(--serif); }
.tile-stack, .deck-extra {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  border: 1px solid #675c42;
  border-radius: 6px;
  background: repeating-linear-gradient(45deg, #2b3224, #2b3224 7px, #262e21 7px, #262e21 14px);
  color: var(--gold-light);
  font-size: 12px;
  font-weight: 700;
}
.tile-stack { flex-direction: column; text-align: center; }
.tile-stack svg { font-size: 22px; }
.tile-stack small { font-size: 10px; color: var(--muted); }
.decks-diagram { display: grid; grid-template-rows: minmax(0, 1fr) minmax(0, 1fr) auto; gap: clamp(6px, 1.3vh, 13px); min-height: 0; }
.cards-row { display: flex; flex-direction: column; justify-content: space-between; min-height: 0; margin: 0; padding: 6px; border: 1px solid #54604b; border-radius: 7px; background: #1d271d; }
.cards-row h3 { color: var(--tone); font-size: 13px; margin: 0 0 4px; }
.card-slots { display: grid; flex: 1; min-height: 0; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
.deck-card, .card-slot { position: relative; min-height: 0; display: grid; place-items: center; border: 1px dashed #697962; border-radius: 4px; color: var(--tone); text-align: center; }
.deck-card { background: repeating-linear-gradient(45deg, #3b3a2d, #3b3a2d 5px, #303327 5px, #303327 10px); border-style: solid; }
.card-slot.revealed { border-style: solid; background: linear-gradient(145deg, #35402f, #263123); }
.card-slot.selected-slot { border-color: var(--tone); box-shadow: inset 0 0 0 1px var(--tone); }
.card-slot svg, .deck-card svg { font-size: clamp(10px, 3vw, 27px); }
.card-slot small { position: absolute; top: 2px; left: 3px; }
.deck-card small { position: absolute; bottom: 2px; font-size: 9px; }
.deck-extra { min-height: 26px; padding: 3px; font-size: 11px; }
.dice-diagram { display: grid; grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); gap: 9px; min-height: 0; }
.featured-die, .skill-dice > div {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  gap: 7px;
  padding: 5px;
  background: #243023;
  border: 1px solid #52604a;
  border-radius: 7px;
}
.featured-die strong { font: 25px/1.15 var(--serif); }
.featured-die p { color: var(--gold-light); margin: 3px 0 0; font-size: 12px; }
.die-face {
  display: grid;
  place-items: center;
  flex: none;
  width: clamp(25px, 9vh, 73px);
  max-width: 100%;
  aspect-ratio: 1;
  font-size: clamp(16px, 4vh, 32px);
  color: #162016;
  background: var(--tone);
}
.die-face.cube { border-radius: 14%; box-shadow: inset 0 0 0 4px #5f4d397a; }
.die-face.poly { clip-path: polygon(50% 0%, 96% 25%, 96% 75%, 50% 100%, 4% 75%, 4% 25%); }
.skill-dice { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; min-height: 0; }
.skill-dice > div { flex-direction: column; text-align: center; gap: 4px; }
.skill-dice strong { color: var(--tone); font-size: clamp(10px, 2vh, 16px); line-height: 1.14; }
.skill-dice small { color: var(--muted); font-size: 10px; line-height: 1.12; }

.battle-diagram { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; gap: 6px; min-height: 0; }
.combatant {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 0;
  padding: 5px;
  border: 1px solid #746252;
  border-radius: 7px;
  background: radial-gradient(ellipse at top, #45362c, #241f18);
  text-align: center;
}
.hero-combatant { background: linear-gradient(135deg, #1b2f23, #142218); }
.combatant > span { color: var(--gold-light); font-size: clamp(16px, 4vh, 42px); }
.foe-combatant > span { color: var(--rose); }
.combatant h3 { margin: 6px 0 0; font: 19px/1.08 var(--serif); }
.combatant strong { color: var(--rose); font: 30px/1.2 var(--serif); }
.combatant small { color: #ddd1be; font-size: 11px; }
.battle-divider { align-self: center; color: var(--gold); font-size: 21px; }
.battle-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 12px; grid-column: 1 / -1; padding: 6px; background: #32281f; border: 1px solid #6c543d; border-radius: 5px; color: #f4dbc0; font-size: 11px; }

.map-board { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 6px 6px 0; }
.map-surface { position: relative; flex: 1; min-height: 0; isolation: isolate; overflow: hidden; background: #233220; border: 1px solid #687a58; border-radius: 5px; }
.map-world, .map-image, .map-vignette, #map-grid, .map-points { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-world { transform-origin: 50% 50%; transition: transform 230ms ease; }
.map-image { background: none center 54%/cover no-repeat; }
.map-vignette { pointer-events: none; box-shadow: inset 0 0 44px 3px #0a130dbf; }
.map-point { position: absolute; display: grid; place-items: center; transform: translate(-50%, -50%); z-index: 1; border: 0; padding: 0; background: transparent; white-space: nowrap; }
div.map-point { pointer-events: none; }
.map-token {
  position: relative;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid #a2b295;
  border-radius: 7px;
  background: #172316eb;
  color: #e0ebd0;
  box-shadow: 0 3px 10px #000a;
  font-size: 15px;
}
.city-number { position: absolute; top: -4px; right: -4px; background: #f3e5c7; color: #231704; border-radius: 50%; width: 13px; height: 13px; font-size: 9px; line-height: 13px; text-align: center; }
.map-token-label {
  position: absolute;
  top: calc(50% + 18px);
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 5px;
  border: 1px solid #788064;
  border-radius: 4px;
  background: #141e16f5;
  color: #edf2e0;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 700;
}
.party-point { z-index: 3; }
.party-point .map-token { width: 38px; height: 38px; border: 2px solid #f9dda3; border-radius: 50%; color: #2d2010; background: radial-gradient(circle at 40% 30%, #f1ca87, #d79951); box-shadow: 0 0 0 3px #e7b65d50, 0 3px 10px #000b; font-size: 17px; }
.party-point .map-token-label { color: #f5ddb4; top: calc(50% + 22px); border-color: #ad8958; }
.target-point { z-index: 4; }
.target-point .map-token { width: 36px; height: 36px; border: 2px solid #c9edd1; border-radius: 50%; color: #e1f8e1; background: #234737; box-shadow: 0 0 0 3px #b3eac244, 0 0 18px #a6dfb456; font-size: 16px; }
.target-point .map-token-label { color: #d6f6df; top: calc(50% + 21px); border-color: #98cea6; }
.target-point:hover .map-token, .target-point:focus-visible .map-token { background: #39634b; outline: 2px solid #e9ffec; outline-offset: 2px; }
.target-point:focus-visible { outline: none; }
.shrine-point .map-token { color: var(--blue); border-color: #b7d9f0; background: #263b52ed; }
.shrine-point .map-token-label { color: #dfedfa; border-color: #819eb8; }
.fallen-point { z-index: 2; }
.fallen-point .map-token { color: var(--rose); border-color: #df9d90; background: #4c2e27; }
.fallen-point .map-token-label { color: #ffccbe; border-color: #ad7469; }
.landmark-point .map-token { width: 24px; height: 24px; font-size: 11px; }
.map-north { position: absolute; top: 9px; right: 10px; z-index: 5; display: grid; place-items: center; color: #eee3bb; font: 11px/1 var(--serif); text-shadow: 0 1px 3px #000; }
.map-north svg { width: 24px; height: 24px; }
.map-scale { position: absolute; right: 6px; bottom: 6px; z-index: 5; display: grid; overflow: hidden; border: 1px solid #859172; border-radius: 5px; background: #151f17f5; }
.map-scale button { display: grid; place-items: center; width: 35px; height: 34px; background: transparent; border: 0; border-bottom: 1px solid #4c5945; color: var(--text); font-size: 15px; }
.map-scale button:last-child { border-bottom: 0; }
.map-scale button:disabled { color: #a3aa99; opacity: 0.66; }
.map-scale button:hover:not(:disabled) { background: #525840; }
.map-scale button:focus-visible { outline-offset: -3px; }
.map-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 13px; min-height: 29px; margin: 0; padding: 2px 4px; list-style: none; color: #c6d1bf; font-size: 11px; }
.map-legend li { display: flex; align-items: center; gap: 5px; }
.legend-swatch { width: 7px; height: 7px; border-radius: 2px; transform: rotate(45deg); }
.swatch-party { background: var(--gold); }
.swatch-destination { background: var(--mint); }
.swatch-shrine { background: var(--blue); }
.swatch-fallen { background: var(--rose); }

.hero-banner {
  flex: none;
  display: flex;
  align-items: flex-end;
  min-height: clamp(82px, 18vh, 158px);
  padding: clamp(9px, 2vh, 16px);
  background: linear-gradient(90deg, #172016, #1e281c77 68%);
  border-bottom: 1px solid #715f3f;
}
.hero-banner .eyebrow { color: var(--gold-light); margin: 0 0 2px; }
.hero-banner h2 { margin: 0; font: clamp(25px, 5vh, 45px)/1.03 var(--serif); }
.hero-banner div > p:last-child { margin: 3px 0 0; color: #e6e7d4; font-size: 12px; }
.sheet-window, .journal-window { margin: 7px 8px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.stat-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat {
  min-width: 0;
  min-height: 48px;
  padding: 5px 6px;
  background: #232f23;
  border: 1px solid #455640;
  border-radius: 6px;
}
.stat-name { display: flex; align-items: center; min-width: 0; gap: 3px; color: #edf0e3; font-size: 11px; line-height: 1.19; }
.stat-name svg { color: var(--tone); }
.stat strong { display: block; color: var(--tone); font: 24px/1.04 var(--serif); margin-top: 3px; }
.stat small { display: block; color: #ccd5c3; font-size: 10px; line-height: 1.2; margin-top: 2px; }
.journal-entry {
  display: flex;
  align-items: start;
  gap: 7px;
  padding: 6px 8px;
  border: 1px solid #43503e;
  border-radius: 5px;
  background: #222d21;
}
.journal-dot { width: 6px; height: 6px; flex: none; margin-top: 5px; background: var(--gold); border-radius: 50%; box-shadow: 0 0 0 2px #ddb36c26; }
.journal-entry small, .journal-entry strong { display: block; }
.journal-entry small { color: var(--gold); font-size: 10px; }
.journal-entry strong { color: #e6e9dc; font-size: 13px; font-weight: 400; }

.dialog {
  width: min(550px, calc(100% - 24px));
  padding: 12px;
  color: var(--text);
  background: #222a21;
  overflow: hidden;
  border: 1px solid #8c7450;
  border-radius: 9px;
  box-shadow: 0 12px 38px #000b;
}
.dialog::backdrop { background: #090e0bce; backdrop-filter: blur(4px); }
.dialog-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; gap: 7px; }
.dialog-header h2 { color: var(--text); margin: 0; font: 26px/1.15 var(--serif); }
.dialog-header form { margin: 0; }
.rules-dialog[open] {
  display: flex;
  flex-direction: column;
  height: min(565px, calc(100vh - 28px));
  height: min(565px, calc(100dvh - 28px));
}
.rule-select { flex: none; margin-bottom: 8px; }
.rule-select select { width: 100%; min-height: 37px; padding: 3px 6px; border: 1px solid #665e45; color: var(--gold-light); border-radius: 5px; background: #293023; }
.rules-controls, .rules-arrows { display: flex; align-items: center; gap: 6px; }
.rules-controls { flex: none; justify-content: space-between; padding-top: 7px; margin-top: 7px; border-top: 1px solid var(--line); }
.rules-link { display: inline-flex; align-items: center; gap: 3px; color: var(--gold-light); font-size: 12px; text-underline-offset: 3px; }
.reset-dialog { width: min(386px, calc(100% - 24px)); }
.reset-dialog p { color: var(--muted); margin: 6px 0 10px; font-size: 14px; }
.dialog-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }

@media (max-width: 1010px) {
  .shell { width: calc(100% - 38px); }
  .workspace { grid-template-columns: minmax(0, 1.15fr) minmax(310px, 1fr); }
  .guide-panel h2 { font-size: 30px; }
}

@media (max-width: 760px) {
  .shell { width: calc(100% - 22px); }
  .topbar-inner { min-height: 48px; }
  .intro h1 { font-size: clamp(32px, 7.7vw, 43px); }
  .main { gap: 7px; padding-top: 8px; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .workspace {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "tabs" "guide";
    gap: 6px;
  }
  .workspace:not([data-mobile-view="guide"]) { grid-template-areas: "tabs" "companion"; }
  .workspace[data-mobile-view="guide"] .companion,
  .workspace:not([data-mobile-view="guide"]) .guide-panel { display: none; }
  .guide-tab { display: inline-flex; }
  .tab { min-height: 41px; }
  .guide-panel { padding: 11px; }
  .guide-panel[data-visual="welcome"] {
    background: linear-gradient(180deg, #20291dee 12%, #192519f3 61%, #162117bd), none center/cover no-repeat;
  }
  .guide-panel h2 { margin: 8px 0; font-size: 28px; }
  .guide-portrait { width: 33px; height: 33px; }
  .companion { min-height: 0; }
  .hero-banner { min-height: clamp(64px, 15vh, 136px); }
  .map-scale button { width: 39px; height: 38px; }
}

@media (max-width: 495px) {
  .brand { gap: 5px; }
  .brand-title { font-size: 20px; }
  .brand > span:first-child { font-size: 22px; }
  .brand-caption, .restart-label { display: none; }
  .restart-button { min-width: 37px; padding-inline: 5px; }
  .intro-eyebrow { display: none; }
  .intro h1 { font-size: clamp(29px, 8.2vw, 39px); }
  .segment-progress { min-width: 79px; padding: 5px 6px; font-size: 10px; }
  .phase { min-height: 36px; gap: 3px; font-size: 10px; }
  .phase-icon { width: 19px; height: 19px; font-size: 10px; border-radius: 4px; }
  .wide-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .small-name { display: inline-block; }
  .tab { gap: 3px; font-size: 11px; }
  .tab svg { width: 12px; height: 12px; }
  .guide-panel h2 { font-size: 25px; }
  .body-copy { font-size: 14px; line-height: 1.39; }
  .info-card, .check-card { gap: 6px; padding: 6px 7px; }
  .info-icon { width: 25px; height: 25px; font-size: 13px; }
  .info-card strong, .check-card strong { font-size: 13px; }
  .info-card p, .check-card p, .formula p { font-size: 12px; }
  .formula > strong { font-size: 20px; }
  .legend-swatch { width: 6px; height: 6px; }
  .map-legend { gap: 3px 10px; font-size: 10px; }
  .map-token-label { font-size: 10px; }
  .visual-grid { gap: 5px; }
  .visual-tile { padding: 5px; }
  .stat { padding-inline: 3px; }
  .stat-name { font-size: 10px; }
  .stat-name svg { display: none; }
}

@media (max-height: 490px) {
  .intro { display: none; }
  .main { gap: 5px; padding-top: 5px; padding-bottom: max(5px, env(safe-area-inset-bottom)); }
  .topbar-inner { min-height: 41px; }
  .utility-button { min-height: 32px; }
  .phase { min-height: 30px; }
  .phase-icon { width: 20px; height: 20px; font-size: 11px; }
  .tab { min-height: 33px; }
  .guide-panel { padding: 7px 9px; }
  .guide-panel h2 { margin: 5px 0 6px; font-size: 23px; }
  .guide-controls { padding-top: 4px; margin-top: 4px; }
  .guide-controls .primary-button, .guide-controls .icon-button { min-height: 35px; }
  .guide-portrait { width: 25px; height: 25px; }
  .guide-header div span { display: none; }
  .page-stack { gap: 5px; }
  .pane-header { min-height: 39px; padding: 4px 6px; }
  .pane-icon { width: 25px; height: 25px; font-size: 13px; }
  .map-scale button { width: 27px; height: 25px; }
  .map-north { top: 5px; right: 6px; }
  .map-north svg { width: 19px; height: 19px; }
  .map-token { width: 23px; height: 23px; font-size: 12px; }
  .party-point .map-token, .target-point .map-token { width: 30px; height: 30px; font-size: 14px; }
  .party-point .map-token-label, .target-point .map-token-label { top: calc(50% + 16px); }
  .map-token-label { padding-block: 1px; }
  .table-content { padding: 5px; }
  .visual-tile > span { margin-bottom: 3px; }
  .hero-banner { min-height: 50px; padding: 4px 7px; }
  .hero-banner h2 { font-size: 25px; }
  .die-face { width: 24px; font-size: 12px; }
  .battle-actions { padding: 2px; }
}

@media (max-height: 365px) {
  .guide-portrait { display: none; }
  .guide-header strong { font-size: 11px; }
  .guide-panel h2 { font-size: 21px; }
  .pane-heading p { display: none; }
  .visual-tile > span { font-size: 14px; margin-bottom: 2px; }
  .visual-tile strong { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}

.tutorials-link { text-decoration: none; }

@media (max-width: 495px) {
  .tutorials-link { min-width: 34px; padding-inline: 5px; }
  .tutorials-link .link-label { display: none; }
  .brand-title { font-size: clamp(15px, 4.6vw, 20px); }
}

@media (max-width: 310px) {
  .topbar-inner { gap: 5px; }
  .topbar-actions { gap: 3px; }
}


/* Selector bilingüe: siempre visible, también en móvil. */
.tutorial-language { flex: none; display: inline-flex; align-items: center; }
.tutorial-language select {
  color: #f4f0db; background: #1c251b; border: 1px solid #687253;
  border-radius: 6px; height: 37px; width: 116px; padding: 0 6px;
  font: 700 12px/1.2 var(--sans, sans-serif); cursor: pointer;
}
.tutorial-language select:focus-visible { outline: 2px solid #dbbb75; outline-offset: 2px; }
@media (max-width: 620px) {
  #rules-button > span:last-child { display: none; }
  #rules-button { min-width: 34px; padding-inline: 6px; }
  .tutorial-language select { width: 108px; }
}
@media (max-width: 385px) {
  .tutorial-language select { width: 86px; font-size: 11px; padding-inline: 1px; }
  .topbar-actions { gap: 3px; }
  .brand-title { font-size: 16px; }
}


/* Fotografías del juego real: vista principal y ampliación sin recortar texto ni cartas. */
.real-materials {
  display:flex; flex-direction:column; flex:1; min-width:0; min-height:0;
  gap:7px; padding:8px;
  border:1px solid #596a57; border-radius:8px;
  background:linear-gradient(155deg,#1b291f,#17231c);
}
.real-materials-top { display:flex; justify-content:space-between; align-items:center; gap:8px; color:#f2d6a3; }
.real-materials-top span { font-size:10px; font-weight:800; letter-spacing:.11em; }
.real-materials-top small { color:#cbd5c7; font-size:11px; }
.real-materials-photos {
  display:grid; grid-template-columns:repeat(2,minmax(0,1fr));
  flex:1; min-height:0; gap:7px;
}
.real-materials-photos.one { grid-template-columns:minmax(0,1fr); }
.real-photo {
  display:flex; flex-direction:column; min-width:0; min-height:0; margin:0;
  border:1px solid #6a715f; border-radius:7px; overflow:hidden;
  background:#101811;
}
.real-photo-open {
  position:relative; display:flex; justify-content:center; align-items:center;
  min-height:0; flex:1; width:100%; padding:0; margin:0;
  border:0; background:#101811; cursor:zoom-in; overflow:hidden;
}
.real-photo-open:focus-visible,.real-sheet-photo:focus-visible,.real-map-thumb:focus-visible {
  outline:2px solid #edc88a; outline-offset:-3px;
}
.real-photo img {
  width:100%; height:100%; min-height:0; object-fit:contain;
  background:#0e160f;
}
.real-photo-zoom {
  position:absolute; right:7px; top:7px; display:flex; align-items:center; gap:4px;
  color:#fff8e9; background:#111b15e9; border:1px solid #c5ad7b;
  border-radius:5px; padding:3px 6px; font-size:11px; font-weight:700;
}
.real-photo-zoom svg { width:13px; height:13px; }
.real-photo figcaption {
  display:grid; gap:2px; padding:6px 8px; color:#eee9d8;
  background:#19241bcf; border-top:1px solid #3b503e;
}
.real-photo figcaption strong { font-size:11px; line-height:1.15; font-weight:700; }
.real-photo figcaption small { font-size:9px; color:#b9c7b2; line-height:1.15; }
.real-materials-note {
  margin:0; color:#c8d3bd; font-size:10px; line-height:1.3;
}
.real-switch {
  min-height:30px; padding:5px 8px;
  font-size:11px; border-color:#879275; color:#f2e1bc;
}
.real-sheet-ref {
  display:grid; grid-template-columns:95px minmax(0,1fr); gap:9px;
  align-items:center; padding:5px; min-height:105px;
  border:1px solid #67775c; border-radius:7px; background:#1d2c22;
}
.real-sheet-photo {
  display:block; width:95px; height:94px; padding:0; margin:0;
  cursor:zoom-in; overflow:hidden; border:1px solid #74866b; border-radius:5px;
}
.real-sheet-photo img {
  width:100%; height:100%; object-fit:cover; object-position:50% 100%;
  transform:scale(1.4); transform-origin:50% 85%;
}
.real-sheet-ref strong {display:block; font-size:12px; color:#f7e7c4;}
.real-sheet-ref small {display:block; font-size:11px; color:#cbd4c2; line-height:1.25; margin-top:4px;}
/* Mapa de práctica separado del tablero auténtico (no comparte coordenadas). */
.map-board { position:relative; }
.map-image {
  background:radial-gradient(ellipse at 52% 43%,#3b523c 0%,#243729 58%,#162619 100%);
}
.real-map-thumb {
  position:absolute; z-index:6; top:11px; left:12px;
  display:flex; flex-direction:column; gap:2px;
  width:145px; padding:4px; border-radius:6px; border:1px solid #bfac7f;
  color:#f8edd7; background:#121c13ef; cursor:zoom-in;
}
.real-map-thumb img {display:block; width:100%; height:62px; object-fit:contain; }
.real-map-thumb span {font-size:10px;font-weight:800;}
/* Sustituir fondos ficticios por material físico o superficies neutras. */
.welcome-art {
  background:linear-gradient(0deg,#101911ed,transparent 75%), url("https://www.hexploreit.com/wp-content/uploads/2020/12/Modular-Map-Graphic-VotDK-@025x_small.png") center/contain no-repeat, #15221a;
}
.quadrants > div {
  background-image:linear-gradient(#15211a72,#15211a96),
    url("https://www.hexploreit.com/wp-content/uploads/2020/12/Modular-Map-Graphic-VotDK-@025x_small.png");
}
.hero-banner {
  background:linear-gradient(90deg,#172016ed,#1e281c9c 74%),
    none
    50% 85%/cover no-repeat;
}
.hero-combatant {background:linear-gradient(135deg,#1b2f23,#142218);}
.real-image-dialog {
  box-sizing:border-box; position:fixed; inset:0; margin:auto;
  width:min(98vw,1200px); height:min(94dvh,900px); max-width:98vw; max-height:94dvh;
  padding:0; border:1px solid #a88a59; border-radius:9px;
  color:#f4ebd5; background:#101810; box-shadow:0 20px 80px #000d;
}
.real-image-dialog::backdrop {background:#060d08ed;}
.real-image-dialog[open] {display:flex; flex-direction:column;}
.real-image-toolbar {
  display:flex; flex:none; justify-content:space-between; align-items:center;
  gap:8px; min-height:48px; padding:7px 10px; background:#202c21;
}
.real-image-toolbar h2 {font-size:14px; margin:0; line-height:1.25;}
.real-image-viewport {
  display:flex; justify-content:center; align-items:center; flex:1; min-height:0;
  overflow:auto; padding:8px; background:#0a100c;
}
.real-image-viewport img {display:block; max-width:100%; max-height:100%; object-fit:contain; touch-action:pinch-zoom;}
.real-image-source {
  display:flex; flex:none; align-items:center; justify-content:space-between;
  flex-wrap:wrap; gap:5px 12px; padding:9px 12px;
  border-top:1px solid #485446; font-size:11px; color:#c5d2bf;
}
.real-image-source a {color:#efd49b; text-decoration:underline;}
@media (max-width:760px) {
  .guide-panel[data-visual="welcome"] {
    background:linear-gradient(180deg,#20291def 6%,#192519e8 65%),
      url("https://www.hexploreit.com/wp-content/uploads/2020/12/Modular-Map-Graphic-VotDK-@025x_small.png") center/contain no-repeat,#162117;
  }
  .real-materials {gap:4px; padding:4px;}
  .real-materials-photos {gap:4px;}
  .real-photo figcaption {padding:4px;}
  .real-photo figcaption strong {font-size:10px;}
  .real-photo figcaption small {font-size:9px;}
  .real-photo-zoom {padding:2px 4px; font-size:10px; right:3px; top:3px;}
  .real-switch {padding-inline:5px; font-size:10px;}
  .real-map-thumb {width:112px; top:9px; left:9px;}
  .real-map-thumb img {height:48px;}
}
@media (max-width:395px) {
  .real-materials-note {font-size:9px;}
  .real-materials-photos:not(.one) figcaption small {display:none;}
  .real-sheet-ref {grid-template-columns:80px minmax(0,1fr);}
  .real-sheet-photo {width:80px;}
}


/* Vista original del tablero y alternancia explícita con el mapa simulado. */
.real-map-splash {
  display:flex; flex-direction:column; align-items:center;
  justify-content:center; flex:1; min-height:0; gap:5px;
  padding:8px; background:linear-gradient(155deg,#1c2c22,#121d18);
  border:1px solid #708065; border-radius:7px;
}
.real-map-main-photo {
  display:flex; align-items:center; justify-content:center;
  width:100%; flex:1; min-height:0; padding:0; margin:0;
  background:#111d15; border:1px solid #546953; border-radius:6px; cursor:zoom-in;
}
.real-map-main-photo img {max-width:100%; max-height:100%; width:100%; height:100%; object-fit:contain;}
.real-map-explainer {
  flex:none; margin:0; max-width:630px;
  color:#e4e9d8; text-align:center; font-size:11px; line-height:1.3;
}
.real-map-practice-button {flex:none; min-height:29px; font-size:11px;}
.real-map-credit {flex:none; font-size:10px; color:#e1cb9b; text-decoration:underline;}
.real-map-splash[hidden], .real-map-thumb[hidden], .map-surface[hidden], .map-legend[hidden] {
  display:none!important;
}
.real-photo-open.real-image-unavailable:after {
  content:"La fotografía no está disponible. Abre la fuente original abajo.";
  color:#f0dabb; font-size:12px; text-align:center; padding:12px;
  position:absolute; inset:0; display:grid; place-items:center; background:#18251b;
}
@media(max-width:760px) {
  .real-map-splash {padding:5px;gap:3px;}
  .real-map-explainer {font-size:10px;}
  .real-map-practice-button {min-height:26px;font-size:10px;}
  .real-map-credit {font-size:9px;}
}


/* MESA DIDÁCTICA — componentes originales recortados del reglamento.
   Se mantiene la imagen original: ningún texto o dibujo de carta es generado. */
.component-stage {display:flex;flex-direction:column;min-width:0;min-height:0;width:100%;height:100%;gap:7px;
  border:1px solid #53644e;border-radius:10px;padding:9px;
  background:radial-gradient(ellipse at 37% 20%,#2d352b,#152019 74%);
}
.component-stage-head {display:flex;justify-content:space-between;align-items:center;gap:6px;flex:none;color:#edcf9b}
.component-stage-head span {font-weight:800;letter-spacing:.075em;font-size:10px}
.component-stage-head small {color:#afbda8;font-size:10px;white-space:nowrap}
.component-stage-body {flex:1;min-height:0;min-width:0;display:grid;grid-template-columns:minmax(0,1fr) clamp(100px,29%,175px);gap:8px}
.component-stage-feature {display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden;
  border:1px solid #68745a;border-radius:9px;background:radial-gradient(circle at center,#2e392f,#111c15);box-shadow:inset 0 0 40px #040b05a9}
.component-stage-hero {flex:1;display:grid;place-items:center;min-width:0;min-height:0;width:100%;border:0;background:transparent;cursor:zoom-in;overflow:hidden;padding:10px}
.component-stage-hero:hover {background:#5160471a}
.game-component-crop {position:relative;display:block;flex:none;width:min(100%,440px);height:auto;aspect-ratio:var(--cut-aspect);
  overflow:hidden;isolation:isolate;background:transparent;border-radius:4px;}
.game-component-crop > img {position:absolute!important;width:var(--cut-width)!important;height:var(--cut-height)!important;
  max-width:none!important;max-height:none!important;left:var(--cut-left);top:var(--cut-top);
  object-fit:fill!important;filter:none!important;transform:none!important;display:block}
.component-stage-hero > .game-component-crop {width:auto;height:100%;max-width:100%;max-height:100%}
.component-stage-magnify {position:absolute;top:14px;right:13px;display:grid;place-items:center;width:28px;height:28px;border:1px solid #7d876f;
  border-radius:5px;color:#f1dfb7;background:#132017dd;font-size:20px;pointer-events:none}
.component-stage-hero-label {flex:none;display:grid;gap:2px;padding:8px 10px;background:#121d15e8;border-top:1px solid #465b46}
.component-stage-hero-label strong {font-size:12px;line-height:1.17;color:#f4e8c9}
.component-stage-hero-label span {font-size:10px;color:#c5d0c2}
.component-stage-tray {display:flex;flex-direction:column;min-width:0;min-height:0;gap:5px;overflow-y:auto;scrollbar-width:thin;scrollbar-color:#65745d transparent;padding-right:2px}
.component-stage-piece {min-height:72px;display:grid;grid-template-columns:44% 1fr;align-items:center;gap:5px;padding:5px;overflow:hidden;
  border:1px solid #52654e;border-radius:7px;background:#1b281e;color:#e3e8d8;text-align:left;cursor:pointer;animation:component-place 320ms both;
  animation-delay:calc(var(--piece-order)*70ms)}
.component-stage-piece:hover,.component-stage-piece.is-selected {background:#36432f;border-color:#c5ab78}
.component-stage-piece:focus-visible,.component-stage-hero:focus-visible,.component-sheet-gallery button:focus-visible {
  outline:2px solid #e5b973;outline-offset:-3px}
.component-stage-piece .game-component-crop {width:100%;max-height:64px}
.component-stage-piece > span:last-child {font-size:10px;line-height:1.16;font-weight:600;overflow-wrap:anywhere}
.component-stage-bottom {flex:none;display:flex;justify-content:space-between;align-items:center;gap:10px;padding-top:2px;border-top:1px solid #475544}
.component-stage-bottom p {margin:0;font-size:10px;line-height:1.2;color:#c5d1bd;max-width:72%}
.component-stage-bottom a {font-size:10px;color:#f0ca8d;text-decoration:underline;white-space:nowrap}
.component-image-failed::after {content:"";position:absolute;inset:0;background:#172318dd}
@keyframes component-place {from {opacity:.05;transform:translateY(9px) rotate(-2deg)}to{opacity:1;transform:translateY(0) rotate(0)}}
@media(prefers-reduced-motion:reduce) {.component-stage-piece {animation:none}}
.component-sheet-gallery {display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,.85fr);min-width:0;gap:6px;padding:5px}
.component-sheet-gallery > div {display:flex;flex-direction:column;align-items:center;min-width:0;gap:4px}
.component-sheet-gallery button {display:grid;place-items:center;min-width:0;width:100%;min-height:110px;max-height:185px;
  overflow:hidden;border:1px solid #6e7b63;border-radius:6px;background:#19251c;padding:5px;cursor:zoom-in}
.component-sheet-gallery button .game-component-crop {height:100%;width:auto;max-width:100%;max-height:178px}
.component-sheet-gallery small {text-align:center;color:#eddeb9;font-size:10px}
.component-sheet-disclaimer {margin:2px 6px 6px;color:#cbd6c8;font-size:11px;line-height:1.25}
.component-zoom-display {width:100%;height:100%;display:grid;place-items:center;overflow:hidden;padding:6px;background:#111b15}
.component-zoom-display .game-component-crop {height:100%;width:auto;max-width:100%;max-height:100%;background:transparent}
.real-image-viewport {overflow:hidden}
.real-image-viewport img {max-width:none;max-height:none}
.real-sheet-ref,.real-photo,.real-materials {display:none!important}
.hero-banner {background:linear-gradient(150deg,#243529,#152419 78%)!important}
@media(max-width:760px) {
  .component-stage {padding:5px;gap:4px}
  .component-stage-body {grid-template-columns:minmax(0,1fr) clamp(80px,29%,125px);gap:4px}
  .component-stage-hero {padding:5px}
  .component-stage-hero-label {padding:4px 6px}
  .component-stage-hero-label strong {font-size:11px}
  .component-stage-head span {font-size:9px}
  .component-stage-piece {min-height:63px;padding:3px;gap:3px}
  .component-stage-piece > span:last-child {font-size:9px}
  .component-stage-bottom p,.component-stage-bottom a {font-size:9px}
  .component-sheet-gallery button {min-height:100px;max-height:155px}
  .component-sheet-gallery button .game-component-crop {max-height:145px}
}
@media(max-height:560px) {
  .component-stage-piece {min-height:51px}
  .component-stage-hero-label span {display:none}
  .component-stage-head small {display:none}
  .component-stage-bottom p {max-width:65%}
}

.guide-avatar {display:grid;place-items:center;flex:none;border:1px solid #6c805e;border-radius:50%;background:#223526;color:#eed19a;padding:6px;}
.guide-avatar svg {width:100%;height:100%;}
.component-stage-hero {position:relative;}
