:root {
  --cream: #fff9e9;
  --paper: #fffdf4;
  --ink: #533c36;
  --muted: #90766c;
  --red: #e9545f;
  --red-deep: #b93342;
  --pink: #f9a6b3;
  --yellow: #ffd85a;
  --teal: #169b91;
  --green: #4f9b58;
  --green-dark: #286848;
  --line: #ecd7b9;
  --shadow: 0 16px 45px rgba(74, 55, 37, .18);
  --display: "Noto Sans TC", sans-serif;
  --body: "Noto Sans TC", sans-serif;
}

* { box-sizing: border-box; }

html,
body { width: 100%; min-width: 320px; min-height: 100%; margin: 0; overflow: hidden; }

body {
  color: var(--ink);
  font-family: var(--body);
  background:
    radial-gradient(circle at 15% 12%, rgba(255, 234, 156, .85), transparent 29%),
    radial-gradient(circle at 86% 4%, rgba(255, 184, 198, .75), transparent 28%),
    linear-gradient(145deg, #fff4d3, #f5d9c3);
  -webkit-user-select: none;
  user-select: none;
  overscroll-behavior: none;
}

button,
input { font: inherit; }

button { color: inherit; -webkit-tap-highlight-color: transparent; }
button:focus-visible,
input:focus-visible { outline: 4px solid rgba(255, 216, 90, .95); outline-offset: 2px; }

.game-shell { width: 100%; height: 100dvh; display: grid; place-items: center; }

.forest-frame {
  position: relative;
  isolation: isolate;
  width: min(100%, 520px);
  height: 100dvh;
  min-height: 540px;
  overflow: hidden;
  background: #c9ebbd;
  box-shadow: 0 0 70px rgba(92, 61, 35, .22);
}

#gameCanvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.game-header {
  position: absolute;
  z-index: 8;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: max(12px, env(safe-area-inset-top)) 14px 0;
  pointer-events: none;
}

.forest-frame.is-home .game-header { opacity: 0; pointer-events: none; transform: translateY(-8px); }
.forest-frame.is-home .scoreboard,
.forest-frame.is-home .run-status { opacity: 0; pointer-events: none; transform: translate(-50%,-8px); }
.forest-frame:not(.is-home) .scoreboard { animation: hudIn .34s ease-out both; }
.forest-frame:not(.is-home) .run-status { animation: hudIn .34s .06s ease-out both; }

.brand-lockup { display: flex; align-items: center; gap: 10px; filter: drop-shadow(0 2px 0 rgba(255,255,255,.55)); }
.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; overflow: hidden; background: #fff4df; border: 2px solid #ead5ae; border-radius: 50%; box-shadow: inset 0 0 0 3px rgba(255,255,255,.68), 0 4px 0 rgba(82,110,71,.18); transform: none; }
.brand-mark img { width: 39px; height: 47px; object-fit: contain; object-position: center bottom; transform: none; }
.brand-lockup small,
.brand-lockup b { display: block; line-height: 1; }
.brand-lockup small { margin-bottom: 4px; color: #795747; font-size: 8px; font-weight: 900; letter-spacing: .18em; }
.brand-lockup b { color: #64453a; font-family: var(--display); font-size: 18px; font-weight: 600; letter-spacing: .04em; }
.header-actions { display: flex; gap: 7px; pointer-events: auto; }

.circle-button {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #5d493f;
  background: rgba(255, 249, 232, .94);
  border: 2px solid #e7d2ae;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.65), 0 5px 0 rgba(101,81,53,.2), 0 9px 18px rgba(47,70,45,.1);
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: transform .15s ease;
}
.circle-button:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(68,96,60,.16); }
.circle-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }
.circle-button .sound-off { display: none; }
.circle-button[aria-pressed="false"] .sound-on { display: none; }
.circle-button[aria-pressed="false"] .sound-off { display: block; }

.scoreboard {
  position: absolute;
  z-index: 7;
  top: max(86px, calc(env(safe-area-inset-top) + 74px));
  left: 50%;
  right: auto;
  width: min(calc(100% - 44px), 440px);
  display: grid;
  grid-template-columns: 1.25fr .9fr 1fr;
  gap: 0;
  padding: 6px;
  background: linear-gradient(160deg, rgba(255,253,243,.96), rgba(250,243,221,.94));
  border: 2px solid #e8d3ad;
  border-radius: 25px;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.72), 0 6px 0 rgba(108,91,57,.18), 0 15px 30px rgba(43,72,43,.09);
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity .2s ease, transform .2s ease;
}
.score-pill {
  min-width: 0;
  height: 65px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 7px 13px;
  text-align: center;
  background: transparent;
  border: 0;
  border-radius: 12px;
  box-shadow: none;
}
.score-pill + .score-pill { border-left: 1px solid rgba(147,119,80,.22); border-radius: 0 15px 15px 0; }
.score-pill small { color: #897469; font-size: 10px; font-weight: 900; letter-spacing: .1em; line-height: 1; white-space: nowrap; }
.score-pill strong { color: #594137; font-size: 22px; font-variant-numeric: tabular-nums; line-height: 1; white-space: nowrap; }
.score-main strong { color: #c8464f; font-size: 25px; letter-spacing: .06em; }
.score-pill.score-gem { display: grid; grid-template-columns: 22px auto; grid-template-rows: auto auto; align-content: center; justify-content: center; column-gap: 8px; row-gap: 3px; }
.score-pill.score-gem > .mini-gem { grid-row: 1 / span 2; align-self: center; }
.score-pill.score-gem > small,
.score-pill.score-gem > strong { justify-self: start; }

.run-status {
  position: absolute;
  z-index: 7;
  top: max(173px, calc(env(safe-area-inset-top) + 161px));
  left: 50%;
  right: auto;
  width: min(calc(100% - 44px), 440px);
  display: grid;
  grid-template-columns: minmax(0,1.45fr) .62fr .9fr;
  gap: 0;
  padding: 5px 7px;
  background: linear-gradient(160deg, rgba(255,253,243,.94), rgba(248,241,218,.91));
  border: 2px solid #e8d3ad;
  border-radius: 21px;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.58), 0 5px 0 rgba(98,83,55,.15), 0 10px 22px rgba(43,72,43,.07);
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity .2s ease, transform .2s ease;
}
.run-status > div {
  min-width: 0;
  height: 40px;
  display: flex;
  align-items: center;
  padding: 5px 8px;
  color: #674e44;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.run-status > div + div { border-left: 1px solid rgba(193,169,137,.4); }
.difficulty-status { gap: 8px; }
.difficulty-status > span { flex: 0 0 auto; }
.run-status small,.run-status b { display: block; white-space: nowrap; }
.run-status small { color: #8c766a; font-size: 8px; font-weight: 900; letter-spacing: .07em; }
.run-status b { margin-top: 2px; font-size: 13px; line-height: 1; }
.difficulty-status > i { flex: 1; height: 9px; overflow: hidden; background: #ded3b7; border: 1px solid rgba(145,112,69,.2); border-radius: 999px; box-shadow: inset 0 2px 2px rgba(84,61,40,.1); }
.difficulty-status > i em { display: block; width: 8%; height: 100%; background: linear-gradient(90deg,#71ae5d,#f1bf4d,#e95660); border-radius: inherit; transition: width .3s ease; }
.combo-status { justify-content: center; gap: 5px; opacity: .58; }
.combo-status b { color: #d6535c; font-size: 17px; }
.combo-status.is-active { opacity: 1; animation: statusPop .22s ease; }
.shield-status { justify-content: center; gap: 5px; }
.shield-status > span { width: 19px; height: 13px; flex: 0 0 auto; background: #9abd68; border-radius: 100% 0 100% 0; transform: rotate(-25deg); }
.shield-status.is-active { color: #2c7747; background: rgba(238,255,220,.92); }
.shield-status.is-active > span { background: #5aa456; box-shadow: 0 0 0 4px rgba(99,171,82,.14); animation: shieldLeaf 1.4s ease-in-out infinite; }

.mini-gem {
  position: relative;
  display: inline-block;
  width: 18px;
  height: 21px;
  flex: 0 0 auto;
  background: linear-gradient(145deg, #ffad9d 0 23%, #e95660 24% 66%, #9e3745 67%);
  border: 2px solid #fff5d8;
  clip-path: polygon(50% 0, 88% 18%, 100% 54%, 72% 91%, 50% 100%, 25% 91%, 0 54%, 13% 18%);
  filter: drop-shadow(0 2px 0 #873540);
}
.mini-gem::after { content: ""; position: absolute; top: 4px; left: 5px; width: 4px; height: 8px; background: rgba(255,250,222,.88); border-radius: 50%; transform: rotate(24deg); }

.screen {
  position: absolute;
  z-index: 20;
  inset: 0;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease, visibility .28s;
}
.screen.is-visible { visibility: visible; opacity: 1; pointer-events: auto; }

.start-screen {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: max(64px, calc(env(safe-area-inset-top) + 52px)) 20px max(18px, env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, rgba(255,250,227,.1) 0%, rgba(255,248,222,.08) 48%, rgba(255,247,222,.92) 70%, #fff8e5 100%);
}
.start-top { display: flex; flex-direction: column; align-items: center; text-align: center; }
.start-screen.is-visible .festival-chip { animation: uiRise .36s ease-out both; }
.start-screen.is-visible .title-art { animation: uiRise .42s .06s ease-out both; }
.start-screen.is-visible .eyebrow,
.start-screen.is-visible h1 { animation: uiRise .42s .12s ease-out both; }
.start-screen.is-visible .intro { animation: uiRise .42s .18s ease-out both; }
.start-screen.is-visible .start-card { animation: uiRise .48s .2s cubic-bezier(.2,.78,.25,1) both; }
.festival-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; color: #7b5a4e; font-size: 10px; font-weight: 900; letter-spacing: .05em; background: rgba(255,253,242,.84); border: 1.5px solid rgba(218,187,151,.65); border-radius: 999px; box-shadow: 0 4px 12px rgba(104,80,55,.08); }
.festival-chip span { width: 8px; height: 8px; background: var(--red); border-radius: 50% 50% 50% 15%; transform: rotate(-45deg); box-shadow: 0 0 0 3px rgba(233,84,95,.13); }
.title-art { position: relative; width: 142px; height: 122px; margin: 7px auto -3px; display: grid; place-items: center; }
.title-art::before { content: ""; position: absolute; width: 101px; height: 89px; background: rgba(255,255,255,.7); border: 3px solid rgba(255,255,255,.8); border-radius: 55% 45% 50% 48%; box-shadow: 0 8px 0 rgba(79,147,84,.12); transform: rotate(-5deg); }
.selected-hero-preview { position: relative; z-index: 2; width: 116px; height: 116px; display: block; contain: paint; transform-origin: 50% 90%; filter: drop-shadow(0 3px 0 rgba(57,101,52,.1)); will-change: transform; }
.selected-hero-preview::before { content: ""; position: absolute; inset: 0; background-image: var(--dance-sprite); background-repeat: no-repeat; background-size: 400% 200%; background-position: 0 0; animation: danceFrames var(--dance-duration) steps(1,end) infinite; will-change: background-position; }
.selected-hero-preview.dance-boy { --dance-duration: 2.35s; animation: boyDanceBody var(--dance-duration) cubic-bezier(.45,0,.55,1) infinite; }
.selected-hero-preview.dance-girl { --dance-duration: 2.55s; animation: girlDanceBody var(--dance-duration) cubic-bezier(.45,0,.55,1) infinite; }
.dance-floor { position: absolute; z-index: 1; left: 50%; bottom: 4px; width: 88px; height: 17px; border-radius: 50%; background: radial-gradient(ellipse, rgba(64,126,75,.23) 0 46%, rgba(101,170,85,.11) 48% 67%, transparent 69%); transform: translateX(-50%); transform-origin: center; }
.dance-floor::after { content: ""; position: absolute; inset: 1px 8px; border: 1.5px solid rgba(255,204,63,.58); border-radius: 50%; opacity: 0; }
.title-art.is-boy .dance-floor { animation: boyFloor 1.9s ease-in-out infinite; }
.title-art.is-boy .dance-floor::after { animation: boyFloorRing 1.9s ease-out infinite; }
.title-art.is-girl .dance-floor { animation: girlFloor 2.1s ease-in-out infinite; }
.title-art.is-girl .dance-floor::after { border-color: rgba(243,121,127,.65); animation: girlFloorRing 2.1s ease-out infinite; }
.leaf { position: absolute; z-index: 1; width: 31px; height: 18px; background: #65aa55; border-radius: 100% 0 100% 0; }
.leaf-one { top: 18px; left: -2px; transform: rotate(18deg); }
.leaf-two { right: -2px; bottom: 23px; background: #91c75d; transform: rotate(195deg); }
.spark { position: absolute; z-index: 3; color: #ffcc3f; font-size: 20px; animation: twinkle 1.8s steps(2) infinite; }
.spark-one { top: 16px; right: 8px; }
.spark-two { bottom: 20px; left: 3px; color: #f3797f; animation-delay: .45s; }
.eyebrow { margin: 0 0 3px; color: var(--teal); font-size: 9px; font-weight: 900; letter-spacing: .2em; }
.start-screen h1 { margin: 0; color: #5e443c; font-family: var(--display); font-size: clamp(36px, 9.5vw, 50px); font-weight: 600; line-height: .98; letter-spacing: -.04em; text-shadow: 0 3px 0 rgba(255,255,255,.8); }
.start-screen h1 em { color: var(--red); font-style: normal; }
.intro { margin: 10px 0 0; color: #745f56; font-size: 13px; font-weight: 700; line-height: 1.65; }

.start-card,
.result-card {
  width: 100%;
  max-width: 400px;
  margin: 12px auto 0;
  padding: 16px;
  background: rgba(255,253,244,.95);
  border: 2px solid rgba(255,255,255,.98);
  border-radius: 23px;
  box-shadow: 0 6px 0 #dfbf99, 0 18px 38px rgba(80,58,39,.16);
  backdrop-filter: blur(10px);
}
.feature-strip { display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; margin: -3px 0 11px; }
.feature-strip span { min-width: 0; padding: 7px 3px; color: #6d574e; font-size: 8px; font-weight: 900; text-align: center; background: linear-gradient(180deg,#fff9e9,#f8ead0); border: 1px solid #ead4b4; border-radius: 9px; }
.feature-strip span::before { content: "✦"; margin-right: 3px; color: var(--red); }
.start-card label { display: block; margin: 0 0 7px 3px; color: #7b6257; font-size: 10px; font-weight: 900; letter-spacing: .04em; }
.character-fieldset { min-width: 0; margin: 0 0 11px; padding: 0; border: 0; }
.character-fieldset legend { width: 100%; margin: 0 0 7px 3px; padding: 0; color: #7b6257; font-size: 10px; font-weight: 900; letter-spacing: .04em; }
.character-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.character-option { position: relative; min-width: 0; height: 76px; display: grid; grid-template-columns: 48px minmax(0,1fr); align-items: center; gap: 7px; padding: 6px 7px; color: #765d51; text-align: left; background: #fff8e8; border: 2px solid #ead6b9; border-radius: 15px; box-shadow: 0 3px 0 #dec49f; cursor: pointer; transition: transform .15s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease; }
.character-option:active { transform: translateY(2px); box-shadow: 0 1px 0 #dec49f; }
.character-option.is-selected { color: #673d38; background: #fff0df; border-color: #ef7880; box-shadow: 0 3px 0 #cf5964, 0 0 0 3px rgba(239,120,128,.12); }
.character-option > span:not(.character-portrait) { min-width: 0; }
.character-option b,.character-option small { display: block; }
.character-option b { overflow: hidden; font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.character-option small { margin-top: 3px; color: #ad8e80; font-size: 6px; font-weight: 900; letter-spacing: .08em; }
.character-option > i { position: absolute; top: 5px; right: 5px; width: 17px; height: 17px; display: grid; place-items: center; color: #fff; font-size: 9px; font-style: normal; background: #e95d68; border: 2px solid #fff; border-radius: 50%; opacity: 0; transform: scale(.5) rotate(-20deg); transition: .16s ease; }
.character-option.is-selected > i { opacity: 1; transform: scale(1) rotate(0); }
.character-portrait { width: 46px; height: 61px; display: grid; place-items: end center; overflow: hidden; background: linear-gradient(180deg,#fce7e4,#f1d7b9); border: 2px solid #fff; border-radius: 13px 13px 10px 10px; box-shadow: 0 2px 0 #dfc2a4; }
.character-portrait.girl { background: linear-gradient(180deg,#fff0ca,#f4d79c); }
.character-portrait img { width: 43px; height: 58px; object-fit: contain; object-position: center bottom; transition: transform .2s ease; }
.character-option.is-selected .character-portrait img { transform: translateY(-1px) rotate(-2deg); }
.name-input-wrap { position: relative; }
.name-input-wrap input { width: 100%; height: 48px; padding: 0 53px 0 14px; color: #5c433b; font-size: 14px; font-weight: 900; background: #fff8e8; border: 2px solid #e8d3b4; border-radius: 14px; box-shadow: inset 0 3px 0 rgba(184,148,106,.08); }
.name-input-wrap span { position: absolute; top: 50%; right: 14px; color: #b09888; font-size: 9px; transform: translateY(-50%); }
.primary-button { position: relative; width: 100%; min-height: 54px; display: flex; align-items: center; justify-content: center; gap: 11px; margin-top: 11px; padding: 8px 18px; color: #fff; font-size: 16px; font-weight: 900; letter-spacing: .06em; background: linear-gradient(180deg, #ef6971, #df4654); border: 3px solid #fff; border-radius: 16px; box-shadow: 0 6px 0 #ad3342, 0 12px 22px rgba(190,55,70,.2); cursor: pointer; transition: transform .14s ease, box-shadow .14s ease; }
.primary-button::before { content: ""; position: absolute; inset: 3px; border: 1px dashed rgba(255,255,255,.37); border-radius: 11px; pointer-events: none; }
.primary-button i { min-width: 34px; padding: 5px 6px; color: #754025; font-family: var(--body); font-size: 10px; font-style: normal; background: var(--yellow); border-radius: 8px; box-shadow: 0 2px 0 #c78b32; }
.primary-button:active { transform: translateY(4px); box-shadow: 0 2px 0 #ad3342; }
.text-button { width: 100%; min-height: 38px; margin-top: 9px; padding: 5px 10px; color: #776157; font-size: 11px; font-weight: 900; background: transparent; border: 0; cursor: pointer; }
.text-button .trophy { color: #d89b2c; font-size: 16px; vertical-align: -1px; }
.one-hand-note { display: flex; justify-content: center; align-items: center; gap: 6px; margin: 4px 0 -2px; color: #a58e7f; font-size: 8px; font-weight: 700; }
.one-hand-note i { width: 7px; height: 12px; border: 1.5px solid currentColor; border-radius: 2px; }

.gameover-screen { display: grid; place-items: center; padding: max(108px, calc(env(safe-area-inset-top) + 96px)) 18px max(16px, env(safe-area-inset-bottom)); background: rgba(45, 81, 51, .28); backdrop-filter: blur(5px) saturate(.84); }
.result-card { position: relative; max-width: 392px; margin: 0; padding: 84px 21px 18px; text-align: center; background: linear-gradient(155deg,#fffdf6,#fbf4e5); border: 2px solid #e7cfa9; border-radius: 30px; box-shadow: 0 8px 0 #d3b487, 0 24px 48px rgba(39,67,42,.25); animation: resultIn .48s cubic-bezier(.18,.86,.3,1.25) both; }
.result-card::before { content: ""; position: absolute; inset: 8px; border: 1.5px solid #efd9b8; border-radius: 22px; pointer-events: none; }
.result-baby { position: absolute; z-index: 2; top: -82px; left: 50%; width: 132px; height: 158px; transform: translateX(-50%); }
.result-baby img { width: 112px; height: 152px; object-fit: contain; object-position: center bottom; filter: drop-shadow(0 7px 0 rgba(64,83,50,.14)); animation: resultHero 1.8s ease-in-out infinite; }
.result-baby span { position: absolute; top: 17px; left: 92px; width: max-content; padding: 8px 11px; color: #664a3e; font-size: 10px; font-weight: 900; background: #fffaf0; border: 2px solid #e4c99f; border-radius: 13px 13px 13px 3px; box-shadow: 0 3px 0 rgba(91,70,45,.12); transform: rotate(4deg); }
.result-kicker { position: relative; z-index: 1; margin: 0 0 7px; color: var(--teal); font-size: 10px; font-weight: 900; letter-spacing: .16em; }
.result-kicker::before,.result-kicker::after { content: "◆"; margin: 0 7px; color: #65a66a; font-size: 7px; }
.result-card h2 { position: relative; z-index: 1; margin: 0; color: #61483f; font-family: var(--display); font-size: 24px; }
.result-card h2 em { color: var(--red); font-size: 39px; font-style: normal; }
.result-score { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 15px 0 9px; }
.result-score > div { min-height: 76px; display: grid; place-content: center; padding: 10px; background: linear-gradient(155deg,#fffaf0,#f8edd8); border: 2px solid #ead0a8; border-radius: 19px; box-shadow: inset 0 0 0 2px rgba(255,255,255,.58), 0 4px 0 rgba(181,145,97,.2); }
.result-score small { display: block; margin-bottom: 5px; color: #80695f; font-size: 10px; font-weight: 900; }
.result-score strong { display: flex; justify-content: center; align-items: center; gap: 7px; color: #5d443c; font-size: 29px; line-height: 1.1; }
.result-score strong .mini-gem { width: 15px; height: 18px; }
.new-record { display: none; margin: 7px 0 0; color: #d64a56; font-family: var(--display); font-size: 14px; font-weight: 600; animation: recordPulse 1s ease-in-out infinite; }
.new-record.is-visible { display: block; }
.new-record span { color: #f2b72e; }
.rank-result { position: relative; z-index: 1; min-height: 21px; margin: 10px 0 5px; color: #6e594f; font-size: 11px; font-weight: 900; }
.checkin-score-button {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 54px;
  margin: 4px 0 9px;
  padding: 7px 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  color: #315f45;
  font-family: var(--body);
  text-align: left;
  background: linear-gradient(155deg,#f3f9dc,#e2efbd);
  border: 2px solid #c6d991;
  border-radius: 18px;
  box-shadow: 0 4px 0 #9eb66d, inset 0 0 0 2px rgba(255,255,255,.48);
  cursor: pointer;
  transition: transform .16s ease, filter .16s ease, box-shadow .16s ease;
}
.checkin-score-button:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #9eb66d, inset 0 0 0 2px rgba(255,255,255,.48); }
.checkin-score-button:disabled { cursor: default; filter: saturate(.78); }
.checkin-score-button > span:last-child { display: grid; gap: 2px; }
.checkin-score-button b { font-size: 15px; letter-spacing: .06em; }
.checkin-score-button small { color: #71815e; font-size: 9px; font-weight: 800; }
.checkin-stamp {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: #fffceb;
  font-size: 20px;
  font-weight: 900;
  background: #5e9d5d;
  border: 2px solid #fff9dd;
  border-radius: 50%;
  box-shadow: 0 2px 0 #397747;
  transform: rotate(-7deg);
}
.checkin-score-button.is-loading .checkin-stamp { animation: checkinSpin .8s linear infinite; }
.checkin-score-button.is-success { color: #fffdf0; background: linear-gradient(155deg,#63a66a,#3f8654); border-color: #fff2bd; box-shadow: 0 4px 0 #2d6a43; }
.checkin-score-button.is-success small { color: #eaf6d8; }
.checkin-score-button.is-error { color: #93414a; background: #fff0e6; border-color: #e7b5a5; box-shadow: 0 4px 0 #c98d7c; }
.support-gate {
  position: absolute;
  z-index: 60;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  background: rgba(39, 70, 46, .64);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, visibility .2s;
}
.support-gate.is-visible { visibility: visible; opacity: 1; pointer-events: auto; }
.support-card {
  position: relative;
  width: min(100%, 370px);
  padding: 69px 22px 18px;
  color: #654b41;
  text-align: center;
  background:
    radial-gradient(circle at 14% 12%, rgba(246,190,86,.18) 0 4px, transparent 5px),
    radial-gradient(circle at 88% 19%, rgba(92,159,94,.16) 0 5px, transparent 6px),
    linear-gradient(155deg, #fffdf5, #f8efd9);
  border: 3px solid #fff9e7;
  border-radius: 29px;
  box-shadow: 0 8px 0 #d6b681, 0 24px 55px rgba(24,53,34,.34);
  transform: translateY(14px) scale(.96);
  transition: transform .28s cubic-bezier(.2,.82,.3,1.15);
}
.support-card::before { content: ""; position: absolute; inset: 8px; border: 1.5px dashed #e7cc9e; border-radius: 20px; pointer-events: none; }
.support-gate.is-visible .support-card { transform: translateY(0) scale(1); }
.support-close { position: absolute; z-index: 2; top: 13px; right: 13px; width: 34px; height: 34px; padding: 0 0 3px; color: #81685b; font-size: 24px; line-height: 1; background: #fff8e7; border: 2px solid #e5cda7; border-radius: 50%; cursor: pointer; }
.support-mark { position: absolute; top: -48px; left: 50%; width: 103px; height: 103px; display: grid; place-items: center; color: #fff9e7; background: linear-gradient(145deg,#ef6871,#d94455); border: 5px solid #fff7da; border-radius: 50%; box-shadow: 0 7px 0 #a83243, 0 14px 25px rgba(129,38,53,.22); transform: translateX(-50%) rotate(-4deg); }
.support-mark span { font-family: var(--display); font-size: 34px; line-height: 1; }
.support-mark i { position: absolute; right: 14px; bottom: 13px; color: #ffd568; font-size: 15px; font-style: normal; transform: rotate(12deg); }
.support-kicker { position: relative; z-index: 1; margin: 0 0 5px; color: var(--teal); font-size: 8px; font-weight: 900; letter-spacing: .17em; }
.support-card h2 { position: relative; z-index: 1; margin: 0; font-family: var(--display); font-size: 27px; line-height: 1.25; }
.support-copy { position: relative; z-index: 1; margin: 10px auto 13px; max-width: 294px; color: #79635a; font-size: 12px; font-weight: 700; line-height: 1.65; }
.support-page-button { position: relative; z-index: 1; min-height: 61px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 14px 9px 17px; color: #315f45; text-align: left; text-decoration: none; background: linear-gradient(145deg,#f1f8d9,#dcecb5); border: 2px solid #bad17c; border-radius: 17px; box-shadow: 0 4px 0 #91ad58, inset 0 0 0 2px rgba(255,255,255,.58); transition: transform .15s ease, background .2s ease; }
.support-page-button:active { transform: translateY(3px); box-shadow: 0 1px 0 #91ad58; }
.support-page-button > span { display: grid; gap: 2px; }
.support-page-button b { font-size: 15px; letter-spacing: .04em; }
.support-page-button small { color: #6f815c; font-size: 9px; font-weight: 800; }
.support-page-button > i { width: 35px; height: 35px; display: grid; place-items: center; flex: 0 0 auto; color: #fffceb; font-size: 18px; font-style: normal; background: #579258; border: 2px solid #fff8d9; border-radius: 50%; box-shadow: 0 2px 0 #357342; }
.support-page-button.is-visited { color: #fffdf0; background: linear-gradient(145deg,#68aa6c,#438a56); border-color: #fff0b5; box-shadow: 0 4px 0 #2e6b43; }
.support-page-button.is-visited small { color: #eaf6d5; }
.support-page-button.is-visited > i { color: #3d7f50; background: #fff4bd; box-shadow: none; }
.support-card .support-confirm { min-height: 56px; margin-top: 13px; }
.support-card .support-confirm:disabled { color: #a99686; background: #e9dfcb; border-color: #f7eedc; box-shadow: 0 4px 0 #c7b8a1; cursor: not-allowed; filter: saturate(.55); }
.support-card .support-confirm:disabled::before { opacity: .25; }
.support-card > .text-button { position: relative; z-index: 1; margin-top: 7px; }
.support-privacy { position: relative; z-index: 1; display: block; margin: 1px auto 0; max-width: 290px; color: #9a867a; font-size: 8px; font-weight: 700; line-height: 1.5; }
.result-card .primary-button { z-index: 1; min-height: 58px; border-color: #ffd7cc; border-radius: 28px; }
.result-card .primary-button::before { border-radius: 21px; }
.result-card .text-button { position: relative; z-index: 1; margin-top: 12px; border-top: 1px dashed #dbc29e; }

.tap-hint { position: absolute; z-index: 9; left: 50%; bottom: max(86px, calc(env(safe-area-inset-bottom) + 70px)); display: flex; flex-direction: column; align-items: center; gap: 10px; color: #315f45; font-size: 12px; font-weight: 900; text-shadow: none; opacity: 0; transform: translateX(-50%); pointer-events: none; }
.tap-hint.is-visible { animation: hintLife 2.8s ease both; }
.tap-hint i { position: relative; width: 56px; height: 56px; display: grid; place-items: center; color: #34764e; background: rgba(255,249,222,.94); border: 2px solid #e8c66d; border-radius: 50%; box-shadow: 0 5px 0 rgba(47,105,68,.22), 0 10px 24px rgba(38,77,48,.15); }
.tap-hint i::before { content: ""; position: absolute; inset: -7px; border: 2px solid rgba(255,249,222,.78); border-radius: 50%; animation: tapRipple 1.15s ease-out infinite; }
.tap-hint i svg { width: 31px; height: 31px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.85; stroke-linecap: round; stroke-linejoin: round; animation: fingerTap 1.15s ease-in-out infinite; }
.tap-hint > span { width: max-content; padding: 7px 12px 6px; background: rgba(255,249,226,.88); border-radius: 999px; box-shadow: 0 3px 0 rgba(54,100,60,.14); }

.milestone-toast { position: absolute; z-index: 10; top: 226px; left: 50%; min-width: 170px; padding: 8px 15px; color: #6a4e42; text-align: center; background: #fffaf0; border: 2px solid #e7cfa7; border-radius: 14px; box-shadow: 0 5px 0 rgba(80,110,61,.18); opacity: 0; transform: translate(-50%, -15px) scale(.9); pointer-events: none; }
.milestone-toast.is-visible { animation: toastPop 2.2s ease both; }
.milestone-toast span { display: block; color: #aa8d7c; font-size: 7px; font-weight: 900; letter-spacing: .14em; }
.milestone-toast b { color: var(--red); font-family: var(--display); font-size: 16px; }

.pause-card { position: absolute; z-index: 32; top: 50%; left: 50%; width: min(82%, 330px); padding: 26px 20px 18px; color: #674e44; text-align: center; background: #fffaf0; border: 3px solid #fff; border-radius: 25px; box-shadow: 0 7px 0 #dfbf99, 0 0 0 100vmax rgba(44,77,50,.38), var(--shadow); visibility: hidden; opacity: 0; transform: translate(-50%,-46%) scale(.94); transition: .2s ease; }
.pause-card.is-visible { visibility: visible; opacity: 1; transform: translate(-50%,-50%) scale(1); }
.pause-card .pause-leaf { display: block; color: #66a758; font-size: 38px; }
.pause-card p { margin: 2px 0 0; color: var(--teal); font-size: 8px; font-weight: 900; letter-spacing: .15em; }
.pause-card h2 { margin: 2px 0 12px; font-family: var(--display); font-size: 29px; }
.pause-card .primary-button { margin-top: 0; }

.countdown-overlay {
  position: absolute;
  z-index: 48;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  padding-top: 42px;
  color: #315f45;
  background: rgba(237,247,220,.14);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  backdrop-filter: saturate(.84) brightness(.96);
  transition: opacity .16s ease, visibility .16s;
}
.countdown-overlay.is-visible { visibility: visible; opacity: 1; }
.countdown-overlay span {
  position: relative;
  width: 186px;
  height: 186px;
  display: grid;
  place-items: center;
  color: #fff5d8;
  font-family: var(--display);
  font-size: 118px;
  line-height: 1;
  text-shadow: 0 5px 0 #24583d, 0 12px 24px rgba(33,69,43,.23);
  background: radial-gradient(circle at 36% 26%, #62a45e 0%, #397d50 52%, #286b47 100%);
  border: 4px solid #efc65c;
  border-radius: 50%;
  box-shadow: inset 0 0 0 4px rgba(255,239,175,.35), 0 8px 0 #245b3d, 0 18px 35px rgba(33,69,43,.24);
  animation: countdownPop .56s cubic-bezier(.2,.8,.3,1) both;
  isolation: isolate;
}
.countdown-overlay span::before,
.countdown-overlay span::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 48px;
  height: 25px;
  background: linear-gradient(145deg,#a9ce62,#65a74f);
  border: 2px solid #3d7b45;
  border-radius: 100% 0 100% 0;
}
.countdown-overlay span::before { top: -13px; left: 18px; transform: rotate(18deg); }
.countdown-overlay span::after { right: 8px; bottom: -9px; transform: rotate(196deg); }
.countdown-overlay span.is-number,
.countdown-overlay span.is-go {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.countdown-overlay span.is-number {
  color: #32754d;
  font-family: var(--body);
  font-weight: 900;
  text-shadow: none;
}
.countdown-overlay span.is-number::before,
.countdown-overlay span.is-number::after {
  display: none;
}
.countdown-overlay span.is-go { color: #e9545f; font-family: var(--body); font-size: 68px; font-weight: 900; letter-spacing: .02em; text-shadow: none; }
.countdown-overlay span.is-go::before,
.countdown-overlay span.is-go::after { display: none; }
.countdown-overlay small {
  min-width: 150px;
  margin-top: 17px;
  padding: 9px 16px 8px;
  color: #315f45;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .12em;
  text-shadow: none;
  text-align: center;
  background: rgba(255,249,225,.82);
  border: 1px solid rgba(221,190,139,.72);
  border-radius: 999px;
  box-shadow: 0 4px 0 rgba(61,105,61,.13), 0 9px 18px rgba(40,75,45,.09);
}

.quiz-card {
  position: absolute;
  z-index: 46;
  top: 50%;
  left: 50%;
  width: min(88%, 354px);
  padding: 78px 18px 18px;
  color: #61483f;
  font-family: var(--body);
  text-align: center;
  background: #fffaf0;
  border: 4px solid #fff;
  border-radius: 27px;
  box-shadow: 0 8px 0 #d6b88f, 0 0 0 100vmax rgba(39,72,47,.46), var(--shadow);
  visibility: hidden;
  opacity: 0;
  transform: translate(-50%,-46%) scale(.92);
  transition: .22s cubic-bezier(.2,.8,.25,1);
}
.quiz-card::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 13px;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #c89a5d, #efd6aa 18%, #d2a567 50%, #efd6aa 82%, #c89a5d);
  box-shadow: 0 2px 0 rgba(122,78,45,.12);
}
.quiz-card.is-visible { visibility: visible; opacity: 1; transform: translate(-50%,-50%) scale(1); }
.challenge-gem-mark {
  position: absolute;
  z-index: 3;
  top: -57px;
  left: 50%;
  width: 108px;
  height: 108px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg,#fff9df 0%,#ead4aa 64%,#c99a63 100%);
  clip-path: polygon(50% 0,82% 12%,100% 40%,92% 74%,68% 96%,34% 100%,7% 79%,0 44%,16% 13%);
  filter: drop-shadow(0 7px 1px rgba(92,56,41,.24));
  transform: translateX(-50%);
}
.challenge-gem-mark::after {
  content: "";
  position: absolute;
  inset: 7px;
  background:
    linear-gradient(151deg, rgba(255,255,255,.28) 0 17%, transparent 18%),
    linear-gradient(132deg,#e96b6e 0 28%,#c84b57 29% 65%,#a33748 66% 100%);
  clip-path: polygon(50% 0,82% 12%,100% 40%,92% 74%,68% 96%,34% 100%,7% 79%,0 44%,16% 13%);
  box-shadow: inset 0 0 0 2px rgba(125,43,48,.22);
}
.challenge-gem-mark span {
  position: relative;
  z-index: 1;
  color: #fff9e6;
  font-family: var(--body);
  font-size: 58px;
  font-weight: 900;
  line-height: 1;
  transform: translateY(-1px);
  text-shadow: 0 3px 0 #9e3543, 0 0 2px rgba(89,36,37,.25);
}
.challenge-gem-mark span.is-ticking { animation: quizGemTick .32s cubic-bezier(.2,.8,.3,1); }
.quiz-card > .quiz-ribbon {
  position: relative;
  z-index: 2;
  width: min(88%, 270px);
  min-height: 42px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  color: #fffaf0;
  background: linear-gradient(180deg,#ce5860 0%,#b8424e 100%);
  clip-path: polygon(0 8%,16% 14%,14% 0,86% 0,84% 14%,100% 8%,94% 50%,100% 92%,84% 86%,86% 100%,14% 100%,16% 86%,0 92%,6% 50%);
  filter: drop-shadow(0 3px 1px rgba(102,46,43,.18));
}
.quiz-ribbon::before,
.quiz-ribbon::after {
  content: "";
  position: absolute;
  top: 7px;
  width: 18px;
  height: 28px;
  background: rgba(111,34,43,.24);
}
.quiz-ribbon::before { left: 28px; transform: skewX(10deg); }
.quiz-ribbon::after { right: 28px; transform: skewX(-10deg); }
.quiz-ribbon span {
  position: relative;
  z-index: 1;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .16em;
  transform: translateX(.08em);
  text-shadow: 0 1px 0 rgba(95,35,35,.28);
}
.quiz-card h2 { margin: 0 0 15px; font-family: var(--body); font-size: 21px; font-weight: 700; line-height: 1.55; letter-spacing: .02em; }
.quiz-answers { display: grid; gap: 9px; }
.quiz-answer {
  min-height: 48px;
  padding: 9px 12px;
  color: #694f45;
  font-family: var(--body);
  font-size: 12px;
  font-weight: 900;
  background: #fff3d9;
  border: 2px solid #e8cfaa;
  border-radius: 14px;
  box-shadow: 0 3px 0 #d6b98e;
  cursor: pointer;
}
.quiz-answer:active { transform: translateY(2px); box-shadow: 0 1px 0 #d6b98e; }
.quiz-answer:disabled { cursor: default; }
.quiz-answer.is-correct { color: #fff; background: #58a366; border-color: #fff; box-shadow: 0 3px 0 #347843; }
.quiz-answer.is-wrong { color: #fff; background: #dc5964; border-color: #fff; box-shadow: 0 3px 0 #a73542; }
.quiz-feedback { min-height: 24px; margin-top: 11px; color: #7e675c; font-family: var(--body); font-size: 11px; font-weight: 900; }
.quiz-feedback.is-correct { color: #37814b; }
.quiz-feedback.is-wrong { color: #c43e4c; }

.scrim { position: absolute; z-index: 39; inset: 0; visibility: hidden; background: rgba(39,70,46,.42); opacity: 0; backdrop-filter: blur(3px); transition: .25s ease; }
.scrim.is-visible { visibility: visible; opacity: 1; }
.leaderboard { position: absolute; z-index: 40; left: 0; right: 0; bottom: 0; height: min(78%, 650px); padding: 9px 16px max(18px, env(safe-area-inset-bottom)); color: #604940; background: #fffaf0; border: 3px solid #fff; border-bottom: 0; border-radius: 27px 27px 0 0; box-shadow: 0 -10px 35px rgba(53,69,42,.2); visibility: hidden; transform: translateY(105%); transition: .36s cubic-bezier(.2,.78,.28,1); }
.leaderboard.is-visible { visibility: visible; transform: translateY(0); }
.drawer-handle { width: 43px; height: 5px; margin: 0 auto 10px; background: #d9c6ac; border-radius: 9px; }
.leaderboard header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.leaderboard header p { margin: 0 0 2px; color: var(--teal); font-size: 8px; font-weight: 900; letter-spacing: .16em; }
.leaderboard header h2 { margin: 0; font-family: var(--display); font-size: 25px; }
.close-button { color: #8b7469; background: #f5ead7; box-shadow: none; font-size: 27px; line-height: 1; }
.rank-tabs { display: flex; padding: 4px; background: #f3e5cc; border-radius: 12px; }
.rank-tabs button { flex: 1; height: 34px; color: #8a756a; font-size: 10px; font-weight: 900; background: transparent; border: 0; border-radius: 9px; }
.rank-tabs button.is-active { color: #fff; background: var(--green); box-shadow: 0 3px 0 #2d704b; }
.rank-status { min-height: 14px; margin: 7px 2px 2px; color: #9a8174; font-size: 8px; font-weight: 700; text-align: center; }
.rank-status.is-online { color: #3b8550; }
.rank-status.is-offline { color: #c14b56; }
.rank-list { height: calc(100% - 177px); margin: 7px 0 10px; padding: 0; overflow: auto; list-style: none; scrollbar-width: thin; }
.rank-list li { min-height: 53px; display: grid; grid-template-columns: 34px 39px minmax(0,1fr) auto; align-items: center; gap: 8px; margin-bottom: 6px; padding: 6px 10px 6px 6px; background: #fffdf7; border: 1.5px solid #ecdbc0; border-radius: 14px; }
.rank-list li.is-me { background: #fff0dc; border-color: #eaa879; }
.rank-list li:nth-child(1) { background: linear-gradient(100deg,#fff4bd,#fffdf5); border-color: #e8bf4f; }
.rank-list li:nth-child(2) { background: linear-gradient(100deg,#f2eee6,#fffdf5); border-color: #c9bba7; }
.rank-list li:nth-child(3) { background: linear-gradient(100deg,#ffe1c6,#fffdf5); border-color: #d89b6b; }
.rank-number { color: #927a6d; font-size: 11px; font-weight: 900; text-align: center; }
.rank-list li:nth-child(-n+3) .rank-number { font-size: 18px; }
.rank-avatar { width: 38px; height: 38px; display: grid; place-items: center; overflow: hidden; background: #f8dfe0; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 2px 0 #d8baa7; }
.rank-avatar img { width: 30px; height: 39px; object-fit: contain; object-position: center bottom; }
.rank-name { min-width: 0; }
.rank-name b { display: block; overflow: hidden; font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.rank-name small { color: #9b8578; font-size: 8px; }
.rank-score { color: var(--red-deep); font-size: 13px; font-weight: 900; text-align: right; }
.rank-score small { display: block; color: #aa9385; font-size: 7px; }
.rank-loading { display: flex !important; justify-content: center; color: #9b8375; font-size: 11px; border-style: dashed !important; }
.my-rank { height: 48px; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px; padding: 0 13px; color: #fff; background: linear-gradient(110deg,#387752,#529858); border: 2px solid #fff; border-radius: 14px; box-shadow: 0 4px 0 #276143; }
.my-rank span { font-size: 10px; font-weight: 900; }
.my-rank b { color: var(--yellow); font-family: var(--display); font-size: 19px; }
.my-rank strong { font-size: 13px; }

.rotate-notice { display: none; }

@keyframes babyFloat { 0%,100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-7px) rotate(1deg); } }
@keyframes danceFrames {
  0%, 12.49% { background-position: 0 0; }
  12.5%, 24.99% { background-position: 33.333% 0; }
  25%, 37.49% { background-position: 66.667% 0; }
  37.5%, 49.99% { background-position: 100% 0; }
  50%, 62.49% { background-position: 0 100%; }
  62.5%, 74.99% { background-position: 33.333% 100%; }
  75%, 87.49% { background-position: 66.667% 100%; }
  87.5%, 99.99% { background-position: 100% 100%; }
  100% { background-position: 0 0; }
}
@keyframes boyDanceBody {
  0%,100% { transform: translate(0,1px) rotate(0) scale(1); }
  12.5% { transform: translate(-2px,-1px) rotate(-.8deg) scale(1.006,.994); }
  25% { transform: translate(-1px,0) rotate(-.5deg) scale(.995,1.005); }
  37.5% { transform: translate(2px,-1px) rotate(.9deg) scale(1.006,.994); }
  50% { transform: translate(0,1px) rotate(0) scale(1.008,.992); }
  62.5% { transform: translate(-2px,0) rotate(-1deg) scale(.995,1.005); }
  75% { transform: translate(2px,-1px) rotate(.7deg) scale(1.004,.996); }
  87.5% { transform: translate(1px,0) rotate(.4deg) scale(1); }
}
@keyframes girlDanceBody {
  0%,100% { transform: translate(0,1px) rotate(0) scale(1); }
  12.5% { transform: translate(2px,-1px) rotate(.9deg) scale(1.004,.996); }
  25% { transform: translate(1px,0) rotate(.5deg) scale(.995,1.005); }
  37.5% { transform: translate(2px,-1px) rotate(1.1deg) scale(1.006,.994); }
  50% { transform: translate(-2px,-1px) rotate(-1deg) scale(1.004,.996); }
  62.5% { transform: translate(-1px,0) rotate(-.8deg) scale(.995,1.005); }
  75% { transform: translate(2px,-1px) rotate(.8deg) scale(1.005,.995); }
  87.5% { transform: translate(0,0) rotate(.3deg) scale(1); }
}
@keyframes boyFloor { 0%,25%,50%,75%,100% { transform: translateX(-50%) scale(1,.9); } 12.5%,62.5% { transform: translateX(-54%) scale(.9,1); } 37.5%,87.5% { transform: translateX(-46%) scale(.9,1); } }
@keyframes girlFloor { 0%,50%,100% { transform: translateX(-50%) scale(.9,1); } 25%,75% { transform: translateX(-50%) scale(1.08,.82); } }
@keyframes boyFloorRing { 0%,50% { opacity: .7; transform: scale(.72); } 35%,85% { opacity: 0; transform: scale(1.18); } 100% { opacity: 0; } }
@keyframes girlFloorRing { 0%,50% { opacity: .75; transform: scale(.68) rotate(0); } 40%,90% { opacity: 0; transform: scale(1.25) rotate(8deg); } 100% { opacity: 0; } }
@keyframes resultHero { 0%,100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-5px) rotate(2deg); } }
@keyframes twinkle { 0%,100% { opacity: .45; transform: scale(.75) rotate(0); } 50% { opacity: 1; transform: scale(1.18) rotate(20deg); } }
@keyframes resultIn { from { opacity: 0; transform: translateY(28px) scale(.94); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes recordPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes tapPulse { 0%,100% { transform: scale(.9); } 50% { transform: scale(1.08); } }
@keyframes fingerTap { 0%,100% { transform: translateY(-2px) scale(1); } 42%,58% { transform: translateY(2px) scale(.92); } }
@keyframes tapRipple { 0% { opacity: .85; transform: scale(.72); } 70%,100% { opacity: 0; transform: scale(1.2); } }
@keyframes hintLife { 0% { opacity: 0; transform: translate(-50%,12px); } 15%,75% { opacity: 1; transform: translate(-50%,0); } 100% { opacity: 0; transform: translate(-50%,-9px); } }
@keyframes toastPop { 0% { opacity: 0; transform: translate(-50%,-14px) scale(.85); } 12%,75% { opacity: 1; transform: translate(-50%,0) scale(1); } 100% { opacity: 0; transform: translate(-50%,-9px) scale(.95); } }
@keyframes countdownPop { 0% { opacity: 0; transform: translateY(10px) scale(.82); } 40% { opacity: 1; transform: translateY(-2px) scale(1.04); } 100% { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes quizGemTick { 0% { opacity: .4; transform: translateY(-1px) scale(.74); } 65% { opacity: 1; transform: translateY(-1px) scale(1.08); } 100% { transform: translateY(-1px) scale(1); } }
@keyframes statusPop { 0% { transform: scale(.92); } 100% { transform: scale(1); } }
@keyframes checkinSpin { to { transform: rotate(353deg); } }
@keyframes shieldLeaf { 0%,100% { transform: rotate(-25deg) scale(1); } 50% { transform: rotate(-14deg) scale(1.12); } }
@keyframes uiRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes hudIn { from { opacity: 0; transform: translate(-50%,-7px); } to { opacity: 1; transform: translate(-50%,0); } }

@media (min-width: 521px) {
  .forest-frame { height: min(100dvh, 920px); border: 7px solid rgba(255,255,255,.75); border-radius: 34px; }
  .game-shell { padding: 14px; }
  .leaderboard { border-radius: 27px; }
}

@media (max-height: 690px) {
  .start-screen { padding-top: max(57px, calc(env(safe-area-inset-top) + 48px)); }
  .festival-chip { padding-block: 5px; }
  .title-art { width: 103px; height: 86px; margin-top: 2px; }
  .title-art::before { width: 78px; height: 66px; }
  .selected-hero-preview { width: 84px; height: 84px; }
  .dance-floor { bottom: 0; width: 68px; height: 13px; }
  .eyebrow { margin-top: -2px; }
  .start-screen h1 { font-size: 34px; }
  .intro { display: none; }
  .start-card { padding: 12px 14px; }
  .character-option { height: 62px; grid-template-columns: 39px minmax(0,1fr); }
  .character-portrait { width: 38px; height: 50px; }
  .character-portrait img { width: 35px; height: 48px; }
  .name-input-wrap input { height: 42px; }
  .primary-button { min-height: 48px; }
  .one-hand-note { display: none; }
  .countdown-overlay { place-content: start center; padding-top: 230px; }
  .countdown-overlay span { width: 154px; height: 154px; font-size: 96px; }
  .countdown-overlay span.is-go { font-size: 50px; }
  .countdown-overlay span::before,
  .countdown-overlay span::after { width: 40px; height: 21px; }
  .countdown-overlay span.is-number::before,
  .countdown-overlay span.is-number::after { width: 28px; height: 14px; }
  .countdown-overlay span.is-go::before,
  .countdown-overlay span.is-go::after { width: 12px; height: 12px; }
  .countdown-overlay small { min-width: 146px; margin-top: 17px; padding: 10px 15px 9px; font-size: 15px; }
  .gameover-screen { padding-top: max(92px, calc(env(safe-area-inset-top) + 82px)); }
  .result-card { padding: 73px 17px 13px; }
  .result-score { gap: 7px; margin-block: 10px 6px; }
  .result-score > div { min-height: 62px; }
  .result-score strong { font-size: 24px; }
  .result-card .primary-button { min-height: 50px; }
}

@media (orientation: landscape) and (max-height: 540px) {
  .rotate-notice { position: absolute; z-index: 80; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #694b42; background: #fff8e3; }
  .rotate-notice span { color: var(--red); font-size: 50px; }
  .rotate-notice b { font-family: var(--display); font-size: 20px; }
}

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