/* Dialogue lives inside the safe-area-aware game viewport. The touch row is
   reserved by the existing stage layout, never overlaid on this composition. */
.dialog-scene {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}
.dialog-scene .dialog {
  pointer-events: auto;
  padding-bottom: 0.8rem;
}
.dialog-scene .dialog-next {
  position: static;
  display: block;
  margin-top: 0.5rem;
  text-align: right;
}
.dialog-scene .dialog-text {
  display: block;
}
.dialog-scene .dialog-name,
.dialog-scene .dialog-next {
  color: #68452f;
}
.dialog-scene .dialog:focus-visible {
  outline: 2px solid var(--color-cream);
  outline-offset: 3px;
}
.dialog-scene-npc {
  display: grid;
  grid-template-columns: minmax(0, 44fr) minmax(0, 56fr);
  grid-template-rows: minmax(0, 1fr);
  align-items: end;
  gap: 1rem;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse at 28% 48%, transparent, #14110eb8 100%),
    linear-gradient(to top, #14110eeb, #14110e20 85%);
}
.dialog-portrait {
  height: 100%;
  min-height: 0;
  min-width: 0;
  display: flex;
  align-items: end;
  justify-content: center;
  filter: drop-shadow(0 12px 24px #14110e80);
}
.dialog-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom;
}
.dialog.dialog-panel {
  position: relative;
  inset: auto;
  min-width: 0;
  min-height: 0;
  margin-bottom: 1rem;
  padding: 1.15rem 1.25rem 0.8rem;
  border: 1px solid var(--color-copper);
  border-radius: 12px;
  background: linear-gradient(135deg, #f0e3c9, var(--color-parchment));
  box-shadow: 0 12px 40px #14110e80;
}
.dialog-nameplate {
  display: block;
}
.dialog-panel .dialog-nameplate {
  margin-bottom: 0.65rem;
}
.dialog-role {
  display: block;
  margin-bottom: 0.25rem;
  color: #68452f;
  font-family: var(--font-display);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.dialog-panel .dialog-name {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: 0.035em;
  color: var(--color-ink);
}
.dialog-panel .dialog-text {
  font-size: 1.05rem;
  line-height: 1.5;
}
/* Secondary chrome yields for a conversation, and returns immediately on
   close. AppStatus stays mounted so offline/update state is never reset. */
.game-root.is-dialog .app-status {
  visibility: hidden;
  pointer-events: none;
}
.game-root.is-dialog .hud {
  /* Dialogue owns the playfield. Remove the inactive HUD from layout so a
     sibling live-status toast can remain visible at the top of the viewport. */
  display: none;
}
@media (max-width: 600px) and (orientation: portrait) {
  .dialog-scene-npc {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 0;
    padding: 0.5rem;
  }
  .dialog-portrait {
    overflow: hidden;
  }
  .dialog.dialog-panel {
    margin: 0;
    padding: 0.85rem 1rem 0.8rem;
  }
  .dialog-panel .dialog-name {
    font-size: 1.05rem;
  }
  .dialog-panel .dialog-text {
    font-size: 0.96rem;
    line-height: 1.45;
  }
}
@media (orientation: landscape) and (max-height: 520px) {
  /* Conversation controls only need the right gutter. Keeping the overworld's
     unused D-pad reservation can force a tiny portrait viewport on short phones. */
  .game-root.is-dialog.has-dialog-touch .stage {
    padding: 0 88px 0 0;
  }
  .game-root.classic-touch.is-dialog.has-touch.has-explore-touch .stage {
    padding: 0 88px 0 132px;
  }
  .game-root.is-dialog .touch-dialog-hint {
    display: none;
  }
  .game-root.is-dialog.has-dialog-touch .touch-dialog {
    justify-content: flex-end;
  }
  .game-root.is-dialog.has-touch .touch {
    top: env(safe-area-inset-top);
    right: env(safe-area-inset-right);
    bottom: env(safe-area-inset-bottom);
    left: env(safe-area-inset-left);
    height: auto;
    padding: 0 0.9rem;
  }
  .game-root.is-dialog.has-touch .touch .ab {
    flex-direction: column-reverse;
  }
  .dialog-scene-npc {
    grid-template-columns: minmax(0, 42fr) minmax(0, 58fr);
    gap: 0.5rem;
    padding: 0.5rem;
  }
  .dialog.dialog-panel {
    margin: 0;
    padding: 0.65rem 0.8rem;
  }
  .dialog-panel .dialog-nameplate {
    margin-bottom: 0.4rem;
  }
  .dialog-panel .dialog-name {
    font-size: 0.95rem;
  }
  .dialog-role {
    font-size: 0.6rem;
    letter-spacing: 0.06em;
  }
  .dialog-panel .dialog-text {
    font-size: 0.9rem;
    line-height: 1.4;
  }
}
@media (orientation: landscape) and (max-height: 520px) and (max-width: 740px) {
  /* Classic keeps its directional pad; give long prose the larger share of
     the remaining scene instead of clipping it or reducing readable type. */
  .game-root.classic-touch .dialog-scene-npc {
    grid-template-columns: minmax(0, 30fr) minmax(0, 70fr);
  }
}
@media (prefers-reduced-motion: no-preference) {
  .dialog-scene-npc {
    animation: dialogue-appear 180ms ease-out;
  }
  .dialog-portrait {
    animation: dialogue-arrive 240ms ease-out;
  }
}
@keyframes dialogue-appear {
  from {
    opacity: 0;
  }
}
@keyframes dialogue-arrive {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
@layer properties {
  @supports (((-webkit-hyphens: none)) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color: rgb(from red r g b)))) {
    *, :before, :after, ::backdrop {
      --tw-rotate-x: initial;
      --tw-rotate-y: initial;
      --tw-rotate-z: initial;
      --tw-skew-x: initial;
      --tw-skew-y: initial;
      --tw-border-style: solid;
      --tw-font-weight: initial;
      --tw-shadow: 0 0 #0000;
      --tw-shadow-color: initial;
      --tw-shadow-alpha: 100%;
      --tw-inset-shadow: 0 0 #0000;
      --tw-inset-shadow-color: initial;
      --tw-inset-shadow-alpha: 100%;
      --tw-ring-color: initial;
      --tw-ring-shadow: 0 0 #0000;
      --tw-inset-ring-color: initial;
      --tw-inset-ring-shadow: 0 0 #0000;
      --tw-ring-inset: initial;
      --tw-ring-offset-width: 0px;
      --tw-ring-offset-color: #fff;
      --tw-ring-offset-shadow: 0 0 #0000;
      --tw-outline-style: solid;
      --tw-blur: initial;
      --tw-brightness: initial;
      --tw-contrast: initial;
      --tw-grayscale: initial;
      --tw-hue-rotate: initial;
      --tw-invert: initial;
      --tw-opacity: initial;
      --tw-saturate: initial;
      --tw-sepia: initial;
      --tw-drop-shadow: initial;
      --tw-drop-shadow-color: initial;
      --tw-drop-shadow-alpha: 100%;
      --tw-drop-shadow-size: initial;
    }
  }
}

@layer theme {
  :root, :host {
    --font-sans: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
      "Courier New", monospace;
    --color-red-500: oklch(63.7% .237 25.331);
    --color-zinc-50: oklch(98.5% 0 none);
    --color-zinc-400: oklch(70.5% .015 286.067);
    --color-zinc-500: oklch(55.2% .016 285.938);
    --color-zinc-900: oklch(21% .006 285.885);
    --color-zinc-950: oklch(14.1% .005 285.823);
    --color-black: #000;
    --color-white: #fff;
    --spacing: .25rem;
    --container-md: 28rem;
    --text-sm: .875rem;
    --text-sm--line-height: calc(1.25 / .875);
    --text-lg: 1.125rem;
    --text-lg--line-height: calc(1.75 / 1.125);
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --default-transition-duration: .15s;
    --default-transition-timing-function: cubic-bezier(.4, 0, .2, 1);
    --default-font-family: var(--font-sans);
    --default-mono-font-family: var(--font-mono);
    --color-ink: #14110e;
    --color-ink-2: #1c1814;
    --color-surface: #231e19;
    --color-parchment: #e4d5b8;
    --color-parchment-dim: #cbbfa3;
    --color-forest: #2c3d32;
    --color-copper: #a36a45;
    --color-cream: #f3ead8;
    --color-muted: #8a8070;
    --color-hp: #b54a3c;
    --color-mp: #3d6e8a;
    --color-line: #f3ead829;
  }

  @supports (color: color-mix(in lab, red, red)) {
    :root, :host {
      --color-line: color-mix(in oklab, var(--color-cream) 16%, transparent);
    }
  }

  :root, :host {
    --font-display: "Cinzel", "Palatino Linotype", Palatino, serif;
  }
}

@layer base {
  *, :after, :before, ::backdrop {
    box-sizing: border-box;
    border: 0 solid;
    margin: 0;
    padding: 0;
  }

  ::file-selector-button {
    box-sizing: border-box;
    border: 0 solid;
    margin: 0;
    padding: 0;
  }

  html, :host {
    -webkit-text-size-adjust: 100%;
    tab-size: 4;
    line-height: 1.5;
    font-family: var(--default-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");
    font-feature-settings: var(--default-font-feature-settings, normal);
    font-variation-settings: var(--default-font-variation-settings, normal);
    -webkit-tap-highlight-color: transparent;
  }

  hr {
    height: 0;
    color: inherit;
    border-top-width: 1px;
  }

  abbr:where([title]) {
    -webkit-text-decoration: underline dotted;
    text-decoration: underline dotted;
  }

  h1, h2, h3, h4, h5, h6 {
    font-size: inherit;
    font-weight: inherit;
  }

  a {
    color: inherit;
    -webkit-text-decoration: inherit;
    -webkit-text-decoration: inherit;
    -webkit-text-decoration: inherit;
    text-decoration: inherit;
  }

  b, strong {
    font-weight: bolder;
  }

  code, kbd, samp, pre {
    font-family: var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);
    font-feature-settings: var(--default-mono-font-feature-settings, normal);
    font-variation-settings: var(--default-mono-font-variation-settings, normal);
    font-size: 1em;
  }

  small {
    font-size: 80%;
  }

  sub, sup {
    vertical-align: baseline;
    font-size: 75%;
    line-height: 0;
    position: relative;
  }

  sub {
    bottom: -.25em;
  }

  sup {
    top: -.5em;
  }

  table {
    text-indent: 0;
    border-color: inherit;
    border-collapse: collapse;
  }

  :-moz-focusring:where(:not(iframe)) {
    outline: auto;
  }

  progress {
    vertical-align: baseline;
  }

  summary {
    display: list-item;
  }

  ol, ul, menu {
    list-style: none;
  }

  img, svg, video, canvas, audio, iframe, embed, object {
    vertical-align: middle;
    display: block;
  }

  img, video {
    max-width: 100%;
    height: auto;
  }

  button, input, select, optgroup, textarea {
    font: inherit;
    font-feature-settings: inherit;
    font-variation-settings: inherit;
    letter-spacing: inherit;
    color: inherit;
    opacity: 1;
    background-color: #0000;
    border-radius: 0;
  }

  ::file-selector-button {
    font: inherit;
    font-feature-settings: inherit;
    font-variation-settings: inherit;
    letter-spacing: inherit;
    color: inherit;
    opacity: 1;
    background-color: #0000;
    border-radius: 0;
  }

  :where(select:is([multiple], [size])) optgroup {
    font-weight: bolder;
  }

  :where(select:is([multiple], [size])) optgroup option {
    padding-inline-start: 20px;
  }

  ::file-selector-button {
    margin-inline-end: 4px;
  }

  ::placeholder {
    opacity: 1;
  }

  @supports (not ((-webkit-appearance: -apple-pay-button))) or (contain-intrinsic-size: 1px) {
    ::placeholder {
      color: currentColor;
    }

    @supports (color: color-mix(in lab, red, red)) {
      ::placeholder {
        color: color-mix(in oklab, currentcolor 50%, transparent);
      }
    }
  }

  textarea {
    resize: vertical;
  }

  ::-webkit-search-decoration {
    -webkit-appearance: none;
  }

  ::-webkit-date-and-time-value {
    min-height: 1lh;
    text-align: inherit;
  }

  ::-webkit-datetime-edit {
    display: inline-flex;
  }

  ::-webkit-datetime-edit-fields-wrapper {
    padding: 0;
  }

  ::-webkit-datetime-edit {
    padding-block: 0;
  }

  ::-webkit-datetime-edit-year-field {
    padding-block: 0;
  }

  ::-webkit-datetime-edit-month-field {
    padding-block: 0;
  }

  ::-webkit-datetime-edit-day-field {
    padding-block: 0;
  }

  ::-webkit-datetime-edit-hour-field {
    padding-block: 0;
  }

  ::-webkit-datetime-edit-minute-field {
    padding-block: 0;
  }

  ::-webkit-datetime-edit-second-field {
    padding-block: 0;
  }

  ::-webkit-datetime-edit-millisecond-field {
    padding-block: 0;
  }

  ::-webkit-datetime-edit-meridiem-field {
    padding-block: 0;
  }

  ::-webkit-calendar-picker-indicator {
    line-height: 1;
  }

  :-moz-ui-invalid {
    box-shadow: none;
  }

  button, input:where([type="button"], [type="reset"], [type="submit"]) {
    appearance: button;
  }

  ::file-selector-button {
    appearance: button;
  }

  ::-webkit-inner-spin-button {
    height: auto;
  }

  ::-webkit-outer-spin-button {
    height: auto;
  }

  [hidden]:where(:not([hidden="until-found"])) {
    display: none !important;
  }

  html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  button:not(:disabled), [role="button"]:not(:disabled) {
    cursor: pointer;
  }

  * {
    box-sizing: border-box;
  }

  body {
    background: var(--color-ink);
    color: var(--color-cream);
    font-family: var(--font-sans);
    margin: 0;
  }
}

@layer components;

@layer utilities {
  .collapse {
    visibility: collapse;
  }

  .invisible {
    visibility: hidden;
  }

  .visible {
    visibility: visible;
  }

  .absolute {
    position: absolute;
  }

  .fixed {
    position: fixed;
  }

  .relative {
    position: relative;
  }

  .static {
    position: static;
  }

  .sticky {
    position: sticky;
  }

  .block {
    display: block;
  }

  .contents {
    display: contents;
  }

  .flex {
    display: flex;
  }

  .grid {
    display: grid;
  }

  .hidden {
    display: none;
  }

  .inline {
    display: inline;
  }

  .table {
    display: table;
  }

  .size-10 {
    width: calc(var(--spacing) * 10);
    height: calc(var(--spacing) * 10);
  }

  .h-8 {
    height: calc(var(--spacing) * 8);
  }

  .min-h-screen {
    min-height: 100vh;
  }

  .w-8 {
    width: calc(var(--spacing) * 8);
  }

  .max-w-md {
    max-width: var(--container-md);
  }

  .grow {
    flex-grow: 1;
  }

  .transform {
    transform: var(--tw-rotate-x, ) var(--tw-rotate-y, ) var(--tw-rotate-z, ) var(--tw-skew-x, ) var(--tw-skew-y, );
  }

  .cursor-pointer {
    cursor: pointer;
  }

  .resize {
    resize: both;
  }

  .flex-col {
    flex-direction: column;
  }

  .place-items-center {
    place-items: center;
  }

  .items-center {
    align-items: center;
  }

  .justify-center {
    justify-content: center;
  }

  .gap-2 {
    gap: calc(var(--spacing) * 2);
  }

  .gap-3 {
    gap: calc(var(--spacing) * 3);
  }

  .rounded {
    border-radius: .25rem;
  }

  .rounded-full {
    border-radius: 3.40282e38px;
  }

  .border {
    border-style: var(--tw-border-style);
    border-width: 1px;
  }

  .bg-black\/10 {
    background-color: #0000001a;
  }

  @supports (color: color-mix(in lab, red, red)) {
    .bg-black\/10 {
      background-color: color-mix(in oklab, var(--color-black) 10%, transparent);
    }
  }

  .bg-zinc-50 {
    background-color: var(--color-zinc-50);
  }

  .object-cover {
    object-fit: cover;
  }

  .px-6 {
    padding-inline: calc(var(--spacing) * 6);
  }

  .text-center {
    text-align: center;
  }

  .text-lg {
    font-size: var(--text-lg);
    line-height: var(--tw-leading, var(--text-lg--line-height));
  }

  .text-sm {
    font-size: var(--text-sm);
    line-height: var(--tw-leading, var(--text-sm--line-height));
  }

  .font-medium {
    --tw-font-weight: var(--font-weight-medium);
    font-weight: var(--font-weight-medium);
  }

  .font-semibold {
    --tw-font-weight: var(--font-weight-semibold);
    font-weight: var(--font-weight-semibold);
  }

  .break-words {
    overflow-wrap: break-word;
  }

  .text-red-500 {
    color: var(--color-red-500);
  }

  .text-zinc-500 {
    color: var(--color-zinc-500);
  }

  .text-zinc-900 {
    color: var(--color-zinc-900);
  }

  .underline-offset-4 {
    text-underline-offset: 4px;
  }

  .opacity-70 {
    opacity: .7;
  }

  .shadow {
    --tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, #0000001a), 0 1px 2px -1px var(--tw-shadow-color, #0000001a);
    box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
  }

  .outline {
    outline-style: var(--tw-outline-style);
    outline-width: 1px;
  }

  .blur {
    --tw-blur: blur(8px);
    filter: var(--tw-blur, ) var(--tw-brightness, ) var(--tw-contrast, ) var(--tw-grayscale, ) var(--tw-hue-rotate, ) var(--tw-invert, ) var(--tw-saturate, ) var(--tw-sepia, ) var(--tw-drop-shadow, );
  }

  .filter {
    filter: var(--tw-blur, ) var(--tw-brightness, ) var(--tw-contrast, ) var(--tw-grayscale, ) var(--tw-hue-rotate, ) var(--tw-invert, ) var(--tw-saturate, ) var(--tw-sepia, ) var(--tw-drop-shadow, );
  }

  .transition {
    transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter, display, content-visibility, overlay, pointer-events;
    transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
    transition-duration: var(--tw-duration, var(--default-transition-duration));
  }

  .\[assert\:prod-runtime\] {
    assert: prod-runtime;
  }

  .\[assert\:web-shell\] {
    assert: web-shell;
  }

  .\[build\:web\] {
    build: web;
  }

  .\[verify\:pwa\] {
    verify: pwa;
  }

  @media (hover: hover) {
    .hover\:underline:hover {
      text-decoration-line: underline;
    }
  }

  .disabled\:cursor-wait:disabled {
    cursor: wait;
  }

  .disabled\:no-underline:disabled {
    text-decoration-line: none;
  }

  @media (prefers-color-scheme: dark) {
    .dark\:bg-white\/20 {
      background-color: #fff3;
    }

    @supports (color: color-mix(in lab, red, red)) {
      .dark\:bg-white\/20 {
        background-color: color-mix(in oklab, var(--color-white) 20%, transparent);
      }
    }

    .dark\:bg-zinc-950 {
      background-color: var(--color-zinc-950);
    }

    .dark\:text-zinc-50 {
      color: var(--color-zinc-50);
    }

    .dark\:text-zinc-400 {
      color: var(--color-zinc-400);
    }
  }
}

.game-root {
  background: var(--color-ink);
  height: 100svh;
  color: var(--color-cream);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  flex-direction: column;
  display: flex;
  position: relative;
  overflow: hidden;
}

.stage {
  background: var(--color-ink-2);
  flex: 1;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 0;
  display: flex;
  position: relative;
  overflow: hidden;
}

.viewport {
  flex: none;
  max-width: 100%;
  max-height: 100%;
  position: relative;
}

.game-canvas {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: var(--color-forest);
  display: block;
}

.game-canvas.is-hidden {
  opacity: 0;
  pointer-events: none;
  position: absolute;
  inset: 0;
}

.title-screen {
  background: var(--color-ink);
  justify-content: center;
  align-items: flex-end;
  display: flex;
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.title-bg {
  object-fit: cover;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
}

.title-veil {
  background: linear-gradient(to top, #14110ee0 0%, #14110e47 38%, #0000 72%);
  position: absolute;
  inset: 0;
}

@supports (color: color-mix(in lab, red, red)) {
  .title-veil {
    background: linear-gradient(to top, color-mix(in oklab, var(--color-ink) 88%, transparent) 0%, color-mix(in oklab, var(--color-ink) 28%, transparent) 38%, transparent 72%);
  }
}

.title-copy {
  z-index: 1;
  text-align: left;
  width: min(520px, 92%);
  padding: 0 0 2rem;
  position: relative;
}

.title-plaque {
  background: #e4d5b8f0;
}

@supports (color: color-mix(in lab, red, red)) {
  .title-plaque {
    background: color-mix(in oklab, var(--color-parchment) 94%, transparent);
  }
}

.title-plaque {
  color: var(--color-ink);
  border: 1px solid var(--color-copper);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.35rem 1.05rem;
  box-shadow: 0 18px 48px #14110e8c;
}

@supports (color: color-mix(in lab, red, red)) {
  .title-plaque {
    box-shadow: 0 18px 48px color-mix(in oklab, var(--color-ink) 55%, transparent);
  }
}

.title-kicker {
  font-family: var(--font-display);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--color-parchment-dim);
  margin: 0 0 .4rem;
  font-size: .72rem;
}

.title-plaque .title-kicker {
  color: var(--color-copper);
}

.title-word {
  font-family: var(--font-display);
  letter-spacing: .04em;
  text-wrap: balance;
  color: var(--color-cream);
  margin: 0 0 .5rem;
  font-size: clamp(2.4rem, 8vw, 3.6rem);
  font-weight: 600;
  line-height: 1.05;
}

.title-plaque .title-word {
  color: var(--color-ink);
}

.title-tag {
  color: var(--color-parchment);
  text-wrap: pretty;
  max-width: 36ch;
  margin: 0 0 1.15rem;
  line-height: 1.5;
}

.title-plaque .title-tag {
  color: #14110ec7;
}

@supports (color: color-mix(in lab, red, red)) {
  .title-plaque .title-tag {
    color: color-mix(in oklab, var(--color-ink) 78%, transparent);
  }
}

.title-actions {
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: .85rem;
  display: flex;
}

.title-confirm {
  border: 1px solid #14110e59;
}

@supports (color: color-mix(in lab, red, red)) {
  .title-confirm {
    border: 1px solid color-mix(in oklab, var(--color-ink) 35%, transparent);
  }
}

.title-confirm {
  background: #f3ead8eb;
  border-radius: .6rem;
  margin-bottom: .85rem;
  padding: .85rem 1rem;
}

@supports (color: color-mix(in lab, red, red)) {
  .title-confirm {
    background: color-mix(in oklab, var(--color-cream) 92%, transparent);
  }
}

.title-confirm .title-actions {
  margin-bottom: 0;
}

.title-plaque .btn-ghost {
  background: var(--color-cream);
  color: var(--color-ink);
}

.title-hint {
  color: var(--color-muted);
  margin: 0;
  font-size: .8rem;
}

.boot .title-copy {
  text-align: center;
  margin: auto;
  padding-bottom: 0;
}

.btn-primary, .btn-ghost, .hud-menu, .cmd button, .menu-list button, .shop-tabs button {
  font-family: var(--font-display);
  letter-spacing: .04em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-line);
  min-height: 44px;
  padding: .6rem 1.1rem;
}

.btn-primary, .a-btn {
  background: var(--color-parchment);
  color: var(--color-ink);
}

.btn-ghost, .b-btn, .hud-menu {
  background: #14110e66;
}

@supports (color: color-mix(in lab, red, red)) {
  .btn-ghost, .b-btn, .hud-menu {
    background: color-mix(in oklab, var(--color-ink) 40%, transparent);
  }
}

.btn-ghost, .b-btn, .hud-menu {
  color: var(--color-cream);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.btn-primary:active, .btn-ghost:active, .hud-menu:active {
  transform: scale(.98);
}

.load-bar {
  background: var(--color-surface);
  border-radius: 999px;
  width: min(240px, 70vw);
  height: 6px;
  margin: 1rem auto;
  overflow: hidden;
}

.load-fill {
  background: var(--color-parchment);
  height: 100%;
  transition: width .2s;
}

.top-stack {
  pointer-events: none;
  z-index: 8;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  display: flex;
  position: absolute;
  top: .6rem;
  left: .6rem;
  right: .6rem;
}

.top-stack:empty {
  display: none;
}

.hud {
  pointer-events: none;
  z-index: 2;
  width: 100%;
  position: relative;
  container-type: inline-size;
}

.hud-row {
  align-items: stretch;
  gap: .35rem;
  width: 100%;
  display: flex;
}

.hud-chip {
  pointer-events: none;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(155deg, #302b20f5, #171c17f5 70%);
  border: 1px solid #b98c51;
  border-radius: 7px;
  flex-direction: column;
  flex: none;
  justify-content: center;
  min-width: 0;
  padding: .35rem .5rem;
  display: flex;
  box-shadow: inset 0 0 0 2px #15130f, inset 0 0 0 3px #92764a, 0 3px 7px #090b08a8;
}

.hud-chip-grow {
  flex: 1 1 0;
  min-width: 0;
}

.hud-chip-stats {
  flex: 0 6.2rem;
  gap: .2rem;
  min-width: 5.1rem;
}

.hud-location {
  align-items: center;
  gap: .4rem;
  min-width: 0;
  display: flex;
}

.hud-sigil {
  color: #f1d28b;
  filter: drop-shadow(0 2px 1px #080907);
  flex: 0 0 1.7rem;
  width: 1.7rem;
  display: block;
}

.hud-sigil svg {
  width: 100%;
  height: auto;
  display: block;
}

.hud-sigil svg > path:first-child {
  fill: #682e29;
  stroke: #d7ad6e;
  stroke-width: 1.5px;
}

.hud-location-copy {
  flex-direction: column;
  min-width: 0;
  display: flex;
}

.hud-objective-expanded .hud-place, .hud-objective-expanded .hud-region {
  opacity: .78;
  transition: opacity .18s;
}

@media (prefers-reduced-motion: reduce) {
  .hud-objective-expanded .hud-place, .hud-objective-expanded .hud-region {
    transition: none;
  }
}

.hud-place {
  overflow-wrap: anywhere;
  font-family: Georgia, Palatino Linotype, serif;
  font-size: .95rem;
  font-weight: 700;
  line-height: 1.1;
}

.hud-muted, .muted {
  color: var(--color-muted);
  font-size: .72rem;
}

.hud-chip .hud-muted {
  color: var(--color-parchment);
}

.hud-region {
  overflow-wrap: anywhere;
  font-family: Georgia, Palatino Linotype, serif;
  font-style: italic;
  line-height: 1.1;
}

.hud-gold {
  color: #fff0cb;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-family: Georgia, Palatino Linotype, serif;
  font-size: .83rem;
}

.hud-coin {
  color: #e8b65e;
  font-size: .85rem;
}

.hud-companion {
  overflow-wrap: anywhere;
  border-top: 1px solid #a1844f88;
  padding-top: .2rem;
  line-height: 1.2;
  display: block;
}

.hud-objective-slot {
  min-width: 0;
  margin-top: .25rem;
  position: relative;
}

.hud-objective-btn {
  pointer-events: auto;
  border-radius: var(--radius-sm);
  width: 100%;
  min-height: 44px;
  color: var(--color-cream);
  text-align: left;
  font: inherit;
  background: #171915d9;
  border: 1px solid #a68959;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .35rem;
  padding: .28rem .4rem;
  display: grid;
}

.hud-objective-label {
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-parchment);
  font-family: Georgia, Palatino Linotype, serif;
  font-size: .62rem;
}

.hud-objective-preview {
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  color: var(--color-cream);
  font-size: .72rem;
  overflow: hidden;
}

.hud-objective-chevron {
  color: var(--color-parchment);
  font-size: .75rem;
}

.hud-objective-popover {
  z-index: 12;
  border-radius: var(--radius-md);
  border: 1px solid #f3ead838;
  padding: .45rem .5rem .5rem;
  position: absolute;
  top: calc(100% + .2rem);
  left: 0;
  right: 0;
}

@supports (color: color-mix(in lab, red, red)) {
  .hud-objective-popover {
    border: 1px solid color-mix(in oklab, var(--color-cream) 22%, transparent);
  }
}

.hud-objective-popover {
  background: #14110eeb;
}

@supports (color: color-mix(in lab, red, red)) {
  .hud-objective-popover {
    background: color-mix(in oklab, var(--color-ink) 92%, transparent);
  }
}

.hud-objective-popover {
  box-shadow: 0 10px 28px #14110e8c;
}

@supports (color: color-mix(in lab, red, red)) {
  .hud-objective-popover {
    box-shadow: 0 10px 28px color-mix(in oklab, var(--color-ink) 55%, transparent);
  }
}

.hud-objective-popover {
  pointer-events: auto;
  touch-action: pan-y;
  max-height: min(38dvh, 220px);
  overflow-y: auto;
}

.hud-objective-full {
  color: var(--color-cream);
  text-wrap: pretty;
  margin: 0 0 .45rem;
  font-size: .78rem;
  line-height: 1.4;
}

.hud-objective-lantern {
  pointer-events: auto;
  min-height: 44px;
  color: var(--color-parchment);
  text-underline-offset: 3px;
  background: none;
  border: 0;
  align-self: flex-start;
  padding: .35rem .55rem;
  font-size: .72rem;
  text-decoration: underline;
}

.hud-menu {
  pointer-events: auto;
  color: #fff0cf;
  letter-spacing: 0;
  background: linear-gradient(155deg, #352b20f5, #191917f5);
  border: 1px solid #c29760;
  border-radius: 7px;
  flex-direction: column;
  flex: 0 0 3.4rem;
  justify-content: center;
  align-items: center;
  gap: .1rem;
  min-width: 44px;
  margin-left: auto;
  padding: .3rem .2rem;
  font-family: Georgia, Palatino Linotype, serif;
  font-size: .8rem;
  display: flex;
  box-shadow: inset 0 0 0 2px #17120f, inset 0 0 0 3px #92764a, 0 3px 7px #090b08a8;
}

.hud-menu-icon {
  font-family: sans-serif;
  font-size: 1.1rem;
  line-height: 1;
}

@container (max-width: 500px) {
  .hud-objective-btn {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .1rem .3rem;
  }

  .hud-objective-label {
    grid-column: 1;
  }

  .hud-objective-preview {
    -webkit-line-clamp: 3;
    white-space: normal;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    grid-column: 1;
    line-height: 1.2;
    display: -webkit-box;
  }

  .hud-objective-chevron {
    grid-area: 1 / 2 / 3;
  }
}

@container (max-width: 300px) {
  .hud-sigil, .hud-objective-label {
    display: none;
  }

  .hud-objective-btn {
    grid-template-columns: 1fr auto;
  }

  .hud-objective-preview, .hud-objective-chevron {
    grid-row: 1;
  }

  .hud-chip-stats {
    min-width: 4.5rem;
  }

  .hud-menu {
    flex-basis: 3rem;
  }
}

.hud button:focus-visible, .touch button:focus-visible {
  outline-offset: 2px;
  outline: 3px solid #fff3c7;
}

.dialog {
  z-index: 4;
  text-align: left;
  background: var(--color-parchment);
  color: var(--color-ink);
  border-radius: var(--radius-lg);
  border: 0;
  min-height: 108px;
  padding: 1rem 1.1rem 1.2rem;
  position: absolute;
  bottom: .7rem;
  left: .7rem;
  right: .7rem;
  box-shadow: 0 12px 40px #14110e80;
}

@supports (color: color-mix(in lab, red, red)) {
  .dialog {
    box-shadow: 0 12px 40px color-mix(in oklab, var(--color-ink) 50%, transparent);
  }
}

.dialog-name {
  font-family: var(--font-display);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-copper);
  margin-bottom: .35rem;
  font-size: .78rem;
  display: inline-block;
}

.dialog-text {
  text-wrap: pretty;
  margin: 0;
  font-size: 1rem;
  line-height: 1.45;
}

.dialog-next {
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-copper);
  font-size: .72rem;
  position: absolute;
  bottom: .55rem;
  right: 1rem;
}

.sheet {
  z-index: 5;
  background: var(--color-parchment);
  width: min(320px, 100% - 1rem);
  color: var(--color-ink);
  border-radius: var(--radius-lg);
  max-height: min(70vh, 520px, 100% - 4rem);
  padding: 1rem;
  position: absolute;
  top: 3.4rem;
  left: 50%;
  right: auto;
  overflow: auto;
  transform: translateX(-50%);
}

.overlay-panel {
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: min(72dvh, 540px, 100% - 4rem);
  padding: 0;
  display: grid;
  overflow: hidden;
}

.overlay-panel-head {
  padding: 16px 16px 8px;
}

.overlay-panel-body {
  touch-action: pan-y;
  overscroll-behavior: contain;
  min-height: 0;
  padding: 0 1rem;
  overflow-y: auto;
}

.overlay-panel-foot {
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  padding: 8px 16px 16px;
  display: flex;
}

.overlay-panel-foot .btn-ghost {
  margin-left: auto;
}

.save-file-input {
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  position: absolute;
  overflow: hidden;
}

.sheet-wide {
  width: min(560px, 100% - 1rem);
}

.sheet h2 {
  font-family: var(--font-display);
  margin: 0 0 .6rem;
  font-size: 1.15rem;
}

.overlay-panel-head h2 {
  margin-bottom: 8px;
}

.overlay-panel-body > .sheet-sub:first-child {
  margin-top: 0;
}

.sheet-sub {
  color: #14110ec7;
  margin: -.3rem 0 .8rem;
}

@supports (color: color-mix(in lab, red, red)) {
  .sheet-sub {
    color: color-mix(in oklab, var(--color-ink) 78%, transparent);
  }
}

.sheet-sub {
  font-size: .85rem;
  line-height: 1.4;
}

.sheet-section {
  font-family: var(--font-display);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #14110eb8;
  margin: .35rem 0 .45rem;
  font-size: .82rem;
}

@supports (color: color-mix(in lab, red, red)) {
  .sheet-section {
    color: color-mix(in oklab, var(--color-ink) 72%, transparent);
  }
}

.menu-list {
  flex-direction: column;
  gap: .3rem;
  margin: 0 0 .8rem;
  padding: 0;
  list-style: none;
  display: flex;
}

.menu-list button {
  background: var(--color-cream);
  width: 100%;
  color: var(--color-ink);
  text-align: left;
  justify-content: space-between;
  display: flex;
}

.menu-list button.active, .cmd button.active, .shop-tabs button.active, .shop-list button.active {
  outline: 2px solid var(--color-copper);
}

.menu-list em, .cmd em {
  color: var(--color-copper);
  font-variant-numeric: tabular-nums;
  font-style: normal;
}

.target-list button {
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: .4rem;
}

.target-list button .muted {
  flex-basis: 100%;
}

.party-grid, .reliq-grid {
  gap: .6rem;
  margin-bottom: .8rem;
  display: grid;
}

.reliq-grid {
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
}

.beast-card {
  background: var(--color-cream);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-line);
  grid-template-columns: 72px minmax(0, 1fr);
  gap: .6rem;
  padding: .55rem;
  display: grid;
}

.beast-card-active {
  border-color: var(--color-copper);
  box-shadow: 0 0 0 1px var(--color-copper);
}

.beast-actions {
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .5rem;
  display: flex;
}

.beast-actions .btn-ghost {
  background: var(--color-ink);
  color: var(--color-cream);
}

.action-with-hint {
  flex-direction: column;
  gap: .2rem;
  width: 100%;
  display: flex;
}

.action-hint {
  color: #14110eb8;
  margin: 0;
  font-size: .78rem;
  line-height: 1.35;
}

@supports (color: color-mix(in lab, red, red)) {
  .action-hint {
    color: color-mix(in oklab, var(--color-ink) 72%, transparent);
  }
}

.action-with-hint button:disabled + .action-hint {
  color: #311b16;
}

@supports (color: color-mix(in lab, red, red)) {
  .action-with-hint button:disabled + .action-hint {
    color: color-mix(in oklab, var(--color-ink) 82%, var(--color-hp));
  }
}

.rename-form {
  flex-wrap: wrap;
  gap: .5rem;
  display: flex;
}

.rename-form label {
  gap: .25rem;
  width: 100%;
  display: grid;
}

.rename-form input {
  width: 100%;
  min-width: 0;
  color: var(--color-ink);
  background: var(--color-cream);
  border: 1px solid var(--color-ink);
  padding: .5rem;
}

.beast-card img, .reliq-cell img {
  object-fit: contain;
  width: 72px;
  height: 72px;
}

.beast-card h3 {
  font-family: var(--font-display);
  overflow-wrap: anywhere;
  margin: 0;
  font-size: .95rem;
}

.beast-card .meter {
  color: var(--color-ink);
  margin-top: .3rem;
  font-size: .8rem;
}

.beast-card .meter-kicker, .beast-card .meter-abbr {
  color: var(--color-ink);
}

.beast-card .meter-kicker {
  letter-spacing: .02em;
  font-size: .75rem;
  line-height: 1.3;
}

.beast-card .meter-head {
  flex-wrap: wrap;
  column-gap: .5rem;
}

.beast-card small {
  color: var(--color-muted);
  font-weight: 500;
}

.els {
  gap: .3rem;
  margin: .2rem 0 .35rem;
  display: flex;
}

.el {
  letter-spacing: .06em;
  text-transform: uppercase;
  background: var(--color-ink);
  color: var(--color-cream);
  border-radius: 999px;
  padding: .1rem .35rem;
  font-size: .65rem;
}

.skills {
  margin: .2rem 0 0;
  font-size: .75rem;
}

.reliq-cell {
  background: var(--color-cream);
  border-radius: var(--radius-sm);
  flex-direction: column;
  align-items: center;
  gap: .2rem;
  min-height: 88px;
  padding: .3rem;
  font-size: .65rem;
  display: flex;
}

.reliq-cell.have {
  outline: 1px solid var(--color-copper);
}

.reliq-cell.seen {
  outline: 1px dashed #a36a458c;
}

@supports (color: color-mix(in lab, red, red)) {
  .reliq-cell.seen {
    outline: 1px dashed color-mix(in oklab, var(--color-copper) 55%, transparent);
  }
}

.unknown {
  width: 72px;
  height: 72px;
  font-family: var(--font-display);
  color: var(--color-muted);
  place-items: center;
  font-size: 1.4rem;
  display: grid;
}

.meter {
  font-variant-numeric: tabular-nums;
  font-size: .7rem;
}

.meter-track {
  background: #14110e2e;
  height: 6px;
}

@supports (color: color-mix(in lab, red, red)) {
  .meter-track {
    background: color-mix(in oklab, var(--color-ink) 18%, transparent);
  }
}

.meter-track {
  border-radius: 999px;
  margin-top: 2px;
  overflow: hidden;
}

.meter-fill.hp {
  background: var(--color-hp);
  height: 100%;
}

.meter-fill.mp {
  background: var(--color-mp);
  height: 100%;
}

.battle-ui {
  pointer-events: none;
  z-index: 3;
  position: absolute;
  inset: 0;
}

.battle-status-zone {
  pointer-events: none;
  justify-content: flex-end;
  transition: opacity .16s;
  display: flex;
  position: absolute;
  top: .6rem;
  left: .6rem;
  right: .6rem;
}

.game-root.is-battle-submenu .battle-status-zone {
  opacity: .78;
}

.battler {
  background: #14110ef5;
  border: 1px solid #f3ead838;
}

@supports (color: color-mix(in lab, red, red)) {
  .battler {
    border: 1px solid color-mix(in oklab, var(--color-cream) 22%, transparent);
  }
}

.battler {
  border-radius: var(--radius-md);
  pointer-events: none;
  min-width: min(140px, 46%);
  max-width: calc(100% - 1.2rem);
  padding: .4rem .55rem;
  box-shadow: 0 4px 16px #14110ea6;
}

@supports (color: color-mix(in lab, red, red)) {
  .battler {
    box-shadow: 0 4px 16px color-mix(in oklab, var(--color-ink) 65%, transparent);
  }
}

.battler {
  color: var(--color-cream);
}

.battler.foe {
  position: relative;
  top: auto;
  right: auto;
}

.battler.me {
  position: relative;
  bottom: auto;
  left: auto;
}

.battler strong {
  font-family: var(--font-display);
  color: var(--color-cream);
  font-size: .88rem;
  display: block;
}

.battler span {
  color: var(--color-parchment);
  font-size: .74rem;
}

.battler .meter {
  color: var(--color-cream);
  font-size: .72rem;
}

.meter-head {
  justify-content: space-between;
  align-items: baseline;
  gap: .35rem;
  line-height: 1.2;
  display: flex;
}

.meter-kicker {
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--color-parchment-dim);
  font-size: .65rem;
}

.meter-frac {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.meter-abbr {
  color: var(--color-cream);
  font-weight: 600;
  text-decoration: none;
}

.meter-row {
  grid-template-columns: 1fr 1fr;
  gap: .3rem;
  margin-top: .15rem;
  display: grid;
}

.battle-log {
  background: var(--color-parchment);
  color: var(--color-ink);
  border-radius: var(--radius-md);
  pointer-events: none;
  box-sizing: border-box;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: .55rem .85rem;
  font-size: .86rem;
  display: flex;
  overflow: visible;
}

.battle-log-text {
  text-wrap: pretty;
  overflow-wrap: anywhere;
  width: 100%;
  line-height: 1.35;
  display: block;
}

.battle-recap-wrap {
  box-sizing: border-box;
  border-radius: var(--radius-md);
  background: var(--color-parchment);
  width: 100%;
  min-width: 0;
  color: var(--color-ink);
  padding: .25rem .5rem;
}

.battle-recap {
  color: var(--color-ink);
  box-sizing: border-box;
  gap: .1rem;
  width: 100%;
  max-height: 5.2rem;
  margin: .2rem 0 0;
  padding: .25rem .25rem .25rem 1.4rem;
  font-size: .76rem;
  list-style: decimal;
  display: grid;
  overflow-y: auto;
}

.battle-recap li {
  overflow-wrap: anywhere;
}

.battler-status {
  letter-spacing: .02em;
  text-transform: uppercase;
  color: #14110eb8;
  font-size: .72rem;
}

@supports (color: color-mix(in lab, red, red)) {
  .battler-status {
    color: color-mix(in oklab, var(--color-ink) 72%, transparent);
  }
}

.battler-status {
  border: 1px solid #14110e4d;
}

@supports (color: color-mix(in lab, red, red)) {
  .battler-status {
    border: 1px solid color-mix(in oklab, var(--color-ink) 30%, transparent);
  }
}

.battler-status {
  border-radius: 999px;
  width: fit-content;
  padding: .05rem .45rem;
}

.battle-panel-title {
  font-family: var(--font-display);
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--color-parchment-dim);
  margin: 0 0 .35rem;
  font-size: .78rem;
}

.battle-recap-wrap .battle-panel-title {
  color: inherit;
}

.cmd {
  pointer-events: auto;
  grid-template-columns: 1fr 1fr;
  gap: .3rem;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
}

.cmd-scroll {
  grid-template-columns: 1fr;
  max-width: none;
}

.cmd-party {
  width: 100%;
}

.cmd button {
  background: var(--color-parchment);
  color: var(--color-ink);
  justify-content: space-between;
  align-items: center;
  gap: .35rem;
  width: 100%;
  min-height: 44px;
  display: flex;
}

.cmd-skills button.skill-unaffordable {
  border-left: 4px solid var(--color-hp);
  background: #e1cdb1;
}

@supports (color: color-mix(in lab, red, red)) {
  .cmd-skills button.skill-unaffordable {
    background: color-mix(in oklab, var(--color-hp) 6%, var(--color-parchment));
  }
}

.cmd-skills button.skill-unaffordable em {
  color: var(--color-hp);
  font-weight: 600;
}

.cmd-skill-main {
  justify-content: space-between;
  align-items: baseline;
  gap: .45rem;
  width: 100%;
  min-width: 0;
  display: flex;
}

.cmd-skill-name {
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  min-width: 0;
  overflow: hidden;
}

.cmd-party button.cmd-party-row, button.cmd-party-row {
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  min-height: 48px;
  padding: .45rem .65rem;
}

.cmd-party-name {
  font-family: var(--font-display);
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  font-size: .88rem;
  line-height: 1.2;
  overflow: hidden;
}

.cmd-party-meta {
  font-size: .78rem;
}

.battle-controls-actions .cmd {
  width: min(260px, 100%);
  margin-left: auto;
}

.battle-back {
  background: var(--color-cream);
  min-width: 5.5rem;
  min-height: 44px;
  color: var(--color-ink);
}

.battle-continue {
  min-height: 44px;
  margin-left: auto;
}

.battle-ui .btn-primary {
  pointer-events: auto;
}

.shop-tabs {
  gap: .4rem;
  margin-bottom: .6rem;
  display: flex;
}

.shop-tabs button {
  background: var(--color-cream);
  color: var(--color-ink);
  flex: 1;
}

.shop-list button {
  align-items: flex-start;
  gap: .55rem;
  min-height: 44px;
}

.shop-row-main {
  text-align: left;
  flex-direction: column;
  flex: 1;
  gap: .15rem;
  min-width: 0;
  display: flex;
}

.shop-row-name {
  font-family: var(--font-display);
  font-size: .92rem;
}

.shop-row-desc {
  color: #14110eb3;
  font-size: .78rem;
  line-height: 1.35;
}

@supports (color: color-mix(in lab, red, red)) {
  .shop-row-desc {
    color: color-mix(in oklab, var(--color-ink) 70%, transparent);
  }
}

.shop-row-price {
  flex-direction: column;
  flex-shrink: 0;
  align-items: flex-end;
  gap: .15rem;
  display: flex;
}

.shop-row-note {
  color: var(--color-hp);
  font-size: .72rem;
}

.shop-list button.unaffordable {
  opacity: 1;
  border-left: 4px solid var(--color-hp);
  background: #edc;
}

@supports (color: color-mix(in lab, red, red)) {
  .shop-list button.unaffordable {
    background: color-mix(in oklab, var(--color-hp) 8%, var(--color-cream));
  }
}

.shop-list button.unaffordable em {
  color: var(--color-hp);
  text-decoration: line-through;
}

.shop-list button.affordable em {
  color: #62513b;
}

@supports (color: color-mix(in lab, red, red)) {
  .shop-list button.affordable em {
    color: color-mix(in oklab, var(--color-forest) 55%, var(--color-copper));
  }
}

.shop-buy-btn {
  width: 100%;
  margin-bottom: .5rem;
}

.shop-buy-btn:disabled {
  opacity: .85;
  background: #e9dbc2;
}

@supports (color: color-mix(in lab, red, red)) {
  .shop-buy-btn:disabled {
    background: color-mix(in oklab, var(--color-parchment) 70%, var(--color-cream));
  }
}

.btn-lead-active {
  background: var(--color-copper);
  color: var(--color-cream);
  border: 1px solid #f3ead859;
}

@supports (color: color-mix(in lab, red, red)) {
  .btn-lead-active {
    border: 1px solid color-mix(in oklab, var(--color-cream) 35%, transparent);
  }
}

.btn-lead-active {
  min-height: 44px;
  font-family: var(--font-display);
  letter-spacing: .04em;
  border-radius: var(--radius-sm);
  opacity: 1;
  padding: .45rem .8rem;
}

.shop-detail {
  margin-bottom: 0;
}

.ui-scrim {
  z-index: 4;
  background: #14110e8c;
  position: absolute;
  inset: 0;
}

@supports (color: color-mix(in lab, red, red)) {
  .ui-scrim {
    background: color-mix(in oklab, var(--color-ink) 55%, transparent);
  }
}

.ui-scrim {
  pointer-events: auto;
  touch-action: none;
}

.game-root.is-ui-modal .overlay-panel {
  z-index: 6;
  max-height: calc(100% - 1rem);
  top: .5rem;
}

.hud-dormant {
  visibility: hidden;
  pointer-events: none;
}

.top-stack-dormant, .game-root.is-ui-modal .game-canvas {
  pointer-events: none;
}

.toast-modal {
  left: 50%;
  top: calc(.75rem + env(safe-area-inset-top));
  z-index: 20;
  max-width: min(22rem, 100% - 1rem);
  position: fixed;
  transform: translateX(-50%);
}

.toast {
  background: var(--color-parchment);
  color: var(--color-ink);
  z-index: 8;
  text-align: center;
  text-wrap: balance;
  border-radius: 999px;
  max-width: 100%;
  padding: .45rem .8rem;
  font-size: .85rem;
  position: relative;
}

.touch-dialog-hint {
  text-align: center;
  color: var(--color-parchment-dim);
  letter-spacing: .06em;
  text-transform: uppercase;
  flex: 1;
  margin: 0;
  font-size: .78rem;
}

.game-root.has-dialog-touch .stage {
  padding-bottom: 88px;
}

.game-root.has-dialog-touch .touch {
  justify-content: center;
  height: 88px;
}

.game-root.is-battle.has-touch .stage, .game-root.is-battle .stage {
  padding-bottom: .35rem;
}

.game-root.is-battle .touch {
  display: none;
}

.game-root.classic-touch.is-dialog.has-touch .stage {
  padding-bottom: 132px;
}

.touch {
  z-index: 12;
  height: 132px;
  padding: .35rem .9rem calc(.55rem + env(safe-area-inset-bottom));
  pointer-events: none;
  background: linear-gradient(to top, #111812f0, #1d241b8c 70%, #0000);
  justify-content: space-between;
  align-items: center;
  display: none;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
}

.touch button {
  pointer-events: auto;
  touch-action: none;
}

.dpad {
  width: 116px;
  height: 116px;
  position: relative;
}

.dpad:before {
  content: "✦";
  color: #b99a65;
  background: #1c241c;
  border: 1px solid #9d7d4f;
  place-items: center;
  display: grid;
  position: absolute;
  inset: 36px;
}

.dpad .d {
  color: #f6e9cf;
  background: linear-gradient(145deg, #40382b, #201d19 75%);
  border: 1px solid #ccaa6c;
  border-radius: 6px;
  place-items: center;
  width: 44px;
  height: 44px;
  display: grid;
  position: absolute;
  box-shadow: inset 0 0 0 2px #17130f, inset 0 0 0 3px #896e46, 0 2px 4px #080a08b0;
}

.dpad .d:active, .a-btn:active, .b-btn:active {
  filter: brightness(1.25);
}

.dpad .d:focus-visible {
  box-shadow: inset 0 0 0 3px #fff3c7, inset 0 0 0 5px #56412b;
}

.dpad .up {
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 0 calc(100% - 8px));
}

.dpad .down {
  clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%, 0 8px);
}

.dpad .left {
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
}

.dpad .right {
  clip-path: polygon(8px 0, 100% 0, 100% 100%, 8px 100%, 0 calc(100% - 8px), 0 8px);
}

.dpad .up {
  top: 0;
  left: 36px;
}

.dpad .down {
  bottom: 0;
  left: 36px;
}

.dpad .left {
  top: 36px;
  left: 0;
}

.dpad .right {
  top: 36px;
  right: 0;
}

.ab {
  align-items: center;
  gap: .55rem;
  display: flex;
}

.a-btn, .b-btn {
  border: 2px solid #bd965e;
  border-radius: 999px;
  width: 60px;
  height: 60px;
  font-family: Georgia, Palatino Linotype, serif;
  font-size: 1.5rem;
  box-shadow: inset 0 0 0 3px #221c17, inset 0 0 0 4px #9c7b48, 0 3px 5px #080a08a8;
}

.a-btn {
  color: #30261e;
  background: radial-gradient(circle at 35% 25%, #fff5d8, #d1b78c);
}

.b-btn {
  color: #f4e7d2;
  background: radial-gradient(circle at 35% 25%, #55483a, #251e18);
}

@media (max-width: 820px), (pointer: coarse) and (max-width: 1100px) {
  .game-root.has-touch .stage {
    align-items: flex-start;
    padding-top: .2rem;
    padding-bottom: 132px;
  }

  .touch {
    display: flex;
  }

  .title-hint {
    display: none;
  }

  .title-confirm .title-hint {
    display: block;
  }

  .dialog {
    min-height: 88px;
    padding: .75rem .85rem 1rem;
    bottom: .45rem;
    left: .45rem;
    right: .45rem;
  }

  .dialog-text {
    font-size: .95rem;
  }

  .top-stack {
    gap: .3rem;
    top: .4rem;
    left: .4rem;
    right: .4rem;
  }

  .hud {
    gap: .3rem;
  }

  .hud-row {
    gap: .28rem;
  }

  .hud-chip {
    padding: .3rem .4rem;
  }

  .hud-place {
    font-size: .88rem;
  }

  .cmd {
    gap: .25rem;
    width: min(240px, 72%);
  }

  .cmd button, .btn-primary, .btn-ghost {
    min-height: 44px;
    padding: .45rem .8rem;
  }

  .battler {
    min-width: min(118px, 46%);
    padding: .32rem .45rem;
  }

  .meter-row {
    grid-template-columns: 1fr;
  }

  .battle-log {
    min-height: 40px;
    font-size: .82rem;
  }

  .battle-controls {
    max-height: min(58%, 100% - 5.5rem);
  }

  .battler.foe {
    max-width: min(128px, 42%);
  }

  .sheet {
    max-height: min(58dvh, 420px, 100% - 3.4rem);
    top: 2.9rem;
  }

  .game-root.is-ui-modal.has-touch .stage {
    padding-bottom: .35rem;
  }

  .title-copy {
    width: min(520px, 94%);
    padding: 0 0 1.15rem;
  }

  .title-word {
    font-size: clamp(2rem, 10vw, 3.2rem);
  }

  .title-plaque {
    padding: 1rem 1.1rem .9rem;
  }
}

@media (max-height: 700px) and (max-width: 820px) {
  .game-root.has-touch .stage {
    padding-bottom: 116px;
  }

  .touch {
    height: 116px;
    padding: .15rem .6rem calc(.2rem + env(safe-area-inset-bottom));
  }

  .dpad {
    width: 108px;
    height: 108px;
  }

  .dpad .d {
    width: 44px;
    height: 44px;
  }

  .dpad .up, .dpad .down {
    left: 32px;
  }

  .dpad .left, .dpad .right {
    top: 32px;
  }

  .dpad:before {
    inset: 32px;
  }

  .dpad .up {
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 12px 100%, 0 calc(100% - 12px));
  }

  .dpad .down {
    clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%, 0 12px);
  }

  .dpad .left {
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
  }

  .dpad .right {
    clip-path: polygon(12px 0, 100% 0, 100% 100%, 12px 100%, 0 calc(100% - 12px), 0 12px);
  }

  .a-btn, .b-btn {
    width: 48px;
    height: 48px;
  }
}

@media (orientation: landscape) and (max-height: 520px) {
  .game-root.has-touch .stage {
    align-items: center;
    padding: 0 132px;
  }

  .touch {
    background: none;
    height: auto;
    top: 0;
  }

  .battle-controls .battler.me {
    padding: .3rem .6rem;
  }

  .battle-controls .battler.me .meter-row {
    grid-template-columns: 1fr 1fr;
    gap: .2rem;
    display: grid;
  }

  .battle-controls .battler.me .meter-head .meter-kicker, .battle-controls .battler.me .meter-frac {
    font-size: .62rem;
  }

  .battle-controls .battle-log {
    min-height: 34px;
    padding: .35rem .6rem;
  }

  .battle-controls-actions .cmd {
    grid-template-columns: repeat(auto-fit, minmax(44px, 1fr));
    width: 100%;
  }

  .battle-controls-actions .cmd button {
    letter-spacing: .02em;
    padding-inline: .25rem;
    font-size: .8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .battle-status-zone, .btn-primary:active, .load-fill {
    transition: none;
  }
}

.empty {
  color: var(--color-muted);
  margin: .4rem 0;
}

.battle-controls {
  pointer-events: auto;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  align-items: stretch;
  gap: .35rem;
  max-height: min(65%, 100% - 5.75rem);
  display: grid;
  position: absolute;
  bottom: .6rem;
  left: .6rem;
  right: .6rem;
  overflow: hidden;
}

.battle-controls:has(.battle-recap) {
  grid-template-rows: auto auto minmax(3rem, 1fr) auto;
  max-height: min(80%, 100% - 5.75rem);
}

@media (orientation: landscape) and (max-height: 520px) {
  .battle-controls, .battle-controls:has(.battle-recap) {
    max-height: calc(100% - 3rem);
  }
}

.battle-controls-body {
  touch-action: pan-y;
  overscroll-behavior: contain;
  min-height: 0;
  overflow-y: auto;
}

.battle-controls-body.is-empty {
  display: none;
}

.battle-controls-actions {
  flex-wrap: wrap;
  flex-shrink: 0;
  justify-content: flex-end;
  align-items: stretch;
  gap: .35rem;
  display: flex;
}

.battle-controls .battler.me {
  align-self: flex-start;
  max-width: min(280px, 100%);
}

button:focus-visible {
  outline: 2px solid var(--color-copper);
  outline-offset: 3px;
}

button:disabled {
  opacity: .55;
  cursor: default;
}

.app-status {
  z-index: 13;
  text-align: center;
  max-width: min(28rem, 100% - 1rem);
  color: var(--color-parchment-dim);
  pointer-events: none;
  margin: 0;
  font-size: .72rem;
  line-height: 1.25;
  position: absolute;
  bottom: .35rem;
  left: 50%;
  transform: translateX(-50%);
}

.game-root.has-touch .app-status {
  bottom: calc(.45rem + env(safe-area-inset-bottom));
  max-width: 6.5rem;
  position: fixed;
}

@property --tw-rotate-x {
  syntax: "*";
  inherits: false
}

@property --tw-rotate-y {
  syntax: "*";
  inherits: false
}

@property --tw-rotate-z {
  syntax: "*";
  inherits: false
}

@property --tw-skew-x {
  syntax: "*";
  inherits: false
}

@property --tw-skew-y {
  syntax: "*";
  inherits: false
}

@property --tw-border-style {
  syntax: "*";
  inherits: false;
  initial-value: solid;
}

@property --tw-font-weight {
  syntax: "*";
  inherits: false
}

@property --tw-shadow {
  syntax: "*";
  inherits: false;
  initial-value: 0 0 #0000;
}

@property --tw-shadow-color {
  syntax: "*";
  inherits: false
}

@property --tw-shadow-alpha {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 100%;
}

@property --tw-inset-shadow {
  syntax: "*";
  inherits: false;
  initial-value: 0 0 #0000;
}

@property --tw-inset-shadow-color {
  syntax: "*";
  inherits: false
}

@property --tw-inset-shadow-alpha {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 100%;
}

@property --tw-ring-color {
  syntax: "*";
  inherits: false
}

@property --tw-ring-shadow {
  syntax: "*";
  inherits: false;
  initial-value: 0 0 #0000;
}

@property --tw-inset-ring-color {
  syntax: "*";
  inherits: false
}

@property --tw-inset-ring-shadow {
  syntax: "*";
  inherits: false;
  initial-value: 0 0 #0000;
}

@property --tw-ring-inset {
  syntax: "*";
  inherits: false
}

@property --tw-ring-offset-width {
  syntax: "<length>";
  inherits: false;
  initial-value: 0;
}

@property --tw-ring-offset-color {
  syntax: "*";
  inherits: false;
  initial-value: #fff;
}

@property --tw-ring-offset-shadow {
  syntax: "*";
  inherits: false;
  initial-value: 0 0 #0000;
}

@property --tw-outline-style {
  syntax: "*";
  inherits: false;
  initial-value: solid;
}

@property --tw-blur {
  syntax: "*";
  inherits: false
}

@property --tw-brightness {
  syntax: "*";
  inherits: false
}

@property --tw-contrast {
  syntax: "*";
  inherits: false
}

@property --tw-grayscale {
  syntax: "*";
  inherits: false
}

@property --tw-hue-rotate {
  syntax: "*";
  inherits: false
}

@property --tw-invert {
  syntax: "*";
  inherits: false
}

@property --tw-opacity {
  syntax: "*";
  inherits: false
}

@property --tw-saturate {
  syntax: "*";
  inherits: false
}

@property --tw-sepia {
  syntax: "*";
  inherits: false
}

@property --tw-drop-shadow {
  syntax: "*";
  inherits: false
}

@property --tw-drop-shadow-color {
  syntax: "*";
  inherits: false
}

@property --tw-drop-shadow-alpha {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 100%;
}

@property --tw-drop-shadow-size {
  syntax: "*";
  inherits: false
}
