:root {
  --bg: #141713;
  --panel: #20261d;
  --panel-light: #2b3526;
  --moss: #8eaa64;
  --moss-bright: #b9d67e;
  --gold: #e7b85a;
  --cream: #f4e7c2;
  --muted: #aeb89a;
  --danger: #ce654f;
  --shadow: rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--cream);
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at 15% 10%, rgba(142, 170, 100, 0.18), transparent 28%),
    radial-gradient(circle at 80% 5%, rgba(231, 184, 90, 0.12), transparent 24%),
    linear-gradient(145deg, #10130f, var(--bg) 55%, #1d1a12);
}

button {
  color: inherit;
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.app {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 20px;
}

.top-bar,
.bottom-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--moss-bright);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 5vw, 52px);
  line-height: 1.05;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
}

.stat,
.panel,
.achievements,
.controls,
.apartment-box {
  border: 1px solid rgba(185, 214, 126, 0.18);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(43, 53, 38, 0.96), rgba(28, 34, 26, 0.96));
  box-shadow: 0 16px 40px var(--shadow);
}

.stat {
  padding: 12px 14px;
}

.stat span,
.panel-title span,
.item-meta,
.achievement,
.apartment-header,
.apartment-visual p {
  color: var(--muted);
}

.stat strong {
  display: block;
  margin-top: 4px;
  color: var(--gold);
  font-size: 18px;
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr minmax(260px, 320px);
  gap: 18px;
  margin-top: 20px;
}

.panel,
.achievements,
.controls,
.apartment-box {
  padding: 16px;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.list {
  display: grid;
  gap: 10px;
}

.shop-item,
.achievement {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(244, 231, 194, 0.1);
  border-radius: 8px;
  background: rgba(20, 23, 19, 0.72);
}

.shop-icon,
.achievement-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 5px 6px rgba(0, 0, 0, 0.25));
}

.shop-item button {
  min-width: 98px;
  padding: 9px 11px;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  color: #19140c;
  font-weight: 800;
  background: linear-gradient(180deg, var(--gold), #bf8039);
}

.shop-item button:disabled {
  cursor: not-allowed;
  color: rgba(244, 231, 194, 0.45);
  background: #3a3b32;
}

.item-name {
  display: block;
  margin-bottom: 5px;
  font-weight: 800;
}

.item-meta {
  display: block;
  font-size: 13px;
  line-height: 1.35;
}

.center-stage {
  min-width: 0;
}

.scene {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  border: 1px solid rgba(185, 214, 126, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(8, 10, 8, 0.04), rgba(8, 10, 8, 0.35)),
    url("../assets/bg3.png") center / cover no-repeat;
  box-shadow: inset 0 -45px 80px rgba(0, 0, 0, 0.22), 0 16px 40px var(--shadow);
}

.scene::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 54% 56%, transparent 0 28%, rgba(0, 0, 0, 0.16) 68%),
    linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, 0.25));
}

.collection-strip {
  position: absolute;
  z-index: 2;
  left: 18px;
  right: 18px;
  top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-height: 58px;
  padding: 8px;
  border: 1px solid rgba(244, 231, 194, 0.12);
  border-radius: 8px;
  background: rgba(16, 19, 15, 0.42);
  backdrop-filter: blur(2px);
}

.collectible {
  display: none;
  width: 46px;
  height: 46px;
  object-fit: contain;
  filter: drop-shadow(0 6px 7px rgba(0, 0, 0, 0.35));
}

.collectible.visible {
  display: block;
}

.hero-image {
  position: absolute;
  z-index: 1;
  left: 42%;
  bottom: 0px;
  width: min(42%, 330px);
  max-height: 390px;
  object-fit: contain;
  transform: translateX(-50%);
  filter: drop-shadow(0 22px 24px rgba(0, 0, 0, 0.45));
}

.money-button {
  position: absolute;
  z-index: 3;
  left: 58%;
  bottom: 70px;
  display: grid;
  place-items: center;
  width: min(28%, 210px);
  min-width: 145px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  background: transparent;
  transform: rotate(-5deg);
  transition: transform 0.08s ease, filter 0.08s ease;
}

.money-button:hover {
  filter: brightness(1.08);
}

.money-button:active {
  transform: rotate(-5deg) scale(0.94);
}

.money-button img {
  width: 100%;
  filter: drop-shadow(0 18px 18px rgba(0, 0, 0, 0.42));
}

.click-label {
  margin-top: -8px;
  padding: 5px 9px;
  border-radius: 999px;
  color: #1b140c;
  font-size: 13px;
  font-weight: 900;
  background: var(--gold);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.22);
}

.floating-texts {
  position: absolute;
  z-index: 5;
  inset: 0;
  pointer-events: none;
}

.float-text {
  position: absolute;
  color: var(--gold);
  font-weight: 900;
  animation: floatUp 850ms ease-out forwards;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5);
}

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

.apartment-box {
  margin-top: 16px;
}

.apartment-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 14px;
}

.progress-track {
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: #12150f;
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--moss), var(--gold));
  transition: width 0.25s ease;
}

.apartment-visual {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 16px;
  align-items: center;
  margin-top: 14px;
}

.apartment-visual img {
  width: 132px;
  height: 104px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(18, 21, 15, 0.44);
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.28));
}

.apartment-visual p {
  margin-bottom: 0;
}

.achievements-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
}

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

.achievement.unlocked {
  color: #1a150d;
  background: linear-gradient(180deg, var(--gold), #ba7d38);
}

.achievement.unlocked span {
  color: #45311b;
}

.achievement:not(.unlocked) .achievement-icon {
  opacity: 0.45;
  filter: grayscale(1) drop-shadow(0 5px 6px rgba(0, 0, 0, 0.25));
}

.controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.controls p {
  margin-bottom: 0;
  color: var(--moss-bright);
  font-weight: 700;
}

.danger-button,
.secondary-button,
.modal-actions button {
  padding: 11px 14px;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 800;
}

.danger-button {
  background: var(--danger);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.62);
}

.modal.hidden {
  display: none;
}

.modal-card {
  width: min(440px, 100%);
  padding: 22px;
  border: 1px solid rgba(231, 184, 90, 0.32);
  border-radius: 8px;
  background: linear-gradient(180deg, #2e3728, #171b15);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.55);
}

.modal-card p {
  color: var(--muted);
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.modal-actions button {
  flex: 1;
  color: #1b140c;
  background: var(--gold);
}

.modal-actions .secondary-button {
  color: var(--cream);
  background: #3a4234;
}

@media (max-width: 1120px) {
  .top-bar,
  .bottom-row,
  .game-layout {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 620px) {
  .app {
    padding: 12px;
  }

  .stats,
  .achievements-list,
  .controls {
    grid-template-columns: 1fr;
  }

  .shop-item {
    grid-template-columns: auto 1fr;
  }

  .shop-item button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .scene {
    min-height: 470px;
  }

  .collection-strip {
    left: 10px;
    right: 10px;
    top: 10px;
  }

  .collectible {
    width: 38px;
    height: 38px;
  }

  .hero-image {
    left: 42%;
    bottom: 64px;
    width: min(58%, 250px);
  }

  .money-button {
    left: 51%;
    bottom: 42px;
    width: min(44%, 180px);
    min-width: 132px;
    transform: rotate(-5deg);
  }

  .money-button:active {
    transform: rotate(-5deg) scale(0.92);
  }

  .apartment-visual {
    grid-template-columns: 96px 1fr;
  }

  .apartment-visual img {
    width: 96px;
    height: 82px;
  }
}
