:root {
  color-scheme: light;
  --ink: #1f2430;
  --muted: #657086;
  --panel: #fff8de;
  --panel-deep: #f0b44b;
  --sky-top: #69c8ff;
  --sky-bottom: #e9f8ff;
  --accent: #d55b35;
  --coin: #f5c84b;
  font-family: "Trebuchet MS", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 255, 255, 0.95), transparent 28rem),
    linear-gradient(135deg, #ffe9a8 0%, #ffd280 34%, #72d7ff 100%);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

button,
canvas {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100vw - 28px));
  min-height: 100dvh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(260px, 0.78fr) minmax(320px, 1.22fr);
  align-items: center;
  gap: clamp(18px, 4vw, 54px);
  padding: clamp(18px, 4vw, 48px) 0;
}

.hero-panel {
  padding: clamp(18px, 4vw, 38px);
  border: 4px solid rgba(98, 60, 29, 0.2);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.52);
  box-shadow: 0 22px 70px rgba(116, 80, 35, 0.18);
  backdrop-filter: blur(12px);
}

.eyebrow {
  margin: 0 0 12px;
  color: #8d4f24;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.4rem, 8vw, 5.7rem);
  line-height: 0.95;
  letter-spacing: -0.08em;
  text-wrap: balance;
}

.intro {
  margin: 22px 0 0;
  color: #4e5c70;
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  line-height: 1.75;
}

.game-card {
  position: relative;
  padding: clamp(12px, 2vw, 18px);
  border: 6px solid #7b4a26;
  border-radius: 30px;
  background: linear-gradient(180deg, #ffe99a, #d88635);
  box-shadow:
    0 30px 0 #5f351d,
    0 34px 50px rgba(64, 40, 20, 0.28);
}

.status-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 10px;
  border: 3px solid #6e421f;
  border-radius: 18px;
  background: #fff5c8;
}

.status-bar > div {
  min-width: 86px;
  padding: 8px 12px;
  border: 3px solid #7b4a26;
  border-radius: 14px;
  background: #fffdf2;
  box-shadow: inset 0 -4px 0 rgba(118, 74, 38, 0.12);
}

.label {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

strong {
  display: block;
  color: #2b2420;
  font-size: 1.5rem;
  line-height: 1;
}

.sound-button {
  min-height: 46px;
  padding: 0 16px;
  border: 3px solid #763e20;
  border-radius: 14px;
  color: #fffdf2;
  font-weight: 900;
  background: linear-gradient(180deg, #e86c3e, #a53a22);
  box-shadow: 0 5px 0 #6a2c1d;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, filter 150ms ease;
}

.sound-button:hover {
  filter: brightness(1.06);
}

.sound-button:active {
  transform: translateY(4px) scale(0.98);
  box-shadow: 0 1px 0 #6a2c1d;
}

.sound-button[aria-pressed="false"] {
  background: linear-gradient(180deg, #7d8796, #4c5563);
}

.canvas-wrap {
  position: relative;
  overflow: hidden;
  border: 5px solid #4e2e1c;
  border-radius: 20px;
  background: #74d5ff;
  cursor: pointer;
  touch-action: manipulation;
}

canvas {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  image-rendering: pixelated;
}

.tap-hint {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  padding: 10px 16px;
  border: 3px solid rgba(73, 42, 24, 0.75);
  border-radius: 999px;
  color: #3a261a;
  font-weight: 900;
  background: rgba(255, 248, 211, 0.9);
  box-shadow: 0 8px 24px rgba(67, 40, 24, 0.18);
  pointer-events: none;
  animation: hint-bob 900ms ease-in-out infinite alternate;
}

.tap-hint.is-hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(10px);
  animation: none;
  transition: opacity 220ms ease, transform 220ms ease;
}

.help-text {
  margin: 12px 6px 0;
  color: #3e2a1c;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.6;
}

@keyframes hint-bob {
  from {
    transform: translateX(-50%) translateY(0);
  }
  to {
    transform: translateX(-50%) translateY(-8px);
  }
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
    align-items: start;
    padding-top: 18px;
  }

  .hero-panel {
    padding: 18px;
  }

  .intro {
    margin-top: 14px;
  }

  .game-card {
    box-shadow:
      0 18px 0 #5f351d,
      0 24px 36px rgba(64, 40, 20, 0.24);
  }

  .status-bar {
    flex-wrap: wrap;
  }

  .status-bar > div,
  .sound-button {
    flex: 1 1 120px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
