:root {
  color-scheme: dark;
  --ink: #eeeadf;
  --soft: #c1bbad;
  --gold: #e2bd78;
  --line: #514632;
  --bg: #121310;
  --paper: #20211b;
  --display: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --body: "Segoe UI", system-ui, sans-serif;
  font: 16px/1.5 var(--body);
  background: var(--bg);
  color: var(--ink);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background:
    radial-gradient(ellipse at 50% 12%, #27251c 0, transparent 58rem), var(--bg);
  min-height: 100vh;
}
button,
select,
input {
  font: inherit;
  color: inherit;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  color: #aaa699;
}
button:focus-visible,
a:focus-visible,
select:focus-visible,
summary:focus-visible,
input:focus-visible {
  outline: 3px solid #f9d68c;
  outline-offset: 4px;
}
a {
  color: inherit;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3,
.brand {
  font-family: var(--display);
  font-weight: 500;
}
h1 {
  font-size: clamp(2.4rem, 6vw, 5.25rem);
  line-height: 1.04;
  letter-spacing: -0.055em;
}
h2 {
  font-size: clamp(1.75rem, 3.7vw, 2.65rem);
  line-height: 1.15;
  letter-spacing: -0.035em;
}
h3 {
  font-size: 1.42rem;
  line-height: 1.15;
}
p {
  color: var(--soft);
}
.sr,
.skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.skip:focus {
  position: fixed;
  z-index: 10;
  padding: 0.6rem;
  background: #111;
}
header {
  background: #121411;
  border-bottom: 1px solid var(--line);
}
.navwrap,
main {
  max-width: 1360px;
  margin: auto;
  padding-inline: clamp(16px, 4.5vw, 70px);
}
.navwrap {
  min-height: 66px;
  display: flex;
  align-items: center;
  gap: clamp(16px, 5vw, 84px);
}
.brand {
  font-size: 1.32rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  white-space: nowrap;
}
.crown {
  width: 29px;
  height: 22px;
  background: var(--gold);
  clip-path: polygon(
    0 11%,
    27% 48%,
    50% 0,
    72% 48%,
    100% 11%,
    87% 85%,
    13% 85%,
    14% 93%,
    86% 93%,
    84% 100%,
    16% 100%
  );
}
nav {
  display: flex;
  align-self: stretch;
  gap: clamp(15px, 2.6vw, 42px);
}
nav a {
  display: grid;
  align-items: center;
  text-decoration: none;
  font-size: 0.9rem;
  color: var(--soft);
  position: relative;
}
nav a[aria-current] {
  color: var(--gold);
}
nav a[aria-current]:after {
  content: "";
  height: 2px;
  background: var(--gold);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
}
.help {
  margin-left: auto;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--gold);
  background: transparent;
  font: italic 1.2rem Georgia;
}
.help:hover {
  border-color: var(--gold);
}
main {
  padding-block: 26px 48px;
}
.loading {
  padding: 5rem 0;
}
.keyart,
.realmhead,
.arena {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid #675438;
  background: #24231e;
}
.scenery {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}
.keyart {
  padding: clamp(32px, 5.1vw, 76px);
  min-height: clamp(295px, 29vw, 396px);
  display: flex;
  align-items: center;
}
.keyart:before,
.realmhead:before,
.arena:before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, #0c0e0be8, #13141085 45%, transparent 75%);
}
.keyart h1 {
  font-size: clamp(3.4rem, 6.5vw, 6rem);
  color: #fcf2df;
  text-shadow: 0 3px 20px #151006;
}
.kicker {
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}
.keyart .kicker {
  margin-bottom: 0.6rem;
}
.keyart p:not(.kicker) {
  color: #e3ddd0;
  margin: 0.65rem 0 1.4rem;
  max-width: 32ch;
  font-size: 1.02rem;
}
.btn,
.quiet,
.pill,
select {
  display: inline-flex;
  gap: 0.7rem;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.55rem 1rem;
  border: 1px solid var(--line);
  background: #292a23;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.88rem;
  border-radius: 3px;
}
.btn {
  background: #e4bf80;
  border-color: #edcd95;
  color: #252017;
}
.btn:hover {
  background: #f1d39b;
}
.quiet:hover,
.pill:hover {
  border-color: #b19566;
}
.btn:disabled,
.quiet:disabled {
  background: #33342d;
  border-color: #49483c;
  color: #bdb8ac;
}
.arrow {
  font-family: Arial;
  font-size: 1.15em;
}
.row,
.actions,
.sectionhead,
.stats {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.sectionhead {
  justify-content: space-between;
  margin: 29px 0 17px;
}
.sectionhead p {
  margin-top: 0.2rem;
  font-size: 0.9rem;
}
.sectionhead .count,
.count {
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  color: var(--soft);
  text-transform: uppercase;
}
.hero-grid,
.choice-grid,
.catalog,
.hand,
.reward-grid,
.journal {
  display: grid;
  gap: 15px;
}
.hero-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.heroTile,
.pathTile {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  text-align: left;
  border: 1px solid var(--line);
  padding: 0;
  color: var(--ink);
  background: #191a16;
}
.heroTile {
  min-height: clamp(240px, 25vw, 338px);
  display: flex;
  align-items: end;
}
.heroTile img,
.pathTile img {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  object-fit: cover;
  z-index: -2;
}
.heroTile img {
  object-position: 50% 22%;
}
.heroTile:after,
.pathTile:after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    0deg,
    #0e100dfc 0%,
    #10110ed1 14%,
    transparent 55%
  );
}
.heroTile:hover,
.pathTile:hover,
.gamecard.playable:hover {
  border-color: #d4b576;
  box-shadow: 0 4px 18px #0007;
}
.heroText {
  display: block;
  width: 100%;
  padding: 18px;
}
.heroText strong {
  font: 500 clamp(1.6rem, 3vw, 2.4rem)/1.1 var(--display);
  display: block;
  letter-spacing: -0.04em;
}
.heroText small {
  color: #e0d7c5;
  font-size: 0.82rem;
}
.tileArrow {
  float: right;
  color: var(--gold);
  font: 1.25rem/1.6 Georgia;
}
.bottomline {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  font-size: 0.8rem;
}
.pane,
dialog {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: clamp(18px, 3vw, 36px);
}
dialog {
  color: var(--ink);
  width: min(640px, calc(100% - 32px));
  max-height: 86vh;
}
dialog::backdrop {
  background: #090a08ce;
}
dialog h2 {
  margin-bottom: 12px;
}
dialog p + p,
dialog details,
dialog .close {
  margin-top: 14px;
}
summary {
  cursor: pointer;
  color: var(--gold);
  padding: 6px 0;
}
.guide-list {
  display: grid;
  gap: 9px;
}
.guide-list p {
  font-size: 0.93rem;
}
.loadout {
  display: grid;
  grid-template-columns: minmax(200px, 0.8fr) minmax(0, 1.4fr);
  gap: 28px;
}
.portrait {
  width: 100%;
  height: 100%;
  max-height: 560px;
  object-fit: cover;
  object-position: top;
  border: 1px solid var(--line);
}
.loadout label,
.filters label {
  display: grid;
  gap: 4px;
  color: var(--soft);
  font-size: 0.82rem;
}
.loadout label {
  margin: 14px 0;
}
.loadout header {
  background: none;
  padding-bottom: 12px;
  margin-bottom: 12px;
}
.loadout .actions {
  margin-top: 20px;
}
.back {
  border: none;
  background: none;
  color: var(--gold);
  padding: 4px 0;
  margin: 0 0 14px;
}
.detail {
  font-size: 0.89rem;
  line-height: 1.5;
  color: var(--soft);
}
.filters {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin: 18px 0;
}
.filters input {
  background: #1c1d19;
  border: 1px solid var(--line);
  min-height: 44px;
  padding: 0.5rem 0.8rem;
}
.catalog {
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
}
.gamecard {
  position: relative;
  display: flex;
  flex-direction: column;
  text-align: left;
  min-width: 0;
  background: linear-gradient(145deg, #39382d, #25251e);
  border: 1px solid #786444;
  overflow: hidden;
  color: var(--ink);
  padding: 0;
  border-radius: 6px;
}
.gamecard img {
  width: 100%;
  aspect-ratio: 1.9;
  height: auto;
  object-fit: cover;
  display: block;
}
.cost {
  display: grid;
  place-items: center;
  position: absolute;
  top: 6px;
  left: 6px;
  background: #1e282d;
  color: #fff1c9;
  border: 1px solid #d4b981;
  border-radius: 50%;
  width: 29px;
  height: 29px;
  font: 600 1.1rem Georgia;
}
.cardtext {
  padding: 9px 11px 12px;
  display: block;
}
.cardtext small {
  display: block;
  color: #e5c68d;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.cardtext strong {
  display: block;
  font: 600 1.22rem/1.12 var(--display);
  margin: 3px 0 6px;
}
.cardtext .rules {
  display: block;
  color: #e2ddcf;
  font-size: 0.79rem;
  line-height: 1.34;
}
.gamecard:disabled {
  color: var(--ink);
  border-color: #49483c;
}
.gamecard:disabled img {
  filter: saturate(0.5) brightness(0.78);
}
.realmhead {
  padding: clamp(24px, 4vw, 54px);
  min-height: 200px;
  display: grid;
  align-content: center;
  gap: 8px;
}
.realmhead h1,
.pageTitle {
  font-size: clamp(2.45rem, 4vw, 3.65rem);
}
.realmhead p {
  color: #eee6d6;
}
.stats {
  font-size: 0.85rem;
  color: var(--soft);
  gap: 8px 18px;
  margin: 12px 0;
}
.stats b {
  color: var(--ink);
}
.choice-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
}
.pathTile {
  min-height: 190px;
  display: flex;
  align-items: end;
  padding: 18px;
}
.pathTile:after {
  background: linear-gradient(0deg, #0b0d0bf5, #0b0d0bd6 32%, #0001 100%);
}
.pathTile strong {
  display: block;
  font: 1.5rem var(--display);
}
.pathTile small {
  color: #e3ded1;
  display: block;
}
.pathTile:disabled {
  opacity: 0.6;
}
.arena {
  padding: 20px clamp(16px, 3vw, 42px);
}
.arena:before {
  background: linear-gradient(90deg, #10130ff1, #121510d1 63%, #10120e9e);
}
.arenaTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.arenaTop h1 {
  font-size: clamp(1.35rem, 3vw, 2.25rem);
}
.duel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 15px 0;
}
.combatant {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.combatant img {
  width: clamp(60px, 9vw, 120px);
  height: clamp(72px, 11vw, 148px);
  object-fit: cover;
  object-position: top;
  border: 1px solid #7b674a;
}
.combatant > div {
  flex: 1;
}
.combatant h2 {
  font-size: clamp(1.05rem, 2.5vw, 1.8rem);
}
.combatant progress {
  width: 100%;
  height: 8px;
  accent-color: #b8553d;
}
.combatant p,
.arena .detail {
  color: #e0dcca;
}
.hand {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  align-items: stretch;
}
.handSlot {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.handSlot .gamecard {
  height: 100%;
  width: 100%;
}
.prepare {
  font-size: 0.78rem;
  min-height: 36px;
}
.reward-grid,
.journal {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 205px), 1fr));
}
.reward-grid .gamecard {
  max-width: 340px;
}
.status {
  color: #f2d18c;
  font-size: 0.83rem;
}
.journal .pane {
  padding: 18px;
}
.journal h3 {
  margin-bottom: 8px;
}
.journal ul {
  padding-left: 20px;
  margin: 8px 0;
}
.journal li {
  margin: 5px 0;
}
.log {
  border-top: 1px solid var(--line);
  margin-top: 18px;
}
.log li {
  color: var(--soft);
  font-size: 0.85rem;
}
.notice,
#saveWarning {
  color: #f4d493;
  background: #322b1b;
  padding: 10px 14px;
  border: 1px solid var(--line);
}
.bar {
  justify-content: space-between;
}
.back,
.help,
.pill,
.btn,
.quiet {
  transition:
    background 0.15s,
    border-color 0.15s;
}
.empty {
  padding: 28px;
  border: 1px dashed var(--line);
}
.heroText small,
.count,
.detail {
  overflow-wrap: anywhere;
}
#saveWarning {
  position: sticky;
  bottom: 0;
}
.pickList {
  display: grid;
  gap: 6px;
}
.pickList button {
  justify-content: space-between;
}
.pageIntro {
  margin: 7px 0 18px;
}
.spaced {
  margin-top: 20px;
}
@media (min-width: 1100px) {
  .hand:has(> .handSlot:nth-child(6)) {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}
@media (max-width: 767px) {
  .navwrap {
    gap: 15px;
    min-height: 58px;
  }
  .brand {
    font-size: 1.06rem;
    gap: 5px;
  }
  .crown {
    width: 22px;
    height: 17px;
  }
  .hero-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .heroTile {
    min-height: clamp(215px, 48vw, 300px);
  }
  .heroText {
    padding: 12px;
  }
  .keyart {
    padding: 25px 22px;
    min-height: 265px;
  }
  .keyart:before {
    background: linear-gradient(90deg, #0b0d0ae8, #090b076c 73%, #0002);
  }
  main {
    padding-top: 16px;
  }
  .loadout {
    grid-template-columns: 1fr;
  }
  .portrait {
    height: 210px;
    object-position: 50% 18%;
  }
  .hand,
  .catalog {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
  .duel {
    gap: 12px;
  }
  .combatant {
    align-items: start;
    flex-direction: column;
    gap: 7px;
  }
  .combatant img {
    width: 74px;
    height: 76px;
  }
  .combatant > div {
    width: 100%;
  }
  .arena {
    padding: 15px;
  }
  .stats {
    gap: 7px 12px;
  }
  .reward-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 480px) {
  .navwrap {
    flex-wrap: wrap;
    gap: 0 12px;
    padding-top: 10px;
  }
  .brand {
    font-size: 1.15rem;
  }
  .help {
    order: 1;
  }
  .navwrap nav {
    order: 2;
    width: 100%;
    gap: 24px;
  }
  .navwrap nav a {
    min-height: 39px;
  }
  .sectionhead {
    margin: 23px 0 12px;
  }
  .keyart h1 {
    font-size: 3.25rem;
  }
  .keyart .scenery {
    object-position: 62% 50%;
  }
  .realmhead {
    min-height: 160px;
  }
  .heroText strong {
    font-size: 1.6rem;
  }
  .filters input {
    width: 100%;
  }
  .actions {
    gap: 7px;
  }
  .handSlot .cardtext {
    padding: 7px;
  }
  .row .detail {
    width: 100%;
  }
  .sectionhead .count {
    font-size: 0.64rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
[hidden] {
  display: none !important;
}
.showcase {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 380px;
  isolation: isolate;
  overflow: hidden;
  background: radial-gradient(
    ellipse at 52% 38%,
    #465044,
    #252820 58%,
    #131611 90%
  );
  border: 1px solid var(--line);
}
.showcase:after,
.miniature:before {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 8%;
  height: 6%;
  border-radius: 50%;
  background: radial-gradient(ellipse, #0a0b08a9, transparent 70%);
  pointer-events: none;
}
.showcase:after {
  display: none;
}
.miniature {
  position: relative;
  width: 100%;
  height: 100%;
  isolation: isolate;
}
.miniature canvas,
.miniature .modelFallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  border: 0;
  display: block;
}
.miniature[data-ready] .modelFallback {
  visibility: hidden;
}
.miniature:not([data-ready]) + .rotate {
  display: none;
}
.showcase > .miniature {
  position: absolute;
  inset: 0 0 48px;
  height: calc(100% - 48px);
}
.rotate {
  position: absolute;
  bottom: 12px;
  display: flex;
  gap: 10px;
}
.rotate .quiet {
  font-size: 0.8rem;
  min-height: 40px;
}
.arena:before {
  background: linear-gradient(90deg, #10140fa8, #10140f6e 55%, #10140fa1);
}
.arenaTop,
.arena > .detail {
  background: #11150fdb;
  border: 1px solid #68583b75;
  padding: 9px 13px;
}
.arenaTop {
  border: 0;
  background: transparent;
  padding: 0;
}
.duel {
  gap: clamp(20px, 8vw, 120px);
  align-items: end;
}
.combatant {
  flex-direction: column;
  justify-content: end;
  align-items: center;
  position: relative;
  gap: 0;
}
.combatant .miniature {
  width: 100%;
  height: clamp(150px, 19vw, 215px);
}
.combatant > div:last-child {
  width: 100%;
  flex: auto;
  background: #101410ed;
  border: 1px solid #695d43;
  padding: 8px 14px;
}
.combatant h2 {
  font-size: clamp(1rem, 2vw, 1.55rem);
}
.combatant .enemyPortrait {
  height: clamp(118px, 14vw, 160px);
  width: clamp(105px, 13vw, 145px);
  object-fit: cover;
  object-position: 50% 24%;
  border: 2px solid #a88c54;
  border-radius: 46% 46% 5px 5px;
  box-shadow: 0 6px 18px #0006;
  margin: 0 0 9px;
}
.combatant .modelFallback {
  width: 100%;
  height: 100%;
  border: 0;
}
.combatant > .miniature {
  flex: none;
  background: none;
  border: 0;
  padding: 0;
}
.heroTile img {
  object-position: 50% 28%;
}
.lunge canvas {
  animation: lunge 0.27s ease-out;
}
.recoil canvas {
  animation: recoil 0.32s ease-out;
}
.warding canvas {
  animation: ward 0.35s ease-out;
}
@keyframes lunge {
  40% {
    transform: translate(10%, -3%) rotate(4deg);
  }
}
@keyframes recoil {
  42% {
    transform: translate(-4%, 2%) rotate(-3deg);
  }
}
@keyframes ward {
  50% {
    filter: drop-shadow(0 0 9px #b9dcff);
  }
}
@media (min-width: 768px) and (max-width: 900px) {
  .hand {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .heroText {
    padding: 12px;
  }
}
@media (max-width: 767px) {
  .showcase {
    min-height: 270px;
  }
  .combatant .miniature {
    height: 132px;
  }
  .combatant .enemyPortrait {
    width: 86px;
    height: 100px;
  }
  .combatant > div:last-child {
    padding: 6px;
  }
  .duel {
    gap: 10px;
  }
  .arena .detail {
    font-size: 0.8rem;
  }
  .arena {
    padding: 10px;
  }
  .arenaTop .kicker {
    font-size: 0.62rem;
  }
  .duel {
    margin: 8px 0;
  }
}

.showcase,.heroTile {background:linear-gradient(0deg,#10161066,transparent 48%),url("assets/hero-armory.webp") center/cover #25302b}
.showcase canvas {touch-action:pan-y;cursor:grab;}
.showcase canvas:active {cursor:grabbing}
.rotate {z-index:2;gap:6px}
.rotate button {background:#1a211eeb;color:#f8ebca}
.rotate button[aria-pressed="true"] {background:#385244;border-color:#d0bd84}
.heroTile img {object-fit:cover;object-position:center 16%}
