:root {
  --ink: #4e5944;
  --soft-ink: #71806a;
  --cream: #fff9e8;
  --paper: #fffdf4;
  --yellow: #f2c960;
  --green: #78b56e;
  --red: #ef8a79;
  --blue: #70a9c8;
  --purple: #aa94cc;
  --pink: #df8eaa;
  --spring: cubic-bezier(.22, 1.35, .42, 1);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: #f9dda0; }
body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 10% 6%, rgba(255,255,255,.75) 0 5px, transparent 6px),
    radial-gradient(circle at 91% 12%, rgba(255,255,255,.65) 0 4px, transparent 5px),
    linear-gradient(180deg, #f9d995 0%, #f7e8b7 48%, #d9e9ba 100%);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

.sky-dots { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.sky-dots i { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.68); }
.sky-dots i:nth-child(1) { top: 8%; left: 9%; }
.sky-dots i:nth-child(2) { top: 19%; right: 13%; width: 17px; height: 17px; }
.sky-dots i:nth-child(3) { top: 44%; left: 3%; }
.sky-dots i:nth-child(4) { top: 72%; right: 4%; width: 15px; height: 15px; }
.sky-dots i:nth-child(5) { bottom: 8%; left: 17%; width: 7px; height: 7px; }
.sky-dots i:nth-child(6) { bottom: 17%; right: 26%; }

.game-shell { position: relative; z-index: 1; width: min(1180px, calc(100% - 26px)); margin: 0 auto; padding: 12px 0 28px; }
.game-header { display: grid; min-height: 76px; grid-template-columns: 120px 1fr 120px; align-items: center; }
.title-lockup { text-align: center; }
.title-lockup p { margin: 0 0 2px; color: #78806a; font-size: 11px; font-weight: 900; letter-spacing: .16em; }
.title-lockup h1 { margin: 0; font-family: KaiTi, STKaiti, serif; font-size: clamp(29px, 4.5vw, 46px); letter-spacing: .06em; }
.header-actions { display: flex; justify-content: flex-end; gap: 9px; }
.round-button {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border: 4px solid rgba(255,255,255,.78);
  border-radius: 50%;
  background: rgba(255,252,233,.92);
  box-shadow: 0 6px 0 rgba(103,91,58,.13);
  color: #61745b;
  cursor: pointer;
  font-size: 24px;
  font-weight: 900;
  text-decoration: none;
  transition: transform 150ms var(--spring), box-shadow 150ms ease;
}
.round-button:active { transform: translateY(4px) scale(.96); box-shadow: 0 2px 0 rgba(103,91,58,.13); }

.game-board {
  display: grid;
  min-height: 660px;
  overflow: hidden;
  grid-template-columns: minmax(0, 1.12fr) minmax(420px, .88fr);
  border: 7px solid rgba(255,255,255,.9);
  border-radius: 38px;
  background: var(--paper);
  box-shadow: 0 18px 45px rgba(108,91,53,.17), 0 8px 0 rgba(104,108,70,.12);
}

.picnic-scene { position: relative; min-height: 660px; overflow: hidden; background: linear-gradient(#bce9e0 0 54%, #a9d486 54%); }
.picnic-scene::before { position: absolute; inset: 0; content: ""; background-image: linear-gradient(rgba(255,255,255,.13) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.13) 1px, transparent 1px); background-size: 36px 36px; }
.sun { position: absolute; top: 42px; right: 55px; color: #f6ca58; font-size: 82px; line-height: 1; filter: drop-shadow(0 8px 0 rgba(221,165,55,.12)); animation: sun-glow 3s ease-in-out infinite; }
.cloud { position: absolute; width: 102px; height: 32px; border-radius: 30px; background: rgba(255,255,255,.72); }
.cloud::before, .cloud::after { position: absolute; bottom: 0; content: ""; border-radius: 50%; background: inherit; }
.cloud::before { left: 15px; width: 42px; height: 42px; }
.cloud::after { right: 12px; width: 55px; height: 55px; }
.cloud-one { top: 73px; left: 35px; }
.cloud-two { top: 146px; right: 12px; transform: scale(.65); opacity: .72; }
.hill { position: absolute; border-radius: 50% 50% 0 0; }
.hill-back { right: -100px; bottom: 160px; width: 470px; height: 240px; background: #91c775; }
.hill-front { bottom: 0; left: -120px; width: 590px; height: 310px; background: #84bd69; }
.tree { position: absolute; top: 126px; left: 40px; width: 150px; height: 260px; }
.tree b { position: absolute; z-index: 1; bottom: 0; left: 62px; width: 38px; height: 165px; border-radius: 20px; background: #9b6e4f; }
.tree i { position: absolute; z-index: 2; width: 95px; height: 95px; border-radius: 50%; background: #5e9d62; box-shadow: inset -8px -10px rgba(60,117,68,.18); }
.tree i:nth-child(1) { top: 6px; left: 0; }
.tree i:nth-child(2) { top: 0; right: 0; }
.tree i:nth-child(3) { top: 62px; left: 30px; width: 110px; height: 110px; }

.friend-stage { position: absolute; z-index: 5; top: 105px; left: 50%; width: 330px; height: 320px; transform: translateX(-42%); }
.friend { position: absolute; bottom: 14px; left: 40px; width: 180px; height: 205px; transform-origin: 50% 100%; }
.friend-emoji { position: relative; z-index: 2; display: block; font-size: 150px; line-height: 1; filter: drop-shadow(0 12px 2px rgba(64,85,51,.15)); animation: friend-breathe 2.3s ease-in-out infinite; }
.friend-shadow { position: absolute; bottom: 0; left: 28px; width: 125px; height: 25px; border-radius: 50%; background: rgba(55,94,49,.18); }
.friend.is-arriving { animation: friend-arrive 430ms var(--spring) both; }
.friend.is-cheering { animation: friend-cheer 560ms var(--spring); }
.request-bubble { position: absolute; z-index: 4; top: 2px; right: 3px; display: grid; width: 118px; height: 102px; place-items: center; border: 5px solid #fff; border-radius: 50% 50% 50% 15%; background: #fffbed; box-shadow: 0 8px 0 rgba(83,91,53,.12); }
.request-icon { font-size: 44px; filter: drop-shadow(0 4px 2px rgba(60,55,40,.1)); }
.request-color { position: absolute; right: 10px; bottom: 9px; width: 30px; height: 30px; border: 4px solid #fff; border-radius: 50%; background: var(--request-color, var(--green)); box-shadow: 0 3px 0 rgba(68,72,50,.1); }
.friend-name { position: absolute; right: -6px; bottom: 14px; margin: 0; padding: 8px 13px; border: 3px solid rgba(255,255,255,.75); border-radius: 999px; background: rgba(255,250,228,.92); box-shadow: 0 5px 0 rgba(86,93,54,.11); font-size: 12px; font-weight: 900; }

.picnic-blanket { position: absolute; z-index: 4; right: 22px; bottom: 25px; left: 22px; height: 205px; border: 8px solid #fff6df; border-radius: 50% 50% 26px 26px; background: repeating-linear-gradient(0deg, transparent 0 42px, rgba(255,255,255,.42) 42px 48px), repeating-linear-gradient(90deg, #ee9d8d 0 54px, #f7c9a7 54px 108px); box-shadow: 0 12px 0 rgba(73,94,49,.14); transform: perspective(500px) rotateX(11deg); }
.rainbow-tray { display: flex; position: absolute; top: 46px; left: 50%; width: min(440px, 82%); min-height: 102px; padding: 15px; justify-content: center; gap: 9px; border: 8px solid #fffaf0; border-radius: 50%; background: #dcebe1; box-shadow: 0 9px 0 rgba(82,89,63,.14), inset 0 0 0 4px rgba(96,143,116,.1); transform: translateX(-50%); }
.tray-food { display: grid; width: 60px; height: 60px; place-items: center; border: 4px solid #fff; border-radius: 20px; background: var(--food-color); box-shadow: 0 5px 0 rgba(76,74,52,.12); font-size: 35px; animation: food-land 450ms var(--spring); }
.friend-row { position: absolute; z-index: 7; bottom: 166px; left: 17px; display: flex; gap: 3px; }
.joined-friend { font-size: 37px; filter: drop-shadow(0 5px 2px rgba(55,75,43,.15)); animation: friend-pop 380ms var(--spring); }
.sparkle-layer { position: absolute; z-index: 20; inset: 0; pointer-events: none; }
.sparkle { position: absolute; color: var(--sparkle-color, #fff); font-size: 27px; text-shadow: 0 2px #cc9b43; animation: sparkle-out 700ms ease-out forwards; }
.flying-food { position: fixed; z-index: 100; pointer-events: none; font-size: 54px; filter: drop-shadow(0 8px 3px rgba(65,56,43,.17)); transition: transform 480ms var(--spring), opacity 480ms ease; }

.play-panel { display: grid; position: relative; z-index: 5; padding: clamp(26px, 3.7vw, 48px); align-items: center; background: radial-gradient(circle at 100% 0, #fff0bd 0, transparent 38%), var(--paper); }
.round-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.eyebrow { margin: 0 0 7px; color: #df7f6f; font-size: 12px; font-weight: 900; letter-spacing: .14em; }
.round-heading h2, .finish-view h2 { margin: 0; font-family: KaiTi, STKaiti, serif; font-size: clamp(30px, 4vw, 42px); line-height: 1.12; }
.round-count { flex: none; padding: 7px 12px; border: 3px solid #f1e2c7; border-radius: 999px; background: #fff9e8; font-size: 13px; font-weight: 900; }
.round-count b { color: #df7f6f; font-size: 23px; }
.color-path { display: flex; margin: 19px 0 17px; justify-content: center; gap: 10px; }
.path-dot { display: grid; width: 46px; height: 46px; place-items: center; border: 5px solid #fff; border-radius: 50%; background: #eee5d6; box-shadow: 0 4px 0 rgba(74,69,49,.1); color: white; font-size: 21px; transition: transform 280ms var(--spring), background 280ms ease; }
.path-dot.is-current { transform: translateY(-4px) scale(1.12); box-shadow: 0 8px 0 rgba(74,69,49,.1); }
.path-dot.is-done { background: var(--dot-color); animation: dot-pop 360ms var(--spring); }

.food-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.food-card { position: relative; min-width: 0; min-height: 142px; padding: 12px 7px 9px; overflow: hidden; border: 5px solid rgba(255,255,255,.88); border-radius: 28px; background: color-mix(in srgb, var(--card-color) 61%, white); box-shadow: 0 7px 0 color-mix(in srgb, var(--card-color) 63%, #756b4f), 0 13px 24px rgba(87,75,46,.12); cursor: pointer; transition: transform 160ms var(--spring), filter 160ms ease; }
.food-card::before { position: absolute; top: -28px; right: -22px; width: 80px; height: 80px; content: ""; border-radius: 50%; background: rgba(255,255,255,.3); }
.food-card:hover { transform: translateY(-5px) rotate(-1deg); filter: saturate(1.08); }
.food-card:active { transform: translateY(3px) scale(.97); }
.food-card.is-trying { animation: gentle-try 380ms ease; }
.food-card.is-match { animation: card-match 430ms var(--spring); }
.food-card[disabled] { pointer-events: none; }
.food-emoji { position: relative; display: block; margin-bottom: 5px; font-size: clamp(43px, 5vw, 60px); line-height: 1; filter: drop-shadow(0 6px 2px rgba(76,58,42,.12)); }
.food-name { display: block; overflow: hidden; font-size: 14px; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.food-color-dot { display: inline-block; width: 17px; height: 17px; margin-top: 7px; border: 3px solid rgba(255,255,255,.8); border-radius: 50%; background: var(--card-color); box-shadow: 0 2px 0 rgba(80,71,48,.12); }
.gentle-feedback { display: flex; min-height: 64px; margin-top: 18px; padding: 9px 13px; align-items: center; justify-content: center; gap: 10px; border: 3px dashed #dfd0ad; border-radius: 20px; background: #fff8df; }
.gentle-feedback > span { font-size: 27px; }
.gentle-feedback p { margin: 0; }
.gentle-feedback b, .gentle-feedback small { display: block; }
.gentle-feedback b { font-size: 13px; }
.gentle-feedback small { margin-top: 2px; color: var(--soft-ink); font-size: 11px; font-weight: 800; }
.gentle-feedback.is-hint { border-color: var(--hint-color); background: color-mix(in srgb, var(--hint-color) 18%, white); }
.gentle-feedback.is-happy { border-style: solid; border-color: #9dcf86; background: #edf8da; }

.finish-view { text-align: center; }
.rainbow-badge { display: grid; width: 118px; height: 118px; margin: 0 auto 18px; place-items: center; border: 7px double #fff; border-radius: 50%; background: #f6d775; box-shadow: 0 9px 0 rgba(83,92,54,.13); font-size: 62px; animation: badge-arrive 520ms var(--spring); }
.finish-view > p:not(.eyebrow) { margin: 16px auto 22px; color: var(--soft-ink); font-weight: 800; }
.finish-foods { display: flex; min-height: 70px; margin: 20px 0; justify-content: center; gap: 8px; flex-wrap: wrap; }
.finish-food { display: grid; width: 64px; height: 64px; place-items: center; border: 4px solid #fff; border-radius: 20px; background: var(--food-color); box-shadow: 0 5px 0 rgba(78,73,49,.12); font-size: 36px; }
.primary-button { min-height: 58px; padding: 0 28px; border: 4px solid rgba(255,255,255,.8); border-radius: 999px; background: #ef937e; box-shadow: 0 7px 0 #bd6859; color: white; cursor: pointer; font-size: 17px; font-weight: 900; }
.primary-button:active { transform: translateY(4px); box-shadow: 0 3px 0 #bd6859; }

.parent-note { display: grid; max-width: 900px; margin: 22px auto 0; padding: 16px 22px; grid-template-columns: auto 1fr; gap: 14px; align-items: center; border: 2px solid rgba(93,92,57,.1); border-radius: 24px; background: rgba(255,252,232,.76); }
.parent-note > span { display: grid; width: 50px; height: 50px; place-items: center; border-radius: 50%; background: #f2dc87; font-size: 27px; }
.parent-note h2 { margin: 0 0 4px; font-size: 15px; }
.parent-note p { margin: 0; color: #777565; font-size: 12px; font-weight: 700; line-height: 1.6; }

.round-button:focus-visible, .food-card:focus-visible, .primary-button:focus-visible { outline: 5px solid rgba(75,113,181,.65); outline-offset: 4px; }
[hidden] { display: none !important; }

@keyframes sun-glow { 0%,100% { transform: rotate(-3deg) scale(.97); } 50% { transform: rotate(3deg) scale(1.03); } }
@keyframes friend-breathe { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes friend-arrive { from { opacity: 0; transform: translateX(45px) scale(.7); } to { opacity: 1; transform: none; } }
@keyframes friend-cheer { 0%,100% { transform: translateY(0) scale(1); } 42% { transform: translateY(-14px) scale(1.08); } 70% { transform: translateY(-4px) scale(.98); } }
@keyframes friend-pop { from { opacity: 0; transform: translateY(15px) scale(.4); } to { opacity: 1; transform: none; } }
@keyframes food-land { from { opacity: 0; transform: translateY(-25px) scale(.5) rotate(-12deg); } to { opacity: 1; transform: none; } }
@keyframes sparkle-out { from { opacity: 1; transform: translate(0, 0) scale(.5); } to { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.25) rotate(90deg); } }
@keyframes dot-pop { 0% { transform: scale(.75); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes gentle-try { 0%,100% { transform: none; } 35% { transform: translateY(-4px) rotate(-2deg); } 70% { transform: translateY(-2px) rotate(2deg); } }
@keyframes card-match { 0% { transform: none; } 45% { transform: translateY(-13px) scale(1.08); } 100% { transform: translateY(4px) scale(.96); } }
@keyframes badge-arrive { from { opacity: 0; transform: scale(.45) rotate(-15deg); } to { opacity: 1; transform: none; } }

@media (max-width: 900px) {
  .game-board { grid-template-columns: 1fr; }
  .picnic-scene { min-height: 590px; }
  .play-panel { min-height: 550px; }
}

@media (max-width: 580px) {
  .game-shell { width: min(100% - 12px, 1180px); padding-top: 5px; }
  .game-header { min-height: 66px; grid-template-columns: 88px 1fr 88px; }
  .round-button { width: 42px; height: 42px; border-width: 3px; font-size: 20px; }
  .header-actions { gap: 4px; }
  .title-lockup p { display: none; }
  .title-lockup h1 { font-size: 25px; white-space: nowrap; }
  .game-board { border-width: 5px; border-radius: 28px; }
  .picnic-scene { min-height: 510px; }
  .sun { top: 29px; right: 30px; font-size: 61px; }
  .tree { left: -8px; transform: scale(.76); transform-origin: bottom left; }
  .friend-stage { top: 68px; left: 51%; transform: translateX(-47%) scale(.84); transform-origin: top center; }
  .picnic-blanket { right: 9px; bottom: 15px; left: 9px; height: 175px; }
  .rainbow-tray { top: 34px; padding: 12px 9px; gap: 4px; }
  .tray-food { width: 47px; height: 47px; border-radius: 15px; font-size: 29px; }
  .friend-row { bottom: 137px; }
  .play-panel { min-height: 510px; padding: 28px 14px 34px; }
  .food-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .food-card { min-height: 126px; border-width: 4px; border-radius: 23px; }
  .food-emoji { font-size: 43px; }
  .color-path { gap: 7px; }
  .path-dot { width: 40px; height: 40px; }
  .parent-note { margin-top: 13px; padding: 14px; grid-template-columns: 1fr; }
  .parent-note > span { display: none; }
}

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