/* 厨房连连看3 · 竖屏 H5
   主色 #FF8A3D，卡通厨房场景，全部原生 CSS / SVG，无外链资源 */

*,
*::before,
*::after { box-sizing: border-box; }

:root {
  --orange: #FF8A3D;
  --orange-deep: #E8621C;
  --orange-dark: #B4490F;
  --yellow: #FFC53D;
  --cream: #FFF8EA;
  --cream-2: #FFEDD2;
  --brown: #6B3A1C;
  --brown-2: #8A4B1E;
  --wood: #C96B2C;
  --green: #58B84A;
  --red: #E8503A;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #F2B56F;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--brown);
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  overscroll-behavior: none;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(80% 60% at 50% 20%, #FFE9C7 0%, #F6BE80 55%, #DE9553 100%);
}

button {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible {
  outline: 3px solid rgba(255, 138, 61, .85);
  outline-offset: 2px;
}

[hidden] { display: none !important; }

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.app {
  position: relative;
  width: 100%;
  max-width: 520px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  isolation: isolate;
  background: #FFE3B8;
  box-shadow: 0 0 70px rgba(90, 40, 10, .28);
}

/* ---------- 厨房场景 ---------- */
.scene {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  transition: filter .45s ease, opacity .45s ease;
}

.scene-wall {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(100% 55% at 50% 0%, #FFF9E9 0%, #FFEECB 42%, #FFDA9E 72%, #F8BE78 100%);
}

.scene-wall::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .5) 1.5px, transparent 1.5px),
    linear-gradient(90deg, rgba(255, 255, 255, .5) 1.5px, transparent 1.5px);
  background-size: 74px 74px;
  opacity: .5;
  -webkit-mask-image: linear-gradient(#000 0%, rgba(0, 0, 0, .7) 55%, transparent 92%);
  mask-image: linear-gradient(#000 0%, rgba(0, 0, 0, .7) 55%, transparent 92%);
}

.scene-glow {
  position: absolute;
  left: 50%;
  top: -18%;
  width: 132%;
  height: 70%;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(255, 255, 255, .9), rgba(255, 255, 255, 0));
}

.scene-window {
  position: absolute;
  left: -18px;
  top: 13%;
  width: 104px;
  height: 138px;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(180deg, #8FD8F0 0%, #DDF4FB 62%, #BFE7A8 100%);
  border: 7px solid #F3D9B4;
  box-shadow: inset 0 0 0 2px #FFF7E7, 0 10px 20px rgba(120, 60, 10, .15);
  transform: rotate(-2deg);
  opacity: .9;
}

.scene-window::before,
.scene-window::after {
  content: "";
  position: absolute;
  z-index: 2;
  background: #F3D9B4;
  box-shadow: 0 0 0 1px rgba(180, 110, 50, .18);
}

.scene-window::before {
  left: 50%;
  top: 0;
  width: 6px;
  height: 100%;
  transform: translateX(-50%);
}

.scene-window::after {
  left: 0;
  top: 46%;
  width: 100%;
  height: 6px;
}

.win-sun {
  position: absolute;
  right: 12px;
  top: 10px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #FFE48A;
  box-shadow: 0 0 16px #FFE48A;
}

.win-cloud {
  position: absolute;
  width: 36px;
  height: 11px;
  border-radius: 99px;
  background: #fff;
  opacity: .82;
}

.win-cloud-a { left: 10px; top: 46px; }
.win-cloud-b { left: 26px; top: 64px; width: 26px; height: 9px; }

.win-plant {
  position: absolute;
  left: 8px;
  bottom: 0;
  width: 32px;
  height: 38px;
  background:
    radial-gradient(circle at 30% 30%, #6CC957 0 7px, transparent 7.5px),
    radial-gradient(circle at 68% 24%, #58B84A 0 8px, transparent 8.5px),
    radial-gradient(circle at 50% 52%, #7FD56A 0 9px, transparent 9.5px),
    linear-gradient(180deg, #4E9E3C, #367A29);
  border-radius: 12px 12px 4px 4px;
}

.scene-shelf {
  position: absolute;
  right: -24px;
  top: 18%;
  width: 160px;
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(#E8A45C, #C97A33);
  box-shadow: 0 6px 0 rgba(140, 70, 20, .22), 0 8px 14px rgba(120, 60, 10, .18);
  opacity: .92;
}

.scene-shelf::after {
  content: "";
  position: absolute;
  right: 26px;
  top: 12px;
  width: 10px;
  height: 42px;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(#C97A33, #A75A1E);
  box-shadow: 15px 0 0 #B9682A;
}

.jar {
  position: absolute;
  bottom: 14px;
  width: 24px;
  height: 32px;
  border-radius: 6px 6px 8px 8px;
  background: linear-gradient(90deg, #F7C978, #E8A94D);
  border: 2px solid rgba(150, 80, 25, .32);
}

.jar::before {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  top: 5px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 243, 216, .78);
}

.jar::after {
  content: "";
  position: absolute;
  left: -2px;
  right: -2px;
  top: -6px;
  height: 6px;
  border-radius: 3px;
  background: #B9682A;
}

.jar-a { right: 34px; }
.jar-b { right: 66px; height: 26px; background: linear-gradient(90deg, #F2B06E, #E09A47); }
.jar-c { right: 98px; height: 36px; background: linear-gradient(90deg, #F4CE8F, #E4B05C); }

.scene-pan {
  position: absolute;
  right: 12%;
  top: 33%;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #6E5747, #3E3129 72%);
  border: 6px solid #8A6B52;
  box-shadow: inset 0 4px 8px rgba(0, 0, 0, .35), 0 8px 16px rgba(70, 35, 10, .2);
  opacity: .9;
}

.scene-pan::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -62px;
  width: 8px;
  height: 62px;
  transform: translateX(-50%);
  border-radius: 4px;
  background: linear-gradient(#A57A55, #7E5836);
}

.scene-counter {
  position: absolute;
  left: -5%;
  right: -5%;
  bottom: -2%;
  height: 30%;
  border-radius: 45% 45% 0 0 / 12% 12% 0 0;
  background: linear-gradient(180deg, #F0A85A 0%, #D97C33 18%, #C46B28 60%, #A95520 100%);
  box-shadow: inset 0 4px 0 rgba(255, 214, 160, .72), 0 -12px 30px rgba(130, 60, 15, .16);
}

.scene-counter::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: repeating-linear-gradient(90deg, transparent 0 84px, rgba(110, 50, 10, .14) 84px 86px);
}

.scene-counter::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 24%;
  height: 2px;
  background: rgba(255, 230, 190, .32);
}

.app[data-screen="game"] .scene-window,
.app[data-screen="game"] .scene-shelf,
.app[data-screen="game"] .scene-pan {
  opacity: .2;
  filter: saturate(.7) blur(1px);
}

.app[data-screen="end"] .scene {
  filter: saturate(.92) brightness(.9);
}

/* ---------- 屏幕容器 ---------- */
.screen {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: none;
  flex-direction: column;
  padding: calc(12px + var(--safe-top)) 16px calc(14px + var(--safe-bottom));
}

.screen.active {
  display: flex;
  animation: screenIn .32s ease both;
}

@keyframes screenIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 通用按钮 ---------- */
.icon-btn {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 248, 234, .85);
  border: 1.5px solid rgba(196, 120, 50, .28);
  box-shadow: 0 4px 10px rgba(150, 75, 20, .12), inset 0 1px 0 #fff;
  color: #B05A17;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}

.icon-btn .mp-icon { width: 21px; height: 21px; }

.icon-btn:active {
  transform: scale(.94);
  box-shadow: 0 2px 5px rgba(150, 75, 20, .15), inset 0 1px 0 #fff;
}

.start-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(78vw, 310px);
  height: 68px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 36px;
  border: 2px solid #D96110;
  background: linear-gradient(180deg, #FFD05E 0%, #FFA52F 42%, #FF7A1A 100%);
  box-shadow: 0 8px 0 #BF4C0A, 0 16px 26px rgba(190, 80, 20, .4), inset 0 3px 0 rgba(255, 255, 255, .65);
  color: #fff;
  font-size: 25px;
  font-weight: 900;
  letter-spacing: .12em;
  text-shadow: 0 3px 0 rgba(160, 60, 10, .5);
  transition: transform .1s ease, box-shadow .1s ease;
}

.start-btn::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 5px;
  height: 34%;
  border-radius: 99px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.start-btn .mp-icon {
  width: 34px;
  height: 34px;
  color: #fff;
  filter: drop-shadow(0 2px 0 rgba(160, 60, 10, .45));
}

.start-btn .start-label {
  position: relative;
  z-index: 1;
}

.start-btn:active {
  transform: translateY(5px);
  box-shadow: 0 3px 0 #BF4C0A, 0 6px 12px rgba(190, 80, 20, .3), inset 0 3px 0 rgba(255, 255, 255, .5);
}

/* ---------- 首页 ---------- */
#screen-home {
  justify-content: space-between;
}

.home-top {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.best-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px 0 7px;
  border-radius: 99px;
  background: rgba(255, 248, 234, .82);
  border: 1.5px solid rgba(196, 120, 50, .28);
  box-shadow: 0 4px 10px rgba(150, 75, 20, .12), inset 0 1px 0 #fff;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.best-ico {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(180deg, #FFD766, #FFA927);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
  color: #8A4B0B;
}

.best-ico .mp-icon { width: 16px; height: 16px; }

.best-label {
  font-size: 12px;
  font-weight: 700;
  color: #9A6A3A;
}

.best-chip b {
  font-size: 17px;
  font-weight: 900;
  color: #D9651A;
  font-variant-numeric: tabular-nums;
}

.home-hero {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2vh 0 0;
}

.logo-wrap {
  position: relative;
  width: min(86vw, 342px);
  margin-top: 30px;
  display: flex;
  justify-content: center;
}

.logo-badge {
  position: relative;
  width: 100%;
  animation: logoIn .7s cubic-bezier(.2, 1.4, .4, 1) both;
}

@keyframes logoIn {
  from { opacity: 0; transform: translateY(18px) scale(.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.logo-plate {
  position: relative;
  overflow: hidden;
  padding: 24px 12px 20px;
  border-radius: 34px;
  border: 4px solid #C4510F;
  background: linear-gradient(180deg, #FFC061 0%, #FF9B36 40%, #F3761C 100%);
  box-shadow:
    inset 0 6px 0 rgba(255, 255, 255, .45),
    inset 0 -8px 0 rgba(170, 60, 10, .25),
    0 12px 0 #A63E09,
    0 24px 34px rgba(120, 50, 10, .32);
  text-align: center;
  transform: rotate(-1.5deg);
}

.logo-plate::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 24px;
  border: 2px dashed rgba(255, 255, 255, .4);
  pointer-events: none;
}

.logo-plate::after {
  content: "";
  position: absolute;
  left: -20%;
  top: -60%;
  width: 70%;
  height: 120%;
  transform: rotate(10deg);
  background: linear-gradient(115deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 60%);
  pointer-events: none;
}

.logo-line1 {
  display: block;
  font-size: clamp(26px, 8vw, 34px);
  line-height: 1;
  font-weight: 900;
  letter-spacing: .18em;
  color: #FFF4D8;
  text-shadow: 0 3px 0 #C4510F, 0 5px 0 rgba(120, 45, 5, .3);
}

.logo-line2 {
  display: block;
  margin-top: 4px;
  font-size: clamp(38px, 12vw, 50px);
  line-height: 1;
  font-weight: 900;
  letter-spacing: .02em;
  color: #FFF9E8;
  text-shadow: 0 4px 0 #C4510F, 0 8px 0 rgba(120, 45, 5, .32);
}

.logo-three {
  display: inline-block;
  margin-left: 2px;
  font-size: 1.08em;
  color: #FFE15A;
  text-shadow: 0 4px 0 #B4490F, 0 8px 0 rgba(120, 45, 5, .3);
  transform: translateY(-2px) rotate(6deg);
}

.logo-shine {
  position: absolute;
  left: 14%;
  top: 12%;
  width: 18%;
  height: 9%;
  border-radius: 50%;
  background: rgba(255, 255, 255, .55);
  filter: blur(3px);
  transform: rotate(-16deg);
  pointer-events: none;
}

.chef-hat {
  position: absolute;
  left: -10px;
  top: -58px;
  width: 104px;
  height: 104px;
  z-index: 2;
  transform: rotate(-10deg);
  filter: drop-shadow(0 8px 8px rgba(120, 60, 10, .22));
  animation: bob 3.2s ease-in-out infinite;
}

.spatula {
  position: absolute;
  right: -16px;
  top: -48px;
  width: 82px;
  height: 82px;
  z-index: 2;
  transform: rotate(20deg);
  filter: drop-shadow(0 6px 7px rgba(120, 60, 10, .25));
  animation: bob 3.8s ease-in-out infinite reverse;
}

@keyframes bob {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -7px; }
}

.tagline {
  margin: 22px 0 0;
  font-size: 14px;
  font-weight: 700;
  color: #9A5A24;
  letter-spacing: .04em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .7);
}

.home-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 6px 12px;
  border-radius: 99px;
  background: rgba(255, 248, 234, .55);
  font-size: 11.5px;
  font-weight: 700;
  color: #9A6330;
}

.home-meta .mp-icon {
  width: 14px;
  height: 14px;
  margin-right: 3px;
  color: #E8862C;
}

.meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #D8A46A;
}

.home-bottom {
  position: relative;
  z-index: 2;
  min-height: 122px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 2px;
}

.board-deco {
  position: absolute;
  left: 50%;
  bottom: 34px;
  width: min(78vw, 320px);
  height: 84px;
  transform: translateX(-50%);
  pointer-events: none;
}

.cutting-board {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 40px;
  border-radius: 16px 16px 12px 12px;
  background: linear-gradient(180deg, #F2C98D, #DCA45E);
  border: 2px solid rgba(150, 90, 35, .28);
  box-shadow: 0 8px 0 rgba(150, 90, 35, .18), 0 12px 18px rgba(120, 60, 10, .18);
  transform: rotate(-1deg);
}

.cutting-board::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 12px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #B87A3E;
  box-shadow: inset 0 2px 2px rgba(0, 0, 0, .22);
}

.veg {
  position: absolute;
  filter: drop-shadow(0 4px 4px rgba(100, 50, 10, .2));
}

.v-tomato { left: 15%; bottom: 24px; width: 66px; height: 66px; }
.v-broccoli { right: 39%; bottom: 30px; width: 52px; height: 52px; }
.v-carrot { right: 13%; bottom: 22px; width: 78px; height: 78px; transform: rotate(8deg); }

.howto {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 8px 13px;
  border-radius: 99px;
  background: rgba(255, 248, 234, .88);
  border: 1px solid rgba(196, 120, 50, .25);
  box-shadow: 0 4px 10px rgba(120, 60, 10, .1);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  font-size: 11.5px;
  font-weight: 600;
  color: #8E4E1B;
}

.howto .mp-icon { width: 15px; height: 15px; color: #E8862C; flex: 0 0 auto; }

.deco {
  position: absolute;
  width: 56px;
  height: 56px;
  opacity: .95;
  filter: drop-shadow(0 6px 6px rgba(120, 60, 10, .18));
}

.deco-broccoli {
  right: 2%;
  top: 6%;
  width: 46px;
  height: 46px;
  opacity: .82;
  transform: rotate(8deg);
  animation: bob 5s ease-in-out infinite .6s;
}

.deco-chili {
  left: 0;
  top: 10%;
  width: 42px;
  height: 42px;
  opacity: .82;
  transform: rotate(-18deg);
  animation: bob 4.3s ease-in-out infinite .2s;
}

/* ---------- 游戏中 ---------- */
#screen-game {
  padding: calc(8px + var(--safe-top)) 14px calc(12px + var(--safe-bottom));
}

.game-hud {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.hud-home {
  align-self: center;
  width: 42px;
  height: 42px;
}

.hud-score {
  flex: 0 0 88px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 5px 10px 5px 13px;
  border-radius: 16px;
  background: rgba(255, 248, 234, .9);
  border: 1.5px solid rgba(196, 120, 50, .25);
  box-shadow: 0 4px 10px rgba(120, 60, 10, .1), inset 0 1px 0 #fff;
}

.hud-score span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  color: #B08052;
}

.hud-score b {
  font-size: 22px;
  line-height: 1.05;
  font-weight: 900;
  color: #E8621C;
  font-variant-numeric: tabular-nums;
}

.hud-score b.pop { animation: numPop .25s ease; }

@keyframes numPop {
  0% { transform: scale(1); }
  45% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

.hud-time {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 5px 12px;
  border-radius: 16px;
  background: rgba(255, 248, 234, .9);
  border: 1.5px solid rgba(196, 120, 50, .25);
  box-shadow: 0 4px 10px rgba(120, 60, 10, .1), inset 0 1px 0 #fff;
}

.time-top {
  display: flex;
  align-items: center;
  gap: 6px;
}

.time-top .mp-icon { width: 15px; height: 15px; color: #E8862C; flex: 0 0 auto; }

.time-top b {
  font-size: 15px;
  font-weight: 900;
  color: #8A4B1E;
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
}

.combo-chip {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 99px;
  background: #FFE4BD;
  color: #B05A17;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}

.combo-chip.hot {
  background: linear-gradient(180deg, #FFB03A, #FF7A1A);
  color: #fff;
  box-shadow: 0 2px 8px rgba(255, 120, 30, .4);
  transform: scale(1.05);
}

.time-track {
  height: 6px;
  margin-top: 5px;
  border-radius: 99px;
  overflow: hidden;
  background: #F1D7B6;
  box-shadow: inset 0 1px 2px rgba(130, 70, 20, .18);
}

.time-fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #FFC53D, #FF8A3D);
  transition: width .12s linear, background .3s ease;
}

.time-track.urgent .time-fill {
  background: linear-gradient(90deg, #FF7A5C, #E8392B);
  animation: urgentPulse .6s ease-in-out infinite;
}

@keyframes urgentPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .55; }
}

.board-area {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 0 4px;
}

.board-wrap {
  position: relative;
  width: min(92vw, 430px);
  width: min(92vw, 430px, calc((100dvh - 205px) * .72));
}

.board {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: clamp(4px, 1.4vw, 6px);
  width: 100%;
}

.tile {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: clamp(9px, 3vw, 14px);
  border: 2px solid #F0CEA0;
  background: linear-gradient(180deg, #FFFDF6 0%, #FFF3DC 55%, #FFE6C2 100%);
  box-shadow: 0 3px 0 #DDAF74, 0 6px 10px rgba(120, 60, 10, .14), inset 0 1px 0 #fff;
  touch-action: manipulation;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}

.tile::before {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, .75), rgba(255, 255, 255, 0) 55%);
  pointer-events: none;
}

.tile .food {
  position: relative;
  width: 78%;
  height: 78%;
  filter: drop-shadow(0 2px 1px rgba(90, 40, 10, .18));
  pointer-events: none;
}

.tile:active { transform: scale(.95); }

.tile.sel {
  z-index: 2;
  border-color: #FF7A1A;
  background: linear-gradient(180deg, #FFF6DC, #FFDFAE);
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 0 0 3px rgba(255, 138, 61, .4), 0 4px 0 #D98A2B, 0 10px 16px rgba(200, 100, 20, .28);
}

.tile.hint {
  z-index: 2;
  border-color: #FFB021;
  animation: hintPulse .9s ease-in-out infinite;
}

.tile.wrong { animation: shake .35s ease; }

.tile.gone {
  pointer-events: none;
  animation: popOut .3s ease forwards;
}

.tile.empty {
  visibility: hidden;
  pointer-events: none;
}

.tile.shuffling { animation: tileFlip .34s ease both; }

@keyframes popOut {
  0% { transform: scale(1); }
  35% { transform: scale(1.18) rotate(4deg); filter: brightness(1.15); }
  100% { transform: scale(.2) rotate(-12deg); opacity: 0; }
}

@keyframes hintPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 176, 33, .55), 0 3px 0 #DDAF74; }
  50% { box-shadow: 0 0 0 6px rgba(255, 176, 33, 0), 0 3px 0 #DDAF74; transform: translateY(-2px) scale(1.03); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px) rotate(-3deg); }
  40% { transform: translateX(4px) rotate(3deg); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

@keyframes tileFlip {
  0% { transform: rotateY(0) scale(1); }
  50% { transform: rotateY(90deg) scale(.9); }
  100% { transform: rotateY(0) scale(1); }
}

.path-layer {
  position: absolute;
  inset: 0;
  z-index: 6;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.path-halo {
  fill: none;
  stroke: rgba(255, 255, 255, .92);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.path-line {
  fill: none;
  stroke: #FF7A1A;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 2px rgba(150, 60, 10, .25));
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: dashIn .22s ease-out forwards;
}

@keyframes dashIn {
  to { stroke-dashoffset: 0; }
}

.float-layer {
  position: absolute;
  inset: 0;
  z-index: 7;
  overflow: visible;
  pointer-events: none;
}

.spark {
  position: absolute;
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
  border-radius: 50%;
  background: #FFC53D;
  box-shadow: 0 0 6px rgba(255, 180, 40, .8);
  animation: sparkOut .55s ease-out forwards;
}

@keyframes sparkOut {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; }
}

.score-float {
  position: absolute;
  z-index: 8;
  transform: translate(-50%, -50%);
  color: #FF6B1A;
  font-size: 18px;
  font-weight: 900;
  white-space: nowrap;
  text-shadow: 0 2px 0 #fff, 0 0 6px #fff;
  pointer-events: none;
  animation: floatUp .8s ease-out forwards;
}

@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, -40%) scale(.8); }
  20% { opacity: 1; transform: translate(-50%, -60%) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -160%) scale(1); }
}

.game-tip {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 6px 12px;
  border-radius: 99px;
  background: rgba(255, 248, 234, .65);
  color: #A06632;
  font-size: 11.5px;
  font-weight: 700;
  transition: color .2s ease, background .2s ease;
}

.game-tip .tip-dot {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #FFB021;
  box-shadow: 0 0 0 3px rgba(255, 176, 33, .2);
}

.game-tip.warn {
  color: #B93A1D;
  background: rgba(255, 235, 225, .92);
}

.game-tools {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: center;
  gap: 10px;
  padding-top: 2px;
}

.tool-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 46px;
  padding: 0 16px;
  border-radius: 23px;
  border: 1.5px solid rgba(196, 120, 50, .28);
  background: rgba(255, 248, 234, .92);
  box-shadow: 0 4px 0 rgba(190, 130, 70, .35), 0 8px 14px rgba(120, 60, 10, .12), inset 0 1px 0 #fff;
  color: #8A4B1E;
  font-size: 14px;
  font-weight: 800;
  transition: transform .1s ease, box-shadow .1s ease, opacity .2s ease;
}

.tool-btn .mp-icon { width: 19px; height: 19px; color: #E8862C; }

.tool-btn em {
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: #FFE3BC;
  color: #C25D12;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.tool-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 rgba(190, 130, 70, .35), inset 0 1px 0 #fff;
}

.tool-btn:disabled {
  opacity: .45;
  box-shadow: 0 2px 0 rgba(190, 130, 70, .25);
  transform: none;
}

.tool-btn:disabled em { background: #EFE0CB; color: #A98A68; }

/* ---------- 结束 ---------- */
#screen-end {
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(70, 30, 5, .05), rgba(70, 30, 5, .28));
}

.end-card {
  position: relative;
  width: min(100%, 370px);
  padding: 30px 22px 20px;
  border-radius: 30px;
  border: 2px solid #F3D3A8;
  background: linear-gradient(180deg, #FFFBF2 0%, #FFF2DA 100%);
  box-shadow: 0 18px 40px rgba(100, 45, 10, .28), inset 0 2px 0 #fff;
  text-align: center;
  animation: cardIn .45s cubic-bezier(.2, 1.2, .4, 1) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(20px) scale(.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.end-card::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 24px;
  border: 1.5px dashed rgba(230, 150, 70, .28);
  pointer-events: none;
}

.end-badge {
  position: relative;
  z-index: 1;
  width: 74px;
  height: 74px;
  margin: -54px auto 6px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 4px solid #FFF8EA;
  background: linear-gradient(180deg, #FFD766, #FF9B2F);
  box-shadow: 0 8px 0 rgba(190, 100, 20, .35), 0 12px 20px rgba(150, 70, 15, .25);
  color: #fff;
}

.end-badge .mp-icon {
  width: 38px;
  height: 38px;
  filter: drop-shadow(0 2px 0 rgba(160, 80, 10, .3));
}

.end-kicker {
  margin: 2px 0 0;
  color: #C08A56;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .16em;
}

.end-title {
  margin: 5px 0 0;
  color: #8A3E0E;
  font-size: 27px;
  line-height: 1.15;
  font-weight: 900;
  text-shadow: 0 1px 0 #fff;
}

.end-sub {
  margin: 8px 0 0;
  padding: 0 6px;
  color: #A06A3A;
  font-size: 12.5px;
  line-height: 1.5;
}

.stars {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin: 10px 0 2px;
}

.star {
  width: 34px;
  height: 34px;
  color: #E7D6BE;
  transform: scale(.8);
  transition: color .3s ease, transform .3s ease;
}

.star.on {
  color: #FFC12E;
  filter: drop-shadow(0 3px 0 rgba(200, 120, 10, .35));
  animation: starPop .45s cubic-bezier(.2, 1.6, .4, 1) both;
}

.star:nth-child(2) { animation-delay: .08s; }
.star:nth-child(3) { animation-delay: .16s; }

@keyframes starPop {
  from { transform: scale(.2) rotate(-30deg); }
  to { transform: scale(1) rotate(0); }
}

.score-panel {
  position: relative;
  margin: 8px 0 0;
  padding: 10px 12px 8px;
  border-radius: 18px;
  border: 1.5px solid #F2D3A3;
  background: linear-gradient(180deg, #FFF3D6, #FFE6BB);
  box-shadow: inset 0 1px 0 #fff;
}

.score-label {
  display: block;
  color: #B07A45;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
}

.score-panel b#end-score {
  display: block;
  color: #F26A1B;
  font-size: 44px;
  line-height: 1.05;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 0 #fff;
}

.best-line {
  display: block;
  margin-top: 2px;
  color: #B07A45;
  font-size: 11px;
  font-weight: 600;
}

.best-line b { color: #8A4B1E; font-weight: 900; }

.record {
  position: absolute;
  right: 10px;
  top: 10px;
  padding: 3px 8px;
  border-radius: 99px;
  background: linear-gradient(180deg, #FFB03A, #FF7A1A);
  box-shadow: 0 2px 6px rgba(255, 110, 20, .35);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  transform: rotate(4deg);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 10px 0 14px;
}

.stats > div {
  padding: 7px 4px;
  border-radius: 14px;
  border: 1px solid rgba(220, 170, 110, .35);
  background: rgba(255, 255, 255, .6);
}

.stats b {
  display: block;
  color: #8A4B1E;
  font-size: 17px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.stats span {
  display: block;
  margin-top: 1px;
  color: #B58A62;
  font-size: 10px;
  font-weight: 700;
}

.end-again {
  width: 100%;
  height: 56px;
  margin-top: 0;
  border-radius: 28px;
  font-size: 21px;
}

.end-again .mp-icon { width: 29px; height: 29px; }

.ghost-btn {
  display: block;
  width: 100%;
  height: 42px;
  margin-top: 8px;
  border-radius: 21px;
  border: 1.5px solid rgba(196, 120, 50, .3);
  background: transparent;
  color: #9A5A24;
  font-size: 14px;
  font-weight: 800;
}

.ghost-btn:active { background: rgba(196, 120, 50, .08); }

/* ---------- 提示与弹窗 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(88px + var(--safe-bottom));
  z-index: 30;
  max-width: 80vw;
  padding: 9px 16px;
  border-radius: 99px;
  background: rgba(90, 45, 15, .9);
  box-shadow: 0 8px 20px rgba(60, 25, 5, .3);
  color: #FFF6E6;
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity .2s ease, transform .2s ease;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal.open { display: flex; }

.modal::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(60, 28, 8, .42);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.modal-card {
  position: relative;
  width: min(100%, 300px);
  padding: 22px 20px 18px;
  border-radius: 22px;
  background: #FFF8EA;
  box-shadow: 0 20px 40px rgba(50, 20, 5, .35);
  text-align: center;
  animation: cardIn .25s ease both;
}

.modal-card p {
  margin: 0;
  color: #8A3E0E;
  font-size: 17px;
  font-weight: 900;
}

.modal-card small {
  display: block;
  margin-top: 6px;
  color: #A06A3A;
  font-size: 12px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.modal-actions button {
  flex: 1;
  height: 44px;
  border-radius: 22px;
  font-size: 14px;
  font-weight: 800;
}

#modal-cancel {
  background: linear-gradient(180deg, #FFB03A, #FF8A3D);
  box-shadow: 0 4px 0 #C4510F;
  color: #fff;
}

#modal-ok {
  background: #F4E4CB;
  color: #8A4B1E;
}

/* ---------- 短屏适配 ---------- */
@media (max-width: 350px) {
  .hud-score { flex-basis: 78px; padding-left: 10px; }
  .hud-score b { font-size: 20px; }
  .hud-time { padding: 5px 9px; }
  .combo-chip { font-size: 9px; padding: 2px 5px; }
  .tool-btn { padding: 0 13px; }
}

@media (max-height: 700px) {
  .logo-wrap { margin-top: 20px; }
  .chef-hat { top: -48px; width: 88px; height: 88px; }
  .spatula { top: -40px; width: 70px; height: 70px; }
  .logo-plate { padding: 20px 10px 16px; }
  .tagline { margin-top: 14px; font-size: 12.5px; }
  .start-btn { height: 60px; font-size: 22px; }
  .home-meta { margin-top: 10px; font-size: 10.5px; }
  .home-bottom { min-height: 100px; }
  .board-deco { bottom: 30px; height: 70px; }
  .v-tomato { width: 56px; height: 56px; }
  .v-carrot { width: 64px; height: 64px; }
  .v-broccoli { width: 44px; height: 44px; }
}

@media (max-height: 620px) {
  .home-hero { padding-top: 0; }
  .home-bottom { min-height: 74px; }
  .board-deco { display: none; }
  .logo-wrap { margin-top: 18px; }
  .chef-hat { top: -40px; width: 74px; height: 74px; }
  .spatula { display: none; }
  .tagline { margin-top: 18px; font-size: 11.5px; }
  .home-meta { margin-top: 8px; padding: 4px 10px; font-size: 10px; }
  .start-btn { height: 56px; margin-top: 12px; }
  .end-card { padding: 24px 18px 14px; }
  .end-badge { width: 62px; height: 62px; margin-top: -44px; }
  .score-panel b#end-score { font-size: 36px; }
  .stats { margin: 8px 0 10px; }
  .end-title { font-size: 23px; }
  .end-again { height: 50px; font-size: 19px; }
}

/* 低端机 / 减少动态 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
