/* ==========================================================================
   Ashveil — a lamp-lit interface of bone, iron and old gold.
   ========================================================================== */

.ashveil-page {
  background:
    radial-gradient(circle at 50% -10%, rgba(80, 52, 28, 0.22), transparent 55%),
    #070605;
  color: #d9cfb8;
}

.ashveil-page main {
  padding-bottom: 2rem;
}

.ashveil-page .ashveil-header {
  position: relative;
  max-width: 1180px;
  margin: 0 auto 0.9rem;
  padding: 1.1rem 1.5rem 1.3rem;
  border: 1px solid rgba(190, 152, 90, 0.18);
  border-top: 0;
  background:
    linear-gradient(90deg, rgba(5, 4, 3, 0.94) 0%, rgba(5, 4, 3, 0.62) 58%, rgba(5, 4, 3, 0.9) 100%),
    linear-gradient(180deg, rgba(5, 4, 3, 0.1), rgba(5, 4, 3, 0.55)),
    url('../../../public/screenshots/ashveil.jpg') center 32% / cover no-repeat;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.ashveil-page .ashveil-header h1 {
  font-family: 'Iowan Old Style', 'Palatino Linotype', 'Book Antiqua', Georgia, serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #e8d5aa;
  text-shadow: none;
  font-size: clamp(1.8rem, 3.2vw, 2.5rem);
  margin: 0 0 0.3rem;
}

.ashveil-header p {
  color: #b3a68c;
  max-width: 70ch;
  margin: 0.25rem 0 0;
  font-size: 0.95rem;
  line-height: 1.55;
}

.eyebrow {
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #b08c53;
  margin: 0 0 0.5rem;
}

/* --------------------------------------------------------------------------
   Stage
   -------------------------------------------------------------------------- */

.ashveil {
  position: relative;
  width: min(1500px, 100%);
  height: clamp(470px, 66vh, 840px);
  min-height: 0;
  margin: 0 auto;
  overflow: hidden;
  background: #070605;
  border: 1px solid rgba(190, 152, 90, 0.32);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.9),
    0 30px 80px rgba(0, 0, 0, 0.7),
    inset 0 0 120px rgba(0, 0, 0, 0.85);
  font-family: 'Iowan Old Style', 'Palatino Linotype', 'Book Antiqua', Georgia, serif;
  color: #e6dcc4;
  user-select: none;
  -webkit-user-select: none;
  isolation: isolate;
}

/* Full screen plays the drawn frame itself, not the page around it. */
.ashveil:fullscreen,
.ashveil:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  max-height: none;
  margin: 0;
  border: 0;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

.ashveil h1,
.ashveil h2,
.ashveil h3,
.ashveil h4,
.ashveil button,
.ashveil .eyebrow,
.ashveil kbd,
.ashveil .orb-read,
.ashveil .gold-chip,
.ashveil .quest-line {
  font-family: 'Iowan Old Style', 'Palatino Linotype', 'Book Antiqua', Georgia, serif;
}

.ashveil :focus-visible {
  outline: 2px solid #e8c37a;
  outline-offset: 2px;
}

/* Film grain and a vignette over everything, for mood. */
.ashveil::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  background:
    radial-gradient(circle at 50% 50%, transparent 58%, rgba(0, 0, 0, 0.45) 100%);
  mix-blend-mode: multiply;
}

.fade {
  position: absolute;
  inset: 0;
  background: #050403;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.32s ease;
  z-index: 70;
}

.fade.is-on {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   HUD
   -------------------------------------------------------------------------- */

.hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 20;
}

.hud[hidden],
.scene[hidden],
.panel[hidden],
[hidden] {
  display: none !important;
}

.hud button,
.hud .zone-card,
.hud .minimap-frame {
  pointer-events: auto;
}

.hud-left {
  position: absolute;
  top: 14px;
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.zone-card {
  background: linear-gradient(180deg, rgba(20, 16, 12, 0.92), rgba(10, 8, 6, 0.72));
  border: 1px solid rgba(190, 152, 90, 0.35);
  border-left: 2px solid #b08c53;
  padding: 9px 16px 11px;
  min-width: 220px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.zone-card h2 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ecd9ac;
  font-weight: 600;
}

.zone-sub {
  margin: 2px 0 7px;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: #a3957a;
  font-style: italic;
}

.quest-line {
  margin: 0;
  padding-top: 7px;
  border-top: 1px solid rgba(190, 152, 90, 0.18);
  font-size: 0.78rem;
  line-height: 1.35;
  color: #d3c4a2;
  max-width: 320px;
}

.hud-right {
  position: absolute;
  top: 14px;
  right: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

/* The boss strip owns the top edge while a fight is on; the rest of the HUD
   steps down instead of sitting under it. */
.hud.has-boss .hud-left,
.hud.has-boss .hud-right {
  top: 60px;
}

.hud.has-boss .target-card {
  top: 174px;
}

.minimap-frame {
  position: relative;
  width: 158px;
  height: 158px;
  padding: 3px;
  background: linear-gradient(180deg, #17130f, #0a0806);
  border: 1px solid rgba(190, 152, 90, 0.4);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.6),
    inset 0 0 0 1px rgba(0, 0, 0, 0.8);
}

.minimap-frame canvas {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0.92;
}

.minimap-label {
  position: absolute;
  bottom: 4px;
  left: 8px;
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(200, 178, 138, 0.6);
  pointer-events: none;
}

.hud-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
  max-width: 320px;
}

.hud-actions button,
.bone-button {
  font-family: inherit;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #cfc0a4;
  background: linear-gradient(180deg, #1d1813, #100d0a);
  border: 1px solid rgba(190, 152, 90, 0.35);
  padding: 6px 9px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.hud-actions button:hover,
.bone-button:hover {
  color: #f4e3b8;
  border-color: rgba(230, 199, 120, 0.75);
  background: linear-gradient(180deg, #2a221a, #17120d);
}

.hud-actions kbd {
  font-family: inherit;
  font-size: 0.6rem;
  color: #8f7f63;
  margin-left: 3px;
}

.bone-button.primary {
  background: linear-gradient(180deg, #4a3320, #241811);
  border-color: #c9a86a;
  color: #f6e6bd;
}

.bone-button.primary:hover {
  background: linear-gradient(180deg, #5e4227, #2e2015);
}

.bone-button.small {
  padding: 4px 8px;
  font-size: 0.62rem;
}

.bone-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Boss bar */
/* A boss strip across the very top edge of the frame, so the fight stays
   visible underneath it. */
.boss-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: auto;
  transform: none;
  text-align: center;
  padding: 7px 16px 9px;
  background: linear-gradient(180deg, rgba(24, 14, 28, 0.96), rgba(10, 7, 12, 0.72));
  border: 0;
  border-bottom: 1px solid rgba(176, 107, 255, 0.4);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 40px rgba(120, 60, 170, 0.12);
}

.boss-name {
  display: block;
  font-size: 0.86rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #dfc4ff;
  margin-bottom: 6px;
}

.boss-track {
  height: 8px;
  max-width: 720px;
  margin: 0 auto;
  background: #16101c;
  border: 1px solid rgba(176, 107, 255, 0.3);
  overflow: hidden;
}

.boss-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #5c2d86, #a86bff, #d7b0ff);
  box-shadow: 0 0 12px rgba(176, 107, 255, 0.7);
  transition: width 0.18s linear;
}

/* Target card */
.target-card {
  position: absolute;
  top: 128px;
  left: 16px;
  min-width: 210px;
  padding: 7px 12px 9px;
  background: rgba(12, 9, 7, 0.82);
  border: 1px solid rgba(190, 152, 90, 0.28);
  backdrop-filter: blur(3px);
}

.target-name {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: #e7d8b5;
}

.target-track {
  height: 4px;
  background: #241614;
  margin: 5px 0 4px;
  overflow: hidden;
}

.target-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #7c2a22, #c4584a);
  transition: width 0.15s linear;
}

.target-meta {
  font-size: 0.63rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8f8066;
}

/* Toasts */
.toasts {
  position: absolute;
  left: 16px;
  top: 214px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 320px;
}

.toast {
  padding: 7px 12px;
  font-size: 0.79rem;
  line-height: 1.35;
  background: rgba(10, 8, 6, 0.9);
  border-left: 2px solid #b08c53;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.is-in {
  opacity: 1;
  transform: translateX(0);
}

.flash {
  position: absolute;
  left: 50%;
  top: 34%;
  transform: translate(-50%, -50%) scale(0.96);
  font-size: clamp(1.6rem, 3.4vw, 2.9rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #f0e2c0;
  text-shadow: 0 2px 22px rgba(0, 0, 0, 0.9), 0 0 40px rgba(230, 180, 100, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.5s ease;
  white-space: nowrap;
}

.flash.is-on {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* --------------------------------------------------------------------------
   Bottom belt and orbs
   -------------------------------------------------------------------------- */

.hud-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  padding: 0 16px 14px;
  pointer-events: none;
}

.orb {
  position: relative;
  width: 136px;
  flex: 0 0 136px;
  text-align: center;
  pointer-events: none;
}

.orb-shell {
  position: relative;
  width: 128px;
  height: 128px;
  margin: 0 auto;
  border-radius: 50%;
  overflow: hidden;
  background:
    radial-gradient(circle at 38% 28%, rgba(255, 255, 255, 0.1), transparent 45%),
    radial-gradient(circle at 50% 70%, #191310, #080605 75%);
  box-shadow:
    inset 0 0 26px rgba(0, 0, 0, 0.95),
    0 10px 26px rgba(0, 0, 0, 0.6);
}

.orb-liquid {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 70%;
  transition: height 0.28s ease;
  border-radius: 46% 46% 0 0 / 10% 10% 0 0;
}

.orb.health .orb-liquid {
  background:
    radial-gradient(circle at 42% 20%, rgba(255, 150, 130, 0.55), transparent 55%),
    linear-gradient(180deg, #b03a30, #5c1410);
  box-shadow: inset 0 8px 22px rgba(255, 110, 90, 0.25);
}

.orb.mana .orb-liquid {
  background:
    radial-gradient(circle at 42% 20%, rgba(160, 200, 255, 0.55), transparent 55%),
    linear-gradient(180deg, #3d63b0, #101f4a);
  box-shadow: inset 0 8px 22px rgba(120, 170, 255, 0.25);
}

.orb-shine {
  position: absolute;
  inset: 8% 12% 46% 18%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 40% 40%, rgba(255, 255, 255, 0.16), transparent 70%);
  pointer-events: none;
}

.orb-rim {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(190, 152, 90, 0.55);
  box-shadow:
    inset 0 0 18px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(0, 0, 0, 0.8),
    0 0 26px rgba(0, 0, 0, 0.6);
}

.orb-read {
  margin-top: 5px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
}

.orb-read b {
  display: block;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: #e8dcc2;
  font-weight: 600;
}

.orb-read span {
  font-size: 0.6rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #9a8a6d;
}

.orb.mana .orb-read b {
  color: #cfdcf2;
}

.belt {
  flex: 1;
  min-width: 0;
  max-width: 720px;
  padding: 8px 12px 9px;
  background:
    linear-gradient(180deg, rgba(28, 22, 17, 0.92), rgba(10, 8, 6, 0.9));
  border: 1px solid rgba(190, 152, 90, 0.32);
  border-bottom: 0;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.55);
  pointer-events: auto;
  align-self: flex-end;
}

.belt-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.skill-bar {
  display: flex;
  gap: 8px;
  flex: 1;
  justify-content: center;
}

.skill {
  position: relative;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  background:
    radial-gradient(circle at 50% 30%, rgba(90, 72, 50, 0.4), transparent 70%),
    linear-gradient(180deg, #1d1812, #0c0a08);
  border: 1px solid rgba(190, 152, 90, 0.45);
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.8);
  cursor: pointer;
  color: var(--skill-color, #e8a45c);
  padding: 0;
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.12s ease;
}

.skill:hover {
  border-color: #e8c37a;
  transform: translateY(-1px);
}

.skill:active {
  transform: translateY(1px) scale(0.98);
}

.skill-glyph {
  display: block;
  width: 62%;
  height: 62%;
  margin: 6px auto 0;
  filter: drop-shadow(0 0 6px rgba(255, 190, 120, 0.3));
}

.skill-glyph svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.skill-cd {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0%;
  background: rgba(4, 3, 2, 0.78);
  pointer-events: none;
}

.skill-rank {
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 0.6rem;
  color: #d8c18a;
  text-shadow: 0 1px 3px #000;
}

.skill-key {
  position: absolute;
  bottom: 2px;
  left: 5px;
  font-size: 0.58rem;
  color: #a5947a;
}

.skill.is-locked {
  color: #6b6254;
  border-color: rgba(120, 100, 70, 0.3);
}

.skill-tip {
  position: absolute;
  left: 50%;
  bottom: 108%;
  transform: translateX(-50%) translateY(4px);
  width: 190px;
  padding: 7px 9px;
  background: rgba(8, 6, 5, 0.96);
  border: 1px solid rgba(190, 152, 90, 0.35);
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  color: #cdbf9f;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 30;
  text-align: center;
  line-height: 1.35;
}

.skill-tip b {
  display: block;
  font-size: 0.72rem;
  color: #efdfb6;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.skill-tip i {
  color: #8f8066;
  font-style: normal;
}

.skill:hover .skill-tip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.potion {
  position: relative;
  width: 44px;
  height: 52px;
  flex: 0 0 44px;
  background: linear-gradient(180deg, #171310, #0a0806);
  border: 1px solid rgba(190, 152, 90, 0.35);
  color: #c9b98f;
  cursor: pointer;
  padding: 0;
}

.potion:hover {
  border-color: #e8c37a;
}

.potion-glyph {
  display: block;
  font-size: 1.15rem;
  line-height: 1.4;
}

.potion.health .potion-glyph {
  color: #d06a5c;
}

.potion.mana .potion-glyph {
  color: #7d9fe0;
}

.potion-key {
  display: block;
  font-size: 0.55rem;
  color: #8f8066;
}

.potion-count {
  position: absolute;
  right: 3px;
  bottom: 2px;
  min-width: 15px;
  padding: 0 3px;
  font-size: 0.62rem;
  background: #241d15;
  border: 1px solid rgba(190, 152, 90, 0.4);
  color: #f0dfb4;
}

.xp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 7px;
}

/* The one menu control a phone gets; on wider screens the action row shows. */
.belt-menu {
  display: none;
}

.gold-chip {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: #d9b96f;
  white-space: nowrap;
}

.gold-chip.big {
  font-size: 0.9rem;
  padding: 4px 10px;
  border: 1px solid rgba(190, 152, 90, 0.4);
  background: rgba(30, 22, 12, 0.6);
}

.xp-track {
  flex: 1;
  height: 5px;
  background: #120e0a;
  border: 1px solid rgba(120, 100, 70, 0.35);
  overflow: hidden;
}

.xp-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6a5426, #e2c168);
  box-shadow: 0 0 8px rgba(230, 199, 120, 0.4);
  transition: width 0.3s ease;
}

.level-badge {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  color: #f2dfb0;
  border: 1px solid rgba(190, 152, 90, 0.55);
  border-radius: 50%;
  background: radial-gradient(circle at 40% 30%, #3a2c1c, #0f0c08);
}

.ashveil-footnote {
  max-width: 900px;
  margin: 1.1rem auto 0;
  text-align: center;
  font-size: 0.78rem;
  color: #867a63;
}

/* --------------------------------------------------------------------------
   Scenes
   -------------------------------------------------------------------------- */

.scene {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 50% 38%, rgba(20, 15, 10, 0.55), rgba(5, 4, 3, 0.94) 78%);
  backdrop-filter: blur(2px);
}

.scene-title {
  background:
    radial-gradient(circle at 50% 38%, rgba(6, 5, 4, 0.28), rgba(4, 3, 3, 0.9) 76%),
    linear-gradient(180deg, rgba(4, 3, 3, 0.7), rgba(4, 3, 3, 0.94)),
    url('../../../public/screenshots/ashveil.jpg') center 42% / cover no-repeat;
  align-items: flex-start;
}

.title-inner {
  width: min(1000px, 100%);
  margin: auto;
  padding: 14px 0 10px;
  text-align: center;
}

.title-inner .eyebrow {
  color: #c69a58;
  letter-spacing: 0.34em;
}

.game-title {
  margin: 0;
  font-family: 'Iowan Old Style', 'Palatino Linotype', 'Book Antiqua', Georgia, serif;
  font-size: clamp(3rem, 7vw, 5.8rem);
  line-height: 0.9;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  color: #e9d7ae;
  text-shadow:
    0 2px 0 #1a120a,
    0 0 40px rgba(220, 160, 80, 0.22),
    0 18px 60px rgba(0, 0, 0, 0.9);
}

.game-title span {
  color: #b8643c;
}

.title-tag {
  margin: 8px 0 18px;
  font-size: clamp(0.72rem, 1.2vw, 0.92rem);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #b9a684;
}

.title-prose {
  max-width: 58ch;
  margin: 10px auto 16px;
  font-size: 0.86rem;
  line-height: 1.6;
  color: #a89a80;
}

.class-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 auto 16px;
  max-width: 900px;
}

.class-card {
  position: relative;
  text-align: left;
  padding: 12px 14px 10px;
  background:
    radial-gradient(circle at 20% 0%, rgba(120, 90, 50, 0.14), transparent 60%),
    linear-gradient(180deg, rgba(26, 21, 16, 0.96), rgba(10, 8, 6, 0.96));
  border: 1px solid rgba(190, 152, 90, 0.26);
  color: #cfc0a4;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.class-card:hover {
  transform: translateY(-3px);
  border-color: rgba(232, 195, 122, 0.6);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
}

.class-card.is-selected {
  border-color: var(--class-color);
  box-shadow:
    0 0 0 1px var(--class-color),
    0 16px 44px rgba(0, 0, 0, 0.6),
    inset 0 0 40px rgba(232, 195, 122, 0.06);
}

.class-card.is-selected::after {
  content: '✦ chosen';
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--class-color);
}

.class-crest {
  display: block;
  width: 40px;
  height: 40px;
  color: var(--class-color);
}

.class-crest svg {
  width: 100%;
  height: 100%;
  fill: none;
}

.class-name {
  font-size: 1.05rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #f0e2c0;
}

.class-epithet {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--class-color);
  font-style: italic;
}

.class-blurb {
  font-size: 0.74rem;
  line-height: 1.45;
  color: #a4957b;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.class-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  padding-top: 7px;
  border-top: 1px solid rgba(190, 152, 90, 0.15);
  font-size: 0.64rem;
  letter-spacing: 0.06em;
  color: #8f8066;
}

.class-stats b {
  color: #ddc99c;
  font-weight: 600;
}

.class-hint {
  font-size: 0.68rem;
  color: #7d705a;
  font-style: italic;
}

.title-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.title-actions .bone-button {
  padding: 11px 26px;
  font-size: 0.76rem;
}

.title-foot {
  margin: 16px 0 0;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: #7a6e59;
  text-transform: uppercase;
}

.scene-death,
.scene-victory {
  background:
    radial-gradient(circle at 50% 40%, rgba(40, 10, 10, 0.4), rgba(4, 3, 3, 0.96) 72%);
}

.scene-victory {
  background:
    radial-gradient(circle at 50% 40%, rgba(70, 40, 90, 0.35), rgba(4, 3, 3, 0.96) 72%);
  padding: 14px;
  overflow-y: auto;
}

.scene-victory .scene-card {
  padding: 18px 22px;
}

.scene-victory .scene-card h2 {
  margin-bottom: 8px;
  font-size: clamp(1.4rem, 2.6vw, 2rem);
}

.scene-victory .run-stats {
  margin: 12px 0;
  padding: 10px;
  gap: 6px;
}

.scene-card {
  width: min(640px, 100%);
  padding: 28px 30px;
  text-align: center;
  background: linear-gradient(180deg, rgba(20, 16, 12, 0.96), rgba(8, 6, 5, 0.98));
  border: 1px solid rgba(190, 152, 90, 0.35);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
}

.scene-card h2 {
  margin: 0 0 12px;
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #eddbb0;
}

.scene-prose {
  margin: 0 0 12px;
  font-size: 0.9rem;
  line-height: 1.65;
  color: #b3a68c;
}

.scene-prose.small {
  font-size: 0.78rem;
  color: #8d8069;
}

.death-penalty {
  margin: 0 0 18px;
  font-size: 0.82rem;
  color: #c98f6a;
}

.scene-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 8px;
}

.run-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 18px 0;
  padding: 12px;
  border: 1px solid rgba(190, 152, 90, 0.2);
  background: rgba(0, 0, 0, 0.3);
}

.run-stats div {
  text-align: center;
}

.run-stats dt {
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #8f8066;
}

.run-stats dd {
  margin: 3px 0 0;
  font-size: 1.05rem;
  color: #e9d3a0;
}

/* --------------------------------------------------------------------------
   Panels
   -------------------------------------------------------------------------- */

.panel {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(4, 3, 2, 0.74);
  backdrop-filter: blur(3px);
}

.panel-card {
  position: relative;
  width: min(720px, 100%);
  max-height: min(86%, 760px);
  display: flex;
  flex-direction: column;
  padding: 18px 20px 20px;
  background:
    radial-gradient(circle at 50% 0%, rgba(110, 80, 44, 0.12), transparent 55%),
    linear-gradient(180deg, #171310, #0b0907);
  border: 1px solid rgba(190, 152, 90, 0.4);
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.8),
    inset 0 0 0 1px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.panel-card.wide {
  width: min(1000px, 100%);
}

.panel-card::before,
.panel-card::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1px solid rgba(220, 186, 120, 0.55);
  pointer-events: none;
}

.panel-card::before {
  top: 6px;
  left: 6px;
  border-right: 0;
  border-bottom: 0;
}

.panel-card::after {
  right: 6px;
  bottom: 6px;
  border-left: 0;
  border-top: 0;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(190, 152, 90, 0.22);
  margin-bottom: 12px;
}

.panel-head h2 {
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #f0e2c0;
}

.panel-head .eyebrow {
  margin-bottom: 2px;
}

.panel-close {
  font-family: inherit;
  font-size: 0.95rem;
  width: 32px;
  height: 32px;
  line-height: 1;
  color: #b9a684;
  background: transparent;
  border: 1px solid rgba(190, 152, 90, 0.35);
  cursor: pointer;
  flex: 0 0 32px;
}

.panel-close:hover {
  color: #f4e3b8;
  border-color: #e8c37a;
}

.panel-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: #5a4a33 transparent;
}

.panel-body::-webkit-scrollbar {
  width: 8px;
}

.panel-body::-webkit-scrollbar-thumb {
  background: #4a3c28;
}

.panel-subhead {
  margin: 0 0 8px;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #b08c53;
  font-weight: 600;
}

.panel-prose {
  font-size: 0.84rem;
  line-height: 1.6;
  color: #ac9e85;
  margin: 0 0 10px;
}

.panel-prose.small {
  font-size: 0.76rem;
}

.panel-foot {
  font-size: 0.68rem;
  line-height: 1.5;
  color: #7f725c;
  margin: 10px 0 0;
  letter-spacing: 0.02em;
}

.panel-foot em {
  color: #b9a684;
}

.points-chip {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 9px;
  border: 1px solid rgba(190, 152, 90, 0.3);
  color: #8f8066;
  white-space: nowrap;
}

.points-chip.has-points {
  color: #9ad8c0;
  border-color: rgba(154, 216, 192, 0.5);
  box-shadow: 0 0 18px rgba(100, 200, 160, 0.12);
}

/* ---------------------------- inventory ---------------------------- */

.inventory-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 18px;
}

.doll-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.doll-slot {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 8px;
  min-height: 88px;
  background: linear-gradient(180deg, rgba(30, 24, 18, 0.7), rgba(10, 8, 6, 0.7));
  border: 1px solid rgba(190, 152, 90, 0.22);
  color: #a4957b;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}

.doll-slot:hover:not(:disabled) {
  border-color: rgba(232, 195, 122, 0.6);
}

.doll-slot:disabled {
  cursor: default;
}

.doll-icon {
  width: 30px;
  height: 30px;
  color: var(--rarity);
}

.doll-icon svg,
.shop-icon svg,
.pack-cell svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.doll-label {
  font-size: 0.56rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #7f725c;
}

.doll-name {
  font-size: 0.7rem;
  line-height: 1.25;
}

.empty-mark {
  opacity: 0.3;
}

.hero-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 10px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(190, 152, 90, 0.18);
}

.hero-stats div {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 0.7rem;
  color: #8f8066;
}

.hero-stats b {
  color: #dcc9a0;
  font-weight: 600;
}

.pack-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.pack-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(190, 152, 90, 0.16);
}

.pack-cell {
  height: 46px;
  display: block;
  background: linear-gradient(180deg, rgba(24, 19, 14, 0.85), rgba(8, 7, 5, 0.85));
  border: 1px solid rgba(120, 100, 70, 0.2);
  color: inherit;
  padding: 7px;
  cursor: default;
}

.pack-cell.has-item {
  border-color: color-mix(in srgb, var(--rarity) 55%, transparent);
  background:
    radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--rarity) 16%, transparent), transparent 70%),
    linear-gradient(180deg, rgba(28, 22, 16, 0.9), rgba(10, 8, 6, 0.9));
  color: var(--rarity);
  cursor: pointer;
}

.pack-cell.has-item:hover {
  border-color: var(--rarity);
  box-shadow: 0 0 16px color-mix(in srgb, var(--rarity) 35%, transparent);
}

/* ------------------------------ skills ----------------------------- */

.skills-layout {
  display: grid;
  grid-template-columns: 1fr 250px;
  gap: 20px;
}

.skills-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.skill-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skill-row {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(28, 22, 17, 0.65), rgba(10, 8, 6, 0.65));
  border: 1px solid rgba(190, 152, 90, 0.2);
  border-left: 2px solid var(--skill-color);
}

.skill-row-icon {
  display: block;
  width: 42px;
  height: 42px;
  color: var(--skill-color);
}

.skill-row-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.skill-row-text header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
}

.skill-row-text h3 {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #f0e2c0;
}

.skill-row-text p {
  margin: 5px 0 0;
  font-size: 0.78rem;
  line-height: 1.55;
  color: #a99b82;
}

.skill-row-text .skill-next {
  color: #7f725c;
  font-size: 0.72rem;
}

.skill-cost {
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  color: #8f8066;
}

.skill-pips {
  display: inline-flex;
  gap: 3px;
}

.skill-pips i {
  width: 7px;
  height: 7px;
  border: 1px solid rgba(190, 152, 90, 0.45);
  display: block;
}

.skill-pips i.on {
  background: var(--skill-color);
  border-color: var(--skill-color);
  box-shadow: 0 0 8px var(--skill-color);
}

.character-sheet {
  padding-left: 16px;
  border-left: 1px solid rgba(190, 152, 90, 0.18);
}

.character-sheet dl {
  margin: 0;
}

.character-sheet dl div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px dashed rgba(190, 152, 90, 0.14);
  font-size: 0.74rem;
  color: #8f8066;
}

.character-sheet dt {
  letter-spacing: 0.06em;
}

.character-sheet dd {
  margin: 0;
  color: #dcc9a0;
}

/* ------------------------------ quest ------------------------------ */

.quest-layout {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 20px;
}

.quest-objective {
  margin: 0 0 10px;
  font-size: 1rem;
  line-height: 1.5;
  color: #efdfb6;
  padding-left: 10px;
  border-left: 2px solid #b08c53;
}

.quest-steps {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
}

.quest-steps li {
  display: flex;
  gap: 9px;
  padding: 6px 0;
  font-size: 0.8rem;
  color: #7f725c;
  border-bottom: 1px dashed rgba(190, 152, 90, 0.12);
}

.quest-steps li.is-done {
  color: #8fae95;
  text-decoration: line-through;
  text-decoration-color: rgba(143, 174, 149, 0.4);
}

.quest-steps li.is-current {
  color: #efdfb6;
}

.step-mark {
  color: #b08c53;
}

.journal {
  padding-left: 16px;
  border-left: 1px solid rgba(190, 152, 90, 0.18);
}

.journal p {
  font-size: 0.76rem;
  line-height: 1.55;
  color: #9a8c74;
  margin: 0 0 10px;
}

/* ------------------------------ help ------------------------------- */

.help-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.key-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.key-list li {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(190, 152, 90, 0.14);
  font-size: 0.76rem;
  color: #a99b82;
}

.key-list kbd {
  font-family: inherit;
  font-size: 0.66rem;
  color: #e6d3a8;
  border: 1px solid rgba(190, 152, 90, 0.4);
  background: rgba(30, 24, 18, 0.8);
  padding: 2px 6px;
  margin-right: 2px;
  white-space: nowrap;
}

.key-list span {
  flex: 1;
}

/* ----------------------------- travel ------------------------------ */

.travel-list {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.travel-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  text-align: left;
  font-family: inherit;
  background: linear-gradient(180deg, rgba(28, 22, 17, 0.65), rgba(10, 8, 6, 0.65));
  border: 1px solid rgba(190, 152, 90, 0.2);
  color: #cfc0a4;
  cursor: pointer;
}

.travel-row:hover:not(:disabled) {
  border-color: rgba(232, 195, 122, 0.55);
  background: linear-gradient(180deg, rgba(40, 31, 22, 0.8), rgba(14, 11, 8, 0.8));
}

.travel-row:disabled {
  opacity: 0.45;
  cursor: default;
}

.travel-row.is-here {
  border-color: rgba(127, 200, 255, 0.4);
  background: linear-gradient(180deg, rgba(20, 30, 40, 0.55), rgba(8, 10, 14, 0.7));
}

.travel-glyph {
  font-size: 1.3rem;
  color: #7fc8ff;
  text-align: center;
}

.travel-text b {
  display: block;
  font-size: 0.86rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #efdfb6;
}

.travel-text i {
  font-size: 0.72rem;
  color: #8f8066;
  font-style: italic;
}

.travel-state {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8f8066;
}

/* ------------------------------ shop ------------------------------- */

.shop-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.shop-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.shop-section {
  margin: 0 0 8px;
  font-size: 0.64rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #b08c53;
}

.shop-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 4px;
}

.shop-row {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  text-align: left;
  font-family: inherit;
  background: rgba(18, 14, 10, 0.7);
  border: 1px solid rgba(190, 152, 90, 0.18);
  color: #cfc0a4;
  cursor: pointer;
}

.shop-row:hover {
  border-color: rgba(232, 195, 122, 0.55);
  background: rgba(32, 25, 17, 0.85);
}

.shop-icon {
  width: 26px;
  height: 26px;
  color: var(--rarity);
}

.shop-text b {
  display: block;
  font-size: 0.76rem;
  font-weight: 600;
}

.shop-text i {
  font-size: 0.65rem;
  color: #8f8066;
  font-style: normal;
}

.shop-price {
  font-size: 0.72rem;
  color: #e0c37e;
  white-space: nowrap;
}

.shop-price.cannot {
  color: #a5564c;
}

.potion-shop {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* ----------------------------- dialog ------------------------------ */

.dialog-layout {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 18px;
}

.dialog-portrait {
  width: 90px;
  height: 90px;
  color: #9ad8c0;
  opacity: 0.8;
}

.dialog-portrait svg {
  width: 100%;
  height: 100%;
  fill: none;
}

.dialog-line {
  margin: 0 0 16px;
  font-size: 0.94rem;
  line-height: 1.7;
  color: #d3c4a2;
  font-style: italic;
}

.dialog-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pause-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  max-width: 320px;
  margin: 0 auto;
}

.pause-actions .bone-button {
  padding: 10px 16px;
}

/* ---------------------------- tooltip ------------------------------ */

.tooltip {
  position: fixed;
  z-index: 120;
  width: 272px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(16, 13, 10, 0.98), rgba(7, 6, 5, 0.99));
  border: 1px solid var(--rarity, #c9a86a);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.85);
  padding: 10px 12px 11px;
  font-size: 0.76rem;
  line-height: 1.45;
  color: #cfc0a4;
}

.tip-name {
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  margin-bottom: 1px;
}

.tip-type {
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8f8066;
  margin-bottom: 7px;
}

.tip-lines {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 7px 0;
  border-top: 1px solid rgba(190, 152, 90, 0.18);
  border-bottom: 1px solid rgba(190, 152, 90, 0.18);
}

.stat-base {
  color: #e3d4b4;
}

.stat-muted {
  color: #8f8066;
  font-size: 0.7rem;
}

.stat-affix {
  color: #8fb0e8;
}

.tip-flavor {
  margin-top: 8px;
  font-size: 0.72rem;
  font-style: italic;
  color: #9a8670;
}

.tip-req,
.tip-value {
  margin-top: 6px;
  font-size: 0.64rem;
  color: #7f725c;
}

.tip-value {
  color: #b99b5f;
}

.tip-compare {
  margin-top: 6px;
  font-size: 0.68rem;
}

.tip-compare.better {
  color: #8fd8a8;
}

.tip-compare.worse {
  color: #d17868;
}

.tip-tag {
  font-size: 0.56rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #7f725c;
  margin-bottom: 3px;
}

.tip-worn {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px dashed rgba(190, 152, 90, 0.3);
}

.tip-worn .tip-name {
  font-size: 0.82rem;
}

.tip-worn .tip-lines {
  padding-bottom: 0;
  border-bottom: 0;
}

/* A touch long-press pins the card to the top of the screen, clear of the
   thumb that is still holding the item. */
.tooltip.is-pinned {
  left: 50% !important;
  top: max(10px, env(safe-area-inset-top)) !important;
  transform: translateX(-50%);
  width: min(88vw, 330px);
  max-height: 70vh;
  overflow-y: auto;
  pointer-events: auto;
  touch-action: pan-y;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 980px) {
  .ashveil {
    height: min(78vh, 74vw);
    min-height: 460px;
  }

  .orb {
    width: 96px;
    flex-basis: 96px;
  }

  .orb-shell {
    width: 88px;
    height: 88px;
  }

  .orb-read b {
    font-size: 0.68rem;
  }

  .skill {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
  }

  .zone-card {
    min-width: 0;
    padding: 7px 12px;
  }

  .zone-sub,
  .target-card {
    display: none;
  }

  .quest-line {
    font-size: 0.7rem;
    max-width: 220px;
  }

  .minimap-frame {
    width: 112px;
    height: 112px;
  }

  .hud-actions {
    max-width: 220px;
  }

  .hud-actions button {
    padding: 5px 7px;
    font-size: 0.6rem;
  }

  .hud-actions kbd {
    display: none;
  }

  .inventory-layout,
  .skills-layout,
  .quest-layout,
  .help-grid,
  .shop-layout {
    grid-template-columns: 1fr;
  }

  .pack-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  .doll-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .character-sheet,
  .journal {
    border-left: 0;
    padding-left: 0;
    border-top: 1px solid rgba(190, 152, 90, 0.18);
    padding-top: 12px;
  }

  .class-list {
    grid-template-columns: 1fr;
  }

  .scene-title {
    align-items: flex-start;
  }

  .game-title {
    font-size: clamp(2.6rem, 12vw, 4rem);
  }

  .run-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .ashveil {
    height: 84vh;
    min-height: 420px;
    border-left: 0;
    border-right: 0;
  }

  .ashveil-header,
  .ashveil-footnote {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .hud-left {
    top: 8px;
    left: 8px;
  }

  .hud-right {
    top: 8px;
    right: 8px;
  }

  .minimap-frame {
    width: 88px;
    height: 88px;
  }

  .hud-actions button {
    padding: 4px 6px;
    font-size: 0.54rem;
  }

  .hud-bottom {
    padding: 0 6px 6px;
    gap: 4px;
  }

  .orb {
    width: 64px;
    flex-basis: 64px;
  }

  .orb-shell {
    width: 62px;
    height: 62px;
  }

  .orb-read span {
    display: none;
  }

  .orb-read b {
    font-size: 0.58rem;
  }

  .belt {
    padding: 6px 6px 5px;
  }

  .skill {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .skill-bar {
    gap: 4px;
  }

  .potion {
    width: 34px;
    height: 44px;
    flex-basis: 34px;
  }

  .potion-key {
    display: none;
  }

  .zone-card h2 {
    font-size: 0.82rem;
  }

  .quest-line {
    display: none;
  }

  .toasts {
    left: 8px;
    top: 104px;
    max-width: 230px;
  }

  .scene-card {
    padding: 20px 16px;
  }

  .panel {
    padding: 8px;
  }

  .panel-card {
    max-height: 94%;
    padding: 14px;
  }

  .pack-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .doll-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .skill-row {
    grid-template-columns: 36px 1fr auto;
    padding: 8px;
  }

  .skill-row-icon {
    width: 32px;
    height: 32px;
  }
}

/* --------------------------------------------------------------------------
   Phone pass (≈390×844): keep every control reachable and the objective read-
   able without the HUD fighting the toast column.
   -------------------------------------------------------------------------- */

@media (max-width: 640px) {
  .scene {
    align-items: flex-start;
    padding: 10px;
  }

  .title-inner {
    margin: 0 auto;
    padding: 4px 0 16px;
  }

  .title-inner .eyebrow {
    font-size: 0.58rem;
    letter-spacing: 0.24em;
  }

  .game-title {
    font-size: clamp(2.1rem, 14vw, 2.9rem);
    letter-spacing: 0.1em;
    text-indent: 0.1em;
  }

  .title-tag {
    margin: 6px 0 10px;
    font-size: 0.6rem;
    letter-spacing: 0.16em;
    line-height: 1.6;
  }

  /* Three compact cards in one row keep both title buttons above the fold on
     a 390x844 phone (a returning player must see "Continue chronicle"). */
  .class-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .class-card {
    padding: 8px 5px 9px;
    align-items: center;
    text-align: center;
    gap: 3px;
  }

  .class-blurb {
    display: none;
  }

  .class-name {
    font-size: 0.72rem;
    margin-top: 2px;
    letter-spacing: 0.05em;
  }

  .class-epithet,
  .class-hint,
  .class-stats {
    display: none;
  }

  .class-crest {
    font-size: 1.1rem;
  }

  .class-card.is-selected::after {
    content: '✦';
    top: 4px;
    right: 5px;
    font-size: 0.6rem;
  }

  .title-actions {
    margin-top: 10px;
    gap: 8px;
  }

  .title-actions .bone-button {
    padding: 9px 13px;
    font-size: 0.7rem;
  }

  .title-foot {
    display: none;
  }

  .toasts {
    top: 196px;
    left: 8px;
    max-width: 196px;
  }

  .toast {
    font-size: 0.68rem;
    padding: 6px 8px;
  }

  .quest-line {
    display: block;
    max-width: 176px;
    font-size: 0.62rem;
    line-height: 1.45;
  }

  .hud-actions {
    max-width: 176px;
    gap: 4px;
  }

  .hud-actions button {
    padding: 5px 6px;
    font-size: 0.55rem;
  }

  .zone-card {
    padding: 6px 9px;
    min-width: 0;
    max-width: 200px;
  }

  .zone-card h2 {
    font-size: 0.76rem;
    letter-spacing: 0.08em;
  }

  .zone-sub {
    display: none;
  }

  .hud.has-boss .hud-left,
  .hud.has-boss .hud-right {
    top: 56px;
  }

  .boss-name {
    font-size: 0.68rem;
  }
}

@media (max-width: 640px) {
  .ashveil-page .ashveil-header {
    padding: 0.8rem 1rem 0.9rem;
  }

  .ashveil-page .ashveil-header h1 {
    font-size: 1.55rem;
    margin-bottom: 0.15rem;
  }

  .ashveil-page .ashveil-header p {
    display: none;
  }

  .ashveil-page .ashveil-header .eyebrow {
    margin-bottom: 0.3rem;
  }
}

@media (max-width: 640px) {
  .flash {
    width: 88%;
    top: 45%;
    font-size: 1.05rem;
    letter-spacing: 0.12em;
    white-space: normal;
    text-align: center;
  }

  .hud-actions {
    max-width: 196px;
  }

  .hud-actions button {
    min-height: 40px;
    padding: 8px 8px;
    font-size: 0.64rem;
  }

  /* Nothing in the HUD may sit between a thumb and the world. The action row
     moves into the pause panel, the objective card and minimap only report,
     and the single menu control lives in the belt at the bottom edge. */
  .hud-actions {
    display: none;
  }

  .hud .zone-card,
  .hud .minimap-frame {
    pointer-events: none;
  }

  .belt-menu {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    padding: 0;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1;
    color: #cfc0a4;
    background: linear-gradient(180deg, #1d1813, #100d0a);
    border: 1px solid rgba(190, 152, 90, 0.45);
    border-radius: 50%;
    cursor: pointer;
  }

  .belt-menu:active {
    color: #f6e6bd;
    border-color: #e8c37a;
  }

  .xp-row {
    gap: 6px;
  }

  .pause-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .pause-actions .bone-button {
    min-height: 42px;
  }

  /* The boss strip is read at a glance mid-fight, so name it properly. */
  .boss-name {
    font-size: 0.8rem;
    letter-spacing: 0.06em;
  }

  /* End-of-run buttons and the panel close are used by the thumb too. */
  .scene-actions .bone-button {
    min-height: 40px;
    padding: 9px 14px;
  }

  .panel-close {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
  }

  .skill {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }
}

/* --------------------------------------------------------------------------
   Playing on a phone: the drawn frame is pinned to the screen for the whole
   run, so the orb belt, the draughts and the skill row sit inside the viewport
   instead of below it, and scrolling can never slide the playfield out of
   reach. Pause → "Abandon & title" returns to the page.
   -------------------------------------------------------------------------- */

@media (max-width: 640px) {
  .ashveil.is-playing {
    position: fixed;
    inset: 0;
    width: auto;
    height: auto;
    min-height: 0;
    max-height: none;
    margin: 0;
    border: 0;
    z-index: 30;
  }

  .ashveil.is-playing .hud-bottom {
    padding-bottom: max(6px, env(safe-area-inset-bottom));
  }
}
