:root { font-family: "Trebuchet MS", "Microsoft YaHei", "PingFang SC", sans-serif; color: #254c42; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
body { display: grid; place-items: center; background: #a8d6bb; }
button { font: inherit; cursor: pointer; }
.game { position: relative; width: min(100%, 520px); height: 100vh; height: 100dvh; overflow: hidden;
  isolation: isolate; touch-action: none; background: #c5ebd8; box-shadow: 0 18px 70px #24534448; }
canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: none; }
.hud { position: absolute; top: max(17px, env(safe-area-inset-top)); left: 15px; right: 15px; z-index: 2;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; pointer-events: none; user-select: none; }
.hud-left { display: flex; align-items: flex-start; gap: 8px; }
.pill { min-height: 46px; display: flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 17px;
  border: 2px solid #ffffffd6; background: #f8fff0ea; box-shadow: 0 5px 0 #365f4c27, 0 12px 26px #27574822; }
.hearts { color: #f59a9e; letter-spacing: 2px; font-size: 20px; line-height: 1; white-space: nowrap; }
.hearts .lost { color: #bdcfc1; }
.icon-button { pointer-events: auto; width: 46px; height: 46px; display: grid; place-items: center; padding: 0;
  border-radius: 16px; border: 2px solid #ffffffd6; background: #f8fff0ea; color: #32554b;
  box-shadow: 0 5px 0 #365f4c27, 0 12px 26px #27574822; font-size: 19px; }
.icon-button:active, .main-button:active, .sub-button:active { transform: translateY(3px); box-shadow: 0 2px 0 #254c4230; }
.score-stack { display: grid; gap: 8px; min-width: 116px; }
.score { display: flex; justify-content: space-between; align-items: center; gap: 14px; min-height: 45px;
  padding: 7px 11px; background: #f8fff0f0; border: 2px solid #fff; border-radius: 16px;
  box-shadow: 0 5px 0 #365f4c27, 0 12px 26px #27574822; }
.score .label { font-size: 12px; font-weight: 800; color: #608076; white-space: nowrap; }
.score strong { font-size: 19px; color: #27584b; font-variant-numeric: tabular-nums; white-space: nowrap; }
.score .coin-mark { display: inline-block; width: 15px; height: 15px; margin-right: 2px; vertical-align: -2px;
  border: 3px solid #f2ac34; border-radius: 50%; background: #ffe679; box-shadow: 0 0 0 1px #fff1b1 inset; }
.unit { font-size: 12px; margin-left: 2px; }
.screen { position: absolute; z-index: 3; inset: 0; }
[hidden] { display: none !important; }
.intro { display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: max(43px, env(safe-area-inset-top)) 18px max(22px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, #e5fae4c4 0%, #e5fae475 31%, transparent 49%, transparent 65%, #daf4d1a6 100%); text-align: center; }
.intro-header { width: 100%; pointer-events: none; }
.eyebrow { display: inline-block; padding: 6px 13px; border-radius: 100px; background: #ffffffde;
  border: 1px solid #fff; color: #4a8374; font-size: 12px; font-weight: 900; letter-spacing: .16em; box-shadow: 0 4px 20px #4d8d631a; }
h1 { margin: 12px 0 2px; color: #316753; font-size: clamp(37px, 10vw, 54px); line-height: 1.17;
  letter-spacing: -.055em; font-weight: 1000; text-shadow: 0 4px 0 #fff9d7, 0 7px 19px #48855e54; }
.intro-header p { margin: 8px 0 0; font-size: 14px; font-weight: 800; letter-spacing: .08em; color: #426f64; }
.intro-bottom { width: min(100%, 412px); padding: 16px 15px 14px; background: #fffdf3e8;
  border: 2px solid #fff; border-radius: 25px; box-shadow: 0 8px 0 #72956e72, 0 18px 34px #3662432c; backdrop-filter: blur(8px); }
.gesture-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-bottom: 14px; }
.gesture { display: grid; justify-items: center; gap: 3px; font-size: 11px; font-weight: 800; color: #5e8073; }
.gesture b { display: grid; place-items: center; height: 34px; width: 40px; border-radius: 11px;
  background: #eaf8dc; color: #39765e; font-size: 19px; box-shadow: inset 0 -3px 0 #d2eabb; }
.main-button { width: 100%; min-height: 56px; border: 0; border-radius: 16px; background: #ffb84b;
  box-shadow: 0 5px 0 #d68436, 0 9px 21px #cc883643; color: #543c2a; font-weight: 1000; font-size: 20px; letter-spacing: .08em; }
.intro-note { margin: 13px 0 0; color: #668577; font-size: 12px; font-weight: 800; }
.veil { display: grid; place-items: center; padding: 24px; background: #18494091; backdrop-filter: blur(6px); }
.dialog { width: min(100%, 380px); padding: 25px 22px 22px; text-align: center; background: #fffdf2;
  border: 3px solid #fff; border-radius: 28px; box-shadow: 0 9px 0 #376d55, 0 22px 45px #103e3566; }
.dialog .badge { display: inline-grid; place-items: center; width: 60px; height: 60px;
  border-radius: 22px; background: #eaf5cb; color: #587c48; font-size: 29px; transform: rotate(-8deg); }
.dialog h2 { margin: 15px 0 6px; font-size: 31px; line-height: 1.2; color: #335e4d; }
.dialog .detail { margin: 0 0 20px; color: #6d897a; font-size: 14px; font-weight: 700; }
.final-scores { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
.final-scores > div { padding: 12px 6px; border-radius: 15px; background: #eaf6dd; }
.final-scores span { display: block; font-size: 12px; font-weight: 800; color: #6b8b76; }
.final-scores strong { display: block; margin-top: 2px; color: #335d4b; font-size: 25px; font-variant-numeric: tabular-nums; }
.best { margin: 0 0 15px; font-weight: 800; color: #6a8673; font-size: 13px; }
.sub-button { width: 100%; min-height: 45px; margin-top: 11px; border-radius: 13px;
  background: #e9f5e3; border: 1px solid #d8ebd0; color: #477561; font-size: 14px; font-weight: 900; }
.toast { position: absolute; z-index: 5; left: 50%; bottom: max(24px, env(safe-area-inset-bottom));
  width: max-content; max-width: calc(100% - 34px); padding: 10px 15px; border-radius: 14px;
  text-align: center; background: #285d4fe8; color: white; font-size: 13px; font-weight: 800;
  box-shadow: 0 8px 24px #133f3550; transform: translate(-50%, 15px);
  opacity: 0; pointer-events: none; transition: transform .22s, opacity .22s; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
@media (max-height: 670px) {
  .intro { padding-top: max(19px, env(safe-area-inset-top)); padding-bottom: 12px; }
  h1 { font-size: 37px; margin-top: 6px; }
  .intro-header p { margin-top: 3px; }
  .intro-bottom { padding: 11px 12px 10px; }
  .gesture-grid { margin-bottom: 9px; }
  .intro-note { margin-top: 9px; }
}
@media (min-width: 540px) { .game { border-radius: 22px; max-height: 920px; } }
