:root {
  color-scheme: dark;
  --bg: #101618;
  --panel: #192024;
  --panel2: #20282c;
  --line: #364044;
  --gold: #d3b77b;
  --ink: #f0e8d6;
  --muted: #a3aaa8;
  --red: #c5786b;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 14px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background:
    radial-gradient(ellipse at 50% 0, #25313655, transparent 70%), var(--bg);
  color: var(--ink);
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
  color: inherit;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 11px 15px;
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.15s;
}
button:hover:not(:disabled) {
  border-color: var(--gold);
  background: #d3b77b12;
}
button:active:not(:disabled) {
  transform: translateY(1px);
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid #ebca83;
  outline-offset: 4px;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}
a {
  color: var(--gold);
  text-decoration: none;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1,
h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
}
h1 {
  font-size: clamp(25px, 3vw, 42px);
  line-height: 1.15;
  margin-bottom: 10px;
}
h2 {
  font-size: 30px;
}
h3 {
  font-size: 16px;
  font-weight: 550;
}
p {
  color: var(--muted);
  line-height: 1.65;
}
small {
  color: var(--muted);
}
main {
  max-width: 1540px;
  margin: auto;
  padding: 34px 42px 46px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 19px 42px;
  border-bottom: 1px solid #3a4142;
  background: #111719f2;
  gap: 24px;
}
.brand {
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: Georgia, serif;
  font-size: 22px;
  letter-spacing: 3px;
  white-space: nowrap;
}
.brand > span {
  font-size: 43px;
  color: var(--gold);
  line-height: 1;
}
.brand small {
  display: block;
  font: 9px system-ui;
  letter-spacing: 4px;
  margin-top: 5px;
}
.topbar nav {
  display: flex;
  gap: 6px;
}
.topbar nav button {
  border: 0;
  color: var(--muted);
  padding: 11px 16px;
}
.topbar nav button.active {
  color: var(--gold);
  background: #d3b77b0b;
}
.edition {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--muted);
  white-space: nowrap;
}
.edition i {
  display: inline-block;
  width: 5px;
  height: 5px;
  background: #92ad9a;
  border-radius: 50%;
  margin-right: 8px;
}
.edition span {
  color: #63716d;
  margin-left: 12px;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin: 3px 0 27px;
}
.page-heading p {
  margin: 0;
}
.eyebrow {
  color: var(--gold);
  font-size: 10px;
  letter-spacing: 2.5px;
  margin-bottom: 14px;
}
.counter {
  font: 46px Georgia;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 15px;
}
.counter small {
  font: 12px system-ui;
  max-width: 65px;
  line-height: 1.5;
}
.primary {
  background: linear-gradient(#d8bd84, #b79a61);
  border: 1px solid #e2c98d;
  color: #181c1d;
  font-weight: 650;
  min-height: 44px;
}
.primary:hover:not(:disabled) {
  background: linear-gradient(#ecd29b, #c3a66c);
  color: #141818;
}
.primary span {
  margin-left: 24px;
}
.secondary {
  border-color: #616154;
  background: #222927;
  min-height: 44px;
}
.gold-line {
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
  width: 90px;
  margin: 22px 0;
}
.creation-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(300px, 0.85fr);
  gap: 30px;
}
.segmented {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
  padding-bottom: 12px;
}
.segmented button {
  border: 0;
  color: var(--muted);
  padding: 10px 18px;
}
.segmented button.active {
  background: #b49a631a;
  color: var(--gold);
}
.hero-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.hero-card {
  padding: 0;
  position: relative;
  overflow: hidden;
  text-align: left;
  border-color: #3d484a;
  min-height: 160px;
  background: #1c2527;
}
.hero-card .portrait {
  width: 100%;
  height: 119px;
  object-fit: cover;
  object-position: 50% 26%;
  display: block;
  filter: saturate(0.68);
}
.hero-card.selected {
  border-color: #e7cb8f;
  box-shadow: 0 0 0 1px #e7cb8f44;
}
.hero-card.selected .portrait {
  filter: saturate(1);
}
.hero-card > div:not(.portrait) {
  padding: 10px 9px;
  min-height: 59px;
}
.hero-card strong {
  display: block;
  font-size: 11px;
  font-weight: 550;
  line-height: 1.4;
}
.hero-card small {
  font-size: 9px;
  display: block;
  margin-top: 5px;
  line-height: 1.3;
}
.hero-num {
  position: absolute;
  top: 6px;
  left: 7px;
  color: #f3e6c8;
  background: #11191dcc;
  padding: 3px 5px;
  font-size: 9px;
  border-radius: 2px;
}
.portrait {
  background: #283639;
  object-fit: cover;
}
.initials {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse, #3d4a49, #182126) !important;
  gap: 10px;
}
.initials > span {
  font: 30px Georgia;
  color: #c4b18a;
}
.initials > small {
  font-size: 7px;
  letter-spacing: 2px;
}
.hero-preview {
  position: relative;
  min-height: 540px;
  max-height: 760px;
  height: clamp(540px, calc(100vh - 220px), 760px);
  align-self: start;
  position: sticky;
  top: 18px;
  border: 1px solid #6e654c;
  overflow: hidden;
  background: #1d272a;
}
.stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 18px 0;
}
.stats-row div {
  min-width: 45px;
}
.stats-row dt {
  font-size: 10px;
  color: var(--muted);
}
.stats-row dd {
  font:
    24px Georgia,
    serif;
  color: var(--gold);
  margin: 5px 0 0;
}
.hero-art {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  object-fit: cover;
  object-position: 50% 25%;
}
.hero-preview .initials > span {
  font-size: 90px;
}
.preview-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, #10191bf5 2%, #10191bdc 23%, #10191b00 80%);
}
.hero-copy {
  position: absolute;
  bottom: 0;
  padding: 30px;
  width: 100%;
}
.hero-copy h2 {
  font-size: 36px;
  line-height: 1.1;
  margin-bottom: 12px;
}
.hero-copy p {
  max-width: 260px;
  font-size: 13px;
  color: #d1d3ca;
}
.hero-copy .primary {
  display: block;
  width: 100%;
  margin: 27px 0 16px;
}
.save-note {
  display: block;
  font-size: 10px;
  line-height: 1.6;
  color: #a2aaa3;
}
.pill {
  display: inline-block;
  font-size: 10px;
  border: 1px solid #9b8b654d;
  color: #dbc99f;
  padding: 6px 10px;
  background: #171e20aa;
}
.intro-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-block: 1px solid var(--line);
  margin-top: 32px;
  padding: 21px 0;
}
.intro-strip > div {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-left: 22px;
  border-right: 1px solid var(--line);
}
.intro-strip > div:last-child {
  border: 0;
}
.intro-strip b {
  font: 29px Georgia;
  color: var(--gold);
}
.intro-strip span {
  font-size: 12px;
  color: var(--muted);
}
footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 42px;
  border-top: 1px solid var(--line);
  font-size: 9px;
  color: #838d8b;
  line-height: 1.6;
}
.custom-form {
  border: 1px solid var(--line);
  padding: 28px;
  background: var(--panel);
  min-height: 560px;
}
.custom-form > label {
  display: block;
  margin-bottom: 24px;
  font-size: 12px;
  color: var(--gold);
}
input,
select {
  background: #101719;
  color: var(--ink);
  border: 1px solid #46514e;
  border-radius: 3px;
  padding: 13px;
  width: 100%;
  margin-top: 9px;
}
select {
  min-height: 44px;
}
.input-row {
  display: flex;
  gap: 9px;
}
.input-row button {
  margin-top: 9px;
}
.custom-form > .primary {
  width: 100%;
  margin-top: 24px;
}
.notice {
  color: #b1b6ac;
  font-size: 12px;
  line-height: 1.7;
  border-left: 2px solid #9b865d;
  background: #b79a6108;
  padding: 14px 17px;
  margin: 22px 0 0;
}
.playerbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 17px 42px;
  background: #192124;
  border-bottom: 1px solid #3a4142;
}
.avatar {
  width: 52px;
  height: 60px;
  border: 1px solid #817451;
  border-radius: 3px;
  object-position: center 20%;
}
.avatar > span {
  font-size: 20px;
}
.avatar > small {
  display: none;
}
.player-name {
  min-width: 145px;
}
.player-name small {
  display: block;
  font-size: 8px;
  letter-spacing: 2px;
  color: var(--gold);
}
.player-name strong {
  display: block;
  font: 18px Georgia;
  margin: 6px 0;
}
.player-name > span {
  font-size: 10px;
  color: var(--muted);
}
.level {
  display: flex;
  flex-direction: column;
  text-align: center;
  padding: 0 18px;
  border-inline: 1px solid #3b4546;
}
.level b {
  font: 25px Georgia;
  color: var(--gold);
}
.level span {
  font-size: 9px;
  color: var(--muted);
}
.player-meter {
  min-width: 95px;
  flex: 1;
  max-width: 170px;
}
.meter-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 9px;
  margin-bottom: 7px;
  color: #b3bab4;
}
.meter-label b {
  font-weight: 500;
  color: var(--ink);
}
.meter {
  height: 5px;
  background: #11191b;
  overflow: hidden;
  border-radius: 2px;
}
.meter i {
  display: block;
  height: 100%;
  background: #88a58c;
  transition: width 0.25s;
}
.meter.mana i {
  background: #6f9dba;
}
.meter.stamina i {
  background: #beaa69;
}
.meter.enemy i {
  background: #c17e70;
}
.meter.xp {
  height: 3px;
}
.meter.xp i {
  background: var(--gold);
}
.player-xp {
  margin-left: auto;
  width: 160px;
}
.player-xp > span {
  display: block;
  font-size: 10px;
  color: var(--gold);
  margin-bottom: 12px;
}
.level-cap {
  color: var(--gold);
  font-size: 12px;
  padding-top: 6px;
}
.opponent-reward {
  color: var(--gold);
  font-size: 12px;
}
.dragon-state {
  display: grid;
  gap: 4px;
  margin: 8px 0 12px;
  padding: 8px 10px;
  border-left: 2px solid var(--gold);
  background: #ffffff05;
  font-size: 12px;
}
.dragon-state > b {
  color: var(--gold);
}
.dragon-state > small {
  line-height: 1.4;
}
.world-tabs {
  display: flex;
  gap: 7px;
}
.world-tabs button {
  font-size: 11px;
  white-space: nowrap;
}
.world-tabs .active {
  border-color: #9c895b;
  background: #d3b77b10;
  color: var(--gold);
}
.atlas-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 22px;
}
.map-panel {
  border: 1px solid #6d634e;
  background: #172222;
  min-width: 0;
  align-self: start;
}
.map-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #1d292a;
  border-bottom: 1px solid #4a5146;
}
.map-toolbar button {
  padding: 7px 13px;
  min-width: 38px;
}
.select-compact {
  display: flex;
  align-items: center;
  gap: 10px;
}
.select-compact label {
  font-size: 11px;
  color: #c9c5b4;
}
.select-compact select {
  width: 135px;
  margin: 0;
  padding: 7px;
  min-height: 34px;
  font-size: 11px;
}
.map-caption {
  font-size: 9px;
  margin-left: auto;
  margin-right: 8px;
  color: var(--muted);
}
.map-scroll {
  overscroll-behavior: contain;
  overflow: auto;
  max-height: 70vh;
}
.map-scroll:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
}
.destination-picker select {
  max-width: 160px;
}
@media (max-width: 520px) {
  .map-toolbar {
    flex-wrap: wrap;
    gap: 10px;
  }
  .destination-picker {
    order: 4;
    width: 100%;
  }
  .destination-picker select {
    flex: 1;
    max-width: none;
  }
}
.map-canvas {
  position: relative;
  min-width: 100%;
  aspect-ratio: 4/3;
  isolation: isolate;
}
.world-art {
  width: 100%;
  height: 100%;
  display: block;
  filter: saturate(0.78) brightness(0.83);
}
.map-canvas::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 55px #0b191b99;
  pointer-events: none;
  z-index: 1;
}
.routes {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.routes line {
  stroke: #f2e0aa70;
  stroke-width: 1.8;
  stroke-dasharray: 5 5;
}
.routes .route-active {
  stroke: #ffdf80;
  stroke-width: 3;
  stroke-dasharray: none;
  filter: drop-shadow(0 0 3px #fbd372);
}
.map-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 0;
  border: 0;
  border-radius: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 2px;
  white-space: nowrap;
  font-size: 9px;
  color: #f8edce;
  min-width: 38px;
  min-height: 36px;
}
.map-pin i {
  font-style: normal;
  font-size: 15px;
  color: #f0cd84;
  text-shadow:
    0 1px 5px #000,
    0 0 5px #000;
}
.map-pin span {
  padding: 3px 5px;
  background: #172125e6;
  border: 1px solid #a4906055;
  border-radius: 2px;
  box-shadow: 0 2px 4px #0005;
}
.map-pin.current i {
  color: #fff4c9;
  filter: drop-shadow(0 0 7px #fff1ab);
}
.map-pin.current span {
  color: #f7dfa4;
  border-color: #dfc17d;
  background: #25383a;
}
.map-pin.selected span {
  box-shadow: 0 0 0 1px #dfc17d;
}
.map-pin:hover:not(:disabled) {
  background: transparent;
  transform: translate(-50%, -50%);
}
.gate-pin i {
  color: #df9aff;
  font-size: 20px;
}
.map-compass {
  position: absolute;
  bottom: 37px;
  right: 28px;
  font-size: 42px;
  color: #e7d4a9b0;
  text-shadow: 0 2px 4px #000;
}
.map-compass small {
  position: absolute;
  top: -8px;
  left: 19px;
  font-size: 10px;
  color: #e7d4a9;
}
.map-legend {
  position: absolute;
  bottom: 8px;
  left: 12px;
  display: flex;
  gap: 15px;
  color: #ddd4bc;
  background: #152125cc;
  padding: 7px;
  font-size: 8px;
  z-index: 2;
}
.map-disclaimer {
  padding: 10px 15px;
  font-size: 9px;
  color: #b7b8a6;
  line-height: 1.6;
  border-top: 1px solid #4a5146;
}
.location-panel {
  background: linear-gradient(155deg, #253034, #192124);
  border: 1px solid #404a4b;
  padding: 24px;
  align-self: start;
}
.location-panel h2 {
  font-size: 32px;
  margin-bottom: 13px;
}
.location-panel p {
  font-size: 12px;
}
.location-panel > .primary,
.location-panel > .secondary {
  width: 100%;
  margin-top: 12px;
  font-size: 12px;
}
.location-stat {
  display: flex;
  gap: 14px;
  align-items: center;
  margin: 12px 0 18px;
}
.location-stat b {
  font: 36px Georgia;
  color: var(--gold);
}
.location-stat span {
  font-size: 12px;
  color: var(--muted);
  max-width: 110px;
  line-height: 1.5;
}
.route-tip {
  margin-top: 25px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
.route-tip small {
  font-size: 8px;
  color: var(--gold);
  letter-spacing: 1.5px;
}
.route-tip p {
  font-size: 11px;
  margin: 9px 0 0;
}
.route-list {
  margin: 20px 0;
}
.route-list > div {
  position: relative;
  padding: 0 0 22px 23px;
  font-size: 12px;
}
.route-list > div:before {
  content: "";
  position: absolute;
  left: 4px;
  top: 10px;
  bottom: -1px;
  width: 1px;
  background: #9b865b;
}
.route-list > div:last-child:before {
  display: none;
}
.route-list i {
  position: absolute;
  left: 0;
  top: 4px;
  width: 9px;
  height: 9px;
  border: 1px solid var(--gold);
  transform: rotate(45deg);
  background: #1d272a;
}
.route-list .current i {
  background: var(--gold);
}
.muted {
  color: var(--muted);
}
.portal-card {
  display: flex;
  text-align: left;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-top: 16px;
  padding: 14px 12px;
  background: #634e791a;
  border-color: #8c799766;
}
.portal-card > span {
  font-size: 30px;
  color: #c9a2dd;
}
.portal-card div {
  flex: 1;
}
.portal-card small {
  display: block;
  font-size: 8px;
  margin-bottom: 5px;
  color: #bca6c7;
}
.portal-card b {
  font-size: 11px;
  font-weight: 500;
}
.portal-card i {
  font-style: normal;
  color: #c9a2dd;
}
.city-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 26px;
}
.section-label {
  display: flex;
  align-items: baseline;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}
.section-label h2 {
  font-size: 24px;
}
.section-label span {
  color: var(--muted);
  font-size: 10px;
}
.opponents {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.opponent {
  border: 1px solid #4e5350;
  background: var(--panel);
  overflow: hidden;
}
.opponent > .portrait {
  width: 100%;
  height: 200px;
  object-position: 50% 25%;
}
.opponent-content {
  padding: 18px;
}
.opponent-content > small {
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--gold);
}
.opponent h3 {
  font: 23px Georgia;
  margin: 11px 0 9px;
}
.opponent p {
  font-size: 11px;
  margin-bottom: 14px;
}
.opponent button {
  width: 100%;
  font-size: 11px;
  margin-top: 14px;
}
.danger {
  font-size: 10px;
  color: #a6bf9c;
}
.danger.high {
  color: #da9382;
}
.destination {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-size: 12px;
  text-align: left;
  margin-bottom: 9px;
}
.divine-label {
  margin-top: 35px;
  color: #e9c876;
}
.divine {
  border-color: #b49a60;
  background: #302c22;
}
.empty {
  grid-column: 1/-1;
  border: 1px dashed var(--line);
  padding: 60px 30px;
  text-align: center;
}
.empty > span {
  font-size: 50px;
  color: var(--gold);
}
.empty h3 {
  margin-top: 20px;
}
.result-banner {
  display: flex;
  align-items: center;
  gap: 20px;
  border: 1px solid #8c9d6b;
  background: #536a361c;
  padding: 20px 28px;
  margin-bottom: 30px;
}
.result-banner > span {
  font-size: 34px;
  color: #c8d19c;
}
.result-banner h2 {
  margin: 0 0 4px;
  font-size: 28px;
}
.result-banner p {
  margin: 0;
  font-size: 12px;
}
.result-banner button {
  margin-left: auto;
  font-size: 12px;
}
.result-banner.loss {
  border-color: #8c6359;
  background: #a3664f10;
}
.realm-landscape {
  position: relative;
  min-height: 440px;
  background:
    radial-gradient(ellipse at 70% 40%, #954f3c55, transparent 40%),
    linear-gradient(135deg, #131a20, #382a31);
  border: 1px solid #8c6960;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-around;
}
.realm-symbol {
  font-size: 230px;
  color: #c7836a99;
  line-height: 1;
}
.realm-copy {
  padding: 40px;
}
.realm-copy h2 {
  font-size: 48px;
  margin: 18px 0;
}
.realm-copy > small {
  letter-spacing: 3px;
  font-size: 9px;
  color: #c79885;
}
.realm-gates {
  display: flex;
  gap: 20px;
  max-width: 850px;
}
.realm-gates > * {
  flex: 1;
}
.skills-layout {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 28px;
}
.skill-points {
  display: flex;
  gap: 15px;
  align-items: center;
}
.skill-points b {
  font: 40px Georgia;
  color: var(--gold);
}
.skill-points span {
  font-size: 12px;
  max-width: 65px;
  line-height: 1.5;
  color: var(--muted);
}
.branches {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 14px;
  max-height: 850px;
  overflow: auto;
}
.branches .segmented {
  gap: 0;
  margin-bottom: 10px;
}
.branches .segmented button {
  padding: 9px 15px;
  font-size: 11px;
}
.branch {
  display: flex;
  align-items: center;
  text-align: left;
  gap: 13px;
  width: 100%;
  border: 1px solid transparent;
  padding: 11px 12px;
  margin-bottom: 3px;
}
.branch > span {
  font-size: 24px;
  color: var(--accent);
  width: 30px;
  text-align: center;
}
.branch strong {
  font-size: 12px;
  font-weight: 500;
}
.branch small {
  display: block;
  font-size: 9px;
  margin-top: 4px;
}
.branch > i {
  margin-left: auto;
  font-style: normal;
  color: #7e8d88;
}
.branch.active {
  border-color: #c1ad794a;
  background: #9b865b17;
}
.branch-detail {
  border: 1px solid var(--line);
  background: linear-gradient(140deg, #242d31, #182125);
  padding: 30px;
}
.branch-title {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 30px;
}
.branch-rune {
  width: 95px;
  height: 95px;
  border: 1px solid var(--accent);
  background: #0d171b50;
  display: grid;
  place-items: center;
  font-size: 50px;
  color: var(--accent);
}
.branch-title small {
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 2px;
}
.branch-title h2 {
  font-size: 38px;
  margin: 8px 0;
}
.branch-title p {
  margin: 0;
  font-size: 12px;
}
.skill-tree {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.skill-node {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  border: 1px solid #3e494a;
  background: #101a1e77;
  position: relative;
}
.skill-node.learned {
  border-color: #a2956d88;
  background: #c0ab7210;
}
.skill-node + .skill-node:before {
  content: "";
  position: absolute;
  left: 35px;
  top: -17px;
  width: 1px;
  height: 16px;
  background: var(--accent);
}
.tier {
  font: 24px Georgia;
  color: var(--accent);
  min-width: 28px;
}
.skill-node-body {
  flex: 1;
}
.skill-node-heading {
  display: flex;
  align-items: center;
  gap: 16px;
}
.skill-node-heading h3 {
  margin: 0;
  font: 19px Georgia;
}
.skill-node-heading > span {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}
.skill-node p {
  font-size: 11px;
  margin: 8px 0;
}
.skill-numbers {
  display: flex;
  gap: 15px;
  font-size: 9px;
  color: var(--accent);
}
.skill-node > button {
  font-size: 11px;
  min-width: 120px;
  white-space: nowrap;
}
.equipped {
  border-color: #808e65;
  color: #c6d2a8;
  background: #4c613a22;
}
.loadout {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.loadout h3 span {
  color: var(--gold);
  font-size: 12px;
  margin-left: 15px;
}
.loadout > div:not(.loadout-expansion) {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.loadout button[data-equip] {
  font-size: 10px;
  padding: 9px 10px;
  background: #141f22;
}
.loadout button[data-equip] span {
  color: var(--gold);
  margin-right: 7px;
}
.loadout button[data-equip] small {
  margin-left: 10px;
}
.loadout p {
  font-size: 10px;
  margin-top: 15px;
}
.round {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--gold);
}
.round b {
  font: 34px Georgia;
  margin-left: 12px;
}
.arena {
  display: grid;
  grid-template-columns: 1fr 80px 1fr;
  gap: 18px;
  align-items: center;
  margin: 20px 0 28px;
}
.fighter {
  display: flex;
  align-items: center;
  gap: 23px;
  border: 1px solid #7e7557;
  background: linear-gradient(130deg, #2a3434, #172125);
  padding: 20px;
}
.fighter > .portrait {
  width: 105px;
  height: 123px;
  object-position: 50% 20%;
  border: 1px solid #b39e6a;
}
.fighter > div:not(.portrait) {
  flex: 1;
  min-width: 0;
}
.fighter small {
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--gold);
}
.fighter h2 {
  font-size: 28px;
  margin: 12px 0 19px;
}
.fighter.enemy {
  border-color: #805d55;
  background: linear-gradient(130deg, #312c2b, #201e21);
}
.fighter.enemy small {
  color: #cb9b8c;
}
.fighter.enemy > .portrait {
  border-color: #9e7365;
}
.versus {
  display: flex;
  flex-direction: column;
  text-align: center;
  gap: 15px;
  font-size: 35px;
  color: var(--gold);
}
.versus span {
  font: 15px Georgia;
  letter-spacing: 4px;
}
.status-row {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 10px;
  min-height: 16px;
}
.status-row span {
  border: 1px solid #8d795355;
  padding: 3px 6px;
  font-size: 8px;
  color: #cfbd94;
}
.combat-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
}
.combat-controls {
  padding: 26px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.combat-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
}
.combat-choice h3,
.step-heading {
  font: 22px Georgia;
  color: var(--gold);
}
.combat-choice h3 span,
.step-heading span {
  font: 14px system-ui;
  color: var(--ink);
  margin-left: 12px;
}
.zone-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}
.zone-grid button {
  padding: 10px 5px;
  font-size: 11px;
  min-height: 44px;
}
.zone-grid button.active {
  background: #d3b77b25;
  border-color: #d3b77b;
  color: #e9d3a2;
}
.intent {
  padding: 12px 14px;
  border-left: 2px solid #ae8462;
  background: #bd91631a;
  font-size: 11px;
  margin: 22px 0;
}
.intent b {
  color: #e2bf90;
  margin-left: 6px;
}
.intent > span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  margin-top: 5px;
}
.action-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}
.action-grid button {
  display: flex;
  align-items: center;
  text-align: left;
  gap: 12px;
  padding: 12px 10px;
  background: #111b1e;
  min-height: 60px;
}
.action-grid button > span {
  font-size: 24px;
  color: var(--gold);
  min-width: 26px;
  text-align: center;
}
.action-grid b {
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
}
.action-grid small {
  display: block;
  font-size: 9px;
  margin-top: 5px;
}
.action-grid button.active {
  border-color: var(--gold);
  background: #9c84552b;
}
.turn-submit {
  display: flex;
  gap: 25px;
  align-items: center;
  border-top: 1px solid var(--line);
  margin-top: 22px;
  padding-top: 20px;
}
.turn-submit p {
  flex: 1;
  font-size: 11px;
  margin: 0;
}
.turn-submit button {
  min-width: 200px;
}
.combat-log {
  background: #141e21;
  border: 1px solid var(--line);
  padding: 22px;
  display: flex;
  flex-direction: column;
  max-height: 650px;
}
.combat-log h3 {
  font: 21px Georgia;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}
.combat-log > div {
  overflow: auto;
  flex: 1;
}
.combat-log p {
  font-size: 11px;
  line-height: 1.65;
  margin-bottom: 13px;
  border-bottom: 1px solid #2d3737;
  padding-bottom: 10px;
}
.combat-log p.fresh {
  color: #e7cf8e;
}
.log-round { padding: 0 10px 8px; }
.block-ring-hint { display: block; margin-top: 6px; color: var(--muted); }
.log-round + .log-round { border-top: 1px solid #526064; padding-top: 18px; margin-top: 14px; }
.log-round h4 { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.log-round h4 span { font-size: 10px; font-weight: normal; }
.log-round.latest { border-left: 2px solid var(--gold); background: #cab07208; }
.log-round.latest h4 { color: #e7cf8e; }
.combat-log .log-round p:last-child { border-bottom: 0; margin-bottom: 0; }
.result-log { margin: -12px 0 28px; }
.result-log summary { cursor: pointer; color: var(--gold); padding: 12px 0; font-size: 13px; }
.result-log .combat-log { max-height: 420px; }
.combat-log > small {
  border-top: 1px solid var(--line);
  padding-top: 15px;
  font-size: 9px;
  line-height: 1.6;
}
.journal-page {
  max-width: 1100px;
}
.journal-list {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 15px 25px;
}
.journal-list > div {
  display: flex;
  align-items: baseline;
  gap: 25px;
  border-bottom: 1px solid #394241;
  padding: 13px 0;
}
.journal-list > div:last-child {
  border: 0;
}
.journal-list span {
  font: 20px Georgia;
  color: var(--gold);
  min-width: 27px;
}
.journal-list p {
  margin: 0;
  font-size: 13px;
}
.death-page {
  max-width: 900px;
  text-align: center;
}
.death-sigil {
  font: 100px Georgia;
  color: #b19373;
  margin: 30px;
}
.death-page > .primary {
  margin: 25px 0;
}
.death-page details {
  text-align: left;
  padding: 25px;
  border: 1px solid var(--line);
  margin-top: 25px;
}
.death-page details p {
  font-size: 12px;
}
.loading {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.sigil {
  font-size: 90px;
  color: var(--gold);
  margin-bottom: 20px;
}
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 30px);
  opacity: 0;
  pointer-events: none;
  background: #2e3635;
  border: 1px solid #b89a64;
  color: #f1e3c6;
  padding: 14px 24px;
  border-radius: 4px;
  font-size: 13px;
  max-width: 90vw;
  z-index: 99;
  box-shadow: 0 8px 30px #0008;
  transition: 0.2s;
}
#toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
.busy button {
  pointer-events: none;
  opacity: 0.65;
}
@media (min-width: 1700px) {
  main {
    padding-inline: 35px;
  }
  .hero-card .portrait {
    height: 143px;
  }
}
@media (max-width: 1150px) {
  main {
    padding: 28px 24px;
  }
  .topbar {
    padding: 18px 24px;
  }
  .edition {
    display: none;
  }
  .playerbar {
    padding: 15px 24px;
    gap: 14px;
  }
  .player-xp {
    display: none;
  }
  .hero-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .creation-layout {
    grid-template-columns: 1.5fr 0.85fr;
    gap: 20px;
  }
  .hero-preview {
    min-height: 560px;
  }
  .hero-copy {
    padding: 22px;
  }
  .atlas-layout {
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 16px;
  }
  .location-panel {
    padding: 20px;
  }
  .opponents {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .skills-layout {
    grid-template-columns: 250px 1fr;
    gap: 20px;
  }
  .branch-detail {
    padding: 22px;
  }
  .combat-layout {
    grid-template-columns: 1fr 260px;
  }
  .action-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .arena {
    grid-template-columns: 1fr 40px 1fr;
    gap: 12px;
  }
  .fighter {
    padding: 16px;
    gap: 16px;
  }
  .fighter > .portrait {
    width: 80px;
    height: 100px;
  }
  .fighter h2 {
    font-size: 23px;
  }
  .combat-choice {
    gap: 15px;
  }
  .zone-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .skill-node {
    gap: 12px;
    padding: 15px;
  }
  .skill-node > button {
    min-width: 95px;
  }
  .page-heading h1 {
    font-size: 31px;
  }
}
@media (max-width: 800px) {
  .topbar {
    flex-wrap: wrap;
    gap: 12px;
    padding: 15px 18px;
  }
  .brand {
    font-size: 18px;
    letter-spacing: 2px;
  }
  .brand > span {
    font-size: 34px;
  }
  .topbar nav {
    margin-left: auto;
    gap: 0;
  }
  .topbar nav button {
    font-size: 11px;
    padding: 9px 10px;
  }
  .playerbar {
    padding: 12px 18px;
    gap: 11px;
    flex-wrap: wrap;
  }
  .player-name {
    flex: 1;
  }
  .level {
    border-right: 0;
  }
  .player-meter {
    max-width: none;
    min-width: 25%;
    flex: 1;
  }
  .player-meter .meter-label {
    font-size: 8px;
  }
  .avatar {
    width: 42px;
    height: 48px;
  }
  .player-name strong {
    font-size: 17px;
  }
  .player-name > span {
    font-size: 9px;
  }
  .level b {
    font-size: 22px;
  }
  .page-heading {
    align-items: flex-start;
    gap: 16px;
  }
  .page-heading h1 {
    font-size: 29px;
  }
  .counter {
    display: none;
  }
  .creation-layout {
    grid-template-columns: 1fr;
  }
  .hero-preview {
    min-height: 380px;
    height: 420px;
    position: relative;
    top: 0;
    grid-row: 1;
  }
  .hero-preview.custom-preview {
    display: none;
  }
  .hero-art {
    object-position: 50% 29%;
  }
  .hero-copy {
    max-width: 60%;
    background: linear-gradient(90deg, #10191be6, transparent);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: end;
  }
  .hero-copy h2 {
    font-size: 29px;
  }
  .hero-copy .primary {
    margin: 15px 0 10px;
  }
  .hero-copy .save-note {
    font-size: 9px;
  }
  .hero-copy .gold-line {
    margin: 12px 0;
  }
  .hero-copy p {
    font-size: 12px;
    margin-bottom: 10px;
  }
  .hero-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .hero-card .portrait {
    height: 110px;
  }
  .hero-card > div:not(.portrait) {
    padding: 8px 7px;
  }
  .hero-card strong {
    font-size: 10px;
  }
  .hero-card small {
    font-size: 8px;
  }
  .intro-strip {
    gap: 10px;
  }
  .intro-strip > div {
    padding-left: 8px;
    gap: 8px;
  }
  .intro-strip b {
    font-size: 24px;
  }
  .intro-strip span {
    font-size: 9px;
  }
  .world-tabs {
    flex-wrap: wrap;
    max-width: 230px;
  }
  .world-tabs button {
    font-size: 9px;
    padding: 9px;
  }
  .atlas-layout {
    grid-template-columns: 1fr;
  }
  .location-panel {
    padding: 22px;
  }
  .location-panel > p {
    max-width: 500px;
  }
  .map-scroll {
    max-height: 75vh;
  }
  .map-caption {
    font-size: 8px;
  }
  .location-stat {
    float: right;
    margin-top: -10px;
  }
  .map-pin {
    font-size: 8px;
  }
  .city-layout {
    grid-template-columns: 1fr;
  }
  .city-layout > .location-panel {
    display: block;
  }
  .city-layout .destination {
    width: auto;
    display: inline-flex;
    gap: 15px;
    margin-right: 8px;
  }
  .opponents {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .opponent > .portrait {
    height: 165px;
  }
  .opponent-content {
    padding: 14px;
  }
  .opponent h3 {
    font-size: 20px;
  }
  .opponent button {
    font-size: 10px;
  }
  .skills-layout {
    grid-template-columns: 1fr;
  }
  .branches {
    display: flex;
    gap: 8px;
    overflow: auto;
    padding: 10px;
    max-height: 150px;
  }
  .branches .segmented {
    display: none;
  }
  .branch {
    min-width: 170px;
    margin: 0;
    padding: 10px;
  }
  .branch > i {
    display: none;
  }
  .branch-detail {
    padding: 24px;
  }
  .branch-title h2 {
    font-size: 32px;
  }
  .combat-layout {
    grid-template-columns: 1fr;
  }
  .combat-log {
    max-height: 270px;
  }
  .arena {
    grid-template-columns: 1fr 25px 1fr;
    gap: 8px;
  }
  .fighter {
    display: block;
    padding: 15px;
  }
  .fighter > .portrait {
    width: 75px;
    height: 90px;
    float: left;
    margin: 0 12px 10px 0;
  }
  .fighter h2 {
    font-size: 22px;
    margin: 9px 0 18px;
  }
  .fighter .meter-label {
    clear: both;
  }
  .fighter small {
    font-size: 8px;
  }
  .versus {
    font-size: 24px;
  }
  .versus span {
    font-size: 11px;
  }
  .action-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .zone-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .combat-choice {
    gap: 25px;
  }
  .realm-copy h2 {
    font-size: 36px;
  }
  .realm-symbol {
    font-size: 150px;
  }
  .realm-landscape {
    min-height: 360px;
  }
  footer {
    padding: 20px 24px;
    flex-direction: column;
    gap: 6px;
  }
}
@media (max-width: 520px) {
  main {
    padding: 24px 16px;
  }
  .topbar {
    padding: 13px 16px;
  }
  .topbar nav {
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    justify-content: flex-start;
    scrollbar-width: thin;
    border-top: 1px solid #34403f;
    padding-top: 7px;
  }
  .topbar nav > * {
    flex-shrink: 0;
  }
  .topbar nav button {
    font-size: 11px;
    padding: 8px 10px;
  }
  .brand small {
    font-size: 7px;
  }
  .playerbar {
    padding: 12px 16px;
  }
  .player-meter {
    flex-basis: 29%;
  }
  .player-name {
    min-width: 120px;
  }
  .player-name > span {
    font-size: 8px;
  }
  .level {
    padding: 0 6px;
  }
  .eyebrow {
    font-size: 8px;
    letter-spacing: 1.5px;
    margin-bottom: 10px;
  }
  .page-heading {
    flex-wrap: wrap;
    margin-bottom: 20px;
  }
  .page-heading h1 {
    font-size: 28px;
  }
  .page-heading p {
    font-size: 12px;
  }
  .hero-preview {
    min-height: 420px;
  }
  .hero-copy {
    max-width: 78%;
    padding: 22px;
  }
  .hero-copy h2 {
    font-size: 32px;
  }
  .hero-art {
    object-position: 60% 26%;
  }
  .hero-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
  }
  .hero-card .portrait {
    height: 120px;
  }
  .hero-card strong {
    font-size: 11px;
  }
  .hero-card small {
    font-size: 9px;
  }
  .hero-card {
    min-height: 175px;
  }
  .creation-layout {
    gap: 18px;
  }
  .segmented button {
    font-size: 12px;
  }
  .intro-strip {
    grid-template-columns: 1fr 1fr;
    padding: 20px 0;
    row-gap: 23px;
  }
  .intro-strip > div:nth-child(2) {
    border: 0;
  }
  .intro-strip span {
    font-size: 10px;
  }
  .intro-strip b {
    font-size: 29px;
  }
  .custom-form {
    padding: 20px;
    min-height: auto;
  }
  .world-tabs {
    max-width: none;
  }
  .map-toolbar {
    padding: 9px 10px;
  }
  .map-caption {
    display: none;
  }
  .map-toolbar > button:first-of-type {
    margin-left: auto;
  }
  .map-canvas {
    min-width: 620px;
  }
  .map-scroll {
    max-height: 470px;
  }
  .map-pin {
    font-size: 9px;
  }
  .map-pin span {
    padding: 4px 6px;
  }
  .map-legend {
    gap: 12px;
  }
  .location-panel h2 {
    font-size: 30px;
  }
  .opponents {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .opponent > .portrait {
    height: 160px;
  }
  .opponent-content {
    padding: 12px;
  }
  .opponent h3 {
    font-size: 20px;
  }
  .opponent-content > small {
    font-size: 8px;
  }
  .opponent button {
    font-size: 10px;
    padding: 11px 7px;
  }
  .section-label {
    flex-wrap: wrap;
    gap: 0;
  }
  .section-label h2 {
    font-size: 23px;
    margin-bottom: 10px;
  }
  .section-label span {
    width: 100%;
    margin-bottom: 15px;
  }
  .result-banner {
    padding: 17px;
    gap: 15px;
    flex-wrap: wrap;
  }
  .result-banner h2 {
    font-size: 25px;
  }
  .result-banner button {
    margin-left: 0;
    width: 100%;
  }
  .result-banner p {
    font-size: 11px;
  }
  .branch-detail {
    padding: 20px 15px;
  }
  .branch-rune {
    width: 60px;
    height: 70px;
    font-size: 36px;
  }
  .branch-title {
    gap: 17px;
  }
  .branch-title h2 {
    font-size: 28px;
  }
  .branch-title p {
    font-size: 11px;
  }
  .skill-node {
    display: grid;
    grid-template-columns: 23px 1fr;
    gap: 10px;
    padding: 16px 12px;
  }
  .skill-node > button {
    grid-column: 2;
    justify-self: start;
    min-width: 120px;
  }
  .skill-node-heading {
    gap: 10px;
  }
  .skill-node-heading h3 {
    font-size: 19px;
  }
  .skill-node p {
    font-size: 11px;
  }
  .skill-numbers {
    font-size: 8px;
    gap: 12px;
  }
  .skill-node + .skill-node:before {
    left: 25px;
  }
  .skill-points b {
    font-size: 30px;
  }
  .skill-points span {
    font-size: 10px;
  }
  .arena {
    grid-template-columns: 1fr 18px 1fr;
    margin-top: 10px;
  }
  .fighter {
    padding: 11px;
  }
  .fighter > .portrait {
    float: none;
    width: 100%;
    height: 150px;
    margin: 0 0 13px;
    object-position: 50% 25%;
  }
  .fighter h2 {
    font-size: 20px;
    min-height: 46px;
    margin: 10px 0;
  }
  .fighter small {
    font-size: 7px;
    letter-spacing: 0.5px;
  }
  .fighter .meter-label {
    font-size: 10px;
  }
  .status-row span {
    font-size: 7px;
  }
  .versus {
    font-size: 20px;
  }
  .versus span {
    font-size: 8px;
  }
  .combat-controls {
    padding: 19px 14px;
  }
  .combat-choice {
    gap: 16px;
  }
  .combat-choice h3 {
    font-size: 18px;
  }
  .combat-choice h3 span {
    font-size: 11px;
    margin-left: 6px;
  }
  .zone-grid {
    grid-template-columns: 1fr 1fr;
  }
  .zone-grid button {
    font-size: 11px;
  }
  .action-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .action-grid button {
    padding: 10px 8px;
    gap: 8px;
  }
  .action-grid b {
    font-size: 10px;
  }
  .action-grid small {
    font-size: 8px;
  }
  .action-grid button > span {
    font-size: 20px;
    min-width: 20px;
  }
  .turn-submit {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .turn-submit .primary {
    width: 100%;
  }
  .round {
    font-size: 9px;
  }
  .round b {
    font-size: 28px;
  }
  .realm-landscape {
    display: block;
    min-height: 390px;
  }
  .realm-symbol {
    position: absolute;
    right: 20px;
    top: 30px;
    opacity: 0.5;
  }
  .realm-copy {
    position: relative;
    padding: 100px 28px 35px;
  }
  .realm-copy h2 {
    font-size: 36px;
  }
  .realm-gates {
    flex-direction: column;
    gap: 0;
  }
  .journal-list {
    padding: 10px 18px;
  }
  .journal-list > div {
    gap: 16px;
  }
  .journal-list p {
    font-size: 12px;
  }
  .death-page h1 {
    font-size: 30px;
  }
  .death-page details {
    padding: 18px;
  }
  footer {
    padding: 18px 16px;
    font-size: 8px;
  }
  .loading {
    padding: 30px;
  }
  .realm-copy > .primary {
    margin-top: 15px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
.creation-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  border: 1px solid var(--line);
  padding: 15px;
  margin-top: 25px;
}
.creation-stats legend {
  padding: 0 8px;
  color: var(--gold);
  font-size: 12px;
}
.creation-stats label {
  font-size: 10px;
  color: var(--muted);
}
.creation-stats input {
  padding: 9px;
  min-width: 0;
}
.creation-stats p {
  grid-column: 1/-1;
  font-size: 10px;
  margin: 0;
}
.realm-map {
  aspect-ratio: auto;
}
.map-scroll.realm-viewport { max-height:none; overflow-x:auto; overflow-y:hidden; }
.realm-map > .world-art { height:auto; }
.mobile-branch-picker {
  display: none;
}
#confirm-dialog {
  width: min(460px, calc(100% - 32px));
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--gold);
  padding: 26px;
  box-shadow: 0 20px 80px #0009;
}
#confirm-dialog::backdrop {
  background: #080d10cc;
}
.dialog-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}
.journey-event, .expedition-status {
  display: flex;
  gap: 22px;
  align-items: center;
  width: min(1360px, calc(100% - 48px));
  margin: 24px auto 0;
  padding: 22px;
  border: 1px solid var(--gold);
  border-left-width: 4px;
  background: linear-gradient(110deg, #2d2d29, var(--panel));
}
.journey-event h2, .expedition-status h2 { font-size: 25px; margin: 6px 0 10px; }
.journey-event p, .expedition-status p { margin-bottom: 12px; max-width: 900px; }
.journey-event .encounter-portrait { width: 110px; height: 140px; flex: 0 0 110px; object-fit: cover; }
.journey-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.expedition-status { border-color: #8b9e98; background: linear-gradient(110deg, #253331, var(--panel)); }
.expedition-status.return-closed { border-color: var(--red); }
@media (max-width: 600px) {
  .journey-event, .expedition-status { width: calc(100% - 24px); padding: 16px; gap: 14px; align-items: flex-start; }
  .journey-event .encounter-portrait { width: 72px; height: 96px; flex-basis: 72px; }
  .journey-event h2, .expedition-status h2 { font-size: 22px; }
  .journey-actions { flex-direction: column; }
}
/* Combat 0.5: five-zone duel and one shared advancement budget. */
.nine-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.nine-stats > div { min-width: 0; }
.nine-stats dt { font-size: 11px; overflow-wrap: anywhere; }
.growth-wallet { display: grid; gap: 6px; text-align: right; flex-shrink: 0; }
.growth-wallet b { color: var(--gold); font-size: 28px; }
.growth-wallet span, .fine-print { color: var(--muted); font-size: 12px; line-height: 1.65; }
.growth-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; align-items: start; }
.growth-card { min-width: 0; padding: 24px; background: var(--panel); border: 1px solid var(--line); border-top: 2px solid #8c7952; border-radius: 5px; }
.growth-card h2 { margin: 12px 0 18px; font-size: 25px; }
.growth-card h3 { margin: 20px 0 10px; }
.growth-card > p { line-height: 1.7; }
.loadout-growth { margin-top: 18px; }
.loadout-expansion { max-width: 640px; margin-top: 18px; }
.loadout-expansion p { font-size: 13px; line-height: 1.6; }
.slot-receipt { color: var(--gold); }
.stat-allocation { margin: 20px 0; }
.stat-allocation > div { display: grid; grid-template-columns: minmax(100px, 1fr) 55px 30px 30px; gap: 7px; align-items: center; padding: 8px 0; border-bottom: 1px solid #ffffff09; }
.stat-allocation label { font-size: 13px; }
.stat-allocation b { text-align: right; }
.stat-allocation em { color: var(--gold); font-style: normal; font-size: 12px; }
.stat-allocation button { min-height: 30px; padding: 2px; border: 1px solid var(--line); background: #0d1517; border-radius: 3px; }
.allocation-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 22px; }
.allocation-buttons button { font-size: 12px; padding: 10px 12px; }
.dice-buy { width: 100%; display: flex; align-items: center; text-align: left; gap: 12px; padding: 15px 12px; margin: 12px 0; border: 1px solid #6e6046; background: linear-gradient(135deg, #342e21, #1a2325); border-radius: 4px; }
.dice-buy > span:nth-child(2) { flex: 1; min-width: 0; }
.dice-buy b, .dice-buy small { display: block; }
.dice-buy b { font-size: 13px; }
.dice-buy small { color: var(--muted); font-size: 11px; margin-top: 6px; line-height: 1.5; }
.dice-buy > strong { color: var(--gold); font-size: 12px; white-space: nowrap; }
.die-icon { font-size: 29px; color: var(--gold); width: 30px; text-align: center; }
.resource-dot { width: 14px; height: 14px; border-radius: 50%; background: #ae655b; box-shadow: 0 0 12px #ae655b33; flex-shrink: 0; }
.resource-dot.mana { background: #5e9bb7; }
.resource-dot.stamina { background: #9caa69; }
.resource-buys { margin: 24px 0; }
.roll-receipt { display: flex; gap: 14px; padding: 18px; margin-top: 20px; background: #11191b; border: 1px solid var(--line); border-radius: 4px; align-items: center; }
.die-face { border: 1px solid var(--gold); border-radius: 9px; width: 48px; height: 48px; display: grid; place-items: center; font: 30px Georgia, serif; color: var(--gold); flex-shrink: 0; }
.roll-receipt small, .roll-receipt b, .roll-receipt strong { display: block; }
.roll-receipt small { color: var(--muted); font-size: 9px; line-height: 1.5; letter-spacing: 1px; }
.roll-receipt b { font-size: 13px; margin: 6px 0; }
.roll-receipt strong { color: var(--gold); }
.growth-skill-label { display: grid; gap: 10px; font-size: 12px; color: var(--muted); }
.growth-skill-label select { width: 100%; }
.skill-tools { display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.scaling-note { color: var(--gold); font-size: 11px; line-height: 1.6; display: block; margin: 8px 0; }
.profile-picker { margin: 26px 0; padding: 24px; border: 1px solid var(--line); background: var(--panel); }
.profile-picker h2 { font-size: 26px; margin: 8px 0; }
.profile-picker p { font-size: 13px; color: var(--muted); }
.profile-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.profile-options button { background: #141e21; border: 1px solid var(--line); padding: 20px; text-align: left; }
.profile-options button.active { border-color: var(--gold); background: #343024; }
.profile-options button.active:disabled { opacity: 1; }
.profile-options strong { display: block; margin-top: 15px; color: var(--gold); font-size: 12px; }
.profile-options b, .profile-options span, .profile-options small { display: block; }
.profile-options span { color: var(--gold); margin: 8px 0; }
.profile-options small { color: var(--muted); font-size: 11px; }
.pending-roll { margin-bottom: 20px; }
.duel-five .page-heading h1 { font-size: 32px; }
.duel-divider { color: #736343; padding: 0 14px; }
.duel-stage { display: grid; grid-template-columns: minmax(230px, 1fr) minmax(330px, 1.35fr) minmax(230px, 1fr); border: 1px solid var(--line); background: linear-gradient(120deg, #1b2427, #11191b 50%, #222221); }
.duel-fighter { padding: 22px; min-width: 0; }
.duel-portrait { position: relative; height: 240px; overflow: hidden; border: 1px solid #6d6048; }
.duel-portrait .portrait { width: 100%; height: 100%; object-fit: cover; object-position: center 23%; }
.duel-portrait > span:not(.portrait) { position: absolute; bottom: 0; left: 0; right: 0; padding: 30px 12px 12px; background: linear-gradient(transparent, #0c1416); font-size: 10px; letter-spacing: 1.5px; color: var(--gold); }
.duel-fighter h2 { margin: 16px 0; font-size: 25px; }
.duel-fighter .meter-label { margin-top: 11px; }
.duel-fighter .stats-row { margin-top: 20px; }
.duel-center { border-left: 1px solid var(--line); border-right: 1px solid var(--line); padding: 26px; }
.zone-heading { display: grid; grid-template-columns: 55px 1fr 55px; text-align: center; align-items: center; font-size: 10px; letter-spacing: 1px; color: var(--muted); margin-bottom: 15px; }
.zone-heading b { color: var(--gold); font-size: 12px; }
.body-zone { display: grid; grid-template-columns: 50px 1fr 50px; gap: 8px; align-items: center; min-height: 57px; border-top: 1px solid #ffffff08; }
.body-zone > span { font-size: 14px; display: flex; align-items: center; gap: 16px; }
.body-zone small { color: #6d7877; font-size: 10px; }
.body-zone.protected { background: linear-gradient(90deg, transparent, #24465260); }
.body-zone button { min-height: 44px; padding: 0; font-size: 28px; background: transparent; border: 1px solid transparent; color: #697675; border-radius: 5px; }
.body-zone .hit-target.active { color: #d9856e; border-color: #8c5e46; background: #48332655; }
.body-zone .block-target.active { color: #9bc5ce; border-color: #496d76; background: #25404b; }
.zone-instruction { color: var(--muted); font-size: 11px; line-height: 1.6; min-height: 36px; }
.prediction { padding: 15px; margin: 20px 0; border: 1px solid #415055; background: #18262b; }
.prediction span, .prediction b, .prediction small { display: block; }
.prediction span { color: #94b8bd; font-size: 10px; letter-spacing: 1px; }
.prediction b { margin: 8px 0; font-size: 14px; }
.prediction small { color: var(--muted); font-size: 11px; line-height: 1.6; }
.chosen-technique { min-height: 140px; }
.chosen-technique > small, .enemy-style > small { font-size: 10px; letter-spacing: 1px; color: var(--muted); }
.chosen-technique h3 { margin: 10px 0; font-size: 19px; }
.chosen-technique p { font-size: 13px; line-height: 1.65; }
.chosen-technique > span { color: var(--gold); font-size: 11px; }
.target-scope { padding: 12px; border: 1px solid var(--line); color: var(--gold); font-size: 12px; line-height: 1.5; margin-bottom: 12px; }
.target-scope.self { border-color: #497967; background: #1a352c; }
.target-scope.whole { border-color: #6c5e88; background: #2b2438; }
.body-zone .no-hit { display: block; text-align: center; color: var(--muted); opacity: .4; }
.defense-note { color: var(--muted); font-size: 11px; line-height: 1.6; }
.stat-label { display: inline-flex; gap: 4px; align-items: center; }
.stat-help, .stat-allocation .stat-help { border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--gold); width: 20px; height: 20px; min-width: 20px; padding: 0; font-size: 11px; cursor: help; }
.stat-help:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.auto-battle { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:18px; margin:18px 0; border:1px solid var(--line); background:#182521; }
.auto-battle b { color:var(--gold); font-size:14px; }
.auto-battle p { margin:8px 0; font-size:13px; }
.auto-battle small { color:var(--muted); font-size:11px; }
.auto-battle button { flex-shrink:0; min-height:44px; }
.busy #auto-battle { pointer-events:auto; opacity:1; }
@media (max-width:700px) {
  .auto-battle { flex-direction:column; align-items:stretch; }
  .stat-help, .stat-allocation .stat-help { width:30px; height:30px; min-width:30px; }
}
.stat-dialog { width: min(680px, calc(100vw - 32px)); max-height: 85vh; overflow: auto; }
.stat-dialog p { line-height: 1.65; }
.stat-skill-list { padding-left: 22px; max-height: 42vh; overflow: auto; line-height: 1.8; }
.stat-skill-list small { color: var(--muted); }
.stat-dialog summary { cursor: pointer; color: var(--gold); }
.submit-modern { width: 100%; margin-top: 22px; }
.enemy-style { margin-top: 25px; padding: 18px 0; border-top: 1px solid var(--line); }
.enemy-style b { display: block; margin: 12px 0; color: var(--gold); }
.enemy-style p, .enemy-style > span { font-size: 12px; line-height: 1.65; color: var(--muted); }
.duel-actions { padding: 24px; background: var(--panel); border: 1px solid var(--line); border-top: 0; }
.duel-actions .section-title { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.duel-actions .section-title h2 { font-size: 22px; margin: 0 0 18px; }
.duel-actions .section-title span { color: var(--muted); font-size: 11px; }
.duel-actions .action-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.modern-log { margin-top: 22px; }
.modern-log > div { max-height: 340px; }
.creation-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1050px) {
  .growth-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .growth-grid > :last-child { grid-column: 1 / -1; }
  .duel-stage { grid-template-columns: minmax(180px, 1fr) minmax(275px, 1.25fr) minmax(180px, 1fr); }
  .duel-fighter { padding: 14px; }
  .duel-center { padding: 18px; }
  .duel-portrait { height: 210px; }
}
@media (max-width: 760px) {
  .growth-grid, .profile-options { grid-template-columns: 1fr; }
  .growth-grid > :last-child { grid-column: auto; }
  .growth-card { padding: 20px; }
  .growth-wallet { text-align: left; }
  .duel-stage { grid-template-columns: 1fr 1fr; }
  .duel-center { grid-column: 1 / -1; grid-row: 2; border: 0; border-top: 1px solid var(--line); }
  .duel-fighter.enemy { grid-column: 2; grid-row: 1; }
  .duel-portrait { height: 165px; }
  .duel-fighter h2 { font-size: 20px; }
  .duel-fighter .nine-stats, .enemy-style { display: none; }
  .duel-five .page-heading h1 { font-size: 25px; }
  .duel-actions { padding: 18px; }
  .duel-actions .action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .duel-actions .section-title { display: block; margin-bottom: 15px; }
  .skill-tools { flex-direction: row; flex-wrap: wrap; }
  .stat-allocation button { min-height: 38px; }
}
.skill-origin {
  display: block;
  font-size: 10px;
  line-height: 1.5;
  margin-bottom: 8px;
}
.hero-copy .start-build {
  font-size: 11px;
  margin: 8px 0;
}
.source-details, .hero-lore { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 10px 0; }
.source-details summary, .hero-lore summary { color: var(--gold); cursor: pointer; }
.source-details p, .hero-lore p { margin: 8px 0; }
.hero-lore { background: #111a1ed9; padding: 10px 12px; border-left: 2px solid var(--gold); }
.art-note { color: var(--muted); display: block; font-size: 10px; margin: 6px 0; }
.legacy-note, .combat-rule-note { max-width: 680px; line-height: 1.5; }
.hero-preview:has(.hero-lore[open]) { height: auto; max-height: none; position: relative; top: 0; }
.hero-preview:has(.hero-lore[open]) .hero-art { height: 420px; }
.hero-preview:has(.hero-lore[open]) .hero-copy {
  position: relative; height: auto; max-width: none; padding-top: 230px;
  background: linear-gradient(0deg, #10191b 60%, #10191be8 78%, transparent);
}
@media (max-width: 800px) {
  .hero-preview { height: auto; max-height: none; }
  .hero-preview .hero-art { height: 420px; }
  .hero-copy { position: relative; height: auto; max-width: none; padding-top: 180px; background: linear-gradient(0deg, #10191bf5 50%, #10191bcc 75%, transparent); }
  .mobile-branch-picker {
    display: flex;
    flex-direction: column;
    gap: 10px;
    color: var(--gold);
  }
  .mobile-branch-picker select {
    width: 100%;
  }
  .skills-layout > .branches {
    display: none;
  }
}
/* Encounter inspection and portrait viewers keep the existing parchment palette. */
[data-zoom-portrait] { cursor: zoom-in; }
[data-zoom-portrait]:focus-visible { outline: 3px solid var(--gold, #c9a76a); outline-offset: 3px; }
.opponent-name { display: block; text-align: left; border: 0; padding: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.opponent-name small { display: block; margin-top: 5px; font: 12px sans-serif; color: #c4aa73; }
.encounter-fate, .xp-debt { font-size: 12px; color: #d3b785; }
.xp-debt { display: block; margin-top: 7px; }
.detail-dialog, .portrait-dialog { max-width: min(820px, calc(100vw - 24px)); max-height: 90dvh; width: 820px; overflow-y: auto; padding: 24px; color: #e4dcc9; background: #172023; border: 1px solid #746345; border-radius: 12px; }
dialog::backdrop { background: #050809db; }
.detail-heading { display: flex; gap: 18px; justify-content: space-between; align-items: start; margin-bottom: 20px; position: sticky; top: -24px; z-index: 2; padding: 12px 0; background: #172023; }
.detail-heading h2 { margin: 0; overflow-wrap: anywhere; }
.detail-heading button { flex-shrink: 0; }
.inspection-layout { display: grid; grid-template-columns: minmax(140px, 230px) 1fr; gap: 24px; }
.inspection-layout .portrait { width: 100%; height: auto; max-height: 340px; object-fit: contain; border-radius: 6px; }
.inspection-layout p { font-size: 14px; line-height: 1.55; }
.inspection-knowledge { margin-top: 24px; border-top: 1px solid #5f543d; padding-top: 18px; }
.inspection-resources { display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 12px; }
.inspection-resources b { color: #e5c683; }
.inspection-knowledge .stats-row { flex-wrap: wrap; margin: 20px 0; }
.inspection-warning { border-left: 3px solid #9f7352; padding: 12px; background: #211e1c; font-size: 13px; line-height: 1.65; }
.inspection-skills { line-height: 1.8; font-size: 13px; }
.unknown-stat { color: #a5aaa3; font-style: italic; }
.inspection-roll { color: #e6c77f; }
.portrait-dialog { width: min(760px, calc(100vw - 24px)); text-align: center; }
#portrait-large { display: block; max-width: 100%; max-height: 70dvh; margin: 0 auto 12px; object-fit: contain; }
.portrait-dialog small { color: #b4b6a9; }
.portrait-forms { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.portrait-forms[hidden], .portrait-description[hidden], .portrait-form-note[hidden] { display: none; }
.portrait-forms button { padding: 11px 15px; min-height: 44px; font-size: 13px; }
.portrait-forms button.active { color: #f3dfb1; border-color: #c2a56e; background: #393225; }
.portrait-description { margin: 12px auto; line-height: 1.6; font-size: 14px; max-width: 62ch; }
.portrait-form-note { color: #c3bdaf; font-size: 12px; line-height: 1.6; max-width: 68ch; margin: 12px auto; }
.portrait-dialog:has(.portrait-forms:not([hidden])) #portrait-large { max-height: 55dvh; }
.inspection-layout:has(.inspection-pair) { grid-template-columns: minmax(220px, 290px) 1fr; }
.inspection-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-content: start; }
.inspection-pair figure { margin: 0; min-width: 0; }
.inspection-pair .portrait { aspect-ratio: 1; object-fit: contain; width: 100%; }
.inspection-pair figcaption { color: #e7c885; font-size: 12px; line-height: 1.5; margin: 8px 0; text-align: center; }
.inspection-pair > small { grid-column: 1 / -1; font-size: 11px; color: #b9b5a9; text-align: center; }
.appearance-canon { border-top: 1px solid #514a38; padding-top: 10px; font-size: 13px; line-height: 1.55; }
.appearance-canon summary { color: #e7c885; cursor: pointer; }
.portrait-pair-hint { font-size: 10px; white-space: normal; }
@media (max-width: 600px) {
  .inspection-layout:has(.inspection-pair) { grid-template-columns: 1fr; }
  .inspection-pair { max-width: 330px; margin: 0 auto; width: 100%; }
  .portrait-forms button { flex: 1 1 125px; }
}
.retreat-action { display: flex; align-items: center; gap: 20px; margin: 24px 0; padding: 16px; border: 1px solid #665840; border-radius: 8px; }
.retreat-action button { flex-shrink: 0; }
.retreat-action small { max-width: 650px; color: #c4c2b4; line-height: 1.5; }
.retreat-result { border-color: #998055; }
.record-reward { color: #e6cc86; font-size: .9rem; line-height: 1.5; }
.progression-rewards { margin-bottom: 24px; border-color: #796747; }
.progression-rewards p { max-width: 900px; line-height: 1.65; }
.last-passive-growth summary { cursor: pointer; color: #e6cc86; padding: 8px 0; }
.growth-result p { margin: 10px 0 0; }
.passive-gain { color: #c4dfbf; }
.record-reset { color: #c4c2b4; font-size: .9rem; }
.creation-heading-actions, .calculator-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.calculator-link, .calculator-actions a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; text-decoration: none; }
.calculator-link.secondary, .calculator-actions a { padding: 10px 16px; border: 1px solid #616154; border-radius: 5px; }
.topbar nav .calculator-link { padding: 9px 12px; color: var(--gold); border: 1px solid var(--line); border-radius: 5px; white-space: nowrap; }
.calculator-banner { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 18px 3.3%; background: #292820; border-bottom: 1px solid #796747; }
.calculator-banner strong { display: block; margin-bottom: 6px; color: #e6cc86; }
.calculator-banner span { display: block; max-width: 760px; color: #d0caba; font-size: .85rem; line-height: 1.5; }
.calculator-actions { flex-shrink: 0; gap: 10px; }
.calculator-setup { display: grid; grid-template-columns: repeat(2, minmax(150px, 230px)) 1fr; gap: 18px; align-items: start; margin: 0 0 28px; padding: 20px; border: 1px solid #796747; border-radius: 8px; background: var(--panel); }
.calculator-setup legend { padding: 0 8px; color: #e6cc86; }
.calculator-setup label { display: grid; gap: 8px; }
.calculator-setup input { width: 100%; min-width: 0; }
.calculator-setup p { margin: 0; font-size: .85rem; color: #c4c2b4; line-height: 1.65; }
.atlas-screen .page-heading p { max-width: 920px; margin-bottom: 0; color: var(--muted); line-height: 1.6; }
.atlas-screen .map-toolbar { flex-wrap: wrap; gap: 10px; }
.atlas-screen .map-toolbar select { max-width: 220px; }
.atlas-screen .map-panel { min-width: 0; }
.atlas-viewport { overflow-x: auto; scrollbar-width: thin; outline-offset: -4px; }
.atlas-pan-hint { display: none; }
.atlas-surface { position: relative; aspect-ratio: 4/3; overflow: hidden; background: #23382e; isolation: isolate; }
.atlas-art { position: absolute; inset: 0; background-size: cover; background-position: center; filter: brightness(.78) saturate(.8); z-index: -2; }
.atlas-surface > svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: -1; }
.atlas-surface polyline { fill: none; stroke: #c9b381; stroke-width: .28; opacity: .8; }
.atlas-surface polyline.sea { stroke: #b8e0e7; stroke-dasharray: 1.3 1; }
.atlas-surface polyline.active { stroke: #ffe4a7; stroke-width: .5; opacity: 1; }
.atlas-pin { position: absolute; transform: translate(-50%,-50%); padding: 7px 9px; background: #17231de8; border: 1px solid #c0aa71; box-shadow: 0 3px 14px #000a; white-space: nowrap; font: 12px Georgia,serif; z-index: 2; }
.atlas-pin:active:not(:disabled) { transform: translate(-50%,-50%); }
.atlas-pin:hover:not(:disabled), .atlas-pin:focus-visible { background: #3a4937; z-index: 3; }
.atlas-pin i { font-style: normal; color: #e4c47f; margin-right: 5px; }
.atlas-pin.current { border-color: #f4da8a; background: #4d4224eb; }
.atlas-pin.selected { outline: 2px solid #efc67c; }
.atlas-pin small { display: block; margin-top: 3px; font: 8px system-ui,sans-serif; letter-spacing: .06em; color: #cac7ac; }
.atlas-legend { position: absolute; bottom: 8px; left: 8px; right: 8px; padding: 9px; background: #111d19dd; color: #d0cdbb; font-size: 10px; border-radius: 4px; pointer-events: none; }
.atlas-landmark { position: absolute; transform: translate(-50%,-50%); color: #f0e9d3; text-shadow: 0 1px 4px #000, 0 0 5px #000; font: italic 11px Georgia,serif; pointer-events: none; opacity: .85; }
.atlas-text-list { display: flex; flex-wrap: wrap; padding: 13px; gap: 7px; border-top: 1px solid var(--line); }
.atlas-text-list button { padding: 8px 10px; font-size: 12px; }
.atlas-text-list small { color: var(--muted); margin-left: 7px; }
.atlas-text-list .active { color: var(--gold); border-color: var(--gold); }
.field-actions { display: grid; gap: 9px; margin-top: 20px; }
.field-actions small, .field-skill > small { color: var(--gold); font-size: 10px; letter-spacing: .07em; }
.field-skill { padding: 22px; border: 1px solid #887344; border-radius: 6px; background: #262923; margin: 20px 0; }
.field-skill h3 { margin: 13px 0 10px; font: 25px Georgia,serif; }
.field-skill p { line-height: 1.65; }
.field-skill .skill-numbers { flex-wrap: wrap; margin: 15px 0; }
.travel-banner { display: flex; align-items: center; justify-content: space-between; padding: 12px 4%; background: #273629; gap: 16px; }
.road-stage { min-height: 440px; padding: 32px; display: flex; align-items: center; background: linear-gradient(90deg,#11221ae8,#11221a65),var(--road-art) center/cover; border: 1px solid #7f714a; border-radius: 8px; }
.road-choice { padding: 28px; max-width: 530px; width: 100%; background: #18231eeb; border: 1px solid #a28e59; border-radius: 7px; }
.road-choice h2 { margin: 15px 0; }
.road-choice p { line-height: 1.7; }
.road-choice button { width: 100%; margin-top: 10px; }
.travel-progress { height: 7px; border-radius: 8px; background: #374734; overflow: hidden; margin: 24px 0; }
.travel-progress i { display: block; height: 100%; width: 0; background: #d6bc7c; transition: width 1s linear; }
@media (max-width: 900px) {
  .atlas-pin { font-size: 10px; padding: 6px; }
  .atlas-pin small { font-size: 7px; }
  .atlas-landmark { font-size: 9px; }
}
@media (max-width: 600px) {
  .atlas-surface { min-width: 500px; }
  .atlas-pan-hint { display: block; padding: 10px; margin: 0; font-size: 11px; color: var(--muted); }
  .atlas-pin { max-width: 102px; white-space: normal; font-size: 9px; padding: 5px; }
  .atlas-pin small { display: none; }
  .atlas-pin i { display: none; }
  .atlas-legend { font-size: 9px; padding: 6px; }
  .atlas-screen .map-toolbar .select-compact { width: 100%; }
  .atlas-screen .map-toolbar select { max-width: none; width: 100%; }
  .atlas-landmark { font-size: 8px; max-width: 60px; text-align: center; }
  .road-stage { padding: 14px; min-height: 360px; }
  .road-choice { padding: 20px; }
  .travel-banner { flex-wrap: wrap; }
}
@media (max-width: 850px) {
  .calculator-banner { flex-wrap: wrap; }
  .calculator-setup { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calculator-setup p { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .detail-dialog, .portrait-dialog { padding: 16px; }
  .detail-heading { top: -16px; }
  .inspection-layout { grid-template-columns: 1fr; gap: 12px; }
  .inspection-layout .portrait { max-height: 240px; }
  .detail-heading h2 { font-size: 20px; }
  .detail-heading button { padding: 8px; }
  .retreat-action { align-items: stretch; flex-direction: column; gap: 12px; }
}

/* Compact combat: skill tiles and stable description between the portraits.
   Only battle-page is affected. Extra rules remain accessible in disclosures. */
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0; }
.battle-page { padding-top:22px; }
.battle-page .page-heading { margin:0 0 18px; }
.battle-page .page-heading .eyebrow { margin-bottom:8px; }
.battle-page .page-heading h1 { margin:0 0 8px; }
.duel-five .page-heading h1 { font-size:38px; }
.battle-page .page-heading p { font-size:13px; }
.battle-page > .auto-battle { display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:14px 24px; min-height:66px; margin:0 0 14px; padding:10px 18px; border:1px solid #a38f5e; border-radius:3px; background:linear-gradient(100deg,#192225,#141c1f); }
.auto-battle h2 { display:flex; align-items:center; gap:16px; margin:0; padding-right:24px; border-right:1px solid #7c7053; font:26px Georgia,serif; }
.combat-icon { display:block; flex:none; width:40px; height:40px; overflow:visible; }
.auto-battle #auto-battle { justify-self:end; min-width:185px; padding:11px 18px; font-size:14px; border-radius:3px; }
.auto-safety { display:flex; align-items:center; gap:10px; border-left:1px solid #7c7053; padding-left:24px; color:var(--muted); font-size:11px; white-space:nowrap; }
.auto-help { position:relative; }
.auto-help > summary { list-style:none; width:20px; height:20px; border:1px solid #748484; border-radius:50%; text-align:center; cursor:help; font:italic 15px Georgia,serif; }
.auto-help > summary::-webkit-details-marker { display:none; }
.auto-help p { position:absolute; right:0; top:22px; z-index:8; width:280px; padding:15px; margin:4px 0; white-space:normal; background:#1a262b; border:1px solid #657373; box-shadow:0 8px 24px #0008; line-height:1.6; }
.auto-status { grid-column:1/-1; border-top:1px solid var(--line); padding-top:8px; font-size:12px; color:var(--gold); }
.battle-ribbon { padding:0; margin:0 0 12px; border:0; background:none; min-width:0; }
.battle-ribbon .action-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(78px,1fr)); gap:6px; margin:0; max-height:146px; overflow-y:auto; padding:2px; }
.action-tile-wrap { display:block; min-width:0; border-radius:3px; }
.battle-ribbon .combat-icon { width:28px; height:28px; }
.battle-ribbon .action-grid button { display:flex; align-items:center; justify-content:center; gap:6px; width:100%; height:44px; min-height:44px; padding:6px; border:1px solid #415359; border-radius:3px; background:linear-gradient(135deg,#1c292d,#111a1d); box-shadow:inset 0 0 8px #0003; }
.battle-ribbon .action-grid button.active { border-color:#d2b567; background:linear-gradient(135deg,#353426,#24281f); box-shadow:inset 0 0 0 1px #d2b56755; }
.battle-ribbon .action-grid button:hover:not(:disabled) { border-color:#c3ae7b; background:#263235; }
.battle-ribbon .action-grid button > small { white-space:nowrap; font:11px system-ui,sans-serif; color:#d2dcde; }
.action-tile-wrap:focus-visible, .battle-ribbon button:focus-visible { outline:2px solid var(--gold); outline-offset:3px; }
.technique-detail { position:relative; display:grid; grid-template-columns:minmax(0,1fr) auto; grid-template-rows:24px minmax(0,1fr); gap:6px 10px; height:112px; min-height:112px; max-height:112px; margin-top:8px; padding:10px 12px; border:1px solid #415359; border-radius:3px; background:linear-gradient(110deg,#1d292c,#141d20); }
.technique-detail h3 { min-width:0; margin:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font:18px Georgia,serif; line-height:24px; }
.technique-copy { grid-column:1/-1; grid-row:2; min-width:0; min-height:0; overflow-y:auto; overscroll-behavior:contain; scrollbar-gutter:stable; }
.technique-copy:focus-visible { outline:1px solid var(--gold); outline-offset:2px; }
.technique-detail p { margin:0; font-size:12px; line-height:1.5; }
.technique-reason { display:block; font-size:12px; color:#ecb79d; margin-top:3px; }
.technique-meta { grid-column:2; grid-row:1; font-size:11px; color:var(--muted); }
.technique-meta summary { cursor:pointer; padding:4px 0; }
.technique-meta > div { position:absolute; right:0; top:100%; z-index:7; width:min(420px,100%); padding:16px; border:1px solid #596d70; background:#1a262b; box-shadow:0 8px 24px #0008; }
.technique-meta p { margin-top:8px; font-size:12px; }
.technique-meta b { color:var(--gold); }
.battle-page .duel-stage { grid-template-columns:minmax(0,.9fr) minmax(320px,1.5fr) minmax(0,.9fr); gap:10px; border:0; background:none; align-items:start; }
.battle-page .duel-fighter, .battle-page .duel-center { border:1px solid #39494c; padding:18px; background:linear-gradient(130deg,#1a2426,#141c1e); min-height:100%; }
.battle-page .duel-portrait { height:auto; aspect-ratio:4/3; }
.battle-page .duel-portrait .portrait { position:absolute; inset:0; }
.battle-page .duel-fighter h2 { font-size:25px; margin:12px 0; }
.battle-page .duel-fighter .meter-label { margin-top:9px; }
.battle-page .status-row:empty { display:none; }
.battle-stats { margin-top:14px; padding-top:10px; border-top:1px solid var(--line); }
.battle-stats summary, .battle-rules summary { color:var(--muted); font-size:11px; cursor:pointer; }
.battle-stats .stats-row { margin-top:14px; }
.battle-page .duel-center { display:flex; flex-direction:column; min-width:0; }
.battle-page .zone-heading { grid-template-columns:44px 1fr 44px; height:48px; min-height:48px; gap:8px; padding:8px 0; border:1px solid #344247; margin:0; }
.battle-page .zone-heading .target-scope { padding:0; border:0; background:none; margin:0; font-size:10px; line-height:1.5; }
.battle-page .body-zone { min-height:52px; grid-template-columns:44px 1fr 44px; }
.battle-page .body-zone > span { gap:16px; }
.battle-page .zone-instruction { margin:8px 0; min-height:0; font-size:10px; }
.battle-page .prediction { display:flex; flex-wrap:wrap; justify-content:space-between; gap:4px 12px; padding:8px 0; margin:0; background:none; border:0; border-top:1px solid var(--line); }
.battle-page .prediction span { font-size:10px; letter-spacing:0; }
.battle-page .prediction b { font-size:11px; margin:0; }
.battle-page .submit-modern { min-height:48px; margin-top:12px; padding:12px; }
.battle-rules { margin-top:10px; }
.battle-rules p { font-size:11px; line-height:1.6; }
.battle-page .enemy-style { margin-top:14px; padding:10px 0 0; }
.battle-page .enemy-style summary { color:var(--muted); font-size:11px; cursor:pointer; }
.battle-page .enemy-style b { margin:5px 0; font-size:13px; }
.battle-page .enemy-style p { margin:0; font-size:11px; }
.battle-page .enemy-style > span { display:block; font-size:10px; margin-top:4px; }
.battle-page .modern-log { display:grid; grid-template-columns:170px minmax(0,1fr); padding:0; margin-top:12px; max-height:240px; }
.battle-page .modern-log h3 { padding:16px; margin:0; font-size:18px; border:0; border-right:1px solid var(--line); }
.battle-page .modern-log > div { padding:10px 16px; max-height:200px; }
.battle-page .modern-log > small { grid-column:1/-1; padding:6px 12px; }
.battle-page .modern-log .log-round { padding:0 6px 6px; }
.battle-page .modern-log .log-round h4 { margin:0 0 6px; font-size:11px; }
.battle-page .modern-log .log-round p { margin:0 0 4px; padding-bottom:4px; }
.battle-page .retreat-action { position:relative; justify-content:center; gap:24px; min-height:48px; margin:12px 0 0; padding:6px 16px; border:1px solid #9c514b; border-radius:3px; background:linear-gradient(90deg,#201d1d,#2a2020,#201d1d); }
.battle-page #retreat { color:#ed9a88; border:0; border-right:1px solid #7f5149; border-radius:0; background:none; padding:6px 26px 6px 4px; font-size:16px; }
.battle-page .retreat-action small { color:#d3a596; font-size:11px; }
.retreat-help { font-size:11px; color:var(--muted); }
.retreat-help summary { cursor:pointer; }
.retreat-help p { position:absolute; right:0; bottom:100%; width:min(360px,100%); margin:0; padding:14px; background:#2a2020; border:1px solid #9c514b; font-size:12px; }
.route-plan small { display:block; color:var(--muted); margin-top:5px; font-size:11px; }
@media (max-width:1100px) {
  .battle-page > .auto-battle { column-gap:14px; }
  .auto-battle h2 { font-size:21px; padding-right:14px; gap:8px; }
  .auto-battle #auto-battle { min-width:150px; font-size:12px; }
  .auto-safety { padding-left:14px; font-size:10px; }
  .battle-page .duel-stage { grid-template-columns:minmax(0,.8fr) minmax(300px,1.4fr) minmax(0,.8fr); }
  .battle-page .duel-fighter, .battle-page .duel-center { padding:12px; }
  .battle-page .duel-fighter h2 { font-size:21px; }
  .duel-five .page-heading h1 { font-size:30px; }
}
@media (max-width:760px) {
  .battle-page { padding:18px 14px 30px; }
  .battle-page > .auto-battle { grid-template-columns:minmax(0,1fr) auto; gap:8px 12px; padding:10px 12px; }
  .auto-battle h2 { border:0; padding:0; font-size:20px; }
  .auto-battle h2 .combat-icon { width:28px; height:28px; }
  .auto-battle #auto-battle { grid-column:auto; min-width:0; }
  .auto-safety { grid-column:1/-1; border:0; padding:0; justify-content:flex-end; white-space:normal; }
  .auto-safety > span { max-width:none; }
  .battle-ribbon .action-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
  .battle-ribbon .combat-icon { width:24px; height:24px; }
  .technique-detail { height:130px; min-height:130px; max-height:130px; }
  .battle-page .duel-stage { grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:8px; }
  .battle-page .duel-fighter h2 { font-size:19px; overflow-wrap:anywhere; }
  .duel-five .page-heading h1 { font-size:25px; }
  .battle-page .enemy-style { display:block; }
  .battle-page .duel-portrait { aspect-ratio:1; }
  .battle-page .duel-fighter .nine-stats { display:grid; grid-template-columns:1fr; }
  .battle-stats summary { font-size:10px; }
  .battle-page .duel-center { grid-column:1/-1; grid-row:2; padding:14px; }
  .battle-page .modern-log { grid-template-columns:1fr; }
  .battle-page .modern-log h3 { padding:10px 14px; border:0; border-bottom:1px solid var(--line); }
  .battle-page .modern-log > div { padding:10px; }
  .battle-page .retreat-action { flex-direction:row; flex-wrap:wrap; gap:6px 12px; padding:10px; }
  .battle-page #retreat { padding-right:12px; }
  .battle-page .retreat-action small { max-width:60%; }
}

/* Short desktop windows: keep the turn button and recent rounds in view.
   The description stays 112px tall; touch layouts retain their larger controls. */
@media (min-width:1000px) and (max-height:950px) and (pointer:fine) {
  #app:has(.duel-five) .topbar { min-height:44px; padding:5px 24px; gap:16px; }
  #app:has(.duel-five) .brand { font-size:17px; gap:8px; }
  #app:has(.duel-five) .brand > span { font-size:30px; }
  #app:has(.duel-five) .brand small { font-size:7px; margin-top:2px; letter-spacing:3px; }
  #app:has(.duel-five) .topbar nav button,
  #app:has(.duel-five) .topbar .calculator-link { min-height:30px; padding:6px 10px; font-size:12px; }
  #app:has(.duel-five) .edition { font-size:9px; letter-spacing:1px; }
  #app:has(.duel-five) .calculator-banner { padding:5px 24px; margin:0 auto; gap:12px; }
  #app:has(.duel-five) .calculator-banner strong { font-size:12px; }
  #app:has(.duel-five) .calculator-banner span { font-size:10px; line-height:1.3; }
  #app:has(.duel-five) .calculator-actions .secondary { padding:5px 10px; font-size:11px; }
  .duel-five { padding:6px 24px 8px; }
  .duel-five .page-heading { margin:0 0 6px; gap:14px; }
  .duel-five .page-heading > div { flex:1; min-width:0; display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; column-gap:12px; }
  .duel-five .page-heading .eyebrow { grid-column:2; grid-row:1; margin:0; font-size:9px; letter-spacing:1px; }
  .duel-five .page-heading h1 { grid-column:1; grid-row:1; margin:0; font-size:24px; line-height:28px; }
  .duel-five .page-heading p { grid-column:1/-1; margin:2px 0 0; font-size:11px; line-height:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .duel-five .round { font-size:9px; }
  .duel-five .round b { font-size:24px; line-height:1; }
  .duel-five > .auto-battle { min-height:40px; margin-bottom:6px; padding:4px 12px; gap:6px 16px; }
  .duel-five .auto-battle h2 { font-size:19px; gap:8px; padding-right:16px; }
  .duel-five .auto-battle .combat-icon { width:26px; height:26px; }
  .duel-five .auto-battle #auto-battle { min-height:30px; min-width:160px; padding:6px 12px; font-size:12px; }
  .duel-five .auto-chance { font-size:12px; }
  .duel-five .auto-chance b { font-size:16px; }
  .duel-five .auto-safety { padding-left:16px; font-size:10px; }
  .duel-five .auto-status { padding-top:3px; font-size:10px; }
  .duel-five .duel-stage { gap:8px; }
  .duel-five .duel-fighter, .duel-five .duel-center { padding:8px; }
  .duel-five .duel-portrait { height:clamp(150px,23vh,205px); aspect-ratio:auto; }
  .duel-five .duel-portrait > span:not(.portrait) { padding:20px 8px 6px; font-size:9px; letter-spacing:1px; }
  .duel-five .duel-fighter h2 { margin:6px 0; font-size:20px; }
  .duel-five .duel-fighter .meter-label { margin-top:5px; font-size:10px; }
  .duel-five .battle-stats, .duel-five .enemy-style { margin-top:6px; padding-top:6px; }
  .duel-five .battle-ribbon { margin-bottom:6px; }
  .duel-five .action-grid { grid-template-columns:repeat(auto-fit,minmax(72px,1fr)); gap:4px; max-height:80px; }
  .duel-five .action-grid button { height:36px; min-height:36px; gap:4px; padding:4px; }
  .duel-five .battle-ribbon .combat-icon { width:24px; height:24px; }
  .duel-five .technique-detail { margin-top:6px; }
  .duel-five .zone-heading { height:28px; min-height:28px; padding:0; grid-template-columns:32px 1fr 32px; }
  .duel-five .zone-heading .target-scope { font-size:9px; line-height:1.2; }
  .duel-five .body-zone { height:30px; min-height:30px; grid-template-columns:32px 1fr 32px; }
  .duel-five .body-zone button { height:28px; min-height:28px; font-size:22px; line-height:24px; }
  .duel-five .body-zone > span { font-size:12px; gap:10px; }
  .duel-five .zone-instruction { margin:3px 0; font-size:10px; line-height:13px; }
  .duel-five .prediction { padding:3px 0; gap:2px 8px; }
  .duel-five .prediction span, .duel-five .prediction b { font-size:10px; line-height:13px; }
  .duel-five .submit-modern { min-height:36px; height:36px; margin-top:4px; padding:6px 10px; font-size:13px; }
  .duel-five .battle-rules { margin-top:4px; }
  .duel-five .battle-rules summary { font-size:10px; line-height:14px; }
  .duel-five .modern-log { grid-template-columns:120px minmax(0,1fr); grid-template-rows:minmax(0,1fr) auto; height:96px; max-height:96px; margin-top:6px; }
  .duel-five .modern-log h3 { padding:6px 8px; font-size:14px; }
  .duel-five .modern-log > div { min-height:0; max-height:none; overflow-y:auto; padding:4px 8px; }
  .duel-five .modern-log > small { padding:2px 8px; font-size:9px; line-height:12px; }
  .duel-five .modern-log .log-round { padding:0 4px 4px; }
  .duel-five .modern-log .log-round h4 { margin:0 0 2px; font-size:10px; line-height:13px; }
  .duel-five .modern-log .log-round p { margin:0 0 2px; padding-bottom:2px; font-size:11px; line-height:14px; }
  .duel-five .retreat-action { min-height:32px; margin-top:6px; padding:3px 12px; gap:16px; }
  .duel-five #retreat { padding:3px 16px 3px 4px; font-size:13px; }
  .duel-five .retreat-action small { font-size:10px; }
}
.location-scene { margin:0 0 22px; border:1px solid var(--border,#4b4132); background:#141716; }
.location-scene img { display:block; width:100%; height:260px; object-fit:cover; cursor:zoom-in; object-position:center; }
.location-scene figcaption { padding:6px 12px; color:#a99d89; font-size:11px; line-height:1.4; }
.party-panel { margin:5px 0 9px; min-width:0; }
.party-members { display:flex; gap:5px; overflow:auto; padding:0 0 5px; }
.party-member { display:flex; flex:0 0 190px; gap:6px; padding:4px; background:#162326; border:1px solid #384d4d; border-radius:3px; }
.party-member.enemy { background:#291c1d; border-color:#573739; }
.party-member.selected { border-color:#d9b66d; box-shadow:inset 0 0 0 1px #d9b66d; }
.party-member.fallen { opacity:.45; }
.party-member .party-portrait { width:36px; height:52px; border-radius:2px; object-fit:cover; flex:0 0 36px; }
.party-member>div { min-width:0; }
.party-member b,.party-member button { display:block; padding:0; margin:0; font:inherit; font-size:11px; line-height:14px; white-space:nowrap; max-width:142px; overflow:hidden; text-overflow:ellipsis; background:none; border:0; color:#ead7b2; text-align:left; min-height:0; }
.party-member button { cursor:pointer; text-decoration:underline; text-underline-offset:2px; }
.party-member small { display:block; font-size:9px; color:#bcae96; line-height:12px; }
.party-resources { display:flex; flex-wrap:wrap; gap:0 5px; }
.party-resources i { font-size:9px; font-style:normal; line-height:12px; color:#c8b9a7; }
.party-resources i:first-child { color:#eba3a0; }
.party-resources i:nth-child(2) { color:#9bbbe1; }
.party-resources i:nth-child(3) { color:#b0cb95; }
.initiative-queue { display:flex; gap:8px; align-items:center; min-width:0; border-bottom:1px solid #40372a; padding:2px 0 4px; }
.initiative-queue>strong { flex:0 0 auto; font-size:10px; color:#c6b08b; line-height:12px; }
.initiative-queue>strong small { font-size:9px; font-weight:400; }
.round-indicator { display:flex; align-items:baseline; gap:6px; flex:0 0 auto; padding:4px 9px; border:1px solid #75613d; border-radius:4px; background:#24251e; color:#e3c88e; line-height:1; white-space:nowrap; }
.round-indicator span { font-size:11px; font-weight:500; }
.round-indicator b { font-size:21px; font-variant-numeric:tabular-nums; }
.combat-round-row { display:flex; align-items:center; margin:6px 0 10px; }
.action-series { position:relative; display:flex; gap:8px; align-items:center; flex-wrap:wrap; padding:5px 7px; border:1px solid #75613d; border-radius:4px; background:#202621; font-size:10px; line-height:1.25; margin-bottom:6px; }
.action-series>div { display:flex; flex-direction:column; gap:3px; flex:1 1 auto; }
.action-series b { color:#e3c88e; font-size:11px; }
.series-spent { color:var(--muted); font-size:10px; }
.series-zones { display:flex; align-items:center; gap:4px; font-size:10px; }
.series-zones select { padding:3px; min-height:28px; font-size:10px; }
.series-help summary { cursor:pointer; color:#e3c88e; }
.series-help p { position:absolute; z-index:15; top:100%; right:0; width:min(360px,100%); margin:4px 0; padding:12px; border:1px solid #75613d; background:#172022; box-shadow:0 8px 24px #000a; font-size:12px; line-height:1.5; }
.series-submit { display:flex; gap:6px; }
.series-submit .submit-modern { flex:1; }
.series-submit .secondary { font-size:11px; padding:5px 10px; }
.block-target:disabled { opacity:.75; cursor:default; }
@media(max-width:720px) { .action-series { font-size:11px; padding:7px; } .series-submit { flex-wrap:wrap; } .series-submit button { min-height:40px; } }
.source-link { display:inline-block; font-size:11px; color:var(--muted); text-decoration:underline; text-underline-offset:3px; }
.skill-node .source-link { margin:0 0 7px; }
.portrait[src*="id=person-25"][src*="form=divine"] { object-position:center 28%; }
.initiative-queue ol { list-style:none; padding:0; margin:0; display:flex; gap:10px; overflow:auto; }
.initiative-queue li { min-width:80px; max-width:150px; flex:0 0 auto; font-size:10px; line-height:12px; }
.initiative-queue li span { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#acc8bf; }
.initiative-queue li.enemy span { color:#d8aaa4; }
.initiative-queue li b { font-size:10px; color:#d6bf92; font-weight:400; }
.approaching { margin-left:auto; font-size:10px; color:#a39888; white-space:nowrap; }
@media(max-width:720px) { .location-scene img { height:210px; } .approaching { display:none; } }
@media (min-width:1000px) and (max-height:760px) and (pointer:fine) {
  .duel-five .page-heading h1 { font-size:22px; line-height:26px; }
  .duel-five .action-grid { max-height:72px; }
  .duel-five .action-grid button { height:32px; min-height:32px; }
  .duel-five .zone-heading { height:24px; min-height:24px; }
  .duel-five .body-zone { height:27px; min-height:27px; }
  .duel-five .body-zone button { height:26px; min-height:26px; }
  .duel-five .modern-log { height:80px; max-height:80px; }
}
.battle-field { flex-shrink:0; padding:3px 6px; border:1px solid #8b6b48; color:var(--gold); background:#2b251d; font-size:10px; line-height:14px; white-space:nowrap; }
.illusion-group { padding:3px 8px; border-top:1px solid var(--line); font-size:12px; }
.illusion-group > summary { cursor:pointer; color:var(--muted); }
.illusion-group .party-members { max-height:150px; overflow:auto; }
.support-target-label { display:flex; align-items:center; gap:5px; font-size:11px; min-width:0; width:100%; }
.support-target-label select { min-width:0; width:100%; max-width:260px; height:22px; min-height:22px; margin:0; padding:0 4px; font-size:11px; line-height:16px; }
.discovery-result { border-color:#6f8265; }
.discovery-event .journey-actions button { flex:1; }
@media (max-width:999px), (pointer:coarse) {
  .support-target-label select { height:40px; min-height:40px; }
  .zone-heading:has(.support-target-label) { height:50px; min-height:50px; }
}

/* The actor strip must not push the turn button below a laptop viewport.
   Keep the agreed 112px description and central position unchanged. */
@media (min-width:1000px) and (max-height:820px) and (pointer:fine) {
  #app:has(.duel-five) .calculator-banner { min-height:30px; padding:3px 24px; }
  #app:has(.duel-five) .calculator-banner > div:first-child { display:flex; align-items:center; gap:10px; }
  #app:has(.duel-five) .calculator-banner span { max-width:620px; }
  #app:has(.duel-five) .calculator-actions .secondary { min-height:24px; padding:3px 8px; }
  .duel-five .page-heading { margin-bottom:4px; }
  .duel-five .party-panel { margin:3px 0 5px; }
  .duel-five .party-member { padding:3px; }
  .duel-five .party-member .party-portrait { height:44px; width:32px; flex-basis:32px; }
  .duel-five .party-member small { line-height:10px; }
  .duel-five .party-resources { line-height:10px; }
  .duel-five .action-grid { grid-template-columns:none; grid-auto-flow:column; grid-auto-columns:minmax(50px,1fr); height:38px; max-height:38px; overflow-x:auto; overflow-y:hidden; gap:3px; }
  .duel-five .action-grid button { height:32px; min-height:32px; padding:3px; gap:2px; }
  .duel-five .battle-ribbon .combat-icon { width:20px; height:20px; }
  .duel-five .duel-center { padding:6px; }
  .duel-five .battle-ribbon { margin-bottom:3px; }
  .duel-five .action-grid button small { font-size:10px; }
  .duel-five .zone-heading { height:24px; min-height:24px; }
  .duel-five .body-zone { height:22px; min-height:22px; }
  .duel-five .body-zone button { height:22px; min-height:22px; }
  .duel-five .modern-log { height:64px; max-height:64px; }
}
/* 0.9.6: private late-game scenery and travel. No new-world names on landing. */
.instant-travel { max-width:1440px; margin:12px auto; padding:12px 18px; border:1px solid #8c779b; background:#201c2d; color:#e8def3; }
.instant-travel summary { cursor:pointer; font-weight:600; }
.instant-travel summary small { margin-left:12px; opacity:.7; font-weight:400; }
.instant-travel form { display:flex; align-items:center; gap:12px; flex-wrap:wrap; padding-top:16px; }
.instant-travel select { flex:1 1 240px; min-width:0; padding:10px; color:#e7def0; background:#24212d; border:1px solid #756784; }
.instant-travel p { flex-basis:100%; margin:0; font-size:12px; opacity:.8; }
.divine-landscape .divine-vista { position:relative; min-height:65vh; background:#393341; }
.divine-landscape .location-scene { margin:0; border:0; }
.divine-landscape .location-scene img { height:72vh; min-height:460px; max-height:850px; object-fit:cover; }
.divine-landscape .location-scene figcaption { position:absolute; top:12px; right:12px; background:#1a1620b8; color:#fff; border-radius:4px; }
.divine-vista-copy { position:absolute; bottom:0; left:0; right:0; padding:80px 32px 28px; background:linear-gradient(transparent,#15131de8); pointer-events:none; color:#fff8e6; }
.divine-vista-copy h1 { font-size:clamp(28px,4vw,48px); margin:8px 0; }
.divine-vista-copy p { max-width:65ch; line-height:1.6; }
.divine-vista-copy button { pointer-events:auto; }
.divine-paths,.divine-exits { display:flex; gap:12px; flex-wrap:wrap; margin-top:16px; }
.divine-paths .destination { flex:1 1 200px; }
.divine-exits .portal-card { flex:1 1 260px; }
.battle-exits { max-width:1440px; margin:20px auto; padding:0 20px; }
.battle-exits p { flex-basis:100%; color:#b9adc8; font-size:13px; }
.spirit-voices { margin-top:12px; border-left:2px solid #9b96aa; padding-left:14px; font-style:italic; color:#c2bdcc; }
.spirit-voices p { font-size:13px; margin:6px 0; }
@media(max-width:700px) { .instant-travel{margin:8px;} .divine-vista-copy{padding:65px 16px 20px;} .divine-landscape .location-scene img{height:65vh;min-height:390px;} }
.atlas-travel-actions { display:flex; gap:8px; flex-wrap:wrap; margin:12px 0; }
.atlas-travel-actions > button { flex:1 1 0; min-width:0; padding:12px 7px; font-size:12px; }
.primary.instant-button { display:inline-flex; align-items:center; justify-content:center; gap:8px; background:linear-gradient(135deg,#7652a4,#533b7d); border:1px solid #ad86d7; color:#fff3ff; box-shadow:0 3px 14px #50288230; }
.primary.instant-button:hover { background:linear-gradient(135deg,#9065bd,#68498f); border-color:#d4a9ff; }
.instant-button svg { width:16px; height:18px; flex:0 0 16px; fill:currentColor; }
.primary.instant-button { gap:6px; }
.primary.instant-button > span { margin:0; padding:0; flex:0 1 auto; min-width:0; font-size:inherit; line-height:1.25; }
.atlas-travel-actions > button { overflow-wrap:anywhere; }
.portrait-dialog.landscape-dialog { box-sizing:border-box; width:calc(100vw - 24px); max-width:none; height:calc(100dvh - 24px); max-height:none; padding:12px; overflow:hidden; }
.portrait-dialog.landscape-dialog[open] { display:flex; flex-direction:column; gap:8px; }
.landscape-dialog .detail-heading { flex:0 0 auto; margin:0; }
.landscape-dialog .detail-heading h2 { font-size:clamp(16px,2.3vw,28px); }
.landscape-dialog #portrait-stage { flex:1 1 auto; min-height:0; width:100%; overflow:auto; overscroll-behavior:contain; background:#0d1518; }
.landscape-dialog #portrait-large { display:block; width:100%; height:auto; max-width:none; max-height:none; margin:0 auto; object-fit:contain; }
.landscape-controls { display:flex; flex:0 0 auto; align-items:center; gap:8px; flex-wrap:wrap; }
.landscape-controls[hidden] { display:none; }
.landscape-controls button { min-height:34px; padding:5px 12px; font-size:13px; }
.landscape-controls output { min-width:44px; font-size:13px; }
.landscape-controls small { margin-left:auto; }
.landscape-dialog > small { flex:0 0 auto; }
.temple-quest { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:20px; align-items:center; padding:20px 24px; margin:0 0 18px; border:1px solid var(--line); background:var(--panel); }
.temple-quest h2 { margin:6px 0 10px; font:28px Georgia,serif; color:var(--gold); }
.temple-quest p { margin:8px 0; max-width:760px; line-height:1.6; }
.temple-quest .muted { font-size:12px; }
.temple-quest > a { display:inline-flex; align-items:center; justify-content:center; min-height:46px; padding:12px 18px; border-radius:4px; text-align:center; text-decoration:none; white-space:nowrap; }
.temple-location .location-scene img { height:auto; max-height:none; object-fit:contain; }
.temple-paths { max-width:420px; margin:18px 0; }
.quest-notice { border-color:#83764f; }
.quest-success { border-color:#6f9478; }
.ascension-welcome { border-color:#a58ac4; background:linear-gradient(110deg,#332940,#192226); }
.temple-camp { color:#d1c7b2; font-style:italic; }
.hago-verse{white-space:pre-line;line-height:1.7}
.peaceful-visitors{max-width:800px;margin:0 0 24px}
.opponent.peaceful{border-color:#697f78}
.temple-return{margin:0 0 20px}
.quest-tracker { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:14px 18px; margin:0 0 20px; border:1px solid var(--line); border-left:3px solid var(--gold); background:var(--panel); }
.quest-tracker small { color:var(--gold); font-size:11px; letter-spacing:.1em; }
.quest-tracker p { margin:7px 0 0; line-height:1.5; }
.quest-tracker button { flex-shrink:0; }
.quest-journal { margin:24px 0; }
.quest-card { border:1px solid var(--line); padding:18px 20px; margin:12px 0; background:var(--panel); }
.quest-card h3 { color:var(--gold); margin:8px 0; }
.quest-card p { line-height:1.6; }
.quest-card > small { letter-spacing:.12em; color:var(--muted); }
.quest-completed > small { color:#a0bf9b; }
.quest-reward { font-size:12px; color:var(--gold); }
@media(max-width:700px) { .quest-tracker { flex-direction:column; align-items:stretch; } .quest-tracker button { align-self:flex-start; } }
@media(max-width:700px) { .temple-quest { grid-template-columns:minmax(0,1fr); padding:16px; gap:10px; } .temple-quest > a { justify-self:stretch; white-space:normal; } }
.custom-portrait-picker { display:flex; align-items:end; flex-wrap:wrap; gap:12px; margin-bottom:18px; }
.custom-portrait-picker label { flex:1; min-width:120px; }
.custom-portrait-picker button { flex:1; min-width:170px; }
.live-portrait-picker { display:flex; align-items:center; flex-wrap:wrap; gap:16px; margin:16px 0; }
.live-portrait-picker > div { flex:1; min-width:200px; }
.live-portrait-picker h2 { margin:4px 0; }
.live-portrait-picker p { font-size:12px; margin:8px 0; }
.live-portrait-picker label { display:grid; gap:5px; }
.atlas-world-select { display:flex; flex-direction:column; align-items:stretch; gap:6px; min-width:220px; margin-left:auto; }
.atlas-world-select label,.atlas-world-select small { color:#b9a6cf; font-size:11px; }
.atlas-world-select select { width:100%; border:1px solid #8b6eac; padding:11px 30px 11px 12px; border-radius:4px; color:#f3e8ff; background:#262033; font-size:14px; }
@media(max-width:600px) { .atlas-world-select { width:100%; margin-left:0; } }
