:root {
  --ink: #0c0b09;
  --ink-2: #14120e;
  --ink-3: #1c1914;
  --paper: #f4efe6;
  --muted: #9a9182;
  --gold: #c9a227;
  --gold-bright: #e0bc4a;
  --gold-deep: #8f7318;
  --line: rgba(201, 162, 39, 0.22);
  --ok: #7cbc6a;
  --font-d: "Syne", system-ui, sans-serif;
  --font-b: "Figtree", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-b);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100dvh;
  overflow-x: hidden;
  position: relative;
}

.skyline {
  position: fixed;
  inset: auto 0 0;
  height: min(32vh, 280px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
}

.skyline-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem clamp(1rem, 3vw, 1.75rem);
  background: rgba(12, 11, 9, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--gold-bright);
  font-family: var(--font-d);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.brand img { display: block; }

.top-stats {
  display: flex;
  gap: clamp(0.75rem, 3vw, 2rem);
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.15;
}

.stat-label {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat strong {
  font-family: var(--font-d);
  font-size: clamp(0.95rem, 2.5vw, 1.2rem);
  color: var(--gold-bright);
}

.exit {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  white-space: nowrap;
}

.exit:hover { color: var(--gold-bright); }

.layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(1rem, 3vw, 2rem);
  width: min(1120px, calc(100% - 2rem));
  margin: 1.25rem auto 3rem;
  align-items: start;
}

.stage {
  position: relative;
  padding: clamp(1.25rem, 3vw, 2rem);
  background: linear-gradient(180deg, rgba(28, 25, 20, 0.92), rgba(12, 11, 9, 0.7));
  border: 1px solid var(--line);
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.eyebrow {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}

.stage h1 {
  margin: 0 0 0.65rem;
  font-family: var(--font-d);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
  max-width: 16ch;
}

.lead {
  margin: 0 0 2rem;
  color: var(--muted);
  max-width: 36ch;
  font-size: 0.98rem;
}

.collect-btn {
  position: relative;
  width: min(100%, 280px);
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  background:
    radial-gradient(circle at 35% 30%, #e0bc4a, #c9a227 45%, #8f7318 100%);
  color: var(--ink);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.35rem;
  box-shadow:
    0 0 0 10px rgba(201, 162, 39, 0.12),
    0 20px 50px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s var(--ease), box-shadow 0.2s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.collect-btn:hover {
  transform: scale(1.03);
}

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

.collect-ring {
  position: absolute;
  inset: -14px;
  border: 1px solid rgba(224, 188, 74, 0.35);
  border-radius: 50%;
  animation: pulse 2.8s var(--ease) infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.06); opacity: 0.25; }
}

.collect-icon { display: grid; place-items: center; }
.collect-label {
  font-family: var(--font-d);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}
.collect-sub {
  font-size: 0.85rem;
  font-weight: 700;
  opacity: 0.75;
}

.float-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.float {
  position: absolute;
  font-family: var(--font-d);
  font-weight: 700;
  color: var(--gold-bright);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
  animation: floatUp 0.9s var(--ease) forwards;
  font-size: 1.05rem;
}

@keyframes floatUp {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-70px) scale(1.15); }
}

.progress-box {
  width: min(100%, 360px);
  margin-top: 2rem;
  text-align: left;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

.progress-track {
  height: 6px;
  background: rgba(244, 239, 230, 0.08);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-bright));
  transition: width 0.35s var(--ease);
}

.btn-prestige {
  width: 100%;
  margin-top: 0.85rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold-bright);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.25s, color 0.25s;
}

.btn-prestige:enabled:hover {
  background: var(--gold);
  color: var(--ink);
}

.btn-prestige:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.panel {
  background: var(--ink-2);
  border: 1px solid var(--line);
  padding: 1rem;
  position: sticky;
  top: 4.5rem;
  max-height: calc(100dvh - 5.5rem);
  overflow: auto;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0.7rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.tab.is-active {
  color: var(--gold-bright);
  border-bottom-color: var(--gold);
}

.shop {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.shop-item {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem;
  background: var(--ink-3);
  border: 1px solid transparent;
  transition: border-color 0.2s, background 0.2s;
}

.shop-item:hover {
  border-color: var(--line);
}

.shop-item.is-locked {
  opacity: 0.45;
}

.shop-ico {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: rgba(201, 162, 39, 0.1);
  color: var(--gold-bright);
}

.shop-ico svg {
  width: 32px;
  height: 32px;
}

.shop-meta h3 {
  margin: 0 0 0.2rem;
  font-family: var(--font-d);
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}

.shop-meta p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.buy-btn {
  border: 0;
  background: var(--gold);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  font-size: 0.78rem;
  padding: 0.55rem 0.7rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, transform 0.15s;
}

.buy-btn:hover:not(:disabled) {
  background: var(--gold-bright);
  transform: translateY(-1px);
}

.buy-btn:disabled {
  background: #3a352c;
  color: var(--muted);
  cursor: not-allowed;
}

.owned {
  display: block;
  font-size: 0.72rem;
  color: var(--gold);
  margin-top: 0.15rem;
}

.hint {
  margin: 1.25rem 0 0.75rem;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.45;
}

.btn-reset {
  width: 100%;
  border: 1px solid rgba(244, 239, 230, 0.12);
  background: transparent;
  color: var(--muted);
  padding: 0.65rem;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.btn-reset:hover {
  color: #e07a6a;
  border-color: rgba(224, 122, 106, 0.4);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink-3);
  border: 1px solid var(--line);
  color: var(--paper);
  padding: 0.75rem 1.1rem;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  z-index: 50;
  transition: opacity 0.3s, transform 0.3s var(--ease);
}

.toast.is-on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

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

  .panel {
    position: static;
    max-height: none;
  }

  .top-stats .stat:nth-child(3) {
    display: none;
  }

  .exit {
    display: none;
  }

  .stage {
    min-height: auto;
    padding-bottom: 2rem;
  }

  .collect-btn {
    width: min(100%, 220px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .collect-ring,
  .float {
    animation: none !important;
  }
}
