:root {
  --bg: #fff6e9;
  --bg-2: #ffe9c6;
  --wood: #c98a4a;
  --wood-dark: #8a5a2a;
  --ink: #3a2a1a;
  --accent: #ff7a59;
  --accent-2: #ffd166;
  --card: #fffaf0;
  --border: #e8c89a;
  --shadow: 0 8px 24px rgba(120, 70, 20, 0.18);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: 'Nunito', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 50% -100px, #fff 0%, transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  user-select: none;
  -webkit-user-select: none;
}

.app {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.app__header {
  text-align: center;
}

.app__title {
  font-family: 'Baloo 2', system-ui, sans-serif;
  margin: 0;
  font-size: 38px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--wood-dark);
  text-shadow: 0 2px 0 #fff, 0 4px 8px rgba(180, 100, 30, 0.18);
}

.app__title-emoji {
  font-size: 32px;
  vertical-align: -3px;
}

.app__subtitle {
  margin: 6px 0 0;
  font-size: 14px;
  color: #8a6a4a;
  font-weight: 700;
}

.app__board {
  display: grid;
  grid-template-columns: 180px auto 180px;
  gap: 16px;
  align-items: start;
  justify-content: center;
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 8px;
}

.panel-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}

.panel-card__label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--wood-dark);
  opacity: 0.7;
  margin-bottom: 6px;
}

.panel-card__preview {
  width: 100%;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.panel-card__preview canvas {
  display: block;
}

.panel-card__tips {
  margin: 0;
  padding-left: 16px;
  font-size: 13px;
  line-height: 1.6;
  color: #6a4a2a;
}

.panel-card__score {
  font-family: 'Baloo 2', sans-serif;
  font-size: 38px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  text-align: center;
  margin-top: 2px;
}

.panel-card__best {
  font-family: 'Baloo 2', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--accent-2);
  line-height: 1;
  text-align: center;
  margin-top: 2px;
  text-shadow: 0 1px 0 #c89a3a;
}

.game-container {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  box-shadow:
    0 0 0 8px var(--wood),
    0 0 0 12px var(--wood-dark),
    0 18px 40px rgba(60, 30, 0, 0.35);
  background: linear-gradient(180deg, #fef7e8 0%, #fce8c0 100%);
  line-height: 0;
}

.game-container canvas {
  display: block;
}

.app__footer {
  text-align: center;
  font-size: 12px;
  color: #8a6a4a;
  padding-top: 8px;
}

/* 水果进化路径 */
.evolution {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 12px 16px 14px;
  box-shadow: var(--shadow);
}

.evolution__title {
  font-family: 'Baloo 2', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--wood-dark);
  text-align: center;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.evolution__chain {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex-wrap: wrap;
}

.evolution__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0 2px;
}

.evolution__item canvas {
  display: block;
}

.evolution__name {
  font-size: 10px;
  font-weight: 700;
  color: #6a4a2a;
  line-height: 1;
}

.evolution__arrow {
  color: var(--wood);
  font-size: 14px;
  font-weight: 700;
  margin: 0 1px;
  align-self: center;
  transform: translateY(-6px);
}

@media (max-width: 720px) {
  .evolution__chain { gap: 1px; }
  .evolution__arrow { display: none; }
  .evolution__name { font-size: 9px; }
}

@media (max-width: 720px) {
  .app__title { font-size: 30px; }
  .app__board {
    grid-template-columns: 1fr;
  }
  .side-panel {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
  }
  .panel-card {
    min-width: 120px;
  }
  .panel-card__score { font-size: 30px; }
}
