:root {
  color-scheme: dark;
  --bg: #120d0b;
  --bg-deep: #080605;
  --panel: rgba(22, 16, 13, 0.78);
  --panel-strong: rgba(30, 22, 18, 0.92);
  --line: rgba(190, 130, 83, 0.24);
  --line-strong: rgba(215, 156, 98, 0.42);
  --text: #f3e3cf;
  --muted: #b8a18a;
  --ember: #d16d3c;
  --amber: #d8a55d;
  --rust: #8a4c34;
  --coin: #d8bf75;
  --good: #85b687;
  --bad: #b46f62;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  --radius: 22px;
  --hammer-width: 30rem;
  --hammer-height: 16.5rem;
  --hammer-padding: 2.4rem 2rem;
  --hammer-label-size: clamp(2rem, 4.8vw, 3.4rem);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at top, rgba(177, 82, 44, 0.22), transparent 33%),
    radial-gradient(circle at bottom, rgba(68, 40, 29, 0.6), transparent 45%),
    linear-gradient(180deg, #0a0807 0%, #120d0b 45%, #1a1310 100%);
  color: var(--text);
  font-family: "Avenir Next Condensed", "Franklin Gothic Medium", "Arial Narrow", sans-serif;
  overflow-x: hidden;
}

body.is-locked {
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.01) 1px, transparent 1px);
  background-size: 120px 120px;
  pointer-events: none;
  opacity: 0.35;
  mix-blend-mode: soft-light;
}

.page-shell {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
}

.page-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 25%, rgba(230, 175, 103, 0.08), transparent 20%),
    linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.32) 100%);
  pointer-events: none;
}

.page-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px),
    radial-gradient(circle at 70% 40%, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px),
    radial-gradient(circle at 50% 75%, rgba(255, 255, 255, 0.028) 0 1px, transparent 1px);
  background-size: 210px 210px;
  opacity: 0.25;
  pointer-events: none;
}

.atmosphere,
.spark-layer,
.toast-stack {
  pointer-events: none;
}

.sky-glow,
.smoke-band,
.ground-haze {
  position: absolute;
  border-radius: 999px;
  filter: blur(18px);
}

.sky-glow-left {
  top: 8vh;
  left: -10vw;
  width: 42vw;
  height: 42vw;
  background: radial-gradient(circle, rgba(137, 72, 43, 0.32), transparent 72%);
  animation: drift 18s ease-in-out infinite alternate;
}

.sky-glow-right {
  top: 24vh;
  right: -12vw;
  width: 32vw;
  height: 32vw;
  background: radial-gradient(circle, rgba(83, 55, 41, 0.3), transparent 74%);
  animation: drift 22s ease-in-out infinite alternate-reverse;
}

.smoke-band {
  left: 50%;
  width: 60vw;
  height: 16vh;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(86, 69, 60, 0.12), transparent);
  animation: smoke 24s linear infinite;
}

.smoke-band-one {
  top: 16vh;
}

.smoke-band-two {
  top: 32vh;
  animation-delay: -9s;
}

.ground-haze {
  left: 50%;
  bottom: -12vh;
  width: 120vw;
  height: 36vh;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(83, 47, 29, 0.52), transparent 70%);
}

.game-layout {
  position: relative;
  z-index: 1;
  width: min(1240px, calc(100vw - 2rem));
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100svh;
  height: 100vh;
  height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 0.85rem;
  padding: 1rem 0;
}

.forge-stage {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 0.75rem;
  min-height: 0;
}

.forge-header {
  width: min(100%, 56rem);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.1rem 0.2rem 0;
}

.forge-heading {
  min-width: 0;
}

.forge-kicker {
  margin: 0 0 0.28rem;
  color: rgba(218, 168, 102, 0.72);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.forge-title-row {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.forge-title {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: 500;
  line-height: 0.95;
}

.forge-owner {
  margin: 0;
  color: rgba(236, 221, 198, 0.7);
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.forge-scoreboard {
  min-width: 13rem;
  padding: 0.72rem 0.9rem 0.76rem;
  border-radius: 18px;
  border: 1px solid rgba(217, 163, 100, 0.18);
  background: rgba(15, 11, 9, 0.58);
  text-align: right;
  box-shadow: inset 0 1px 0 rgba(255, 237, 208, 0.04);
}

.forge-scoreboard-label {
  display: block;
  color: rgba(222, 201, 172, 0.58);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.forge-scoreboard-value {
  display: block;
  margin-top: 0.24rem;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  font-size: 1.15rem;
  line-height: 1.1;
}

.forge-core {
  position: relative;
  width: min(34rem, 100%);
  display: grid;
  place-items: center;
  padding: 0.5rem 1rem 0.25rem;
  min-height: 0;
}

.hammer-button {
  position: relative;
  width: min(var(--hammer-width), 100%);
  min-height: var(--hammer-height);
  border: 1px solid rgba(212, 151, 100, 0.26);
  background:
    linear-gradient(180deg, rgba(89, 50, 31, 0.74) 0%, rgba(33, 22, 17, 0.94) 100%),
    radial-gradient(circle at top, rgba(230, 178, 110, 0.18), transparent 40%);
  box-shadow:
    inset 0 1px 0 rgba(255, 226, 188, 0.08),
    inset 0 -26px 50px rgba(0, 0, 0, 0.28),
    0 28px 80px rgba(0, 0, 0, 0.42);
  color: var(--text);
  padding: var(--hammer-padding);
  cursor: pointer;
  border-radius: 46% 54% 38% 62% / 56% 47% 53% 44%;
  transition: all 0.4s ease;
  isolation: isolate;
}

.hammer-button:hover {
  transform: translateY(-2px);
  border-color: rgba(235, 180, 112, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 226, 188, 0.08),
    inset 0 -26px 50px rgba(0, 0, 0, 0.28),
    0 32px 90px rgba(0, 0, 0, 0.48),
    0 0 38px rgba(201, 105, 55, 0.16);
}

.hammer-button:active,
.hammer-button.is-pressed {
  transform: translateY(3px) scale(0.995);
}

.hammer-button.btn-xl {
  --hammer-width: 30rem;
  --hammer-height: 16.5rem;
  --hammer-padding: 2.4rem 2rem;
  --hammer-label-size: clamp(2rem, 4.8vw, 3.4rem);
}

.hammer-button.btn-lg {
  --hammer-width: 22rem;
  --hammer-height: 12.4rem;
  --hammer-padding: 1.8rem 1.7rem;
  --hammer-label-size: clamp(1.7rem, 3.2vw, 2.7rem);
}

.hammer-button.btn-md {
  --hammer-width: 18rem;
  --hammer-height: 9.8rem;
  --hammer-padding: 1.3rem 1.4rem;
  --hammer-label-size: clamp(1.35rem, 2.3vw, 2rem);
}

.hammer-rim {
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(242, 188, 120, 0.13);
  border-radius: 50% 50% 42% 58% / 54% 50% 50% 46%;
  pointer-events: none;
}

.hammer-label {
  display: block;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  font-size: var(--hammer-label-size);
  line-height: 0.95;
  letter-spacing: 0.02em;
  margin-bottom: 0.55rem;
}

.hammer-detail {
  display: block;
  color: rgba(241, 227, 207, 0.78);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.spark-layer {
  position: absolute;
  inset: 0;
  overflow: visible;
}

.spark {
  position: absolute;
  left: 50%;
  top: 54%;
  color: var(--amber);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  animation: spark-rise 900ms ease-out forwards;
  white-space: nowrap;
  text-shadow: 0 0 12px rgba(255, 191, 106, 0.28);
}

.systems-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: 0.85rem;
  align-items: stretch;
  min-height: 0;
}

.panel-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(25, 18, 15, 0.92), rgba(17, 12, 10, 0.84));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition:
    opacity 500ms ease,
    transform 500ms ease,
    border-color 280ms ease;
}

.panel-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(236, 198, 154, 0.04), transparent 24%);
  pointer-events: none;
}

.panel-shell.is-hidden {
  opacity: 0;
  transform: translateY(24px);
  visibility: hidden;
  max-height: 0;
  min-height: 0;
  padding: 0;
  margin: 0;
  border-width: 0;
  box-shadow: none;
}

.panel-shell:not(.is-hidden) {
  opacity: 1;
  transform: none;
  visibility: visible;
}

.summary-strip {
  width: min(100%, 56rem);
  padding: 0.8rem 0.95rem 0.9rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
}

.summary-chip {
  padding: 0.72rem 0.8rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.summary-chip span {
  display: block;
}

.summary-chip-label {
  color: rgba(235, 221, 199, 0.62);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.summary-chip-value {
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  font-size: 1.18rem;
  line-height: 1;
}

.panel-head {
  padding: 0.85rem 1rem 0;
}

.panel-kicker {
  margin: 0 0 0.42rem;
  color: rgba(212, 165, 112, 0.75);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.panel-head h2 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  font-size: 1.45rem;
  font-weight: 500;
}

.card-list {
  display: grid;
  gap: 0.7rem;
  padding: 0.8rem 1rem 1rem;
  overflow: auto;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(216, 165, 93, 0.35) transparent;
}

.card {
  position: relative;
  display: grid;
  gap: 0.7rem;
  align-items: start;
  padding: 0.85rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 100%),
    rgba(255, 255, 255, 0.015);
}

.card-topline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: space-between;
  align-items: flex-start;
}

.card-heading {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.card-title {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.card-subtitle {
  margin: 0;
  color: rgba(235, 221, 199, 0.68);
  font-size: 0.74rem;
  line-height: 1.4;
}

.card-meta {
  color: rgba(242, 230, 212, 0.76);
  font-size: 0.78rem;
  white-space: nowrap;
}

.card-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tag {
  padding: 0.28rem 0.48rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: rgba(233, 220, 201, 0.76);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.action-row {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.cost-label {
  color: rgba(235, 221, 199, 0.66);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.card button,
.wide-button {
  appearance: none;
  border: 1px solid rgba(229, 171, 103, 0.24);
  background: linear-gradient(180deg, rgba(214, 130, 71, 0.24), rgba(94, 50, 31, 0.54));
  color: var(--text);
  padding: 0.65rem 0.85rem;
  border-radius: 999px;
  font: inherit;
  letter-spacing: 0.1em;
  font-size: 0.76rem;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    transform 140ms ease,
    border-color 180ms ease,
    background 180ms ease,
    opacity 180ms ease;
}

.card button:hover,
.wide-button:hover {
  transform: translateY(-1px);
  border-color: rgba(229, 171, 103, 0.42);
  background: linear-gradient(180deg, rgba(226, 148, 83, 0.3), rgba(104, 56, 36, 0.68));
}

.card button:disabled,
.wide-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.market-summary,
.prestige-copy,
.leaderboard-status {
  padding: 0.8rem 1rem 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.9rem;
}

.market-summary strong,
.prestige-copy strong,
.leaderboard-status strong {
  color: var(--text);
  font-weight: 600;
}

.market-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.market-price {
  font-size: 0.9rem;
}

.market-price.is-good {
  color: var(--good);
}

.market-price.is-bad {
  color: var(--bad);
}

.wide-button {
  width: calc(100% - 2rem);
  margin: auto 1rem 1rem;
}

.support-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(216, 165, 93, 0.24);
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(221, 138, 74, 0.18), transparent 38%),
    linear-gradient(135deg, rgba(28, 19, 15, 0.92), rgba(17, 12, 10, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 230, 198, 0.05),
    0 22px 60px rgba(0, 0, 0, 0.24);
}

.support-footer-copy {
  display: grid;
  gap: 0.24rem;
  min-width: 0;
}

.support-footer-kicker {
  color: rgba(216, 165, 93, 0.78);
  font-size: 0.64rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.support-footer-headline {
  color: var(--text);
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  line-height: 1.28;
}

.support-footer-note {
  color: rgba(235, 221, 199, 0.72);
  font-size: 0.78rem;
  line-height: 1.45;
}

.support-footer-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.82rem 1.18rem;
  border-radius: 999px;
  border: 1px solid rgba(240, 187, 112, 0.42);
  background: linear-gradient(180deg, rgba(214, 134, 74, 0.32), rgba(94, 50, 31, 0.92));
  color: var(--text);
  text-decoration: none;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow:
    inset 0 1px 0 rgba(255, 225, 184, 0.08),
    0 0 0 1px rgba(255, 198, 120, 0.04),
    0 0 30px rgba(209, 109, 60, 0.16);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease;
}

.support-footer-link:hover,
.support-footer-link:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(249, 201, 138, 0.56);
  background: linear-gradient(180deg, rgba(224, 145, 83, 0.42), rgba(102, 54, 34, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 225, 184, 0.08),
    0 0 0 1px rgba(255, 198, 120, 0.08),
    0 0 36px rgba(214, 134, 74, 0.24);
}

.support-prompt {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 6;
  width: min(25rem, calc(100vw - 2rem));
  padding: 1rem 1rem 0.95rem;
  border-radius: 22px;
  border: 1px solid rgba(224, 168, 105, 0.28);
  background:
    radial-gradient(circle at top right, rgba(216, 126, 74, 0.18), transparent 36%),
    linear-gradient(180deg, rgba(31, 21, 17, 0.96), rgba(17, 12, 10, 0.96));
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.34),
    0 0 28px rgba(214, 134, 74, 0.12);
  animation: support-prompt-in 240ms ease-out both;
}

.support-prompt[hidden] {
  display: none;
}

.support-prompt-kicker {
  margin: 0;
  color: rgba(216, 165, 93, 0.8);
  font-size: 0.64rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.support-prompt-copy {
  margin: 0.45rem 0 0;
  color: var(--text);
  line-height: 1.55;
  font-size: 0.95rem;
}

.support-prompt-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.95rem;
}

.support-prompt-link,
.support-prompt-dismiss {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  min-height: 2.7rem;
  padding: 0.72rem 1rem;
  font: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease,
    color 180ms ease;
}

.support-prompt-link {
  border: 1px solid rgba(240, 187, 112, 0.4);
  background: linear-gradient(180deg, rgba(214, 134, 74, 0.32), rgba(94, 50, 31, 0.92));
  color: var(--text);
}

.support-prompt-link:hover,
.support-prompt-link:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(249, 201, 138, 0.56);
}

.support-prompt-dismiss {
  border: 1px solid rgba(215, 156, 98, 0.22);
  background: rgba(12, 9, 7, 0.72);
  color: rgba(243, 227, 207, 0.72);
}

.support-prompt-dismiss:hover,
.support-prompt-dismiss:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(235, 180, 112, 0.36);
  color: var(--text);
}

.toast-stack {
  position: fixed;
  left: 50%;
  bottom: 1.4rem;
  transform: translateX(-50%);
  width: min(36rem, calc(100vw - 2rem));
  display: grid;
  gap: 0.65rem;
  z-index: 5;
}

.toast {
  padding: 1rem 1.1rem;
  border-radius: 18px;
  border: 1px solid rgba(224, 168, 105, 0.3);
  background: rgba(20, 14, 11, 0.92);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
  color: var(--text);
  line-height: 1.65;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  font-size: 1rem;
  animation: toast-in-out 9s ease forwards;
}

.page-shell[data-phase="embers"] .hammer-button {
  background:
    linear-gradient(180deg, rgba(106, 57, 35, 0.78) 0%, rgba(36, 23, 18, 0.96) 100%),
    radial-gradient(circle at top, rgba(240, 184, 112, 0.2), transparent 40%);
}

.page-shell[data-phase="work"] .hammer-button {
  box-shadow:
    inset 0 1px 0 rgba(255, 226, 188, 0.08),
    inset 0 -26px 50px rgba(0, 0, 0, 0.28),
    0 32px 90px rgba(0, 0, 0, 0.48),
    0 0 48px rgba(187, 102, 60, 0.18);
}

.page-shell[data-phase="market"] .panel-shell {
  border-color: rgba(202, 158, 92, 0.3);
}

.page-shell[data-phase="legacy"] .hammer-button {
  background:
    linear-gradient(180deg, rgba(73, 53, 39, 0.82) 0%, rgba(31, 24, 20, 0.95) 100%),
    radial-gradient(circle at top, rgba(211, 177, 127, 0.22), transparent 42%);
}

.page-shell[data-phase="legacy"] .panel-shell {
  border-color: rgba(211, 177, 127, 0.34);
}

#market-panel {
  grid-column: span 2;
}

#leaderboard-panel {
  grid-column: 1 / -1;
}

.leaderboard-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem 0.7rem;
  padding: 0.75rem 1rem 1rem;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.62rem 0.75rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 100%),
    rgba(255, 255, 255, 0.015);
}

.leaderboard-row.is-self {
  border-color: rgba(226, 171, 103, 0.44);
  background:
    linear-gradient(180deg, rgba(233, 170, 98, 0.12), transparent 100%),
    rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 0 0 1px rgba(233, 170, 98, 0.12);
}

.leaderboard-rank {
  min-width: 2.1rem;
  color: rgba(221, 198, 168, 0.64);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.leaderboard-meta {
  min-width: 0;
}

.leaderboard-name,
.leaderboard-score {
  display: block;
}

.leaderboard-name {
  font-size: 0.96rem;
  line-height: 1.1;
}

.leaderboard-note {
  display: block;
  margin-top: 0.14rem;
  color: rgba(235, 221, 199, 0.56);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.leaderboard-score {
  color: rgba(243, 227, 207, 0.8);
  font-size: 0.8rem;
  line-height: 1.3;
  text-align: right;
}

.name-entry-overlay {
  position: fixed;
  inset: 0;
  z-index: 9;
  display: grid;
  place-items: center;
  padding: 1rem;
  background:
    radial-gradient(circle at top, rgba(185, 95, 47, 0.18), transparent 32%),
    rgba(8, 6, 5, 0.78);
  backdrop-filter: blur(12px);
}

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

.name-entry-card {
  width: min(28rem, 100%);
  padding: 1.45rem;
  border-radius: 24px;
  border: 1px solid rgba(216, 165, 93, 0.24);
  background:
    linear-gradient(180deg, rgba(37, 26, 21, 0.96), rgba(16, 12, 10, 0.92)),
    rgba(15, 11, 9, 0.92);
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 230, 198, 0.05);
}

.name-entry-kicker {
  margin: 0;
  color: rgba(216, 165, 93, 0.74);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.name-entry-card h2 {
  margin: 0.55rem 0 0;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  font-size: clamp(2rem, 6vw, 2.6rem);
  line-height: 0.96;
  font-weight: 500;
}

.name-entry-copy {
  margin: 0.9rem 0 0;
  color: rgba(236, 221, 198, 0.72);
  line-height: 1.6;
}

.name-entry-form {
  display: grid;
  gap: 0.8rem;
  margin-top: 1rem;
}

.name-entry-form input {
  width: 100%;
  appearance: none;
  border: 1px solid rgba(226, 171, 103, 0.22);
  border-radius: 16px;
  background: rgba(11, 8, 7, 0.82);
  color: var(--text);
  padding: 0.95rem 1rem;
  font: inherit;
  font-size: 1rem;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.name-entry-form input:focus {
  outline: none;
  border-color: rgba(235, 180, 112, 0.48);
  box-shadow: 0 0 0 3px rgba(216, 165, 93, 0.12);
}

.name-entry-form input::placeholder {
  color: rgba(235, 221, 199, 0.36);
}

.name-entry-button {
  width: 100%;
  margin: 0;
}

.name-entry-error {
  min-height: 1.1rem;
  margin: 0.75rem 0 0;
  color: #f0b38d;
  font-size: 0.84rem;
}

.page-shell[data-phase="quiet"][data-leaderboard="hidden"] .game-layout {
  justify-content: center;
}

.page-shell[data-phase="quiet"][data-leaderboard="hidden"] .forge-stage {
  min-height: calc(100svh - 6rem);
  align-content: center;
}

.page-shell[data-phase="quiet"][data-leaderboard="hidden"] .forge-core {
  padding-top: 1.75rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.noscript-note {
  position: fixed;
  inset: auto 1rem 1rem;
  border: 1px solid rgba(212, 165, 112, 0.28);
  background: rgba(20, 14, 11, 0.94);
  color: var(--text);
  padding: 0.85rem 1rem;
  border-radius: 14px;
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(4vw, -2vh, 0);
  }
}

@keyframes smoke {
  from {
    transform: translateX(-52%) translateY(0);
  }
  to {
    transform: translateX(-48%) translateY(-1.6vh);
  }
}

@keyframes spark-rise {
  0% {
    opacity: 0;
    transform: translate(-50%, 0) scale(0.8);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--spark-x, 0px)), -42px) scale(1);
  }
}

@keyframes toast-in-out {
  0% {
    opacity: 0;
    transform: translateY(18px);
  }
  10%,
  78% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(14px);
  }
}

@keyframes support-prompt-in {
  from {
    opacity: 0;
    transform: translate3d(0, -10px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@media (max-width: 1100px) {
  .game-layout {
    width: min(100vw - 1.5rem, 62rem);
  }

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

  #market-panel,
  #prestige-panel,
  #leaderboard-panel {
    grid-column: span 2;
  }
}

@media (max-width: 900px) {
  .game-layout {
    width: min(100vw - 1.25rem, 46rem);
    min-height: 100svh;
    height: auto;
    padding-top: 4rem;
    padding-bottom: 4rem;
  }

  .systems-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }

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

  #market-panel,
  #prestige-panel,
  #leaderboard-panel {
    grid-column: auto;
  }

  .hammer-button {
    padding-inline: 1.4rem;
  }

  .forge-header {
    flex-direction: column;
    align-items: stretch;
  }

  .forge-scoreboard {
    min-width: 0;
    text-align: left;
  }

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

  .support-footer {
    padding-inline: 0.95rem;
  }

  .support-prompt {
    left: 1rem;
    right: 1rem;
    width: auto;
  }
}

@media (max-width: 560px) {
  .forge-core {
    padding-top: 2.4rem;
  }

  .hammer-button {
    width: 100%;
    min-height: 13.5rem;
    border-radius: 36px;
  }

  .hammer-label {
    font-size: clamp(1.8rem, 10vw, 2.8rem);
  }

  .hammer-detail,
  .cost-label {
    letter-spacing: 0.1em;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .forge-title-row {
    gap: 0.4rem;
  }

  .forge-owner {
    font-size: 0.74rem;
  }

  .action-row,
  .market-row {
    align-items: stretch;
  }

  .action-row button,
  .market-row button {
    width: 100%;
  }

  .support-footer {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    padding: 0.95rem;
  }

  .name-entry-card {
    padding: 1.2rem;
  }

  .support-footer-link {
    width: 100%;
  }

  .support-prompt {
    top: auto;
    bottom: 7rem;
  }

  .support-prompt-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .support-prompt-link,
  .support-prompt-dismiss {
    width: 100%;
  }
}
