:root {
  /* Kiln of Cinders — Realms of the Kiln V3 Hand-Painted Forge Palette */
  --bg-obsidian: #090a10;
  --bg-basalt: #131117;
  --bg-plate: rgba(16, 13, 18, 0.88);
  --bg-plate-deep: rgba(10, 9, 14, 0.94);

  --brass: #c98a2e;
  --brass-bright: #f4c76b;
  --brass-dim: rgba(201, 138, 46, 0.38);
  --brass-hairline: rgba(201, 138, 46, 0.56);

  --amber: #f59e24;
  --amber-bright: #ffd36e;
  --ember-core: #fff3c4;
  --ember-deep: #d95d16;

  --cyan: #38e8ff;
  --cyan-soft: rgba(56, 232, 255, 0.22);

  --violet: #c77dff;
  --crimson: #ff3d5a;
  --crimson-deep: #a81730;

  --ivory: #f7efe0;
  --parchment: #d9ccb8;
  --ash: #9e9384;

  --spring-ease: cubic-bezier(0.22, 1.4, 0.36, 1);
  --drawer-ease: cubic-bezier(0.22, 1.18, 0.36, 1);

  --font-display: "Cinzel", Georgia, "Palatino Linotype", serif;
  --font-ui: "Space Grotesk", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-obsidian);
  color: var(--ivory);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  user-select: none;
  touch-action: none;
}

.stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: var(--bg-obsidian);
  opacity: 1;
  transition: opacity 0.22s ease-out;
}

.stage.is-booting {
  opacity: 0;
  animation: stageBootSafety 0.01s linear 0.45s forwards;
}

@keyframes stageBootSafety {
  to { opacity: 1; }
}

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

.is-hidden {
  display: none !important;
}

kbd {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid rgba(201, 138, 46, 0.45);
  background: rgba(24, 19, 17, 0.85);
  color: var(--brass-bright);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  clip-path: polygon(4px 0, calc(100% - 4px) 0, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 0 calc(100% - 4px), 0 4px);
}

/* ================================================================
   SHARED HAND-PAINTED UI SPRITE HELPERS
   ================================================================ */
.ui-divider-img {
  display: block;
  width: auto;
  max-width: 100%;
  height: 22px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.85));
}

.title-divider-img {
  height: 22px;
  margin: -2px 0 2px;
}

.drawer-divider-img {
  height: 18px;
  margin: 0 auto 10px;
  opacity: 0.92;
}

.shrine-divider-img {
  height: 22px;
  margin: 6px auto 12px;
}

/* Mirrored Hand-Painted Antique-Brass Corner Ornaments */
.ui-corner {
  position: absolute;
  width: 40px;
  height: 40px;
  pointer-events: none;
  z-index: 4;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.78));
}

.uc-tl { top: -6px; left: -6px; }
.uc-tr { top: -6px; right: -6px; transform: scaleX(-1); }
.uc-bl { bottom: -6px; left: -6px; transform: scaleY(-1); }
.uc-br { bottom: -6px; right: -6px; transform: scale(-1, -1); }

/* Illustrated 22-26px Shrine Icons inside Buttons & Drawer Headers */
.btn-sprite-icon {
  width: 23px;
  height: 23px;
  object-fit: contain;
  flex-shrink: 0;
  pointer-events: none;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.85));
}

.btn-icon-primary {
  width: 24px;
  height: 24px;
  position: relative;
  z-index: 1;
}

.drawer-header-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 8px rgba(245, 158, 36, 0.35));
}

/* ================================================================
   FORGED DIEGETIC HUD (Smooth Glide-In/Out + 9-Slice Brass Plates)
   ================================================================ */
.hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 12;
  display: grid;
  grid-template-columns: 1fr minmax(220px, 350px) 1fr;
  align-items: start;
  gap: 14px;
  padding: 12px 18px;
  pointer-events: none;
  opacity: 1;
  visibility: visible;
  contain: layout style;
  transform: translate3d(0, 0, 0);
  will-change: transform, opacity;
  transition: transform 0.38s var(--drawer-ease), opacity 0.28s ease, visibility 0.28s ease;
}

.hud.is-hidden {
  display: grid !important;
  opacity: 0;
  visibility: hidden;
  transform: translate3d(0, -20px, 0);
  pointer-events: none;
}

.hud.is-hidden * {
  pointer-events: none !important;
}

.hud-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.hud-left { justify-content: flex-start; }
.hud-center { justify-content: center; }
.hud-right { justify-content: flex-end; align-items: center; }

.hud-left-stack {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.hud-plates-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

/* Painted Antique-Brass 9-Slice HUD Plates */
.forge-plate {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 100px;
  padding: 5px 12px 6px;
  background-color: var(--bg-plate);
  background-clip: padding-box;
  border-style: solid;
  border-width: 7px;
  border-color: var(--brass-hairline);
  border-image-source: url("assets/ui/ui-panel-frame.png");
  border-image-slice: 60 fill;
  border-image-width: 12px;
  border-image-repeat: stretch;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.54);
  contain: layout style;
  transform: translateZ(0);
}

.plate-label {
  font-family: var(--font-ui);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--parchment);
  text-transform: uppercase;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

.plate-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 21px;
  font-weight: 800;
  line-height: 1.12;
  color: var(--ivory);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}

.combo-plate {
  min-width: 96px;
  transition: box-shadow 0.16s ease, transform 0.2s var(--spring-ease);
}

.combo-value {
  color: var(--amber-bright);
  transition: transform 0.14s var(--spring-ease), color 0.15s ease;
}

.combo-plate.is-hot {
  box-shadow: 0 0 18px rgba(245, 158, 36, 0.48), inset 0 0 14px rgba(245, 158, 36, 0.22);
}

.combo-plate.is-hot .combo-value {
  color: var(--ember-core);
  text-shadow: 0 0 12px rgba(255, 209, 102, 0.8);
}

.combo-plate.is-pop {
  animation: comboPopScale 0.28s var(--spring-ease);
}

@keyframes comboPopScale {
  0% { transform: scale(1); }
  40% { transform: scale(1.13); }
  100% { transform: scale(1); }
}

.combo-track {
  margin-top: 4px;
  width: 100%;
  height: 3px;
  background: rgba(247, 239, 224, 0.14);
  overflow: hidden;
}

.combo-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--ember-deep), var(--amber-bright), var(--cyan));
  transform: scaleX(0);
  transform-origin: left center;
  will-change: transform;
}

/* Act Crest, Level Seal, Overdrive & Relic Boon Pills */
.hud-act-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.act-crest {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  background: rgba(12, 10, 15, 0.84);
  border-left: 2px solid var(--brass);
  border-right: 1px solid rgba(201, 138, 46, 0.34);
  border-top: 1px solid rgba(201, 138, 46, 0.24);
  border-bottom: 1px solid rgba(201, 138, 46, 0.24);
}

.act-diamond {
  color: var(--amber-bright);
  font-size: 9px;
  line-height: 1;
}

.act-label-text {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--parchment);
  text-transform: uppercase;
}

.seal-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  background: rgba(24, 18, 14, 0.86);
  border: 1px solid rgba(244, 199, 107, 0.48);
  color: var(--amber-bright);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  clip-path: polygon(5px 0, calc(100% - 5px) 0, 100% 5px, 100% calc(100% - 5px), calc(100% - 5px) 100%, 5px 100%, 0 calc(100% - 5px), 0 5px);
}

.overdrive-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: linear-gradient(90deg, rgba(168, 23, 48, 0.94), rgba(217, 93, 22, 0.94));
  border: 1px solid var(--amber-bright);
  color: var(--ember-core);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 50%, calc(100% - 6px) 100%, 6px 100%, 0 50%);
  text-shadow: 0 0 8px rgba(255, 211, 110, 0.8);
  animation: overdrivePulse 1.15s ease-in-out infinite;
}

.relic-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 11px;
  background: linear-gradient(90deg, rgba(20, 44, 62, 0.94), rgba(70, 32, 92, 0.94));
  border: 1px solid var(--cyan);
  color: #dffbff;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 50%, calc(100% - 6px) 100%, 6px 100%, 0 50%);
  box-shadow: 0 0 16px rgba(56, 232, 255, 0.42);
  text-shadow: 0 0 8px rgba(56, 232, 255, 0.8);
  animation: relicBoonPulse 1.1s ease-in-out infinite;
}

@keyframes overdrivePulse {
  0%, 100% { filter: brightness(1); transform: scale(1); }
  50% { filter: brightness(1.18); transform: scale(1.03); }
}

@keyframes relicBoonPulse {
  0%, 100% { box-shadow: 0 0 10px rgba(56, 232, 255, 0.35); transform: scale(1); }
  50% { box-shadow: 0 0 22px rgba(56, 232, 255, 0.72), 0 0 12px rgba(199, 125, 255, 0.5); transform: scale(1.04); }
}

/* Ornate Flame Vial / Light Ring Bar (9-Slice Painted Frame) */
.vial-plate {
  position: relative;
  width: 100%;
  padding: 6px 13px 8px;
  background-color: var(--bg-plate);
  background-clip: padding-box;
  border-style: solid;
  border-width: 7px;
  border-color: var(--brass-hairline);
  border-image-source: url("assets/ui/ui-panel-frame.png");
  border-image-slice: 60 fill;
  border-image-width: 12px;
  border-image-repeat: stretch;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.58);
  contain: layout style;
  transform: translateZ(0);
}

.vial-plate::after {
  content: "";
  position: absolute;
  inset: -4px;
  pointer-events: none;
  border: 1px solid rgba(255, 61, 90, 0.72);
  box-shadow: 0 0 18px rgba(255, 61, 90, 0.65), inset 0 0 14px rgba(255, 61, 90, 0.3);
  opacity: 0;
  will-change: opacity;
}

.vial-plate.is-low::after {
  animation: vialDanger 0.72s ease-in-out infinite;
}

@keyframes vialDanger {
  0%, 100% { opacity: 0.38; }
  50% { opacity: 1; }
}

.vial-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.vial-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ivory);
}

.vial-brazier-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.light-pct {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 800;
  color: var(--amber-bright);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
}

.vial-plate.is-low .light-pct {
  color: #ff7c90;
}

.vial-frame {
  padding: 2px;
  border: 1px solid rgba(201, 138, 46, 0.55);
  background: rgba(7, 6, 10, 0.92);
}

.vial-plate.is-low .vial-frame {
  border-color: rgba(255, 61, 90, 0.78);
}

.light-track {
  position: relative;
  width: 100%;
  height: 9px;
  background: rgba(247, 239, 224, 0.08);
  overflow: hidden;
}

.light-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #cf4611 0%, var(--amber) 52%, var(--ember-core) 100%);
  box-shadow: 0 0 14px rgba(245, 158, 36, 0.65);
  transform: scaleX(1);
  transform-origin: left center;
  will-change: transform;
}

.vial-plate.is-low .light-fill {
  background: linear-gradient(90deg, #8f0f24 0%, var(--crimson) 60%, #ff99a8 100%);
  box-shadow: 0 0 14px rgba(255, 61, 90, 0.72);
}

.vial-ticks {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-evenly;
  pointer-events: none;
}

.vial-ticks span {
  width: 1px;
  height: 100%;
  background: rgba(12, 9, 10, 0.65);
}

/* Cyan Spark Gem Dash Ring */
.dash-plate {
  flex-direction: row;
  align-items: center;
  gap: 9px;
  min-width: auto;
  padding: 4px 10px 4px 6px;
}

.dash-ring {
  --dash-deg: 360deg;
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: conic-gradient(var(--cyan) var(--dash-deg), rgba(56, 232, 255, 0.14) 0deg);
  display: grid;
  place-items: center;
  border: 1px solid rgba(201, 138, 46, 0.45);
  transition: box-shadow 0.18s ease, transform 0.14s var(--spring-ease);
}

.dash-ring.is-ready {
  border-color: rgba(56, 232, 255, 0.72);
  box-shadow: 0 0 15px rgba(56, 232, 255, 0.48);
}

.dash-ring-inner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #0d111b;
  display: grid;
  place-items: center;
}

.dash-text {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--cyan);
}

.dash-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dash-key-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--brass-bright);
  letter-spacing: 0.08em;
}

/* Hammered Iron Mute Toggle */
.forge-icon-btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  background-color: var(--bg-plate);
  background-clip: padding-box;
  border-style: solid;
  border-width: 7px;
  border-color: var(--brass-hairline);
  border-image-source: url("assets/ui/ui-panel-frame.png");
  border-image-slice: 60 fill;
  border-image-width: 12px;
  border-image-repeat: stretch;
  color: var(--ivory);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.55);
  transform: translateZ(0);
  transition: box-shadow 0.16s ease, opacity 0.16s ease, transform 0.2s var(--spring-ease);
}

.forge-icon-btn:hover {
  box-shadow: 0 6px 18px rgba(245, 158, 36, 0.36);
  transform: translateY(-2px);
}

.forge-icon-btn:active {
  transform: scale(0.96);
}

.forge-icon-btn.is-muted {
  color: var(--ash);
  opacity: 0.72;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.55);
}

/* ================================================================
   ACT / LEVEL TRANSITION BANNER
   ================================================================ */
.act-banner {
  position: absolute;
  top: 17%;
  left: 50%;
  transform: translate(-50%, 0) scale(1);
  width: min(680px, 88vw);
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  pointer-events: none;
  opacity: 1;
  visibility: visible;
  transition: transform 0.42s var(--drawer-ease), opacity 0.3s ease, visibility 0.3s ease;
}

.act-banner.is-hidden {
  display: flex !important;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -14px) scale(0.95);
  pointer-events: none;
}

.act-banner-rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brass-bright), transparent);
  opacity: 0.8;
}

.act-banner-body {
  text-align: center;
  padding: 6px 14px;
  background: radial-gradient(ellipse at center, rgba(9, 8, 13, 0.78) 0%, rgba(9, 8, 13, 0) 76%);
}

.act-banner-eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.34em;
  color: var(--brass-bright);
  text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
}

.act-banner-title {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: clamp(24px, 4vw, 38px);
  font-weight: 900;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ember-core);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.95), 0 0 26px rgba(245, 158, 36, 0.55);
}

/* ================================================================
   UNOBSTRUCTED PLAYABLE SANCTUARY TITLE OVERLAY
   ================================================================ */
.title-sanctuary {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px 24px 10px;
  pointer-events: none;
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  transition: opacity 0.36s ease, transform 0.42s var(--drawer-ease), visibility 0.36s ease;
}

.title-sanctuary.is-hidden {
  display: flex !important;
  opacity: 0;
  visibility: hidden;
  transform: scale(1.03);
  pointer-events: none;
}

.title-sanctuary.is-hidden * {
  pointer-events: none !important;
}

/* Soft top/bottom vignettes only — middle ~65% wide open for Pip & pedestals */
.sanctuary-edge-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(8, 7, 12, 0.72) 0%,
    rgba(8, 7, 12, 0.22) 16%,
    rgba(8, 7, 12, 0) 27%,
    rgba(8, 7, 12, 0) 75%,
    rgba(8, 7, 12, 0.46) 88%,
    rgba(8, 7, 12, 0.84) 100%
  );
}

/* Compact Regal Top Header */
.sanctuary-header {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  pointer-events: none;
}

.sanctuary-brand-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.brand-crest-img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 0 16px rgba(245, 158, 36, 0.55)) drop-shadow(0 3px 8px rgba(0, 0, 0, 0.9));
  animation: crestFloat 3.4s ease-in-out infinite;
}

@keyframes crestFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.sanctuary-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(28px, 3.8vw, 46px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #fff8de 0%, #ffd36e 44%, #d98924 80%, #9e5612 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 12px rgba(0, 0, 0, 0.95)) drop-shadow(0 0 22px rgba(245, 158, 36, 0.36));
}

.sanctuary-meta-strip {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 2px;
}

.realm-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 12px;
  background: rgba(14, 11, 17, 0.84);
  border: 1px solid rgba(201, 138, 46, 0.54);
  color: var(--brass-bright);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  clip-path: polygon(7px 0, calc(100% - 7px) 0, 100% 50%, calc(100% - 7px) 100%, 7px 100%, 0 50%);
}

.sanctuary-best {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 3px 11px;
  background: rgba(14, 11, 17, 0.82);
  border-left: 2px solid var(--amber);
  border-right: 1px solid rgba(201, 138, 46, 0.3);
  border-top: 1px solid rgba(201, 138, 46, 0.24);
  border-bottom: 1px solid rgba(201, 138, 46, 0.24);
}

.sanctuary-best-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--ash);
}

.sanctuary-best-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 800;
  color: var(--amber-bright);
}

/* Compact Forged Bottom Quick-Dock */
.sanctuary-dock-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.sanctuary-dock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 4px 8px;
  pointer-events: auto;
}

/* Painted Secondary / Quick-Dock Button Plaque */
.dock-btn,
.forge-secondary-btn {
  appearance: none;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 36px;
  border: none;
  background: transparent url("assets/ui/ui-btn-secondary.png") center / 100% 100% no-repeat;
  color: var(--ivory);
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.96);
  cursor: pointer;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.65));
  transition: transform 0.24s var(--spring-ease), filter 0.18s ease, color 0.16s ease;
}

.dock-btn:hover,
.forge-secondary-btn:hover {
  transform: translateY(-3px) scale(1.03);
  color: var(--ember-core);
  filter: brightness(1.18) drop-shadow(0 10px 20px rgba(245, 158, 36, 0.34));
}

.dock-btn:active,
.forge-secondary-btn:active {
  transform: translateY(0) scale(0.96);
}

.dock-btn.is-active,
.dock-btn[aria-expanded="true"] {
  color: #dffbff;
  filter: brightness(1.2) drop-shadow(0 0 16px rgba(56, 232, 255, 0.55));
}

.forge-secondary-sm {
  min-height: 38px;
  padding: 8px 28px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
}

.sanctuary-hint {
  margin: 0;
  font-size: 12px;
  color: var(--parchment);
  letter-spacing: 0.04em;
  text-align: center;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.95);
}

/* ================================================================
   HAND-PAINTED PRIMARY PLAQUE BUTTONS (IGNITE / REKINDLE / RESUME)
   ================================================================ */
.forge-btn-frame {
  display: inline-block;
  filter: drop-shadow(0 8px 20px rgba(245, 158, 36, 0.42));
  transition: transform 0.24s var(--spring-ease), filter 0.2s ease;
}

.forge-btn-frame:hover {
  transform: translateY(-3px) scale(1.04);
  filter: brightness(1.16) drop-shadow(0 12px 28px rgba(245, 158, 36, 0.68));
}

.forge-btn-frame:active {
  transform: translateY(0) scale(0.96);
}

.forge-primary-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 198px;
  min-height: 54px;
  padding: 12px 42px;
  border: none;
  background: transparent url("assets/ui/ui-btn-primary.png") center / 100% 100% no-repeat;
  color: #fff8df;
  font-family: var(--font-display);
  font-size: 16.5px;
  font-weight: 900;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-shadow: 0 2px 4px rgba(14, 6, 2, 0.98), 0 0 14px rgba(255, 206, 104, 0.55);
  cursor: pointer;
}

.dock-ignite-btn {
  min-width: 192px;
  min-height: 54px;
  padding: 11px 38px;
  font-size: 16px;
}

.forge-primary-btn .btn-label {
  position: relative;
  z-index: 1;
}

.btn-sheen-clip {
  position: absolute;
  inset: 7px 24px;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.forge-primary-btn .btn-sheen {
  position: absolute;
  top: -25%;
  left: -80%;
  width: 55%;
  height: 160%;
  background: linear-gradient(90deg, transparent, rgba(255, 250, 224, 0.65), transparent);
  transform: skewX(-26deg);
  transition: left 0.56s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.forge-primary-btn:hover .btn-sheen {
  left: 138%;
}

.forge-primary-btn:focus-visible,
.forge-secondary-btn:focus-visible,
.forge-signin-btn:focus-visible,
.dock-btn:focus-visible,
.drawer-close-btn:focus-visible,
.lb-tab:focus-visible,
#forge-style-list [data-flame-id]:focus-visible,
#realm-card-list [data-map-id]:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* ================================================================
   3 SPRING-EASED FORGED SLIDE-OUT DRAWERS (9-Slice + Corner Filigree)
   ================================================================ */
.slide-drawer {
  position: absolute;
  z-index: 24;
  display: flex;
  flex-direction: column;
  padding: 14px 16px 14px;
  background-color: rgba(12, 10, 15, 0.9);
  background-clip: padding-box;
  border-style: solid;
  border-width: 12px;
  border-color: var(--brass-hairline);
  border-image-source: url("assets/ui/ui-panel-frame.png");
  border-image-slice: 60 fill;
  border-image-width: 22px;
  border-image-repeat: stretch;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.78);
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
  contain: layout style;
  transform: translate3d(0, 0, 0) scale(1);
  will-change: transform, opacity;
  transition: transform 0.38s var(--drawer-ease), opacity 0.26s ease, visibility 0.26s ease;
}

/* Left Forge Drawer */
.forge-drawer {
  top: 108px;
  bottom: 98px;
  left: 20px;
  width: min(362px, calc(100vw - 32px));
}

.forge-drawer.is-hidden {
  display: flex !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-40px) scale(0.97);
}

/* Bottom-Left Realm Selector Drawer (leaves right half live for biome preview!) */
.realm-drawer {
  bottom: 102px;
  left: 20px;
  width: min(572px, calc(100vw - 32px));
  max-height: calc(100vh - 210px);
}

.realm-drawer.is-hidden {
  display: flex !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(36px) scale(0.97);
}

/* Right Hall of Flames Drawer */
.lb-drawer {
  top: 108px;
  bottom: 98px;
  right: 20px;
  width: min(392px, calc(100vw - 32px));
}

.lb-drawer.is-hidden {
  display: flex !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(40px) scale(0.97);
}

.slide-drawer.is-hidden * {
  pointer-events: none !important;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.drawer-title-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.drawer-heading-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.drawer-eyebrow {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--brass-bright);
  text-transform: uppercase;
}

.drawer-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 17.5px;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: var(--ivory);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}

.drawer-close-btn {
  appearance: none;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(201, 138, 46, 0.5);
  background: rgba(16, 13, 18, 0.92);
  color: var(--parchment);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 0 calc(100% - 6px), 0 6px);
  transition: transform 0.2s var(--spring-ease), border-color 0.15s ease, color 0.15s ease;
}

.drawer-close-btn:hover {
  border-color: var(--brass-bright);
  color: var(--ember-core);
  transform: scale(1.08);
}

.drawer-close-btn:active {
  transform: scale(0.94);
}

/* ================================================================
   FLAME FORGE CARDS
   ================================================================ */
.forge-style-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 138, 46, 0.45) transparent;
}

#forge-style-list [data-flame-id],
.flame-card {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  text-align: left;
  border: 1px solid rgba(201, 138, 46, 0.28);
  background: linear-gradient(180deg, rgba(24, 19, 24, 0.82), rgba(11, 10, 15, 0.9));
  color: var(--ivory);
  cursor: pointer;
  clip-path: polygon(9px 0, calc(100% - 9px) 0, 100% 9px, 100% calc(100% - 9px), calc(100% - 9px) 100%, 9px 100%, 0 calc(100% - 9px), 0 9px);
  transition: transform 0.22s var(--spring-ease), border-color 0.16s ease, background 0.16s ease, box-shadow 0.18s ease;
}

#forge-style-list [data-flame-id]:hover:not(.is-locked):not(:disabled),
.flame-card:hover:not(.is-locked):not(:disabled) {
  transform: translateX(4px) scale(1.015);
  border-color: var(--brass-bright);
  background: linear-gradient(180deg, rgba(44, 32, 24, 0.9), rgba(18, 14, 18, 0.94));
  box-shadow: 0 6px 18px rgba(245, 158, 36, 0.2);
}

#forge-style-list [data-flame-id]:active:not(.is-locked):not(:disabled),
.flame-card:active:not(.is-locked):not(:disabled) {
  transform: scale(0.96);
}

#forge-style-list [data-flame-id].is-equipped,
#forge-style-list [data-flame-id].is-active,
#forge-style-list [data-flame-id].is-selected,
#forge-style-list [data-flame-id][aria-pressed="true"] {
  border-color: var(--amber-bright);
  background: linear-gradient(90deg, rgba(245, 158, 36, 0.22), rgba(20, 15, 19, 0.92));
  box-shadow: inset 0 0 18px rgba(245, 158, 36, 0.18), 0 0 16px rgba(245, 158, 36, 0.22);
}

#forge-style-list [data-flame-id].is-locked,
#forge-style-list [data-flame-id]:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  border-style: dashed;
}

.flame-swatch {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, #ffffff 0%, var(--swatch, var(--amber)) 52%, rgba(0, 0, 0, 0.4) 100%);
  border: 1px solid rgba(255, 243, 196, 0.55);
  box-shadow: 0 0 14px var(--swatch, var(--amber));
}

.flame-card-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.flame-card-name {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ivory);
}

.flame-card-sub {
  font-size: 11.5px;
  color: var(--ash);
  line-height: 1.3;
}

.flame-card-badge {
  flex-shrink: 0;
  padding: 3px 7px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--brass-bright);
  background: rgba(10, 9, 14, 0.78);
  border: 1px solid rgba(201, 138, 46, 0.36);
  text-transform: uppercase;
}

.flame-card.is-equipped .flame-card-badge,
#forge-style-list [data-flame-id].is-equipped .flame-card-badge {
  color: #160e06;
  background: var(--amber-bright);
  border-color: var(--ember-core);
}

/* ================================================================
   REALM SELECTOR CARDS
   ================================================================ */
.realm-card-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  overflow-y: auto;
  padding: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 138, 46, 0.45) transparent;
}

#realm-card-list [data-map-id],
.realm-card {
  appearance: none;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 12px 13px;
  text-align: left;
  border: 1px solid rgba(201, 138, 46, 0.3);
  background: linear-gradient(180deg, rgba(24, 19, 25, 0.84), rgba(11, 10, 16, 0.92));
  color: var(--ivory);
  cursor: pointer;
  clip-path: polygon(11px 0, calc(100% - 11px) 0, 100% 11px, 100% calc(100% - 11px), calc(100% - 11px) 100%, 11px 100%, 0 calc(100% - 11px), 0 11px);
  transition: transform 0.24s var(--spring-ease), border-color 0.16s ease, background 0.16s ease, box-shadow 0.2s ease;
}

#realm-card-list [data-map-id]:hover,
.realm-card:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: var(--brass-bright);
  background: linear-gradient(180deg, rgba(42, 30, 28, 0.9), rgba(15, 12, 18, 0.95));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55), 0 0 18px rgba(245, 158, 36, 0.18);
}

#realm-card-list [data-map-id]:active,
.realm-card:active {
  transform: scale(0.96);
}

#realm-card-list [data-map-id].is-selected,
#realm-card-list [data-map-id].is-active,
#realm-card-list [data-map-id][aria-pressed="true"] {
  border-color: var(--amber-bright);
  background: linear-gradient(160deg, rgba(245, 158, 36, 0.22), rgba(18, 14, 22, 0.94));
  box-shadow: inset 0 0 20px rgba(245, 158, 36, 0.16), 0 0 20px rgba(245, 158, 36, 0.24);
}

#realm-card-list [data-map-id="frostfire"].is-selected,
#realm-card-list [data-map-id="frostfire"]:hover {
  border-color: var(--cyan);
  box-shadow: 0 8px 22px rgba(56, 232, 255, 0.22);
}

#realm-card-list [data-map-id="citadel"].is-selected,
#realm-card-list [data-map-id="citadel"]:hover {
  border-color: var(--violet);
  box-shadow: 0 8px 22px rgba(199, 125, 255, 0.24);
}

.realm-card-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.realm-card-name {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--ivory);
}

.realm-mult-pill {
  flex-shrink: 0;
  padding: 2px 7px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  color: var(--ember-core);
  background: rgba(201, 138, 46, 0.22);
  border: 1px solid rgba(244, 199, 107, 0.5);
  clip-path: polygon(4px 0, calc(100% - 4px) 0, 100% 50%, calc(100% - 4px) 100%, 4px 100%, 0 50%);
}

.realm-stars {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--amber-bright);
}

.realm-mechanic {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--parchment);
}

/* ================================================================
   HALL OF FLAMES — LEADERBOARD TABS & ROWS
   ================================================================ */
.lb-mode-badge {
  display: inline-block;
  align-self: flex-start;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--brass-bright);
  text-transform: uppercase;
  opacity: 0.92;
}

.lb-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 11px;
  padding: 3px;
  background: rgba(7, 6, 10, 0.74);
  border: 1px solid rgba(201, 138, 46, 0.3);
}

.lb-tabs-compact {
  display: inline-grid;
  min-width: 190px;
  margin-bottom: 0;
}

.lb-tab {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ash);
  padding: 7px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease, transform 0.16s var(--spring-ease);
}

.lb-tab:hover {
  color: var(--ivory);
}

.lb-tab:active {
  transform: scale(0.96);
}

.lb-tab.is-active,
.lb-tab[aria-selected="true"] {
  background: linear-gradient(180deg, rgba(201, 138, 46, 0.28), rgba(140, 82, 18, 0.2));
  border-color: rgba(244, 199, 107, 0.58);
  color: var(--ember-core);
  text-shadow: 0 0 10px rgba(245, 158, 36, 0.42);
}

.lb-list {
  flex: 1;
  min-height: 150px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 138, 46, 0.45) transparent;
}

.lb-list.is-loading {
  opacity: 0.6;
}

.lb-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.lb-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  background: rgba(18, 15, 20, 0.72);
  border: 1px solid rgba(201, 138, 46, 0.18);
  clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 0 calc(100% - 6px), 0 6px);
}

.lb-row.is-me {
  background: linear-gradient(90deg, rgba(56, 232, 255, 0.15), rgba(245, 158, 36, 0.13));
  border-color: rgba(56, 232, 255, 0.58);
}

.lb-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  color: var(--ash);
  background: rgba(10, 9, 14, 0.8);
  border: 1px solid rgba(201, 138, 46, 0.22);
  clip-path: polygon(5px 0, calc(100% - 5px) 0, 100% 50%, calc(100% - 5px) 100%, 5px 100%, 0 50%);
}

.lb-rank-1 .lb-rank {
  background: linear-gradient(180deg, #ffe591, #c9861a);
  border-color: #fff3c4;
  color: #191005;
}

.lb-rank-2 .lb-rank {
  background: linear-gradient(180deg, #e7edf5, #8d99a8);
  border-color: #f5f8fc;
  color: #11151c;
}

.lb-rank-3 .lb-rank {
  background: linear-gradient(180deg, #e5a976, #8f4e22);
  border-color: #f6c9a0;
  color: #1a0e06;
}

.lb-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.lb-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--ivory);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}

.lb-row.is-me .lb-name {
  color: #baf7ff;
}

/* Compact Realm Tag on Leaderboard Entries */
.lb-realm-tag {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 1px 5px;
  color: var(--amber-bright);
  background: rgba(245, 158, 36, 0.14);
  border: 1px solid rgba(245, 158, 36, 0.34);
  text-transform: uppercase;
}

.lb-realm-tag[data-realm-tag="frostfire"] {
  color: #8df2ff;
  background: rgba(56, 232, 255, 0.14);
  border-color: rgba(56, 232, 255, 0.38);
}

.lb-realm-tag[data-realm-tag="foundry"] {
  color: #ffab7a;
  background: rgba(255, 123, 59, 0.16);
  border-color: rgba(255, 123, 59, 0.4);
}

.lb-realm-tag[data-realm-tag="citadel"] {
  color: #dfaeff;
  background: rgba(199, 125, 255, 0.16);
  border-color: rgba(199, 125, 255, 0.4);
}

.lb-meta {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--brass-bright);
  padding: 1px 5px;
  background: rgba(201, 138, 46, 0.12);
  border: 1px solid rgba(201, 138, 46, 0.24);
}

.lb-score {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  font-weight: 800;
  color: var(--amber-bright);
  letter-spacing: 0.03em;
}

.lb-rank-1 .lb-score {
  color: var(--ember-core);
  text-shadow: 0 0 10px rgba(255, 211, 110, 0.45);
}

.lb-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  min-height: 144px;
  padding: 18px 14px;
  border: 1px dashed rgba(201, 138, 46, 0.28);
  background: rgba(9, 8, 13, 0.45);
}

.lb-empty-glyph {
  color: var(--brass);
  font-size: 16px;
  opacity: 0.75;
}

.lb-empty-text {
  margin: 0;
  max-width: 240px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ash);
}

.hall-footer {
  margin-top: 10px;
  display: flex;
  justify-content: center;
}

.forge-signin-btn {
  appearance: none;
  width: 100%;
  padding: 8px 14px;
  border: 1px solid rgba(56, 232, 255, 0.48);
  background: rgba(56, 232, 255, 0.1);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 0 calc(100% - 8px), 0 8px);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.2s var(--spring-ease);
}

.forge-signin-btn:hover {
  background: rgba(56, 232, 255, 0.18);
  border-color: var(--cyan);
  transform: translateY(-2px);
}

.forge-signin-btn:active {
  transform: scale(0.96);
}

.forge-signin-sm {
  width: auto;
  padding: 5px 10px;
  font-size: 10px;
}

/* ================================================================
   PAUSE & GAME OVER SHRINE TABLETS (9-Slice + Corner Filigree)
   ================================================================ */
.shrine-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: radial-gradient(circle at 50% 45%, rgba(9, 8, 13, 0.56), rgba(7, 6, 11, 0.9) 76%);
  opacity: 1;
  visibility: visible;
  will-change: transform, opacity;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.shrine-overlay.is-hidden {
  display: grid !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.shrine-overlay.is-hidden * {
  pointer-events: none !important;
}

.shrine-tablet {
  position: relative;
  width: min(580px, 100%);
  padding: 24px 28px 22px;
  background-color: rgba(12, 10, 15, 0.94);
  background-clip: padding-box;
  border-style: solid;
  border-width: 14px;
  border-color: var(--brass-hairline);
  border-image-source: url("assets/ui/ui-panel-frame.png");
  border-image-slice: 60 fill;
  border-image-width: 24px;
  border-image-repeat: stretch;
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.85);
  text-align: center;
  transform: translate3d(0, 0, 0) scale(1);
  will-change: transform, opacity;
  transition: transform 0.38s var(--drawer-ease);
}

.shrine-tablet .ui-corner {
  width: 46px;
  height: 46px;
}

.shrine-tablet .uc-tl { top: -8px; left: -8px; }
.shrine-tablet .uc-tr { top: -8px; right: -8px; }
.shrine-tablet .uc-bl { bottom: -8px; left: -8px; }
.shrine-tablet .uc-br { bottom: -8px; right: -8px; }

.shrine-overlay.is-hidden .shrine-tablet {
  transform: translateY(20px) scale(0.95);
}

.shrine-eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.eyebrow-amber { color: var(--brass-bright); }
.eyebrow-danger { color: #ff6981; }

.shrine-heading {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(24px, 3.8vw, 34px);
  font-weight: 900;
  letter-spacing: 0.14em;
  color: var(--ivory);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.9);
}

.shrine-controls {
  margin: 0 0 20px;
  padding: 10px 14px;
  border-top: 1px solid rgba(201, 138, 46, 0.24);
  border-bottom: 1px solid rgba(201, 138, 46, 0.24);
  background: rgba(7, 6, 10, 0.5);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ash);
}

.shrine-controls strong {
  color: var(--ivory);
  font-weight: 700;
}

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

.pause-settings {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}

.hero-prompt {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--ash);
  letter-spacing: 0.04em;
}

/* ---------------- Game Over Tablet ---------------- */
.gameover-tablet {
  width: min(772px, 100%);
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  padding: 16px 24px 16px;
}

.go-header {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.go-banners {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.new-best-ribbon {
  display: inline-block;
  margin-top: 4px;
  padding: 4px 14px;
  background: linear-gradient(90deg, rgba(56, 232, 255, 0.18), rgba(245, 158, 36, 0.2));
  border: 1px solid rgba(56, 232, 255, 0.65);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.16em;
  clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 8px 100%, 0 50%);
}

.unlock-banner {
  display: inline-block;
  margin-top: 4px;
  padding: 4px 14px;
  background: linear-gradient(90deg, rgba(245, 158, 36, 0.26), rgba(199, 125, 255, 0.28));
  border: 1px solid var(--amber-bright);
  color: var(--ember-core);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.16em;
  clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 8px 100%, 0 50%);
  box-shadow: 0 0 18px rgba(245, 158, 36, 0.35);
  animation: unlockShimmer 1.6s ease-in-out infinite;
}

@keyframes unlockShimmer {
  0%, 100% { filter: brightness(1); transform: scale(1); }
  50% { filter: brightness(1.22); transform: scale(1.03); }
}

.go-emblem-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 8px 0 11px;
}

.go-rank-crest,
.go-act-crest,
.go-map-crest {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: rgba(8, 7, 12, 0.76);
  border: 1px solid rgba(201, 138, 46, 0.44);
  clip-path: polygon(7px 0, calc(100% - 7px) 0, 100% 7px, 100% calc(100% - 7px), calc(100% - 7px) 100%, 7px 100%, 0 calc(100% - 7px), 0 7px);
}

.go-crest-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--ash);
}

.go-rank-badge {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: var(--amber-bright);
}

.go-act-reached {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--ivory);
}

.go-map-tag {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--cyan);
}

.go-stats-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 11px;
}

.go-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 8px;
  background: rgba(20, 16, 22, 0.78);
  border: 1px solid rgba(201, 138, 46, 0.32);
  clip-path: polygon(7px 0, calc(100% - 7px) 0, 100% 7px, 100% calc(100% - 7px), calc(100% - 7px) 100%, 7px 100%, 0 calc(100% - 7px), 0 7px);
}

.go-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 20px;
  font-weight: 800;
  color: var(--ivory);
}

.accent-amber { color: var(--amber-bright); }
.accent-cyan { color: var(--cyan); }

.go-board-section {
  text-align: left;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: rgba(8, 7, 12, 0.62);
  border: 1px solid rgba(201, 138, 46, 0.3);
}

.go-board-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.go-board-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.go-board-meta .lb-mode-badge {
  margin-bottom: 0;
}

.lb-list-go {
  min-height: 98px;
  max-height: 156px;
}

.lb-list-go .lb-empty {
  min-height: 86px;
  padding: 12px;
}

.go-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ================================================================
   RESPONSIVE LAYOUT
   ================================================================ */
@media (max-width: 860px) {
  .title-sanctuary {
    padding: 8px 10px 8px;
  }

  .brand-crest-img {
    width: 38px;
    height: 38px;
  }

  .sanctuary-dock {
    gap: 5px;
    padding: 4px;
  }

  .dock-btn {
    min-height: 42px;
    padding: 8px 16px;
    font-size: 11px;
    gap: 5px;
  }

  .btn-sprite-icon {
    width: 19px;
    height: 19px;
  }

  .dock-ignite-btn {
    min-width: 148px;
    min-height: 46px;
    padding: 9px 24px;
    font-size: 13.5px;
  }

  .forge-drawer,
  .lb-drawer {
    top: 90px;
    bottom: 92px;
    left: 12px;
    right: 12px;
    width: auto;
  }

  .realm-drawer {
    bottom: 92px;
    left: 12px;
    right: 12px;
    width: auto;
    max-height: calc(100vh - 186px);
  }

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

  .hud {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    padding: 8px 10px;
    gap: 7px;
  }

  .hud-center {
    grid-column: 1 / -1;
    order: 3;
  }

  .forge-plate {
    min-width: 78px;
    padding: 4px 8px;
  }

  .plate-value {
    font-size: 18px;
  }

  .go-stats-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
