@font-face {
  font-family: "Press Start 2P";
  src: url("fonts/PressStart2P-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #1a1e22;
  --panel: #242a30;
  --panel-border: #5a636c;
  --text: #d8dde2;
  --muted: #9aa3ab;
  --button: #2a3036;
  --button-hover: #3e474f;
  --disabled: #1c2228;
  --font-size: 16px;
  --font-family: "Segoe UI", Tahoma, sans-serif;
  --font-title: "Press Start 2P", ui-monospace, monospace;
  --radius: 2px;
  --radius-sm: 2px;
  --radius-lg: 2px;
  --border-w: 2px;
  --control-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), inset 0 -2px 0 rgba(0, 0, 0, 0.35),
    0 0 0 1px #0e1012;
  --chrome-accent: #c4a030;
  --wash-top: rgba(80, 90, 100, 0.28);
  --wash-mid: rgba(20, 24, 28, 0.35);
  --wash-bottom: rgba(8, 10, 12, 0.7);
  --wash-radial: #2a3036;
  --sidebar: rgba(12, 14, 16, 0.88);
  --news-bg: rgba(12, 14, 16, 0.96);
  --rock: #c9bba8;
  --clay: #b5836a;
  --flint: #6b6e73;
  --gravel: #9aa4ab;
  --limestone: #d8d0b8;
  --slate: #4a5560;
  --sandstone: #c4a574;
  --siltstone: #9a8b78;
  --chert: #7a8a6a;
  --granite: #d4a090;
  --marble: #e8e4dc;
  --quartz: #c5d5e0;
  --bedrock: #8a8580;
  --basalt: #6a6460;
  --obsidian: #8b7bb8;
  --sulfur: #e6cf3a;
  --olivine: #8fc85a;
  --snowbank: #e8f4ff;
  --icepack: #9ec8e8;
  --blue-ice: #5aa0d8;
  --magma-chunk: #ff6a1a;
  --planet-core: #ff3b6b;
  --tektite: #8a7460;
  --stardust: #c8b8ff;
  --iridium: #a8c0d8;
  --manganese: #9a8070;
  --cobalt: #5a8ef2;
  --black-pearl: #a59fcc;
  --gems: #7fd0c3;
  --science: #7ea8d4;
  --perk-points: #e8c34a;
  --accent: #c4a030;
  --warn: #e39a3a;
  --ready: #ff8a1f;
  --danger: #d45c4c;
  --complete: #7dba6a;
  --shaft: #0e1114;
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: #8a5c3a #1a120e;
}

*::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

*::-webkit-scrollbar-track {
  background: linear-gradient(90deg, #0c0907 0 2px, #1c140f 2px, #241810 9px, #0c0907 9px);
  box-shadow: inset 0 0 0 1px #3a2a1c;
}

*::-webkit-scrollbar-thumb {
  background: repeating-linear-gradient(
    180deg,
    #6b4428 0 2px,
    #8a5a38 2px 4px,
    #5a3824 4px 5px,
    #a07048 5px 6px,
    #6b4428 6px 8px
  );
  border: 1px solid #2a1a12;
  box-shadow: inset 1px 0 0 rgba(232, 196, 140, 0.22), inset -1px 0 0 rgba(0, 0, 0, 0.35);
}

*::-webkit-scrollbar-thumb:hover {
  background: repeating-linear-gradient(
    180deg,
    #7a5030 0 2px,
    #9a6840 2px 4px,
    #6a4028 4px 5px,
    #b08050 5px 6px,
    #7a5030 6px 8px
  );
}

*::-webkit-scrollbar-corner {
  background: #1a120e;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  height: var(--app-height, 100dvh);
  overflow: hidden;
  background:
    linear-gradient(
      to bottom,
      var(--wash-top),
      transparent 22%,
      var(--wash-mid) 48%,
      var(--wash-bottom)
    ),
    radial-gradient(ellipse at top, var(--wash-radial), var(--bg) 58%);
  color: var(--text);
  font-family: var(--font-family);
  font-size: var(--font-size);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/*
 * Studio intro on launch (2s): from black, the dark logo fades in, holds, fades back to black,
 * then the game shows. A tap skips it. The stage repeats the logo image's own glow (centre 40%
 * down, dark from 600 of its 1024 px), so the square image melts into the screen at any size.
 */
.studio-intro {
  --logo: min(100vw, 62vh, 600px);
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #000;
  animation: studio-intro-out 0.2s linear 1.8s forwards;
}

.studio-intro-stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(
    circle calc(var(--logo) * 0.781) at 50% calc(50% - var(--logo) * 0.1),
    #2a3036 0,
    #12161a calc(var(--logo) * 0.586)
  );
  animation: studio-intro-show 1.75s ease-in-out both;
}

.studio-intro img {
  width: var(--logo);
  height: auto;
}

.studio-intro.is-skipping {
  animation: studio-intro-out 0.22s ease-in forwards;
}

/* In by 0.5s, hold, out to black by 1.75s. */
@keyframes studio-intro-show {
  0% {
    opacity: 0;
  }
  29%,
  71% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes studio-intro-out {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

.app {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr);
  position: relative;
  width: 100%;
  height: 100%;
  height: var(--app-height, 100dvh);
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}

.app.is-blocked {
  pointer-events: none;
}

input,
textarea,
select {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
  touch-action: auto;
}

@media (pointer: fine) and (min-width: 720px) {
  html,
  body {
    width: 100%;
    height: 100%;
    height: 100dvh;
  }

  body {
    display: grid;
    place-items: center;
  }

  .app {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr);
    width: min(100vw, calc(100dvh * 390 / 844));
    height: min(100dvh, calc(100vw * 844 / 390));
    overflow: hidden;
    border: var(--border-w) solid var(--panel-border);
  }

  /*
   * Discord on desktop opens Activities in a wide, short window, where the phone shape came out
   * narrower than any phone. Use the full height and a wider column (about 4:5) instead.
   */
  html[data-host="discord"][data-layout] .app {
    top: 0;
    width: min(100vw, clamp(440px, calc(100dvh * 0.8), 600px));
    height: 100dvh;
  }
}

.resources,
.news-log {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  pointer-events: auto;
}

.resources {
  top: 0;
  height: var(--drawer-resources-height, 56px);
  max-height: 45%;
  padding: 10px 18px 0;
  background: var(--sidebar);
  border-bottom: 1px solid var(--panel-border);
}

.news-log {
  bottom: 0;
  height: var(--drawer-news-height, 72px);
  max-height: 45%;
  padding: 0 18px 10px;
  background: var(--news-bg);
  border-top: 1px solid var(--panel-border);
}

.resources-body,
.news-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  flex: 1;
  scrollbar-gutter: stable;
}

.resources-body {
  overflow-y: scroll;
}

.resources.is-closed .resources-body,
.news-log.is-closed .news-body {
  overflow: hidden;
}

.resources.is-closed .resources-body {
  overflow-y: scroll;
  pointer-events: none;
  clip-path: inset(0 11px 0 0);
}

.drawer-tab {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  align-self: center;
  width: 52px;
  height: 22px;
  margin: 0;
  padding: 0;
  border: var(--border-w) solid var(--panel-border);
  background: var(--panel);
  color: var(--accent);
  cursor: grab;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.resources .drawer-tab {
  margin-bottom: -1px;
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
}

.news-log .drawer-tab {
  margin-top: -1px;
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
}

.drawer-tab:active {
  cursor: grabbing;
}

.drawer-arrow {
  display: grid;
  place-items: center;
  width: 28px;
  height: 22px;
  transition: transform 0.15s ease;
}

.drawer-arrow::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 7px solid var(--accent);
}

.resources .drawer-arrow {
  transform: rotate(0deg);
}

.resources .drawer-tab.will-close .drawer-arrow {
  transform: rotate(180deg);
}

.news-log .drawer-arrow {
  transform: rotate(180deg);
}

.news-log .drawer-tab.will-close .drawer-arrow {
  transform: rotate(0deg);
}

.resources-header {
  flex: 0 0 auto;
}

.resources h1,
.actions h2,
.actions h3 {
  margin: 0 0 8px;
  letter-spacing: 0.06em;
}

.resources h1,
.game-title {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  margin-bottom: 8px;
  color: var(--accent);
  text-transform: uppercase;
  font-family: var(--font-title);
  font-size: 1.05rem;
  line-height: 1.45;
  letter-spacing: 0.04em;
  font-weight: 400;
}

.game-title-pickaxe {
  flex: 0 0 auto;
  width: 1.35em;
  height: 1.35em;
  overflow: visible;
  transform: rotate(-38deg);
}

.resources-tools {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 8px;
}

.resources-tools .info-button {
  margin-top: 0;
}

.resources.is-closed .resources-tools {
  display: none;
}

.actions h3 {
  margin-top: 28px;
  font-size: 1.05rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.subtitle,
.hint {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.4;
}

.resources .subtitle {
  margin-bottom: 14px;
}

.resources-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.resources-heading .info-button {
  flex: 0 0 auto;
  margin-left: auto;
}

.resource-list {
  list-style: none;
  margin: 0;
  padding: 6px 0 0;
  display: grid;
  gap: 4px;
}

.resource-card {
  padding: 14px 16px;
  background: var(--panel);
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius);
}

.resources .resource-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "icon name amount"
    "icon hint amount";
  align-items: center;
  column-gap: 8px;
  row-gap: 0;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.resources .resource-card > .resource-icon {
  grid-area: icon;
  align-self: center;
}

.shards-view {
  overflow: auto;
}

.shards-sections {
  display: grid;
  gap: 18px;
  margin-top: 8px;
}

.shard-section {
  display: grid;
  gap: 8px;
}

.shard-section-title {
  margin: 0;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--panel-border);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Always six to a row, on every screen width. */
.shards-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.shard-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 10px 10px;
  background: var(--panel);
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius-sm);
  min-width: 0;
  color: inherit;
  font: inherit;
  text-align: center;
  cursor: pointer;
}

.shard-card-alert {
  position: absolute;
  top: -7px;
  right: -4px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: #d45c4c;
  color: #fff8f4;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 0 0 2px var(--bg), 0 1px 4px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.shard-card.is-ready {
  border-color: color-mix(in srgb, #d45c4c 55%, var(--panel-border));
}

.shard-card.is-gilded {
  border-color: #e0b84a;
  box-shadow: 0 0 0 1px #c9a227;
}

.shard-card.is-diamondized {
  border-color: #9fdfff;
  background: linear-gradient(160deg, rgba(180, 230, 255, 0.14), rgba(42, 33, 24, 0.92) 55%);
  box-shadow:
    0 0 0 1px rgba(120, 200, 255, 0.55),
    inset 0 1px 0 rgba(230, 248, 255, 0.28);
}

.shard-card .resource-icon--card {
  width: 28px;
  height: 28px;
}

.shard-card .shard-bar {
  width: 100%;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.shard-card .shard-bar span {
  display: block;
  height: 100%;
  background: #e0b84a;
}

.shard-card .shard-bar.is-diamond span {
  background: linear-gradient(90deg, #7ec8ef, #dff4ff);
}

.shard-gild-button {
  align-self: stretch;
  margin: 0;
  padding: 5px 6px;
  border: 1px solid #c9a227;
  border-radius: var(--radius-sm);
  background: rgba(224, 184, 74, 0.16);
  color: #f0d24a;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.shard-gild-button:hover {
  background: rgba(224, 184, 74, 0.28);
}

.shard-gild-button.is-diamond {
  border-color: #9fdcff;
  background: rgba(159, 220, 255, 0.16);
  color: #dff4ff;
  text-shadow: 0 0 6px rgba(159, 220, 255, 0.6);
}

.shard-gild-button.is-diamond:hover {
  background: rgba(159, 220, 255, 0.28);
}

@media (max-width: 480px) {
  .shards-grid {
    gap: 6px;
  }

  .shard-card {
    gap: 6px;
    padding: 8px 4px 6px;
  }

  .shard-card .resource-icon--card {
    width: 24px;
    height: 24px;
  }
}

.resource-card .label {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.95rem;
}

.resources .resource-card .label {
  display: contents;
}

.resources .resource-card .label span:first-child {
  grid-area: name;
  color: var(--muted);
  font-size: 0.72rem;
}

.resources .resource-card .label span:last-child {
  grid-area: hint;
  color: var(--muted);
  font-size: 0.62rem;
  line-height: 1.15;
}

.resource-card .amount {
  margin-top: 6px;
  font-size: 1.8rem;
}

.resources .resource-card .amount {
  grid-area: amount;
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.resource-card.rock .amount {
  color: var(--rock);
}

.resource-card.clay .amount {
  color: var(--clay);
}

.resource-card.flint .amount {
  color: var(--flint);
}

.resource-card.gravel .amount {
  color: var(--gravel);
}

.resource-card.limestone .amount {
  color: var(--limestone);
}

.resource-card.slate .amount {
  color: var(--slate);
}

.resource-card.sandstone .amount {
  color: var(--sandstone);
}

.resource-card.siltstone .amount {
  color: var(--siltstone);
}

.resource-card.chert .amount {
  color: var(--chert);
}

.resource-card.granite .amount {
  color: var(--granite);
}

.resource-card.marble .amount {
  color: var(--marble);
}

.resource-card.quartz .amount {
  color: var(--quartz);
}

.resource-card.bedrock .amount {
  color: var(--bedrock);
}

.resource-card.basalt .amount {
  color: var(--basalt);
}

.resource-card.obsidian .amount {
  color: var(--obsidian);
}

.resource-card.sulfur .amount {
  color: var(--sulfur);
}

.resource-card.olivine .amount {
  color: var(--olivine);
}

.resource-card.snowbank .amount {
  color: var(--snowbank);
}

.resource-card.icepack .amount {
  color: var(--icepack);
}

.resource-card.blue-ice .amount {
  color: var(--blue-ice);
}

.resource-card.magma-chunk .amount {
  color: var(--magma-chunk);
}

.resource-card.planet-core .amount {
  color: var(--planet-core);
}

.resource-card.tektite .amount {
  color: var(--tektite);
}

.resource-card.stardust .amount {
  color: var(--stardust);
}

.resource-card.iridium .amount {
  color: var(--iridium);
}

.resource-card.manganese .amount {
  color: var(--manganese);
}

.resource-card.cobalt .amount {
  color: var(--cobalt);
}

.resource-card.black-pearl .amount {
  color: var(--black-pearl);
}

.resource-card.gems .amount {
  color: var(--gems);
}

.resource-card.science .amount,
.resource-card.scientists .amount {
  color: var(--science);
}

.hire-button {
  width: 100%;
  padding: 16px 18px;
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--button);
  color: var(--text);
  box-shadow: var(--control-shadow);
  font-size: 1.05rem;
  text-align: left;
}

.hire-button:hover:not(:disabled):not([aria-disabled="true"]) {
  background: var(--button-hover);
}

.hire-button:active:not(:disabled):not([aria-disabled="true"]) {
  transform: translateY(1px);
}

.hire-button:disabled,
.hire-button[aria-disabled="true"] {
  background: var(--disabled);
  color: var(--muted);
  cursor: not-allowed;
}

.hire-button .detail {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.92rem;
}

.assign-control {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.assign-buttons {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.assign-control button {
  width: 48px;
  height: 48px;
  padding: 0;
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--button);
  color: var(--text);
  box-shadow: var(--control-shadow);
  font-size: 1.6rem;
  line-height: 1;
}

.assign-control button:hover:not(:disabled) {
  background: var(--button-hover);
}

.assign-control button:active:not(:disabled) {
  transform: translateY(1px);
}

.assign-control button:disabled {
  background: var(--disabled);
  color: var(--muted);
  cursor: not-allowed;
}

.scientist-pool {
  display: grid;
  gap: 12px;
}

.crew-viewport {
  flex: 1;
  min-width: 0;
  height: 88px;
  overflow: hidden;
  background: transparent;
}

.crew-viewport canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.pour-bit {
  position: fixed;
  z-index: 50;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  pointer-events: none;
  opacity: 1;
  transform: translate(0, 0) scale(1);
  transition: transform 0.48s ease-in, opacity 0.48s ease-in;
}

.pour-bit .resource-icon {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.45));
}

.actions-chrome {
  position: relative;
  grid-row: 1;
  justify-self: stretch;
  width: min(640px, 100%);
  max-width: 100%;
  min-width: 0;
}

.resource-float-stage {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: auto;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  width: min(88px, 28%);
  max-width: 88px;
  pointer-events: none;
}

.resource-float-stage:empty {
  display: none;
}

html[data-resource-float-place="top"] .resource-float-stage {
  top: calc(var(--drawer-resources-height, 56px) + 4px);
  left: 50%;
  right: auto;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  /* max-content: left:50% would otherwise squeeze the row to half the screen and stack it. */
  width: max-content;
  max-width: calc(100% - 20px);
  transform: translateX(-50%);
}

html[data-resource-float-style="expanded"] .resource-float-stage {
  width: min(152px, 42%);
  max-width: 152px;
}

html[data-resource-float-place="top"][data-resource-float-style="expanded"] .resource-float-stage {
  width: max-content;
  max-width: calc(100% - 20px);
}

.resource-float-card {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  width: 100%;
  padding: 3px 6px;
  background: var(--panel);
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--control-shadow);
  opacity: 0;
  transform: translateX(-24px);
  transition:
    transform 0.34s ease,
    opacity 0.34s ease;
}

html[data-resource-float-place="top"] .resource-float-card {
  width: auto;
  min-width: 72px;
  transform: translateY(-24px);
}

.resource-float-card.is-in {
  opacity: 1;
  transform: translateX(0);
}

/* Long-press to pin (drawer) — pinned floating cards get a thin accent edge. */
.resource-float-card.is-pinned {
  border-color: var(--accent);
}

.resources .resource-card {
  position: relative;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.resources .resource-card.is-pressing {
  transform: scale(0.98);
  transition: transform 0.5s ease-out;
}

.resources .resource-card.is-pinned {
  border-color: var(--accent);
}

.resources .resource-card.is-pinned::after {
  content: "PINNED";
  position: absolute;
  top: 3px;
  right: 6px;
  color: var(--accent);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.resources .resource-card.pin-flash {
  animation: pin-flash 0.45s ease-out;
}

@keyframes pin-flash {
  0% { box-shadow: 0 0 0 0 var(--accent); }
  100% { box-shadow: 0 0 0 8px transparent; }
}

html[data-resource-float-place="top"] .resource-float-card.is-in {
  transform: translateY(0);
}

.resource-float-card.is-out {
  opacity: 0;
  transform: translateX(-28px);
}

html[data-resource-float-place="top"] .resource-float-card.is-out {
  transform: translateY(-32px);
}

.resource-float-card > .resource-icon {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
}

.resource-float-card .amount {
  flex: 1 1 auto;
  margin: 0;
  min-width: 0;
  font-size: 0.78rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

html[data-resource-float-style="expanded"] .resource-float-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "icon name amount"
    "icon hint amount";
  align-items: center;
  column-gap: 8px;
  row-gap: 0;
  padding: 4px 8px;
  min-width: 140px;
}

html[data-resource-float-style="expanded"] .resource-float-card > .resource-icon {
  grid-area: icon;
  width: auto;
  height: auto;
}

html[data-resource-float-style="expanded"] .resource-float-card .label {
  display: contents;
}

html[data-resource-float-style="expanded"] .resource-float-card .label span:first-child {
  grid-area: name;
  color: var(--muted);
  font-size: 0.72rem;
}

html[data-resource-float-style="expanded"] .resource-float-card .label span:last-child {
  grid-area: hint;
  color: var(--muted);
  font-size: 0.62rem;
  line-height: 1.15;
}

html[data-resource-float-style="expanded"] .resource-float-card .amount {
  grid-area: amount;
  font-size: 0.98rem;
  line-height: 1.15;
  text-align: left;
}

.haul-bit {
  position: fixed;
  z-index: 40;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  pointer-events: none;
  opacity: 1;
  transform: translate(0, 0) scale(1);
  transition: transform 0.55s ease-in, opacity 0.55s ease-in;
  will-change: transform, opacity;
}

/* No drop-shadow filter here: re-rasterising it every frame on dozens of flying icons lags phones. */
.haul-bit .resource-icon {
  width: 100%;
  height: 100%;
  display: block;
}

.gain-pop {
  position: fixed;
  z-index: 41;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin: 0;
  padding: 0;
  pointer-events: none;
  color: var(--text);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  opacity: 1;
  transform: translate(-50%, -50%);
  transition: transform 0.55s ease-out, opacity 0.55s ease-out;
}

.gain-pop.is-out {
  opacity: 0;
  transform: translate(-50%, calc(-50% - 26px));
}

.assign-income {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

#crew-income {
  display: grid;
  gap: 2px;
}

.site-lab-controls {
  display: grid;
  gap: 16px;
}

.actions {
  display: grid;
  /* One column no wider than the screen: a scrolling tab bar must not stretch it. */
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
  justify-items: center;
  gap: 28px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: calc(var(--drawer-resources-min, 56px) + 12px) 24px calc(var(--drawer-news-min, 72px) + 12px);
  position: relative;
}

.view-tabs {
  display: flex;
  width: 100%;
  gap: 4px;
  border-bottom: 1px solid var(--panel-border);
}

.view-tab {
  flex: 1;
  width: auto;
  padding: 12px 10px 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  text-align: center;
  text-transform: uppercase;
  cursor: pointer;
}

.view-tab.pin-end {
  flex: 0 1 auto;
  min-width: 5.5rem;
}

.view-tab.pin-end.icon-tab {
  min-width: 2.8rem;
}

.view-tab[data-view="achievements"] {
  min-width: 8.4rem;
  letter-spacing: 0.06em;
}

.view-tab[data-view="achievements"].icon-tab {
  min-width: 2.8rem;
}

.view-tab[data-view="descension"] {
  min-width: 8.2rem;
  letter-spacing: 0.04em;
  overflow: visible;
}

.view-tab .funnel-icon {
  overflow: visible;
}

.view-tab.pin-first {
  margin-left: auto;
}

.view-tab.icon-tab {
  min-width: 2.8rem;
  padding-left: 8px;
  padding-right: 8px;
  letter-spacing: 0;
}

.view-tab .view-tab-icon,
.view-tab .gear-icon {
  display: block;
  width: 1.2rem;
  height: 1.2rem;
  margin: 0 auto;
}

.view-tab .flask-icon {
  color: #3d8fd4;
}

.view-tab .trophy-icon {
  color: #d4a017;
}

.view-tab:hover:not([aria-selected="true"]) {
  background: transparent;
  color: var(--text);
}

html[data-tab-layout="scroll"] .view-tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
  max-width: 100%;
}

html[data-tab-layout="scroll"] .view-tab {
  flex: 0 0 auto;
}

html[data-layout="narrow"][data-tab-layout="scroll"] .view-tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
}

/* Wrapped tab rows keep the top row's tab size and sit centered (GameUi.syncViewTabRows). */
.view-tabs:has(.is-extra-row) {
  justify-content: center;
}

.view-tabs .view-tab.is-extra-row {
  flex: 0 0 var(--view-tab-row-w);
  min-width: 0;
  margin-left: 0;
}

.view-tab[aria-selected="true"] {
  background: transparent;
  color: var(--chrome-accent, var(--accent));
  box-shadow: inset 0 -3px 0 var(--chrome-accent, var(--accent));
}

.view {
  display: grid;
  grid-row: 2;
  align-content: start;
  align-self: stretch;
  justify-items: center;
  gap: 28px;
  width: min(560px, 100%);
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.view[hidden],
.view.mine-view[hidden] {
  display: none;
}

.view.mine-view {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) var(--deposit-viewport-h, 148px);
  width: 100%;
  min-height: 0;
  align-content: stretch;
  justify-items: stretch;
  gap: 10px;
  overflow: hidden;
  /* Let the deposit canvas run to the screen edges (DepositViewport.resize widens it). */
  overflow-x: visible;
  overflow-y: clip;
  margin-bottom: -40px;
}

.view.vault-view {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  width: 100%;
  min-height: 0;
  align-content: stretch;
  justify-items: stretch;
  gap: 10px;
  overflow: hidden;
  margin-bottom: -40px;
}

.view.vault-view[hidden] {
  display: none;
}

.vault-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  width: min(560px, 100%);
  justify-self: center;
}

.vault-header h2 {
  margin: 0;
}

/* Sits on the wall: VaultViewport says how high its top row reaches. */
.vault-keys {
  position: absolute;
  right: 0;
  bottom: calc(var(--vault-wall-top, 100%) + 8px);
  left: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  pointer-events: none;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.vault-key-icon {
  width: 1.05em;
  height: 1.05em;
  flex: 0 0 auto;
  color: var(--accent);
}

.vault-view .hint {
  width: min(560px, 100%);
  justify-self: center;
  margin: 0;
}

.vault-actions {
  position: relative;
  z-index: 5;
  width: min(560px, 100%);
  justify-self: center;
}

.vault-renew-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 10px 14px;
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--button);
  color: var(--text);
  font-size: 1rem;
}

.vault-renew-button:hover:not(:disabled) {
  background: var(--button-hover);
}

.vault-renew-button:disabled {
  background: var(--disabled);
  color: var(--muted);
  cursor: not-allowed;
}

.vault-renew-cost {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.vault-renew-button:disabled .vault-renew-cost {
  color: var(--muted);
}

.vault-viewport {
  position: relative;
  width: 100%;
  height: 320px;
  justify-self: stretch;
  align-self: end;
  overflow: visible;
  background: transparent;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  z-index: 4;
}

.vault-viewport canvas {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  touch-action: none;
}

.descension-points {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  margin: 0 0 8px;
  color: var(--perk-points);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

.descension-points .resource-icon {
  color: var(--perk-points);
}

.descension-store-link {
  display: inline-flex;
  align-items: center;
  gap: 0.28em;
  margin: 0;
  margin-left: 0.35em;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 0.9em;
  letter-spacing: 0.04em;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
}

.descension-store-link .view-tab-icon {
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
}

.descension-store-link:hover,
.descension-store-link:focus-visible {
  color: var(--accent, var(--text));
  filter: brightness(1.08);
}

.store-card-title-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
}

.store-card-title-with-icon .resource-icon,
.store-starter-loot .resource-icon[data-resource="perk-points"],
.store-card .hint .resource-icon[data-resource="perk-points"],
.gift-reward .resource-icon[data-resource="perk-points"],
.descension-cost .resource-icon[data-resource="perk-points"] {
  color: var(--perk-points);
}

.store-starter-loot .resource-icon[data-resource="gems"],
.store-card .hint .resource-icon[data-resource="gems"] {
  color: var(--gems);
}

.store-starter-loot {
  display: inline-flex;
  align-items: center;
  gap: 0.28em;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.store-starter-sep {
  opacity: 0.55;
}

.gift-reward {
  display: flex;
  align-items: center;
  gap: 0.4em;
}

.view.descension-view {
  grid-template-rows: auto auto minmax(0, 1fr);
  align-content: stretch;
  gap: 0.5rem;
  overflow: hidden;
}

.descension-pane {
  min-height: 0;
  width: 100%;
  display: grid;
  gap: 0.65rem;
  align-content: start;
  justify-items: stretch;
}

.descension-pane[hidden] {
  display: none;
}

#descension-digging {
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

#descension-reset {
  overflow-x: hidden;
  overflow-y: auto;
}

.descension-reset-reward {
  margin: 0;
  font-weight: 600;
}

.descension-reset-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.descension-reset-columns h4 {
  margin: 0 0 0.35rem;
}

.descension-reset-list {
  margin: 0;
  padding-left: 0;
  display: grid;
  gap: 0.4rem;
  list-style: none;
}

.descension-reset-part {
  display: inline;
}

.descension-reset-part svg {
  display: inline-block;
  width: 0.95em;
  height: 0.95em;
  vertical-align: -0.15em;
  margin-right: 0.2em;
}

.descension-reset-list .achievement-kind-icon {
  color: var(--muted);
}

#descension-fill-button {
  justify-self: start;
}

.mine-locations {
  display: grid;
  gap: 4px;
  justify-self: center;
  width: min(560px, 100%);
}

.mine-heading {
  margin: 0;
}

.mine-body {
  display: grid;
  width: min(560px, 100%);
  min-height: 0;
  justify-self: center;
  align-content: start;
  justify-items: center;
  gap: 28px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  /* Clear the mine fade overhang so the last controls stay readable. */
  padding-bottom: 128px;
  scroll-padding-bottom: 128px;
}

.lab-view {
  grid-template-rows: auto auto minmax(0, 1fr);
  align-content: stretch;
}

.lab-heading {
  margin: 0 0 4px;
}

.lab-view > .view-title {
  justify-self: stretch;
  width: 100%;
}

.lab-view > .zone-tabs {
  justify-self: center;
}

.lab-pane {
  display: grid;
  align-content: start;
  gap: 28px;
  width: 100%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  justify-items: stretch;
}

.lab-pane[hidden] {
  display: none;
}

.overseer-view {
  gap: 12px;
}

.overseer-view > .workshop-heading {
  margin: 0;
}

.overseer-view > .view-title {
  justify-self: stretch;
  width: 100%;
}

.overseer-view > .zone-tabs {
  justify-self: stretch;
  width: 100%;
  max-width: none;
}

#workshop-permits.lab-pane {
  gap: 12px;
}

#workshop-permits .research-header {
  margin: 0;
}

#workshop-permits .research-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

#workshop-permits .permit-block {
  display: grid;
  gap: 6px;
}

#workshop-permits .permit-block[hidden] {
  display: none;
}

#workshop-permits h3 {
  margin: 0;
}

#workshop-permits .button-grid {
  gap: 8px;
}

#workshop-permits .button-grid button {
  padding: 12px 14px;
}

#lab-research-slot > .research-view {
  display: grid;
  grid-row: auto;
  width: 100%;
  overflow: visible;
  gap: 16px;
}

.monument-list {
  display: grid;
  gap: 12px;
  width: 100%;
}

.monument-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px 14px;
  align-items: center;
  padding: 14px;
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

.monument-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.monument-card.is-locked {
  opacity: 0.55;
}

.monument-card h3 {
  margin: 0;
  font-size: 0.95rem;
}

.monument-need {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.monument-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: color-mix(in srgb, var(--panel-border) 70%, transparent);
}

.monument-bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.monument-card button {
  min-width: 7.5rem;
}

.monument-card button[data-monument-build] {
  touch-action: none;
}

.monument-figure {
  --monument: var(--accent);
  display: grid;
  justify-items: center;
  align-content: end;
  gap: 2px;
  width: 56px;
  height: 60px;
}

.monument-block {
  display: block;
  background: color-mix(in srgb, var(--monument) 78%, #1a1410);
  box-shadow:
    inset 2px 2px 0 color-mix(in srgb, var(--monument) 55%, #fff),
    inset -2px -2px 0 rgba(0, 0, 0, 0.28);
  opacity: 0.18;
}

.monument-figure.is-stage-1 .base,
.monument-figure.is-stage-2 .base,
.monument-figure.is-stage-2 .shaft,
.monument-figure.is-stage-3 .base,
.monument-figure.is-stage-3 .shaft,
.monument-figure.is-stage-3 .cap {
  opacity: 1;
}

.monument-block.base {
  width: 36px;
  height: 10px;
}

.monument-block.shaft {
  width: 16px;
  height: 28px;
}

.monument-block.cap {
  width: 24px;
  height: 10px;
}

/* Unique silhouettes — still three blocks: cap / shaft / base */
/* Rock: stepped podium with a round summit stone — not a tapering obelisk. */
.monument-figure.is-pinnacle-of-advancement {
  gap: 1px;
}
.monument-figure.is-pinnacle-of-advancement .base {
  width: 46px;
  height: 12px;
  border-radius: 1px;
}
.monument-figure.is-pinnacle-of-advancement .shaft {
  width: 28px;
  height: 16px;
  border-radius: 1px;
}
.monument-figure.is-pinnacle-of-advancement .cap {
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

.monument-figure.is-hall-of-clay .base {
  width: 44px;
  height: 8px;
  border-radius: 1px;
}
.monument-figure.is-hall-of-clay .shaft {
  width: 34px;
  height: 22px;
  border-radius: 1px 1px 0 0;
}
.monument-figure.is-hall-of-clay .cap {
  width: 42px;
  height: 10px;
  clip-path: polygon(0 100%, 100% 100%, 92% 0, 8% 0);
}

/* Flint: knapped blade on a short haft — wide flake, not a thin needle. */
.monument-figure.is-flint-spire .base {
  width: 14px;
  height: 8px;
  border-radius: 1px;
}
.monument-figure.is-flint-spire .shaft {
  width: 7px;
  height: 18px;
  border-radius: 1px;
}
.monument-figure.is-flint-spire .cap {
  width: 34px;
  height: 22px;
  clip-path: polygon(8% 70%, 0 40%, 28% 0, 72% 8%, 100% 48%, 78% 100%, 42% 92%, 22% 100%);
}

.monument-figure.is-gravel-cairn {
  gap: 1px;
}
.monument-figure.is-gravel-cairn .base {
  width: 40px;
  height: 12px;
  border-radius: 40% 40% 20% 20% / 50% 50% 30% 30%;
}
.monument-figure.is-gravel-cairn .shaft {
  width: 28px;
  height: 16px;
  border-radius: 45% 40% 35% 40%;
}
.monument-figure.is-gravel-cairn .cap {
  width: 16px;
  height: 12px;
  border-radius: 50% 45% 40% 50%;
}

.monument-figure.is-limestone-keep .base {
  width: 42px;
  height: 10px;
}
.monument-figure.is-limestone-keep .shaft {
  width: 28px;
  height: 24px;
}
.monument-figure.is-limestone-keep .cap {
  width: 34px;
  height: 10px;
  clip-path: polygon(0 100%, 100% 100%, 100% 35%, 88% 35%, 88% 0, 72% 0, 72% 35%, 58% 35%, 58% 0, 42% 0, 42% 35%, 28% 35%, 28% 0, 12% 0, 12% 35%, 0 35%);
}

.monument-figure.is-slate-obelisk .base {
  width: 24px;
  height: 6px;
  clip-path: polygon(10% 100%, 90% 100%, 100% 0, 0 0);
}
.monument-figure.is-slate-obelisk .shaft {
  width: 12px;
  height: 34px;
  clip-path: polygon(20% 100%, 80% 100%, 70% 0, 30% 0);
}
.monument-figure.is-slate-obelisk .cap {
  width: 10px;
  height: 12px;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.monument-figure.is-sandstone-terrace {
  gap: 1px;
}
.monument-figure.is-sandstone-terrace .base {
  width: 44px;
  height: 10px;
}
.monument-figure.is-sandstone-terrace .shaft {
  width: 32px;
  height: 14px;
}
.monument-figure.is-sandstone-terrace .cap {
  width: 20px;
  height: 14px;
}

.monument-figure.is-siltstone-gallery .base {
  width: 46px;
  height: 8px;
}
.monument-figure.is-siltstone-gallery .shaft {
  width: 40px;
  height: 18px;
  clip-path: polygon(0 100%, 100% 100%, 100% 0, 88% 0, 88% 55%, 72% 55%, 72% 0, 28% 0, 28% 55%, 12% 55%, 12% 0, 0 0);
}
.monument-figure.is-siltstone-gallery .cap {
  width: 46px;
  height: 8px;
}

.monument-figure.is-chert-pinnacle .base {
  width: 38px;
  height: 8px;
  clip-path: polygon(0 100%, 100% 100%, 80% 0, 20% 0);
}
.monument-figure.is-chert-pinnacle .shaft {
  width: 20px;
  height: 24px;
  clip-path: polygon(15% 100%, 85% 100%, 60% 0, 40% 0);
}
.monument-figure.is-chert-pinnacle .cap {
  width: 12px;
  height: 14px;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.monument-figure.is-granite-colossus .base {
  width: 46px;
  height: 12px;
}
.monument-figure.is-granite-colossus .shaft {
  width: 30px;
  height: 28px;
  border-radius: 2px 2px 0 0;
}
.monument-figure.is-granite-colossus .cap {
  width: 22px;
  height: 10px;
  border-radius: 2px 2px 0 0;
}

.monument-figure.is-marble-rotunda .base {
  width: 40px;
  height: 8px;
  border-radius: 2px;
}
.monument-figure.is-marble-rotunda .shaft {
  width: 22px;
  height: 22px;
  border-radius: 2px 2px 0 0;
  clip-path: polygon(0 100%, 22% 100%, 22% 0, 78% 0, 78% 100%, 100% 100%, 100% 0, 0 0);
}
.monument-figure.is-marble-rotunda .cap {
  width: 28px;
  height: 16px;
  border-radius: 50% 50% 8% 8% / 80% 80% 20% 20%;
}

.monument-figure.is-quartz-beacon .base {
  width: 26px;
  height: 8px;
}
.monument-figure.is-quartz-beacon .shaft {
  width: 10px;
  height: 30px;
}
.monument-figure.is-quartz-beacon .cap {
  width: 18px;
  height: 14px;
  border-radius: 50%;
  box-shadow:
    inset 2px 2px 0 color-mix(in srgb, var(--monument) 55%, #fff),
    inset -2px -2px 0 rgba(0, 0, 0, 0.28),
    0 0 8px color-mix(in srgb, var(--monument) 55%, transparent);
}

.monument-figure.is-snowbank-shelf .base {
  width: 44px;
  height: 10px;
  border-radius: 0 0 40% 40% / 0 0 60% 60%;
}
.monument-figure.is-snowbank-shelf .shaft {
  width: 36px;
  height: 12px;
  border-radius: 2px;
}
.monument-figure.is-snowbank-shelf .cap {
  width: 28px;
  height: 16px;
  border-radius: 60% 40% 20% 30% / 70% 50% 30% 40%;
}

.monument-figure.is-icepack-arcade .base {
  width: 42px;
  height: 8px;
}
.monument-figure.is-icepack-arcade .shaft {
  width: 36px;
  height: 24px;
  clip-path: polygon(0 100%, 18% 100%, 18% 45%, 50% 10%, 82% 45%, 82% 100%, 100% 100%, 100% 0, 0 0);
}
.monument-figure.is-icepack-arcade .cap {
  width: 42px;
  height: 8px;
  border-radius: 40% 40% 0 0 / 100% 100% 0 0;
}

.monument-figure.is-blue-ice-lantern .base {
  width: 18px;
  height: 6px;
}
.monument-figure.is-blue-ice-lantern .shaft {
  width: 6px;
  height: 22px;
}
.monument-figure.is-blue-ice-lantern .cap {
  width: 22px;
  height: 22px;
  border-radius: 40% 40% 35% 35% / 45% 45% 55% 55%;
  box-shadow:
    inset 2px 2px 0 color-mix(in srgb, var(--monument) 55%, #fff),
    inset -2px -2px 0 rgba(0, 0, 0, 0.28),
    0 0 10px color-mix(in srgb, var(--monument) 45%, transparent);
}

.monument-figure.is-bedrock-bastion .base {
  width: 46px;
  height: 12px;
}
.monument-figure.is-bedrock-bastion .shaft {
  width: 36px;
  height: 26px;
  clip-path: polygon(0 100%, 100% 100%, 100% 0, 78% 0, 78% 40%, 22% 40%, 22% 0, 0 0);
}
.monument-figure.is-bedrock-bastion .cap {
  width: 40px;
  height: 10px;
  clip-path: polygon(0 100%, 100% 100%, 100% 40%, 85% 40%, 85% 0, 70% 0, 70% 40%, 55% 40%, 55% 0, 45% 0, 45% 40%, 30% 40%, 30% 0, 15% 0, 15% 40%, 0 40%);
}

.monument-figure.is-basalt-ziggurat {
  gap: 1px;
}
.monument-figure.is-basalt-ziggurat .base {
  width: 44px;
  height: 12px;
}
.monument-figure.is-basalt-ziggurat .shaft {
  width: 30px;
  height: 14px;
}
.monument-figure.is-basalt-ziggurat .cap {
  width: 16px;
  height: 14px;
}

.monument-figure.is-obsidian-needle .base {
  width: 16px;
  height: 5px;
}
.monument-figure.is-obsidian-needle .shaft {
  width: 5px;
  height: 38px;
  transform: skewX(-6deg);
}
.monument-figure.is-obsidian-needle .cap {
  width: 10px;
  height: 12px;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  transform: skewX(-6deg);
}

.monument-figure.is-sulfur-crown .base {
  width: 28px;
  height: 8px;
}
.monument-figure.is-sulfur-crown .shaft {
  width: 20px;
  height: 18px;
}
.monument-figure.is-sulfur-crown .cap {
  width: 36px;
  height: 16px;
  clip-path: polygon(0 100%, 100% 100%, 100% 45%, 82% 0, 68% 55%, 50% 0, 32% 55%, 18% 0, 0 45%);
}

.monument-figure.is-olivine-garden .base {
  width: 38px;
  height: 8px;
  border-radius: 40%;
}
.monument-figure.is-olivine-garden .shaft {
  width: 14px;
  height: 24px;
  border-radius: 40% 40% 20% 20%;
}
.monument-figure.is-olivine-garden .cap {
  width: 28px;
  height: 18px;
  border-radius: 50% 45% 40% 50%;
}

/* Tektite: orbital antenna — hex pad, faceted mast, crystal tip. */
.monument-figure.is-tektite-spire .base {
  width: 34px;
  height: 8px;
  clip-path: polygon(12% 100%, 88% 100%, 100% 40%, 75% 0, 25% 0, 0 40%);
}
.monument-figure.is-tektite-spire .shaft {
  width: 12px;
  height: 30px;
  clip-path: polygon(0 100%, 100% 100%, 78% 55%, 100% 0, 0 0, 22% 55%);
}
.monument-figure.is-tektite-spire .cap {
  width: 18px;
  height: 16px;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  box-shadow:
    inset 2px 2px 0 color-mix(in srgb, var(--monument) 55%, #fff),
    inset -2px -2px 0 rgba(0, 0, 0, 0.28),
    0 0 10px color-mix(in srgb, var(--monument) 50%, transparent);
}

.monument-figure.is-stardust-vault .base {
  width: 42px;
  height: 8px;
}
.monument-figure.is-stardust-vault .shaft {
  width: 34px;
  height: 18px;
  clip-path: polygon(0 100%, 100% 100%, 100% 30%, 50% 0, 0 30%);
}
.monument-figure.is-stardust-vault .cap {
  width: 20px;
  height: 14px;
  clip-path: polygon(50% 0, 100% 55%, 70% 100%, 30% 100%, 0 55%);
  box-shadow:
    inset 2px 2px 0 color-mix(in srgb, var(--monument) 55%, #fff),
    inset -2px -2px 0 rgba(0, 0, 0, 0.28),
    0 0 8px color-mix(in srgb, var(--monument) 40%, transparent);
}

.monument-figure.is-iridium-monolith .base {
  width: 30px;
  height: 6px;
}
.monument-figure.is-iridium-monolith .shaft {
  width: 24px;
  height: 36px;
  border-radius: 1px;
}
.monument-figure.is-iridium-monolith .cap {
  width: 24px;
  height: 6px;
}

/* Manganese Reef: lumpy mound of nodules. */
.monument-figure.is-manganese-reef .base {
  width: 42px;
  height: 8px;
  border-radius: 40%;
}
.monument-figure.is-manganese-reef .shaft {
  width: 32px;
  height: 16px;
  border-radius: 50% 50% 20% 20%;
}
.monument-figure.is-manganese-reef .cap {
  width: 18px;
  height: 14px;
  border-radius: 50%;
}

/* Cobalt Lighthouse: tall tapered tower with a lamp room. */
.monument-figure.is-cobalt-lighthouse .base {
  width: 30px;
  height: 6px;
}
.monument-figure.is-cobalt-lighthouse .shaft {
  width: 20px;
  height: 34px;
  clip-path: polygon(15% 0, 85% 0, 100% 100%, 0 100%);
}
.monument-figure.is-cobalt-lighthouse .cap {
  width: 16px;
  height: 12px;
  clip-path: polygon(50% 0, 100% 40%, 100% 100%, 0 100%, 0 40%);
  box-shadow:
    inset 2px 2px 0 color-mix(in srgb, var(--monument) 55%, #fff),
    0 0 10px color-mix(in srgb, var(--monument) 50%, transparent);
}

/* Pearl Grotto: arched shell with a pearl on top. */
.monument-figure.is-pearl-grotto .base {
  width: 40px;
  height: 7px;
}
.monument-figure.is-pearl-grotto .shaft {
  width: 32px;
  height: 20px;
  border-radius: 50% 50% 4px 4px;
}
.monument-figure.is-pearl-grotto .cap {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow:
    inset 2px 2px 0 color-mix(in srgb, var(--monument) 45%, #fff),
    0 0 8px color-mix(in srgb, var(--monument) 45%, transparent);
}

.monument-figure.is-vault-of-stars .base {
  width: 36px;
  height: 8px;
  clip-path: polygon(8% 100%, 92% 100%, 100% 0, 0 0);
}
.monument-figure.is-vault-of-stars .shaft {
  width: 20px;
  height: 22px;
  clip-path: polygon(15% 100%, 85% 100%, 100% 0, 0 0);
}
.monument-figure.is-vault-of-stars .cap {
  width: 26px;
  height: 16px;
  clip-path: polygon(50% 0, 62% 35%, 100% 38%, 70% 62%, 80% 100%, 50% 78%, 20% 100%, 30% 62%, 0 38%, 38% 35%);
  box-shadow:
    inset 2px 2px 0 color-mix(in srgb, var(--monument) 55%, #fff),
    inset -2px -2px 0 rgba(0, 0, 0, 0.28),
    0 0 10px color-mix(in srgb, var(--monument) 50%, transparent);
}

.reliquary-card {
  grid-template-columns: minmax(0, 1fr) auto;
}

.time-view {
  height: 100%;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  align-content: stretch;
  gap: 16px;
  padding-bottom: 72px;
  overflow: hidden;
}

.time-stage {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 4px;
  min-height: 0;
  width: 100%;
  overflow: hidden;
}

.time-stage .view-title {
  position: relative;
  z-index: 1;
  justify-self: start;
  align-items: center;
}

.time-stage .view-title .info-button {
  margin-top: 0;
}

.time-viewport {
  width: 100%;
  height: 100%;
  min-height: 0;
  margin-bottom: 4px;
  overflow: hidden;
}

.time-viewport canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.gravity-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 12px;
  align-items: stretch;
  min-height: 280px;
}

.gravity-viewport {
  min-height: 260px;
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--bg) 82%, black);
  overflow: hidden;
}

/* Launch Pad: the rocket as built so far (drawn by js/ui/launchFx.js, like the launch itself). */
.rocket-art {
  height: 240px;
  margin: 0 0 12px;
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #0e142c;
}

.rocket-art canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.gravity-viewport canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.gravity-panel {
  min-width: 0;
}

.gravity-panel .monument-card {
  height: 100%;
}

@media (max-width: 720px) {
  .gravity-layout {
    grid-template-columns: 1fr;
  }

  .gravity-viewport {
    min-height: 200px;
  }
}

.time-warps {
  display: grid;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  min-height: 0;
}

.time-warps button {
  display: grid;
  align-content: center;
  justify-items: start;
  height: 100%;
  margin: 0;
  padding: 12px 16px;
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--button);
  color: var(--text);
  font: inherit;
  font-size: 1.05rem;
  text-align: left;
}

.time-warps button:hover:not(:disabled) {
  background: var(--button-hover);
}

.time-warps button:disabled {
  background: var(--disabled);
  color: var(--muted);
  cursor: not-allowed;
}

.time-warps button .detail {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.92rem;
}

.store-view {
  gap: 10px;
  padding-bottom: 72px;
}

.store-view .hint {
  margin: 0;
}

.store-offers {
  display: grid;
  gap: 18px;
  align-content: start;
}

.store-section {
  display: grid;
  gap: 10px;
  align-content: start;
}

.store-section-title {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.store-card {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--button);
}

.store-card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 12px;
  align-items: center;
}

.store-card-head strong {
  font-size: 1.05rem;
}

.store-card-title-help {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.store-card-title-help .info-button {
  margin-top: 0;
}

.store-card-head .detail {
  color: var(--muted);
  font-size: 0.92rem;
}

/* Gem packs: a little scene on the left, name / amount / value on the right, Buy below. */
.gem-pack-card {
  position: relative;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "art info"
    "actions actions";
  align-items: center;
  column-gap: 14px;
  overflow: hidden;
}

.gem-pack-card.is-best {
  border-color: var(--gems);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--gems) 35%, transparent), 0 0 18px color-mix(in srgb, var(--gems) 18%, transparent);
}

.gem-pack-art {
  grid-area: art;
  width: 120px;
  height: 80px;
  line-height: 0;
  border-radius: var(--radius-sm);
  background: radial-gradient(ellipse at 50% 70%, color-mix(in srgb, var(--gems) 16%, transparent), transparent 70%);
}

.gem-pack-art svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.gem-pack-info {
  grid-area: info;
  display: grid;
  gap: 2px;
  min-width: 0;
}

.gem-pack-name {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gem-pack-amount {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  color: var(--text);
  font-size: calc(1.1rem + var(--gem-tier, 0) * 0.12rem);
  line-height: 1.15;
}

.gem-pack-amount .resource-icon {
  color: var(--gems);
}

.gem-pack-value {
  justify-self: start;
  margin-top: 2px;
  padding: 1px 7px;
  border: 1px solid color-mix(in srgb, var(--gems) 60%, transparent);
  border-radius: 999px;
  color: var(--gems);
  font-size: 0.75rem;
  font-weight: 700;
}

.gem-pack-card .store-card-actions {
  grid-area: actions;
}

.gem-pack-ribbon {
  position: absolute;
  /* Centred 40px in and 34px down, so both ends of the text clear the card's edges. */
  top: 25px;
  right: -25px;
  width: 130px;
  padding: 3px 0;
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
  transform: rotate(45deg);
  background: var(--gems);
  color: #10302b;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

/* Bundles and gift shelf: the art beside the name and contents, Buy below. */
.store-card-art-left {
  grid-template-columns: auto minmax(0, 1fr);
  align-content: start;
  column-gap: 14px;
}

.store-card-art-left > :not(.bundle-art) {
  grid-column: 2;
}

.store-card-art-left > .store-card-actions {
  grid-column: 1 / -1;
}

.bundle-art {
  grid-area: 1 / 1 / span 3;
  align-self: center;
  width: 96px;
  height: 96px;
}

.bundle-art--shelf {
  grid-row-end: span 2;
  background: none;
}

.bundle-art--starter {
  background: radial-gradient(ellipse at 50% 60%, color-mix(in srgb, #c9a24a 24%, transparent), transparent 70%);
}

.bundle-art--rare {
  background: radial-gradient(ellipse at 50% 60%, color-mix(in srgb, #9a5ad0 32%, transparent), transparent 70%);
}

.gem-pack-art .gem-bob {
  animation: gem-bob 2.4s ease-in-out infinite;
}

.gem-pack-art .gem-twinkle {
  animation: gem-twinkle 2.2s ease-in-out infinite;
}

.gem-pack-art .gem-rays {
  animation: gem-rays 24s linear infinite;
}

@keyframes gem-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1.6px); }
}

@keyframes gem-twinkle {
  0%, 100% { opacity: 0; transform: scale(0.3) rotate(0deg); }
  45%, 55% { opacity: 1; transform: scale(1) rotate(45deg); }
}

@keyframes gem-rays {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .gem-pack-art .gem-bob,
  .gem-pack-art .gem-rays {
    animation: none;
  }

  .gem-pack-art .gem-twinkle {
    animation: none;
    opacity: 0.8;
  }
}

@media (max-width: 360px) {
  .gem-pack-art {
    width: 96px;
    height: 64px;
  }

  .bundle-art {
    width: 80px;
    height: 80px;
  }
}

.store-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.store-card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.store-card-actions button {
  margin: 0;
  min-height: 40px;
  padding: 8px 14px;
}

.store-billing-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.gift-open-screen {
  z-index: 46;
  overflow: hidden;
  isolation: isolate;
}

.gift-open-screen > :not(.gift-open-fx) {
  position: relative;
  z-index: 1;
}

.gift-open-fx {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.gift-open-screen.is-opening {
  animation: gift-open-backdrop 0.55s ease-out both;
}

.gift-open-screen.is-opening > :not(.gift-open-fx) {
  animation: gift-open-rise 0.5s cubic-bezier(0.2, 0.85, 0.25, 1) both;
}

.gift-open-screen.is-opening #gift-open-list {
  animation-delay: 0.08s;
}

.gift-open-screen.is-opening [data-gift-open-confirm] {
  animation-delay: 0.16s;
}

.gift-open-burst,
.gift-open-ring,
.gift-open-flare,
.gift-open-halo,
.gift-open-beam,
.gift-open-orbit,
.gift-open-key-flash {
  position: absolute;
  left: 50%;
  top: 42%;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.2);
  opacity: 0;
}

.gift-open-box {
  position: absolute;
  left: 50%;
  top: 42%;
  z-index: 2;
  width: min(34vw, 7.5rem);
  height: min(34vw, 7.5rem);
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: none;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.45));
}

.gift-open-box-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.gift-open-box-lid {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  transform: translate(1.5px, -7px) rotate(-22deg);
}

.gift-open-screen.is-opening .gift-open-box {
  animation: gift-open-box 0.75s cubic-bezier(0.2, 0.85, 0.25, 1) both;
}

.gift-open-screen.is-opening .gift-open-box-lid {
  animation: gift-open-lid 0.7s cubic-bezier(0.15, 0.9, 0.25, 1) 0.08s both;
}

.gift-open-burst {
  width: min(42vw, 16rem);
  height: min(42vw, 16rem);
  background: radial-gradient(circle, var(--gift-burst-core) 0%, transparent 70%);
}

.gift-open-ring {
  width: min(28vw, 11rem);
  height: min(28vw, 11rem);
  border: 2px solid var(--gift-burst-ring);
  box-shadow: 0 0 18px var(--gift-burst-glow);
}

.gift-open-flare {
  width: min(70vw, 26rem);
  height: min(70vw, 26rem);
  background: conic-gradient(
    from 20deg,
    transparent 0 12%,
    var(--gift-flare) 13% 15%,
    transparent 16% 37%,
    var(--gift-flare) 38% 40%,
    transparent 41% 62%,
    var(--gift-flare) 63% 65%,
    transparent 66% 87%,
    var(--gift-flare) 88% 90%,
    transparent 91% 100%
  );
  filter: blur(1px);
  mix-blend-mode: screen;
}

.gift-open-halo {
  width: min(54vw, 20rem);
  height: min(54vw, 20rem);
  border: 1px solid rgba(220, 250, 255, 0.55);
  box-shadow:
    0 0 24px rgba(140, 220, 255, 0.45),
    inset 0 0 30px rgba(180, 240, 255, 0.2);
}

.gift-open-beam {
  width: min(12vw, 4rem);
  height: min(90vw, 34rem);
  border-radius: 40%;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(200, 245, 255, 0.55) 42%,
    transparent 100%
  );
  filter: blur(1.5px);
  mix-blend-mode: screen;
}

.gift-open-beam.is-alt {
  width: min(10vw, 3.2rem);
  transform: translate(-50%, -50%) scale(0.2) rotate(28deg);
}

.gift-open-orbit {
  width: min(48vw, 18rem);
  height: min(48vw, 18rem);
  border: 1px dashed rgba(210, 245, 255, 0.55);
  box-shadow: 0 0 20px rgba(140, 220, 255, 0.35);
}

.gift-open-key-flash {
  width: min(28vw, 10rem);
  height: min(28vw, 10rem);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.85) 0%, transparent 68%);
  mix-blend-mode: screen;
}

.gift-open-spark {
  position: absolute;
  left: 50%;
  top: 42%;
  width: var(--s, 6px);
  height: var(--s, 6px);
  margin: calc(var(--s, 6px) / -2) 0 0 calc(var(--s, 6px) / -2);
  border-radius: 50%;
  background: var(--gift-spark);
  box-shadow: 0 0 8px var(--gift-spark-glow);
  opacity: 0;
  transform: rotate(var(--a, 0deg)) translateY(0) scale(0.4);
}

.gift-open-screen.is-opening .gift-open-burst {
  animation: gift-open-burst 0.7s ease-out both;
}

.gift-open-screen.is-opening .gift-open-ring {
  animation: gift-open-ring 0.75s ease-out both;
}

.gift-open-screen.is-opening .gift-open-flare {
  animation: gift-open-flare 0.85s ease-out both;
}

.gift-open-screen.is-opening .gift-open-halo {
  animation: gift-open-halo 0.95s ease-out both;
}

.gift-open-screen.is-opening .gift-open-beam {
  animation: gift-open-beam 1.15s ease-out both;
}

.gift-open-screen.is-opening .gift-open-beam.is-alt {
  animation-name: gift-open-beam-alt;
  animation-delay: 0.06s;
}

.gift-open-screen.is-opening .gift-open-orbit {
  animation: gift-open-orbit 1.25s cubic-bezier(0.15, 0.85, 0.25, 1) both;
}

.gift-open-screen.is-opening .gift-open-key-flash {
  animation: gift-open-key-flash 0.7s ease-out both;
}

.gift-open-screen.is-opening .gift-open-spark {
  animation: gift-open-spark 0.7s ease-out both;
  animation-delay: var(--delay, 0s);
}

.gift-open-screen.gift-rarity-common {
  --gift-burst-core: rgba(210, 180, 140, 0.28);
  --gift-burst-ring: rgba(200, 170, 130, 0.35);
  --gift-burst-glow: rgba(180, 150, 110, 0.2);
  --gift-spark: #e2c9a4;
  --gift-spark-glow: rgba(210, 180, 140, 0.55);
  --gift-flare: rgba(210, 180, 140, 0.2);
}

.gift-open-screen.gift-rarity-uncommon {
  --gift-burst-core: rgba(180, 210, 90, 0.32);
  --gift-burst-ring: rgba(190, 220, 100, 0.45);
  --gift-burst-glow: rgba(170, 210, 80, 0.28);
  --gift-spark: #d8f08a;
  --gift-spark-glow: rgba(200, 230, 100, 0.6);
  --gift-flare: rgba(180, 220, 90, 0.28);
}

.gift-open-screen.gift-rarity-rare {
  --gift-burst-core: rgba(110, 170, 255, 0.36);
  --gift-burst-ring: rgba(130, 190, 255, 0.55);
  --gift-burst-glow: rgba(100, 170, 255, 0.35);
  --gift-spark: #b6d8ff;
  --gift-spark-glow: rgba(120, 180, 255, 0.7);
  --gift-flare: rgba(120, 180, 255, 0.32);
}

.gift-open-screen.gift-rarity-epic {
  --gift-burst-core: rgba(200, 120, 255, 0.4);
  --gift-burst-ring: rgba(220, 150, 255, 0.6);
  --gift-burst-glow: rgba(180, 100, 240, 0.4);
  --gift-spark: #efc2ff;
  --gift-spark-glow: rgba(220, 150, 255, 0.75);
  --gift-flare: rgba(210, 130, 255, 0.38);
}

.gift-open-screen.gift-rarity-legendary {
  --gift-burst-core: rgba(160, 230, 255, 0.48);
  --gift-burst-ring: rgba(200, 245, 255, 0.75);
  --gift-burst-glow: rgba(140, 220, 255, 0.55);
  --gift-spark: #eaf9ff;
  --gift-spark-glow: rgba(180, 240, 255, 0.9);
  --gift-flare: rgba(170, 235, 255, 0.45);
}

.gift-open-screen.is-opening.gift-rarity-uncommon .gift-open-box {
  animation-name: gift-open-box-uncommon;
}

.gift-open-screen.is-opening.gift-rarity-rare .gift-open-box {
  animation-name: gift-open-box-rare;
}

.gift-open-screen.is-opening.gift-rarity-epic .gift-open-box {
  animation-name: gift-open-box-epic;
}

.gift-open-screen.is-opening.gift-rarity-legendary .gift-open-box {
  animation-name: gift-open-box-legendary;
}

.gift-open-screen.is-opening.gift-rarity-rare,
.gift-open-screen.is-opening.gift-rarity-epic,
.gift-open-screen.is-opening.gift-rarity-legendary {
  animation-name: gift-open-backdrop-rich;
}

.gift-open-screen .gift-reward.is-legendary.is-revealed:not(.is-special) > span {
  animation: gift-open-prize-pop 0.7s cubic-bezier(0.2, 0.9, 0.3, 1) 0.18s both;
}

.gift-open-screen.is-opening.gift-rarity-legendary > :not(.gift-open-fx) {
  animation-duration: 0.7s;
}

@keyframes gift-open-backdrop {
  from {
    background: rgba(8, 6, 4, 0.2);
  }
  to {
    background: rgba(8, 6, 4, 0.82);
  }
}

@keyframes gift-open-backdrop-rich {
  0% {
    background: rgba(8, 6, 4, 0.15);
  }
  35% {
    background: color-mix(in srgb, var(--gift-burst-core) 35%, rgba(8, 6, 4, 0.82));
  }
  100% {
    background: rgba(8, 6, 4, 0.82);
  }
}

@keyframes gift-open-rise {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes gift-open-box {
  0% {
    opacity: 0;
    transform: translate(-50%, -40%) scale(0.55);
  }
  28% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.08);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes gift-open-box-uncommon {
  0% {
    opacity: 0;
    transform: translate(-50%, -40%) scale(0.5);
  }
  30% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.16);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes gift-open-box-rare {
  0% {
    opacity: 0;
    transform: translate(-50%, -38%) scale(0.42);
  }
  32% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.28);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.04);
  }
}

@keyframes gift-open-box-epic {
  0% {
    opacity: 0;
    transform: translate(-50%, -36%) scale(0.34);
  }
  34% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.4);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.08);
  }
}

@keyframes gift-open-box-legendary {
  0% {
    opacity: 0;
    transform: translate(-50%, -32%) scale(0.22) rotate(-8deg);
  }
  22% {
    opacity: 1;
    transform: translate(-50%, -52%) scale(1.55) rotate(4deg);
  }
  48% {
    transform: translate(-50%, -48%) scale(0.92) rotate(-2deg);
  }
  72% {
    transform: translate(-50%, -50%) scale(1.22) rotate(1deg);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.12) rotate(0deg);
  }
}

@keyframes gift-open-beam {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.2) rotate(-12deg);
  }
  25% {
    opacity: 0.95;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.15) rotate(8deg);
  }
}

@keyframes gift-open-beam-alt {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.15) rotate(32deg);
  }
  30% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.2) rotate(18deg);
  }
}

@keyframes gift-open-orbit {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.35) rotate(0deg);
  }
  35% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.55) rotate(140deg);
  }
}

@keyframes gift-open-key-flash {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.2);
  }
  18% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.8);
  }
}

@keyframes gift-open-lid {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  100% {
    transform: translate(1.5px, -7px) rotate(-22deg);
  }
}

@keyframes gift-open-burst {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.15);
  }
  35% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.35);
  }
}

@keyframes gift-open-ring {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.2);
  }
  30% {
    opacity: 0.95;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.55);
  }
}

@keyframes gift-open-flare {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.3) rotate(0deg);
  }
  25% {
    opacity: 0.85;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.2) rotate(28deg);
  }
}

@keyframes gift-open-halo {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.4) rotate(-8deg);
  }
  40% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.45) rotate(12deg);
  }
}

@keyframes gift-open-spark {
  0% {
    opacity: 0;
    transform: rotate(var(--a, 0deg)) translateY(0) scale(0.3);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: rotate(var(--a, 0deg)) translateY(calc(var(--d, 40%) * -1)) scale(1);
  }
}

@keyframes gift-open-prize-pop {
  0% {
    transform: scale(0.85);
    filter: brightness(1);
  }
  55% {
    transform: scale(1.08);
    filter: brightness(1.25);
  }
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .gift-open-screen.is-opening,
  .gift-open-screen.is-opening > :not(.gift-open-fx),
  .gift-open-screen.is-opening .gift-open-burst,
  .gift-open-screen.is-opening .gift-open-ring,
  .gift-open-screen.is-opening .gift-open-flare,
  .gift-open-screen.is-opening .gift-open-halo,
  .gift-open-screen.is-opening .gift-open-beam,
  .gift-open-screen.is-opening .gift-open-orbit,
  .gift-open-screen.is-opening .gift-open-key-flash,
  .gift-open-screen.is-opening .gift-open-spark,
  .gift-open-screen .gift-reward.is-legendary.is-revealed:not(.is-special) > span {
    animation: none !important;
  }
}

.purchase-screen {
  z-index: 34;
}

.item-detail-screen {
  z-index: 35;
}

.item-detail-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(20rem, 100%);
  padding: 22px 20px 18px;
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04);
  text-align: center;
}

.item-detail-icon {
  display: grid;
  place-items: center;
  width: 4.5rem;
  height: 4.5rem;
  border: 2px solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--button);
}

.item-detail-icon .consumable-icon,
.item-detail-icon .consumable-icon--detail {
  width: 2.8rem;
  height: 2.8rem;
}

.item-detail-screen #item-detail-title {
  margin: 0;
  font-size: clamp(1.15rem, 3.8vw, 1.45rem);
  letter-spacing: 0.04em;
}

.item-detail-rarity {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.item-detail-desc {
  margin: 0;
  max-width: 18rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.item-detail-count {
  margin: 0;
  color: var(--text);
  font-size: 0.85rem;
}

.item-detail-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.item-detail-icon.rarity-common,
.items-drawer-slot.rarity-common,
.info-list .rarity-common > span,
.item-detail-rarity.rarity-common {
  border-color: #b8976a;
  color: #d7c4a8;
}

.item-detail-icon.rarity-uncommon,
.items-drawer-slot.rarity-uncommon,
.info-list .rarity-uncommon > span,
.item-detail-rarity.rarity-uncommon {
  border-color: #8fb84a;
  color: #c8e070;
}

.item-detail-icon.rarity-rare,
.items-drawer-slot.rarity-rare,
.info-list .rarity-rare > span,
.item-detail-rarity.rarity-rare {
  border-color: #5a9de8;
  color: #9ec8ff;
}

.item-detail-icon.rarity-epic,
.items-drawer-slot.rarity-epic,
.info-list .rarity-epic > span,
.item-detail-rarity.rarity-epic {
  border-color: #b46ae8;
  color: #e0b4ff;
}

.item-detail-icon.rarity-legendary,
.items-drawer-slot.rarity-legendary,
.info-list .rarity-legendary > span,
.item-detail-rarity.rarity-legendary {
  border-color: #7ed7f0;
  color: #c8f4ff;
}

.purchase-screen .purchase-name {
  margin: 0;
  color: var(--accent);
  font-size: clamp(1.2rem, 4vw, 1.7rem);
  letter-spacing: 0.06em;
  text-align: center;
}

.purchase-screen .purchase-detail {
  margin: 0;
  max-width: 22rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.45;
  text-align: center;
}

.shard-detail-screen {
  z-index: 34;
}

.shard-detail-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: min(20rem, 100%);
  padding: 22px 20px 18px;
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04);
  overflow: visible;
}

.shard-detail-card.is-gild-fanfare {
  animation: shard-gild-pulse 0.5s ease-out;
}

.shard-gild-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 3rem;
  height: 3rem;
  border: 3px solid #e0b84a;
  border-radius: 50%;
  box-shadow:
    0 0 0 1px rgba(249, 224, 120, 0.55),
    0 0 18px rgba(224, 184, 74, 0.55);
  pointer-events: none;
  animation: shard-gild-ring 0.5s ease-out forwards;
}

@keyframes shard-gild-pulse {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes shard-gild-ring {
  0% {
    opacity: 0.95;
    transform: translate(-50%, -50%) scale(0.35);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(4.2);
  }
}

.shard-detail-screen.is-gilded .shard-detail-card {
  border-color: #e0b84a;
  box-shadow:
    0 0 0 1px #c9a227,
    0 0 24px rgba(224, 184, 74, 0.22);
  background: linear-gradient(165deg, rgba(224, 184, 74, 0.14), rgba(42, 33, 24, 0.96) 55%);
}

.shard-detail-screen.is-diamondized .shard-detail-card {
  border-color: #9fdfff;
  box-shadow:
    0 0 0 1px rgba(120, 200, 255, 0.55),
    0 0 24px rgba(120, 200, 255, 0.22);
  background: linear-gradient(165deg, rgba(180, 230, 255, 0.16), rgba(42, 33, 24, 0.96) 55%);
}

.shard-detail-icon .resource-icon {
  width: 42px;
  height: 42px;
}

.shard-detail-screen h1 {
  margin: 0;
  font-size: clamp(1.25rem, 4vw, 1.7rem);
  letter-spacing: 0.04em;
  text-align: center;
}

.shard-detail-count {
  margin: 0;
  color: var(--accent);
  font-size: clamp(1.35rem, 4.5vw, 1.9rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  text-align: center;
}

.shard-detail-screen.is-gilded .shard-detail-count {
  color: #f0d24a;
}

.shard-detail-screen.is-diamondized .shard-detail-count {
  color: #9fdfff;
}

.shard-detail-card .shard-bar {
  width: 100%;
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.shard-detail-card .shard-bar span {
  display: block;
  height: 100%;
  background: #e0b84a;
}

.shard-detail-card .shard-bar.is-diamond span {
  background: linear-gradient(90deg, #7ec8ef, #dff4ff);
}

.shard-detail-bonus {
  margin: 0;
  white-space: pre-line;
  max-width: 18rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.45;
  text-align: center;
}

.shard-detail-actions {
  display: flex;
  width: 100%;
  justify-content: center;
}

.shard-detail-actions:empty {
  display: none;
}

.shard-detail-actions .shard-gild-button {
  min-width: 7rem;
  padding: 8px 12px;
  font-size: 0.85rem;
}

.gift-drawer {
  position: absolute;
  top: calc(50% + 48px);
  left: 0;
  z-index: 9;
  transform: translateY(-50%);
  pointer-events: none;
}

.items-drawer {
  position: absolute;
  top: calc(50% + 196px);
  left: 0;
  z-index: 9;
  transform: translateY(-50%);
  pointer-events: none;
}

.items-drawer[hidden] {
  display: none;
}

.items-drawer-panel {
  display: flex;
  align-items: center;
  transform: translateX(0);
  transition: transform 0.28s ease;
  pointer-events: auto;
}

.items-drawer.is-closed .items-drawer-panel {
  transform: translateX(calc(-100% + 20px));
}

.items-drawer-body {
  display: grid;
  gap: 8px;
  width: auto;
  padding: 10px 8px 10px 10px;
  overflow: visible;
  border: var(--border-w) solid var(--panel-border);
  border-left: 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--sidebar);
  box-shadow: 4px 0 16px rgba(0, 0, 0, 0.28);
}

.items-drawer-count {
  display: none;
}

.items-drawer-list {
  display: grid;
  grid-template-columns: repeat(4, 36px);
  gap: 6px;
}

.items-drawer-slot {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 2px solid var(--panel-border);
  border-radius: var(--radius-sm);
  background: var(--button);
  color: var(--text);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.items-drawer-slot.is-empty {
  opacity: 0.45;
  cursor: default;
}

.items-drawer-slot.is-active {
  box-shadow: 0 0 0 1px var(--accent), 0 0 10px color-mix(in srgb, var(--accent) 45%, transparent);
}

.items-drawer-slot-mark {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  line-height: 1;
}

.items-drawer-slot-mark .consumable-icon {
  display: block;
  width: 22px;
  height: 22px;
}

.consumable-icon--inline {
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.2em;
  margin-right: 0.3em;
}

.items-drawer-slot-count {
  position: absolute;
  left: 2px;
  bottom: 1px;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
  pointer-events: none;
}

.items-drawer-slot.is-empty .items-drawer-slot-count {
  color: var(--muted);
}

.items-drawer-buffs {
  display: grid;
  gap: 4px;
  max-width: calc(4 * 36px + 3 * 6px);
}

.items-drawer-buff {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.25;
}

.items-drawer-buff strong {
  color: var(--text);
  font-weight: 600;
}

.items-drawer-tab {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  align-self: center;
  width: 20px;
  height: 34px;
  margin: 0 0 0 -1px;
  padding: 0;
  border: var(--border-w) solid var(--panel-border);
  border-left: 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--panel);
  color: var(--accent);
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 3px 0 12px rgba(0, 0, 0, 0.28);
}

.items-drawer-tab-mark {
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
}

.items-drawer-tab-mark svg {
  display: block;
  width: 14px;
  height: 14px;
}

.items-drawer.has-items .items-drawer-tab-mark {
  animation: gift-drawer-jiggle 2.6s ease-in-out infinite;
}

.gift-drawer[hidden] {
  display: none;
}

.gift-drawer-panel {
  display: flex;
  align-items: center;
  transform: translateX(0);
  transition: transform 0.28s ease;
  pointer-events: auto;
}

.gift-drawer.is-closed .gift-drawer-panel {
  transform: translateX(calc(-100% + 20px));
}

.gift-drawer-body {
  display: grid;
  justify-items: center;
  gap: 8px;
  width: 92px;
  padding: 12px 10px 12px 12px;
  border: var(--border-w) solid var(--panel-border);
  border-left: 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--sidebar);
  box-shadow: 4px 0 16px rgba(0, 0, 0, 0.28);
}

.gift-drawer-present {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
}

.gift-drawer-icon {
  display: block;
  width: 44px;
  height: 44px;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35));
}

.gift-drawer-count {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-align: center;
  line-height: 1.2;
}

.gift-drawer-body button {
  margin: 0;
  min-height: 34px;
  padding: 6px 12px;
  font-size: 0.85rem;
}

/* Regular and golden boxes each get a slot; a slot hides when it is empty. */
.gift-drawer-slot {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.gift-drawer-slot[hidden] {
  display: none;
}

.gift-drawer-slot + .gift-drawer-slot:not([hidden]) {
  padding-top: 10px;
  border-top: 1px solid var(--panel-border);
}

#gift-drawer-slot[hidden] + .gift-drawer-slot {
  padding-top: 0;
  border-top: 0;
}

.gift-drawer-slot.is-golden .gift-drawer-count {
  color: #ffd75a;
}

.gift-drawer-slot.is-golden .gift-drawer-icon {
  filter:
    drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35))
    drop-shadow(0 0 6px rgba(170, 100, 230, 0.55));
}

.gift-drawer-slot.is-golden button:not(:disabled) {
  background: #5a2a8a;
  border-color: #f2c94c;
  color: #ffe58a;
}

.gift-drawer-tab {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  align-self: center;
  width: 20px;
  height: 34px;
  margin: 0 0 0 -1px;
  padding: 0;
  border: var(--border-w) solid var(--panel-border);
  border-left: 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--panel);
  color: var(--accent);
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 3px 0 12px rgba(0, 0, 0, 0.28);
}

.gift-drawer-tab-mark {
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  transform-origin: 50% 60%;
}

.gift-drawer-tab-mark svg {
  display: block;
  width: 14px;
  height: 14px;
}

.gift-drawer.has-gifts .gift-drawer-tab-mark {
  animation: gift-drawer-jiggle 2.6s ease-in-out infinite;
}

@keyframes gift-drawer-jiggle {
  0%,
  68%,
  100% {
    transform: rotate(0deg) translateX(0);
  }
  72% {
    transform: rotate(-10deg) translateX(-1px);
  }
  76% {
    transform: rotate(9deg) translateX(1px);
  }
  80% {
    transform: rotate(-7deg) translateX(-1px);
  }
  84% {
    transform: rotate(5deg) translateX(1px);
  }
  88% {
    transform: rotate(-2deg);
  }
  92% {
    transform: rotate(0deg);
  }
}

.pets-view {
  width: min(720px, 100%);
  align-content: start;
  gap: 8px;
}

.pets-view h2 {
  margin: 0;
}

.pets-view .hint {
  margin: 0;
}

.pets-slot-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pets-slot-tabs[hidden] {
  display: none;
}

.pets-slot-tab {
  margin: 0;
  min-height: 34px;
  padding: 6px 12px;
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius-sm);
  background: var(--button);
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.pets-slot-tab.is-selected {
  background: var(--button-hover);
  color: var(--text);
  border-color: var(--accent);
}

.pets-actions {
  display: grid;
  justify-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 4px;
}

.pets-actions .hint {
  text-align: center;
}

/* Pets buttons reuse .button-grid styling (theme tokens + chrome packs); just size them here. */
.pets-actions.button-grid button {
  width: min(100%, 22rem);
  margin: 0;
  padding: 12px 16px;
  text-align: center;
}

.pets-actions.button-grid button.danger-button {
  color: color-mix(in srgb, var(--danger) 35%, var(--text));
}

.pets-actions.button-grid button.danger-button .detail {
  color: var(--muted);
}

.pets-feed-go.button-grid {
  display: block;
}

.pets-feed .pets-feed-go button {
  width: auto;
  min-width: 7.5rem;
  min-height: 40px;
  margin: 0;
  padding: 8px 18px;
  text-align: center;
}

.pet-viewport.is-empty {
  opacity: 0.35;
}

.pets-stage {
  display: grid;
  grid-template-columns: minmax(7rem, 10rem) minmax(0, 1fr);
  gap: 16px;
  width: 100%;
  align-items: start;
}

.pets-stage:has(.pets-stats[hidden]) {
  grid-template-columns: 1fr;
}

.pets-stats {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 10px;
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--panel);
}

.pets-stats h3 {
  margin: 0 0 4px;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.pets-stats p {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  font-size: 0.82rem;
}

.pets-center {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 8px;
}

.pet-viewport {
  width: min(280px, 70vw);
  height: 220px;
}

.pet-viewport.is-hatched {
  cursor: pointer;
}

.pet-heart {
  position: fixed;
  z-index: 42;
  margin: -10px 0 0 -8px;
  color: #e45c7a;
  font-size: 1.35rem;
  line-height: 1;
  pointer-events: none;
  opacity: 1;
  transform: translate(0, 0) scale(1);
  transition: transform 0.62s ease-out, opacity 0.62s ease-out;
  text-shadow: 0 1px 0 #7a2438;
}

.pet-viewport canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.pets-timer {
  margin: 0;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.pets-feed {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.pets-feed[hidden],
.pets-xp[hidden],
.pets-stats[hidden] {
  display: none;
}

.pets-feed label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.pets-feed select,
.pets-feed button {
  min-width: 7.5rem;
}

.pets-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 10px;
  width: 100%;
}

.pets-name[hidden] {
  display: none;
}

.pets-name-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  min-height: 34px;
  padding: 4px 10px;
  border: var(--border-w) solid transparent;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  font: inherit;
  font-size: 1.05rem;
  cursor: pointer;
}

.pets-name-button:hover,
.pets-name-button:focus-visible {
  border-color: var(--panel-border);
}

.pets-name-pen {
  color: var(--muted);
  font-size: 0.85rem;
}

.pets-mood {
  padding: 2px 8px;
  border: var(--border-w) solid var(--mood, var(--panel-border));
  border-radius: var(--radius-sm);
  color: var(--mood, var(--muted));
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pets-rename {
  display: flex;
  gap: 6px;
}

.pets-rename input {
  width: 11rem;
  min-height: 34px;
  padding: 4px 8px;
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.pets-rename button {
  margin: 0;
  min-height: 34px;
  padding: 4px 12px;
}

.pets-stats p {
  border-left: 3px solid var(--stat, transparent);
  padding-left: 6px;
}

.pets-stat-name {
  color: var(--stat, inherit);
}

.pet-food-picker {
  position: relative;
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.pets-feed .pet-food-current {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 10.5rem;
  margin: 0;
  min-height: 40px;
  padding: 6px 10px 6px 12px;
  position: relative;
  overflow: hidden;
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--control-shadow);
  font: inherit;
  font-size: 0.9rem;
  text-align: left;
  touch-action: manipulation;
}

/* Same dark panel as the open list so the tinted food name stays vivid. */
.pets-feed .pet-food-current:hover:not(:disabled),
.pets-feed .pet-food-current[aria-expanded="true"] {
  background: color-mix(in srgb, var(--button-hover) 55%, var(--panel));
}

.pets-feed .pet-food-current:disabled {
  background: var(--disabled);
  color: var(--muted);
  cursor: not-allowed;
}

.pet-food-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pet-food-caret {
  margin-left: auto;
  color: var(--muted);
}

/* Food name tinted with a blend of the stat colors it feeds (no explicit stat hints). */
.pet-food-ink {
  flex: 0 1 auto;
  color: var(--food-color, var(--text));
  font-weight: 700;
  /* Dark edge keeps the pale stat colors readable on light buttons too. */
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.6)) drop-shadow(0 0 1px rgba(0, 0, 0, 0.5));
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .pet-food-ink[style*="--food-ink"] {
    background-image: var(--food-ink, none);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
}

.pet-food-list {
  position: absolute;
  z-index: 30;
  bottom: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  max-height: min(18rem, 50vh);
  overflow-y: auto;
  margin: 0;
  padding: 4px;
  list-style: none;
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}

.pet-food-list[hidden] {
  display: none;
}

.pets-feed .pet-food-option {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  min-height: 36px;
  margin: 0;
  padding: 4px 8px 4px 12px;
  position: relative;
  overflow: hidden;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  text-align: left;
  touch-action: manipulation;
}

.pets-feed .pet-food-option:hover,
.pets-feed .pet-food-option[aria-selected="true"] {
  background: var(--button-hover);
}

.pets-feed button {
  touch-action: none;
}

.pets-xp {
  width: 100%;
  display: grid;
  gap: 6px;
}

.pets-xp-bar {
  height: 12px;
  overflow: hidden;
  border-radius: 99px;
  background: color-mix(in srgb, var(--panel-border) 70%, transparent);
}

.pets-xp-bar > span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
}

.pets-xp p {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}

.research-view,
.overseer-view,
.lab-view,
.processor-view,
.monuments-view,
.reliquary-view,
.pets-view,
.descension-view,
.stats-view,
.achievements-view,
.settings-view {
  justify-items: stretch;
}

.processor-list {
  display: grid;
  gap: 10px;
  width: 100%;
}

/* Bonus colours come from the shared families (see "Bonus families" below). */

.processor-summary {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: var(--border-w) solid color-mix(in srgb, var(--chrome-accent) 55%, var(--panel-border));
  border-radius: var(--radius);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--chrome-accent) 14%, var(--panel)),
    var(--panel)
  );
  box-shadow: var(--control-shadow);
}

.actions .processor-list .processor-summary h3 {
  margin: 0;
  color: var(--chrome-accent);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.processor-summary-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.processor-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.processor-chip {
  display: grid;
  gap: 1px;
  min-width: 0;
  padding: 5px 9px;
  border: 1px solid color-mix(in srgb, var(--bonus) 60%, transparent);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--bonus) 14%, var(--bg));
}

.processor-chip-value {
  color: var(--bonus);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 8px color-mix(in srgb, var(--bonus) 45%, transparent);
}

.processor-chip-label {
  color: var(--muted);
  font-size: 0.7rem;
  white-space: nowrap;
}

.processor-card {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 12px 14px 12px 16px;
  overflow: hidden;
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius);
  background: linear-gradient(
    100deg,
    color-mix(in srgb, var(--processor-ore) 16%, var(--panel)) 0%,
    var(--panel) 55%
  );
  box-shadow: var(--control-shadow);
}

/* Ore-coloured stripe down the left edge. */
.processor-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--processor-ore);
}

.processor-card.is-complete {
  border-color: color-mix(in srgb, var(--chrome-accent) 75%, var(--panel-border));
  background: linear-gradient(
    100deg,
    color-mix(in srgb, var(--chrome-accent) 18%, var(--panel)) 0%,
    var(--panel) 60%
  );
}

.processor-card.just-upgraded {
  animation: processor-pop 0.5s ease-out;
}

@keyframes processor-pop {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--bonus) 70%, transparent), var(--control-shadow); }
  100% { box-shadow: 0 0 0 10px transparent, var(--control-shadow); }
}

.processor-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px 12px;
  align-items: center;
}

.processor-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid color-mix(in srgb, var(--processor-ore) 55%, transparent);
  border-radius: var(--radius-sm);
  background: radial-gradient(
    circle at 50% 40%,
    color-mix(in srgb, var(--processor-ore) 30%, transparent),
    color-mix(in srgb, var(--processor-ore) 6%, var(--bg)) 70%
  );
}

.processor-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.processor-card h3 {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.2;
}

.processor-bonus {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  color: color-mix(in srgb, var(--bonus) 45%, var(--muted));
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.25;
}

.processor-card.is-started .processor-bonus {
  color: var(--bonus);
  font-size: 1rem;
  text-shadow: 0 0 10px color-mix(in srgb, var(--bonus) 40%, transparent);
}

.processor-effect {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.25;
}

.processor-level {
  align-self: start;
  margin: 0;
  padding: 3px 7px;
  border: 1px solid color-mix(in srgb, var(--processor-ore) 45%, var(--panel-border));
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.processor-card.is-complete .processor-level {
  border-color: var(--chrome-accent);
  color: var(--chrome-accent);
}

.processor-bar {
  position: relative;
  height: 10px;
  overflow: hidden;
  border: 1px solid #0e1012;
  border-radius: 99px;
  background: color-mix(in srgb, var(--panel-border) 45%, var(--bg));
}

/* Notches every 10 levels. */
.processor-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent 0 calc(20% - 1px),
    rgba(0, 0, 0, 0.45) calc(20% - 1px) 20%
  );
  pointer-events: none;
}

.processor-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--processor-ore) 70%, #fff),
    var(--processor-ore) 55%,
    color-mix(in srgb, var(--processor-ore) 70%, #000)
  );
  box-shadow: 0 0 8px color-mix(in srgb, var(--processor-ore) 60%, transparent);
  transition: width 0.35s ease-out;
}

.processor-card.is-complete .processor-bar > span {
  background: linear-gradient(180deg, #ffe58a, var(--chrome-accent) 55%, #8a6a10);
}

.processor-card button {
  display: grid;
  justify-items: start;
  gap: 2px;
  width: 100%;
  padding: 10px 12px;
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius-sm);
  background: var(--button);
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
  box-shadow: var(--control-shadow);
}

.processor-card button.is-affordable:not(:disabled) {
  border-color: #6fbf73;
  background: linear-gradient(180deg, #3f7a43, #2c5a30);
  color: #f2fff2;
}

.processor-card button.is-affordable:not(:disabled):hover {
  background: linear-gradient(180deg, #4a8c4e, #336838);
}

.processor-card button:active:not(:disabled) {
  transform: translateY(1px);
}

.processor-card button:disabled {
  background: var(--disabled);
  color: var(--muted);
  cursor: default;
}

.processor-card button .processor-buy-label {
  font-weight: 700;
}

.processor-buy-next {
  margin-left: 6px;
  font-weight: 600;
  opacity: 0.85;
}

.processor-card button .detail {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.processor-card button.is-affordable:not(:disabled) .detail {
  color: #cdeccd;
}

.processor-maxed {
  margin: 0;
  padding: 9px 12px;
  border: 1px dashed color-mix(in srgb, var(--chrome-accent) 70%, transparent);
  border-radius: var(--radius-sm);
  color: var(--chrome-accent);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.resource-icon {
  grid-area: icon;
  align-self: center;
}

.shards-view {
  overflow: auto;
}

.shards-sections {
  display: grid;
  gap: 18px;
  margin-top: 8px;
}

.shard-section {
  display: grid;
  gap: 8px;
}

.shard-section-title {
  margin: 0;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--panel-border);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Always six to a row, on every screen width. */
.shards-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.shard-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 10px 10px;
  background: var(--panel);
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius-sm);
  min-width: 0;
  color: inherit;
  font: inherit;
  text-align: center;
  cursor: pointer;
}

.shard-card-alert {
  position: absolute;
  top: -7px;
  right: -4px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: #d45c4c;
  color: #fff8f4;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 0 0 2px var(--bg), 0 1px 4px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.shard-card.is-ready {
  border-color: color-mix(in srgb, #d45c4c 55%, var(--panel-border));
}

.shard-card.is-gilded {
  border-color: #e0b84a;
  box-shadow: 0 0 0 1px #c9a227;
}

.shard-card.is-diamondized {
  border-color: #9fdfff;
  background: linear-gradient(160deg, rgba(180, 230, 255, 0.14), rgba(42, 33, 24, 0.92) 55%);
  box-shadow:
    0 0 0 1px rgba(120, 200, 255, 0.55),
    inset 0 1px 0 rgba(230, 248, 255, 0.28);
}

.shard-card .resource-icon--card {
  width: 28px;
  height: 28px;
}

.shard-card .shard-bar {
  width: 100%;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.shard-card .shard-bar span {
  display: block;
  height: 100%;
  background: #e0b84a;
}

.shard-card .shard-bar.is-diamond span {
  background: linear-gradient(90deg, #7ec8ef, #dff4ff);
}

.shard-gild-button {
  align-self: stretch;
  margin: 0;
  padding: 5px 6px;
  border: 1px solid #c9a227;
  border-radius: var(--radius-sm);
  background: rgba(224, 184, 74, 0.16);
  color: #f0d24a;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.shard-gild-button:hover {
  background: rgba(224, 184, 74, 0.28);
}

.shard-gild-button.is-diamond {
  border-color: #9fdcff;
  background: rgba(159, 220, 255, 0.16);
  color: #dff4ff;
  text-shadow: 0 0 6px rgba(159, 220, 255, 0.6);
}

.shard-gild-button.is-diamond:hover {
  background: rgba(159, 220, 255, 0.28);
}

@media (max-width: 480px) {
  .shards-grid {
    gap: 6px;
  }

  .shard-card {
    gap: 6px;
    padding: 8px 4px 6px;
  }

  .shard-card .resource-icon--card {
    width: 24px;
    height: 24px;
  }
}

.resource-card .label {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.95rem;
}

.resources .resource-card .label {
  display: contents;
}

.resources .resource-card .label span:first-child {
  grid-area: name;
  color: var(--muted);
  font-size: 0.72rem;
}

.resources .resource-card .label span:last-child {
  grid-area: hint;
  color: var(--muted);
  font-size: 0.62rem;
  line-height: 1.15;
}

.resource-card .amount {
  margin-top: 6px;
  font-size: 1.8rem;
}

.resources .resource-card .amount {
  grid-area: amount;
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.resource-card.rock .amount {
  color: var(--rock);
}

.resource-card.clay .amount {
  color: var(--clay);
}

.resource-card.flint .amount {
  color: var(--flint);
}

.resource-card.gravel .amount {
  color: var(--gravel);
}

.resource-card.limestone .amount {
  color: var(--limestone);
}

.resource-card.slate .amount {
  color: var(--slate);
}

.resource-card.sandstone .amount {
  color: var(--sandstone);
}

.resource-card.siltstone .amount {
  color: var(--siltstone);
}

.resource-card.chert .amount {
  color: var(--chert);
}

.resource-card.granite .amount {
  color: var(--granite);
}

.resource-card.marble .amount {
  color: var(--marble);
}

.resource-card.quartz .amount {
  color: var(--quartz);
}

.resource-card.bedrock .amount {
  color: var(--bedrock);
}

.resource-card.basalt .amount {
  color: var(--basalt);
}

.resource-card.obsidian .amount {
  color: var(--obsidian);
}

.resource-card.sulfur .amount {
  color: var(--sulfur);
}

.resource-card.olivine .amount {
  color: var(--olivine);
}

.resource-card.snowbank .amount {
  color: var(--snowbank);
}

.resource-card.icepack .amount {
  color: var(--icepack);
}

.resource-card.blue-ice .amount {
  color: var(--blue-ice);
}

.resource-card.magma-chunk .amount {
  color: var(--magma-chunk);
}

.resource-card.planet-core .amount {
  color: var(--planet-core);
}

.resource-card.tektite .amount {
  color: var(--tektite);
}

.resource-card.stardust .amount {
  color: var(--stardust);
}

.resource-card.iridium .amount {
  color: var(--iridium);
}

.resource-card.manganese .amount {
  color: var(--manganese);
}

.resource-card.cobalt .amount {
  color: var(--cobalt);
}

.resource-card.black-pearl .amount {
  color: var(--black-pearl);
}

.resource-card.gems .amount {
  color: var(--gems);
}

.resource-card.science .amount,
.resource-card.scientists .amount {
  color: var(--science);
}

.hire-button {
  width: 100%;
  padding: 16px 18px;
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--button);
  color: var(--text);
  box-shadow: var(--control-shadow);
  font-size: 1.05rem;
  text-align: left;
}

.hire-button:hover:not(:disabled):not([aria-disabled="true"]) {
  background: var(--button-hover);
}

.hire-button:active:not(:disabled):not([aria-disabled="true"]) {
  transform: translateY(1px);
}

.hire-button:disabled,
.hire-button[aria-disabled="true"] {
  background: var(--disabled);
  color: var(--muted);
  cursor: not-allowed;
}

.hire-button .detail {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.92rem;
}

.assign-control {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.assign-buttons {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.assign-control button {
  width: 48px;
  height: 48px;
  padding: 0;
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--button);
  color: var(--text);
  box-shadow: var(--control-shadow);
  font-size: 1.6rem;
  line-height: 1;
}

.assign-control button:hover:not(:disabled) {
  background: var(--button-hover);
}

.assign-control button:active:not(:disabled) {
  transform: translateY(1px);
}

.assign-control button:disabled {
  background: var(--disabled);
  color: var(--muted);
  cursor: not-allowed;
}

.scientist-pool {
  display: grid;
  gap: 12px;
}

.crew-viewport {
  flex: 1;
  min-width: 0;
  height: 88px;
  overflow: hidden;
  background: transparent;
}

.crew-viewport canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.pour-bit {
  position: fixed;
  z-index: 50;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  pointer-events: none;
  opacity: 1;
  transform: translate(0, 0) scale(1);
  transition: transform 0.48s ease-in, opacity 0.48s ease-in;
}

.pour-bit .resource-icon {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.45));
}

.actions-chrome {
  position: relative;
  grid-row: 1;
  justify-self: stretch;
  width: min(640px, 100%);
  max-width: 100%;
  min-width: 0;
}

.resource-float-stage {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: auto;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  width: min(88px, 28%);
  max-width: 88px;
  pointer-events: none;
}

.resource-float-stage:empty {
  display: none;
}

html[data-resource-float-place="top"] .resource-float-stage {
  top: calc(var(--drawer-resources-height, 56px) + 4px);
  left: 50%;
  right: auto;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  /* max-content: left:50% would otherwise squeeze the row to half the screen and stack it. */
  width: max-content;
  max-width: calc(100% - 20px);
  transform: translateX(-50%);
}

html[data-resource-float-style="expanded"] .resource-float-stage {
  width: min(152px, 42%);
  max-width: 152px;
}

html[data-resource-float-place="top"][data-resource-float-style="expanded"] .resource-float-stage {
  width: max-content;
  max-width: calc(100% - 20px);
}

.resource-float-card {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  width: 100%;
  padding: 3px 6px;
  background: var(--panel);
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--control-shadow);
  opacity: 0;
  transform: translateX(-24px);
  transition:
    transform 0.34s ease,
    opacity 0.34s ease;
}

html[data-resource-float-place="top"] .resource-float-card {
  width: auto;
  min-width: 72px;
  transform: translateY(-24px);
}

.resource-float-card.is-in {
  opacity: 1;
  transform: translateX(0);
}

/* Long-press to pin (drawer) — pinned floating cards get a thin accent edge. */
.resource-float-card.is-pinned {
  border-color: var(--accent);
}

.resources .resource-card {
  position: relative;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.resources .resource-card.is-pressing {
  transform: scale(0.98);
  transition: transform 0.5s ease-out;
}

.resources .resource-card.is-pinned {
  border-color: var(--accent);
}

.resources .resource-card.is-pinned::after {
  content: "PINNED";
  position: absolute;
  top: 3px;
  right: 6px;
  color: var(--accent);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.resources .resource-card.pin-flash {
  animation: pin-flash 0.45s ease-out;
}

@keyframes pin-flash {
  0% { box-shadow: 0 0 0 0 var(--accent); }
  100% { box-shadow: 0 0 0 8px transparent; }
}

html[data-resource-float-place="top"] .resource-float-card.is-in {
  transform: translateY(0);
}

.resource-float-card.is-out {
  opacity: 0;
  transform: translateX(-28px);
}

html[data-resource-float-place="top"] .resource-float-card.is-out {
  transform: translateY(-32px);
}

.resource-float-card > .resource-icon {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
}

.resource-float-card .amount {
  flex: 1 1 auto;
  margin: 0;
  min-width: 0;
  font-size: 0.78rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

html[data-resource-float-style="expanded"] .resource-float-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "icon name amount"
    "icon hint amount";
  align-items: center;
  column-gap: 8px;
  row-gap: 0;
  padding: 4px 8px;
  min-width: 140px;
}

html[data-resource-float-style="expanded"] .resource-float-card > .resource-icon {
  grid-area: icon;
  width: auto;
  height: auto;
}

html[data-resource-float-style="expanded"] .resource-float-card .label {
  display: contents;
}

html[data-resource-float-style="expanded"] .resource-float-card .label span:first-child {
  grid-area: name;
  color: var(--muted);
  font-size: 0.72rem;
}

html[data-resource-float-style="expanded"] .resource-float-card .label span:last-child {
  grid-area: hint;
  color: var(--muted);
  font-size: 0.62rem;
  line-height: 1.15;
}

html[data-resource-float-style="expanded"] .resource-float-card .amount {
  grid-area: amount;
  font-size: 0.98rem;
  line-height: 1.15;
  text-align: left;
}

.haul-bit {
  position: fixed;
  z-index: 40;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  pointer-events: none;
  opacity: 1;
  transform: translate(0, 0) scale(1);
  transition: transform 0.55s ease-in, opacity 0.55s ease-in;
  will-change: transform, opacity;
}

/* No drop-shadow filter here: re-rasterising it every frame on dozens of flying icons lags phones. */
.haul-bit .resource-icon {
  width: 100%;
  height: 100%;
  display: block;
}

.gain-pop {
  position: fixed;
  z-index: 41;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin: 0;
  padding: 0;
  pointer-events: none;
  color: var(--text);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  opacity: 1;
  transform: translate(-50%, -50%);
  transition: transform 0.55s ease-out, opacity 0.55s ease-out;
}

.gain-pop.is-out {
  opacity: 0;
  transform: translate(-50%, calc(-50% - 26px));
}

.assign-income {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

#crew-income {
  display: grid;
  gap: 2px;
}

.site-lab-controls {
  display: grid;
  gap: 16px;
}

.actions {
  display: grid;
  /* One column no wider than the screen: a scrolling tab bar must not stretch it. */
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
  justify-items: center;
  gap: 28px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: calc(var(--drawer-resources-min, 56px) + 12px) 24px calc(var(--drawer-news-min, 72px) + 12px);
  position: relative;
}

.view-tabs {
  display: flex;
  width: 100%;
  gap: 4px;
  border-bottom: 1px solid var(--panel-border);
}

.view-tab {
  flex: 1;
  width: auto;
  padding: 12px 10px 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  text-align: center;
  text-transform: uppercase;
  cursor: pointer;
}

.view-tab.pin-end {
  flex: 0 1 auto;
  min-width: 5.5rem;
}

.view-tab.pin-end.icon-tab {
  min-width: 2.8rem;
}

.view-tab[data-view="achievements"] {
  min-width: 8.4rem;
  letter-spacing: 0.06em;
}

.view-tab[data-view="achievements"].icon-tab {
  min-width: 2.8rem;
}

.view-tab[data-view="descension"] {
  min-width: 8.2rem;
  letter-spacing: 0.04em;
  overflow: visible;
}

.view-tab .funnel-icon {
  overflow: visible;
}

.view-tab.pin-first {
  margin-left: auto;
}

.view-tab.icon-tab {
  min-width: 2.8rem;
  padding-left: 8px;
  padding-right: 8px;
  letter-spacing: 0;
}

.view-tab .view-tab-icon,
.view-tab .gear-icon {
  display: block;
  width: 1.2rem;
  height: 1.2rem;
  margin: 0 auto;
}

.view-tab .flask-icon {
  color: #3d8fd4;
}

.view-tab .trophy-icon {
  color: #d4a017;
}

.view-tab:hover:not([aria-selected="true"]) {
  background: transparent;
  color: var(--text);
}

html[data-tab-layout="scroll"] .view-tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
  max-width: 100%;
}

html[data-tab-layout="scroll"] .view-tab {
  flex: 0 0 auto;
}

html[data-layout="narrow"][data-tab-layout="scroll"] .view-tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
}

/* Wrapped tab rows keep the top row's tab size and sit centered (GameUi.syncViewTabRows). */
.view-tabs:has(.is-extra-row) {
  justify-content: center;
}

.view-tabs .view-tab.is-extra-row {
  flex: 0 0 var(--view-tab-row-w);
  min-width: 0;
  margin-left: 0;
}

.view-tab[aria-selected="true"] {
  background: transparent;
  color: var(--chrome-accent, var(--accent));
  box-shadow: inset 0 -3px 0 var(--chrome-accent, var(--accent));
}

.view {
  display: grid;
  grid-row: 2;
  align-content: start;
  align-self: stretch;
  justify-items: center;
  gap: 28px;
  width: min(560px, 100%);
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.view[hidden],
.view.mine-view[hidden] {
  display: none;
}

.view.mine-view {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) var(--deposit-viewport-h, 148px);
  width: 100%;
  min-height: 0;
  align-content: stretch;
  justify-items: stretch;
  gap: 10px;
  overflow: hidden;
  /* Let the deposit canvas run to the screen edges (DepositViewport.resize widens it). */
  overflow-x: visible;
  overflow-y: clip;
  margin-bottom: -40px;
}

.view.vault-view {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  width: 100%;
  min-height: 0;
  align-content: stretch;
  justify-items: stretch;
  gap: 10px;
  overflow: hidden;
  margin-bottom: -40px;
}

.view.vault-view[hidden] {
  display: none;
}

.vault-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  width: min(560px, 100%);
  justify-self: center;
}

.vault-header h2 {
  margin: 0;
}

/* Sits on the wall: VaultViewport says how high its top row reaches. */
.vault-keys {
  position: absolute;
  right: 0;
  bottom: calc(var(--vault-wall-top, 100%) + 8px);
  left: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  pointer-events: none;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.vault-key-icon {
  width: 1.05em;
  height: 1.05em;
  flex: 0 0 auto;
  color: var(--accent);
}

.vault-view .hint {
  width: min(560px, 100%);
  justify-self: center;
  margin: 0;
}

.vault-actions {
  position: relative;
  z-index: 5;
  width: min(560px, 100%);
  justify-self: center;
}

.vault-renew-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 10px 14px;
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--button);
  color: var(--text);
  font-size: 1rem;
}

.vault-renew-button:hover:not(:disabled) {
  background: var(--button-hover);
}

.vault-renew-button:disabled {
  background: var(--disabled);
  color: var(--muted);
  cursor: not-allowed;
}

.vault-renew-cost {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.vault-renew-button:disabled .vault-renew-cost {
  color: var(--muted);
}

.vault-viewport {
  position: relative;
  width: 100%;
  height: 320px;
  justify-self: stretch;
  align-self: end;
  overflow: visible;
  background: transparent;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  z-index: 4;
}

.vault-viewport canvas {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  touch-action: none;
}

.descension-points {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  margin: 0 0 8px;
  color: var(--perk-points);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

.descension-points .resource-icon {
  color: var(--perk-points);
}

.descension-store-link {
  display: inline-flex;
  align-items: center;
  gap: 0.28em;
  margin: 0;
  margin-left: 0.35em;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 0.9em;
  letter-spacing: 0.04em;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
}

.descension-store-link .view-tab-icon {
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
}

.descension-store-link:hover,
.descension-store-link:focus-visible {
  color: var(--accent, var(--text));
  filter: brightness(1.08);
}

.store-card-title-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
}

.store-card-title-with-icon .resource-icon,
.store-starter-loot .resource-icon[data-resource="perk-points"],
.store-card .hint .resource-icon[data-resource="perk-points"],
.gift-reward .resource-icon[data-resource="perk-points"],
.descension-cost .resource-icon[data-resource="perk-points"] {
  color: var(--perk-points);
}

.store-starter-loot .resource-icon[data-resource="gems"],
.store-card .hint .resource-icon[data-resource="gems"] {
  color: var(--gems);
}

.store-starter-loot {
  display: inline-flex;
  align-items: center;
  gap: 0.28em;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.store-starter-sep {
  opacity: 0.55;
}

.gift-reward {
  display: flex;
  align-items: center;
  gap: 0.4em;
}

.view.descension-view {
  grid-template-rows: auto auto minmax(0, 1fr);
  align-content: stretch;
  gap: 0.5rem;
  overflow: hidden;
}

.descension-pane {
  min-height: 0;
  width: 100%;
  display: grid;
  gap: 0.65rem;
  align-content: start;
  justify-items: stretch;
}

.descension-pane[hidden] {
  display: none;
}

#descension-digging {
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

#descension-reset {
  overflow-x: hidden;
  overflow-y: auto;
}

.descension-reset-reward {
  margin: 0;
  font-weight: 600;
}

.descension-reset-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.descension-reset-columns h4 {
  margin: 0 0 0.35rem;
}

.descension-reset-list {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.35rem;
  list-style: disc;
}

.descension-reset-part {
  display: inline;
}

.descension-reset-part svg {
  display: inline-block;
  width: 0.95em;
  height: 0.95em;
  vertical-align: -0.15em;
  margin-right: 0.2em;
}

.descension-reset-list .achievement-kind-icon {
  color: var(--muted);
}

#descension-fill-button {
  justify-self: start;
}

.mine-locations {
  display: grid;
  gap: 4px;
  justify-self: center;
  width: min(560px, 100%);
}

.mine-heading {
  margin: 0;
}

.mine-body {
  display: grid;
  width: min(560px, 100%);
  min-height: 0;
  justify-self: center;
  align-content: start;
  justify-items: center;
  gap: 28px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  /* Clear the mine fade overhang so the last controls stay readable. */
  padding-bottom: 128px;
  scroll-padding-bottom: 128px;
}

.lab-view {
  grid-template-rows: auto auto minmax(0, 1fr);
  align-content: stretch;
}

.lab-heading {
  margin: 0 0 4px;
}

.lab-view > .view-title {
  justify-self: stretch;
  width: 100%;
}

.lab-view > .zone-tabs {
  justify-self: center;
}

.lab-pane {
  display: grid;
  align-content: start;
  gap: 28px;
  width: 100%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  justify-items: stretch;
}

.lab-pane[hidden] {
  display: none;
}

.overseer-view {
  gap: 12px;
}

.overseer-view > .workshop-heading {
  margin: 0;
}

.overseer-view > .view-title {
  justify-self: stretch;
  width: 100%;
}

.overseer-view > .zone-tabs {
  justify-self: stretch;
  width: 100%;
  max-width: none;
}

#workshop-permits.lab-pane {
  gap: 12px;
}

#workshop-permits .research-header {
  margin: 0;
}

#workshop-permits .research-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

#workshop-permits .permit-block {
  display: grid;
  gap: 6px;
}

#workshop-permits .permit-block[hidden] {
  display: none;
}

#workshop-permits h3 {
  margin: 0;
}

#workshop-permits .button-grid {
  gap: 8px;
}

#workshop-permits .button-grid button {
  padding: 12px 14px;
}

#lab-research-slot > .research-view {
  display: grid;
  grid-row: auto;
  width: 100%;
  overflow: visible;
  gap: 16px;
}

.monument-list {
  display: grid;
  gap: 12px;
  width: 100%;
}

.monument-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px 14px;
  align-items: center;
  padding: 14px;
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

.monument-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.monument-card.is-locked {
  opacity: 0.55;
}

.monument-card h3 {
  margin: 0;
  font-size: 0.95rem;
}

.monument-need {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.monument-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: color-mix(in srgb, var(--panel-border) 70%, transparent);
}

.monument-bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.monument-card button {
  min-width: 7.5rem;
}

.monument-card button[data-monument-build] {
  touch-action: none;
}

.monument-figure {
  --monument: var(--accent);
  display: grid;
  justify-items: center;
  align-content: end;
  gap: 2px;
  width: 56px;
  height: 60px;
}

.monument-block {
  display: block;
  background: color-mix(in srgb, var(--monument) 78%, #1a1410);
  box-shadow:
    inset 2px 2px 0 color-mix(in srgb, var(--monument) 55%, #fff),
    inset -2px -2px 0 rgba(0, 0, 0, 0.28);
  opacity: 0.18;
}

.monument-figure.is-stage-1 .base,
.monument-figure.is-stage-2 .base,
.monument-figure.is-stage-2 .shaft,
.monument-figure.is-stage-3 .base,
.monument-figure.is-stage-3 .shaft,
.monument-figure.is-stage-3 .cap {
  opacity: 1;
}

.monument-block.base {
  width: 36px;
  height: 10px;
}

.monument-block.shaft {
  width: 16px;
  height: 28px;
}

.monument-block.cap {
  width: 24px;
  height: 10px;
}

/* Unique silhouettes — still three blocks: cap / shaft / base */
/* Rock: stepped podium with a round summit stone — not a tapering obelisk. */
.monument-figure.is-pinnacle-of-advancement {
  gap: 1px;
}
.monument-figure.is-pinnacle-of-advancement .base {
  width: 46px;
  height: 12px;
  border-radius: 1px;
}
.monument-figure.is-pinnacle-of-advancement .shaft {
  width: 28px;
  height: 16px;
  border-radius: 1px;
}
.monument-figure.is-pinnacle-of-advancement .cap {
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

.monument-figure.is-hall-of-clay .base {
  width: 44px;
  height: 8px;
  border-radius: 1px;
}
.monument-figure.is-hall-of-clay .shaft {
  width: 34px;
  height: 22px;
  border-radius: 1px 1px 0 0;
}
.monument-figure.is-hall-of-clay .cap {
  width: 42px;
  height: 10px;
  clip-path: polygon(0 100%, 100% 100%, 92% 0, 8% 0);
}

/* Flint: knapped blade on a short haft — wide flake, not a thin needle. */
.monument-figure.is-flint-spire .base {
  width: 14px;
  height: 8px;
  border-radius: 1px;
}
.monument-figure.is-flint-spire .shaft {
  width: 7px;
  height: 18px;
  border-radius: 1px;
}
.monument-figure.is-flint-spire .cap {
  width: 34px;
  height: 22px;
  clip-path: polygon(8% 70%, 0 40%, 28% 0, 72% 8%, 100% 48%, 78% 100%, 42% 92%, 22% 100%);
}

.monument-figure.is-gravel-cairn {
  gap: 1px;
}
.monument-figure.is-gravel-cairn .base {
  width: 40px;
  height: 12px;
  border-radius: 40% 40% 20% 20% / 50% 50% 30% 30%;
}
.monument-figure.is-gravel-cairn .shaft {
  width: 28px;
  height: 16px;
  border-radius: 45% 40% 35% 40%;
}
.monument-figure.is-gravel-cairn .cap {
  width: 16px;
  height: 12px;
  border-radius: 50% 45% 40% 50%;
}

.monument-figure.is-limestone-keep .base {
  width: 42px;
  height: 10px;
}
.monument-figure.is-limestone-keep .shaft {
  width: 28px;
  height: 24px;
}
.monument-figure.is-limestone-keep .cap {
  width: 34px;
  height: 10px;
  clip-path: polygon(0 100%, 100% 100%, 100% 35%, 88% 35%, 88% 0, 72% 0, 72% 35%, 58% 35%, 58% 0, 42% 0, 42% 35%, 28% 35%, 28% 0, 12% 0, 12% 35%, 0 35%);
}

.monument-figure.is-slate-obelisk .base {
  width: 24px;
  height: 6px;
  clip-path: polygon(10% 100%, 90% 100%, 100% 0, 0 0);
}
.monument-figure.is-slate-obelisk .shaft {
  width: 12px;
  height: 34px;
  clip-path: polygon(20% 100%, 80% 100%, 70% 0, 30% 0);
}
.monument-figure.is-slate-obelisk .cap {
  width: 10px;
  height: 12px;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.monument-figure.is-sandstone-terrace {
  gap: 1px;
}
.monument-figure.is-sandstone-terrace .base {
  width: 44px;
  height: 10px;
}
.monument-figure.is-sandstone-terrace .shaft {
  width: 32px;
  height: 14px;
}
.monument-figure.is-sandstone-terrace .cap {
  width: 20px;
  height: 14px;
}

.monument-figure.is-siltstone-gallery .base {
  width: 46px;
  height: 8px;
}
.monument-figure.is-siltstone-gallery .shaft {
  width: 40px;
  height: 18px;
  clip-path: polygon(0 100%, 100% 100%, 100% 0, 88% 0, 88% 55%, 72% 55%, 72% 0, 28% 0, 28% 55%, 12% 55%, 12% 0, 0 0);
}
.monument-figure.is-siltstone-gallery .cap {
  width: 46px;
  height: 8px;
}

.monument-figure.is-chert-pinnacle .base {
  width: 38px;
  height: 8px;
  clip-path: polygon(0 100%, 100% 100%, 80% 0, 20% 0);
}
.monument-figure.is-chert-pinnacle .shaft {
  width: 20px;
  height: 24px;
  clip-path: polygon(15% 100%, 85% 100%, 60% 0, 40% 0);
}
.monument-figure.is-chert-pinnacle .cap {
  width: 12px;
  height: 14px;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.monument-figure.is-granite-colossus .base {
  width: 46px;
  height: 12px;
}
.monument-figure.is-granite-colossus .shaft {
  width: 30px;
  height: 28px;
  border-radius: 2px 2px 0 0;
}
.monument-figure.is-granite-colossus .cap {
  width: 22px;
  height: 10px;
  border-radius: 2px 2px 0 0;
}

.monument-figure.is-marble-rotunda .base {
  width: 40px;
  height: 8px;
  border-radius: 2px;
}
.monument-figure.is-marble-rotunda .shaft {
  width: 22px;
  height: 22px;
  border-radius: 2px 2px 0 0;
  clip-path: polygon(0 100%, 22% 100%, 22% 0, 78% 0, 78% 100%, 100% 100%, 100% 0, 0 0);
}
.monument-figure.is-marble-rotunda .cap {
  width: 28px;
  height: 16px;
  border-radius: 50% 50% 8% 8% / 80% 80% 20% 20%;
}

.monument-figure.is-quartz-beacon .base {
  width: 26px;
  height: 8px;
}
.monument-figure.is-quartz-beacon .shaft {
  width: 10px;
  height: 30px;
}
.monument-figure.is-quartz-beacon .cap {
  width: 18px;
  height: 14px;
  border-radius: 50%;
  box-shadow:
    inset 2px 2px 0 color-mix(in srgb, var(--monument) 55%, #fff),
    inset -2px -2px 0 rgba(0, 0, 0, 0.28),
    0 0 8px color-mix(in srgb, var(--monument) 55%, transparent);
}

.monument-figure.is-snowbank-shelf .base {
  width: 44px;
  height: 10px;
  border-radius: 0 0 40% 40% / 0 0 60% 60%;
}
.monument-figure.is-snowbank-shelf .shaft {
  width: 36px;
  height: 12px;
  border-radius: 2px;
}
.monument-figure.is-snowbank-shelf .cap {
  width: 28px;
  height: 16px;
  border-radius: 60% 40% 20% 30% / 70% 50% 30% 40%;
}

.monument-figure.is-icepack-arcade .base {
  width: 42px;
  height: 8px;
}
.monument-figure.is-icepack-arcade .shaft {
  width: 36px;
  height: 24px;
  clip-path: polygon(0 100%, 18% 100%, 18% 45%, 50% 10%, 82% 45%, 82% 100%, 100% 100%, 100% 0, 0 0);
}
.monument-figure.is-icepack-arcade .cap {
  width: 42px;
  height: 8px;
  border-radius: 40% 40% 0 0 / 100% 100% 0 0;
}

.monument-figure.is-blue-ice-lantern .base {
  width: 18px;
  height: 6px;
}
.monument-figure.is-blue-ice-lantern .shaft {
  width: 6px;
  height: 22px;
}
.monument-figure.is-blue-ice-lantern .cap {
  width: 22px;
  height: 22px;
  border-radius: 40% 40% 35% 35% / 45% 45% 55% 55%;
  box-shadow:
    inset 2px 2px 0 color-mix(in srgb, var(--monument) 55%, #fff),
    inset -2px -2px 0 rgba(0, 0, 0, 0.28),
    0 0 10px color-mix(in srgb, var(--monument) 45%, transparent);
}

.monument-figure.is-bedrock-bastion .base {
  width: 46px;
  height: 12px;
}
.monument-figure.is-bedrock-bastion .shaft {
  width: 36px;
  height: 26px;
  clip-path: polygon(0 100%, 100% 100%, 100% 0, 78% 0, 78% 40%, 22% 40%, 22% 0, 0 0);
}
.monument-figure.is-bedrock-bastion .cap {
  width: 40px;
  height: 10px;
  clip-path: polygon(0 100%, 100% 100%, 100% 40%, 85% 40%, 85% 0, 70% 0, 70% 40%, 55% 40%, 55% 0, 45% 0, 45% 40%, 30% 40%, 30% 0, 15% 0, 15% 40%, 0 40%);
}

.monument-figure.is-basalt-ziggurat {
  gap: 1px;
}
.monument-figure.is-basalt-ziggurat .base {
  width: 44px;
  height: 12px;
}
.monument-figure.is-basalt-ziggurat .shaft {
  width: 30px;
  height: 14px;
}
.monument-figure.is-basalt-ziggurat .cap {
  width: 16px;
  height: 14px;
}

.monument-figure.is-obsidian-needle .base {
  width: 16px;
  height: 5px;
}
.monument-figure.is-obsidian-needle .shaft {
  width: 5px;
  height: 38px;
  transform: skewX(-6deg);
}
.monument-figure.is-obsidian-needle .cap {
  width: 10px;
  height: 12px;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  transform: skewX(-6deg);
}

.monument-figure.is-sulfur-crown .base {
  width: 28px;
  height: 8px;
}
.monument-figure.is-sulfur-crown .shaft {
  width: 20px;
  height: 18px;
}
.monument-figure.is-sulfur-crown .cap {
  width: 36px;
  height: 16px;
  clip-path: polygon(0 100%, 100% 100%, 100% 45%, 82% 0, 68% 55%, 50% 0, 32% 55%, 18% 0, 0 45%);
}

.monument-figure.is-olivine-garden .base {
  width: 38px;
  height: 8px;
  border-radius: 40%;
}
.monument-figure.is-olivine-garden .shaft {
  width: 14px;
  height: 24px;
  border-radius: 40% 40% 20% 20%;
}
.monument-figure.is-olivine-garden .cap {
  width: 28px;
  height: 18px;
  border-radius: 50% 45% 40% 50%;
}

/* Tektite: orbital antenna — hex pad, faceted mast, crystal tip. */
.monument-figure.is-tektite-spire .base {
  width: 34px;
  height: 8px;
  clip-path: polygon(12% 100%, 88% 100%, 100% 40%, 75% 0, 25% 0, 0 40%);
}
.monument-figure.is-tektite-spire .shaft {
  width: 12px;
  height: 30px;
  clip-path: polygon(0 100%, 100% 100%, 78% 55%, 100% 0, 0 0, 22% 55%);
}
.monument-figure.is-tektite-spire .cap {
  width: 18px;
  height: 16px;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  box-shadow:
    inset 2px 2px 0 color-mix(in srgb, var(--monument) 55%, #fff),
    inset -2px -2px 0 rgba(0, 0, 0, 0.28),
    0 0 10px color-mix(in srgb, var(--monument) 50%, transparent);
}

.monument-figure.is-stardust-vault .base {
  width: 42px;
  height: 8px;
}
.monument-figure.is-stardust-vault .shaft {
  width: 34px;
  height: 18px;
  clip-path: polygon(0 100%, 100% 100%, 100% 30%, 50% 0, 0 30%);
}
.monument-figure.is-stardust-vault .cap {
  width: 20px;
  height: 14px;
  clip-path: polygon(50% 0, 100% 55%, 70% 100%, 30% 100%, 0 55%);
  box-shadow:
    inset 2px 2px 0 color-mix(in srgb, var(--monument) 55%, #fff),
    inset -2px -2px 0 rgba(0, 0, 0, 0.28),
    0 0 8px color-mix(in srgb, var(--monument) 40%, transparent);
}

.monument-figure.is-iridium-monolith .base {
  width: 30px;
  height: 6px;
}
.monument-figure.is-iridium-monolith .shaft {
  width: 24px;
  height: 36px;
  border-radius: 1px;
}
.monument-figure.is-iridium-monolith .cap {
  width: 24px;
  height: 6px;
}

/* Manganese Reef: lumpy mound of nodules. */
.monument-figure.is-manganese-reef .base {
  width: 42px;
  height: 8px;
  border-radius: 40%;
}
.monument-figure.is-manganese-reef .shaft {
  width: 32px;
  height: 16px;
  border-radius: 50% 50% 20% 20%;
}
.monument-figure.is-manganese-reef .cap {
  width: 18px;
  height: 14px;
  border-radius: 50%;
}

/* Cobalt Lighthouse: tall tapered tower with a lamp room. */
.monument-figure.is-cobalt-lighthouse .base {
  width: 30px;
  height: 6px;
}
.monument-figure.is-cobalt-lighthouse .shaft {
  width: 20px;
  height: 34px;
  clip-path: polygon(15% 0, 85% 0, 100% 100%, 0 100%);
}
.monument-figure.is-cobalt-lighthouse .cap {
  width: 16px;
  height: 12px;
  clip-path: polygon(50% 0, 100% 40%, 100% 100%, 0 100%, 0 40%);
  box-shadow:
    inset 2px 2px 0 color-mix(in srgb, var(--monument) 55%, #fff),
    0 0 10px color-mix(in srgb, var(--monument) 50%, transparent);
}

/* Pearl Grotto: arched shell with a pearl on top. */
.monument-figure.is-pearl-grotto .base {
  width: 40px;
  height: 7px;
}
.monument-figure.is-pearl-grotto .shaft {
  width: 32px;
  height: 20px;
  border-radius: 50% 50% 4px 4px;
}
.monument-figure.is-pearl-grotto .cap {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow:
    inset 2px 2px 0 color-mix(in srgb, var(--monument) 45%, #fff),
    0 0 8px color-mix(in srgb, var(--monument) 45%, transparent);
}

.monument-figure.is-vault-of-stars .base {
  width: 36px;
  height: 8px;
  clip-path: polygon(8% 100%, 92% 100%, 100% 0, 0 0);
}
.monument-figure.is-vault-of-stars .shaft {
  width: 20px;
  height: 22px;
  clip-path: polygon(15% 100%, 85% 100%, 100% 0, 0 0);
}
.monument-figure.is-vault-of-stars .cap {
  width: 26px;
  height: 16px;
  clip-path: polygon(50% 0, 62% 35%, 100% 38%, 70% 62%, 80% 100%, 50% 78%, 20% 100%, 30% 62%, 0 38%, 38% 35%);
  box-shadow:
    inset 2px 2px 0 color-mix(in srgb, var(--monument) 55%, #fff),
    inset -2px -2px 0 rgba(0, 0, 0, 0.28),
    0 0 10px color-mix(in srgb, var(--monument) 50%, transparent);
}

.reliquary-card {
  grid-template-columns: minmax(0, 1fr) auto;
}

.time-view {
  height: 100%;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  align-content: stretch;
  gap: 16px;
  padding-bottom: 72px;
  overflow: hidden;
}

.time-stage {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 4px;
  min-height: 0;
  width: 100%;
  overflow: hidden;
}

.time-stage .view-title {
  position: relative;
  z-index: 1;
  justify-self: start;
  align-items: center;
}

.time-stage .view-title .info-button {
  margin-top: 0;
}

.time-viewport {
  width: 100%;
  height: 100%;
  min-height: 0;
  margin-bottom: 4px;
  overflow: hidden;
}

.time-viewport canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.gravity-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 12px;
  align-items: stretch;
  min-height: 280px;
}

.gravity-viewport {
  min-height: 260px;
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--bg) 82%, black);
  overflow: hidden;
}

/* Launch Pad: the rocket as built so far (drawn by js/ui/launchFx.js, like the launch itself). */
.rocket-art {
  height: 240px;
  margin: 0 0 12px;
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #0e142c;
}

.rocket-art canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.gravity-viewport canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.gravity-panel {
  min-width: 0;
}

.gravity-panel .monument-card {
  height: 100%;
}

@media (max-width: 720px) {
  .gravity-layout {
    grid-template-columns: 1fr;
  }

  .gravity-viewport {
    min-height: 200px;
  }
}

.time-warps {
  display: grid;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  min-height: 0;
}

.time-warps button {
  display: grid;
  align-content: center;
  justify-items: start;
  height: 100%;
  margin: 0;
  padding: 12px 16px;
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--button);
  color: var(--text);
  font: inherit;
  font-size: 1.05rem;
  text-align: left;
}

.time-warps button:hover:not(:disabled) {
  background: var(--button-hover);
}

.time-warps button:disabled {
  background: var(--disabled);
  color: var(--muted);
  cursor: not-allowed;
}

.time-warps button .detail {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.92rem;
}

.store-view {
  gap: 10px;
  padding-bottom: 72px;
}

.store-view .hint {
  margin: 0;
}

.store-offers {
  display: grid;
  gap: 18px;
  align-content: start;
}

.store-section {
  display: grid;
  gap: 10px;
  align-content: start;
}

.store-section-title {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.store-card {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--button);
}

.store-card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 12px;
  align-items: center;
}

.store-card-head strong {
  font-size: 1.05rem;
}

.store-card-title-help {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.store-card-title-help .info-button {
  margin-top: 0;
}

.store-card-head .detail {
  color: var(--muted);
  font-size: 0.92rem;
}

/* Gem packs: a little scene on the left, name / amount / value on the right, Buy below. */
.gem-pack-card {
  position: relative;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "art info"
    "actions actions";
  align-items: center;
  column-gap: 14px;
  overflow: hidden;
}

.gem-pack-card.is-best {
  border-color: var(--gems);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--gems) 35%, transparent), 0 0 18px color-mix(in srgb, var(--gems) 18%, transparent);
}

.gem-pack-art {
  grid-area: art;
  width: 120px;
  height: 80px;
  line-height: 0;
  border-radius: var(--radius-sm);
  background: radial-gradient(ellipse at 50% 70%, color-mix(in srgb, var(--gems) 16%, transparent), transparent 70%);
}

.gem-pack-art svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.gem-pack-info {
  grid-area: info;
  display: grid;
  gap: 2px;
  min-width: 0;
}

.gem-pack-name {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gem-pack-amount {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  color: var(--text);
  font-size: calc(1.1rem + var(--gem-tier, 0) * 0.12rem);
  line-height: 1.15;
}

.gem-pack-amount .resource-icon {
  color: var(--gems);
}

.gem-pack-value {
  justify-self: start;
  margin-top: 2px;
  padding: 1px 7px;
  border: 1px solid color-mix(in srgb, var(--gems) 60%, transparent);
  border-radius: 999px;
  color: var(--gems);
  font-size: 0.75rem;
  font-weight: 700;
}

.gem-pack-card .store-card-actions {
  grid-area: actions;
}

.gem-pack-ribbon {
  position: absolute;
  /* Centred 40px in and 34px down, so both ends of the text clear the card's edges. */
  top: 25px;
  right: -25px;
  width: 130px;
  padding: 3px 0;
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
  transform: rotate(45deg);
  background: var(--gems);
  color: #10302b;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

/* Bundles and gift shelf: the art beside the name and contents, Buy below. */
.store-card-art-left {
  grid-template-columns: auto minmax(0, 1fr);
  align-content: start;
  column-gap: 14px;
}

.store-card-art-left > :not(.bundle-art) {
  grid-column: 2;
}

.store-card-art-left > .store-card-actions {
  grid-column: 1 / -1;
}

.bundle-art {
  grid-area: 1 / 1 / span 3;
  align-self: center;
  width: 96px;
  height: 96px;
}

.bundle-art--shelf {
  grid-row-end: span 2;
  background: none;
}

.bundle-art--starter {
  background: radial-gradient(ellipse at 50% 60%, color-mix(in srgb, #c9a24a 24%, transparent), transparent 70%);
}

.bundle-art--rare {
  background: radial-gradient(ellipse at 50% 60%, color-mix(in srgb, #9a5ad0 32%, transparent), transparent 70%);
}

.gem-pack-art .gem-bob {
  animation: gem-bob 2.4s ease-in-out infinite;
}

.gem-pack-art .gem-twinkle {
  animation: gem-twinkle 2.2s ease-in-out infinite;
}

.gem-pack-art .gem-rays {
  animation: gem-rays 24s linear infinite;
}

@keyframes gem-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1.6px); }
}

@keyframes gem-twinkle {
  0%, 100% { opacity: 0; transform: scale(0.3) rotate(0deg); }
  45%, 55% { opacity: 1; transform: scale(1) rotate(45deg); }
}

@keyframes gem-rays {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .gem-pack-art .gem-bob,
  .gem-pack-art .gem-rays {
    animation: none;
  }

  .gem-pack-art .gem-twinkle {
    animation: none;
    opacity: 0.8;
  }
}

@media (max-width: 360px) {
  .gem-pack-art {
    width: 96px;
    height: 64px;
  }

  .bundle-art {
    width: 80px;
    height: 80px;
  }
}

.store-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.store-card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.store-card-actions button {
  margin: 0;
  min-height: 40px;
  padding: 8px 14px;
}

.store-billing-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.gift-open-screen {
  z-index: 46;
  overflow: hidden;
  isolation: isolate;
}

.gift-open-screen > :not(.gift-open-fx) {
  position: relative;
  z-index: 1;
}

.gift-open-fx {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.gift-open-screen.is-opening {
  animation: gift-open-backdrop 0.55s ease-out both;
}

.gift-open-screen.is-opening > :not(.gift-open-fx) {
  animation: gift-open-rise 0.5s cubic-bezier(0.2, 0.85, 0.25, 1) both;
}

.gift-open-screen.is-opening #gift-open-list {
  animation-delay: 0.08s;
}

.gift-open-screen.is-opening [data-gift-open-confirm] {
  animation-delay: 0.16s;
}

.gift-open-burst,
.gift-open-ring,
.gift-open-flare,
.gift-open-halo,
.gift-open-beam,
.gift-open-orbit,
.gift-open-key-flash {
  position: absolute;
  left: 50%;
  top: 42%;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.2);
  opacity: 0;
}

.gift-open-box {
  position: absolute;
  left: 50%;
  top: 42%;
  z-index: 2;
  width: min(34vw, 7.5rem);
  height: min(34vw, 7.5rem);
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: none;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.45));
}

.gift-open-box-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.gift-open-box-lid {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  transform: translate(1.5px, -7px) rotate(-22deg);
}

.gift-open-screen.is-opening .gift-open-box {
  animation: gift-open-box 0.75s cubic-bezier(0.2, 0.85, 0.25, 1) both;
}

.gift-open-screen.is-opening .gift-open-box-lid {
  animation: gift-open-lid 0.7s cubic-bezier(0.15, 0.9, 0.25, 1) 0.08s both;
}

.gift-open-burst {
  width: min(42vw, 16rem);
  height: min(42vw, 16rem);
  background: radial-gradient(circle, var(--gift-burst-core) 0%, transparent 70%);
}

.gift-open-ring {
  width: min(28vw, 11rem);
  height: min(28vw, 11rem);
  border: 2px solid var(--gift-burst-ring);
  box-shadow: 0 0 18px var(--gift-burst-glow);
}

.gift-open-flare {
  width: min(70vw, 26rem);
  height: min(70vw, 26rem);
  background: conic-gradient(
    from 20deg,
    transparent 0 12%,
    var(--gift-flare) 13% 15%,
    transparent 16% 37%,
    var(--gift-flare) 38% 40%,
    transparent 41% 62%,
    var(--gift-flare) 63% 65%,
    transparent 66% 87%,
    var(--gift-flare) 88% 90%,
    transparent 91% 100%
  );
  filter: blur(1px);
  mix-blend-mode: screen;
}

.gift-open-halo {
  width: min(54vw, 20rem);
  height: min(54vw, 20rem);
  border: 1px solid rgba(220, 250, 255, 0.55);
  box-shadow:
    0 0 24px rgba(140, 220, 255, 0.45),
    inset 0 0 30px rgba(180, 240, 255, 0.2);
}

.gift-open-beam {
  width: min(12vw, 4rem);
  height: min(90vw, 34rem);
  border-radius: 40%;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(200, 245, 255, 0.55) 42%,
    transparent 100%
  );
  filter: blur(1.5px);
  mix-blend-mode: screen;
}

.gift-open-beam.is-alt {
  width: min(10vw, 3.2rem);
  transform: translate(-50%, -50%) scale(0.2) rotate(28deg);
}

.gift-open-orbit {
  width: min(48vw, 18rem);
  height: min(48vw, 18rem);
  border: 1px dashed rgba(210, 245, 255, 0.55);
  box-shadow: 0 0 20px rgba(140, 220, 255, 0.35);
}

.gift-open-key-flash {
  width: min(28vw, 10rem);
  height: min(28vw, 10rem);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.85) 0%, transparent 68%);
  mix-blend-mode: screen;
}

.gift-open-spark {
  position: absolute;
  left: 50%;
  top: 42%;
  width: var(--s, 6px);
  height: var(--s, 6px);
  margin: calc(var(--s, 6px) / -2) 0 0 calc(var(--s, 6px) / -2);
  border-radius: 50%;
  background: var(--gift-spark);
  box-shadow: 0 0 8px var(--gift-spark-glow);
  opacity: 0;
  transform: rotate(var(--a, 0deg)) translateY(0) scale(0.4);
}

.gift-open-screen.is-opening .gift-open-burst {
  animation: gift-open-burst 0.7s ease-out both;
}

.gift-open-screen.is-opening .gift-open-ring {
  animation: gift-open-ring 0.75s ease-out both;
}

.gift-open-screen.is-opening .gift-open-flare {
  animation: gift-open-flare 0.85s ease-out both;
}

.gift-open-screen.is-opening .gift-open-halo {
  animation: gift-open-halo 0.95s ease-out both;
}

.gift-open-screen.is-opening .gift-open-beam {
  animation: gift-open-beam 1.15s ease-out both;
}

.gift-open-screen.is-opening .gift-open-beam.is-alt {
  animation-name: gift-open-beam-alt;
  animation-delay: 0.06s;
}

.gift-open-screen.is-opening .gift-open-orbit {
  animation: gift-open-orbit 1.25s cubic-bezier(0.15, 0.85, 0.25, 1) both;
}

.gift-open-screen.is-opening .gift-open-key-flash {
  animation: gift-open-key-flash 0.7s ease-out both;
}

.gift-open-screen.is-opening .gift-open-spark {
  animation: gift-open-spark 0.7s ease-out both;
  animation-delay: var(--delay, 0s);
}

.gift-open-screen.gift-rarity-common {
  --gift-burst-core: rgba(210, 180, 140, 0.28);
  --gift-burst-ring: rgba(200, 170, 130, 0.35);
  --gift-burst-glow: rgba(180, 150, 110, 0.2);
  --gift-spark: #e2c9a4;
  --gift-spark-glow: rgba(210, 180, 140, 0.55);
  --gift-flare: rgba(210, 180, 140, 0.2);
}

.gift-open-screen.gift-rarity-uncommon {
  --gift-burst-core: rgba(180, 210, 90, 0.32);
  --gift-burst-ring: rgba(190, 220, 100, 0.45);
  --gift-burst-glow: rgba(170, 210, 80, 0.28);
  --gift-spark: #d8f08a;
  --gift-spark-glow: rgba(200, 230, 100, 0.6);
  --gift-flare: rgba(180, 220, 90, 0.28);
}

.gift-open-screen.gift-rarity-rare {
  --gift-burst-core: rgba(110, 170, 255, 0.36);
  --gift-burst-ring: rgba(130, 190, 255, 0.55);
  --gift-burst-glow: rgba(100, 170, 255, 0.35);
  --gift-spark: #b6d8ff;
  --gift-spark-glow: rgba(120, 180, 255, 0.7);
  --gift-flare: rgba(120, 180, 255, 0.32);
}

.gift-open-screen.gift-rarity-epic {
  --gift-burst-core: rgba(200, 120, 255, 0.4);
  --gift-burst-ring: rgba(220, 150, 255, 0.6);
  --gift-burst-glow: rgba(180, 100, 240, 0.4);
  --gift-spark: #efc2ff;
  --gift-spark-glow: rgba(220, 150, 255, 0.75);
  --gift-flare: rgba(210, 130, 255, 0.38);
}

.gift-open-screen.gift-rarity-legendary {
  --gift-burst-core: rgba(160, 230, 255, 0.48);
  --gift-burst-ring: rgba(200, 245, 255, 0.75);
  --gift-burst-glow: rgba(140, 220, 255, 0.55);
  --gift-spark: #eaf9ff;
  --gift-spark-glow: rgba(180, 240, 255, 0.9);
  --gift-flare: rgba(170, 235, 255, 0.45);
}

.gift-open-screen.is-opening.gift-rarity-uncommon .gift-open-box {
  animation-name: gift-open-box-uncommon;
}

.gift-open-screen.is-opening.gift-rarity-rare .gift-open-box {
  animation-name: gift-open-box-rare;
}

.gift-open-screen.is-opening.gift-rarity-epic .gift-open-box {
  animation-name: gift-open-box-epic;
}

.gift-open-screen.is-opening.gift-rarity-legendary .gift-open-box {
  animation-name: gift-open-box-legendary;
}

.gift-open-screen.is-opening.gift-rarity-rare,
.gift-open-screen.is-opening.gift-rarity-epic,
.gift-open-screen.is-opening.gift-rarity-legendary {
  animation-name: gift-open-backdrop-rich;
}

.gift-open-screen .gift-reward.is-legendary.is-revealed:not(.is-special) > span {
  animation: gift-open-prize-pop 0.7s cubic-bezier(0.2, 0.9, 0.3, 1) 0.18s both;
}

.gift-open-screen.is-opening.gift-rarity-legendary > :not(.gift-open-fx) {
  animation-duration: 0.7s;
}

@keyframes gift-open-backdrop {
  from {
    background: rgba(8, 6, 4, 0.2);
  }
  to {
    background: rgba(8, 6, 4, 0.82);
  }
}

@keyframes gift-open-backdrop-rich {
  0% {
    background: rgba(8, 6, 4, 0.15);
  }
  35% {
    background: color-mix(in srgb, var(--gift-burst-core) 35%, rgba(8, 6, 4, 0.82));
  }
  100% {
    background: rgba(8, 6, 4, 0.82);
  }
}

@keyframes gift-open-rise {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes gift-open-box {
  0% {
    opacity: 0;
    transform: translate(-50%, -40%) scale(0.55);
  }
  28% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.08);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes gift-open-box-uncommon {
  0% {
    opacity: 0;
    transform: translate(-50%, -40%) scale(0.5);
  }
  30% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.16);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes gift-open-box-rare {
  0% {
    opacity: 0;
    transform: translate(-50%, -38%) scale(0.42);
  }
  32% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.28);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.04);
  }
}

@keyframes gift-open-box-epic {
  0% {
    opacity: 0;
    transform: translate(-50%, -36%) scale(0.34);
  }
  34% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.4);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.08);
  }
}

@keyframes gift-open-box-legendary {
  0% {
    opacity: 0;
    transform: translate(-50%, -32%) scale(0.22) rotate(-8deg);
  }
  22% {
    opacity: 1;
    transform: translate(-50%, -52%) scale(1.55) rotate(4deg);
  }
  48% {
    transform: translate(-50%, -48%) scale(0.92) rotate(-2deg);
  }
  72% {
    transform: translate(-50%, -50%) scale(1.22) rotate(1deg);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.12) rotate(0deg);
  }
}

@keyframes gift-open-beam {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.2) rotate(-12deg);
  }
  25% {
    opacity: 0.95;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.15) rotate(8deg);
  }
}

@keyframes gift-open-beam-alt {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.15) rotate(32deg);
  }
  30% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.2) rotate(18deg);
  }
}

@keyframes gift-open-orbit {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.35) rotate(0deg);
  }
  35% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.55) rotate(140deg);
  }
}

@keyframes gift-open-key-flash {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.2);
  }
  18% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.8);
  }
}

@keyframes gift-open-lid {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  100% {
    transform: translate(1.5px, -7px) rotate(-22deg);
  }
}

@keyframes gift-open-burst {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.15);
  }
  35% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.35);
  }
}

@keyframes gift-open-ring {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.2);
  }
  30% {
    opacity: 0.95;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.55);
  }
}

@keyframes gift-open-flare {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.3) rotate(0deg);
  }
  25% {
    opacity: 0.85;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.2) rotate(28deg);
  }
}

@keyframes gift-open-halo {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.4) rotate(-8deg);
  }
  40% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.45) rotate(12deg);
  }
}

@keyframes gift-open-spark {
  0% {
    opacity: 0;
    transform: rotate(var(--a, 0deg)) translateY(0) scale(0.3);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: rotate(var(--a, 0deg)) translateY(calc(var(--d, 40%) * -1)) scale(1);
  }
}

@keyframes gift-open-prize-pop {
  0% {
    transform: scale(0.85);
    filter: brightness(1);
  }
  55% {
    transform: scale(1.08);
    filter: brightness(1.25);
  }
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .gift-open-screen.is-opening,
  .gift-open-screen.is-opening > :not(.gift-open-fx),
  .gift-open-screen.is-opening .gift-open-burst,
  .gift-open-screen.is-opening .gift-open-ring,
  .gift-open-screen.is-opening .gift-open-flare,
  .gift-open-screen.is-opening .gift-open-halo,
  .gift-open-screen.is-opening .gift-open-beam,
  .gift-open-screen.is-opening .gift-open-orbit,
  .gift-open-screen.is-opening .gift-open-key-flash,
  .gift-open-screen.is-opening .gift-open-spark,
  .gift-open-screen .gift-reward.is-legendary.is-revealed:not(.is-special) > span {
    animation: none !important;
  }
}

.purchase-screen {
  z-index: 34;
}

.item-detail-screen {
  z-index: 35;
}

.item-detail-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(20rem, 100%);
  padding: 22px 20px 18px;
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04);
  text-align: center;
}

.item-detail-icon {
  display: grid;
  place-items: center;
  width: 4.5rem;
  height: 4.5rem;
  border: 2px solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--button);
}

.item-detail-icon .consumable-icon,
.item-detail-icon .consumable-icon--detail {
  width: 2.8rem;
  height: 2.8rem;
}

.item-detail-screen #item-detail-title {
  margin: 0;
  font-size: clamp(1.15rem, 3.8vw, 1.45rem);
  letter-spacing: 0.04em;
}

.item-detail-rarity {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.item-detail-desc {
  margin: 0;
  max-width: 18rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.item-detail-count {
  margin: 0;
  color: var(--text);
  font-size: 0.85rem;
}

.item-detail-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.item-detail-icon.rarity-common,
.items-drawer-slot.rarity-common,
.info-list .rarity-common > span,
.item-detail-rarity.rarity-common {
  border-color: #b8976a;
  color: #d7c4a8;
}

.item-detail-icon.rarity-uncommon,
.items-drawer-slot.rarity-uncommon,
.info-list .rarity-uncommon > span,
.item-detail-rarity.rarity-uncommon {
  border-color: #8fb84a;
  color: #c8e070;
}

.item-detail-icon.rarity-rare,
.items-drawer-slot.rarity-rare,
.info-list .rarity-rare > span,
.item-detail-rarity.rarity-rare {
  border-color: #5a9de8;
  color: #9ec8ff;
}

.item-detail-icon.rarity-epic,
.items-drawer-slot.rarity-epic,
.info-list .rarity-epic > span,
.item-detail-rarity.rarity-epic {
  border-color: #b46ae8;
  color: #e0b4ff;
}

.item-detail-icon.rarity-legendary,
.items-drawer-slot.rarity-legendary,
.info-list .rarity-legendary > span,
.item-detail-rarity.rarity-legendary {
  border-color: #7ed7f0;
  color: #c8f4ff;
}

.purchase-screen .purchase-name {
  margin: 0;
  color: var(--accent);
  font-size: clamp(1.2rem, 4vw, 1.7rem);
  letter-spacing: 0.06em;
  text-align: center;
}

.purchase-screen .purchase-detail {
  margin: 0;
  max-width: 22rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.45;
  text-align: center;
}

.shard-detail-screen {
  z-index: 34;
}

.shard-detail-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: min(20rem, 100%);
  padding: 22px 20px 18px;
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04);
  overflow: visible;
}

.shard-detail-card.is-gild-fanfare {
  animation: shard-gild-pulse 0.5s ease-out;
}

.shard-gild-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 3rem;
  height: 3rem;
  border: 3px solid #e0b84a;
  border-radius: 50%;
  box-shadow:
    0 0 0 1px rgba(249, 224, 120, 0.55),
    0 0 18px rgba(224, 184, 74, 0.55);
  pointer-events: none;
  animation: shard-gild-ring 0.5s ease-out forwards;
}

@keyframes shard-gild-pulse {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes shard-gild-ring {
  0% {
    opacity: 0.95;
    transform: translate(-50%, -50%) scale(0.35);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(4.2);
  }
}

.shard-detail-screen.is-gilded .shard-detail-card {
  border-color: #e0b84a;
  box-shadow:
    0 0 0 1px #c9a227,
    0 0 24px rgba(224, 184, 74, 0.22);
  background: linear-gradient(165deg, rgba(224, 184, 74, 0.14), rgba(42, 33, 24, 0.96) 55%);
}

.shard-detail-screen.is-diamondized .shard-detail-card {
  border-color: #9fdfff;
  box-shadow:
    0 0 0 1px rgba(120, 200, 255, 0.55),
    0 0 24px rgba(120, 200, 255, 0.22);
  background: linear-gradient(165deg, rgba(180, 230, 255, 0.16), rgba(42, 33, 24, 0.96) 55%);
}

.shard-detail-icon .resource-icon {
  width: 42px;
  height: 42px;
}

.shard-detail-screen h1 {
  margin: 0;
  font-size: clamp(1.25rem, 4vw, 1.7rem);
  letter-spacing: 0.04em;
  text-align: center;
}

.shard-detail-count {
  margin: 0;
  color: var(--accent);
  font-size: clamp(1.35rem, 4.5vw, 1.9rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  text-align: center;
}

.shard-detail-screen.is-gilded .shard-detail-count {
  color: #f0d24a;
}

.shard-detail-screen.is-diamondized .shard-detail-count {
  color: #9fdfff;
}

.shard-detail-card .shard-bar {
  width: 100%;
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.shard-detail-card .shard-bar span {
  display: block;
  height: 100%;
  background: #e0b84a;
}

.shard-detail-card .shard-bar.is-diamond span {
  background: linear-gradient(90deg, #7ec8ef, #dff4ff);
}

.shard-detail-bonus {
  margin: 0;
  white-space: pre-line;
  max-width: 18rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.45;
  text-align: center;
}

.shard-detail-actions {
  display: flex;
  width: 100%;
  justify-content: center;
}

.shard-detail-actions:empty {
  display: none;
}

.shard-detail-actions .shard-gild-button {
  min-width: 7rem;
  padding: 8px 12px;
  font-size: 0.85rem;
}

/* GILD: the gilded card in ten pieces slams onto the plain one. */
.shard-detail-card.is-gild-assembling {
  visibility: hidden;
}

.shard-gild-layer {
  position: absolute;
  top: calc(-1 * var(--border-w));
  left: calc(-1 * var(--border-w));
  z-index: 3;
  visibility: visible;
  pointer-events: none;
}

.shard-gild-layer .shard-detail-card {
  position: absolute;
  inset: 0 auto auto 0;
  box-sizing: border-box;
  max-width: none;
  margin: 0;
}

.shard-gild-layer .shard-gild-base {
  position: relative;
}

.shard-gild-piece {
  position: absolute;
  inset: 0;
  will-change: transform, opacity;
  filter: drop-shadow(0 0 1.5px #fff3b0) drop-shadow(0 0 6px rgba(224, 184, 74, 0.6));
}

.shard-gild-layer.is-diamond .shard-gild-piece {
  filter: drop-shadow(0 0 1.5px #ffffff) drop-shadow(0 0 6px rgba(140, 215, 255, 0.65));
}

.shard-gild-piece.is-landed {
  filter: drop-shadow(0 0 1px rgba(255, 243, 176, 0.8));
}

.shard-gild-layer.is-diamond .shard-gild-piece.is-landed {
  filter: drop-shadow(0 0 1px rgba(220, 245, 255, 0.85));
}

/* The pieces are solid gold (or diamond), whatever the screen's tone is right now. */
.shard-detail-screen .shard-gild-layer.is-gold .shard-gild-piece .shard-detail-card {
  border-color: #e0b84a;
  box-shadow: 0 0 0 1px #c9a227;
  background: linear-gradient(165deg, #6b5420, #2e2418 55%);
}

.shard-detail-screen .shard-gild-layer.is-diamond .shard-gild-piece .shard-detail-card {
  border-color: #9fdfff;
  box-shadow: 0 0 0 1px rgba(120, 200, 255, 0.55);
  background: linear-gradient(165deg, #3f5c6e, #2a2620 55%);
}

.shard-detail-screen .shard-gild-layer.is-gold .shard-gild-piece .shard-detail-count {
  color: #f0d24a;
}

.shard-detail-screen .shard-gild-layer.is-diamond .shard-gild-piece .shard-detail-count {
  color: #9fdfff;
}

.shard-gild-piece .is-gild-spacer {
  visibility: hidden;
}

/* The new bonus stays hidden until the card is whole. */
.shard-gild-piece .shard-detail-bonus {
  visibility: hidden;
}

.shard-gild-layer.is-assembled .shard-gild-piece {
  filter: brightness(1.9) drop-shadow(0 0 10px rgba(255, 230, 140, 0.9));
  transition: filter 0.15s ease-out;
}

.shard-gild-layer.is-diamond.is-assembled .shard-gild-piece {
  filter: brightness(1.7) drop-shadow(0 0 10px rgba(170, 230, 255, 0.95));
}

/* Back glow once it's whole: a burst, then a soft breathing glow while the card stays open. */
.shard-gild-glow {
  position: absolute;
  inset: -30%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 214, 102, 0.7), rgba(224, 184, 74, 0.25) 55%, transparent 75%);
  pointer-events: none;
  animation:
    shard-gild-glow-in 0.6s ease-out both,
    shard-gild-glow-breathe 2.4s ease-in-out 0.6s infinite;
}

.shard-detail-screen.is-diamondized .shard-gild-glow {
  background: radial-gradient(closest-side, rgba(170, 230, 255, 0.7), rgba(120, 200, 255, 0.25) 55%, transparent 75%);
}

.shard-detail-card.is-gild-reveal {
  animation: shard-gild-land 0.45s ease-out;
}

.shard-detail-card.is-gild-reveal .shard-detail-bonus {
  color: #f6dc7a;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(240, 200, 90, 0.55);
  animation: shard-gild-bonus-in 0.6s cubic-bezier(0.2, 1.6, 0.4, 1) 0.1s both;
}

.shard-detail-screen.is-diamondized .shard-detail-card.is-gild-reveal .shard-detail-bonus {
  color: #c4ecff;
  text-shadow: 0 0 10px rgba(140, 215, 255, 0.6);
}

@keyframes shard-gild-glow-in {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  40% {
    opacity: 1;
    transform: scale(1.15);
  }
  100% {
    opacity: 0.85;
    transform: scale(1);
  }
}

@keyframes shard-gild-glow-breathe {
  0%,
  100% {
    opacity: 0.85;
    transform: scale(1);
  }
  50% {
    opacity: 0.55;
    transform: scale(0.94);
  }
}

/* Box-shadow only: a transform or filter here would pull the back glow in front of the card. */
@keyframes shard-gild-land {
  0% {
    box-shadow:
      0 0 0 3px #fff3b0,
      0 0 40px rgba(255, 220, 120, 0.9);
  }
}

@keyframes shard-gild-bonus-in {
  0% {
    opacity: 0;
    transform: scale(0.4);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .shard-gild-glow {
    animation: none;
    opacity: 0.8;
  }

  .shard-detail-card.is-gild-reveal,
  .shard-detail-card.is-gild-reveal .shard-detail-bonus {
    animation: none;
  }
}

.gift-drawer {
  position: absolute;
  top: calc(50% + 48px);
  left: 0;
  z-index: 9;
  transform: translateY(-50%);
  pointer-events: none;
}

.items-drawer {
  position: absolute;
  top: calc(50% + 196px);
  left: 0;
  z-index: 9;
  transform: translateY(-50%);
  pointer-events: none;
}

.items-drawer[hidden] {
  display: none;
}

.items-drawer-panel {
  display: flex;
  align-items: center;
  transform: translateX(0);
  transition: transform 0.28s ease;
  pointer-events: auto;
}

.items-drawer.is-closed .items-drawer-panel {
  transform: translateX(calc(-100% + 20px));
}

.items-drawer-body {
  display: grid;
  gap: 8px;
  width: auto;
  padding: 10px 8px 10px 10px;
  overflow: visible;
  border: var(--border-w) solid var(--panel-border);
  border-left: 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--sidebar);
  box-shadow: 4px 0 16px rgba(0, 0, 0, 0.28);
}

.items-drawer-count {
  display: none;
}

.items-drawer-list {
  display: grid;
  grid-template-columns: repeat(4, 36px);
  gap: 6px;
}

.items-drawer-slot {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 2px solid var(--panel-border);
  border-radius: var(--radius-sm);
  background: var(--button);
  color: var(--text);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.items-drawer-slot.is-empty {
  opacity: 0.45;
  cursor: default;
}

.items-drawer-slot.is-active {
  box-shadow: 0 0 0 1px var(--accent), 0 0 10px color-mix(in srgb, var(--accent) 45%, transparent);
}

.items-drawer-slot-mark {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  line-height: 1;
}

.items-drawer-slot-mark .consumable-icon {
  display: block;
  width: 22px;
  height: 22px;
}

.consumable-icon--inline {
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.2em;
  margin-right: 0.3em;
}

.items-drawer-slot-count {
  position: absolute;
  left: 2px;
  bottom: 1px;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
  pointer-events: none;
}

.items-drawer-slot.is-empty .items-drawer-slot-count {
  color: var(--muted);
}

.items-drawer-buffs {
  display: grid;
  gap: 4px;
  max-width: calc(4 * 36px + 3 * 6px);
}

.items-drawer-buff {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.25;
}

.items-drawer-buff strong {
  color: var(--text);
  font-weight: 600;
}

.items-drawer-tab {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  align-self: center;
  width: 20px;
  height: 34px;
  margin: 0 0 0 -1px;
  padding: 0;
  border: var(--border-w) solid var(--panel-border);
  border-left: 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--panel);
  color: var(--accent);
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 3px 0 12px rgba(0, 0, 0, 0.28);
}

.items-drawer-tab-mark {
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
}

.items-drawer-tab-mark svg {
  display: block;
  width: 14px;
  height: 14px;
}

.items-drawer.has-items .items-drawer-tab-mark {
  animation: gift-drawer-jiggle 2.6s ease-in-out infinite;
}

.gift-drawer[hidden] {
  display: none;
}

.gift-drawer-panel {
  display: flex;
  align-items: center;
  transform: translateX(0);
  transition: transform 0.28s ease;
  pointer-events: auto;
}

.gift-drawer.is-closed .gift-drawer-panel {
  transform: translateX(calc(-100% + 20px));
}

.gift-drawer-body {
  display: grid;
  justify-items: center;
  gap: 8px;
  width: 92px;
  padding: 12px 10px 12px 12px;
  border: var(--border-w) solid var(--panel-border);
  border-left: 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--sidebar);
  box-shadow: 4px 0 16px rgba(0, 0, 0, 0.28);
}

.gift-drawer-present {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
}

.gift-drawer-icon {
  display: block;
  width: 44px;
  height: 44px;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35));
}

.gift-drawer-count {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-align: center;
  line-height: 1.2;
}

.gift-drawer-body button {
  margin: 0;
  min-height: 34px;
  padding: 6px 12px;
  font-size: 0.85rem;
}

/* Regular and golden boxes each get a slot; a slot hides when it is empty. */
.gift-drawer-slot {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.gift-drawer-slot[hidden] {
  display: none;
}

.gift-drawer-slot + .gift-drawer-slot:not([hidden]) {
  padding-top: 10px;
  border-top: 1px solid var(--panel-border);
}

#gift-drawer-slot[hidden] + .gift-drawer-slot {
  padding-top: 0;
  border-top: 0;
}

.gift-drawer-slot.is-golden .gift-drawer-count {
  color: #ffd75a;
}

.gift-drawer-slot.is-golden .gift-drawer-icon {
  filter:
    drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35))
    drop-shadow(0 0 6px rgba(170, 100, 230, 0.55));
}

.gift-drawer-slot.is-golden button:not(:disabled) {
  background: #5a2a8a;
  border-color: #f2c94c;
  color: #ffe58a;
}

.gift-drawer-tab {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  align-self: center;
  width: 20px;
  height: 34px;
  margin: 0 0 0 -1px;
  padding: 0;
  border: var(--border-w) solid var(--panel-border);
  border-left: 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--panel);
  color: var(--accent);
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 3px 0 12px rgba(0, 0, 0, 0.28);
}

.gift-drawer-tab-mark {
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  transform-origin: 50% 60%;
}

.gift-drawer-tab-mark svg {
  display: block;
  width: 14px;
  height: 14px;
}

.gift-drawer.has-gifts .gift-drawer-tab-mark {
  animation: gift-drawer-jiggle 2.6s ease-in-out infinite;
}

@keyframes gift-drawer-jiggle {
  0%,
  68%,
  100% {
    transform: rotate(0deg) translateX(0);
  }
  72% {
    transform: rotate(-10deg) translateX(-1px);
  }
  76% {
    transform: rotate(9deg) translateX(1px);
  }
  80% {
    transform: rotate(-7deg) translateX(-1px);
  }
  84% {
    transform: rotate(5deg) translateX(1px);
  }
  88% {
    transform: rotate(-2deg);
  }
  92% {
    transform: rotate(0deg);
  }
}

.pets-view {
  width: min(720px, 100%);
  align-content: start;
  gap: 8px;
}

.pets-view h2 {
  margin: 0;
}

.pets-view .hint {
  margin: 0;
}

.pets-slot-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pets-slot-tabs[hidden] {
  display: none;
}

.pets-slot-tab {
  margin: 0;
  min-height: 34px;
  padding: 6px 12px;
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius-sm);
  background: var(--button);
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.pets-slot-tab.is-selected {
  background: var(--button-hover);
  color: var(--text);
  border-color: var(--accent);
}

.pets-actions {
  display: grid;
  justify-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 4px;
}

.pets-actions .hint {
  text-align: center;
}

/* Pets buttons reuse .button-grid styling (theme tokens + chrome packs); just size them here. */
.pets-actions.button-grid button {
  width: min(100%, 22rem);
  margin: 0;
  padding: 12px 16px;
  text-align: center;
}

.pets-actions.button-grid button.danger-button {
  color: color-mix(in srgb, var(--danger) 35%, var(--text));
}

.pets-actions.button-grid button.danger-button .detail {
  color: var(--muted);
}

.pets-feed-go.button-grid {
  display: block;
}

.pets-feed .pets-feed-go button {
  width: auto;
  min-width: 7.5rem;
  min-height: 40px;
  margin: 0;
  padding: 8px 18px;
  text-align: center;
}

.pet-viewport.is-empty {
  opacity: 0.35;
}

.pets-stage {
  display: grid;
  grid-template-columns: minmax(7rem, 10rem) minmax(0, 1fr);
  gap: 16px;
  width: 100%;
  align-items: start;
}

.pets-stage:has(.pets-stats[hidden]) {
  grid-template-columns: 1fr;
}

.pets-stats {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 10px;
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--panel);
}

.pets-stats h3 {
  margin: 0 0 4px;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.pets-stats p {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  font-size: 0.82rem;
}

.pets-center {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 8px;
}

.pet-viewport {
  width: min(280px, 70vw);
  height: 220px;
}

.pet-viewport.is-hatched {
  cursor: pointer;
}

.pet-heart {
  position: fixed;
  z-index: 42;
  margin: -10px 0 0 -8px;
  color: #e45c7a;
  font-size: 1.35rem;
  line-height: 1;
  pointer-events: none;
  opacity: 1;
  transform: translate(0, 0) scale(1);
  transition: transform 0.62s ease-out, opacity 0.62s ease-out;
  text-shadow: 0 1px 0 #7a2438;
}

.pet-viewport canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.pets-timer {
  margin: 0;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.pets-feed {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.pets-feed[hidden],
.pets-xp[hidden],
.pets-stats[hidden] {
  display: none;
}

.pets-feed label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.pets-feed select,
.pets-feed button {
  min-width: 7.5rem;
}

.pets-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 10px;
  width: 100%;
}

.pets-name[hidden] {
  display: none;
}

.pets-name-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  min-height: 34px;
  padding: 4px 10px;
  border: var(--border-w) solid transparent;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  font: inherit;
  font-size: 1.05rem;
  cursor: pointer;
}

.pets-name-button:hover,
.pets-name-button:focus-visible {
  border-color: var(--panel-border);
}

.pets-name-pen {
  color: var(--muted);
  font-size: 0.85rem;
}

.pets-mood {
  padding: 2px 8px;
  border: var(--border-w) solid var(--mood, var(--panel-border));
  border-radius: var(--radius-sm);
  color: var(--mood, var(--muted));
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pets-rename {
  display: flex;
  gap: 6px;
}

.pets-rename input {
  width: 11rem;
  min-height: 34px;
  padding: 4px 8px;
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.pets-rename button {
  margin: 0;
  min-height: 34px;
  padding: 4px 12px;
}

.pets-stats p {
  border-left: 3px solid var(--stat, transparent);
  padding-left: 6px;
}

.pets-stat-name {
  color: var(--stat, inherit);
}

.pet-food-picker {
  position: relative;
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.pets-feed .pet-food-current {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 10.5rem;
  margin: 0;
  min-height: 40px;
  padding: 6px 10px 6px 12px;
  position: relative;
  overflow: hidden;
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--control-shadow);
  font: inherit;
  font-size: 0.9rem;
  text-align: left;
  touch-action: manipulation;
}

/* Same dark panel as the open list so the tinted food name stays vivid. */
.pets-feed .pet-food-current:hover:not(:disabled),
.pets-feed .pet-food-current[aria-expanded="true"] {
  background: color-mix(in srgb, var(--button-hover) 55%, var(--panel));
}

.pets-feed .pet-food-current:disabled {
  background: var(--disabled);
  color: var(--muted);
  cursor: not-allowed;
}

.pet-food-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pet-food-caret {
  margin-left: auto;
  color: var(--muted);
}

/* Food name tinted with a blend of the stat colors it feeds (no explicit stat hints). */
.pet-food-ink {
  flex: 0 1 auto;
  color: var(--food-color, var(--text));
  font-weight: 700;
  /* Dark edge keeps the pale stat colors readable on light buttons too. */
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.6)) drop-shadow(0 0 1px rgba(0, 0, 0, 0.5));
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .pet-food-ink[style*="--food-ink"] {
    background-image: var(--food-ink, none);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
}

.pet-food-list {
  position: absolute;
  z-index: 30;
  bottom: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  max-height: min(18rem, 50vh);
  overflow-y: auto;
  margin: 0;
  padding: 4px;
  list-style: none;
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}

.pet-food-list[hidden] {
  display: none;
}

.pets-feed .pet-food-option {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  min-height: 36px;
  margin: 0;
  padding: 4px 8px 4px 12px;
  position: relative;
  overflow: hidden;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  text-align: left;
  touch-action: manipulation;
}

.pets-feed .pet-food-option:hover,
.pets-feed .pet-food-option[aria-selected="true"] {
  background: var(--button-hover);
}

.pets-feed button {
  touch-action: none;
}

.pets-xp {
  width: 100%;
  display: grid;
  gap: 6px;
}

.pets-xp-bar {
  height: 12px;
  overflow: hidden;
  border-radius: 99px;
  background: color-mix(in srgb, var(--panel-border) 70%, transparent);
}

.pets-xp-bar > span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
}

.pets-xp p {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}

.research-view,
.overseer-view,
.lab-view,
.processor-view,
.monuments-view,
.reliquary-view,
.pets-view,
.descension-view,
.stats-view,
.achievements-view,
.settings-view {
  justify-items: stretch;
}

.resource-icon {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -0.15em;
  flex-shrink: 0;
  overflow: visible;
}

.resource-icon--card {
  width: 1.05rem;
  height: 1.05rem;
}

.resource-icon--processor {
  width: 1.7rem;
  height: 1.7rem;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35));
}

.resource-icon--inline {
  width: 0.95em;
  height: 0.95em;
}

.resource-icon--pop {
  width: 0.85rem;
  height: 0.85rem;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.55));
}

.resource-icon--haul {
  width: 100%;
  height: 100%;
}

.cost-resource {
  display: inline-flex;
  align-items: center;
  gap: 0.22em;
  white-space: nowrap;
}

.cost-resource.is-ready,
.button-grid button .detail .cost-resource.is-ready,
.button-grid button:disabled .detail .cost-resource.is-ready,
.hire-button .detail .cost-resource.is-ready {
  color: #6fbf73;
}

.settings-groups {
  display: grid;
  gap: 20px;
  width: 100%;
}

.settings-group h3,
.settings-view .settings-group h3 {
  margin: 0 0 8px;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.settings-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  width: 100%;
}

.settings-field {
  display: grid;
  gap: 6px;
  flex: 1 1 8.6rem;
  min-width: 8.6rem;
}

.settings-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--text);
  font-size: 0.95rem;
  cursor: pointer;
  user-select: none;
}

.settings-check input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
}

.settings-check-nested {
  flex: 1 1 100%;
  margin: 0 0 2px 1.35rem;
  font-size: 0.9rem;
}

.settings-hint {
  flex: 1 1 100%;
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.settings-field span {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.settings-field select {
  width: 100%;
  min-height: 36px;
  padding: 6px 8px;
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius-sm);
  background: var(--button);
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
}

.descension-board {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.18);
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.descension-board.is-dragging {
  cursor: grabbing;
}

.descension-world {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
}

.descension-lines {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  pointer-events: none;
  overflow: visible;
}

.descension-lines line {
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  opacity: 0.85;
}

.descension-lines line.is-link {
  stroke-width: 4;
  stroke-dasharray: 2 8;
  opacity: 1;
}

.descension-stars {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.descension-major-star {
  position: absolute;
  display: grid;
  place-items: center;
  color: #d4a017;
  line-height: 1;
  text-shadow: 0 1px 0 #4a3208;
}

.descension-grid {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.descension-marks {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.descension-mark {
  position: absolute;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  opacity: 0.5;
  pointer-events: auto;
  cursor: pointer;
}

.descension-mark svg {
  width: 62%;
  height: 62%;
}

.descension-mark[data-descension-grid="gems"] {
  color: var(--gems);
}

.descension-mark[data-descension-grid="science"] {
  color: var(--science);
}

.descension-mark[data-descension-grid="miners"] {
  color: var(--accent);
}

.descension-mark[data-descension-grid="sites"] {
  color: var(--complete);
}

.descension-board.is-zoomed-out .descension-node {
  min-height: 0;
  padding: 0;
  pointer-events: none;
  box-shadow: none;
}

.descension-board.is-zoomed-out .descension-name,
.descension-board.is-zoomed-out .descension-detail,
.descension-board.is-zoomed-out .descension-cost {
  display: none;
}

.descension-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 0 28px 6px rgba(0, 0, 0, 0.55);
}

.descension-vignette .edge {
  position: absolute;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.descension-vignette .edge-left,
.descension-vignette .edge-right {
  top: 0;
  bottom: 0;
  width: 56px;
}

.descension-vignette .edge-top,
.descension-vignette .edge-bottom {
  left: 0;
  right: 0;
  height: 56px;
}

.descension-vignette .edge-left {
  left: 0;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.75), transparent);
}

.descension-vignette .edge-right {
  right: 0;
  background: linear-gradient(to left, rgba(0, 0, 0, 0.75), transparent);
}

.descension-vignette .edge-top {
  top: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), transparent);
}

.descension-vignette .edge-bottom {
  bottom: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75), transparent);
}

.descension-board.more-left .edge-left,
.descension-board.more-right .edge-right,
.descension-board.more-top .edge-top,
.descension-board.more-bottom .edge-bottom {
  opacity: 1;
}

.descension-node[data-theme="gems"] {
  --theme: var(--gems);
}

.descension-node[data-theme="science"] {
  --theme: var(--science);
}

.descension-node[data-theme="miners"] {
  --theme: var(--accent);
}

.descension-node[data-theme="major"] {
  --theme: #c9a227;
}

.descension-node[data-theme="sites"] {
  --theme: var(--complete);
}

.descension-node[data-theme]:not(.is-bought) {
  border-top: 3px solid var(--theme);
}

.descension-node {
  position: absolute;
  overflow: hidden;
  display: grid;
  align-content: safe center;
  justify-items: center;
  gap: 2px;
  min-height: 0;
  padding: 6px 4px;
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  text-align: center;
  cursor: pointer;
}

.descension-node:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.descension-node:disabled {
  opacity: 1;
  cursor: default;
}

.descension-node.is-ready {
  border-color: var(--gems);
  box-shadow: 0 0 0 1px var(--gems), 0 0 14px rgba(127, 208, 195, 0.35);
}

.descension-node.is-ready .descension-cost {
  color: var(--gems);
}

.descension-node.is-ready:hover:not(:disabled) {
  border-color: var(--gems);
  color: var(--gems);
}

.descension-node.is-major {
  border-radius: var(--radius-lg);
  box-shadow: inset 0 0 0 1px rgba(201, 162, 39, 0.35);
}

.descension-node.is-bought {
  color: #1a120c;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: none;
  cursor: default;
}

.descension-name {
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.15;
}

.descension-detail,
.descension-cost {
  font-size: 0.64rem;
  line-height: 1.2;
  color: var(--muted);
}

.descension-node.is-bought .descension-detail,
.descension-node.is-bought .descension-cost {
  color: #6a3a16;
}

.descension-cost:empty {
  display: none;
}

/* Repeatable perk with some (not all) levels owned */
.descension-node.is-partial {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--accent) 22%, var(--button)),
    var(--button)
  );
  border-color: color-mix(in srgb, var(--accent) 70%, var(--panel-border));
}

.descension-level {
  display: inline-block;
  margin-left: 0.25em;
  padding: 0 0.3em;
  border-radius: 3px;
  font-size: 0.85em;
  letter-spacing: 0;
  color: var(--accent);
  background: rgba(0, 0, 0, 0.35);
}

/* Repeatable perk held back until its next site has been seen */
.descension-node.is-capped {
  border-style: dashed;
}

.descension-node.is-capped .descension-level {
  color: var(--muted);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent);
}

.descension-locked {
  color: var(--muted);
  font-style: italic;
}

.descension-node.is-bought .descension-level {
  color: #1a120c;
  background: rgba(255, 255, 255, 0.35);
}

.stats-view {
  grid-template-rows: auto auto auto minmax(0, 1fr);
  align-content: stretch;
  overflow: hidden;
}

.stats-view > h2,
.stats-view > .hint {
  margin: 0;
}

.stats-view > .zone-tabs {
  width: 100%;
}

.stats-panel {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

/* ---------- Trophy room (Stats): a shareable showcase, compact enough for one screenshot ---------- */
.trophy-room {
  --tr-wall: #1d1612;
  --tr-wood: #5a3a22;
  --tr-wood-dark: #2e1d12;
  --tr-gold: #e6be55;
  position: relative;
  display: grid;
  gap: 8px;
  width: 100%;
  max-width: 420px;
  min-height: max-content;
  margin: 0 auto;
  padding: 10px 10px 8px;
  border: 2px solid color-mix(in srgb, var(--tr-gold) 55%, transparent);
  border-radius: 12px;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(255, 214, 120, 0.22), transparent 60%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 2px, transparent 2px 22px),
    linear-gradient(180deg, #2a1f18, var(--tr-wall) 55%, #140f0c);
  box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.35), 0 6px 18px rgba(0, 0, 0, 0.35);
  color: #f2e6cf;
  overflow: hidden;
}

.tr-header {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 4px;
  text-align: center;
}

.tr-brand {
  color: color-mix(in srgb, var(--tr-gold) 80%, #fff);
  font-family: var(--font-title);
  font-size: 0.45rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  opacity: 0.8;
}

.trophy-room .tr-title {
  margin: 0;
  padding: 5px 12px 4px;
  border: 2px solid #8a6512;
  border-radius: 5px;
  background: linear-gradient(180deg, #ffe28a, #d4a23a 55%, #9a7016);
  color: #3a2608;
  font-family: var(--font-title);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-shadow: none;
  text-transform: uppercase;
  box-shadow: 0 2px 0 #5a3e0a, 0 0 16px rgba(255, 200, 90, 0.35);
}

/* Full-screen toggle: a small corner button, hidden in the full-screen view. */
.trophy-room .tr-expand {
  position: absolute;
  top: -2px;
  right: -2px;
  display: grid;
  place-items: center;
  width: 28px;
  min-width: 0;
  height: 28px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--tr-gold) 45%, transparent);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--tr-gold);
  cursor: pointer;
}

.trophy-room .tr-expand svg {
  width: 14px;
  height: 14px;
}

.tr-fullscreen .tr-expand {
  display: none;
}


.tr-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 12px calc(env(safe-area-inset-bottom, 0px) + 12px);
  background: radial-gradient(ellipse at 50% 30%, #2a1f18, #0b0806 75%);
  overflow: hidden;
}

.tr-fullscreen[hidden] {
  display: none;
}

.tr-fit {
  width: 380px;
}

.tr-fullscreen .trophy-room {
  max-width: none;
}

.tr-fullscreen .tr-close {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 8px);
  right: 8px;
  z-index: 1;
  width: 34px;
  min-width: 0;
  height: 34px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(230, 190, 85, 0.5);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #e6be55;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

/* The 3D Trophy Room. */
.trophy-room.is-3d {
  max-width: 560px;
  padding: 8px;
}

.tr3d-slot {
  position: relative;
  /* Short enough that the card at its bottom stays on a phone screen. */
  height: min(55vh, 520px);
  min-height: 280px;
  border-radius: 8px;
  overflow: hidden;
}

.tr3d {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #120d0a;
}

.tr3d-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}

.tr3d-canvas:active {
  cursor: grabbing;
}

.tr3d-hint {
  position: absolute;
  top: 8px;
  left: 50%;
  z-index: 1;
  margin: 0;
  padding: 4px 10px;
  transform: translateX(-50%);
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.55);
  color: #f2e6cf;
  font-size: 0.75rem;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

.tr3d-hint.is-gone {
  opacity: 0;
}

.tr3d-empty {
  position: absolute;
  inset: auto 16px 50% 16px;
  z-index: 1;
  margin: 0;
  color: #d8c8a8;
  font-size: 0.95rem;
  text-align: center;
  text-shadow: 0 1px 3px #000;
  pointer-events: none;
}

.tr3d-card {
  position: absolute;
  right: 10px;
  bottom: 10px;
  left: 10px;
  z-index: 2;
  padding: 10px 40px 10px 14px;
  border: 1px solid rgba(230, 190, 85, 0.55);
  border-radius: 10px;
  background: rgba(24, 17, 12, 0.92);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  color: #f2e6cf;
  animation: tr3d-card-in 0.22s ease-out;
}

.tr3d-card[hidden] {
  display: none;
}

.tr3d-card-title {
  margin: 0 0 4px;
  color: #e6be55;
  font-size: 1rem;
  letter-spacing: 0.03em;
}

.tr3d-card-text {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.4;
}

.tr3d-card-lines {
  display: grid;
  gap: 2px;
  margin: 6px 0 0;
  padding: 0;
  color: #d8c8a8;
  font-size: 0.8rem;
  list-style: none;
}

.tr3d-card .tr3d-card-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  min-width: 0;
  height: 28px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(230, 190, 85, 0.45);
  border-radius: 50%;
  background: transparent;
  color: #e6be55;
  font-size: 1rem;
  line-height: 1;
}

.tr3d.is-failed .tr3d-hint {
  display: none;
}

@keyframes tr3d-card-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

/* Full screen: the room fills the screen. */
.tr-fullscreen .tr-fit {
  width: 100%;
  height: 100%;
}

.tr-fullscreen .trophy-room.is-3d {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: none;
}

.tr-fullscreen .tr3d-slot {
  flex: 1;
  height: auto;
}

@media (prefers-reduced-motion: reduce) {
  .tr3d-card {
    animation: none;
  }
}

.stats-list {
  display: grid;
  gap: 8px;
  margin: 0 0 8px;
}

.stats-list div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 10px 12px;
  border: var(--border-w) solid var(--panel-border);
  background: var(--button);
}

.stats-list dt {
  color: var(--muted);
}

.stats-list .is-locked dt,
.stats-list .is-locked dd {
  color: var(--muted);
  letter-spacing: 0.04em;
}

.stats-list dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.achievements-panel {
  display: grid;
  gap: 6px;
}

.achievement-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 4px 8px;
  border: var(--border-w) solid var(--panel-border);
  background: var(--button);
  border-radius: var(--radius-sm);
}

.achievement-copy {
  min-width: 0;
}

.achievement-name {
  margin: 0;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.achievement-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.3;
}

.achievement-card .achievement-bonus {
  margin-top: 4px;
  color: var(--complete);
  font-weight: 650;
}

/* Earned, reward waiting: copy | kind icon | Claim */
.achievement-card.is-claimable {
  grid-template-columns: minmax(0, 1fr) auto auto;
  border-color: color-mix(in srgb, var(--accent) 65%, var(--panel-border));
}

.achievement-claim {
  margin: 0;
  min-height: 34px;
  padding: 6px 12px;
  font-size: 0.8rem;
  border-color: var(--accent);
  color: var(--accent);
}

/* Achievements view tab: dot while rewards wait */
#view-tabs [data-view="achievements"],
#view-tabs [data-view="shards"] {
  position: relative;
}

#view-tabs [data-view="achievements"].has-claims::after,
#view-tabs [data-view="shards"].has-claims::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}

.achievement-card.is-unearned {
  border-style: dashed;
  background: transparent;
  opacity: 0.6;
}

.achievement-card.is-unearned .achievement-name {
  color: var(--muted);
}

.achievement-card.is-unearned .achievement-bonus {
  color: var(--muted);
  font-weight: 400;
}

.achievement-kind {
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  color: var(--accent);
}

.achievement-kind-icon {
  display: block;
  width: 1.35rem;
  height: 1.35rem;
}

.achievement-kind-icon.is-miner {
  transform: rotate(-38deg);
}

.achievement-kind-icon.is-gem {
  color: #3d8fd4;
}

.achievement-kind-icon.is-trophy {
  color: #d4a017;
}

.achievement-kind-icon.is-science {
  color: #3d8fd4;
}

.achievement-kind-icon.is-implosion {
  color: #d45c4c;
}

.achievement-kind-icon.is-key {
  color: #c4893a;
}

.achievement-kind-icon.is-key-silver {
  color: #9aa3ad;
}

.achievement-kind-icon.is-key-gold {
  color: #d4a017;
}

.achievement-tag {
  margin-left: 8px;
  padding: 1px 6px;
  border: var(--border-w) solid var(--panel-border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  vertical-align: middle;
}

.stats-list dd.rock {
  color: var(--rock);
}

.stats-list dd.clay {
  color: var(--clay);
}

.stats-list dd.flint {
  color: var(--flint);
}

.stats-list dd.gravel {
  color: var(--gravel);
}

.stats-list dd.limestone {
  color: var(--limestone);
}

.stats-list dd.slate {
  color: var(--slate);
}

.stats-list dd.granite {
  color: var(--granite);
}

.stats-list dd.marble {
  color: var(--marble);
}

.stats-list dd.quartz {
  color: var(--quartz);
}

.stats-list dd.bedrock {
  color: var(--bedrock);
}

.stats-list dd.basalt {
  color: var(--basalt);
}

.stats-list dd.obsidian {
  color: var(--obsidian);
}

.stats-list dd.sulfur {
  color: var(--sulfur);
}

.stats-list dd.olivine {
  color: var(--olivine);
}

.stats-list dd.gems {
  color: var(--gems);
}

.stats-list dd.science {
  color: var(--science);
}

.research-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.research-header h2 {
  margin-bottom: 0;
}

.research-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  cursor: pointer;
  user-select: none;
}

.research-filter[hidden] {
  display: none !important;
}

.research-filter input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
}

.empty-research {
  margin: 0;
  padding: 18px 16px;
  background: var(--panel);
  border: 1px dashed var(--panel-border);
  border-radius: var(--radius);
  color: var(--muted);
}

.research-sections {
  display: grid;
  gap: 22px;
  width: 100%;
}

.research-section-title {
  margin: 0 0 10px;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.research-section-grid {
  margin: 0;
}

.button-grid button.is-run-reset-path {
  border-color: color-mix(in srgb, var(--warn) 48%, var(--panel-border));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 22%, transparent);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--warn) 10%, var(--button)),
    var(--button)
  );
}

.button-grid button.is-run-reset {
  border: 2px solid color-mix(in srgb, var(--danger) 82%, #8a2018);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--danger) 45%, transparent),
    0 0 10px color-mix(in srgb, var(--danger) 28%, transparent);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--danger) 28%, var(--button)),
    color-mix(in srgb, var(--danger) 10%, var(--button))
  );
}

.button-grid button.is-avoid-magma {
  border: 2px solid #c62828;
  color: var(--text);
}

.button-grid button.is-avoid-magma.is-armed,
.button-grid button.is-avoid-magma.is-locked {
  background: #c62828;
  border-color: #c62828;
  color: #fff7f5;
}

.button-grid button.is-avoid-magma.is-armed .detail,
.button-grid button.is-avoid-magma.is-locked .detail,
.button-grid button.is-avoid-magma.is-locked .research-status {
  color: rgba(255, 247, 245, 0.88);
}

.button-grid button.is-avoid-magma:disabled {
  cursor: default;
  opacity: 1;
}

.zone-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  width: min(560px, 100%);
  gap: 8px;
  padding: 2px 0 4px;
  background: transparent;
  border: 0;
}

/* Mine zones: one scrolling strip; the edges fade while more zones lie that way. */
@property --zone-fade-l {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

@property --zone-fade-r {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

#zone-tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--zone-fade-l), #000 calc(100% - var(--zone-fade-r)), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 var(--zone-fade-l), #000 calc(100% - var(--zone-fade-r)), transparent 100%);
  transition: --zone-fade-l 0.18s ease, --zone-fade-r 0.18s ease;
}

#zone-tabs::-webkit-scrollbar {
  display: none;
}

#zone-tabs.has-more-left {
  --zone-fade-l: 36px;
}

#zone-tabs.has-more-right {
  --zone-fade-r: 36px;
}

#zone-tabs .zone-tab {
  flex: 0 0 auto;
  white-space: nowrap;
}

.zone-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 1 auto;
  width: auto;
  padding: 7px 13px;
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--muted);
  font: inherit;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-align: center;
  text-transform: uppercase;
  cursor: pointer;
}

.zone-empty {
  display: inline-grid;
  place-items: center;
  width: 0.78rem;
  height: 0.78rem;
  margin-left: 6px;
  color: #d45c4c;
  vertical-align: -0.12em;
}

.zone-empty svg {
  display: block;
  width: 100%;
  height: 100%;
}

.zone-tab[aria-selected="true"] .zone-empty {
  color: #8a1f16;
}

/* Red "!" on a zone tab while magma has mining paused there. */
.zone-alert {
  display: inline-block;
  margin-left: 5px;
  color: #e0483a;
  font-weight: 700;
  font-size: 1.15em;
  line-height: 1;
  vertical-align: -0.05em;
}

.zone-tab[aria-selected="true"] .zone-alert {
  color: #b3170c;
}

.zone-tab:hover:not([aria-selected="true"]):not(.is-selected) {
  color: var(--text);
  border-color: var(--panel-border);
  background: var(--button-hover);
}

.zone-tab[aria-selected="true"],
.zone-tab.is-selected {
  color: #1a120c;
  background: var(--chrome-accent, var(--accent));
  border-color: var(--chrome-accent, var(--accent));
}

.zone-tab.depleted {
  color: var(--muted);
}

.zone-panel {
  width: min(560px, 100%);
}

.zone-header,
.view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.view-header-actions {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.view-title {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.view-title h2,
.view-title .mine-heading,
.view-title .workshop-heading,
.view-title .lab-heading {
  margin: 0;
}

.zone-header h2,
.view-header h2 {
  margin: 0 0 4px;
}

.view-header .view-title h2 {
  margin: 0 0 4px;
}

.info-button {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-top: 2px;
  padding: 0;
  border: var(--border-w) solid var(--panel-border);
  border-radius: 50%;
  background: var(--button);
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1;
}

.info-button svg {
  width: 14px;
  height: 14px;
}

.info-button:hover,
.info-button[aria-expanded="true"] {
  color: var(--text);
  border-color: var(--accent);
  background: var(--button-hover);
}

.deposit-viewport {
  width: 100%;
  height: var(--deposit-viewport-h, 148px);
  overflow: visible;
  background: var(--bg);
  position: relative;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  z-index: 4;
}

.deposit-viewport:focus {
  outline: none;
}

.deposit-viewport:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

.mine-hint {
  margin: 0;
  color: var(--accent);
}

.deposit-viewport canvas {
  position: absolute;
  left: 0;
  /* Leave the mine-body scrollbar / gutter uncovered. */
  right: 14px;
  bottom: 10px;
  display: block;
  width: auto;
  height: var(--deposit-canvas-h, 220px);
  pointer-events: none;
  touch-action: none;
}

.gem-hit {
  position: absolute;
  z-index: 2;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  transform: translate(-50%, -50%);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.workshop-gift {
  width: min(28rem, 100%);
  margin: 0 0 4px;
  padding-bottom: 10px;
}

.workshop-gift[hidden] {
  display: none !important;
}

.workshop-gift-wait {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.gift-shelves {
  display: flex;
  justify-content: flex-start;
  gap: 2px;
  margin-top: 6px;
}

/* Up to ten across the panel; a few shelves stay a comfortable size. */
.gift-shelf {
  display: grid;
  grid-template-rows: 48px auto;
  flex: 1 1 0;
  min-width: 0;
  max-width: 56px;
}

.gift-shelf-gift {
  display: grid;
  align-items: end;
  justify-items: center;
  grid-row: 1;
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  animation: gift-shelf-drop 0.35s ease-out both;
}

.gift-shelf-gift[hidden] {
  display: none;
}

.gift-shelf-gift svg {
  display: block;
  width: min(100%, 42px);
  /* The box's base is at 21 of 24: sit it on the plank. */
  margin-bottom: calc(min(100%, 42px) * -0.125);
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.45));
}

.gift-shelf-gift .gift-shelf-rare,
.gift-shelf-gift.is-rare .gift-shelf-plain {
  display: none;
}

.gift-shelf-gift.is-rare .gift-shelf-rare {
  display: block;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.45)) drop-shadow(0 0 5px rgba(186, 120, 255, 0.75));
  animation: gift-shelf-rare-glow 2.4s ease-in-out infinite;
}

@keyframes gift-shelf-rare-glow {
  50% {
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.45)) drop-shadow(0 0 9px rgba(242, 201, 76, 0.8));
  }
}

.gift-shelf-gift:hover svg {
  filter: drop-shadow(0 0 4px rgba(242, 201, 76, 0.7));
}

.gift-shelf-board {
  grid-row: 2;
  position: relative;
  height: 8px;
  border: 1px solid #3e2a18;
  border-radius: 2px;
  background: linear-gradient(180deg, #b58250 0 25%, #8f6238 25% 100%);
}

.gift-shelf-board::before,
.gift-shelf-board::after {
  content: "";
  position: absolute;
  top: 100%;
  width: 7px;
  height: 9px;
  background: #5f4128;
}

.gift-shelf-board::before {
  left: 12%;
  clip-path: polygon(0 0, 100% 0, 0 100%);
}

.gift-shelf-board::after {
  right: 12%;
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}

@keyframes gift-shelf-drop {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .gift-shelf-gift,
  .gift-shelf-gift.is-rare .gift-shelf-rare {
    animation: none;
  }
}

.lab-gift-hit {
  position: absolute;
  z-index: 3;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, rgba(255, 236, 180, 0.35), transparent 68%);
  cursor: pointer;
  pointer-events: auto;
  transform: translate(-50%, -50%);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  animation: lab-gift-pop 0.55s ease-out both, lab-gift-bob 1.8s ease-in-out 0.55s infinite;
}

.lab-gift-hit-mark {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45));
}

.lab-gift-hit-mark svg {
  display: block;
  width: 28px;
  height: 28px;
}

@keyframes lab-gift-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -35%) scale(0.35);
  }
  70% {
    opacity: 1;
    transform: translate(-50%, -54%) scale(1.12);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes lab-gift-bob {
  0%,
  100% {
    transform: translate(-50%, -50%);
  }
  50% {
    transform: translate(-50%, -62%);
  }
}

.gift-fly {
  position: fixed;
  z-index: 45;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  pointer-events: none;
  opacity: 1;
  transform: translate(0, 0) scale(1) rotate(0deg);
  transition: transform 0.65s cubic-bezier(0.2, 0.75, 0.2, 1), opacity 0.65s ease-in;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.4));
}

.gift-fly svg {
  display: block;
  width: 100%;
  height: 100%;
}

.ground-gem {
  position: absolute;
  bottom: 30px;
  width: 16px;
  height: 24px;
  padding: 0;
  border: 0;
  background: linear-gradient(135deg, #d7fff6, var(--gems) 42%, #2f6f66);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  transform: scale(var(--gem-scale, 1));
  cursor: pointer;
  pointer-events: auto;
}

.ground-trophy {
  width: 18px;
  height: 22px;
  background: linear-gradient(180deg, #f4e08a, #c48a24);
  clip-path: none;
  border-radius: 3px 3px 2px 2px;
}

.ground-shard {
  width: 22px;
  height: 30px;
  background: linear-gradient(135deg, #fff8e0, #e8c34a 40%, #8a6a20);
  animation: shard-glimmer 1.6s ease-in-out infinite;
}

.ground-diamond-shard {
  background: linear-gradient(135deg, #f4fbff, #9fdfff 42%, #3a6a88);
}

@keyframes shard-glimmer {
  0%,
  100% {
    filter: brightness(1) drop-shadow(0 0 0 transparent);
  }
  45% {
    filter: brightness(1.35) drop-shadow(0 0 4px rgba(255, 248, 220, 0.85));
  }
}

@media (prefers-reduced-motion: reduce) {
  .ground-shard {
    animation: none;
  }
}

.deposit-fallback {
  display: grid;
  grid-template-columns: repeat(20, minmax(0, 1fr));
  align-content: end;
  gap: 3px;
  height: 100%;
  padding: 8px 10px 10px;
  border-top: 1px solid var(--panel-border);
}

.deposit-fallback span {
  position: relative;
  aspect-ratio: 1;
  height: auto;
  border-radius: 2px;
  background: var(--rock);
}

.deposit-fallback span.vein::after {
  content: "";
  position: absolute;
  width: 28%;
  height: 28%;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  background: #3d9eff;
  box-shadow: 0 0 6px #5eb6ff;
  transform: translate(-50%, -50%);
}

.zone-panel.zone-parking-lot .deposit-fallback span {
  background: var(--gravel);
}

.zone-panel.zone-canyon .deposit-fallback span {
  background: var(--sandstone);
}

.zone-panel.zone-quarry .deposit-fallback span {
  background: var(--granite);
}

.zone-panel.zone-pit .deposit-fallback span {
  background: var(--bedrock);
}

.deposit-fallback span[hidden] {
  display: none;
}

.button-grid {
  display: grid;
  gap: 12px;
}

.button-grid[hidden] {
  display: none;
}

button {
  font: inherit;
  cursor: pointer;
}

.button-grid button {
  width: 100%;
  padding: 16px 18px;
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--button);
  color: var(--text);
  box-shadow: var(--control-shadow);
  font-size: 1.05rem;
  text-align: left;
}

.button-grid button:hover:not(:disabled) {
  background: var(--button-hover);
}

.button-grid button.danger-button {
  border-color: var(--danger);
}

.button-grid button.danger-button:hover:not(:disabled) {
  background: #4a2a24;
}

.button-grid button:active:not(:disabled) {
  transform: translateY(1px);
}

.button-grid button:disabled,
.button-grid button[aria-disabled="true"] {
  background: var(--disabled);
  color: var(--muted);
  cursor: not-allowed;
}

.button-grid button.is-affordable:not(:disabled):not([aria-disabled="true"]),
.hire-button.is-affordable:not(:disabled):not([aria-disabled="true"]),
#crew-hire button.is-affordable:not(:disabled) {
  border-color: color-mix(in srgb, #6fbf73 55%, var(--panel-border));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #6fbf73 28%, transparent), var(--control-shadow);
}

/* Keep reset-path / reset tints after completion (disabled otherwise greys them out). */
.button-grid button.is-run-reset-path:disabled {
  border-color: color-mix(in srgb, var(--warn) 48%, var(--panel-border));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 22%, transparent);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--warn) 10%, var(--button)),
    var(--button)
  );
  color: var(--text);
}

.button-grid button.is-run-reset:disabled {
  border: 2px solid color-mix(in srgb, var(--danger) 82%, #8a2018);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--danger) 45%, transparent),
    0 0 10px color-mix(in srgb, var(--danger) 28%, transparent);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--danger) 28%, var(--button)),
    color-mix(in srgb, var(--danger) 10%, var(--button))
  );
  color: var(--text);
}

.button-grid button .detail {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.92rem;
}

.settings-button-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.discord-icon {
  width: 1.15em;
  height: 1.15em;
  flex: 0 0 auto;
  color: #5865f2;
}

.button-grid button.discord-button:hover:not(:disabled) .discord-icon {
  color: #7289da;
}

.button-grid button .research-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.button-grid button .research-status {
  flex: 0 0 auto;
  color: var(--complete);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.14em;
}

.button-grid button:disabled .research-status {
  color: var(--complete);
}

.news-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0 10px;
  flex: 0 0 auto;
}

.news-log h2 {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.news-clear {
  margin: 0;
  padding: 2px 8px;
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.news-clear:hover {
  color: var(--text);
  border-color: var(--accent);
}

.news-log.is-closed .news-clear {
  visibility: hidden;
  pointer-events: none;
}

.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.news-list li {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 12px;
  font-size: 0.92rem;
  line-height: 1.4;
}

.news-list time {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.news-list li:not(:first-child) {
  opacity: 0.55;
}

/* Ten shards in hand: ready to gild. */
.news-list li.news-ready span {
  color: var(--ready);
}

.news-list li.news-warn span {
  color: var(--warn);
}

.news-list li.news-depleted span {
  color: var(--danger);
}

.info-screen {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 24px;
  background: rgba(8, 6, 4, 0.72);
}

.info-screen[hidden] {
  display: none;
}

.info-card {
  display: grid;
  gap: 16px;
  width: min(22rem, 100%);
  padding: 22px 20px 18px;
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

.info-card h2 {
  margin: 0;
  color: var(--accent);
  font-size: 1.05rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
}

.info-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
  text-align: center;
}

.info-note[hidden] {
  display: none;
}

.info-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.info-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  color: var(--text);
}

.info-list .name {
  color: var(--drop-color, var(--text));
}

.info-list .value {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.info-list .empty {
  justify-content: center;
  color: var(--muted);
}

.info-list li.is-bonus {
  font-size: 0.92rem;
}

.info-list li.is-bonus .value {
  color: var(--drop-color, var(--magma-chunk));
}

.stats-list dd.planet-core {
  color: var(--planet-core);
}

.info-card button {
  min-height: 44px;
  padding: 12px 24px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--button);
  color: var(--text);
  font-size: 1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.info-card button:hover {
  background: var(--button-hover);
  color: var(--accent);
}

.away-screen {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 18px;
  padding: 24px;
  background: rgba(8, 6, 4, 0.82);
}

.away-screen[hidden] {
  display: none;
}

.away-screen h1 {
  margin: 0;
  color: var(--accent);
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
}

.away-screen p {
  margin: 0;
  max-width: 22rem;
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1.45;
  text-align: center;
}

.away-gains {
  width: min(16rem, 100%);
  max-height: min(40vh, 16rem);
  margin: 0;
  padding: 8px 10px;
  overflow: auto;
  scrollbar-gutter: stable;
  list-style: none;
  display: grid;
  gap: 3px;
  border-radius: var(--radius-sm);
  background: rgba(8, 6, 4, 0.72);
  font-size: 0.75rem;
  line-height: 1.3;
}

.away-gains[hidden] {
  display: none;
}

.away-gains li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.catchup-gains {
  max-height: min(50vh, 22rem);
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
}

.catchup-gains li span:last-child {
  color: var(--text);
}

.away-screen button {
  min-height: 44px;
  padding: 12px 36px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--button);
  color: var(--text);
  font-size: 1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.away-screen button:hover {
  background: #534032;
  color: var(--accent);
}

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

.notify-prompt-screen {
  z-index: 41;
}

.notify-prompt-screen [data-notify-prompt-skip] {
  border-color: var(--muted);
  background: transparent;
  color: var(--muted);
}

.notify-prompt-screen [data-notify-prompt-skip]:hover {
  border-color: var(--text);
  background: transparent;
  color: var(--text);
}

.reset-confirm-screen button.danger-button {
  border-color: var(--danger);
}

.reset-confirm-screen button.danger-button:hover {
  background: #4a2a24;
  color: var(--text);
}

.feedback-screen {
  z-index: 41;
}

.feedback-field {
  display: grid;
  width: min(28rem, 100%);
}

.feedback-field textarea {
  width: 100%;
  min-height: 10rem;
  padding: 12px 14px;
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  line-height: 1.4;
  resize: vertical;
}

.feedback-field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.feedback-status {
  max-width: 22rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.pets-gift-screen {
  z-index: 32;
}

.pets-gift-list {
  list-style: none;
  margin: 0;
  padding: 12px 16px;
  min-width: min(18rem, 80vw);
  display: grid;
  gap: 8px;
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--panel);
}

.pets-gift-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
}

.gift-open-screen .gift-reward {
  justify-content: center;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.gift-open-screen .gift-reward span {
  display: inline-block;
}

.gift-open-screen .gift-reward .consumable-icon {
  display: inline-block;
  width: 1.2em;
  height: 1.2em;
  vertical-align: -0.2em;
  margin-right: 0.35em;
  flex: 0 0 auto;
}

.gift-open-screen .gift-reward.is-common {
  color: #d7c4a8;
  text-shadow: 0 0 8px rgba(180, 150, 110, 0.25);
}

.gift-open-screen .gift-reward.is-uncommon {
  color: #e8f0c8;
  background: rgba(120, 140, 60, 0.12);
  box-shadow: inset 0 0 12px rgba(180, 210, 90, 0.12);
  text-shadow: 0 0 10px rgba(200, 230, 100, 0.35);
}

.gift-open-screen .gift-reward.is-rare {
  color: #cfe4ff;
  background: rgba(70, 120, 200, 0.14);
  box-shadow: inset 0 0 14px rgba(110, 170, 255, 0.16);
  text-shadow: 0 0 12px rgba(120, 180, 255, 0.45);
}

.gift-open-screen .gift-reward.is-epic {
  color: #f3d4ff;
  background: rgba(140, 70, 180, 0.16);
  box-shadow:
    inset 0 0 16px rgba(200, 120, 255, 0.18),
    0 0 14px rgba(160, 80, 220, 0.2);
  text-shadow: 0 0 14px rgba(220, 150, 255, 0.55);
  animation: gift-reward-pulse 1.8s ease-in-out infinite;
}

.gift-open-screen .gift-reward.is-legendary {
  color: #e8f7ff;
  background: linear-gradient(160deg, rgba(140, 220, 255, 0.2), rgba(40, 80, 120, 0.18));
  box-shadow:
    inset 0 0 18px rgba(160, 230, 255, 0.28),
    0 0 18px rgba(120, 210, 255, 0.35);
  text-shadow:
    0 0 8px rgba(220, 250, 255, 0.9),
    0 0 18px rgba(120, 210, 255, 0.7);
  animation: gift-reward-shine 1.4s ease-in-out infinite;
}

@keyframes gift-reward-pulse {
  0%,
  100% {
    box-shadow:
      inset 0 0 16px rgba(200, 120, 255, 0.18),
      0 0 10px rgba(160, 80, 220, 0.16);
  }
  50% {
    box-shadow:
      inset 0 0 20px rgba(200, 120, 255, 0.28),
      0 0 18px rgba(160, 80, 220, 0.32);
  }
}

@keyframes gift-reward-shine {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.12);
  }
}

/* ---- Gift open: one-by-one prize reveal ---- */
.gift-open-screen .gift-reward {
  transition:
    opacity 0.32s ease-out,
    transform 0.38s cubic-bezier(0.2, 0.9, 0.3, 1.25);
}

.gift-open-screen .gift-reward.is-pending {
  opacity: 0;
  transform: translateY(8px) scale(0.92);
}

.gift-open-screen .gift-reward.is-revealed {
  opacity: 1;
  transform: none;
}

/* ---- Gift open: shard / key rows get the big treatment ---- */
.gift-open-screen .gift-reward.is-special {
  --special: #9fe3ff;
  --special-glow: rgba(120, 210, 255, 0.55);
  position: relative;
  overflow: hidden;
  padding: 12px 14px;
  font-size: 1.2rem;
  font-weight: 700;
  border: 2px solid color-mix(in srgb, var(--special) 70%, transparent);
  box-shadow:
    inset 0 0 18px color-mix(in srgb, var(--special) 30%, transparent),
    0 0 16px var(--special-glow);
}

.gift-open-screen .gift-reward.is-special-golden {
  --special: #ffb648;
  --special-glow: rgba(255, 170, 60, 0.6);
  color: #fff0d0;
  background: linear-gradient(160deg, rgba(255, 180, 70, 0.3), rgba(140, 70, 20, 0.24));
  text-shadow:
    0 0 6px rgba(255, 230, 180, 0.9),
    0 0 16px rgba(255, 160, 50, 0.75);
}

/* Rare box opening: recolor the animated box to match the rare box (gift drawer art). */
.gift-open-screen.is-golden-box .gift-open-box-wrap {
  fill: #5a2a8a;
}

.gift-open-screen.is-golden-box .gift-open-box-cap {
  fill: #7a3aa8;
}

.gift-open-screen.is-golden-box .gift-open-box-ribbon {
  fill: #f2c94c;
}

.gift-open-screen.is-golden-box .gift-open-box-bow {
  fill: #ffd84a;
}

.gift-open-screen.is-golden-box .gift-open-box-svg {
  /* Same purple glow as the drawer's rare box, scaled for the bigger box. */
  filter: drop-shadow(0 0 16px rgba(170, 100, 230, 0.6));
}

.gift-open-screen.is-golden-box #gift-open-title {
  color: #ffd75a;
  text-shadow: 0 0 14px rgba(255, 200, 70, 0.6);
}

.gift-open-screen .gift-reward.is-special-key {
  --special: #ffd75a;
  --special-glow: rgba(255, 200, 70, 0.55);
  color: #fff3c4;
  background: linear-gradient(160deg, rgba(255, 210, 90, 0.26), rgba(120, 80, 20, 0.22));
  text-shadow:
    0 0 6px rgba(255, 240, 190, 0.9),
    0 0 16px rgba(255, 190, 60, 0.75);
}

/* Diamondized shard: icy facets and a slow glint. A step up from a shard, short of a treasure. */
.gift-open-screen .gift-reward.is-special-diamond {
  --special: #c9f1ff;
  --special-glow: rgba(150, 225, 255, 0.6);
  color: #f2fcff;
  background:
    repeating-linear-gradient(120deg, rgba(255, 255, 255, 0.07) 0 10px, transparent 10px 22px),
    linear-gradient(160deg, rgba(160, 225, 255, 0.3), rgba(30, 70, 105, 0.3));
  text-shadow:
    0 0 6px rgba(235, 250, 255, 0.95),
    0 0 16px rgba(130, 215, 255, 0.8);
}

.gift-open-screen .gift-reward.is-special-diamond.is-revealed {
  animation: diamond-reward-glint 2.2s ease-in-out 0.4s infinite;
}

.gift-open-screen .gift-reward.is-special-diamond .gift-reward-star {
  font-size: 0.75em;
}

@keyframes diamond-reward-glint {
  0%,
  100% {
    box-shadow:
      inset 0 0 18px rgba(200, 240, 255, 0.28),
      0 0 14px rgba(150, 225, 255, 0.45);
  }
  50% {
    box-shadow:
      inset 0 0 24px rgba(220, 248, 255, 0.4),
      0 0 26px rgba(150, 225, 255, 0.7);
  }
}

@media (prefers-reduced-motion: reduce) {
  .gift-open-screen .gift-reward.is-special-diamond.is-revealed {
    animation: none;
  }
}

/* Treasure piece: the best prize in a box. Iridescent frame, relic chunk, progress. */
@property --treasure-turn {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

.gift-open-screen .gift-reward.is-special-treasure {
  --special: #ffd75a;
  --special-glow: rgba(255, 190, 80, 0.75);
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 16px 14px 14px;
  border: 3px solid transparent;
  color: #fff7dc;
  background:
    linear-gradient(165deg, #4a2a72, #231238 60%, #4b2f14) padding-box,
    conic-gradient(from var(--treasure-turn), #ffd75a, #ff9ecb, #c08bff, #8ff0dc, #fff3c4, #ffd75a) border-box;
  text-shadow:
    0 0 6px rgba(255, 245, 210, 0.9),
    0 0 18px rgba(255, 190, 80, 0.85);
  box-shadow:
    inset 0 0 26px rgba(255, 210, 120, 0.28),
    0 0 22px rgba(255, 190, 80, 0.6),
    0 0 60px rgba(190, 120, 255, 0.45);
}

.treasure-title {
  color: #ffd75a;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.treasure-body {
  display: grid;
  justify-items: center;
  gap: 4px;
  font-size: 1.35rem;
  line-height: 1.15;
}

.treasure-chunk {
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  filter: drop-shadow(0 0 8px rgba(255, 215, 90, 0.85));
}

.treasure-bar {
  position: relative;
  width: min(100%, 12rem);
  height: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 215, 90, 0.6);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.4);
}

.treasure-bar > span {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, #c08bff, #ffd75a);
}

.treasure-count {
  font-size: 0.85rem;
  font-weight: 700;
}

.gift-open-screen .gift-reward.is-special-treasure.is-revealed {
  animation:
    treasure-slam 0.75s cubic-bezier(0.2, 0.9, 0.25, 1.3) both,
    treasure-border 3.2s linear infinite,
    treasure-glow 1.8s ease-in-out 0.75s infinite;
}

.gift-open-screen .is-special-treasure.is-revealed .treasure-chunk {
  animation: treasure-chunk 2.6s ease-in-out 0.6s infinite;
}

.gift-open-screen .is-special-treasure.is-revealed .treasure-bar > span {
  animation: treasure-fill 0.9s ease-out 0.55s both;
}

/* Something is still in the box: its card glows and rattles, face down, before it shows. */
.gift-open-screen.is-treasure-tease .gift-reward.is-special-treasure.is-pending {
  opacity: 1;
  border-color: color-mix(in srgb, #ffd75a 60%, transparent);
  background: #1b1128;
  animation:
    treasure-rattle 0.14s linear infinite,
    treasure-charge 0.95s ease-in both;
}

.gift-open-screen.is-treasure-tease .is-special-treasure.is-pending > * {
  visibility: hidden;
}

.gift-open-screen.is-treasure-tease .is-special-treasure.is-pending::before {
  content: "?";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #ffd75a;
  font-size: 3.4rem;
  font-weight: 800;
}

.gift-open-screen.is-treasure-found #gift-open-list {
  animation: treasure-shake 0.5s ease-out;
}

.treasure-fx {
  position: absolute;
  left: 50%;
  width: 0;
  height: 0;
}

.treasure-fx > span {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
}

.treasure-flash {
  width: 220vmax;
  height: 220vmax;
  margin: -110vmax 0 0 -110vmax;
  background: radial-gradient(circle, rgba(255, 250, 225, 0.95), rgba(255, 210, 120, 0.4) 22%, transparent 48%);
  animation: treasure-flash 0.8s ease-out both;
}

.treasure-rays {
  width: 150vmin;
  height: 150vmin;
  margin: -75vmin 0 0 -75vmin;
  border-radius: 50%;
  background: repeating-conic-gradient(rgba(255, 215, 110, 0.34) 0 9deg, transparent 9deg 24deg, rgba(200, 140, 255, 0.26) 24deg 31deg, transparent 31deg 45deg);
  -webkit-mask-image: radial-gradient(circle, #000 8%, transparent 68%);
  mask-image: radial-gradient(circle, #000 8%, transparent 68%);
  animation:
    treasure-rays-in 0.7s ease-out both,
    treasure-rays-turn 22s linear infinite;
}

.treasure-wave {
  width: 60vmin;
  height: 60vmin;
  margin: -30vmin 0 0 -30vmin;
  border: 4px solid #ffd75a;
  border-radius: 50%;
  box-shadow: 0 0 24px rgba(255, 215, 90, 0.9), inset 0 0 24px rgba(200, 140, 255, 0.7);
  animation: treasure-wave 0.9s ease-out both;
}

.treasure-wave.is-late {
  border-color: #c08bff;
  animation-delay: 0.18s;
}

.treasure-spark {
  width: var(--s);
  height: var(--s);
  background: var(--c);
  box-shadow: 0 0 8px var(--c);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  transform: scale(0);
  animation: treasure-spark 1.5s cubic-bezier(0.12, 0.8, 0.3, 1) var(--delay) both;
}

@keyframes treasure-slam {
  0% {
    opacity: 0;
    transform: scale(2.1) rotate(-4deg);
    filter: brightness(2.6);
  }
  45% {
    opacity: 1;
    transform: scale(0.94) rotate(1deg);
    filter: brightness(1.5);
  }
  100% {
    transform: scale(1) rotate(0);
    filter: brightness(1);
  }
}

@keyframes treasure-border {
  to {
    --treasure-turn: 360deg;
  }
}

@keyframes treasure-glow {
  50% {
    box-shadow:
      inset 0 0 34px rgba(255, 210, 120, 0.45),
      0 0 34px rgba(255, 190, 80, 0.85),
      0 0 84px rgba(190, 120, 255, 0.65);
  }
}

@keyframes treasure-chunk {
  0%,
  100% {
    transform: translateY(0) rotate(-5deg);
  }
  50% {
    transform: translateY(-4px) rotate(5deg) scale(1.06);
  }
}

@keyframes treasure-fill {
  from {
    width: 0;
  }
}

@keyframes treasure-rattle {
  0%,
  100% {
    transform: none;
  }
  25% {
    transform: translate(-4px, 1px) rotate(-1.2deg);
  }
  75% {
    transform: translate(4px, -1px) rotate(1.2deg);
  }
}

@keyframes treasure-charge {
  from {
    box-shadow: 0 0 0 rgba(255, 190, 80, 0);
    filter: brightness(0.7);
  }
  to {
    box-shadow:
      0 0 34px rgba(255, 190, 80, 0.95),
      0 0 80px rgba(190, 120, 255, 0.7);
    filter: brightness(1.8);
  }
}

@keyframes treasure-shake {
  0%,
  100% {
    transform: translate(0, 0);
  }
  15% {
    transform: translate(-7px, 4px);
  }
  30% {
    transform: translate(6px, -5px);
  }
  50% {
    transform: translate(-4px, 3px);
  }
  75% {
    transform: translate(2px, -1px);
  }
}

@keyframes treasure-flash {
  0% {
    opacity: 0;
    transform: scale(0.2);
  }
  18% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(1);
  }
}

@keyframes treasure-rays-in {
  from {
    opacity: 0;
    scale: 0.2;
  }
}

@keyframes treasure-rays-turn {
  to {
    transform: rotate(360deg);
  }
}

@keyframes treasure-wave {
  0% {
    opacity: 1;
    transform: scale(0.15);
  }
  100% {
    opacity: 0;
    transform: scale(2);
  }
}

@keyframes treasure-spark {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.3);
  }
  55% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy) + 6vmin)) rotate(var(--r)) scale(1.5);
  }
}

@media (prefers-reduced-motion: reduce) {
  .gift-open-screen .gift-reward.is-special-treasure.is-revealed,
  .gift-open-screen .is-special-treasure.is-revealed .treasure-chunk,
  .gift-open-screen .is-special-treasure.is-revealed .treasure-bar > span,
  .gift-open-screen.is-treasure-found #gift-open-list {
    animation: none !important;
  }
}

/* Shine sweep across the row */
.gift-open-screen .gift-reward.is-special::after {
  content: "";
  position: absolute;
  inset: -20% auto -20% -60%;
  width: 45%;
  pointer-events: none;
  background: linear-gradient(
    100deg,
    transparent,
    rgba(255, 255, 255, 0.55),
    transparent
  );
  transform: skewX(-18deg);
  opacity: 0;
}

.gift-open-screen .gift-reward.is-special.is-revealed::after {
  animation: gift-special-sweep 2.4s ease-in-out 0.25s infinite;
}

.gift-open-screen .gift-reward-star {
  color: var(--special);
  font-size: 0.85em;
  text-shadow: 0 0 8px var(--special-glow);
}

.gift-open-screen .gift-reward.is-special.is-revealed .gift-reward-text {
  animation: gift-special-pop 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.4) both;
}

.gift-open-screen .gift-reward.is-special.is-revealed .gift-reward-star {
  animation:
    gift-special-star-in 0.5s ease-out both,
    gift-special-twinkle 1.6s ease-in-out 0.5s infinite;
}

.gift-open-screen .gift-reward.is-special.is-revealed .gift-reward-star:last-child {
  animation-delay: 0.08s, 1.3s;
}

@keyframes gift-special-pop {
  0% {
    transform: scale(0.6);
  }
  60% {
    transform: scale(1.18);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes gift-special-star-in {
  from {
    opacity: 0;
    transform: scale(0.2) rotate(-120deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

@keyframes gift-special-twinkle {
  0%,
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
  50% {
    opacity: 0.55;
    transform: scale(0.8) rotate(45deg);
  }
}

@keyframes gift-special-sweep {
  0% {
    left: -60%;
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  45%,
  100% {
    left: 120%;
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gift-open-screen .gift-reward {
    transition: none;
  }
  .gift-open-screen .gift-reward.is-special.is-revealed::after,
  .gift-open-screen .gift-reward.is-special.is-revealed .gift-reward-text,
  .gift-open-screen .gift-reward.is-special.is-revealed .gift-reward-star {
    animation: none !important;
  }
}

.catchup-screen {
  z-index: 45;
  pointer-events: auto;
}

.pachinko-screen,
.gear-screen,
.shuffle-screen {
  position: fixed;
  inset: 0;
  z-index: 28;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 16px;
  background: rgba(8, 6, 4, 0.82);
}

.bellows-screen[hidden],
.pachinko-screen[hidden],
.gear-screen[hidden],
.shuffle-screen[hidden] {
  display: none;
}

.gear-card {
  display: grid;
  gap: 14px;
  width: min(22rem, 100%);
  padding: 16px 14px 14px;
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  justify-items: center;
}

.gear-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.gear-head h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gear-speed-bar {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel-border) 70%, transparent);
  overflow: hidden;
}

.gear-speed-bar > span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c4a574, #e8d5a3 55%, #f3e7c7);
  transition: width 60ms linear;
}

.gear-status {
  margin: 0;
  color: var(--muted);
  text-align: center;
  font-size: 0.92rem;
}

.gear-stage {
  width: min(16rem, 100%);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.gear-wheel {
  width: 100%;
  height: auto;
  transform-origin: 50% 50%;
  will-change: transform;
}

.gear-hub-ring {
  fill: color-mix(in srgb, var(--panel) 40%, #8a7a5c);
  stroke: color-mix(in srgb, var(--text) 35%, #6a5a3c);
  stroke-width: 4;
}

.gear-teeth use {
  fill: #b89a68;
  stroke: #6e5a38;
  stroke-width: 1.5;
}

.gear-hub {
  fill: #9a8258;
  stroke: #5c4a2e;
  stroke-width: 3;
}

.gear-bore {
  fill: var(--panel);
  stroke: #5c4a2e;
  stroke-width: 2;
}

[data-gear-spin] {
  width: 100%;
  touch-action: none;
  user-select: none;
}

.pachinko-card {
  display: grid;
  gap: 12px;
  width: min(22rem, 100%);
  padding: 16px 14px 14px;
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

.pachinko-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pachinko-head h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pachinko-status,
.pachinko-regen {
  margin: 0;
  color: var(--muted);
  text-align: center;
}

.pachinko-regen[hidden] {
  display: none;
}

.pachinko-rewards {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text);
  text-align: center;
  font-size: 0.92rem;
}

.pachinko-rewards[hidden] {
  display: none;
}

[data-pachinko-launch] {
  touch-action: none;
}

.pachinko-board {
  width: 100%;
  height: auto;
}

.pachinko-pegs circle {
  fill: color-mix(in srgb, var(--text) 80%, var(--accent));
}

.pachinko-bin rect {
  fill: color-mix(in srgb, var(--button) 80%, #111);
  stroke: var(--panel-border);
}

.pachinko-bin text {
  fill: var(--text);
  font-size: 11px;
  text-anchor: middle;
}

.pachinko-pegs circle {
  transition: fill 0.2s ease-out;
}

.pachinko-pegs circle.is-hit {
  fill: #ffd75a;
  transition: none;
}

.pachinko-bin.is-diamond text {
  fill: #9fe6ff;
}

.pachinko-bin .pachinko-bin-glow {
  fill: #d4a017;
  stroke: #ffd75a;
  opacity: 0;
}

.pachinko-bin.is-hit .pachinko-bin-glow {
  animation: pachinko-bin-hit 0.5s ease-out;
}

@keyframes pachinko-bin-hit {
  from {
    opacity: 0.85;
  }
}

.pachinko-ball {
  fill: #d4a017;
  transition: opacity 0.22s ease-out;
}

.pachinko-ball.is-gone {
  opacity: 0;
}

.shuffle-card {
  display: grid;
  gap: 12px;
  width: min(22rem, 100%);
  padding: 16px 14px 14px;
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

.shuffle-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.shuffle-head h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.shuffle-status,
.shuffle-regen {
  margin: 0;
  color: var(--muted);
  text-align: center;
}

.shuffle-regen[hidden] {
  display: none;
}

.shuffle-stage {
  display: grid;
  grid-template-columns: 1fr 28px;
  gap: 12px;
  align-items: stretch;
}

.shuffle-board {
  width: 100%;
  height: auto;
}

.shuffle-lane {
  fill: color-mix(in srgb, var(--button) 72%, #1a1610);
  stroke: var(--panel-border);
}

.shuffle-half {
  stroke: color-mix(in srgb, var(--text) 35%, transparent);
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
}

.shuffle-zone-gems {
  fill: color-mix(in srgb, #3d6b4f 35%, transparent);
}

.shuffle-zone-shard {
  fill: color-mix(in srgb, #8a6ab8 40%, transparent);
}

.shuffle-zone-label.is-left {
  text-anchor: end;
  fill: #9fe6ff;
}

.shuffle-zone-diamond {
  fill: color-mix(in srgb, #7fdcff 55%, transparent);
}

.shuffle-zone-label {
  fill: var(--text);
  font-size: 11px;
  dominant-baseline: middle;
}

.shuffle-home {
  fill: none;
  stroke: color-mix(in srgb, var(--text) 40%, transparent);
  stroke-width: 1.5;
  stroke-dasharray: 3 3;
}

.shuffle-stone {
  fill: #c4b08a;
  stroke: #6e5a38;
  stroke-width: 1.5;
}

.shuffle-power {
  position: relative;
  width: 100%;
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel-border) 70%, transparent);
  overflow: hidden;
}

.shuffle-power-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0%;
  border-radius: inherit;
  background: linear-gradient(180deg, #e8d5a3, #c4a574 55%, #8a6a3c);
}

.shuffle-rewards {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text);
  text-align: center;
  font-size: 0.92rem;
}

.shuffle-rewards[hidden] {
  display: none;
}

[data-shuffle-slide] {
  width: 100%;
  touch-action: none;
  user-select: none;
}

.pinball-board {
  width: 100%;
  max-height: 62vh;
  touch-action: none;
  user-select: none;
  cursor: grab;
}

.pinball-board.is-pulling {
  cursor: grabbing;
}

.pinball-table {
  fill: color-mix(in srgb, #1f3a4a 70%, var(--panel));
  stroke: var(--panel-border);
  stroke-width: 2;
}

.pinball-floor {
  fill: none;
  stroke: #8fb4c8;
  stroke-width: 2;
}

.pinball-lane-wall {
  stroke: var(--panel-border);
  stroke-width: 2;
}

.pinball-gate {
  stroke: color-mix(in srgb, var(--panel-border) 60%, transparent);
  stroke-width: 1.5;
  stroke-dasharray: 2 2;
}

.pinball-post {
  fill: #c9d6de;
  stroke: #5d6f7a;
  stroke-width: 1;
}

.pinball-cup path {
  fill: color-mix(in srgb, #3d6b4f 30%, transparent);
  stroke: #b9c9a3;
  stroke-width: 2;
  stroke-linejoin: round;
}

.pinball-cup.is-shard path {
  fill: color-mix(in srgb, #8a6ab8 40%, transparent);
  stroke: #c3a8ea;
}

.pinball-cup.is-diamond path {
  fill: color-mix(in srgb, #7fdcff 35%, transparent);
  stroke: #bfefff;
}

.pinball-cup.is-box path {
  fill: color-mix(in srgb, #c4a030 35%, transparent);
  stroke: #e8cc6a;
}

.pinball-cup.is-hit path {
  stroke: #fff;
}

.pinball-cup text {
  fill: var(--text);
  font-size: 7px;
  text-anchor: middle;
}

.pinball-ball {
  fill: #e6edf2;
  stroke: #6b7c88;
  stroke-width: 1;
  transition: opacity 0.35s;
}

.pinball-ball.is-gone {
  opacity: 0;
}

.pinball-plunger rect {
  fill: #8a96a0;
}

.pinball-plunger .pinball-knob {
  fill: #c44a3a;
  stroke: #5a1f18;
  stroke-width: 1;
}

.pinball-spring {
  fill: none;
  stroke: #b8c2ca;
  stroke-width: 1.2;
}

.pinball-gate.is-closed {
  stroke: var(--panel-border);
  stroke-dasharray: none;
}

.pinball-cup.is-floor path {
  fill: color-mix(in srgb, #8fb4c8 25%, transparent);
  stroke: #8fb4c8;
}

.pinball-hint {
  margin: 0;
  color: var(--muted);
  text-align: center;
  font-size: 0.85rem;
}

.fossil-grid {
  display: grid;
  grid-template-columns: repeat(var(--fossil-size, 5), minmax(0, 1fr));
  grid-template-rows: repeat(var(--fossil-size, 5), minmax(0, 1fr));
  aspect-ratio: 1;
  gap: 0;
  padding: 4px;
  border: 2px solid #5a3a24;
  border-radius: var(--radius);
  /* The fossil bed: seen through dug fossil tiles. */
  background: radial-gradient(circle at 30% 30%, #3a281a, #24170e);
}

.fossil-sprite {
  position: relative;
  z-index: 0;
  min-width: 0;
  min-height: 0;
  pointer-events: none;
}

/* Absolute so the art never changes the row/column size. */
.fossil-sprite svg {
  position: absolute;
  inset: 6%;
  width: 88%;
  height: 88%;
  overflow: visible;
}

.fossil-sprite.is-whole svg {
  filter: drop-shadow(0 0 3px #ffd36a) drop-shadow(0 0 1px #ffd36a);
}

.fossil-tile {
  position: relative;
  z-index: 1;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 2px solid #5a3a24;
  border-radius: 0;
  background: linear-gradient(160deg, #c98a52, #a8683a);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.18), inset 0 -3px 0 rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.fossil-tile:disabled {
  cursor: default;
}

.fossil-tile:not(:disabled):hover {
  background: linear-gradient(160deg, #d99a62, #b8784a);
}

/* Dug fossil tile: a window onto the sprite below. */
.fossil-tile.is-fossil {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

/* Fossil you didn't reach, shown at the end of a round. */
.fossil-tile.is-fossil.is-missed {
  background: rgba(201, 138, 82, 0.6);
  border-color: rgba(90, 58, 36, 0.6);
}

.fossil-tile.is-rubble {
  background: repeating-linear-gradient(45deg, #3a281a 0 4px, #33231a 4px 8px);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.fossil-screen .is-skull { color: #efe4cf; }
.fossil-screen .is-fern { color: #8fcf7a; }
.fossil-screen .is-fish { color: #8ec4e8; }
.fossil-screen .is-shell { color: #f0b8c8; }
.fossil-screen .is-amber { color: #ffb43a; }
.fossil-screen .is-diamond { color: #9fe6ff; }

.fossil-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 4px 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.82rem;
}

.fossil-legend-row {
  display: grid;
  grid-template-columns: 1.2rem 1fr;
  column-gap: 6px;
  align-items: center;
}

.fossil-legend-row svg {
  width: 1.2rem;
  height: 1.2rem;
  grid-row: span 2;
}

.fossil-legend-row span {
  color: var(--text);
}

.fossil-legend-row small {
  color: var(--muted);
}

.fossil-legend-row.is-whole span {
  color: #ffd36a;
}

.fossil-legend-row.is-absent {
  opacity: 0.35;
}

[data-fossil-refresh][hidden] {
  display: none;
}

.reel-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.reel-board {
  width: 100%;
  max-height: 46vh;
  height: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.reel-floor {
  fill: #0a0c12;
}

.reel-ticks line {
  stroke: rgba(180, 220, 255, 0.35);
  stroke-width: 1;
}

.reel-boat {
  fill: #a8683a;
}

.reel-line {
  stroke: rgba(230, 240, 255, 0.7);
  stroke-width: 0.8;
}

.reel-lure-core {
  fill: #eafff9;
}

.reel-fish {
  fill: #2a3a48;
  stroke: #5b7488;
  stroke-width: 0.8;
  transition: opacity 0.3s;
}

.reel-fish-stalk {
  fill: none;
}

.reel-fish-eye {
  fill: #ffe27a;
  stroke: none;
}

.reel-depth {
  fill: #cfe8ff;
  font-size: 10px;
  font-weight: 600;
}

.reel-board.is-bite .reel-water {
  filter: brightness(1.6);
}

.reel-board.is-landed .reel-water {
  filter: brightness(1.4) hue-rotate(40deg);
}

.reel-ladder {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.76rem;
  color: var(--muted);
}

.reel-ladder li {
  display: grid;
  grid-template-columns: 2.2em auto;
  column-gap: 6px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.reel-ladder li span {
  grid-row: span 2;
  align-self: center;
  opacity: 0.6;
}

.reel-ladder li b {
  font-weight: 600;
  color: var(--text);
}

.reel-ladder li em {
  font-style: normal;
}

.reel-ladder li.is-here {
  background: color-mix(in srgb, #5cf2c8 22%, transparent);
  outline: 1px solid color-mix(in srgb, #5cf2c8 70%, transparent);
}

.reel-meter {
  display: grid;
  gap: 6px;
  opacity: 0.35;
  transition: opacity 0.2s;
}

.reel-meter.is-active {
  opacity: 1;
}

.reel-tension {
  position: relative;
  height: 18px;
  border-radius: 9px;
  background: linear-gradient(90deg, #1a2430, #2a2a30 70%, #5a1e1e);
  overflow: hidden;
}

.reel-band {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 40%;
  width: 20%;
  background: color-mix(in srgb, #4ad27a 70%, transparent);
  box-shadow: 0 0 6px #4ad27a;
}

.reel-meter.is-out .reel-band {
  background: color-mix(in srgb, #4ad27a 40%, transparent);
}

.reel-needle {
  position: absolute;
  top: -2px;
  bottom: -2px;
  left: 0;
  width: 4px;
  margin-left: -2px;
  border-radius: 2px;
  background: #f3f6f8;
}

.reel-meter.is-danger .reel-needle {
  background: #ff6a5a;
}

.reel-progress {
  height: 6px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--panel-border) 80%, transparent);
  overflow: hidden;
}

.reel-progress > span {
  display: block;
  width: 0;
  height: 100%;
  background: #5cf2c8;
}

[data-reel-main] {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

[data-reel-main].is-holding {
  filter: brightness(1.25);
  transform: translateY(1px);
}

.strike-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.strike-board {
  width: 100%;
  height: auto;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.strike-crater {
  fill: color-mix(in srgb, #3a2a22 75%, var(--panel));
  stroke: #5a3e2e;
  stroke-width: 3;
}

.strike-track {
  fill: none;
  stroke: color-mix(in srgb, var(--panel-border) 80%, transparent);
  stroke-width: 12;
}

.strike-target {
  fill: none;
  stroke: #ffb43a;
  stroke-width: 12;
  stroke-linecap: butt;
  filter: drop-shadow(0 0 4px #ff8a2a);
}

.strike-marker {
  stroke: #f3f6f8;
  stroke-width: 4;
  stroke-linecap: round;
}

.strike-center {
  fill: var(--text);
  font-size: 34px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: central;
}

.strike-board.is-hit .strike-crater {
  fill: #6a4a1e;
}

.strike-board.is-miss .strike-crater {
  fill: #6a1e1e;
}

.strike-ladder {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.78rem;
  color: var(--muted);
}

.strike-ladder li {
  display: flex;
  gap: 6px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.strike-ladder li span {
  min-width: 1em;
  opacity: 0.6;
}

.strike-ladder li.is-reached {
  color: var(--text);
  background: color-mix(in srgb, #ffb43a 22%, transparent);
}

.strike-ladder li.is-next {
  color: #ffb43a;
  outline: 1px dashed color-mix(in srgb, #ffb43a 70%, transparent);
}

.strike-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

/* Room for two lines, so a longer message doesn't shift the buttons mid-run. */
.strike-hint {
  min-height: 2.8em;
}

.strike-actions button {
  min-height: 3.4em;
}

[data-strike-main] {
  touch-action: manipulation;
  user-select: none;
}

.bellows-heat-bar > span {
  background: linear-gradient(90deg, #8a3a1a, #ff7a2a 55%, #ffd36a);
}

.bellows-stage {
  width: min(18rem, 100%);
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  /* A one-second hold: a drifting finger must not turn into a scroll. */
  touch-action: none;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.bellows-stage:hover,
.bellows-stage:active {
  background: transparent;
}

.bellows-art {
  display: block;
  width: 100%;
  height: auto;
  --heat: 0;
  --press: 0;
}

.bellows-forge-box {
  fill: #3a3430;
  stroke: #1e1a17;
  stroke-width: 2;
}

.bellows-coals {
  fill: color-mix(in srgb, #ff5a1a calc(var(--heat) * 100%), #2a2420);
}

.bellows-glow {
  opacity: calc(0.08 + var(--heat) * 0.92);
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(calc(0.6 + var(--heat) * 0.5));
}

.bellows-flames path {
  fill: #ffb43a;
  opacity: var(--heat);
  transform-box: fill-box;
  transform-origin: 50% 100%;
  transform: scaleY(calc(0.3 + var(--heat) * 0.9));
}

.bellows-nozzle {
  fill: #6e6a66;
  stroke: #3a3632;
  stroke-width: 1.5;
}

.bellows-body {
  transform-box: view-box;
  transform-origin: 104px 101px;
  transform: scaleY(calc(1 - var(--press) * 0.55));
  transition: transform 0.18s ease-out;
}

/* Follows the finger while squeezed, springs back when let go. */
.bellows-art.is-held .bellows-body {
  transition: none;
}

.bellows-art.is-flaring .bellows-glow {
  animation: bellows-glow-flare 0.6s ease-out;
}

.bellows-art.is-flaring .bellows-flames path {
  animation: bellows-flame-flare 0.6s ease-out;
}

@keyframes bellows-glow-flare {
  25% {
    opacity: 1;
    transform: scale(1.55);
  }
}

@keyframes bellows-flame-flare {
  25% {
    opacity: 1;
    transform: scaleY(1.8);
  }
}

@media (prefers-reduced-motion: reduce) {
  .bellows-art.is-flaring .bellows-glow,
  .bellows-art.is-flaring .bellows-flames path {
    animation: none;
  }
}

.bellows-hint {
  min-height: 2.7em;
}

.bellows-leather {
  fill: #7a4a2a;
  stroke: #4a2a16;
  stroke-width: 2;
}

.bellows-board {
  fill: #a8784a;
  stroke: #5c3c20;
  stroke-width: 1.5;
}

.bellows-handle {
  fill: #5c3c20;
}

.reliquary-card.is-placeholder {
  opacity: 0.72;
}

.reliquary-play {
  display: grid;
  gap: 6px;
  justify-items: stretch;
}

.reliquary-balls {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.implosion-screen {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 32px;
  padding: 24px;
  background:
    radial-gradient(ellipse at center, #5a1c14 0%, #140806 58%, #070404 100%);
  color: var(--text);
}

.implosion-screen[hidden] {
  display: none;
}

.run-reset-totals {
  width: min(24rem, 100%);
  max-height: min(46vh, 22rem);
  margin: 0;
  padding: 0;
  overflow: auto;
  scrollbar-gutter: stable;
  list-style: none;
  display: grid;
  gap: 8px;
}

.run-reset-totals li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--text);
  font-size: 1rem;
}

.run-reset-totals .name {
  color: var(--muted);
}

.run-reset-totals li.is-reward .name,
.run-reset-totals li.is-reward span:last-child {
  color: var(--magma-chunk);
  font-weight: 700;
}

.run-reset-totals li.is-reward.is-planet-core .name,
.run-reset-totals li.is-reward.is-planet-core span:last-child {
  color: var(--planet-core);
}

.stats-list dd.snowbank {
  color: var(--snowbank);
}

.stats-list dd.icepack {
  color: var(--icepack);
}

.stats-list dd.blue-ice {
  color: var(--blue-ice);
}

.stats-list dd.magma-chunk {
  color: var(--magma-chunk);
}

.stats-list dd.tektite {
  color: var(--tektite);
}

.stats-list dd.stardust {
  color: var(--stardust);
}

.stats-list dd.iridium {
  color: var(--iridium);
}

.stats-list dd.manganese {
  color: var(--manganese);
}

.stats-list dd.cobalt {
  color: var(--cobalt);
}

.stats-list dd.black-pearl {
  color: var(--black-pearl);
}

.implosion-screen:not(.is-implosion) {
  background: rgba(8, 6, 4, 0.97);
}

.implosion-screen h1 {
  margin: 0;
  color: #f4c4b4;
  font-size: clamp(2.2rem, 8vw, 4.6rem);
  letter-spacing: 0.12em;
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 0 0 28px rgba(212, 92, 76, 0.55);
}

.implosion-screen button {
  padding: 14px 42px;
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  background: #3d221c;
  color: var(--text);
  font-size: 1.15rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.implosion-screen button:hover {
  background: #4a2a24;
}

.run-reset-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.implosion-screen button.run-reset-cancel {
  border-color: var(--muted);
  background: transparent;
  color: var(--muted);
}

.implosion-screen button.run-reset-cancel:hover {
  border-color: var(--text);
  background: transparent;
  color: var(--text);
}

.implosion-screen.is-fx-playing {
  pointer-events: none;
}

.implosion-screen.is-fx-playing button {
  opacity: 0.45;
}

.reset-fx {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.42s ease;
}

.reset-fx[hidden] {
  display: none;
}

.reset-fx.is-fading {
  opacity: 0;
}

.reset-fx canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.rotate-screen {
  display: none;
}

html[data-layout="narrow"] {
  .app {
    top: max(28px, env(safe-area-inset-top, 0px));
    height: calc(var(--app-height, 100dvh) - max(28px, env(safe-area-inset-top, 0px)));
  }

  .resources {
    padding: 8px 12px 0;
    background: var(--bg);
  }

  .news-log {
    padding: 0 12px max(10px, env(safe-area-inset-bottom));
  }

  .resources h1,
  .game-title {
    margin-bottom: 0;
    font-size: 0.72rem;
  }

  .resources .subtitle {
    display: none;
  }

  .resource-list {
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }

  .resources .resource-card {
    padding: 3px 6px;
  }

  .resources .resource-card .label span:first-child {
    font-size: 0.68rem;
  }

  .resources .resource-card .label span:last-child {
    font-size: 0.58rem;
  }

  .resources .resource-card .amount {
    font-size: 0.9rem;
  }

  .hire-button {
    padding: 10px 12px;
    font-size: 0.95rem;
  }

  .actions {
    gap: 12px;
    padding: calc(var(--drawer-resources-min, 52px) + 8px) 12px calc(var(--drawer-news-min, 64px) + 8px);
  }

  .resource-float-stage {
    width: min(80px, 26%);
    max-width: 80px;
  }

  &[data-resource-float-style="expanded"] .resource-float-stage {
    width: min(140px, 48%);
    max-width: 140px;
  }

  /* Top center: one row, side by side (width hugs the cards; wraps only past the screen). */
  &[data-resource-float-place="top"] .resource-float-stage,
  &[data-resource-float-place="top"][data-resource-float-style="expanded"] .resource-float-stage {
    width: max-content;
    max-width: calc(100% - 16px);
  }

  .view-tabs,
  .zone-tabs,
  .view,
  .zone-panel {
    width: 100%;
  }

  .view-tabs {
    flex-wrap: wrap;
    overflow: visible;
    row-gap: 0;
  }

  .view-tab {
    flex: 1 1 auto;
    min-width: auto;
    padding: 10px 9px 12px;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
  }

  .view-tab.pin-first {
    margin-left: 0;
  }

  .view-tab[data-view="achievements"] {
    min-width: auto;
    letter-spacing: 0.04em;
  }

  .view-tab[data-view="descension"] {
    min-width: auto;
    letter-spacing: 0.03em;
  }

  .view-tab.icon-tab {
    min-width: 2.4rem;
    padding-left: 8px;
    padding-right: 8px;
  }

  .view {
    gap: 14px;
  }

  .view.mine-view {
    grid-template-rows: auto minmax(0, 1fr) var(--deposit-viewport-h, 110px);
    gap: 8px;
    margin-bottom: -10px;
  }

  .mine-body {
    gap: 14px;
    padding-bottom: 108px;
    scroll-padding-bottom: 108px;
  }

  .subtitle,
  .hint {
    margin-bottom: 12px;
    font-size: 0.9rem;
  }

  .actions h3 {
    margin-top: 16px;
  }

  #workshop-permits.lab-pane {
    gap: 10px;
  }

  #workshop-permits .permit-block {
    gap: 4px;
  }

  .zone-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 2px 0 4px;
    overflow: visible;
  }

  .zone-tab {
    width: auto;
    padding: 8px 12px;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
  }

  .crew-viewport {
    height: 76px;
  }

  .deposit-viewport {
    height: var(--deposit-viewport-h, 110px);
  }

  .deposit-viewport canvas {
    height: var(--deposit-canvas-h, 168px);
  }

  .button-grid button,
  .assign-control button,
  .hire-button,
  .view-tab,
  .zone-tab,
  .descension-node {
    min-height: 44px;
    touch-action: manipulation;
  }

  .descension-board.is-zoomed-out .descension-node {
    min-height: 0;
    touch-action: none;
  }

  .button-grid {
    gap: 8px;
  }

  .button-grid button {
    padding: 12px 14px;
    font-size: 1rem;
  }

  .news-heading {
    margin: 4px 0 6px;
  }

  .news-list {
    gap: 4px;
  }

  .news-list li {
    grid-template-columns: 3.6rem 1fr;
    gap: 8px;
    font-size: 0.82rem;
  }
}

/* —— Chrome packs (data-chrome on <html>) —— */
html[data-chrome="timber"] .zone-tab {
  border-radius: 999px;
}

html[data-chrome="rivet"] .button-grid button,
html[data-chrome="rivet"] .hire-button {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.95rem;
  font-weight: 600;
}

html[data-chrome="rivet"] .button-grid button .detail,
html[data-chrome="rivet"] .hire-button .detail {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}

html[data-chrome="rivet"] .resource-card,
html[data-chrome="rivet"] .button-grid button,
html[data-chrome="rivet"] .hire-button {
  box-shadow:
    var(--control-shadow),
    inset 6px 6px 0 -5px #8a949e,
    inset -6px -6px 0 -5px #8a949e,
    inset 6px -6px 0 -5px #8a949e,
    inset -6px 6px 0 -5px #8a949e;
}

html[data-chrome="rust"] .button-grid button,
html[data-chrome="rust"] .hire-button,
html[data-chrome="rust"] .zone-tab {
  font-family: Georgia, "Times New Roman", serif;
}

html[data-chrome="stencil"] body {
  background-image:
    linear-gradient(rgba(40, 80, 50, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(40, 80, 50, 0.07) 1px, transparent 1px),
    linear-gradient(
      to bottom,
      var(--wash-top),
      transparent 22%,
      var(--wash-mid) 48%,
      var(--wash-bottom)
    ),
    radial-gradient(ellipse at top, var(--wash-radial), var(--bg) 58%);
  background-size: 16px 16px, 16px 16px, auto, auto;
}

html[data-chrome="stencil"] .button-grid button,
html[data-chrome="stencil"] .hire-button,
html[data-chrome="stencil"] .zone-tab,
html[data-chrome="stencil"] .view-tab {
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

html[data-chrome="stencil"] .button-grid button .detail,
html[data-chrome="stencil"] .hire-button .detail {
  text-transform: none;
  letter-spacing: 0;
}

html[data-chrome="bunker"] .view-tab[aria-selected="true"] {
  box-shadow: inset 0 -3px 0 var(--chrome-accent);
}

html[data-chrome="bunker"] .resource-card,
html[data-chrome="bunker"] .button-grid button,
html[data-chrome="bunker"] .hire-button {
  border-left: 4px solid var(--chrome-accent);
}

html[data-chrome="bunker"] .button-grid button,
html[data-chrome="bunker"] .hire-button {
  font-weight: 700;
}

/* Guided tutorial spotlight */
.tutorial-screen {
  position: fixed;
  inset: 0;
  z-index: 35;
  pointer-events: none;
}

.tutorial-screen[hidden] {
  display: none;
}

.tutorial-cutout {
  position: fixed;
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(8, 6, 4, 0.68);
  pointer-events: none;
  outline: 2px solid rgba(232, 196, 120, 0.85);
  outline-offset: 0;
}

.tutorial-screen.is-soft .tutorial-cutout {
  box-shadow: 0 0 0 9999px rgba(8, 6, 4, 0.45);
  outline-color: rgba(232, 196, 120, 0.7);
}

.tutorial-screen.is-wrapup::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(8, 6, 4, 0.68);
  pointer-events: none;
}

.tutorial-screen.is-wrapup .tutorial-tip {
  text-align: center;
}

.tutorial-screen.is-wrapup .tutorial-tip p {
  text-align: center;
}

.tutorial-tip {
  position: fixed;
  z-index: 1;
  display: grid;
  gap: 10px;
  width: min(22rem, calc(100vw - 24px));
  padding: 12px 14px;
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  color: var(--text);
  pointer-events: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.tutorial-tip-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.tutorial-tip p {
  margin: 0;
  flex: 1 1 auto;
  font-size: 0.92rem;
  line-height: 1.35;
  text-align: left;
}

.tutorial-tip:not(.has-cost) p {
  text-align: center;
}

.tutorial-tip-cost {
  flex: 0 0 auto;
  display: grid;
  gap: 4px;
  justify-items: end;
  max-width: 9.5rem;
  font-size: 0.78rem;
  line-height: 1.25;
  color: var(--muted);
  text-align: right;
}

.tutorial-tip-cost .cost-resource {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
}

.tutorial-tip-cost .cost-resource.is-ready {
  color: #6fbf73;
}

.resource-float-stage.is-over-tutorial {
  position: fixed;
  z-index: 36;
  pointer-events: none;
}

.tutorial-tip button {
  justify-self: center;
  min-width: 6.5rem;
  padding: 8px 14px;
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--button);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.tutorial-tip button:hover {
  background: var(--button-hover);
  border-color: var(--accent);
}


/* ------------------------------------------------------------------
 * Tab bar position (Settings → UI → Tab bar position).
 * "top": classic layout — Resources drawer hangs from the top, News rises from the bottom.
 * "bottom" (default): view tabs sit at the bottom. The "Dig Deep" title bar stands on its own
 * at the top, and both drawers pull out from under it with their classic pull-tabs side by
 * side (Resources left, News right). Each tab rides the bottom of its own drawer, so it can
 * be tapped or dragged down like before.
 * ------------------------------------------------------------------ */
.drawer-tab-label {
  display: none;
}

html[data-tab-position="bottom"] {
  /* Title bar, moved out of the Resources drawer by GameUi.syncDrawerHandles. */
  .app > .resources-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 11;
    display: flex;
    align-items: center;
    padding: 6px 12px;
    background: var(--bg);
    border-bottom: 1px solid var(--panel-border);
  }

  .app > .resources-header .game-title {
    margin: 0;
  }

  .resources,
  .news-log {
    top: var(--title-bar-h, 32px);
    bottom: auto;
    padding: 0;
    background: transparent;
    border: 0;
    /* Only the handle and the drawer body take taps; the clear area beside a handle doesn't. */
    pointer-events: none;
  }

  .resources > *,
  .news-log > * {
    pointer-events: auto;
  }

  /* Drawer body background: everything above the hanging handle. */
  .resources::before,
  .news-log::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: calc(var(--drawer-tab-h, 22px) - 1px);
    z-index: -1;
    background: var(--bg);
    border-bottom: 1px solid var(--panel-border);
  }

  /* Closed drawers draw no strip: the title bar has its own border, and the News strip
     would otherwise paint across the top row of the Resources handle (1px mismatch). */
  .resources.is-closed::before,
  .news-log.is-closed::before {
    display: none;
  }

  .news-log::before {
    /* News tint over a solid base so the page never shows through. */
    background: linear-gradient(var(--news-bg), var(--news-bg)), var(--bg);
  }

  /* Start below the other drawer's handle, which hangs over the top of an open drawer. */
  .resources-body,
  .news-body {
    min-height: 0;
    padding: calc(var(--drawer-tab-h, 22px) + 6px) 12px 0;
  }

  .resources.is-closed > :not(.drawer-tab),
  .news-log.is-closed > :not(.drawer-tab) {
    display: none;
  }

  /* Classic pull-tab, plus a label beside the arrow. */
  .resources .drawer-tab,
  .news-log .drawer-tab {
    order: 2;
    align-self: flex-start;
    gap: 2px;
    width: auto;
    height: var(--drawer-tab-h, 22px);
    margin: -1px 0 0;
    padding: 0 6px 0 12px;
    border: var(--border-w) solid var(--panel-border);
    border-top: 0;
    border-radius: 0 0 var(--radius) var(--radius);
    transform: translateX(-50%);
    color: var(--muted);
    font: inherit;
    font-size: 0.66rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .resources .drawer-tab {
    margin-left: 25%;
  }

  .news-log .drawer-tab {
    margin-left: 75%;
  }

  .drawer-tab[aria-expanded="true"] {
    color: var(--chrome-accent, var(--accent));
  }

  .drawer-tab-label {
    display: inline;
  }

  .resources .drawer-arrow,
  .news-log .drawer-arrow {
    width: 20px;
    transform: rotate(0deg);
  }

  .resources .drawer-tab.will-close .drawer-arrow,
  .news-log .drawer-tab.will-close .drawer-arrow {
    transform: rotate(180deg);
  }

  .actions {
    grid-template-rows: minmax(0, 1fr) auto;
    padding: calc(var(--title-bar-h, 32px) + var(--drawer-resources-min, 22px) + 10px) 24px
      max(6px, env(safe-area-inset-bottom));
  }

  .actions-chrome {
    grid-row: 2;
  }

  .actions > .view {
    grid-row: 1;
  }

  .view-tabs {
    border-bottom: 0;
    border-top: 1px solid var(--panel-border);
  }

  .view-tab {
    padding: 14px 10px 12px;
  }

  .view-tab[aria-selected="true"] {
    box-shadow: inset 0 3px 0 var(--chrome-accent, var(--accent));
  }

  /* "By tabs" cards: top right of the content, under the drawer handles, stacking down
     (the mine sits right above the bottom tab bar, so they must not float there). */
  .resource-float-stage {
    top: calc(var(--title-bar-h, 32px) + var(--drawer-resources-height, 22px) + 6px);
    bottom: auto;
  }

  &[data-resource-float-place="top"] .resource-float-stage {
    top: calc(var(--title-bar-h, 32px) + var(--drawer-resources-height, 22px) + 4px);
    bottom: auto;
  }
}

html[data-layout="narrow"][data-tab-position="bottom"] {
  .resources,
  .news-log {
    padding: 0;
  }

  .actions {
    padding: calc(var(--title-bar-h, 32px) + var(--drawer-resources-min, 22px) + 8px) 12px
      max(6px, env(safe-area-inset-bottom));
  }

  .view-tab {
    padding: 12px 9px 10px;
  }
}

/* Settings → Redeem a code */
.redeem-code-form {
  display: flex;
  gap: 8px;
  width: 100%;
}

.redeem-code-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 12px;
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.redeem-code-input::placeholder {
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: none;
}

.redeem-code-input:focus {
  outline: none;
  border-color: var(--accent);
}

.redeem-code-button {
  flex: 0 0 auto;
  width: auto;
  padding: 10px 16px;
}

/* The shared hint style tucks up under its control; give the code box some room. */
.redeem-code-form ~ .settings-hint {
  margin-top: 10px;
}

.redeem-code-status:empty {
  display: none;
}

.redeem-code-status.is-ok {
  color: #6fbf73;
}

.redeem-code-status.is-error {
  color: #e0483a;
}

/* Code redeem overlay: techno-green number burst instead of the gift box animation. */
.gift-open-screen.is-code-reward {
  --code-green: #39ff88;
  --code-glow: rgba(57, 255, 136, 0.55);
}

.gift-open-screen.is-code-reward #gift-open-title {
  color: var(--code-green);
  font-family: ui-monospace, "Cascadia Mono", "Consolas", monospace;
  letter-spacing: 0.12em;
  text-shadow:
    0 0 10px var(--code-glow),
    0 0 22px rgba(57, 255, 136, 0.35);
}

.code-burst-digit {
  position: absolute;
  left: 50%;
  top: 42%;
  color: var(--code-green);
  font-family: ui-monospace, "Cascadia Mono", "Consolas", monospace;
  font-size: var(--fs, 1rem);
  font-weight: 700;
  line-height: 1;
  text-shadow:
    0 0 6px var(--code-green),
    0 0 14px var(--code-glow);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.4);
  animation: code-burst-digit 1.25s cubic-bezier(0.16, 0.8, 0.3, 1) var(--delay, 0s) both;
}

.code-burst-core {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 24vmin;
  height: 24vmin;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(57, 255, 136, 0.55), rgba(57, 255, 136, 0) 65%);
  transform: translate(-50%, -50%) scale(0.2);
  opacity: 0;
  animation: code-burst-core 0.7s ease-out both;
}

.code-burst-ring {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 70vmin;
  height: 70vmin;
  border: 2px solid var(--code-green);
  border-radius: 50%;
  box-shadow:
    0 0 12px var(--code-glow),
    inset 0 0 12px var(--code-glow);
  transform: translate(-50%, -50%) scale(0.05);
  opacity: 0;
  animation: code-burst-ring 0.9s ease-out both;
}

.code-burst-ring.is-late {
  border-style: dashed;
  animation-delay: 0.18s;
}

@keyframes code-burst-digit {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.4);
  }
  12% {
    opacity: 1;
  }
  70% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx, 0vmin)), calc(-50% + var(--dy, 0vmin))) scale(1.05);
  }
}

@keyframes code-burst-core {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.2);
  }
  25% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.4);
  }
}

@keyframes code-burst-ring {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.05);
  }
  15% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .code-burst-digit,
  .code-burst-core,
  .code-burst-ring {
    animation: none;
    opacity: 0;
  }
}

/* Research / Workshop: pinned resource cards sit in a right-aligned row and push the view down. */
html[data-pinned-float-row] .resource-float-stage {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-end;
  width: max-content;
  max-width: calc(100% - 20px);
}

html[data-pinned-float-row] .resource-float-stage .resource-float-card {
  width: 88px;
}

html[data-pinned-float-row][data-resource-float-style="expanded"] .resource-float-stage .resource-float-card {
  width: 152px;
}

html[data-pinned-float-row] #research-view,
html[data-pinned-float-row] #overseer-view,
html[data-pinned-float-row] #store-view {
  padding-top: var(--pinned-float-space, 0px);
}

/* ---------- Challenges: one goal with a progress bar, then the coin rewards ---------- */
.challenges-view {
  display: grid;
  align-content: start;
  gap: 12px;
}

.challenge-current {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: var(--border-w) solid var(--accent);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

.challenge-current p {
  margin: 0;
}

.challenge-count {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.75;
}

.challenge-goal {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.3;
}

.challenge-bar {
  height: 12px;
  overflow: hidden;
  border-radius: 99px;
  background: color-mix(in srgb, var(--panel-border) 70%, transparent);
}

.challenge-bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}

.challenge-bar.is-late > span {
  background: color-mix(in srgb, var(--panel-border) 100%, transparent);
}

.challenge-progress {
  font-variant-numeric: tabular-nums;
}

.challenge-reward,
.challenge-coins,
.challenge-reward-card button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.monument-card.is-blocked {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 14%, var(--panel));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 45%, transparent);
}

.monument-card.is-blocked.is-locked {
  opacity: 0.85;
}

.rocket-requires {
  margin: 0;
  color: var(--danger);
  font-weight: 700;
}

.challenge-claim {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  justify-self: start;
  min-width: 9rem;
  min-height: 44px;
  padding: 10px 22px;
  border: var(--border-w) solid color-mix(in srgb, #6fbf73 55%, var(--panel-border));
  border-radius: var(--radius);
  background: var(--button);
  color: var(--text);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #6fbf73 28%, transparent), var(--control-shadow);
  font-size: 1.05rem;
  font-weight: 700;
}

.challenge-claim:hover {
  background: var(--button-hover);
}

.challenge-claim:active {
  transform: translateY(1px);
}

.challenge-coin-icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
}

.challenge-shop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.challenge-shop-head h3 {
  margin: 0;
}

.challenge-coins {
  font-weight: 700;
}

.challenge-shop {
  display: grid;
  gap: 8px;
}

.challenge-reward-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: var(--border-w) solid var(--panel-border);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

.challenge-reward-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.challenge-reward-copy h4,
.challenge-reward-copy p {
  margin: 0;
}

.challenge-reward-card button {
  justify-content: center;
  min-width: 4.5rem;
}

.challenge-reward-card.is-maxed {
  opacity: 0.65;
}

.challenges-view[hidden] {
  display: none;
}

/* Open all: a long prize list scrolls inside the gift screen. */
#gift-open-list.is-many {
  max-height: min(52vh, 460px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

/* Geode: a bigger tap target, and the prize name that floats up when it cracks. */
.gem-hit--geode {
  border-radius: 50%;
}

.geode-prize {
  position: absolute;
  z-index: 5;
  transform: translate(-50%, -50%);
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(20, 14, 30, 0.82);
  color: #f3dcff;
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 0 6px rgba(176, 107, 255, 0.7);
  animation: geode-prize-rise 2.2s ease-out forwards;
}

/* The juggle count: a quick pop over the geode on each tap that keeps it up. */
.geode-juggle {
  position: absolute;
  z-index: 5;
  transform: translate(-50%, -50%);
  color: #ffe9a8;
  font-weight: 800;
  font-size: 1.05rem;
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.6), 0 0 8px rgba(255, 196, 80, 0.7);
  animation: geode-juggle-pop 0.9s ease-out forwards;
}

@keyframes geode-juggle-pop {
  0% { opacity: 0; transform: translate(-50%, -80%) scale(0.6); }
  15% { opacity: 1; transform: translate(-50%, -140%) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -260%) scale(1); }
}

@keyframes geode-prize-rise {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(0.7); }
  12% { opacity: 1; transform: translate(-50%, -60%) scale(1.08); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -260%) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .geode-prize { animation-duration: 2.2s; animation-name: geode-prize-fade; }
  .geode-juggle { animation-name: geode-prize-fade; }
}

@keyframes geode-prize-fade {
  0%, 80% { opacity: 1; }
  100% { opacity: 0; }
}

/* ---------- Bonus families: one colour + icon per kind of bonus, used everywhere ---------- */
:root {
  --bonus-miner: #f39a4a;
  --bonus-tap: #f2d14b;
  --bonus-gem: #c890ff;
  --bonus-geode: #4fd6c8;
  --bonus-gift: #ff86b4;
  --bonus-science: #5fb4ff;
  --bonus-ore: #d4b48c;
  --bonus-magma: #ff6a5a;
}

[data-bonus-family="miner"] { --bonus: var(--bonus-miner); }
[data-bonus-family="tap"] { --bonus: var(--bonus-tap); }
[data-bonus-family="gem"] { --bonus: var(--bonus-gem); }
[data-bonus-family="geode"] { --bonus: var(--bonus-geode); }
[data-bonus-family="gift"] { --bonus: var(--bonus-gift); }
[data-bonus-family="science"] { --bonus: var(--bonus-science); }
[data-bonus-family="ore"] { --bonus: var(--bonus-ore); }
[data-bonus-family="magma"] { --bonus: var(--bonus-magma); }

/* Picture in the family colour, corner mark a lighter tint with a dark halo behind it. */
.bonus-icon {
  flex: none;
  width: 1.5em;
  height: 1.5em;
  overflow: visible;
  vertical-align: -0.4em;
}

.bonus-icon .bi-glyph {
  fill: none;
  stroke: var(--bonus, currentColor);
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bonus-icon .bi-glyph .bi-fill {
  fill: color-mix(in srgb, var(--bonus, currentColor) 35%, transparent);
  stroke: none;
}

.bonus-icon .bi-mark,
.bonus-icon .bi-halo {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bonus-icon .bi-mark {
  stroke: color-mix(in srgb, var(--bonus, currentColor) 45%, #fff);
  stroke-width: 2;
}

.bonus-icon .bi-halo {
  stroke: var(--bonus-halo, var(--button));
  stroke-width: 5;
}

.bonus-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--bonus, inherit);
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

/* Research and Workshop cards: the bonus line under the name; slightly smaller text so the
   cards stay about as tall as before. */
.research-section-grid button {
  font-size: 0.9rem;
}

.research-section-grid button .detail {
  font-size: 0.84rem;
  line-height: 1.35;
}

.research-bonuses {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  margin: 3px 0 2px;
  font-size: 0.8rem;
  line-height: 1.2;
}

/* Ore Processor: icon beside each total. */
.processor-chip {
  grid-template-columns: auto 1fr;
  column-gap: 7px;
  align-items: center;
  --bonus-halo: color-mix(in srgb, var(--bonus) 14%, var(--bg));
}

.processor-chip .processor-chip-icon {
  grid-row: span 2;
  width: 1.7em;
  height: 1.7em;
}

.processor-card {
  --bonus-halo: var(--panel);
}

/* Stats → Active effects: icon before each label. */
.stats-list dt[data-bonus-family] {
  display: flex;
  align-items: center;
  gap: 6px;
  --bonus-halo: var(--panel);
}

.stats-list dd[data-bonus-family] {
  color: var(--bonus);
}

/* Descension nodes: icon + family colour on the effect line. */
.descension-detail[data-bonus-family] {
  color: color-mix(in srgb, var(--bonus) 80%, var(--text));
}

.descension-detail .bonus-icon {
  width: 1.3em;
  height: 1.3em;
  margin-right: 2px;
}

/* Shard detail: bonus copy coloured by its family, icon in front. */
.shard-detail-bonus-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.shard-detail-bonus-line[data-bonus-family] {
  color: var(--bonus);
}

.shard-detail-card.is-gild-reveal .shard-detail-bonus-line {
  color: inherit;
}

.shard-detail-bonus .bonus-icon {
  --bonus-halo: var(--panel);
}

/* Research done: one soft pulse of the bonus colour from the bottom of the screen. */
.bonus-pulse {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 38vh;
  z-index: 60;
  pointer-events: none;
  background: radial-gradient(
    ellipse 75% 100% at 50% 100%,
    color-mix(in srgb, var(--bonus, #fff) 42%, transparent),
    color-mix(in srgb, var(--bonus, #fff) 12%, transparent) 55%,
    transparent 80%
  );
  transform-origin: 50% 100%;
  opacity: 0;
  animation: bonus-pulse 1.1s ease-out forwards;
}

@keyframes bonus-pulse {
  0% { opacity: 0; transform: scaleY(0.6); }
  30% { opacity: 1; transform: scaleY(1); }
  100% { opacity: 0; transform: scaleY(1.08); }
}

@media (prefers-reduced-motion: reduce) {
  .bonus-pulse {
    animation-duration: 0.8s;
    transform: none;
  }

  @keyframes bonus-pulse {
    0%, 100% { opacity: 0; }
    35% { opacity: 0.8; }
  }
}

/* Settings → Account */
.account-panel {
  display: grid;
  gap: 8px;
}

.account-name {
  margin: 0;
  font-weight: 700;
}

.account-status,
.account-error {
  margin: 0;
}

.account-error {
  color: var(--danger, #ff7a6a);
}

/* Which progress do you want to keep? */
.cloud-conflict-screen,
.purchase-signin-screen {
  /* Can open over the welcome-back screen, so it covers it fully. */
  z-index: 41;
  background: rgba(8, 6, 4, 0.97);
}

.cloud-conflict-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  width: min(100%, 460px);
  margin: 4px auto 0;
}

.cloud-conflict-option {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line, rgba(255, 255, 255, 0.18));
  border-radius: 10px;
  background: var(--panel, rgba(0, 0, 0, 0.25));
  text-align: left;
}

.cloud-conflict-option h2 {
  margin: 0;
  font-size: 1rem;
}

.cloud-conflict-stats {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.86rem;
  line-height: 1.4;
}

.cloud-conflict-stats li:last-child {
  margin-top: 4px;
  opacity: 0.8;
}

.cloud-conflict-later {
  margin-top: 10px;
}

/* Trophy Rating, under the Trophy Room's title. */
.trophy-room .tr-rating {
  display: grid;
  justify-items: center;
  gap: 1px;
  margin: 2px 0 0;
  line-height: 1.2;
}

.tr-rating-label {
  color: color-mix(in srgb, var(--tr-gold) 85%, #fff);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.tr-rating-value {
  color: var(--tr-gold);
  font-family: var(--font-title);
  font-size: 1.15rem;
  text-shadow: 0 2px 0 #5a3e0a, 0 0 14px rgba(255, 200, 90, 0.35);
}

.tr-rating-split {
  color: #cdbd9f;
  font-size: 0.72rem;
}

/* Server tab (Discord): players on this server by Trophy Rating. */
.server-panel {
  display: grid;
  gap: 10px;
}

.server-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.server-toolbar .server-refresh {
  min-height: 0;
  padding: 6px 12px;
}

.server-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.server-privacy {
  margin-top: -4px;
  font-size: 0.78rem;
}

.server-head {
  display: flex;
  justify-content: space-between;
  padding: 0 52px 0 76px;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.server-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.server-row {
  display: grid;
  grid-template-columns: 28px 32px minmax(0, 1fr) auto 40px;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 10px;
  border: 1px solid var(--line, rgba(255, 255, 255, 0.14));
  border-radius: 10px;
  background: var(--panel, rgba(0, 0, 0, 0.2));
}

.server-row.is-you {
  border-color: color-mix(in srgb, #e6be55 60%, transparent);
}

.server-rank {
  color: var(--muted);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.server-who {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 6px;
  min-width: 0;
}

.server-who strong {
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-handle {
  flex-basis: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-tag {
  padding: 0 6px;
  border-radius: 999px;
  background: color-mix(in srgb, #e6be55 25%, transparent);
  color: #f2d98a;
  font-size: 0.68rem;
  text-transform: uppercase;
}

.server-tag.is-hidden {
  background: rgba(255, 255, 255, 0.1);
  color: var(--muted);
}

.server-rating {
  color: #e6be55;
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

.server-room-button {
  display: grid;
  place-items: center;
  width: 40px;
  min-width: 0;
  height: 40px;
  min-height: 0;
  margin: 0;
  padding: 0;
}

.server-room-button .view-tab-icon {
  width: 22px;
  height: 22px;
}

.server-room-button:disabled {
  opacity: 0.35;
}

.server-star,
.server-star-gap {
  width: 32px;
  height: 32px;
}

.server-star {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.server-star svg {
  width: 22px;
  height: 22px;
}

.server-star.is-friend {
  color: #f2c94c;
}

.server-error {
  color: var(--danger, #ff7a6a);
}

.server-room-viewer {
  z-index: 901;
}

/* Community → Friends: your username and adding a friend. */
.community-me,
.community-add {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line, rgba(255, 255, 255, 0.14));
  border-radius: 10px;
  background: var(--panel, rgba(0, 0, 0, 0.2));
}

.community-label {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.community-username {
  font-size: 1.15rem;
  overflow-wrap: anywhere;
}

.community-add-row {
  display: flex;
  gap: 8px;
}

.community-add-row input {
  flex: 1;
  min-width: 0;
}

.community-add-row button {
  min-height: 0;
  padding: 6px 14px;
}

.community-added {
  color: var(--good, #7bd36a);
}

/* Loading screen: under the studio intro, over the game until it has started. */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 990;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  padding: 24px;
  background: radial-gradient(ellipse at 50% 40%, #232a30, #0d1013 75%);
  color: #f0c94a;
  text-align: center;
}

.loading-screen.is-done {
  animation: loading-out 0.35s ease-in 0.3s forwards;
}

.loading-bar {
  display: grid;
  grid-template-columns: repeat(20, 1fr);
  gap: 3px;
  width: min(86vw, 420px);
  padding: 5px;
  border: 2px solid #c9a227;
  border-radius: 6px;
  background: #07090b;
  box-shadow: 0 0 0 3px #3b2f14, 0 10px 30px rgba(0, 0, 0, 0.6);
}

.loading-bar span {
  aspect-ratio: 1;
  border-radius: 2px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.28), inset 0 -2px 0 rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(-6px) scale(0.6);
  animation: loading-block 0.22s ease-out forwards;
}
.loading-bar span:nth-child(1) { background: #c9bba8; animation-delay: 1.60s; }
.loading-bar span:nth-child(2) { background: #b5836a; animation-delay: 1.76s; }
.loading-bar span:nth-child(3) { background: #6b6e73; animation-delay: 1.92s; }
.loading-bar span:nth-child(4) { background: #9aa4ab; animation-delay: 2.08s; }
.loading-bar span:nth-child(5) { background: #d8d0b8; animation-delay: 2.24s; }
.loading-bar span:nth-child(6) { background: #4a5560; animation-delay: 2.40s; }
.loading-bar span:nth-child(7) { background: #c4a574; animation-delay: 2.56s; }
.loading-bar span:nth-child(8) { background: #9a8b78; animation-delay: 2.72s; }
.loading-bar span:nth-child(9) { background: #7a8a6a; animation-delay: 2.88s; }
.loading-bar span:nth-child(10) { background: #d4a090; animation-delay: 3.04s; }
.loading-bar span:nth-child(11) { background: #e8e4dc; animation-delay: 3.20s; }
.loading-bar span:nth-child(12) { background: #c5d5e0; animation-delay: 3.36s; }
.loading-bar span:nth-child(13) { background: #8a8580; animation-delay: 3.52s; }
.loading-bar span:nth-child(14) { background: #3d3a3a; animation-delay: 3.68s; }
.loading-bar span:nth-child(15) { background: #2a2040; animation-delay: 4.54s; }
.loading-bar span:nth-child(16) { background: #d8be2c; animation-delay: 5.24s; }
.loading-bar span:nth-child(17) { background: #7caf4a; animation-delay: 5.94s; }
.loading-bar span:nth-child(18) { background: #9ec8e8; animation-delay: 6.64s; }
.loading-bar span:nth-child(19) { background: #ff6a1a; animation-delay: 7.34s; }
.loading-bar span:nth-child(20) { background: #3a6fd6; animation-delay: 8.04s; }
.loading-screen.is-done .loading-bar span:nth-child(1) { animation-delay: 0.000s; }
.loading-screen.is-done .loading-bar span:nth-child(2) { animation-delay: 0.012s; }
.loading-screen.is-done .loading-bar span:nth-child(3) { animation-delay: 0.024s; }
.loading-screen.is-done .loading-bar span:nth-child(4) { animation-delay: 0.036s; }
.loading-screen.is-done .loading-bar span:nth-child(5) { animation-delay: 0.048s; }
.loading-screen.is-done .loading-bar span:nth-child(6) { animation-delay: 0.060s; }
.loading-screen.is-done .loading-bar span:nth-child(7) { animation-delay: 0.072s; }
.loading-screen.is-done .loading-bar span:nth-child(8) { animation-delay: 0.084s; }
.loading-screen.is-done .loading-bar span:nth-child(9) { animation-delay: 0.096s; }
.loading-screen.is-done .loading-bar span:nth-child(10) { animation-delay: 0.108s; }
.loading-screen.is-done .loading-bar span:nth-child(11) { animation-delay: 0.120s; }
.loading-screen.is-done .loading-bar span:nth-child(12) { animation-delay: 0.132s; }
.loading-screen.is-done .loading-bar span:nth-child(13) { animation-delay: 0.144s; }
.loading-screen.is-done .loading-bar span:nth-child(14) { animation-delay: 0.156s; }
.loading-screen.is-done .loading-bar span:nth-child(15) { animation-delay: 0.168s; }
.loading-screen.is-done .loading-bar span:nth-child(16) { animation-delay: 0.180s; }
.loading-screen.is-done .loading-bar span:nth-child(17) { animation-delay: 0.192s; }
.loading-screen.is-done .loading-bar span:nth-child(18) { animation-delay: 0.204s; }
.loading-screen.is-done .loading-bar span:nth-child(19) { animation-delay: 0.216s; }
.loading-screen.is-done .loading-bar span:nth-child(20) { animation-delay: 0.228s; }

.loading-text {
  margin: 0;
  max-width: 26em;
  font-family: var(--font-title, monospace);
  font-size: 0.7rem;
  line-height: 1.7;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@keyframes loading-block {
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes loading-out {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading-bar span {
    transform: none;
  }
}

/* Settings info: newer version available. */
.info-list .info-update {
  align-items: center;
}

.info-list .info-update .name {
  color: var(--good, #7bd36a);
  font-weight: 700;
}

.info-update-button {
  min-height: 0;
  margin: 0;
  padding: 4px 10px;
}

/* Full-screen Trophy Rooms: a Close button in the bottom-right corner too. */
.tr-fullscreen .tr-close-bottom {
  position: absolute;
  right: 14px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
  z-index: 2;
  min-height: 0;
  margin: 0;
  padding: 8px 16px;
  border: 1px solid rgba(230, 190, 85, 0.6);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: #e6be55;
  font-family: var(--font-title);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

/* Fill in the depths: one row per thing kept or lost, its icon as the bullet. */
.descension-reset-list {
  padding-left: 0;
  gap: 0.4rem;
  list-style: none;
}

/* Keep text clear of the pane's scrollbar on the right. */
#descension-reset {
  padding-right: 12px;
}

.descension-reset-list .descension-reset-part {
  display: flex;
  align-items: center;
  gap: 0.45em;
}

.descension-reset-list .descension-reset-part > :first-child {
  flex: none;
  width: 1.15em;
  height: 1.15em;
  margin: 0;
}

/* Yellow bar: this run's ore toward the next perk point. */
.depths-progress {
  display: grid;
  gap: 5px;
  margin-bottom: 4px;
}

.depths-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
}

.depths-progress-head > :first-child {
  color: #f2c94c;
}

.depths-progress-head > :last-child {
  color: var(--muted);
  font-weight: 600;
}

.depths-progress-bar {
  height: 12px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, #f2c94c 55%, transparent);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
}

.depths-progress-bar > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, #ffe07a, #f2c94c 55%, #d4a12a);
  box-shadow: 0 0 10px rgba(242, 201, 76, 0.45);
  transition: width 0.4s ease-out;
}
