:root {
  --cream: #fff8e8;
  --mint: #b9efcf;
  --leaf: #4f9c67;
  --berry: #ff6f91;
  --peach: #ffc8a2;
  --sun: #ffe079;
  --ink: #3f4f3f;
  --soft-ink: #74816f;
  --white: #fffdf7;
  --shadow: 0 24px 70px rgba(109, 145, 98, 0.22);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Nunito", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 200, 162, 0.55) 0 11rem, transparent 11.2rem),
    radial-gradient(circle at 82% 16%, rgba(185, 239, 207, 0.65) 0 12rem, transparent 12.2rem),
    linear-gradient(135deg, #fff7df 0%, #edfbdc 46%, #ffe9ef 100%);
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  background-image:
    radial-gradient(circle, rgba(79, 156, 103, 0.18) 0 2px, transparent 2.5px),
    radial-gradient(circle, rgba(255, 111, 145, 0.2) 0 1.5px, transparent 2px);
  background-position:
    0 0,
    28px 34px;
  background-size:
    74px 74px,
    92px 92px;
  opacity: 0.42;
}

.game-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(260px, 0.86fr) minmax(320px, 1.18fr);
  gap: 22px;
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 30px 0;
  align-items: center;
}

.hero-panel,
.history-panel {
  border: 2px solid rgba(255, 255, 255, 0.74);
  background: rgba(255, 253, 247, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero-panel {
  min-height: 520px;
  padding: 34px;
  border-radius: 8px;
}

.brand-mark {
  display: grid;
  width: 70px;
  height: 70px;
  place-items: center;
  margin-bottom: 22px;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffe4eb, #fff9cf);
  box-shadow: inset 0 -8px 18px rgba(255, 111, 145, 0.16), 0 16px 34px rgba(255, 111, 145, 0.24);
  font-size: 2rem;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--leaf);
  font-family: "Baloo 2", sans-serif;
  font-size: 0.94rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: "Baloo 2", "Nunito", sans-serif;
  line-height: 1;
  letter-spacing: 0;
}

h1 {
  max-width: 8em;
  font-size: clamp(2.85rem, 7vw, 5.6rem);
}

.intro {
  max-width: 25rem;
  margin: 20px 0 26px;
  color: var(--soft-ink);
  font-size: 1.04rem;
  line-height: 1.72;
}

.score-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.score-board div {
  min-height: 94px;
  padding: 16px;
  border: 2px solid rgba(79, 156, 103, 0.16);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 248, 232, 0.88));
}

.score-board span {
  display: block;
  color: var(--soft-ink);
  font-size: 0.9rem;
  font-weight: 800;
}

.score-board strong {
  display: block;
  margin-top: 6px;
  color: var(--berry);
  font-family: "Baloo 2", sans-serif;
  font-size: 2.7rem;
  line-height: 1;
}

button {
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.primary-button {
  width: 100%;
  min-height: 58px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--berry), #ff9a76);
  color: #fff;
  box-shadow: 0 14px 28px rgba(255, 111, 145, 0.36);
  font-weight: 900;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.primary-button:hover,
.pad-button:hover,
.history-heading button:hover {
  transform: translateY(-2px);
}

.primary-button:active,
.pad-button:active {
  transform: translateY(1px) scale(0.98);
}

.play-panel {
  display: grid;
  gap: 16px;
  justify-items: center;
}

.garden-frame {
  position: relative;
  width: min(100%, 620px);
  aspect-ratio: 1;
  padding: clamp(10px, 2vw, 18px);
  border: 12px solid rgba(255, 253, 247, 0.86);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(255, 224, 121, 0.58), rgba(185, 239, 207, 0.72));
  box-shadow: 0 30px 85px rgba(62, 120, 76, 0.28);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  background: #fbfff1;
}

.overlay {
  position: absolute;
  inset: 32px;
  display: grid;
  place-content: center;
  gap: 10px;
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.74);
  color: var(--ink);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.96);
  transition: opacity 180ms ease, transform 180ms ease;
}

.overlay.is-visible {
  opacity: 1;
  transform: scale(1);
}

.overlay span {
  color: var(--berry);
  font-family: "Baloo 2", sans-serif;
  font-size: clamp(2rem, 6vw, 4.6rem);
  font-weight: 700;
}

.overlay strong {
  font-size: clamp(0.95rem, 3vw, 1.15rem);
}

.mobile-pad {
  display: grid;
  grid-template-columns: repeat(3, 64px);
  grid-template-rows: repeat(2, 54px);
  gap: 9px;
  justify-content: center;
}

.pad-button {
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.86);
  box-shadow: 0 12px 26px rgba(109, 145, 98, 0.18);
  color: var(--leaf);
  font-size: 1.4rem;
  font-weight: 900;
  transition: transform 160ms ease;
}

.pad-button.up {
  grid-column: 2;
}

.pad-button.left {
  grid-column: 1;
}

.pad-button.down {
  grid-column: 2;
}

.pad-button.right {
  grid-column: 3;
}

.history-panel {
  grid-column: 1 / -1;
  padding: 18px;
  border-radius: 8px;
}

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

.history-heading h2 {
  font-size: 1.8rem;
}

.history-heading button {
  min-width: 78px;
  min-height: 38px;
  border-radius: 999px;
  background: rgba(255, 111, 145, 0.12);
  color: var(--berry);
  font-weight: 900;
  transition: transform 160ms ease;
}

.history-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  min-height: 64px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.history-list li {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--soft-ink);
  font-size: 0.88rem;
  font-weight: 800;
}

.history-list strong {
  color: var(--leaf);
  font-family: "Baloo 2", sans-serif;
  font-size: 1.5rem;
}

.history-list .empty {
  grid-column: 1 / -1;
  justify-content: center;
  color: var(--soft-ink);
}

@media (max-width: 880px) {
  .game-shell {
    grid-template-columns: 1fr;
    align-items: start;
    padding: 16px 0 22px;
  }

  .hero-panel {
    min-height: auto;
    padding: 24px;
  }

  h1 {
    max-width: 100%;
  }

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

@media (max-width: 520px) {
  .game-shell {
    width: min(100% - 20px, 1180px);
  }

  .score-board,
  .history-list {
    grid-template-columns: 1fr;
  }

  .garden-frame {
    border-width: 8px;
  }

  .overlay {
    inset: 22px;
  }
}
