/* The board remains interactive between the three independent lower controls. */
.field-console,
#fv-bottom.field-console {
  --brass: #d1aa69;
  --ink: #17151d;
  position: absolute;
  inset: auto max(14px, env(safe-area-inset-right))
    max(8px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  z-index: 28;
  display: grid;
  grid-template-columns: minmax(130px, 0.91fr) minmax(0, 2.55fr) minmax(
      172px,
      1.04fr
    );
  grid-template-areas: "flask hand dock";
  align-items: end;
  justify-content: normal;
  gap: clamp(6px, 1vw, 18px);
  pointer-events: none;
}
#fv-bottom.field-console {
  position: fixed;
}
.field-console > * {
  min-width: 0;
  pointer-events: auto;
}
.field-console [hidden],
.field-scroll [hidden] {
  display: none !important;
}
.field-console #field-tray,
.field-console .native-hand-tray {
  grid-area: hand;
  min-width: 0;
  width: 100%;
}
.field-console .field-tray,
.field-console .native-hand-tray {
  position: relative;
  inset: auto;
  transform: none;
  margin: 0;
  padding: 0;
  width: 100%;
  box-sizing: border-box;
  background: transparent;
  box-shadow: none;
  border: 0;
}
.field-console .hand-window {
  position: relative;
  min-width: 0;
}
.field-console .battle-hand,
.field-console #fv-hand {
  display: flex;
  justify-content: safe center;
  align-items: stretch;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 6px;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  padding: 5px 3px 3px;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: #8c7358 #1c171b40;
}
.field-console
  :is(
    .hand-toggle,
    .hand-nav button,
    .hand-aim,
    .field-actions button,
    .field-actions summary
  ) {
  border: 1px solid #9d7e52;
  border-radius: 4px;
  padding: 4px 6px;
  background: linear-gradient(#39302b, #211c22);
  color: #f5e7ca;
  cursor: pointer;
  font:
    650 11px/1.1 Inter,
    system-ui,
    sans-serif;
}
.field-console .hand-label {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 0;
  margin: 0 3px;
  justify-content: flex-end;
}
.field-console .hand-label small {
  color: #e9dcbf;
  font:
    600 9px/1 Inter,
    system-ui,
    sans-serif;
  text-shadow: 0 1px 3px #000;
}
.field-console .hand-toggle {
  display: flex;
  gap: 4px;
  align-items: center;
  min-height: 22px;
  padding: 2px 5px;
  opacity: 0.86;
}
.field-console .hand-toggle i {
  font-style: normal;
}
.field-console .hand-nav:not([hidden]) {
  display: flex;
  gap: 3px;
}
.field-console .hand-nav button {
  width: 29px;
  height: 26px;
  padding: 0;
  font-size: 18px;
}
.field-console .hand-nav button:disabled {
  opacity: 0.45;
}
.field-console .field-actions {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 0;
  width: 100%;
}
.field-console .field-actions:not(:has(button, details, .selected-target)) {
  display: none;
}
.field-console .field-selection:has(.field-prompt),
.field-console .turn-actions:empty {
  display: none;
}
.field-console .field-actions button,
.field-console .field-actions summary,
.field-console .hand-aim {
  min-height: 27px;
}
.field-console .selected-unit,
.field-console .selected-target {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 2px 7px;
  min-height: 28px;
  background: #211c25ed;
  color: #fae8bb;
  border-radius: 4px;
}
.field-console .selected-unit img {
  width: 23px;
  height: 23px;
  object-fit: cover;
}
.field-console .selected-unit small,
.field-console .selected-target small {
  display: block;
  color: #e4d6c3;
  font:
    10px/1.12 Inter,
    system-ui,
    sans-serif;
}
.field-console .selected-target b {
  font-size: 12px;
}
.field-console .unit-orders {
  position: static;
  margin: 0;
}
.field-console .order-list {
  position: absolute;
  z-index: 9;
  inset: auto 0 calc(100% + 4px);
  width: auto;
  max-height: min(34vh, 188px);
  overflow: auto;
  padding: 8px;
  background: #211b23;
  border: 1px solid #a58758;
  border-radius: 5px;
}
.field-console .order-list select {
  min-width: 0;
  max-width: 100%;
}
.field-console [data-hint] {
  color: #2a1c12;
  border-color: #f9d986;
  background: linear-gradient(#ffe5a4, #c89a4e);
}
.native-hand-tray #fv-hint {
  position: static;
  inset: auto;
  transform: none;
  overflow-wrap: anywhere;
  margin: 0 2px;
  max-width: 100%;
  padding: 2px 6px;
  border: 0;
  box-shadow: none;
  background: #201b24d6;
  color: #f6dfb1;
  font:
    600 10px/1.3 Inter,
    system-ui,
    sans-serif;
  text-align: center;
  border-radius: 3px;
}
.native-hand-tray #fv-hint:empty {
  display: none;
}

.field-print {
  --metal: #a98d68;
  --high: #e4cca3;
  --dark: #453021;
  --edge: #735b45;
  --gem: #c9a76e;
  --rail: 3px;
  position: relative;
  flex: 0 0 clamp(91px, calc((100% - 24px) / 5), 170px);
  aspect-ratio: 1.015;

  isolation: isolate;
}
.field-print[data-rarity="Rare"] {
  --metal: #a4aeb0;
  --high: #f1e8cb;
  --dark: #34404b;
  --edge: #719bb8;
  --gem: #aad8ff;
  --rail: 3px;
}
.field-print[data-rarity="Legendary"] {
  --metal: #db9e40;
  --high: #fff0a0;
  --dark: #563319;
  --edge: #b67831;
  --gem: #ffdc78;
  --rail: 4px;
}
.field-print[data-rarity="Mythic"] {
  --metal: #cfaa65;
  --high: #ffebc9;
  --dark: #3e294b;
  --edge: #b691ee;
  --gem: #dec5ff;
  --rail: 4px;
}
.field-print .field-print-play {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template: "cost" auto "shortfall" auto "caption" minmax(0, 1fr) / minmax(0, 1fr);
  justify-items: start;
  align-items: start;
  margin: 0;
  padding: 4px 5px 6px;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border-radius: 9px;
  cursor: pointer;
  text-align: left;
  color: #fff2df;
  border: 1px solid var(--high);
  background: linear-gradient(
    145deg,
    var(--high),
    var(--dark) 15%,
    var(--metal) 26%,
    var(--dark) 55%,
    var(--high) 70%,
    var(--metal)
  );
  box-shadow:
    0 0 0 1px var(--dark),
    0 0 0 2px var(--edge),
    0 4px 9px #17111ac7;
  transition:
    transform 0.14s ease,
    box-shadow 0.14s ease;
  touch-action: manipulation;
}
.field-print .field-print-play[aria-pressed="true"],
.field-print .field-print-play:focus-visible {
  outline: 2px solid #edc6ff;
  outline-offset: 1px;
  transform: translateY(-2px);
  box-shadow:
    0 0 0 3px #ad6cf6,
    0 0 11px #a255ffe0;
}
@media (hover: hover) {
  .field-print .field-print-play:hover {
    transform: translateY(-2px);
    box-shadow:
      0 0 0 1px var(--high),
      0 0 9px var(--edge);
  }
}
.field-print .print-image,
.field-print .print-mount {
  position: absolute;
  inset: var(--rail);
  border-radius: 6px;
  overflow: hidden;
}
.field-print .print-image {
  background: #241c22;
}
.field-print .print-art,
.field-print .print-standard,
.print-standard-art {
  display: block;
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  object-position: 50% 32%;
  border: 0;
  margin: 0;
}
.field-print-play[aria-disabled="true"] .print-image {
  filter: saturate(0.8) brightness(0.87);
}
.field-print .print-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    0deg,
    #120f17fa 3%,
    #171119f5 20%,
    #191118a1 37%,
    transparent 60%
  );
}
.field-print .print-standard {
  display: grid;
  align-content: start;
  justify-items: center;
  position: relative;
  text-align: center;
  color: #ffdaa0;
  padding-top: 22%;
  background: #3d3136;
}
.print-standard-art {
  position: absolute;
  inset: 0;
  filter: brightness(0.48) saturate(0.65);
}
.print-standard b,
.print-standard small {
  position: relative;
  text-shadow: 0 1px 3px #110c13;
}
.print-standard b {
  font:
    20px/1 Georgia,
    serif;
}
.print-standard small {
  font:
    700 8px/1.1 Inter,
    system-ui,
    sans-serif;
}
.field-print .print-mount {
  pointer-events: none;
  inset: 2px;
  border: 1px solid color-mix(in srgb, var(--high) 64%, transparent);
  border-radius: 6px;
}
.field-print[data-rarity="Rare"] .print-mount {
  box-shadow: inset 0 0 0 1px #44617e85;
}
.field-print[data-rarity="Legendary"] .print-mount,
.field-print[data-rarity="Mythic"] .print-mount {
  background:
    linear-gradient(
        135deg,
        var(--high) 0 2px,
        var(--dark) 3px,
        var(--metal) 4px 6px,
        transparent 7px
      )
      top left/16px 16px no-repeat,
    linear-gradient(
        315deg,
        var(--high) 0 2px,
        var(--dark) 3px,
        var(--metal) 4px 6px,
        transparent 7px
      )
      bottom right/16px 16px no-repeat;
}
.field-print[data-rarity="Mythic"] .print-mount {
  box-shadow:
    inset 0 0 0 1px #c5a8ff,
    inset 0 0 7px #a775df;
}
.field-print .print-cost {
  grid-area: cost;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background-color: rgb(16 24 36 / 94%);
  border-radius: 3px;
  padding: 2px 4px 2px 3px;
  color: #f7f8fa;
  font: 700 clamp(12px, 1.1vw, 18px) / 1.05 Inter, system-ui, sans-serif;
  font-variant-numeric: lining-nums tabular-nums;
  text-shadow: none;
}
.field-print .print-cost::before,
.mini-crystal {
  content: "";
  display: inline-block;
  width: 10px;
  height: 14px;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  background: conic-gradient(
    from 45deg,
    #b6ffff,
    #2889d7,
    #133f8e,
    #4fd4ff,
    #e2ffff,
    #599deb,
    #c6ffff
  );
}
.field-print .print-engraving {
  grid-area: caption;
  position: relative;
  align-self: end;
  justify-self: stretch;
  max-height: 100%;
  margin-inline: 2px 1px;
  overflow: hidden;
  padding: 0 15px 0 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  background: none;
  color: #fff3de;
}
.field-print .print-type {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  width: fit-content;
  margin: 0;
  padding: 1px 3px;
  border: 1px solid #77634266;
  border-radius: 2px;
  background: #141017ae;
  color: #ead9a8;
  font:
    750 clamp(7px, 0.58vw, 10px) / 1.1 Inter,
    system-ui,
    sans-serif;
  letter-spacing: 0.015em;
  text-transform: uppercase;
}
.print-type::before {
  content: "✦";
  color: var(--gem);
  font-size: 0.77em;
}
.field-print .print-name {
  display: block;
  max-width: 100%;
  font:
    700 clamp(10px, 0.95vw, 17px) / 1.03 Georgia,
    serif;
  text-align: left;
  color: #fff1db;
  overflow-wrap: normal;
  word-break: normal;
  text-shadow: 0 1px 3px #030206;
}
.field-print .print-grade {
  position: absolute;
  right: 0;
  top: auto;
  bottom: 0;
  display: none;
}
.field-print::after {
  content: "";
  pointer-events: none;
  position: absolute;
  right: 7px;
  top: 6px;
  width: 5px;
  height: 5px;
  transform: rotate(45deg);
  background: var(--gem);
  box-shadow: 0 0 2px #080910;
}
.field-print[data-rarity="Rare"]::after {
  box-shadow: -5px 5px var(--gem);
}
.field-print[data-rarity="Legendary"]::after {
  box-shadow:
    -5px 5px var(--gem),
    -10px 10px var(--gem);
}
.field-print[data-rarity="Mythic"]::after {
  box-shadow:
    -5px 5px var(--gem),
    -10px 10px var(--gem),
    -15px 15px var(--gem);
}
.field-print .field-print-inspect {
  position: absolute;
  right: 2px;
  bottom: 2px;
  z-index: 2;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  font:
    italic 700 10px/1 Georgia,
    serif;
  color: #f1d49f;
  background: radial-gradient(
    circle,
    #211921 0 34%,
    #c8ad70 36% 41%,
    #34231b 43% 47%,
    transparent 50%
  );
  cursor: pointer;
}
.field-print .print-shortfall {
  grid-area: shortfall;
  position: relative;
  margin-top: 2px;
  padding: 1px 4px;
  border-radius: 2px;
  background: #2f1a22dc;
  color: #f8dbba;
  font:
    650 8px/1.2 Inter,
    sans-serif;
}
.field-print-inspect:focus-visible,
.field-console button:focus-visible,
.field-console summary:focus-visible,
.field-scroll button:focus-visible {
  outline: 2px solid #fff0ac;
  outline-offset: 1px;
}

/* A 150-crystal scale on glass and faceted ten-step readout. */
.field-vial {
  position: relative;
  grid-area: flask;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 0;
  padding: 0;
  line-height: 1;
  color: #d9eaff;
  filter: drop-shadow(0 2px 3px #080411a8);
}
.vial-art {
  position: relative;
  width: clamp(74px, 9.1vw, 157px);
  aspect-ratio: 350/420;
  flex: 0 0 auto;
  z-index: 1;
}
.vial-bezel,
.vial-glass {
  position: absolute;
  inset: 0;
}
.vial-bezel {
  background: url("./crystal-vial.webp") center/100% 100% no-repeat;
  pointer-events: none;
}
.vial-glass {
  inset: 29% 13% 16%;
  border-radius: 50%;
  overflow: hidden;
  background: radial-gradient(ellipse at 31% 19%, #9acbfa80, transparent 16%),
    radial-gradient(ellipse at 58% 67%, #112755e6, #0c1c3080 68%, #a5daee8f 99%);
}
.vial-liquid {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--crystal-fill, 0) * 100%);
  border-radius: 37% 48% 0 0 / 7% 7% 0 0;
  background: linear-gradient(
    165deg,
    #c1f8ff 0%,
    #168bd7 9%,
    #0d76c7 35%,
    #1948ad 72%,
    #3869dd
  );
  box-shadow: inset 0 2px 4px #a6ffffa8;
}
.vial-liquid i {
  position: absolute;
  left: 3%;
  bottom: 0;
  width: 22%;
  height: 63%;
  clip-path: polygon(50% 0, 98% 37%, 77% 100%, 18% 92%, 0 32%);
  background: conic-gradient(
    from 35deg at 49% 38%,
    #93f6ff 0 18%,
    #329adf 19% 37%,
    #1649b3 38% 54%,
    #30b3ef 55% 73%,
    #d0fcff 74% 88%,
    #6bd9ff 89%
  );
  transform: rotate(-24deg);
}
.vial-liquid i:nth-child(2) {
  left: 16%;
  bottom: 9%;
  height: 85%;
  transform: rotate(-12deg);
}
.vial-liquid i:nth-child(3) {
  left: 32%;
  bottom: -7%;
  height: 72%;
  transform: rotate(-7deg);
}
.vial-liquid i:nth-child(4) {
  left: 45%;
  height: 98%;
  transform: rotate(13deg);
}
.vial-liquid i:nth-child(5) {
  left: 58%;
  bottom: -9%;
  height: 80%;
  transform: rotate(32deg);
}
.vial-liquid i:nth-child(6) {
  left: 73%;
  height: 67%;
  transform: rotate(28deg);
}
.vial-liquid i:nth-child(7) {
  left: 41%;
  bottom: -13%;
  height: 60%;
  transform: rotate(-17deg);
}
.vial-readout {
  min-width: 0;
  flex: 1;
  position: relative;
  margin-left: -9%;
  padding: 9px 6px 7px 8%;
  margin-bottom: 3px;
  border: 1px solid #85719c;
  border-radius: 4px 14px 14px 6px;
  background: linear-gradient(150deg, #19162ace, #10111fe6);
  box-shadow:
    inset 0 0 0 2px #252334,
    0 0 7px #7370a866;
  text-shadow: 0 2px 4px #08060e;
  white-space: nowrap;
}
.vial-label {
  position: absolute;
  left: 13%;
  top: -9px;
  color: #a9c9ed;
  font:
    650 8px/1.1 Inter,
    system-ui,
    sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: #131322cc;
  padding: 1px 3px;
  border-radius: 2px;
}
.vial-count {
  font:
    700 clamp(18px, 2.05vw, 35px) / 1 Georgia,
    serif;
  color: #f3eeed;
  font-variant-numeric: tabular-nums;
}
.vial-scale {
  color: #aacded;
  font:
    700 clamp(10px, 1.25vw, 23px) / 1 Georgia,
    serif;
}
.vial-reserve {
  display: block;
  color: #bdefff;
  font:
    650 8px/1.1 Inter,
    system-ui,
    sans-serif;
}
.vial-reserve:empty {
  display: none;
}
.vial-pips {
  margin-top: 5px;
  display: flex;
  gap: 2px;
  align-items: center;
  justify-content: flex-start;
}
.vial-pips i {
  position: relative;
  width: clamp(4px, 0.7vw, 12px);
  aspect-ratio: 0.72;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  background: #686b82;
}
.vial-pips i::before,
.vial-pips i::after {
  position: absolute;
  content: "";
  inset: 1px;
  clip-path: inherit;
  background: #171727;
}
.vial-pips i::after {
  background: conic-gradient(
    from 25deg,
    #c3fcff,
    #51caff,
    #1f58b7,
    #b8feff,
    #4b95e5,
    #c3fcff
  );
  opacity: var(--lit, 0);
}
.vial-change {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 47%;
  padding: 0 4px;
  font:
    800 clamp(17px, 2.15vw, 35px) / 1 Georgia,
    serif;
  opacity: 0;
  pointer-events: none;
}
.field-vial[data-flow] .vial-change {
  opacity: 1;
}
.field-vial[data-flow="gain"] .vial-change {
  color: #bcff84;
  text-shadow:
    0 1px 2px #152716,
    0 0 7px #6dcc36,
    0 0 18px #54d91a;
}
.field-vial[data-flow="spend"] .vial-change {
  color: #ffac92;
  text-shadow:
    0 1px 2px #351314,
    0 0 7px #c34330,
    0 0 15px #ca4035;
}
.vial-live {
  position: absolute;
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.field-dock {
  grid-area: dock;
  align-self: end;
  justify-self: end;
  position: relative;
  width: min(100%, 300px);
  min-width: 0;
}
.hud-rail,
.hud-turn {
  display: flex;
  position: relative;
  justify-content: flex-end;
  gap: clamp(4px, 0.52vw, 9px);
  align-items: center;
}
.hud-rail {
  --field-tool-size: clamp(29px, 3.2vw, 47px);
  margin: 0 0 clamp(5px, 1vh, 10px);
}
.hud-rail > * {
  flex: none;
}
.hud-turn {
  align-items: stretch;
}
.field-command-dock,
.hud-audio,
.native-dock {
  position: relative;
}
.hud-rail .hud-icon,
.hud-rail .hud-audio .sound-adjust > summary,
.hud-turn button,
.field-scroll .scroll-tab {
  display: grid;
  place-items: center;
  position: relative;
  min-width: 0;
  box-sizing: border-box;
  margin: 0;
  isolation: isolate;
  list-style: none;
  cursor: pointer;
  transition: border-color 120ms ease, filter 120ms ease;
  color: #ebc786;
  border: 1px solid #e7c886;
  border-radius: 7px;
  background: linear-gradient(135deg, #30282c, #19161c 48%, #30262a);
  box-shadow:
    inset 0 0 0 2px #41332e,
    inset 0 0 0 3px #826743,
    0 2px 5px #100c13b8;
}
.hud-rail .hud-icon,
.hud-rail .hud-audio .sound-adjust > summary {
  width: var(--field-tool-size);
  height: var(--field-tool-size);
  min-height: var(--field-tool-size);
  padding: 2px;
  font:
    700 clamp(17px, 1.8vw, 26px) / 1 Georgia,
    serif;
  text-shadow: 0 1px 2px #060207;
}
.hud-rail .hud-icon:hover,
.hud-rail .hud-audio .sound-adjust > summary:hover,
.hud-turn button:hover {
  border-color: #fff7bb;
  filter: brightness(1.13);
}
.hud-rail .hud-icon::-webkit-details-marker,
.hud-audio .sound-adjust > summary::-webkit-details-marker {
  display: none;
}
.hud-rail .hud-flag {
  color: #d88b75;
}
.hud-audio .sound-adjust {
  position: relative;
  margin: 0;
}
.hud-rail .hud-audio .sound-adjust > summary {
  font-size: 0;
}
.hud-audio .sound-adjust > div {
  top: auto;
  bottom: calc(100% + 5px);
  right: 0;
  z-index: 7;
}
.hud-turn button {
  min-width: max-content;
  font:
    700 clamp(12px, 1.28vw, 21px) / 1 Georgia,
    serif;
  padding: clamp(7px, 0.8vw, 14px) 7px;
  white-space: nowrap;
}
.hud-turn :is([data-end], #fv-end) {
  flex: 1.65;
  color: #fff0bc;
  font-variant: small-caps;
  text-transform: none;
  font-weight: 700;
  letter-spacing: 0.025em;
  font-size: clamp(15px, 1.8vw, 26px);
  border-color: #fff0b9;
  background: linear-gradient(
    168deg,
    #735221,
    #896328 36%,
    #493113 78%,
    #795423
  );
  box-shadow:
    inset 0 0 0 2px #a07939,
    inset 0 0 0 3px #f1d590,
    inset 0 -6px 13px #38240f59,
    0 0 7px #dea54775;
}
.hud-turn :is([data-end], #fv-end)::before {
  display: inline;
  content: "⌛︎";
  margin-right: 5px;
  font-size: 0.8em;
}
.hud-turn :is([data-end], #fv-end) {
  display: flex;
  align-items: center;
  justify-content: center;
}
.hud-turn :is([data-retreat], [data-act="withdraw"]) {
  flex: 0.9;
  padding-inline: 4px;
  font-size: clamp(11px, 1.02vw, 17px);
  font-weight: 600;
  color: #e6d9c2;
  border-color: #a2947f;
}
.hud-turn :is([data-end], #fv-end):disabled,
.guided-turn .hud-turn [data-end] {
  filter: saturate(0.52) brightness(0.85);
}
.field-console .field-tools,
.field-console #fv-actions {
  position: absolute;
  inset: auto 0 calc(100% + 7px) auto;
  z-index: 6;
  display: grid;
  width: 167px;
  max-width: none;
  box-sizing: border-box;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 6px;
  background: #211b23fa;
  border: 1px solid #b99b64;
  border-radius: 6px;
  box-shadow: 0 4px 14px #100b1699;
}
.field-console .field-tools button,
.field-console #fv-actions button {
  min-height: 28px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  padding: 3px 4px;
  margin: 0;
  color: #f6e7c7;
  border: 1px solid #726047;
  border-radius: 3px;
  background: #332931;
  font:
    650 10px/1.1 Inter,
    system-ui,
    sans-serif;
  cursor: pointer;
}
.field-tools button[aria-pressed="true"] {
  outline: 1px solid #e1bc72;
}
.field-tools .fv-btn-row {
  display: contents;
}
.field-tools [data-cam="follow"],
.field-tools [data-cam="company"] {
  grid-column: 1/-1;
}
.native-dock #fv-right {
  display: none;
  position: absolute;
  inset: auto 0 calc(100% + 8px) auto;
  width: min(222px, 45vw);
  max-height: 46vh;
  overflow: auto;
  z-index: 7;
  background: #241c23;
  border: 1px solid #a58958;
  border-radius: 5px;
  pointer-events: auto;
}
body.practice-map-open .native-dock #fv-right {
  display: flex;
}
body.practice-map-open .native-dock #fv-actions {
  right: calc(min(222px, 45vw) + 7px);
  z-index: 8;
}
.roster-side,
.practice-field-modal .fv-side {
  margin-block: 9px;
  padding: 8px;
  background: #231c24;
  border: 1px solid #716046;
  border-radius: 5px;
}
.roster-side h3 {
  margin: 0 0 6px;
  color: #e5c287;
}
.roster-side p {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 3px 0;
}
.roster-side small {
  color: #cdbda9;
}
#practice-hand-detail,
.practice-field-modal {
  width: min(340px, 90vw);
  max-height: 80dvh;
  overflow: auto;
  padding: 16px;
  color: #fae6c3;
  background: #241c21;
  border: 1px solid #b18a5d;
  border-radius: 7px;
}
#practice-hand-detail::backdrop,
.practice-field-modal::backdrop {
  background: #110e16ab;
}
#practice-hand-detail img {
  width: 100%;
  max-height: 250px;
  object-fit: cover;
  border-radius: 5px;
}
#practice-hand-detail h2,
.practice-field-modal h2 {
  font:
    700 21px/1.2 Georgia,
    serif;
  margin: 7px 0;
}
#practice-hand-detail > button,
.practice-field-modal button {
  padding: 5px 9px;
  color: #fbe4b6;
  background: #33272d;
  border: 1px solid #b29764;
  border-radius: 4px;
}
#practice-hand-detail > button {
  position: absolute;
  right: 20px;
  top: 20px;
}
#practice-hand-detail p,
.practice-field-modal p {
  font:
    14px/1.45 Inter,
    system-ui,
    sans-serif;
}

/* Gilded battlefield furniture. The mission content and its button remain separate. */
.field-scroll.field-objectives,
#fv-top.field-head,
#field-head.field-head {
  position: absolute;
  z-index: 25;
  box-sizing: border-box;
  color: #f0e7d8;
  border: 1px solid #e1c28b;
  border-radius: 9px;
  background: linear-gradient(125deg, #31242aef, #1e1b24fa 44%, #17151bf5);
  box-shadow:
    inset 0 0 0 2px #36282a,
    inset 0 0 0 3px #90704c,
    0 2px 5px #130e16b5;
}
.field-scroll.field-objectives {
  top: max(10px, env(safe-area-inset-top));
  left: max(22px, env(safe-area-inset-left));
  width: clamp(215px, 24vw, 390px);
  max-height: 60vh;
  overflow: visible;
  padding: 9px 13px 9px 40px;
}
.field-scroll [data-scroll-body] {
  max-height: calc(60vh - 24px);
  overflow: auto;
  scrollbar-width: thin;
}
.field-scroll .field-chapter {
  display: block;
}
.field-scroll .kicker {
  margin: 0 26px 2px 0;
  color: #e0bd7e;
  font:
    650 clamp(9px, 0.8vw, 14px) / 1.05 Georgia,
    serif;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}
.field-scroll .kicker::before {
  content: "✥";
  margin-right: 5px;
  color: #e3bd73;
}
.field-scroll h2 {
  margin: 1px 15px 5px 0;
  color: #fcf1df;
  font:
    700 clamp(17px, 1.55vw, 28px) / 1.05 Georgia,
    serif;
  font-variant: small-caps;
}
.field-scroll .scroll-banner {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: start center;
  top: -3px;
  left: -11px;
  width: clamp(31px, 3.7vw, 58px);
  height: clamp(50px, 5.5vw, 83px);
  padding-top: 15%;
  box-sizing: border-box;
  isolation: isolate;
  background: linear-gradient(
    100deg,
    #9f733b,
    #e4c381 12%,
    #997143 66%,
    #f4d799
  );
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 77%, 0 100%);
  font:
    normal 700 clamp(17px, 2vw, 32px) / 1 Georgia,
    serif;
  color: #edce8c;
  text-shadow: 0 1px 2px #26150b;
}
.field-scroll .scroll-banner::before {
  position: absolute;
  content: "";
  inset: 2px 3px 4px;
  z-index: -1;
  clip-path: inherit;
  background: linear-gradient(
    100deg,
    #442126,
    #873d37 35%,
    var(--faction-dark, #602831) 72%,
    #441c25
  );
}
.field-scroll .scroll-banner {
  padding-top: 9px;
}
.field-scroll .scroll-tab {
  position: absolute;
  right: 4px;
  top: 4px;
  min-width: 25px;
  width: 25px;
  height: 25px;
  font:
    700 17px/1 Georgia,
    serif;
  z-index: 2;
}
.field-scroll[data-folded] {
  width: 42px;
  height: 42px;
  min-width: 0;
  padding: 0;
}
.field-scroll[data-folded] .scroll-tab {
  inset: 0;
  width: 100%;
  height: 100%;
}
.field-scroll[data-folded] .scroll-tab span {
  transform: rotate(180deg);
}
.field-scroll .objective-line,
.field-scroll .support-objective {
  display: flex;
  gap: 6px;
  margin: 5px 0;
  align-items: baseline;
  line-height: 1.2;
}
.field-scroll .objective-line span,
.field-scroll .support-objective span {
  font:
    650 clamp(10px, 0.86vw, 15px) / 1.24 Inter,
    system-ui,
    sans-serif;
  color: #eee5d6;
}
.field-scroll .objective-line i,
.field-scroll .support-objective i {
  font-style: normal;
  color: #edcd89;
}
.field-scroll .field-numbers,
.field-scroll .carrier-label {
  margin: 4px 0;
  font:
    600 clamp(9px, 0.8vw, 12px) / 1.2 Inter,
    system-ui,
    sans-serif;
  color: #d9cab2;
}
.field-scroll .field-numbers::before {
  content: "□";
  margin-right: 7px;
  color: #d2be9b;
}
.field-scroll .field-lesson {
  margin: 5px 0 0;
  font:
    600 11px/1.28 Inter,
    system-ui,
    sans-serif;
}
.field-scroll .field-lesson summary {
  color: #dbc9a6;
  cursor: pointer;
}
.field-scroll .field-lesson p {
  margin: 5px 0;
  color: #dfd5c4;
  font-weight: 500;
}
.field-scroll #fv-inspect {
  position: static;
  inset: auto;
  width: 100%;
  max-height: 25vh;
  overflow: auto;
  box-sizing: border-box;
  padding: 5px;
  border: 0;
  background: #221c23;
}
#field-head.field-head,
#fv-top.field-head {
  inset: max(10px, env(safe-area-inset-top))
    max(14px, env(safe-area-inset-right)) auto auto;
  min-width: 0;
  width: auto;
  max-width: 35vw;
  padding: 7px 12px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
}
#fv-top.field-head #fv-turn {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  background: none;
  border: 0;
  box-shadow: none;
  padding: 0;
}
.field-head .status-tower {
  flex: 0 0 auto;
  display: block;
  width: clamp(30px, 4.2vw, 61px);
  height: clamp(36px, 4.4vw, 68px);
  object-fit: contain;
  filter: sepia(0.28) brightness(1.16) drop-shadow(0 0 4px #e5ba8452);
}
.field-head .status-copy {
  min-width: 0;
  text-align: left;
}
.field-head .status-copy > strong {
  display: block;
  color: #f3dba6;
  font:
    700 clamp(11px, 1.07vw, 19px) / 1.1 Georgia,
    serif;
  font-variant: small-caps;
}
.field-head .status-copy > .turn-sign {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 2px 0;
  color: #ece7da;
  font:
    650 clamp(10px, 0.95vw, 17px) / 1.1 Georgia,
    serif;
}
.field-head .turn-sign i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e98c76;
  box-shadow: 0 0 5px #b26456;
}
.field-head .turn-sign[data-active="true"] i {
  background: #96ec76;
  box-shadow: 0 0 6px #8deb67;
}
.field-head .status-copy > small {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 4px;
  padding-top: 3px;
  border-top: 1px solid #7e684d70;
  color: #f2e7cf;
  font:
    650 clamp(9px, 0.79vw, 14px) / 1.05 Georgia,
    serif;
  white-space: nowrap;
}
.field-head .status-copy > small > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.mini-crystal {
  width: 7px;
  height: 11px;
}
.mini-deck {
  width: 8px;
  height: 10px;
  border-radius: 1px;
  transform: rotate(8deg);
  background: linear-gradient(130deg, #534029, #ecd19e 35%, #9f7955);
  box-shadow: -2px 1px #846743;
}

@media (max-width: 900px) {
  .field-console,
  #fv-bottom.field-console {
    grid-template-columns: minmax(94px, 0.87fr) minmax(0, 2.8fr) minmax(
        135px,
        0.93fr
      );
    gap: 6px;
  }
  .field-print {
    flex-basis: clamp(76px, calc((100% - 20px) / 5), 145px);
  }
  .field-console .battle-hand,
  .field-console #fv-hand {
    gap: 5px;
  }
  .hud-rail {
    gap: 4px;
  }
  .field-scroll.field-objectives {
    padding-left: 33px;
  }
}
@media (max-width: 620px) and (orientation: portrait) {
  .field-console,
  #fv-bottom.field-console {
    inset-inline: max(6px, env(safe-area-inset-left))
      max(6px, env(safe-area-inset-right));
    bottom: max(5px, env(safe-area-inset-bottom));
    grid-template-columns: clamp(59px, 17.5vw, 91px) minmax(0, 1fr);
    grid-template-areas: "flask hand" "flask dock";
    column-gap: 5px;
    row-gap: 2px;
  }
  .field-console .battle-hand,
  .field-console #fv-hand {
    justify-content: safe flex-start;
    gap: 5px;
    padding: 4px 2px 3px;
  }
  .field-print {
    flex-basis: clamp(90px, 24.5vw, 117px);
  }
  .field-print .print-cost {
    font-size: 13px;
  }
  .field-print .print-engraving {
    margin-inline: 0;
    padding-right: 13px;
    gap: 2px;
  }
  .field-print .print-name {
    font-size: 11px;
  }
  .field-print .print-type {
    font-size: 7px;
  }
  .field-console .hand-label {
    justify-content: space-between;
  }
  .field-console .hand-label small {
    margin-right: auto;
  }
  .field-console .hand-toggle,
  .field-console .hand-nav button {
    min-height: 25px;
  }
  .field-console .hand-nav button {
    height: 25px;
    width: 30px;
  }
  .field-vial {
    align-self: end;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .vial-art {
    width: 100%;
  }
  .vial-readout {
    margin: -6px 0 0;
    z-index: 2;
    padding: 6px 3px 4px;
    border-radius: 5px;
    width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
    text-align: center;
  }
  .vial-label {
    left: 8%;
    top: -7px;
    font-size: 6px;
  }
  .vial-count {
    font-size: 17px;
  }
  .vial-scale {
    font-size: 9px;
  }
  .vial-pips {
    justify-content: center;
    gap: 1px;
    margin-top: 2px;
  }
  .vial-pips i {
    width: 4px;
  }
  .vial-change {
    top: -7px;
    left: 47%;
    font-size: 19px;
  }
  .field-dock {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 5px;
  }
  .hud-rail {
    --field-tool-size: clamp(26px, 7.4vw, 32px);
    margin: 0;
    gap: 2px;
    flex: 1;
    justify-content: flex-end;
  }
  .hud-rail .hud-icon,
  .hud-rail .hud-audio .sound-adjust > summary {
    font-size: 15px;
    border-radius: 4px;
  }
  .hud-rail .hud-audio .sound-adjust > summary {
    font-size: 0;
  }
  .hud-turn {
    flex: 1;
    gap: 3px;
  }
  .hud-turn button,
  .hud-turn :is([data-end], #fv-end) {
    padding: 4px 4px;
    min-height: 44px;
    border-radius: 4px;
    font-size: 12px;
  }
  .hud-turn :is([data-end], #fv-end)::before {
    content: none;
  }
  .hud-turn :is([data-retreat], [data-act="withdraw"]) {
    font-size: 10px;
  }
  .field-console :is(.field-actions button, .field-actions summary) {
    min-height: 26px;
    font-size: 10px;
  }
  .field-scroll.field-objectives {
    top: 6px;
    left: 10px;
    width: min(52vw, 235px);
    padding: 8px 6px 6px 22px;
    max-height: 38vh;
  }
  .field-scroll [data-scroll-body] {
    max-height: calc(38vh - 16px);
  }
  .field-scroll[data-folded] {
    width: 32px;
    height: 32px;
    padding: 0;
  }
  .field-scroll .scroll-banner {
    width: 25px;
    height: 40px;
    left: -6px;
    font-size: 14px;
    padding-top: 5px;
  }
  .field-scroll .scroll-tab {
    min-width: 21px;
    width: 21px;
    height: 22px;
    top: 3px;
    right: 3px;
  }
  .field-scroll[data-folded] .scroll-tab {
    inset: 0;
    width: 100%;
    height: 100%;
  }
  .field-scroll h2 {
    font-size: 14px;
  }
  .field-scroll .kicker {
    font-size: 8px;
  }
  .field-scroll .objective-line span,
  .field-scroll .support-objective span,
  .field-scroll .field-lesson {
    font-size: 9px;
  }
  #field-head.field-head,
  #fv-top.field-head {
    top: 6px;
    right: 6px;
    padding: 6px;
    gap: 3px;
    max-width: 44vw;
  }
  .field-head .status-tower {
    width: 20px;
    height: 30px;
  }
  .field-head .status-copy > strong {
    font-size: 10px;
  }
  .field-head .status-copy > .turn-sign,
  .field-head .status-copy > small {
    font-size: 8px;
  }
  .field-head .status-copy > small {
    gap: 5px;
  }
  .field-head .turn-sign i {
    width: 5px;
    height: 5px;
  }
  .hud-audio .sound-adjust > div {
    right: -65px;
  }
  .field-console .field-tools,
  .field-console #fv-actions {
    width: 138px;
  }
  body.practice-map-open .native-dock #fv-actions {
    right: auto;
    left: -8px;
    bottom: calc(100% + 3px);
  }
  body.practice-map-open .native-dock #fv-right {
    right: 0;
    bottom: calc(100% + 143px);
    max-height: 32vh;
  }
  .field-console .field-selection:has(.field-prompt) {
    display: none;
  }
}
@media (max-height: 540px) and (orientation: landscape) {
  .field-console,
  #fv-bottom.field-console {
    inset-inline: max(8px, env(safe-area-inset-left))
      max(8px, env(safe-area-inset-right));
    bottom: max(4px, env(safe-area-inset-bottom));
    grid-template-columns: minmax(108px, 0.92fr) minmax(0, 2.65fr) minmax(
        168px,
        1.03fr
      );
  }
  .field-print {
    flex-basis: clamp(88px, calc((100% - 18px) / 5), 100px);
  }
  .field-console .battle-hand,
  .field-console #fv-hand {
    gap: 4px;
  }
  .field-print .print-engraving {
    margin-inline: 0;
    gap: 2px;
  }
  .field-print .print-name {
    font-size: 10px;
  }
  .field-print .print-type {
    font-size: 6.8px;
  }
  .field-print .print-cost {
    font-size: 12px;
  }
  .field-print .field-print-inspect {
    width: 23px;
    height: 23px;
  }
  .vial-art {
    width: clamp(60px, 9.2vw, 90px);
  }
  .hud-rail {
    --field-tool-size: 27px;
    gap: clamp(2px, 0.32vw, 4px);
    margin-bottom: 4px;
  }
  .hud-rail .hud-icon,
  .hud-rail .hud-audio .sound-adjust > summary {
    border-radius: 4px;
    font-size: 15px;
  }
  .hud-rail .hud-audio .sound-adjust > summary {
    font-size: 0;
  }
  .hud-turn button,
  .hud-turn :is([data-end], #fv-end) {
    padding: 5px;
    min-height: 44px;
    font-size: 14px;
  }
  .field-console .hand-toggle,
  .field-console .hand-label small {
    font-size: 9px;
  }
  .field-console .hand-toggle {
    min-height: 18px;
  }
  .field-console .field-actions button,
  .field-console .field-actions summary {
    min-height: 23px;
  }
  .field-scroll.field-objectives {
    top: 5px;
    left: 14px;
    max-height: 48vh;
    width: clamp(194px, 29vw, 270px);
    padding: 6px 10px 7px 31px;
  }
  .field-scroll [data-scroll-body] {
    max-height: calc(48vh - 15px);
  }
  .field-scroll[data-folded] {
    width: 30px;
    height: 30px;
    padding: 0;
  }
  #field-head.field-head,
  #fv-top.field-head {
    top: 5px;
    right: 8px;
    padding: 5px 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .field-print .field-print-play,
  .vial-liquid {
    transition: none;
  }
}

/* The two heraldic ornaments are standalone alpha cutouts. */
.field-scroll .scroll-banner {
  background: url("./hud-pennon.webp") center top / contain no-repeat;
  clip-path: none;
  padding: 0;
  width: clamp(34px, 4.6vw, 74px);
  height: clamp(54px, 7.4vw, 118px);
  left: clamp(-20px, -1vw, -10px);
  top: -5px;
  color: transparent;
  text-shadow: none;
}
.field-scroll .scroll-banner::before {
  content: none;
}
@media (max-width: 620px) and (orientation: portrait) {
  .field-scroll .scroll-banner {
    width: 27px;
    height: 48px;
    left: -7px;
    top: -4px;
  }
}

.hud-turn :is([data-end], #fv-end)::before {
  content: "";
  width: 0.65em;
  height: 0.88em;
  margin-right: 6px;
  background: linear-gradient(#ffe6a3, #ac803e 55%, #ffe7a4);
  clip-path: polygon(
    0 0,
    100% 0,
    100% 12%,
    83% 12%,
    83% 28%,
    57% 49%,
    83% 70%,
    83% 87%,
    100% 87%,
    100% 100%,
    0 100%,
    0 87%,
    17% 87%,
    17% 70%,
    43% 49%,
    17% 28%,
    17% 12%,
    0 12%
  );
}
.field-print[data-rarity="Mythic"]
  .field-print-play:not([aria-pressed="true"]):not(:focus-visible) {
  box-shadow:
    0 0 0 1px #43283b,
    0 0 0 2px #c097db,
    0 0 9px #a854e17d;
}
@media (max-width: 620px) and (orientation: portrait) {
  .field-head .status-copy {
    flex: 1;
  }
  #field-head.field-head,
  #fv-top.field-head {
    overflow: hidden;
  }
  .field-head .status-copy > small {
    flex-wrap: wrap;
    column-gap: 5px;
    row-gap: 2px;
  }
  .hud-turn :is([data-end], #fv-end)::before {
    content: none;
  }
}

.hand-window[data-more-right]::after,
.hand-window[data-more-left]::before {
  content: "";
  position: absolute;
  z-index: 4;
  top: 4px;
  bottom: 3px;
  width: 10px;
  pointer-events: none;
}
.hand-window[data-more-right]::after {
  right: 0;
  background: linear-gradient(90deg, transparent, #251c24b5);
}
.hand-window[data-more-left]::before {
  left: 0;
  background: linear-gradient(90deg, #251c24b5, transparent);
}
.hud-rail :is([data-field-roster], [data-act="roster"]) span {
  display: block;
  width: 60%;
  height: 58%;
  font-size: 0;
  background: radial-gradient(
      ellipse at 50% 21%,
      #ecd5a2 0 14%,
      transparent 16%
    ),
    radial-gradient(ellipse at 18% 33%, #c8a86d 0 11%, transparent 13%),
    radial-gradient(ellipse at 82% 33%, #c8a86d 0 11%, transparent 13%),
    radial-gradient(ellipse at 50% 93%, #e7ca90 0 33%, transparent 35%),
    radial-gradient(ellipse at 17% 85%, #b69260 0 22%, transparent 24%),
    radial-gradient(ellipse at 83% 85%, #b69260 0 22%, transparent 24%);
}
.hud-audio .sound-adjust > summary::before,
.hud-rail #fv-sound-btn::before {
  content: "";
  display: block;
  position: absolute;
  left: 24%;
  top: 32%;
  width: 27%;
  height: 36%;
  margin: 0;
  background: #e4c187;
  clip-path: polygon(0 34%, 35% 34%, 100% 0, 100% 100%, 35% 66%, 0 66%);
}
.hud-audio .sound-adjust > summary::after,
.hud-rail #fv-sound-btn::after {
  content: "";
  position: absolute;
  left: 54%;
  top: 29%;
  width: 22%;
  height: 42%;
  background:
    radial-gradient(ellipse 46% 69% at 0 50%, transparent 56%, #f0cd90 64% 83%, transparent 92%),
    radial-gradient(ellipse 100% 100% at 0 50%, transparent 72%, #e4bd7f 77% 85%, transparent 92%);
}
.hud-rail #fv-sound-btn span {
  display: none;
}
@media (max-width: 620px) and (orientation: portrait) {
  .field-scroll .field-company {
    margin-top: 5px;
    padding: 3px 4px;
    border-left-width: 2px;
  }
  .field-scroll .field-company > div {
    gap: 3px;
  }
  .field-scroll .field-company b,
  .field-scroll .field-company strong {
    font-size: 10px;
    line-height: 1.15;
  }
  .field-scroll .field-company p {
    font-size: 9px;
    line-height: 1.15;
    margin: 3px 0;
  }
}
@media (max-width: 370px) and (orientation: portrait) {
  .hud-rail .hud-flag {
    display: none;
  }
  .field-dock {
    gap: 3px;
  }
}
