:root {
  color-scheme: light;
  --bg: #f5f2ea;
  --panel: #fffdf7;
  --panel-strong: #f7df72;
  --ink: #202124;
  --muted: #68645d;
  --line: #d9d1bf;
  --red: #c7352d;
  --red-dark: #931f1a;
  --green: #18794e;
  --shadow: 0 18px 45px rgba(32, 33, 36, 0.14);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(199, 53, 45, 0.12), transparent 280px),
    var(--bg);
}

button {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  gap: 18px;
  width: min(1180px, calc(100% - 28px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 0;
}

.summary-panel,
.play-area,
.shop-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.88);
  box-shadow: var(--shadow);
}

.summary-panel {
  grid-column: 1 / -1;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--red-dark);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p,
dl,
dd {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 6vw, 4.5rem);
  line-height: 0.95;
}

h2 {
  font-size: 1.35rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: 10px;
  width: min(650px, 100%);
}

.stats-grid div {
  min-height: 78px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

dt {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

dd {
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-size: 1.2rem;
  font-weight: 850;
}

.play-area {
  display: grid;
  min-height: 560px;
  padding: 24px;
  place-items: center;
}

.clicker-stage {
  position: relative;
  display: grid;
  width: min(430px, 100%);
  aspect-ratio: 1;
  place-items: center;
}

.clicker-button {
  display: grid;
  width: min(390px, 92%);
  aspect-ratio: 1;
  padding: 0;
  border: 10px solid #ffffff;
  border-radius: 50%;
  background: var(--panel-strong);
  box-shadow:
    0 16px 0 #d7b941,
    0 24px 36px rgba(32, 33, 36, 0.2);
  cursor: pointer;
  place-items: center;
  transition:
    transform 120ms ease,
    box-shadow 120ms ease;
}

.clicker-button:hover {
  transform: translateY(-2px);
}

.clicker-button:active {
  transform: translateY(8px) scale(0.98);
  box-shadow:
    0 8px 0 #d7b941,
    0 14px 24px rgba(32, 33, 36, 0.22);
}

.clicker-button img {
  width: 88%;
  height: 88%;
  pointer-events: none;
}

.click-effects {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.click-effect {
  position: absolute;
  color: var(--green);
  font-size: 1rem;
  font-weight: 900;
  transform: translate(-50%, -50%);
  animation: floatUp 800ms ease-out forwards;
  text-shadow: 0 1px 0 #ffffff;
  white-space: nowrap;
}

.shop-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 560px;
  padding: 18px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.secondary-button,
.buy-button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
}

.secondary-button {
  padding: 0 14px;
  color: var(--red-dark);
  background: #f4d5d2;
}

.generator-list {
  display: grid;
  gap: 10px;
  overflow: auto;
  padding-right: 4px;
}

.generator-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 138px;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.generator-copy {
  min-width: 0;
}

.generator-copy h3 {
  font-size: 1rem;
}

.generator-copy p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.generator-copy dl {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 10px;
}

.generator-copy dd {
  font-size: 0.95rem;
}

.buy-button {
  align-self: center;
  padding: 10px;
  color: #ffffff;
  background: var(--red);
}

.buy-button:disabled {
  color: #736f68;
  background: #ded6c8;
  cursor: not-allowed;
}

.buy-button span {
  display: block;
  margin-top: 2px;
  overflow-wrap: anywhere;
  font-size: 0.84rem;
}

.save-status {
  min-height: 22px;
  color: var(--muted);
  font-size: 0.85rem;
}

@keyframes floatUp {
  from {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }

  to {
    opacity: 0;
    transform: translate(-50%, -155%) scale(1.12);
  }
}

@media (max-width: 860px) {
  .app-shell {
    display: flex;
    flex-direction: column;
    min-height: auto;
    padding: 14px 0;
  }

  .summary-panel {
    align-items: stretch;
    flex-direction: column;
  }

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

  .play-area,
  .shop-panel {
    min-height: auto;
  }

  .clicker-stage {
    width: min(360px, 100%);
  }
}

@media (max-width: 520px) {
  .generator-row {
    grid-template-columns: 1fr;
  }

  .buy-button {
    width: 100%;
  }
}
