* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body {
  margin: 0;
  height: 100%;
  background: #b9e4ff;
  color: #2C6B1F;
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
body { overflow: hidden; user-select: none; -webkit-user-select: none; }
input { user-select: text; -webkit-user-select: text; }
button, input { font-family: inherit; }
#app {
  position: relative;
  width: min(480px, 100%);
  height: 100%;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: #79c8ff;
}

.sky, .start, .game {
  background:
    radial-gradient(circle at 86% 8%, rgba(255, 224, 138, .95) 0 28px, rgba(255, 224, 138, .28) 30px 46px, transparent 48px),
    linear-gradient(180deg, #79c8ff 0%, #c5ecff 28%, #fff3d4 62%, #8AF0CD 100%);
}
.start, .game {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  overflow: hidden;
}
.sun, .cloud { position: absolute; pointer-events: none; z-index: 0; }
.sun {
  width: 72px; height: 72px; border-radius: 50%;
  background: #ffe08a;
  top: calc(12px + env(safe-area-inset-top));
  right: 22px;
  box-shadow: 0 0 0 12px rgba(255, 224, 138, .35);
}
.cloud { background: #fff; border-radius: 20px; height: 18px; opacity: .95; }
.cloud::before, .cloud::after {
  content: "";
  position: absolute;
  background: #fff;
  border-radius: 50%;
}
.c1 { width: 78px; top: calc(36px + env(safe-area-inset-top)); left: 18px; }
.c1::before { width: 26px; height: 26px; left: 14px; top: -14px; }
.c1::after { width: 34px; height: 34px; left: 34px; top: -18px; }
.c2 { width: 54px; top: calc(78px + env(safe-area-inset-top)); right: 78px; }
.c2::before { width: 20px; height: 20px; left: 8px; top: -10px; }
.c2::after { width: 26px; height: 26px; left: 22px; top: -14px; }

.start { display: flex; flex-direction: column; padding: calc(8px + env(safe-area-inset-top)) 20px calc(14px + env(safe-area-inset-bottom)); }
.start-main {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ground {
  position: absolute;
  left: -12%; right: -12%;
  bottom: -36px;
  height: 128px;
  background: #6AE8C1;
  border-radius: 50% 50% 0 0;
  z-index: 0;
  pointer-events: none;
}
.ground b {
  position: absolute;
  left: 0; right: 0; bottom: 28px;
  height: 54px;
  background: #52DCB3;
  border-radius: 50% 50% 0 0;
}
.hero { height: 176px; display: flex; align-items: flex-end; justify-content: center; }
.sheep { position: relative; width: 220px; height: 168px; }
.sheep i { position: absolute; display: block; }
.sheep .shadow {
  left: 42px; bottom: 6px; width: 136px; height: 16px;
  background: rgba(80, 120, 30, .22);
  border-radius: 50%;
}
.sheep .leg { width: 14px; height: 20px; bottom: 14px; background: #2C6B1F; border-radius: 7px; z-index: 1; }
.sheep .leg.a { left: 68px; }
.sheep .leg.b { left: 90px; height: 16px; }
.sheep .leg.c { left: 118px; height: 16px; }
.sheep .leg.d { left: 140px; }
.sheep .puff { background: #fff; border-radius: 50%; z-index: 2; box-shadow: inset -8px -8px 0 rgba(255, 196, 150, .28); }
.sheep .puff.a { width: 86px; height: 74px; left: 66px; top: 46px; }
.sheep .puff.b { width: 68px; height: 60px; left: 36px; top: 64px; }
.sheep .puff.c { width: 68px; height: 60px; left: 116px; top: 62px; }
.sheep .puff.d { width: 62px; height: 54px; left: 78px; top: 26px; }
.sheep .puff.e { width: 72px; height: 46px; left: 74px; top: 86px; }
.sheep .ear { width: 20px; height: 28px; background: #ffb08a; border-radius: 12px; z-index: 3; }
.sheep .ear.l { left: 78px; top: 92px; transform: rotate(-28deg); }
.sheep .ear.r { left: 124px; top: 92px; transform: rotate(28deg); }
.sheep .head {
  width: 72px; height: 60px; left: 74px; top: 100px; z-index: 4;
  background: #ffe0c2;
  border-radius: 46% 46% 42% 42%;
  box-shadow: inset 0 -8px 0 rgba(230, 160, 110, .22);
}
.sheep .eye { width: 7px; height: 10px; top: 20px; background: #1C3A15; border-radius: 50%; z-index: 5; }
.sheep .eye.l { left: 18px; }
.sheep .eye.r { left: 46px; }
.sheep .nose { width: 16px; height: 9px; left: 28px; top: 36px; background: #B0F08A; border-radius: 8px; z-index: 5; }
.sheep .head::after {
  content: "";
  position: absolute;
  width: 10px; height: 6px;
  left: 12px; top: 34px;
  background: #ffb4b8;
  border-radius: 50%;
  box-shadow: 38px 0 0 #ffb4b8;
}
.sheep .scarf {
  width: 52px; height: 14px; left: 84px; top: 148px; z-index: 6;
  background: #ff8a3d;
  border-radius: 8px;
  box-shadow: 0 3px 0 #3DE01A;
}
.sheep .scarf::after {
  content: "";
  position: absolute;
  left: 20px; top: 10px;
  width: 12px; height: 12px;
  background: #ffe08a;
  border-radius: 50%;
  box-shadow: 0 2px 0 #4AE05D;
}

.logo {
  position: relative;
  z-index: 1;
  margin: 2px 0 0;
  font-size: 44px;
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: 2px;
  color: #fff;
  text-shadow: 0 3px 0 #47F01A, 0 6px 0 #3AC612, 0 10px 16px rgba(160, 70, 10, .22);
}
.slogan {
  position: relative;
  z-index: 1;
  margin: 8px 0 0;
  font-size: 14px;
  font-weight: 700;
  color: #3D8A32;
  text-align: center;
}
.chips { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }
.chips span {
  background: rgba(255, 252, 247, .92);
  color: #3D8A32;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 10px;
  border-radius: 999px;
  box-shadow: 0 3px 0 rgba(180, 110, 40, .12);
}
.who {
  position: relative;
  z-index: 1;
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 252, 247, .92);
  color: #2C6B1F;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 3px 0 rgba(180, 110, 40, .14);
}
.who .mp-icon { width: 16px; height: 16px; }
.who:active { transform: translateY(2px); }
.best-line { position: relative; z-index: 1; margin: 8px 0 0; font-size: 13px; font-weight: 700; color: #57A050; }

.play-btn {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 56px;
  margin-top: 12px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(#ffb36e, #ff8a3d 42%, #47F020);
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 1px;
  box-shadow: 0 5px 0 #3BD810, 0 12px 20px rgba(220, 90, 20, .28);
}
.play-btn .mp-icon { width: 22px; height: 22px; }
.play-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #3BD810; }
.ghost-btn {
  width: 100%;
  height: 44px;
  margin-top: 4px;
  border: 0;
  background: transparent;
  color: #57A050;
  font-size: 15px;
  font-weight: 800;
}
.ghost-btn:active { opacity: .6; }
.line-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 48px;
  margin-top: 8px;
  border-radius: 16px;
  border: 2px solid #ffd0a8;
  background: #fff;
  color: #3DE01A;
  font-size: 16px;
  font-weight: 900;
}
.line-btn .mp-icon { width: 20px; height: 20px; }
.line-btn:active { transform: translateY(2px); }
.ad-screen {
  height: 132px;
  margin: 14px 0 4px;
  border-radius: 16px;
  background: linear-gradient(165deg, #2E6A24, #162C10 70%);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-shadow: inset 0 0 0 2px rgba(255, 186, 120, .35);
}
.ad-screen b {
  font-size: 48px;
  line-height: 1;
  font-weight: 900;
  color: #ffe08a;
  text-shadow: 0 3px 0 #32C412;
}
.ad-screen span { font-size: 13px; font-weight: 800; color: #ffd7b0; }
#maskAd { z-index: 60; }
.play-btn:focus-visible, .prop:focus-visible, .who:focus-visible, .ghost-btn:focus-visible, .line-btn:focus-visible {
  outline: 3px solid #ffd7b0;
  outline-offset: 2px;
}

.game { display: flex; flex-direction: column; }
.hud {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 8px;
  padding: calc(8px + env(safe-area-inset-top)) 16px 6px;
}
.pill {
  min-width: 0;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 252, 247, .94);
  color: #2C6B1F;
  font-size: 15px;
  box-shadow: 0 4px 0 rgba(180, 110, 40, .16), 0 8px 16px rgba(120, 70, 10, .08);
}
.pill .mp-icon { width: 18px; height: 18px; flex: none; }
.pill b { font-size: 15px; white-space: nowrap; }
.pill.timer { flex: 1.05; }
.pill.level { flex: 1.15; justify-content: center; }
.pill.score { flex: .9; justify-content: flex-end; }
.pill.timer.warn { color: #A9E548; animation: pulse 1s ease infinite; }
.pill.score.pop b { animation: scorepop .35s ease; }
@keyframes pulse { 50% { transform: scale(1.04); } }
@keyframes scorepop { 40% { transform: scale(1.28); } }

.stage { position: relative; z-index: 1; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.playfield { flex: 1; min-height: 0; }
.dock { flex: none; padding: 0 16px calc(10px + env(safe-area-inset-bottom)); }
.prop-row { display: flex; gap: 8px; margin-bottom: 8px; }
.prop {
  flex: 1;
  min-width: 0;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 4px;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 252, 247, .95);
  color: #2C6B1F;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 4px 0 rgba(180, 110, 40, .16);
}
.prop span { white-space: nowrap; }
.prop .mp-icon { width: 18px; height: 18px; flex: none; }
.prop em {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: #ff8a3d;
  color: #fff;
  font-style: normal;
  font-size: 13px;
  line-height: 22px;
  text-align: center;
}
.prop:active { transform: translateY(2px); }
.prop.spent { color: #99B794; box-shadow: 0 3px 0 rgba(180, 150, 120, .18); }
.prop.spent em { background: #B8D9B6; }

.tray {
  display: flex;
  gap: 4px;
  padding: 7px;
  border-radius: 18px;
  background: linear-gradient(#7AF37B, #4DE040);
  box-shadow: 0 7px 0 #3DC428, 0 14px 22px rgba(140, 70, 10, .22);
}
.tray.wide { gap: 3px; padding: 6px; }
.tray.wide .well { height: 52px; }
.tray.danger { background: linear-gradient(#74F060, #68E038); box-shadow: 0 7px 0 #5CC422, 0 14px 22px rgba(180, 40, 10, .25); }
.tray.full { animation: trayshake .4s linear; }
.well {
  flex: 1;
  height: 56px;
  border-radius: 10px;
  background: rgba(255, 248, 235, .5);
  box-shadow: inset 0 2px 4px rgba(120, 60, 10, .16);
}
.well.next { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .9), inset 0 2px 4px rgba(120, 60, 10, .12); }
@keyframes trayshake {
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

.tile {
  position: absolute;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(#fffefb, #fff1dc);
  box-shadow: 0 4px 0 #62E25A, 0 8px 12px rgba(120, 60, 10, .16);
  z-index: 1;
  touch-action: none;
}
.stage.anim .tile {
  transition: left .22s cubic-bezier(.2, .75, .2, 1), top .22s cubic-bezier(.2, .75, .2, 1), width .22s, height .22s;
}
.tile .face {
  position: absolute;
  left: 9%; top: 8%; right: 9%; bottom: 12%;
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 0 0 0 2px rgba(255, 170, 90, .35);
  display: flex;
  align-items: center;
  justify-content: center;
}
.tile .stripe {
  position: absolute;
  top: 6px;
  width: 42%;
  height: 4px;
  border-radius: 4px;
}
.tile .mp-icon { width: 52%; height: 52%; }
.tile.is-hot { cursor: pointer; }
.tile.is-hot:active { transform: translateY(2px) scale(.96); }
.tile.is-blocked {
  box-shadow: 0 2px 0 #A6D8A7, 0 4px 8px rgba(80, 50, 10, .08);
  filter: saturate(.6) brightness(.9);
}
.tile.is-blocked .face { box-shadow: inset 0 0 0 2px rgba(160, 140, 110, .28); }
.tile.is-blocked::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(90, 60, 30, .22);
}
.tile.nope { animation: nope .28s linear; }
.tile.clearing { animation: burst .26s ease forwards; pointer-events: none; }
.tile.spin .mp-icon { animation: twist .42s ease; }
@keyframes nope {
  20% { transform: translateX(-3px); }
  40% { transform: translateX(3px); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}
@keyframes burst {
  40% { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(.2); opacity: 0; }
}
@keyframes twist {
  50% { transform: rotate(180deg) scale(.75); }
  100% { transform: rotate(360deg) scale(1); }
}

.banner {
  position: absolute;
  left: 50%;
  top: 38%;
  z-index: 2600;
  font-size: 40px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 4px 0 #47F01A, 0 8px 16px rgba(120, 50, 0, .18);
  pointer-events: none;
  white-space: nowrap;
}
.banner.show { animation: banner .9s ease forwards; }
@keyframes banner {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(.8); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  72% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -70%) scale(1.04); }
}
.floater {
  position: absolute;
  z-index: 2400;
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 0 #47F01A;
  pointer-events: none;
  animation: floatup .7s ease forwards;
}
@keyframes floatup {
  0% { opacity: 0; transform: translate(-50%, 6px) scale(.8); }
  25% { opacity: 1; transform: translate(-50%, -4px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -30px) scale(1); }
}
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(132px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 80;
  max-width: calc(100% - 48px);
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(80, 46, 22, .9);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  pointer-events: none;
}

.mask {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(70, 40, 10, .46);
}
.dialog {
  width: min(100%, 340px);
  max-height: calc(100% - 24px);
  overflow: auto;
  background: #fffaf3;
  border-radius: 24px;
  padding: 22px 18px 14px;
  text-align: center;
  box-shadow: 0 16px 40px rgba(80, 40, 10, .28);
}
.dialog h2 { margin: 8px 0 4px; font-size: 26px; line-height: 1.2; color: #2C6B1F; }
.dialog .lead { margin: 0; color: #57A050; font-size: 14px; font-weight: 700; }
.dialog .bonus { margin: 10px 0 0; font-size: 18px; font-weight: 900; color: #3AE814; }
.dialog .meta { margin: 4px 0 0; color: #57A050; font-size: 13px; font-weight: 700; }
.dialog .big {
  margin: 6px 0 2px;
  font-size: 56px;
  font-weight: 900;
  line-height: 1;
  color: #ff8a3d;
  text-shadow: 0 3px 0 rgba(240, 106, 26, .16);
}
.dialog .record { margin: 8px 0 12px; font-size: 15px; font-weight: 900; color: #98E24A; }
.dialog .who-line { margin: 8px 0 0; font-size: 13px; font-weight: 800; color: #57A050; }
.dialog .play-btn { margin-top: 14px; }
.badge-ico {
  width: 64px; height: 64px;
  margin: 0 auto;
  border-radius: 50%;
  background: #fff1e4;
  color: #ff8a3d;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 3px #ffd7b5;
}
.badge-ico .mp-icon { width: 34px; height: 34px; }
.dialog input {
  width: 100%;
  height: 52px;
  margin: 12px 0 4px;
  border: 2px solid #BFF0BC;
  border-radius: 14px;
  background: #fff;
  color: #2C6B1F;
  font-size: 18px;
  font-weight: 800;
  text-align: center;
}
.dialog input:focus { outline: none; border-color: #ff8a3d; }

@media (max-height: 680px) {
  .hero { height: 132px; }
  .sheep { transform: scale(.74); transform-origin: center bottom; }
  .logo { font-size: 36px; }
  .slogan { margin-top: 2px; }
  .chips { margin-top: 8px; }
  .who { margin-top: 8px; }
  .banner { font-size: 32px; }
  .well { height: 50px; }
}
@media (min-width: 520px) {
  #app { box-shadow: 0 0 0 1px rgba(255, 255, 255, .4), 0 18px 50px rgba(40, 80, 20, .12); }
}
@media (prefers-reduced-motion: reduce) {
  .stage.anim .tile, .banner.show, .floater, .tile.clearing, .tile.nope, .pill.timer.warn { animation: none; transition: none; }
}
