/* V0.4: one viewport, one content scroller, navigation with real reserved space. */
:root {
  --ink: #254e40;
  --muted: #647b6c;
  --paper: #fffdf4;
  --line: #d5e1cf;
  --primary: #2e7356;
}
html {
  height: 100%;
  overflow: hidden;
}
body {
  position: relative;
  top: var(--app-top, 0px);
  height: var(--app-height, 100dvh);
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  color: var(--ink);
}
.site-header {
  grid-row: 1;
  width: 100%;
  max-width: none;
  min-height: 66px;
  padding: max(8px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 8px
    max(20px, env(safe-area-inset-left));
  background: #f7faed;
  border-bottom: 1px solid var(--line);
  gap: 12px;
  z-index: 40;
}
.site-header .brand {
  font-size: 19px;
  letter-spacing: 0;
  flex-shrink: 0;
}
.site-header .brand i {
  width: 37px;
  height: 40px;
  font-size: 23px;
}
.site-header .brand small {
  font-size: 10px;
  letter-spacing: 1px;
}
.site-header #account .row {
  gap: 8px;
  flex-wrap: nowrap;
}
.site-header button {
  min-height: 42px;
  padding: 8px 13px;
  white-space: nowrap;
}
.site-header .hero-chip {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-footer {
  display: none;
}
#notice {
  grid-row: 2;
  position: static;
  z-index: auto;
  width: 100%;
  max-width: none;
  padding: 0;
  margin: 0;
}
#notice .notice {
  border-radius: 0;
  box-shadow: none;
  padding: 6px max(20px, calc((100% - 1180px) / 2));
  font-size: 12px;
  line-height: 1.6;
  max-height: 110px;
  overflow: auto;
}
#main {
  grid-row: 3;
  width: 100%;
  max-width: none;
  margin: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior-y: contain;
  padding: 24px max(24px, calc((100% - 1180px) / 2)) 30px;
  scroll-padding: 18px 0 30px;
}
#main:focus {
  outline: none;
}
#nav {
  grid-row: 4;
  position: static;
  transform: none;
  inset: auto;
  z-index: 40;
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  background: #fffef7;
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 7px max(12px, env(safe-area-inset-right)) max(7px, env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left));
}
#nav:empty {
  display: none;
}
#nav a {
  min-width: 0;
  width: min(144px, 20%);
  min-height: 54px;
  padding: 5px 12px;
  font-size: 12px;
  line-height: 1.35;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
#nav a.active {
  background: #e1efda;
  color: #225e43;
  font-weight: 800;
}
#nav .nav-icon {
  height: 23px;
  width: 23px;
}
body[data-mode='parent'] #nav,
body[data-mode='battle'] #nav,
body[data-mode='learning'] #nav,
body[data-mode='welcome'] #nav {
  display: none;
}
body[data-mode='battle'] #main {
  position: relative;
  padding: 0;
  overflow: hidden;
}
body[data-mode='battle'] .site-header .brand small {
  display: none;
}
body[data-mode='parent'] #main {
  background: #f3f6ed;
}
body[data-mode='welcome'] #main {
  padding-bottom: 30px;
}
button,
input,
select,
summary {
  scroll-margin: 16px;
}
button.gold,
.primary-action {
  background: linear-gradient(#478663, #286047);
  color: #fffdf3;
  border-color: #205c42;
  box-shadow: 0 3px 0 #1d4a36;
}
button.secondary {
  box-shadow: none;
}
button:disabled {
  cursor: default;
}
.page-heading {
  margin-bottom: 22px;
}
.page-heading h1 {
  font-size: clamp(24px, 3vw, 32px);
  margin: 5px 0;
}
.page-heading .eyebrow {
  font-size: 12px;
  color: var(--muted);
}
.card {
  border-radius: 22px;
  box-shadow: 0 5px 18px #2b493b0b;
}
.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  position: relative;
  overflow: hidden;
  min-height: 310px;
  padding: 32px 40px;
  border-radius: 28px;
  border: 1px solid #c6d7b7;
  background:
    linear-gradient(90deg, #e8f1d9 0%, #e8f1d9eb 42%, #e3edd199 100%),
    url('/assets/v3/forest-world.webp') center 58% / cover;
  align-items: center;
}
.home-hero h1 {
  font-size: clamp(26px, 3.5vw, 40px);
  line-height: 1.3;
  margin: 10px 0 12px;
  max-width: 600px;
}
.home-hero p {
  color: #4c6c51;
  font-size: 15px;
  max-width: 500px;
  line-height: 1.75;
}
.home-hero .home-character {
  height: 250px;
  width: 100%;
}
.home-hero .avatar-shell .element-rune {
  right: 12%;
  bottom: 5%;
}
.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 23px;
}
.home-actions button {
  min-height: 54px;
  font-size: 16px;
  padding: 13px 24px;
}
.home-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 18px 4px;
}
.home-status > div {
  flex: 1;
  min-width: 170px;
}
.home-status .xp-track {
  margin: 7px 0 0;
  max-width: 500px;
}
.home-status .xp-caption {
  max-width: 500px;
}
.home-paths {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 5px;
}
.home-path {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px;
  min-height: 130px;
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 22px;
  color: var(--ink);
  box-shadow: none;
}
.home-path > span {
  flex: 0 0 64px;
  height: 76px;
  display: grid;
  place-items: center;
}
.home-path svg {
  width: 42px;
  height: 42px;
}
.home-path img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.home-path b {
  display: block;
  font-size: 17px;
  margin-bottom: 7px;
}
.home-path small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}
.home-next {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-top: 22px;
  padding: 22px 26px;
  background: #e4eddb;
  border-radius: 22px;
}
.home-next p {
  margin: 5px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.home-next b {
  font-size: 17px;
}
.parent-home {
  max-width: 980px;
  margin: auto;
}
.parent-actions {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 18px;
}
.parent-action {
  padding: 26px;
}
.parent-action h2 {
  font-size: 23px;
  margin-bottom: 10px;
}
.parent-action p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.8;
}
.parent-action button {
  margin-top: 12px;
  width: 100%;
}
.parent-characters {
  padding: 24px;
  margin-top: 22px;
}
.parent-character-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.parent-character-row small {
  display: block;
  color: var(--muted);
  margin-top: 5px;
}
.account-tools {
  margin-top: 20px;
  padding: 18px 24px;
  background: #e9eee2;
  border-radius: 16px;
}
.account-tools summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 750;
}
.atlas-layer-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}
.atlas-layer-tabs button {
  min-height: 44px;
  padding: 10px 17px;
}
.atlas-legend {
  display: none;
}
.atlas-route-shortcuts > div {
  display: none;
}
.atlas-route-shortcuts {
  margin: 12px 0;
}
.atlas-title h2 {
  margin-bottom: 4px;
}
.map-portal-hub {
  --x: 20%;
  --y: 80%;
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  gap: 5px;
  width: 116px;
  min-height: 110px;
  padding: 9px;
  color: #fff7da;
  background: #183d3dd9;
  border: 1px solid #c4d291;
  border-radius: 24px;
  z-index: 4;
  box-shadow: 0 8px 24px #102c32aa;
}
.map-portal-hub .painted-icon {
  width: 48px;
  height: 48px;
}
.map-portal-hub small {
  font-size: 10px;
}
.atlas-layer-help {
  margin: 3px 0 10px;
  font-size: 13px;
  color: var(--muted);
}
.training-control .topic-cards {
  max-height: none;
  overflow: visible;
}
.practice-ready {
  padding: 24px;
  margin-top: 16px;
  border: 1px solid var(--line);
  background: #eef5e3;
  border-radius: 22px;
}
.practice-ready h3 {
  margin: 0 0 8px;
}
.practice-ready .practice-bottom {
  margin-top: 16px;
}
.training-control .subject-tabs {
  margin-bottom: 16px;
}
.training-control .topic-card {
  min-height: 78px;
  box-shadow: none;
}
.training-control .topic-card.selected {
  border: 2px solid #4f8a61;
  background: #e5f1d8;
}
.training-control .topic-card small {
  line-height: 1.5;
}
.training-quest {
  max-width: 900px;
  margin: auto;
}
.training-clock {
  position: static;
  display: flex;
  justify-content: flex-end;
  gap: 5px;
  align-items: baseline;
  margin-bottom: 12px;
}
.training-companion {
  min-height: 0;
}
.training-quest .question-portrait {
  height: 95px;
  width: 85px;
}
.hero-summary .build-stat-grid {
  grid-template-columns: repeat(3, 1fr);
}
.hero-summary .advanced-character-stats {
  margin-top: 16px;
}
.hero-summary .advanced-character-stats summary {
  cursor: pointer;
  font-weight: 750;
  font-size: 13px;
}
.hero-summary .hero-portrait {
  height: 200px;
}
.hero-summary .paperdoll {
  min-height: 210px;
}
.hero-summary .dodge-note {
  display: none;
}
.build-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.build-tabs button {
  min-height: 44px;
}
.backpack-panel .bag-toolbar {
  position: static;
}
.bag-toolbar {
  gap: 10px;
}
.bag-filters {
  flex-wrap: wrap;
}
.bag-filters button {
  min-height: 42px;
}
.friend-banner {
  gap: 20px;
}
.friend-banner .code {
  font-size: 28px;
}
.modal-backdrop {
  z-index: 500;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.game-modal {
  max-height: calc(var(--app-height, 100dvh) - 32px);
  padding: 24px;
  scroll-padding: 72px 0 24px;
  overscroll-behavior: contain;
}
.game-modal .modal-close {
  position: sticky;
  top: 0;
  float: none;
  display: block;
  width: fit-content;
  margin: 0 0 10px auto;
  z-index: 20;
  background: #fffdf4;
  border: 1px solid #bacdb3;
  box-shadow: 0 2px 8px #24463522;
  min-height: 42px;
}
.game-modal h2 {
  margin-top: 12px;
  font-size: 23px;
}
.dialog-open #main {
  overflow: hidden;
}
.library-detail-backdrop {
  z-index: 600;
  padding: 16px;
}
.library-detail {
  max-height: calc(var(--app-height, 100dvh) - 32px);
  overscroll-behavior: contain;
}
.library-detail > header {
  position: sticky;
  top: 0;
  background: var(--paper);
  padding: 10px 0;
  z-index: 5;
  border-bottom: 1px solid var(--line);
}
/* Battle is a content-sized scene, not a second independently positioned viewport. */
body[data-mode='battle'] .mobile-combat {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 0.95fr);
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
  gap: 12px;
  z-index: 1;
}
body[data-mode='battle'] .mobile-combat .battlefield {
  height: 100%;
  min-height: 0;
  top: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 14px;
  overflow: hidden;
}
body[data-mode='battle'] .mobile-combat .combat-console {
  height: 100%;
  overflow: visible;
  min-height: 0;
  padding: 14px;
}
body[data-mode='battle'] .mobile-combat .battle-backdrop {
  flex: 1;
  min-height: 75px;
  height: auto;
  margin: 0;
  display: grid;
  place-items: center;
}
body[data-mode='battle'] .mobile-combat .boss-art {
  height: 100%;
  max-height: 310px;
  min-height: 75px;
  width: 100%;
  margin: 0;
  position: relative;
}
body[data-mode='battle'] .mobile-combat .boss-art img {
  object-fit: contain;
}
body[data-mode='battle'] .mobile-combat .boss-panel {
  flex: 0 0 auto;
  height: auto;
  margin: 0;
}
body[data-mode='battle'] .mobile-combat .battle-members {
  flex: 0 0 auto;
  height: auto;
  min-height: 100px;
  margin: 0;
  align-items: stretch;
  gap: 5px;
}
body[data-mode='battle'] .mobile-combat .battle-member {
  min-height: 100px;
  height: auto;
  padding: 5px 3px;
}
body[data-mode='battle'] .mobile-combat .member-art {
  height: 60px;
}
body[data-mode='battle'] .mobile-combat .battle-caption-space {
  height: 30px;
  flex: 0 0 auto;
  margin: 0;
}
body[data-mode='battle'] .mobile-combat .live-spell-label {
  top: auto;
  bottom: 125px;
  font-size: 13px;
}
.combat-console .combat-skill-pager button {
  min-height: 42px;
}
.combat-more-panel {
  max-height: calc(100% - 70px);
  z-index: 80;
}
/* Parent workspace: a small primary navigation, specialist tools disclosed on demand. */
.studio-heading {
  margin: 0 0 20px;
  padding: 0;
  max-width: none;
}
.studio-heading h1 {
  margin: 5px 0 0;
  font-size: 29px;
}
.studio-layout {
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 22px;
}
.studio-nav {
  position: static;
  align-self: start;
  top: auto;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 18px;
  padding: 8px;
}
.studio-nav button {
  min-height: 48px;
  text-align: left;
  padding: 10px 12px;
}
.studio-tools summary {
  cursor: pointer;
  padding: 13px 12px;
  color: var(--muted);
  font-size: 12px;
}
.studio-tools button {
  font-size: 12px;
}
.studio-main {
  min-width: 0;
}
.studio-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.studio-stats article {
  padding: 15px;
}
.studio-home-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 18px 0;
}
.studio-home-actions article {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
}
.studio-home-actions h3 {
  margin: 0 0 8px;
  font-size: 19px;
}
.studio-home-actions p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}
.studio-home-actions button {
  width: 100%;
  margin-top: 8px;
  min-height: 46px;
}
.studio-coverage-detail {
  padding: 18px 22px;
  background: #e9eee3;
  border-radius: 18px;
}
.studio-coverage-detail > summary {
  font-size: 13px;
  cursor: pointer;
}
.studio-main .bank-generator {
  margin-top: 0;
}
.studio-guidance summary {
  padding: 9px 0;
  cursor: pointer;
}
.studio-main .bank-filter-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.sv8-studio .bank-metrics {
  gap: 8px;
}
@media (max-width: 1000px) {
  .home-hero {
    grid-template-columns: minmax(0, 1fr) 190px;
    padding: 26px;
  }
  .home-hero .home-character {
    height: 220px;
  }
  .home-paths {
    gap: 12px;
  }
  .home-path {
    padding: 16px;
    gap: 10px;
  }
  .home-path > span {
    flex-basis: 48px;
  }
  .studio-layout {
    grid-template-columns: 145px minmax(0, 1fr);
    gap: 16px;
  }
  .hero-build {
    grid-template-columns: 230px minmax(0, 1fr);
  }
}
@media (max-width: 760px) {
  .site-header {
    min-height: 58px;
    padding-left: 12px;
    padding-right: 12px;
  }
  .site-header .brand {
    font-size: 15px;
    gap: 7px;
  }
  .site-header .brand small {
    display: none;
  }
  .site-header .brand i {
    width: 29px;
    height: 33px;
    font-size: 19px;
  }
  .site-header .hero-chip {
    display: none;
  }
  .site-header button {
    padding: 7px 11px;
    font-size: 12px;
  }
  #main {
    padding: 18px 14px 24px;
  }
  #nav {
    gap: 3px;
    padding-top: 5px;
  }
  #nav a {
    padding: 4px 3px;
    min-height: 52px;
    font-size: 11px;
  }
  .home-hero {
    min-height: 275px;
    grid-template-columns: minmax(0, 1fr) 125px;
    padding: 22px;
    border-radius: 24px;
  }
  .home-hero h1 {
    font-size: 27px;
  }
  .home-hero p {
    font-size: 13px;
  }
  .home-hero .home-character {
    height: 190px;
  }
  .home-actions {
    grid-column: 1/-1;
  }
  .home-actions button {
    padding: 12px 16px;
    min-height: 49px;
    font-size: 14px;
  }
  .home-paths {
    grid-template-columns: 1fr;
  }
  .home-path {
    min-height: 100px;
    padding: 14px 18px;
  }
  .home-path > span {
    height: 62px;
    flex-basis: 55px;
  }
  .home-path b {
    font-size: 16px;
    margin-bottom: 4px;
  }
  .home-next {
    padding: 18px;
    align-items: flex-start;
  }
  .home-next button {
    min-width: 88px;
  }
  .parent-actions {
    grid-template-columns: 1fr;
  }
  .parent-action {
    padding: 22px;
  }
  .hero-build {
    grid-template-columns: 1fr;
  }
  .hero-summary {
    display: grid;
    grid-template-columns: 95px minmax(0, 1fr);
    gap: 8px 15px;
    align-items: center;
  }
  .hero-summary .paperdoll {
    grid-row: 1/5;
    min-height: 130px;
    height: 130px;
  }
  .hero-summary .hero-portrait {
    height: 130px;
  }
  .hero-summary > h2 {
    font-size: 18px;
    margin: 0;
  }
  .hero-summary > .advanced-character-stats,
  .hero-summary > .attributes-panel,
  .hero-summary > .element-summary {
    grid-column: 1/-1;
  }
  .hero-summary > .build-stat-grid {
    display: none;
  }
  .hero-summary .xp-caption {
    font-size: 10px;
  }
  .studio-layout {
    display: block;
  }
  .studio-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
    padding: 6px;
    margin-bottom: 16px;
  }
  .studio-nav > button {
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    font-size: 11px;
    padding: 8px 3px;
    min-height: 55px;
  }
  .studio-tools {
    grid-column: 1/-1;
  }
  .studio-tools summary {
    padding: 9px;
    text-align: center;
  }
  .studio-tools[open] {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
  }
  .studio-tools[open] summary {
    width: 100%;
  }
  .studio-tools button {
    min-height: 40px;
  }
  .studio-home-actions {
    grid-template-columns: 1fr;
  }
  .studio-heading {
    gap: 12px;
  }
  .studio-heading h1 {
    font-size: 25px;
  }
  .studio-main .bank-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .map-portal-hub {
    width: 94px;
    min-height: 100px;
    font-size: 12px;
  }
}
@media (max-width: 700px) and (min-height: 600px) {
  body[data-mode='battle'] .mobile-combat {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 200px minmax(0, 1fr);
    padding: 6px;
    gap: 6px;
  }
  body[data-mode='battle'] .mobile-combat .battlefield {
    padding: 6px;
    gap: 2px;
    border-radius: 17px;
  }
  body[data-mode='battle'] .mobile-combat .boss-panel h2 {
    font-size: 14px;
  }
  body[data-mode='battle'] .mobile-combat .boss-panel .eyebrow {
    display: none;
  }
  body[data-mode='battle'] .mobile-combat .battle-backdrop,
  body[data-mode='battle'] .mobile-combat .boss-art {
    min-height: 35px;
    max-height: 50px;
  }
  body[data-mode='battle'] .mobile-combat .battle-members {
    min-height: 64px;
    gap: 3px;
  }
  body[data-mode='battle'] .mobile-combat .battle-member {
    min-height: 64px;
    padding: 2px;
  }
  body[data-mode='battle'] .mobile-combat .member-art {
    height: 28px;
  }
  body[data-mode='battle'] .mobile-combat .battle-caption-space {
    height: 14px;
  }
  body[data-mode='battle'] .mobile-combat .live-spell-label {
    bottom: 75px;
    font-size: 10px;
  }
  body[data-mode='battle'] .mobile-combat .combat-console {
    padding: 9px;
    border-radius: 17px;
  }
}
@media (max-height: 599px) {
  .site-header {
    min-height: 45px;
    padding-top: 3px;
    padding-bottom: 3px;
  }
  .site-header .brand i {
    height: 28px;
  }
  body[data-mode='battle'] .mobile-combat {
    grid-template-columns: minmax(0, 0.9fr) minmax(240px, 1.2fr);
    grid-template-rows: minmax(0, 1fr);
    padding: 5px;
    gap: 6px;
  }
  body[data-mode='battle'] .mobile-combat .battlefield {
    padding: 6px;
    gap: 3px;
  }
  body[data-mode='battle'] .mobile-combat .member-art {
    height: 30px;
  }
  body[data-mode='battle'] .mobile-combat .battle-members,
  body[data-mode='battle'] .mobile-combat .battle-member {
    min-height: 68px;
  }
  body[data-mode='battle'] .mobile-combat .battle-caption-space {
    height: 12px;
  }
  .combat-console .selected-skill {
    min-height: 28px;
  }
  .combat-console-header h2 {
    font-size: 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .home-character,
  .home-path img {
    animation: none !important;
  }
}
.practice-more {
  margin-top: 15px;
}
.practice-more > summary {
  cursor: pointer;
  padding: 12px 4px;
  font-size: 13px;
  color: #45674e;
}
.review-steps {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.review-steps span {
  padding: 7px 12px;
  background: #e5efda;
  color: #416449;
  border-radius: 20px;
  font-size: 12px;
}
@media (max-width: 760px) {
  .studio-nav {
    grid-template-columns: repeat(var(--studio-nav-count, 4), minmax(0, 1fr));
  }
}
.party-ready-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #e6f0d9;
  padding: 18px 22px;
  border: 1px solid #c9dbba;
  border-radius: 18px;
  margin: 16px 0 20px;
}
.party-ready-actions p {
  margin: 4px 0 0;
  font-size: 13px;
  color: #5d775d;
}
.party-ready-actions button {
  min-height: 48px;
}
.party-room-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.party-room-meta summary {
  font-size: 13px;
  cursor: pointer;
  color: #536d56;
  padding: 9px 0;
}
.party-more {
  margin-top: 22px;
}
.party-more summary {
  font-size: 12px;
  color: #687f68;
  padding: 10px 0;
}
.party-more .row {
  gap: 10px;
  margin-top: 12px;
}
@media (max-width: 760px) {
  .party-ready-actions {
    align-items: stretch;
    flex-direction: column;
    padding: 16px;
  }
  .party-ready-actions .row,
  .party-ready-actions button {
    width: 100%;
  }
}
.map-hub-dock {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 20px;
  background: linear-gradient(#143f35, #315d42);
  border-radius: 0 0 22px 22px;
}
.map-hub-dock:empty {
  display: none;
}
.map-hub-dock .map-portal-hub {
  position: static;
  transform: none;
  width: 100%;
  min-width: 0;
  min-height: 130px;
}
@media (max-width: 600px) {
  .map-hub-dock {
    gap: 8px;
    padding: 12px;
  }
  .map-hub-dock .map-portal-hub {
    padding: 8px 4px;
    font-size: 12px;
  }
  .map-hub-dock .map-portal-hub small {
    font-size: 9px;
  }
}
.training-control {
  padding: 24px;
}
.training-control h1 {
  font-size: 26px;
  margin: 5px 0 12px;
}
.training-control .topic-cards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.practice-ready {
  padding: 18px 20px;
}
.practice-ready > p {
  margin: 4px 0 10px;
}
.active-adventure-note {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  background: #f5efd3;
  border: 1px solid #dfcda0;
  border-radius: 18px;
  margin-bottom: 20px;
}
.active-adventure-note p {
  font-size: 12px;
  margin: 6px 0 0;
}
.bank-replace-tools {
  margin-top: 18px;
  border-top: 1px solid #d6e0cb;
  padding-top: 12px;
}
.bank-replace-tools summary {
  cursor: pointer;
  font-size: 13px;
  color: #63745d;
  margin-bottom: 12px;
}
@media (max-width: 760px) {
  .training-control {
    padding: 18px;
  }
  .training-control h1 {
    font-size: 22px;
  }
  .practice-ready {
    padding: 16px;
  }
  .active-adventure-note {
    flex-direction: column;
    align-items: stretch;
  }
}
.primary-action {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 46px;
  padding: 11px 20px;
  border: 1px solid #205c42;
  border-radius: 14px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 750;
  margin-top: 8px;
}
@media (min-width: 761px) {
  .studio-nav {
    position: sticky;
    top: 0;
  }
}
.library-filter-more {
  margin: 8px 0 18px;
  padding: 0 0 10px;
  border-bottom: 1px solid #d9e2d0;
}
.library-filter-more > summary {
  cursor: pointer;
  color: #5e755e;
  font-size: 13px;
  padding: 8px 0;
}
.library-filter-more[open] > summary {
  margin-bottom: 12px;
}
.studio-main .bank-filter-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.studio-main .bank-game-question > label {
  grid-template-columns: auto minmax(0, 1fr);
}
.studio-main .bank-game-question > label {
  display: flex;
  gap: 10px;
  align-items: center;
}
.bank-game-question input[hidden] {
  display: none;
}
.collection-preview {
  margin-top: 22px;
  padding: 16px 20px;
  background: #e7efdf;
  border: 1px solid #cfddc3;
  border-radius: 18px;
}
.collection-preview > summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 750;
}
.collection-preview .set-collection {
  margin-top: 18px;
}
.pet-carebar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 8px 0 22px;
  padding: 17px 20px;
  background: #e5efda;
  border-radius: 18px;
}
.pet-carebar > span {
  font-size: 15px;
  font-weight: 750;
  margin-right: auto;
}
.talent-investment-actions {
  margin: 18px 0 12px;
}
/* The destination becomes the next step, with preparation details secondary. */
.party-roster-details {
  margin-top: 22px;
  border-top: 1px dashed var(--line);
  padding-top: 16px;
}
.party-roster-details > summary,
.expedition-preferences > summary {
  cursor: pointer;
  font-weight: 800;
  padding: 12px 4px;
}
.expedition-picker {
  margin-top: 8px;
}
.expedition-preferences {
  margin-bottom: 12px;
}
#main {
  scrollbar-gutter: stable;
}
.combat-console .combat-skill-grid {
  grid-template-rows: repeat(2, minmax(0, 150px));
  align-content: start;
}
.creation-elements > summary {
  min-height: 44px;
  padding: 12px;
  cursor: pointer;
  font-weight: 800;
  background: #edf2e5;
  border-radius: 14px;
}
body[data-mode='battle'] #main {
  scrollbar-gutter: auto;
}
@media (max-width: 700px) and (min-height: 600px) {
  body[data-mode='battle'] .mobile-combat {
    grid-template-rows: 230px minmax(0, 1fr);
  }
  body[data-mode='battle'] .mobile-combat .battlefield {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 3px 6px;
  }
  body[data-mode='battle'] .mobile-combat .boss-panel {
    grid-column: 1 / -1;
    grid-row: 1;
  }
  body[data-mode='battle'] .mobile-combat .boss-panel .hp-caption {
    font-size: 9px;
    margin: 2px 0;
  }
  body[data-mode='battle'] .mobile-combat .boss-panel .ward-seals {
    position: absolute;
    right: 10px;
    top: 30px;
    margin: 0;
    padding: 0;
    height: 12px;
    font-size: 10px;
  }
  body[data-mode='battle'] .mobile-combat .boss-panel .ward-seals i {
    font-size: 10px;
    width: 12px;
    height: 12px;
  }
  body[data-mode='battle'] .mobile-combat .monster-intent {
    grid-column: 1 / -1;
    grid-row: 2;
    min-height: 20px;
    padding: 2px 6px;
    margin: 0;
  }
  body[data-mode='battle'] .mobile-combat .battle-backdrop {
    grid-column: 1;
    grid-row: 3;
    min-height: 0;
    max-height: none;
    height: 100%;
  }
  body[data-mode='battle'] .mobile-combat .boss-art {
    min-height: 0;
    max-height: none;
    height: 100%;
  }
  body[data-mode='battle'] .mobile-combat .battle-members {
    grid-column: 2;
    grid-row: 3;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px;
    min-height: 0;
    height: 100%;
  }
  body[data-mode='battle'] .mobile-combat .battle-member {
    min-height: 0;
    height: 100%;
    padding: 2px;
    border-radius: 8px;
  }
  body[data-mode='battle'] .mobile-combat .member-art {
    height: 25px;
  }
  body[data-mode='battle'] .mobile-combat .battle-member b {
    font-size: 8px;
    line-height: 1.15;
    margin: 0;
  }
  body[data-mode='battle'] .mobile-combat .battle-member .meter {
    height: 3px;
    margin: 2px 0;
  }
  body[data-mode='battle'] .mobile-combat .member-intent,
  body[data-mode='battle'] .mobile-combat .battle-caption-space,
  body[data-mode='battle'] .mobile-combat .battle-member small {
    display: none;
  }
  body[data-mode='battle'] .mobile-combat .counter-plan {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 5px;
    z-index: 5;
    font-size: 9px;
    padding: 2px 6px;
    min-height: 0;
  }
  body[data-mode='battle'] .mobile-combat .counter-plan span {
    display: none;
  }
  body[data-mode='battle'] .mobile-combat .live-spell-label {
    bottom: 20px;
  }
}
.combat-console .selected-skill .spell-medallion {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
}
.combat-console .selected-skill .spell-medallion .painted-icon,
.combat-console .selected-skill .spell-medallion img {
  width: 100%;
  height: 100%;
  min-width: 0;
  max-width: 100%;
  object-fit: contain;
}
@media (max-width: 700px) and (min-height: 600px) {
  body[data-mode='battle'] .mobile-combat .boss-panel .ward-seals {
    top: 8px;
    right: 70px;
  }
}
.combat-more-panel .presentation-preferences {
  display: flex;
  flex-wrap: wrap;
  margin: 8px 0;
  padding: 8px 0;
  gap: 6px;
}
.combat-more-panel .presentation-preferences small {
  flex-basis: 100%;
}
@media (max-width: 700px) and (min-height: 600px) {
  body[data-mode='battle'] .mobile-combat .battle-members.count-5 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
/* V0.4.1: a world has four landmarks; only the selected chapter exposes encounters. */
.journey-shell {
  max-width: 1060px;
  margin: 0 auto;
}
.journey-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}
.journey-heading h1 {
  margin: 4px 0 0;
  font-size: 30px;
}
.journey-progress {
  font-size: 30px;
  font-weight: 900;
  white-space: nowrap;
}
.journey-progress small {
  font-size: 13px;
  color: var(--muted);
  margin-left: 4px;
}
.journey-modes {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.journey-modes button {
  min-width: 140px;
}
.journey-next {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: #f6f7e8;
  border: 1px solid #d6e0cb;
  border-radius: 20px;
  margin-bottom: 16px;
}
.journey-next small,
.journey-next b {
  display: block;
}
.journey-next small {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}
.journey-next b {
  font-size: 19px;
}
.journey-world {
  position: relative;
  height: 350px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid #bdd1b5;
  border-radius: 28px;
  background: #dae8cb;
}
.journey-world:before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(0deg, #dce8ccaa, #ecf1d8aa),
    url('/assets/v3/forest-world.webp') center 48% / cover;
  filter: saturate(0.65);
}
.journey-world:after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, #f3f4df40, transparent 50%, #e3ecd340);
  pointer-events: none;
}
.journey-trail {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.journey-trail path {
  fill: none;
  stroke: #fff8d9;
  stroke-width: 1.6;
  stroke-dasharray: 1 1.7;
  stroke-linecap: round;
  filter: drop-shadow(0 2px 2px #456c4366);
}
.chapter-marker {
  position: absolute;
  left: var(--chapter-x);
  top: var(--chapter-y);
  transform: translate(-50%, -50%);
  width: 140px;
  min-height: 102px;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 6px;
  border: 0;
  border-radius: 20px;
  background: #f9f8e6eb;
  color: #385944;
  box-shadow: 0 5px 0 #405d3324;
}
.chapter-marker:hover {
  transform: translate(-50%, -50%);
  background: #fffbea;
}
.chapter-marker .chapter-crest {
  display: grid;
  place-items: center;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  background: #dbe7d0;
  color: #396a4f;
  font-weight: 900;
  font-size: 18px;
}
.chapter-marker b {
  font-size: 16px;
}
.chapter-marker small {
  color: #63735e;
  font-size: 11px;
}
.chapter-marker.selected {
  outline: 3px solid #527b47;
  outline-offset: 3px;
}
.chapter-marker.current .chapter-crest {
  background: #42744e;
  color: #fff9dd;
}
.chapter-marker.completed .chapter-crest {
  background: #becfb2;
}
.journey-gateway {
  position: absolute;
  right: 7%;
  bottom: 7%;
  display: grid;
  grid-template-columns: 32px 1fr;
  column-gap: 7px;
  text-align: left;
  padding: 9px 13px;
  min-height: 65px;
  border-radius: 18px;
  background: #f6f5e8ee;
  color: #66567e;
  border: 1px solid #cbbdd5;
  box-shadow: none;
}
.journey-gateway span {
  grid-row: 1/3;
  font-size: 27px;
  align-self: center;
  color: #9d85bd;
}
.journey-gateway small {
  font-size: 10px;
  font-weight: 500;
}
.chapter-detail {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 20px;
  background: #fffdf4;
}
.chapter-detail-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.chapter-detail-heading h2 {
  font-size: 22px;
  margin: 3px 0 0;
}
.chapter-detail-heading > small {
  font-size: 12px;
  color: var(--muted);
}
.chapter-stops {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-top: 16px;
}
.journey-stop {
  flex: 1;
  max-width: 260px;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 5px;
  padding: 12px 8px;
  background: #f3f5e9;
  color: var(--ink);
  border: 1px solid #d7e1cf;
  border-radius: 18px;
  box-shadow: none;
}
.journey-stop.next {
  border: 2px solid #608254;
  background: #e9f0dc;
}
.journey-stop small {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}
.journey-stop b {
  font-size: 15px;
}
.journey-stop em {
  font-style: normal;
  font-size: 11px;
  color: #517343;
  margin-top: 4px;
}
.journey-stop-art {
  position: relative;
  display: block;
  width: 80px;
  height: 70px;
}
.journey-stop-art .rpg-art,
.journey-stop-art img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
}
.journey-stop-art i {
  position: absolute;
  left: -3px;
  bottom: 0;
  width: 23px;
  height: 23px;
  background: #fff8dd;
  border: 1px solid #c9d4ba;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-style: normal;
  font-size: 12px;
}
.dungeon-landing {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  min-height: 150px;
  padding: 22px 28px;
  background: linear-gradient(110deg, #e5e6ef, #f4f3e6);
  border-radius: 25px;
}
.dungeon-landing h2 {
  margin: 6px 0;
  font-size: 25px;
}
.dungeon-landing p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}
.dungeon-landing-art {
  width: 110px;
  height: 110px;
  flex: 0 0 110px;
}
.dungeon-landing-art .rpg-art,
.dungeon-landing-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.dungeon-subjects {
  display: flex;
  gap: 8px;
  margin: 18px 0;
}
.dungeon-subjects button {
  min-width: 100px;
}
.dungeon-doors {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.dungeon-door {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 115px;
  padding: 16px;
  text-align: left;
  background: #fffdf4;
  border: 1px solid #d6dfce;
  color: var(--ink);
  box-shadow: none;
  border-radius: 20px;
}
.dungeon-door > span:nth-child(2) {
  flex: 1;
  min-width: 0;
}
.dungeon-door b {
  display: block;
  font-size: 16px;
  line-height: 1.5;
}
.dungeon-door small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 5px;
}
.dungeon-door i {
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
  color: #6a7c64;
}
.dungeon-door-art {
  display: block;
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
}
.dungeon-door-art .painted-icon,
.dungeon-door-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.dungeon-pages {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 18px 0 10px;
}
.dungeon-pages span {
  font-size: 12px;
  color: var(--muted);
}
@media (max-width: 700px) {
  .journey-heading h1 {
    font-size: 25px;
  }
  .journey-modes button {
    flex: 1;
    min-width: 0;
  }
  .journey-next {
    padding: 12px;
    gap: 8px;
  }
  .journey-next b {
    font-size: 15px;
  }
  .journey-next button {
    font-size: 12px;
    padding: 10px;
    white-space: nowrap;
  }
  .journey-world {
    height: 310px;
    border-radius: 22px;
  }
  .chapter-marker {
    width: 83px;
    min-height: 82px;
    padding: 5px;
    border-radius: 15px;
  }
  .chapter-marker b {
    font-size: 12px;
  }
  .chapter-marker small {
    font-size: 9px;
  }
  .chapter-marker .chapter-crest {
    width: 27px;
    height: 27px;
    font-size: 15px;
  }
  .journey-gateway {
    right: 5%;
    bottom: 8%;
    padding: 7px 9px;
    min-height: 54px;
  }
  .journey-gateway b {
    font-size: 12px;
  }
  .chapter-detail {
    padding: 13px;
    border-radius: 20px;
  }
  .chapter-detail-heading h2 {
    font-size: 20px;
  }
  .chapter-stops {
    gap: 6px;
  }
  .journey-stop {
    padding: 10px 3px;
    gap: 4px;
  }
  .journey-stop b {
    font-size: 11px;
  }
  .journey-stop small {
    font-size: 9px;
    line-height: 1.5;
  }
  .journey-stop-art {
    width: 55px;
    height: 58px;
  }
  .journey-stop em {
    font-size: 10px;
  }
  .dungeon-landing {
    padding: 16px;
    min-height: 130px;
  }
  .dungeon-landing h2 {
    font-size: 21px;
  }
  .dungeon-landing p {
    font-size: 12px;
  }
  .dungeon-landing-art {
    width: 75px;
    height: 85px;
    flex-basis: 75px;
  }
  .dungeon-subjects button {
    flex: 1;
    min-width: 0;
  }
  .dungeon-doors {
    grid-template-columns: 1fr;
  }
  .dungeon-door {
    min-height: 92px;
    padding: 12px;
    gap: 11px;
  }
  .dungeon-door b {
    font-size: 14px;
  }
}
@media (min-width: 900px) {
  .journey-stage {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
    gap: 16px;
    align-items: stretch;
  }
  .journey-stage .journey-world {
    height: 350px;
  }
  .journey-stage .chapter-detail {
    margin: 0;
    padding: 16px;
  }
  .journey-stage .chapter-stops {
    flex-direction: column;
    gap: 9px;
    margin-top: 12px;
  }
  .journey-stage .journey-stop {
    display: grid;
    grid-template-columns: 60px minmax(0, 1fr);
    column-gap: 12px;
    row-gap: 2px;
    width: 100%;
    max-width: none;
    text-align: left;
    align-content: center;
    padding: 9px;
  }
  .journey-stage .journey-stop-art {
    grid-column: 1;
    grid-row: 1/4;
    width: 60px;
    height: 60px;
  }
  .journey-stage .journey-stop b,
  .journey-stage .journey-stop small,
  .journey-stage .journey-stop em {
    grid-column: 2;
  }
  .journey-stage .journey-stop b {
    font-size: 14px;
  }
  .journey-stage .chapter-marker {
    width: 108px;
    min-height: 90px;
  }
  .journey-stage .chapter-marker b {
    font-size: 14px;
  }
}
.journey-trail .trail-narrow {
  display: none;
}
@media (max-width: 700px) {
  .journey-world .chapter-marker[data-chapter='0'] {
    left: 22%;
    top: 78%;
  }
  .journey-world .chapter-marker[data-chapter='1'] {
    left: 75%;
    top: 61%;
  }
  .journey-world .chapter-marker[data-chapter='2'] {
    left: 24%;
    top: 37%;
  }
  .journey-world .chapter-marker[data-chapter='3'] {
    left: 77%;
    top: 18%;
  }
  .journey-trail .trail-wide {
    display: none;
  }
  .journey-trail .trail-narrow {
    display: block;
  }
}

/* Forest expansion: illustration leads, controls stay in the content flow. */
.journey-stage .journey-world {
  height: 440px;
  min-height: 440px;
  border: 2px solid #c69c54;
  border-radius: 26px;
  box-shadow:
    0 12px 28px #18352f36,
    inset 0 0 30px #ffd46d44;
}
.journey-stage .journey-world:before {
  background:
    linear-gradient(0deg, #0b332e35, #0b332e05),
    url('/assets/v9/world.webp') center/cover;
  filter: none;
}
.journey-stage .journey-world:after {
  background: radial-gradient(ellipse at center, transparent 35%, #052c2d50);
}
.journey-stage .chapter-marker {
  left: var(--chapter-x) !important;
  top: var(--chapter-y) !important;
  width: 100px;
  min-height: 72px;
  gap: 1px;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: #fff9df;
  padding: 2px;
  outline: none;
}
.journey-stage .chapter-marker:hover {
  background: #123c3e44;
}
.journey-stage .chapter-marker .chapter-crest {
  width: 40px;
  height: 40px;
  border: 2px solid #ffda89;
  border-radius: 12px;
  transform: rotate(5deg);
  background: linear-gradient(135deg, #326d66, #153e45);
  color: #fff0bb;
  box-shadow:
    0 3px 0 #123c3c,
    0 0 15px #ffc95e90;
  font-size: 19px;
}
.journey-stage .chapter-marker b {
  font-size: 13px;
  line-height: 1.4;
  white-space: nowrap;
  text-shadow:
    0 2px 3px #05252a,
    1px 0 3px #05252a,
    -1px 0 3px #05252a;
}
.journey-stage .chapter-marker small {
  display: block;
  color: #fff0bb;
  font-size: 10px;
  text-shadow: 0 1px 3px #05252a;
}
.journey-stage .chapter-marker.selected .chapter-crest {
  background: linear-gradient(135deg, #ffe59d, #d99533);
  color: #4d321a;
  box-shadow:
    0 0 0 4px #ffedb744,
    0 0 25px #ffd05b;
}
.journey-stage .chapter-marker.current .chapter-crest {
  border-color: #fff9db;
}
.journey-stage .chapter-marker.completed .chapter-crest {
  background: linear-gradient(135deg, #69baa2, #215b58);
}
.journey-stage .journey-trail .trail-wide {
  stroke: #ffdf91;
  stroke-width: 0.7;
  stroke-dasharray: 1 1.5;
  filter: drop-shadow(0 0 3px #fff0a4);
}
.journey-stage .journey-trail .trail-narrow {
  display: none;
}
.journey-stage .journey-gateway {
  right: 3%;
  bottom: 2%;
  min-height: 38px;
  grid-template-columns: 20px 1fr;
  padding: 4px 10px;
  background: #153f4ce8;
  color: #ffdf98;
  border-color: #dcb770;
  border-radius: 12px;
}
.journey-stage .journey-gateway small {
  display: none;
}
.journey-stage .journey-gateway span {
  font-size: 18px;
  grid-row: auto;
}
.journey-stage .journey-gateway b {
  font-size: 12px;
}
.chapter-billboard {
  position: relative;
  min-height: 180px;
  display: grid;
  grid-template-columns: minmax(100px, 40%) 1fr;
  align-items: center;
  gap: 10px;
  padding: 15px;
  border-radius: 20px;
  color: #fff1ce;
  background:
    radial-gradient(ellipse at 20% 50%, #688d6777, transparent 65%),
    linear-gradient(135deg, #183b3a, #314e42);
  overflow: hidden;
  border: 1px solid #b69156;
}
.chapter-billboard h2 {
  color: #ffe7a2;
  margin: 5px 0;
  font-size: 24px;
}
.chapter-billboard p {
  font-size: 13px;
  line-height: 1.6;
  color: #d4e8d3;
}
.chapter-billboard .eyebrow {
  color: #e9c884;
  font-size: 10px;
}
.chapter-billboard-art {
  height: 175px;
  min-width: 0;
  filter: drop-shadow(0 8px 12px #061d1a99);
}
.chapter-billboard-art .rpg-art {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}
.tactic-hint {
  display: block;
  font-size: 12px;
  color: #ffe5a3;
  line-height: 1.6;
}
.chapter-detail-heading {
  margin-top: 16px;
}
.journey-stop-art .grove-boss {
  object-fit: contain !important;
  width: 100%;
  height: 100%;
  transform: none !important;
}
.monster-art.grove-boss {
  object-fit: contain;
  object-position: center;
  max-width: 100%;
  max-height: 100%;
}
.creation-preview > .guardian-art {
  max-width: 100%;
  height: 290px;
  object-fit: contain;
}
.resistance-summary small {
  white-space: normal !important;
  line-height: 1.6;
}
@media (min-width: 1100px) {
  .journey-stage {
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 1fr);
  }
  .journey-stage .journey-world {
    height: 510px;
  }
}
@media (max-width: 700px) {
  .journey-stage .journey-world {
    height: 380px;
    min-height: 380px;
  }
  .journey-stage .chapter-marker {
    width: 76px;
    min-height: 66px;
  }
  .journey-stage .chapter-marker .chapter-crest {
    width: 34px;
    height: 34px;
    font-size: 16px;
  }
  .journey-stage .chapter-marker b {
    font-size: 11px;
  }
  .journey-stage .chapter-marker small {
    font-size: 9px;
  }
  .chapter-billboard {
    min-height: 150px;
    padding: 12px;
    grid-template-columns: 35% 1fr;
  }
  .chapter-billboard-art {
    height: 145px;
  }
  .chapter-billboard h2 {
    font-size: 21px;
  }
  .chapter-billboard p {
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .chapter-marker.current .chapter-crest {
    animation: grove-glow 2.8s ease-in-out infinite;
  }
  @keyframes grove-glow {
    50% {
      box-shadow:
        0 0 0 5px #ffe4a033,
        0 0 24px #ffc75a;
    }
  }
}
.dungeon-tactics {
  padding: 13px 16px;
  margin: 12px 0;
  border: 1px solid #a9c6ae;
  border-radius: 16px;
  background: #eaf3e8;
}
.dungeon-tactics p,
.dungeon-tactics small {
  font-size: 13px;
  line-height: 1.6;
  margin: 6px 0;
}
.gear-resistance {
  padding: 9px 12px;
  border-radius: 12px;
  background: #e2efe2;
  color: #365f4b;
  font-weight: 700;
}
@media (min-width: 701px) {
  .journey-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
  }
  .journey-shell > * {
    grid-column: 1/-1;
  }
  .journey-shell > .journey-heading {
    grid-column: 1;
    grid-row: 1;
    margin: 0;
  }
  .journey-shell > .journey-modes {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
    align-self: center;
  }
  .journey-shell > .journey-next {
    margin: 0;
    padding: 10px 16px;
    min-height: 64px;
  }
  .journey-heading h1 {
    font-size: 27px;
  }
  .journey-modes button {
    min-width: 110px;
  }
  .journey-stage .journey-world {
    height: 470px;
    min-height: 440px;
  }
}
@media (max-width: 700px) {
  .journey-heading {
    margin-bottom: 10px;
  }
  .journey-heading h1 {
    font-size: 25px;
  }
  .journey-modes {
    margin-bottom: 10px;
  }
  .journey-modes button {
    min-width: 0;
    flex: 1;
  }
  .journey-next {
    padding: 10px 12px;
    margin-bottom: 12px;
    gap: 8px;
  }
  .journey-next b {
    font-size: 15px;
  }
  .journey-next button {
    padding: 10px;
    white-space: nowrap;
    font-size: 13px;
  }
}
/* A readable illustrated camp, with a clear foreground for the next action. */
.home-hero {
  background:
    linear-gradient(90deg, #123b3aef 0%, #123b3ad9 43%, #123b3a18 100%),
    url('/assets/v9/world.webp') center 52% / cover;
  border-color: #c8a665;
  box-shadow: 0 12px 26px #1f453928;
}
.home-hero h1 {
  color: #ffedbc;
  text-shadow: 0 2px 8px #102d2b80;
}
.home-hero p,
.home-hero .eyebrow {
  color: #e2f2d9;
}
.home-hero .home-character {
  filter: drop-shadow(0 10px 16px #09272080);
}
body[data-mode='battle'] .mobile-combat .battlefield {
  background:
    linear-gradient(180deg, #f5f8e9fa 0%, #eff5e9d9 40%, #c4dac69c 100%),
    url('/assets/v9/world.webp') center/cover;
  border-color: #bfa46a;
}
@media (min-width: 900px) {
  .journey-stage .chapter-detail {
    padding: 14px;
  }
  .journey-stage .chapter-billboard {
    min-height: 145px;
    padding: 10px;
    gap: 9px;
  }
  .journey-stage .chapter-billboard-art {
    height: 125px;
  }
  .journey-stage .chapter-billboard h2 {
    font-size: 22px;
  }
  .journey-stage .chapter-billboard p {
    margin: 6px 0;
    font-size: 12px;
  }
  .journey-stage .chapter-detail-heading {
    margin-top: 10px;
  }
  .journey-stage .chapter-detail-heading h2 {
    font-size: 19px;
  }
  .journey-stage .chapter-detail-heading .eyebrow {
    font-size: 10px;
  }
  .journey-stage .chapter-stops {
    margin-top: 10px;
    gap: 7px;
  }
  .journey-stage .journey-stop {
    grid-template-columns: 52px minmax(0, 1fr);
    column-gap: 9px;
    padding: 7px;
    min-height: 70px;
  }
  .journey-stage .journey-stop-art {
    width: 52px;
    height: 52px;
  }
  .journey-stage .journey-stop em {
    margin-top: 0;
  }
}
@media (min-width: 900px) and (max-width: 1099px) and (min-height: 650px) {
  .journey-stage .journey-world {
    height: 440px;
  }
  .journey-stage .chapter-detail {
    padding: 12px;
  }
  .journey-stage .chapter-billboard {
    min-height: 120px;
  }
  .journey-stage .chapter-billboard-art {
    height: 105px;
  }
  .journey-stage .chapter-detail-heading h2 {
    line-height: 1.25;
  }
}
@media (min-width: 900px) and (max-width: 1099px) and (min-height: 650px) {
  .journey-stage .chapter-billboard p {
    display: none;
  }
}
/* V0.6: three quiet forest acts, one clear selected scene, no nested map scroller. */
.clean-journey .journey-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(330px, 1fr);
  gap: 18px;
  align-items: start;
}
.clean-journey .journey-stage .journey-world {
  height: 520px;
  min-height: 0;
  overflow: visible;
  background:
    linear-gradient(#f5f1fc18, #f7ffed12),
    url('/assets/v10/world.webp') center/cover;
  border: 1px solid #abc6bc;
  border-radius: 26px;
  box-shadow: 0 8px 24px #27483c12;
}
.clean-journey .journey-world:before,
.clean-journey .journey-world:after {
  display: none;
}
.clean-journey .world-act {
  position: absolute;
  left: 18px;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 1px;
  color: #315450;
  background: #fffffff0;
  padding: 5px 9px;
  border-radius: 20px;
  z-index: 2;
}
.clean-journey .act-1 {
  top: 65%;
}
.clean-journey .act-2 {
  top: 35%;
}
.clean-journey .act-3 {
  top: 5%;
}
.clean-journey .journey-stage .chapter-marker {
  left: var(--chapter-x);
  top: var(--chapter-y);
  width: 22%;
  max-width: 110px;
  padding: 5px 3px;
  min-width: 0;
  min-height: 84px;
  background: #fffffff2;
  box-shadow: 0 3px 7px #173f3920;
  border: 1px solid #d2ddd4;
  border-radius: 18px;
  color: #274d46;
  text-shadow: none;
  transform: translate(-50%, -50%);
  animation: none;
}
.clean-journey .journey-stage .chapter-marker:hover {
  transform: translate(-50%, -50%) translateY(-3px);
}
.clean-journey .journey-stage .chapter-marker .chapter-crest {
  width: 29px;
  height: 29px;
  border-radius: 50%;
  font-size: 14px;
  background: #e1ebe1;
  color: #315a4f;
  border: 0;
  box-shadow: none;
  animation: none;
}
.clean-journey .journey-stage .chapter-marker b {
  color: #274d46;
  text-shadow: none;
  display: block;
  font-size: 12px;
  line-height: 1.5;
  white-space: nowrap;
}
.clean-journey .journey-stage .chapter-marker small {
  color: #5d756a;
  font-size: 10px;
  text-shadow: none;
}
.clean-journey .journey-stage .chapter-marker.selected {
  outline: 3px solid #f8cd70;
  background: #fff8df;
  outline-offset: 2px;
  z-index: 4;
}
.clean-journey .journey-stage .chapter-marker.current .chapter-crest {
  background: #326b58;
  color: white;
  box-shadow: none;
  animation: none;
}
.clean-journey .journey-stage .chapter-marker.completed .chapter-crest {
  background: #d2ecdc;
  color: #246745;
}
.clean-journey .journey-stage .journey-trail .trail-wide {
  stroke: #fff5d7;
  stroke-width: 5;
  filter: none;
}
.clean-journey .journey-stage .journey-trail .trail-narrow {
  stroke: #a9ae84;
  stroke-width: 0.5;
  stroke-dasharray: 1 1;
  filter: none;
}
.clean-journey .journey-stage .chapter-detail {
  padding: 16px;
  border-radius: 24px;
  min-height: 520px;
  background: #fffdf7;
  border: 1px solid #d7dfd2;
  box-shadow: 0 8px 24px #27483c0d;
}
.chapter-story {
  padding: 19px 18px 21px;
  border-radius: 17px;
  background:
    linear-gradient(90deg, #fffdf4f5, #fffdf4e8 70%, #fffdf470),
    url('/assets/v10/glade.webp') center/cover;
}
.scene-roots .chapter-story {
  background-image:
    linear-gradient(90deg, #f2faf9f5, #f2faf9e8 70%, #f2faf970), url('/assets/v10/roots.webp');
}
.scene-canopy .chapter-story {
  background-image:
    linear-gradient(90deg, #f7f3fcf5, #f7f3fce8 70%, #f7f3fc70), url('/assets/v10/canopy.webp');
}
.chapter-story h2 {
  font-size: 24px;
  margin: 6px 0;
  color: #274c44;
}
.chapter-story p {
  font-size: 13px;
  line-height: 1.7;
  margin: 6px 0 10px;
  color: #516c60;
}
.chapter-story strong {
  font-size: 13px;
  color: #296751;
}
.clean-journey .journey-stage .chapter-stops {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 14px;
}
.clean-journey .journey-stage .journey-stop {
  display: flex;
  align-items: center;
  text-align: left;
  gap: 13px;
  width: 100%;
  padding: 10px 13px;
  min-height: 88px;
  border-radius: 18px;
  background: #f5f8f0;
  border: 1px solid #dbe4d4;
  box-shadow: none;
  color: #294e42;
}
.clean-journey .journey-stage .journey-stop.next {
  background: #fff6db;
  border-color: #dcb969;
}
.clean-journey .journey-stage .journey-stop.guardian,
.clean-journey .journey-stage .journey-stop.boss {
  background: #f0edf9;
  border-color: #d9d0e7;
}
.clean-journey .journey-stage .journey-stop-art {
  width: 78px;
  height: 78px;
  flex: 0 0 78px;
  background: #fffdf8;
  border-radius: 15px;
  position: relative;
  overflow: visible;
  grid-row: auto;
}
.clean-journey .journey-stage .journey-stop-art .rpg-art {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: none;
  filter: drop-shadow(0 4px 3px #27483c20);
}
.clean-journey .journey-stage .journey-stop-art i {
  position: absolute;
  bottom: 0;
  left: 0;
  top: auto;
  width: 23px;
  height: 23px;
  font-size: 11px;
  border: 2px solid #fffdf7;
  border-radius: 50%;
  background: #315d4e;
  color: white;
  display: grid;
  place-items: center;
  font-style: normal;
}
.stop-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.clean-journey .journey-stage .journey-stop b {
  font-size: 15px;
  line-height: 1.3;
}
.clean-journey .journey-stage .journey-stop small {
  font-size: 10px;
  color: #698072;
}
.stop-copy > span {
  font-size: 11px;
  color: #567263;
}
.clean-journey .journey-stage .journey-stop em {
  font-size: 11px;
  color: #386d55;
  margin: 0;
  font-style: normal;
}
.chapter-resolution {
  font-size: 11px;
  line-height: 1.7;
  color: #64806f;
  margin: 13px 3px 0;
}
.home-hero {
  background:
    linear-gradient(90deg, #163f3bed 0%, #163f3bdc 45%, #163f3b05 100%),
    url('/assets/v10/glade.webp') center/cover;
  border-color: #b2c5ae;
}
body[data-mode='battle'] .mobile-combat .battlefield {
  background:
    linear-gradient(#fcfff6ed, #f0f8edb5 36%, #f0f8ed20),
    url('/assets/v10/glade.webp') center/cover;
  border-color: #afc6b3;
}
body[data-mode='battle'] .mobile-combat .battlefield.scene-roots {
  background-image:
    linear-gradient(#f5fcfbed, #e7f4f2b5 36%, #e7f4f220), url('/assets/v10/roots.webp');
}
body[data-mode='battle'] .mobile-combat .battlefield.scene-canopy {
  background-image:
    linear-gradient(#fbf8ffed, #f0ebf9b5 36%, #f0ebf920), url('/assets/v10/canopy.webp');
}
.item-art {
  background-image: none !important;
}
.item-art > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 3px 4px #384c3925);
}
.gear-inspect .item-art {
  width: 150px;
  height: 150px;
  background: #f4f6ef;
  border-radius: 24px;
  padding: 6px;
}
.gear-collection-caption {
  font-size: 12px;
  color: #657c70;
  line-height: 1.7;
}
.scene-mission {
  border-radius: 10px;
  background: #fffbeb;
  border: 1px solid #e1d5a5;
  padding: 6px 9px;
  margin: 5px 0 7px;
  position: relative;
  z-index: 6;
}
.scene-mission > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.scene-mission b {
  font-size: 11px;
  line-height: 1.4;
}
.scene-mission small {
  font-size: 10px;
  color: #6c775b;
}
.mission-pips {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}
.mission-pips i {
  height: 4px;
  flex: 1;
  background: #e8e4ce;
  border-radius: 4px;
}
.mission-pips i.done {
  background: #4d956e;
}
.scene-mission details {
  position: absolute;
  right: 4px;
  top: 100%;
  z-index: 10;
}
.scene-mission summary {
  font-size: 9px;
  list-style: none;
  background: #fffbed;
  border: 1px solid #e1d5a5;
  border-radius: 0 0 7px 7px;
  padding: 2px 7px;
  cursor: pointer;
}
.scene-mission details[open] {
  width: min(270px, 85vw);
  background: #fffdf0;
  padding: 9px;
  border: 1px solid #d7cca3;
  border-radius: 10px;
  box-shadow: 0 8px 20px #27483c30;
}
.scene-mission details p {
  font-size: 12px;
  line-height: 1.7;
}
@media (max-width: 1099px) {
  .clean-journey .journey-stage {
    grid-template-columns: minmax(0, 1fr) minmax(290px, 0.95fr);
    gap: 12px;
  }
  .clean-journey .journey-stage .journey-world {
    height: 500px;
  }
  .clean-journey .journey-stage .chapter-detail {
    min-height: 500px;
    padding: 12px;
  }
  .chapter-story {
    padding: 14px;
  }
  .chapter-story h2 {
    font-size: 21px;
  }
  .clean-journey .journey-stage .journey-stop-art {
    width: 65px;
    height: 65px;
    flex-basis: 65px;
  }
  .clean-journey .journey-stage .journey-stop {
    min-height: 85px;
    padding: 8px;
    gap: 9px;
  }
  .clean-journey .journey-stage .chapter-marker b {
    font-size: 11px;
  }
}
@media (max-width: 899px) {
  .clean-journey .journey-stage {
    display: block;
  }
  .clean-journey .journey-stage .journey-world {
    height: 410px;
    min-height: 0;
  }
  .clean-journey .journey-stage .chapter-detail {
    min-height: 0;
    margin-top: 16px;
    padding: 14px;
  }
  .clean-journey .journey-stage .chapter-stops {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
  }
  .clean-journey .journey-stage .journey-stop {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    text-align: center;
    padding: 10px 6px;
  }
  .clean-journey .journey-stage .journey-stop-art {
    width: 90px;
    height: 90px;
    flex-basis: 90px;
  }
  .clean-journey .journey-stage .journey-stop b {
    font-size: 13px;
  }
}
@media (max-width: 500px) {
  .clean-journey .journey-stage .journey-world {
    height: 370px;
  }
  .clean-journey .world-act {
    left: 10px;
    font-size: 10px;
    padding: 4px 8px;
  }
  .clean-journey .journey-stage .chapter-marker {
    min-height: 74px;
    border-radius: 13px;
    padding: 4px 1px;
  }
  .clean-journey .journey-stage .chapter-marker b {
    font-size: 10px;
  }
  .clean-journey .journey-stage .chapter-marker .chapter-crest {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }
  .clean-journey .journey-stage .chapter-marker small {
    font-size: 9px;
  }
  .clean-journey .journey-stage .chapter-stops {
    grid-template-columns: 1fr;
  }
  .clean-journey .journey-stage .journey-stop {
    flex-direction: row;
    text-align: left;
    gap: 13px;
    padding: 10px 12px;
  }
  .clean-journey .journey-stage .journey-stop-art {
    width: 75px;
    height: 75px;
    flex-basis: 75px;
  }
  .clean-journey .journey-stage .journey-stop b {
    font-size: 15px;
  }
  .scene-mission {
    padding: 4px 6px;
    margin: 3px 0 5px;
  }
  .scene-mission b {
    font-size: 9px;
  }
  .scene-mission small {
    font-size: 9px;
  }
}
@media (max-height: 500px) {
  .scene-mission {
    padding: 3px 6px;
    margin: 2px 0;
  }
  .scene-mission b,
  .scene-mission small {
    font-size: 9px;
  }
  .mission-pips {
    margin-top: 2px;
  }
  .mission-pips i {
    height: 3px;
  }
}
/* Clear inherited card grid placement when the selected chapter uses portrait rows. */
.clean-journey .journey-stage .journey-stop {
  flex-direction: row;
}
.clean-journey .stop-copy > * {
  grid-column: 1;
  grid-row: auto;
}
@media (min-width: 501px) and (max-width: 899px) {
  .clean-journey .journey-stage .journey-stop {
    flex-direction: column;
  }
}
.clean-journey .journey-stage .stop-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.clean-journey .journey-stage .stop-copy > * {
  text-align: left;
  margin: 0;
}
@media (min-width: 501px) and (max-width: 899px) {
  .clean-journey .journey-stage .stop-copy {
    align-items: center;
  }
  .clean-journey .journey-stage .stop-copy > * {
    text-align: center;
  }
}
.region-loot-preview {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 10px 12px;
  background: #f5f4ed;
  border-radius: 16px;
  margin: 12px 0;
}
.region-loot-preview .item-art {
  width: 65px;
  height: 65px;
  flex: 0 0 65px;
}
.region-loot-preview > div {
  display: grid;
  gap: 5px;
}
.region-loot-preview small {
  font-size: 11px;
  color: #667c6d;
}
.encounter-guide {
  padding: 10px 12px;
  border: 1px solid #dce4d5;
  border-radius: 13px;
}
.encounter-guide summary {
  font-size: 12px;
  cursor: pointer;
  font-weight: 700;
}
.encounter-guide p {
  font-size: 12px;
  line-height: 1.8;
}
.mission-objective {
  font-size: 15px;
  font-weight: 700;
  color: #396b54;
}
.encounter-entry-actions {
  padding: 4px 0;
}
.clean-journey .journey-stage .journey-stop {
  max-width: none;
  filter: none;
  opacity: 1;
}
/* A single environment behind the whole battle; remove the old nested busy wallpaper. */
body[data-mode='battle'] .mobile-combat .battle-backdrop {
  background: none;
  box-shadow: none;
  border: 0;
}
body[data-mode='battle'] .mobile-combat .boss-panel .hp-caption {
  color: #3c5b52;
  background: #fbfff4d9;
  border-radius: 5px;
  padding: 2px 5px;
}
body[data-mode='battle'] .mobile-combat .battle-member > small {
  color: #3b594d;
}
/* V0.7: scene entrances instead of card grids; viewport-aware map stage. */
body[data-route='map'] #main {
  max-width: none;
  padding: 10px 18px;
}
body[data-route='map'] .journey-shell {
  max-width: 1440px;
  margin: 0 auto;
  gap: 8px;
}
body[data-route='map'] .journey-heading h1 {
  font-size: clamp(20px, 2vw, 28px);
  margin: 3px 0;
}
body[data-route='map'] .journey-heading .eyebrow {
  font-size: 10px;
}
body[data-route='map'] .journey-next {
  padding: 6px 12px;
  min-height: 48px;
  margin: 0;
  gap: 9px;
}
body[data-route='map'] .journey-next small {
  font-size: 10px;
}
body[data-route='map'] .journey-next b {
  font-size: 14px;
}
body[data-route='map'] .journey-next button {
  min-height: 36px;
  padding: 7px 15px;
  font-size: 13px;
}
.clean-journey .journey-stage .chapter-marker {
  background: none;
  border: 0;
  box-shadow: none;
  min-height: 0;
  padding: 0;
  outline: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  max-width: 115px;
}
.clean-journey .journey-stage .chapter-marker.selected {
  background: none;
  outline: 0;
}
.region-landmark {
  width: clamp(55px, 7vw, 92px);
  height: clamp(45px, 6.5vw, 78px);
  object-fit: contain;
  filter: drop-shadow(0 4px 3px #254e4035);
  pointer-events: none;
}
.clean-journey .journey-stage .chapter-marker b {
  background: #fffdf2ef;
  border: 1px solid #c3d2bf;
  padding: 3px 7px;
  border-radius: 9px;
  font-size: 11px;
  line-height: 1.2;
}
.clean-journey .journey-stage .chapter-marker small {
  background: #fffdf2d9;
  border-radius: 0 0 6px 6px;
  padding: 0 5px 2px;
  font-size: 9px;
}
.clean-journey .journey-stage .chapter-marker .chapter-crest {
  position: absolute;
  left: 12%;
  top: 0;
  width: 22px;
  height: 22px;
  border: 2px solid #fff8e3;
  background: #436f5a;
  color: #fffdf5;
  font-size: 10px;
  z-index: 2;
}
.clean-journey .journey-stage .chapter-marker.selected .region-landmark {
  filter: drop-shadow(0 0 6px #ffe59a) drop-shadow(0 3px 2px #76623960);
}
.clean-journey .journey-stage .chapter-marker.selected b {
  background: #fff1bb;
  border-color: #c9a357;
}
.clean-journey .journey-stage .journey-trail .trail-wide {
  stroke-width: 2.1;
  stroke: #fff4d7;
  opacity: 0.78;
}
.clean-journey .journey-stage .journey-trail .trail-narrow {
  stroke-width: 0.3;
}
.clean-journey .journey-stage .chapter-detail {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  padding: 10px;
  background: #fffdf7;
}
.clean-journey .chapter-story {
  padding: 10px 12px;
  background: #fffdf5;
  flex: 0 0 auto;
}
.clean-journey .chapter-story h2 {
  font-size: clamp(18px, 1.7vw, 23px);
  margin: 3px 0;
}
.clean-journey .chapter-story p {
  margin: 4px 0;
  font-size: 12px;
  line-height: 1.5;
}
.clean-journey .chapter-story strong {
  font-size: 12px;
  line-height: 1.4;
}
.chapter-encounter-scene {
  flex: 1;
  position: relative;
  min-height: 250px;
  border: 1px solid #cddac3;
  border-radius: 19px;
  background: url('/assets/v10/glade.webp') center/cover;
  isolation: isolate;
}
.scene-roots .chapter-encounter-scene {
  background-image: url('/assets/v10/roots.webp');
}
.scene-canopy .chapter-encounter-scene {
  background-image: url('/assets/v10/canopy.webp');
}
.scene-landmark {
  position: absolute;
  right: 8%;
  top: 0;
  width: 48%;
  height: 58%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 5px 3px #1a493329);
}
.chapter-encounter-scene:after {
  content: '';
  position: absolute;
  left: 17%;
  right: 17%;
  bottom: 25%;
  height: 23%;
  border: 4px dashed #fff8d4;
  border-top: 0;
  border-radius: 0 0 50% 50%;
  z-index: -1;
  opacity: 0.9;
}
.clean-journey .journey-stage .chapter-stops {
  display: block;
  position: absolute;
  inset: 0;
  margin: 0;
}
.clean-journey .journey-stage .journey-stop {
  position: absolute;
  bottom: 5%;
  left: 2%;
  width: 32%;
  height: 58%;
  max-height: 180px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 3px;
  background: none !important;
  border: 0;
  box-shadow: none;
  align-items: center;
  justify-content: flex-end;
}
.clean-journey .journey-stage .journey-stop:nth-child(2) {
  left: 34%;
  bottom: 18%;
}
.clean-journey .journey-stage .journey-stop:nth-child(3) {
  left: 66%;
  bottom: 5%;
}
.clean-journey .journey-stage .journey-stop-art {
  width: clamp(56px, 7vw, 96px);
  height: clamp(56px, 7vw, 96px);
  flex: 0 1 96px;
  background: #fffdf0b0;
  border: 2px solid #f9eaca;
  border-radius: 50%;
  box-shadow: 0 5px 8px #22463126;
}
.clean-journey .journey-stage .journey-stop.next .journey-stop-art {
  border-color: #f5cc59;
  box-shadow:
    0 0 0 4px #fff1a350,
    0 5px 9px #22463135;
}
.clean-journey .journey-stage .stop-copy {
  flex: 0 0 auto;
  align-items: center;
  gap: 2px;
  padding: 4px 5px;
  background: #fffef3f2;
  border-radius: 11px;
  box-shadow: 0 3px 6px #2045331a;
}
.clean-journey .journey-stage .stop-copy > * {
  text-align: center;
}
.clean-journey .journey-stage .stop-copy > span {
  display: none;
}
.clean-journey .journey-stage .journey-stop b {
  font-size: 12px;
  line-height: 1.3;
}
.clean-journey .journey-stage .journey-stop small {
  font-size: 9px;
}
.clean-journey .journey-stage .journey-stop em {
  font-size: 10px;
}
.clean-journey .chapter-resolution {
  margin: 0 4px;
  font-size: 10px;
  line-height: 1.4;
  flex: 0 0 auto;
}
@media (min-width: 900px) and (min-height: 560px) {
  body[data-route='map'] #main {
    overflow: hidden;
  }
  body[data-route='map'] .clean-journey {
    height: var(--journey-height, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 8px;
  }
  body[data-route='map'] .clean-journey > .journey-stage {
    min-height: 0;
    grid-row: 3;
  }
  body[data-route='map'] .clean-journey .journey-stage .journey-world {
    height: 100%;
    min-height: 0;
  }
  body[data-route='map'] .clean-journey .journey-stage .chapter-detail {
    height: 100%;
    min-height: 0;
  }
  body[data-route='map'] .chapter-encounter-scene {
    min-height: 0;
  }
}
.dungeon-journey .dungeon-landing {
  min-height: 70px;
  padding: 10px 16px;
  background: #f3f7e9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dungeon-landing-art > img {
  width: 85px;
  height: 65px;
  object-fit: contain;
}
.dungeon-journey .dungeon-landing h2 {
  font-size: 20px;
  margin: 3px 0;
}
.dungeon-journey .dungeon-landing p {
  font-size: 12px;
  margin: 3px 0;
}
.dungeon-environment {
  min-height: 320px;
  position: relative;
  overflow: hidden;
  border: 1px solid #bfd2bb;
  border-radius: 24px;
  background: url('/assets/v10/glade.webp') center/cover;
  display: flex;
  align-items: end;
  padding: 40px 18px 16px;
}
.dungeon-environment.scene-math {
  background-image: url('/assets/v10/roots.webp');
}
.dungeon-environment.scene-en {
  background-image: url('/assets/v10/canopy.webp');
}
.dungeon-scene-title {
  position: absolute;
  top: 12px;
  left: 16px;
  background: #fffdf1e8;
  border-radius: 14px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 800;
  color: #385c4d;
}
.dungeon-journey .dungeon-doors {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}
.dungeon-journey .dungeon-door {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  background: none;
  border: 0;
  box-shadow: none;
  padding: 3px;
  min-height: 0;
  text-align: center;
  color: #315744;
}
.dungeon-journey .dungeon-door-art {
  width: 100%;
  height: 150px;
  background: none;
}
.dungeon-door-art > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 5px 5px #203c3550);
}
.dungeon-journey .dungeon-door > span:nth-child(2) {
  background: #fffdf3eb;
  border-radius: 11px;
  padding: 7px 8px;
  min-height: 65px;
  display: grid;
  gap: 4px;
  align-content: center;
  width: 100%;
}
.dungeon-journey .dungeon-door b {
  font-size: 13px;
}
.dungeon-journey .dungeon-door small {
  font-size: 10px;
  line-height: 1.4;
}
.dungeon-journey .dungeon-door i {
  background: #fffdf0df;
  border-radius: 8px;
  padding: 3px 8px;
  font-size: 11px;
}
@media (min-width: 900px) and (min-height: 560px) {
  body[data-route='map'] .dungeon-journey {
    height: var(--journey-height);
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
    gap: 6px;
  }
  body[data-route='map'] .dungeon-environment {
    min-height: 0;
    height: 100%;
    grid-row: 4;
    padding-top: 30px;
  }
  body[data-route='map'] .dungeon-journey > p.tiny {
    display: none;
  }
  .dungeon-journey .dungeon-door-art {
    height: clamp(80px, 20vh, 170px);
  }
}
@media (max-width: 899px) {
  .clean-journey .journey-stage .journey-world {
    height: 330px;
  }
  .clean-journey .journey-stage .chapter-detail {
    height: 410px;
    margin-top: 10px;
  }
  .clean-journey .journey-stage .journey-stop-art {
    width: 70px;
    height: 70px;
    flex-basis: 70px;
  }
  .region-landmark {
    width: 65px;
    height: 58px;
  }
  .dungeon-journey .dungeon-doors {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .dungeon-environment {
    min-height: 480px;
  }
  .dungeon-journey .dungeon-door-art {
    height: 120px;
  }
}
.quality-common {
  --quality: #dde1d7;
}
.quality-uncommon {
  --quality: #559ae6;
}
.quality-rare {
  --quality: #d9b839;
}
.quality-epic {
  --quality: #ac7bdd;
}
.quality-legendary {
  --quality: #ef943e;
}
.item-art.quality-uncommon {
  border-color: #559ae6;
}
.item-art.quality-rare {
  border-color: #d9b839;
}
.item-art.quality-legendary {
  border-color: #ef943e;
}
.set-art,
.set-gear .item-art {
  border-color: #53b57b !important;
  background-color: #e8f4e8 !important;
}
.spell-art > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.set-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 18px 0 10px;
}
.set-selector button {
  min-height: 39px;
  padding: 8px 12px;
  font-size: 12px;
}
.relic-lore {
  padding: 12px 16px;
  border-left: 3px solid #dba65a;
  background: #fbf1dd;
  border-radius: 0 13px 13px 0;
  font-size: 13px;
  line-height: 1.8;
  color: #785d39;
}
.journey-view-tabs {
  display: none;
}
@media (max-width: 600px) and (min-height: 500px) {
  body[data-route='map'] #main {
    overflow: hidden;
    padding: 8px 10px;
  }
  body[data-route='map'] .clean-journey {
    height: var(--journey-height, 100%);
    display: flex;
    flex-direction: column;
    gap: 7px;
  }
  body[data-route='map'] .clean-journey > .journey-heading {
    margin: 0;
    flex: 0 0 auto;
  }
  body[data-route='map'] .journey-heading h1 {
    font-size: 20px;
  }
  body[data-route='map'] .journey-heading .eyebrow {
    display: none;
  }
  body[data-route='map'] .clean-journey > .journey-modes {
    margin: 0;
    display: flex;
    gap: 5px;
  }
  body[data-route='map'] .journey-modes button {
    padding: 7px 9px;
    min-height: 36px;
    font-size: 12px;
  }
  body[data-route='map'] .clean-journey > .journey-next {
    min-height: 45px;
    padding: 6px 9px;
    flex: 0 0 auto;
  }
  body[data-route='map'] .journey-next b {
    font-size: 12px;
  }
  .journey-next small {
    font-size: 9px;
  }
  .journey-view-tabs {
    display: flex;
    gap: 5px;
    flex: 0 0 auto;
  }
  .journey-view-tabs button {
    flex: 1;
    min-height: 32px;
    font-size: 11px;
    padding: 5px 8px;
  }
  body[data-route='map'] .clean-journey > .journey-stage {
    flex: 1;
    min-height: 0;
    display: block;
  }
  body[data-route='map'] .clean-journey .journey-stage .journey-world {
    height: 100%;
    min-height: 0;
  }
  body[data-route='map'] .clean-journey .journey-stage .chapter-detail {
    height: 100%;
    margin: 0;
    min-height: 0;
  }
  body[data-route='map'] .clean-journey.view-world .chapter-detail {
    display: none;
  }
  body[data-route='map'] .clean-journey.view-scene .journey-world {
    display: none;
  }
  body[data-route='map'] .chapter-encounter-scene {
    min-height: 0;
  }
  .region-landmark {
    width: 63px;
    height: 60px;
  }
  .clean-journey .journey-stage .chapter-marker b {
    font-size: 10px;
  }
  .clean-journey .journey-stage .journey-stop-art {
    width: 61px;
    height: 61px;
    flex-basis: 61px;
  }
  .clean-journey .journey-stage .journey-stop b {
    font-size: 11px;
  }
  body[data-route='map'] .dungeon-journey {
    height: var(--journey-height);
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .dungeon-journey .journey-heading {
    margin: 0;
  }
  .dungeon-journey .journey-modes {
    margin: 0;
  }
  .dungeon-journey .dungeon-landing {
    min-height: 0;
    padding: 5px 10px;
  }
  .dungeon-journey .dungeon-landing h2 {
    font-size: 16px;
  }
  .dungeon-journey .dungeon-landing p,
  .dungeon-journey .dungeon-landing .eyebrow {
    display: none;
  }
  .dungeon-landing-art > img {
    height: 38px;
    width: 55px;
  }
  .dungeon-journey .dungeon-subjects {
    margin: 0;
    gap: 5px;
  }
  .dungeon-journey .dungeon-subjects button {
    padding: 5px 9px;
    min-height: 31px;
  }
  .dungeon-environment {
    flex: 1;
    min-height: 0;
    padding: 27px 10px 8px;
  }
  .dungeon-journey .dungeon-doors {
    height: 100%;
    gap: 5px;
    grid-template-rows: repeat(2, minmax(0, 1fr));
  }
  .dungeon-journey .dungeon-door-art {
    height: clamp(38px, 8vh, 75px);
  }
  .dungeon-journey .dungeon-door > span:nth-child(2) {
    min-height: 43px;
    padding: 4px;
  }
  .dungeon-journey .dungeon-door b {
    font-size: 10px;
  }
  .dungeon-journey .dungeon-door small {
    font-size: 9px;
  }
  .dungeon-journey .dungeon-door i {
    display: none;
  }
  .dungeon-journey .dungeon-pages {
    margin: 0;
  }
  .dungeon-journey .dungeon-pages button {
    min-height: 32px;
    padding: 5px 9px;
    font-size: 11px;
  }
  .dungeon-journey > p.tiny {
    display: none;
  }
}
.legendary-library {
  margin-top: 16px;
}
.legendary-library > summary {
  font-weight: 800;
  color: #976128;
  cursor: pointer;
}
.legendary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 10px;
  margin-top: 15px;
}
.legendary-grid button {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fff9eb;
  border: 1px solid #dfbf81;
  border-radius: 16px;
  color: #72542c;
  padding: 10px;
}
.legendary-grid img {
  width: 86px;
  height: 86px;
  object-fit: contain;
}
.legendary-grid b {
  font-size: 13px;
}
.legendary-grid small {
  font-size: 10px;
  color: #9c845e;
}
.clean-journey .journey-stage .journey-stop-art {
  flex: 0 0 auto;
  aspect-ratio: 1;
  height: clamp(56px, 7vw, 82px);
  width: clamp(56px, 7vw, 82px);
}
@media (min-width: 601px) and (max-width: 899px) and (min-height: 800px) {
  body[data-route='map'] .clean-journey {
    height: var(--journey-height);
    display: flex;
    flex-direction: column;
    gap: 7px;
  }
  .clean-journey > .journey-stage {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 9px;
  }
  .clean-journey .journey-stage .journey-world {
    height: 100%;
    min-height: 0;
  }
  .clean-journey .journey-stage .chapter-detail {
    height: 100%;
    min-height: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 35% 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 8px;
  }
  .clean-journey .chapter-encounter-scene {
    min-height: 0;
  }
  .clean-journey .chapter-resolution {
    grid-column: 1/-1;
  }
  .clean-journey .chapter-story {
    align-self: center;
  }
  .clean-journey .chapter-story p {
    font-size: 12px;
  }
  .clean-journey .chapter-story h2 {
    font-size: 21px;
  }
}
@media (min-width: 700px) and (max-height: 559px) {
  body[data-route='map'] #main {
    overflow: hidden;
    padding: 4px 10px;
  }
  body[data-route='map'] .clean-journey {
    height: var(--journey-height);
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: 30px 32px minmax(0, 1fr);
    gap: 4px;
  }
  .journey-heading .eyebrow {
    display: none;
  }
  body[data-route='map'] .journey-heading h1 {
    font-size: 17px;
    margin: 0;
  }
  .journey-progress {
    font-size: 20px;
  }
  .journey-modes {
    margin: 0 !important;
  }
  .journey-modes button {
    min-height: 27px;
    padding: 3px 9px;
    font-size: 11px;
  }
  body[data-route='map'] .journey-next {
    min-height: 30px;
    padding: 2px 8px;
  }
  body[data-route='map'] .journey-next small {
    display: none;
  }
  body[data-route='map'] .journey-next button {
    min-height: 25px;
    padding: 3px 9px;
    font-size: 11px;
  }
  .clean-journey > .journey-stage {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    min-height: 0;
  }
  .clean-journey .journey-stage .journey-world {
    height: 100%;
    min-height: 0;
  }
  .clean-journey .journey-stage .chapter-detail {
    height: 100%;
    margin: 0;
    padding: 4px;
    min-height: 0;
    gap: 3px;
  }
  .clean-journey .chapter-story {
    padding: 3px 7px;
  }
  .clean-journey .chapter-story .eyebrow,
  .clean-journey .chapter-story p {
    display: none;
  }
  .clean-journey .chapter-story h2 {
    font-size: 14px;
    margin: 1px 0;
  }
  .clean-journey .chapter-story strong {
    font-size: 10px;
  }
  .chapter-encounter-scene {
    min-height: 0;
  }
  .clean-journey .chapter-resolution {
    display: none;
  }
  .region-landmark {
    width: 40px;
    height: 31px;
  }
  .clean-journey .journey-stage .chapter-marker b {
    font-size: 8px;
    padding: 1px 4px;
  }
  .clean-journey .journey-stage .chapter-marker small {
    display: none;
  }
  .clean-journey .journey-stage .chapter-marker .chapter-crest {
    width: 15px;
    height: 15px;
    font-size: 8px;
    top: -3px;
    left: 14%;
  }
  .clean-journey .world-act {
    font-size: 8px;
    padding: 2px 5px;
    top: auto;
  }
  .clean-journey .world-act.act-1 {
    top: 67%;
  }
  .clean-journey .world-act.act-2 {
    top: 34%;
  }
  .clean-journey .world-act.act-3 {
    top: 1%;
  }
  .clean-journey .journey-stage .journey-stop-art {
    width: 41px;
    height: 41px;
  }
  .clean-journey .journey-stage .journey-stop b {
    font-size: 9px;
  }
  .clean-journey .journey-stage .journey-stop small {
    font-size: 8px;
  }
  .clean-journey .journey-stage .journey-stop em {
    display: none;
  }
  .clean-journey .journey-stage .stop-copy {
    padding: 2px 4px;
  }
  .clean-journey .journey-stage .journey-stop {
    max-height: 110px;
    height: 72%;
  }
}
.dungeon-journey .dungeon-landing-art {
  height: 54px;
  width: 74px;
  flex: 0 0 74px;
}
.dungeon-journey .dungeon-landing-art > img {
  height: 54px;
  width: 74px;
}
.dungeon-journey .dungeon-landing {
  padding: 6px 12px;
  min-height: 0;
}
.dungeon-journey .dungeon-landing .eyebrow {
  display: none;
}
.dungeon-journey .dungeon-subjects {
  margin: 0;
  gap: 7px;
}
.dungeon-journey .dungeon-subjects button {
  min-height: 33px;
  padding: 6px 13px;
  font-size: 12px;
}
.dungeon-journey .dungeon-door.locked {
  filter: none;
  opacity: 1;
}
.dungeon-journey .dungeon-door-art {
  overflow: visible;
}
.dungeon-journey .dungeon-door-art > img {
  object-position: center bottom;
}
.quality-common {
  color: #687366;
}
.quality-uncommon {
  color: #377fc3;
}
.quality-rare {
  color: #9c7a15;
}
.quality-epic {
  color: #9870c8;
}
.quality-legendary {
  color: #bb7326;
}
.item-art {
  background-color: #fffdf1;
}
.item-art.quality-uncommon {
  box-shadow: 0 0 10px #70ace025;
}
.item-art.quality-rare {
  box-shadow: 0 0 11px #dabe4530;
}
.set-gear {
  color: #318b57;
}
@media (min-width: 700px) and (max-height: 559px) {
  body[data-route='map'] .dungeon-journey {
    height: var(--journey-height);
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: 30px 30px minmax(0, 1fr) 28px;
    gap: 4px;
  }
  .dungeon-journey .dungeon-landing,
  .dungeon-journey > p.tiny {
    display: none;
  }
  .dungeon-journey .dungeon-subjects {
    grid-row: 2;
  }
  .dungeon-journey .dungeon-subjects button {
    min-height: 26px;
    padding: 3px 10px;
  }
  .dungeon-journey .dungeon-environment {
    grid-row: 3;
    min-height: 0;
    height: 100%;
    padding: 22px 8px 3px;
  }
  .dungeon-journey .dungeon-doors {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    height: 100%;
    gap: 6px;
  }
  .dungeon-journey .dungeon-door-art {
    height: clamp(28px, 13vh, 60px);
  }
  .dungeon-journey .dungeon-door > span:nth-child(2) {
    min-height: 34px;
    padding: 3px 5px;
    gap: 1px;
  }
  .dungeon-journey .dungeon-door b {
    font-size: 10px;
  }
  .dungeon-journey .dungeon-door small {
    font-size: 8px;
  }
  .dungeon-journey .dungeon-door i {
    display: none;
  }
  .dungeon-journey .dungeon-pages {
    grid-row: 4;
    margin: 0;
  }
  .dungeon-journey .dungeon-pages button {
    min-height: 25px;
    font-size: 10px;
    padding: 3px 8px;
  }
  .dungeon-scene-title {
    font-size: 9px;
    top: 4px;
    padding: 3px 7px;
  }
}
.item-art.quality-common {
  border-color: #e1e4dc;
  box-shadow: none;
}
.game-modal .set-ultimate-hero {
  float: right;
  width: 70px;
  height: 70px;
  margin: 0 0 5px 10px;
}
.game-modal .set-ultimate-hero > img {
  width: 70px;
  height: 70px;
  object-fit: contain;
}
.game-modal:has(.set-preview-stage) {
  padding: 20px;
}
.game-modal:has(.set-preview-stage) > p {
  font-size: 12px;
  line-height: 1.6;
  margin: 8px 0;
}
.game-modal .set-preview-stage {
  height: clamp(170px, 29vh, 250px);
  min-height: 0;
  margin-top: 10px;
}
.game-modal:has(.set-preview-stage) .hint {
  font-size: 12px;
  line-height: 1.6;
  padding: 10px;
}
.game-modal:has(.set-preview-stage) h2 {
  font-size: 23px;
  margin: 5px 0;
}
/* V0.8: compact, inspectable status row and one clear learning trail. */
.combat-status-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 0;
  max-width: 100%;
  padding: 2px 0;
  flex-shrink: 0;
}
.combat-status-strip:empty {
  display: none;
}
.status-token,
.status-overflow {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  min-height: 26px;
  width: 26px;
  height: 26px;
  padding: 2px;
  border-radius: 8px;
  background: #eaf5df;
  border: 1px solid #97bfa0;
  box-shadow: none;
  font-size: 15px;
  color: #285c43;
}
.status-token.negative {
  background: #f7e5e5;
  border-color: #d3a1a6;
  color: #79444f;
}
.status-token sup {
  font-size: 9px;
  position: absolute;
  right: 0;
  bottom: 0;
  border-radius: 3px;
  background: #fff;
  padding: 0 2px;
  line-height: 11px;
}
.status-overflow {
  font-size: 10px;
}
.status-detail-list {
  display: grid;
  gap: 8px;
}
.status-detail {
  padding: 12px;
  border: 1px solid #c6d6ba;
  background: #f0f6e8;
  border-radius: 14px;
}
.status-detail.negative {
  background: #fff0ec;
  border-color: #ebc3b8;
}
.status-detail small {
  display: block;
}
.notebook-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.learning-counts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.learning-counts span {
  display: grid;
  text-align: center;
  background: #f1f5e9;
  border-radius: 14px;
  padding: 14px 8px;
  font-size: 12px;
}
.learning-counts b {
  font-size: 27px;
}
.learning-report h2 {
  margin-top: 18px;
}
.learning-patterns,
.notebook-list {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}
.learning-pattern {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid #dce3ca;
}
.learning-pattern summary {
  cursor: pointer;
}
.learning-pattern summary small {
  display: block;
}
.learning-pattern pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
  font-size: 13px;
  background: #f6f5e9;
  border-radius: 12px;
  padding: 12px;
}
.mistake-card h3 {
  font-size: 17px;
  margin: 14px 0 8px;
}
.mistake-card details {
  border-top: 1px solid #e1e5d3;
  padding-top: 12px;
}
.mistake-card details summary {
  cursor: pointer;
  font-weight: 700;
  color: #346954;
  min-height: 32px;
}
.solution-answer {
  padding: 10px;
  background: #ecf4e6;
  border-radius: 10px;
}
.notebook-entry {
  margin: 12px 0;
}
.loot-rates {
  margin: 12px 0;
}
.loot-rates .pill {
  display: inline-block;
  margin: 3px;
}
.battle-member .combat-status-strip {
  position: relative;
  z-index: 2;
}
.boss-panel .combat-status-strip {
  justify-content: flex-start;
}
@media (max-width: 600px) {
  .status-token,
  .status-overflow {
    width: 24px;
    min-width: 24px;
    min-height: 24px;
    height: 24px;
    font-size: 13px;
  }
  .combat-status-strip {
    gap: 2px;
  }
  .learning-report,
  .mistake-card {
    padding: 16px;
  }
  .learning-counts b {
    font-size: 24px;
  }
  .notebook-toolbar button {
    padding: 8px 12px;
    min-height: 40px;
  }
}
.status-cluster {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  min-height: 28px;
  padding: 0 2px;
  background: transparent;
  border: 0;
  box-shadow: none;
  max-width: 100%;
  border-radius: 8px;
}
.status-cluster:hover {
  transform: none;
  background: #ffffff80;
}
.status-cluster:focus-visible {
  outline: 3px solid #d2b360;
  outline-offset: 1px;
}
.status-cluster .status-token {
  flex-shrink: 0;
}
.status-cluster .status-overflow {
  min-width: 17px;
  width: 17px;
  border: 0;
  background: #fff9;
  font-size: 9px;
}
.boss-panel > .combat-status-strip {
  margin: 0;
}
@media (max-width: 700px) and (min-height: 600px) {
  body[data-mode='battle'] .mobile-combat {
    grid-template-rows: clamp(200px, 27dvh, 248px) minmax(0, 1fr);
  }
  body[data-mode='battle'] .mobile-combat .boss-panel {
    position: relative;
  }
  body[data-mode='battle'] .mobile-combat .boss-panel > .combat-status-strip {
    position: absolute;
    top: 0;
    right: 54px;
    max-width: 90px;
    padding: 0;
  }
  body[data-mode='battle'] .mobile-combat .boss-panel h2 {
    max-width: calc(100% - 150px);
  }
  body[data-mode='battle'] .mobile-combat .battle-member {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    min-height: 0;
    overflow: hidden;
  }
  body[data-mode='battle'] .mobile-combat .battle-members {
    grid-auto-rows: minmax(0, 1fr);
  }
  body[data-mode='battle'] .mobile-combat .battle-member .combat-status-strip {
    padding: 0;
    margin-top: 1px;
    min-height: 26px;
  }
  body[data-mode='battle'] .mobile-combat .status-cluster {
    gap: 2px;
    min-height: 26px;
    padding: 0;
  }
  body[data-mode='battle'] .mobile-combat .status-token {
    width: 22px;
    min-width: 22px;
    height: 24px;
    min-height: 24px;
    font-size: 12px;
  }
  body[data-mode='battle'] .mobile-combat .status-overflow {
    min-width: 14px;
    width: 14px;
  }
  body[data-mode='battle'] .mobile-combat .battle-member .member-art {
    height: 22px;
    flex-shrink: 0;
  }
  body[data-mode='battle'] .mobile-combat .battle-member b {
    line-height: 10px;
    min-height: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  body[data-mode='battle'] .mobile-combat .battle-member .meter {
    flex-shrink: 0;
    height: 3px;
    margin: 1px 0;
  }
}
@media (max-width: 700px) and (min-height: 600px) {
  body[data-mode='battle'] .mobile-combat .boss-panel .row.spread > div:first-child {
    min-width: 0;
    flex: 1;
  }
  body[data-mode='battle'] .mobile-combat .boss-panel h2 {
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
.live-spell-label {
  pointer-events: none;
}
@media (max-width: 700px) and (min-height: 600px) {
  body[data-mode='battle'] .mobile-combat .boss-panel > .combat-status-strip {
    right: 90px;
  }
}

/* Effect captions are an overlay. Text and status updates never consume sprite space. */
body[data-mode='battle'] .mobile-combat .live-spell-label {
  position: absolute;
  left: 12px;
  right: 12px;
  top: auto;
  height: 34px;
  min-height: 0;
  margin: 0;
  padding: 4px 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1.3;
  z-index: 12;
  text-wrap: balance;
  text-shadow: 0 1px 3px #fff;
}
.fallen-actions {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  min-height: 100%;
  text-align: center;
  padding: 16px;
}
.fallen-actions > span:first-child {
  font-size: 36px;
  color: #779a8a;
}
.fallen-actions h3,
.fallen-actions p {
  margin: 0;
}
.fallen-actions button {
  width: min(100%, 290px);
  min-height: 44px;
}

@media (min-width: 701px) and (min-height: 600px) {
  body[data-mode='battle'] .mobile-combat .boss-panel {
    flex: 0 0 86px;
    min-height: 86px;
    max-height: 86px;
    overflow: hidden;
  }
  body[data-mode='battle'] .mobile-combat .monster-intent {
    flex: 0 0 52px;
    height: 52px;
    min-height: 52px;
    max-height: 52px;
    overflow: auto;
  }
  body[data-mode='battle'] .mobile-combat .battle-members {
    flex: 0 0 144px;
    height: 144px;
    min-height: 144px;
    max-height: 144px;
  }
  body[data-mode='battle'] .mobile-combat .battle-member {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }
  body[data-mode='battle'] .mobile-combat .counter-plan,
  body[data-mode='battle'] .mobile-combat .counter-failed-note {
    position: absolute;
    left: 18px;
    right: 18px;
    top: 150px;
    z-index: 10;
    margin: 0;
  }
}
@media (max-width: 700px) and (min-height: 600px) {
  body[data-mode='battle'] .mobile-combat .battlefield {
    grid-template-rows: 52px 24px minmax(0, 1fr);
  }
  body[data-mode='battle'] .mobile-combat .boss-panel {
    height: 52px;
    min-height: 52px;
    max-height: 52px;
    overflow: hidden;
  }
  body[data-mode='battle'] .mobile-combat .live-spell-label {
    left: 8px;
    right: auto;
    width: 43%;
    bottom: 8px;
    height: 30px;
    font-size: 10px;
    line-height: 1.1;
  }
}
body[data-mode='battle'] .boss-art {
  animation: boss-drift-stable 4s ease-in-out infinite;
}
@keyframes boss-drift-stable {
  50% {
    transform: translateY(-3px);
  }
}

/* Long language tasks use reading typography; arithmetic display sizing is inappropriate here. */
body[data-mode='learning'] .training-quest {
  padding: 14px 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
}
body[data-mode='learning'] .training-companion {
  grid-column: 1;
  grid-row: 1;
  padding: 0;
  border: 0;
  gap: 6px;
  font-size: 11px;
}
body[data-mode='learning'] .training-companion .question-portrait {
  width: 36px;
  height: 40px;
  flex: 0 0 36px;
}
body[data-mode='learning'] .training-progress {
  grid-column: 2;
  grid-row: 1;
  gap: 5px;
  margin: 0;
  align-items: center;
}
body[data-mode='learning'] .training-progress i {
  width: 24px;
  height: 26px;
  font-size: 12px;
}
body[data-mode='learning'] .training-clock {
  grid-column: 3;
  grid-row: 1;
  position: static;
  margin: 0;
  align-self: center;
  font-size: 11px;
}
body[data-mode='learning'] #trainingQuestionForm,
body[data-mode='learning'] .training-quest > .learning-hint,
body[data-mode='learning'] .training-quest > .feedback,
body[data-mode='learning'] .training-quest > .tiny,
body[data-mode='learning'] .training-exit {
  grid-column: 1 / -1;
  margin: 0;
}
body[data-mode='learning'] .training-quest .lq-question {
  gap: 8px;
}
body[data-mode='learning'] .training-quest .lq-prompt {
  font-size: 15px;
  line-height: 1.45;
  margin: 4px 0;
}
body[data-mode='learning'] .training-quest .lq-workout .lq-expression {
  font-size: 18px;
  line-height: 1.5;
  padding: 12px;
  text-align: left;
  margin: 4px 0;
  font-weight: 600;
}
body[data-mode='learning'] .training-quest .lq-field-options .lq-choice {
  font-size: 15px;
  line-height: 1.4;
  padding: 8px;
}
body[data-mode='learning'] .training-quest .lq-submit {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin-top: 2px;
}
@media (max-width: 700px) {
  body[data-mode='learning'] main > .heading {
    margin: 0 0 10px;
  }
  body[data-mode='learning'] main > .heading h1 {
    font-size: 20px;
    margin: 4px 0;
  }
  body[data-mode='learning'] .training-quest {
    padding: 10px 12px;
    gap: 8px;
  }
  body[data-mode='learning'] .training-companion > span {
    display: none;
  }
  body[data-mode='learning'] .training-quest .lq-workout .lq-expression {
    font-size: 16px;
    line-height: 1.45;
    padding: 10px;
  }
  body[data-mode='learning'] .training-quest .lq-prompt {
    font-size: 14px;
    line-height: 1.4;
  }
  body[data-mode='learning'] .training-quest .lq-field-options .lq-choice {
    font-size: 14px;
  }
}
