/* 找不同 6 — 竖屏休闲找茬游戏 */
* { box-sizing: border-box; }
:root {
  --orange: #FF8A3D;
  --orange-deep: #EC6A18;
  --orange-soft: #FFE7D2;
  --cream: #FFF8EF;
  --card: #FFFDF9;
  --ink: #32200F;
  --ink-2: #6E523C;
  --muted: #A1816A;
  --line: #F3DAC5;
  --green: #2FA36B;
  --red: #E8493F;
  --shadow: 0 10px 24px rgba(168, 82, 27, .14);
}
html { -webkit-text-size-adjust: 100%; }
html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: #FFEAD6;
  color: var(--ink);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
body {
  min-height: 100dvh;
  background:
    radial-gradient(110% 46% at 50% 0%, #FFD9B9 0%, rgba(255, 217, 185, 0) 64%),
    linear-gradient(180deg, #FFF3E5 0%, #FFE8D2 44%, #FFF7EC 100%);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(214, 126, 61, .12) 1.2px, transparent 1.2px);
  background-size: 22px 22px;
  opacity: .55;
  z-index: 0;
}
button { font-family: inherit; cursor: pointer; touch-action: manipulation; }
b, strong { font-weight: 800; }

.game {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 16px calc(env(safe-area-inset-bottom, 0px) + 12px);
}

/* 顶部关卡进度 */
.seg-row { display: flex; gap: 5px; padding: 2px 2px 0; margin-bottom: 10px; }
.seg {
  flex: 1;
  height: 4px;
  border-radius: 99px;
  background: #F2D5BD;
  transition: background .3s ease, box-shadow .3s ease;
}
.seg.done { background: #FFB478; }
.seg.active {
  background: linear-gradient(90deg, #FFA258, var(--orange));
  box-shadow: 0 0 0 2px rgba(255, 138, 61, .18);
}

/* 顶部 HUD */
.hud { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.round-card {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  padding: 7px 13px 8px;
  background: rgba(255, 253, 249, .92);
  border: 1px solid #FFE0C8;
  border-radius: 15px;
  box-shadow: 0 4px 12px rgba(196, 106, 48, .09);
}
.round-kicker { font-size: 10px; font-weight: 700; letter-spacing: .06em; color: #CB7C45; line-height: 1.2; }
.round-name {
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: .01em;
  line-height: 1.2;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hud-right { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.timer {
  position: relative;
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 50%;
  background: conic-gradient(var(--orange) calc(var(--p, 1) * 360deg), #F7DFCC 0);
  display: grid;
  place-items: center;
  filter: drop-shadow(0 4px 8px rgba(224, 112, 35, .2));
  transition: background .2s linear;
}
.timer::before {
  content: "";
  position: absolute;
  inset: 4px;
  background: #FFFDF9;
  border-radius: 50%;
  box-shadow: inset 0 1px 3px rgba(176, 108, 58, .12);
}
.timer span {
  position: relative;
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: #4A2C16;
  transform: translateY(-3px);
}
.timer small {
  position: absolute;
  bottom: 8px;
  font-size: 8px;
  font-weight: 700;
  color: #B4896F;
  transform: scale(.92);
}
.timer.urgent { background: conic-gradient(var(--red) calc(var(--p, 1) * 360deg), #FFDAD6 0); animation: urgentPulse 1s ease-in-out infinite; }
.timer.urgent span { color: var(--red); }
.timer.urgent small { color: #D9776F; }
.score-card {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 44px;
  padding: 0 12px 0 10px;
  background: #FFFDF9;
  border: 1px solid #FFE3CD;
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(196, 106, 48, .09);
  font-size: 16px;
  font-weight: 900;
  color: #4A2C16;
  font-variant-numeric: tabular-nums;
}
.score-card .mp-icon { width: 18px; height: 18px; color: #FFB02E; filter: drop-shadow(0 1px 1px rgba(190, 110, 20, .25)); }
.score-card.bump { animation: scoreBump .35s ease; }

/* 目标行 */
.goal-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 2px 9px; }
.goal-left { display: flex; align-items: center; gap: 7px; min-width: 0; }
.diff-badge {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--orange-soft);
  color: #CF6417;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
}
.diff-badge.mid { background: #E7F0FF; color: #4A70C8; }
.diff-badge.hard { background: #F3E4FF; color: #8A4FC9; }
.goal-text { font-size: 12px; font-weight: 600; color: #8C6A52; white-space: nowrap; }
.goal-text b { color: #5A3A22; font-weight: 900; }
.found-pips { display: flex; align-items: center; gap: 4px; }
.pip { width: 15px; height: 4px; border-radius: 99px; background: #EDD4C0; transition: .25s; }
.pip.on { background: var(--green); box-shadow: 0 0 0 2px rgba(47, 163, 107, .12); }

/* 两张场景图 */
.scenes { display: flex; flex-direction: column; gap: 10px; }
.scene-card {
  position: relative;
  width: 100%;
  aspect-ratio: 5 / 4;
  border-radius: 18px;
  overflow: hidden;
  background: #CDEBEF;
  border: 2px solid rgba(255, 255, 255, .96);
  box-shadow: 0 10px 22px rgba(160, 81, 32, .16), 0 2px 0 rgba(255, 255, 255, .7) inset;
  transform: translateZ(0);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  cursor: pointer;
}
.scene-card .art, .scene-card .art svg { display: block; width: 100%; height: 100%; }
.scene-card .layer { position: absolute; inset: 0; pointer-events: none; }
.scene-card.press { transform: scale(.995); }
.scenes.enter .scene-card { animation: sceneIn .42s cubic-bezier(.2, .9, .3, 1) both; }
.scenes.enter .scene-card:nth-child(2) { animation-delay: .07s; }

.scene-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 23px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .02em;
  box-shadow: 0 3px 8px rgba(35, 20, 8, .18);
  backdrop-filter: blur(4px);
  pointer-events: none;
}
.tag-a { padding: 0 8px; background: rgba(255, 253, 248, .92); color: #6B4A30; }
.tag-b { padding: 0 9px 0 4px; background: linear-gradient(180deg, #FFA45C, #FF7A26); color: #fff; }
.tag-b b {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .24);
  font-size: 10.5px;
  font-weight: 900;
}
.tag-b em { font-style: normal; font-size: 9.5px; opacity: .95; }

/* 命中的圈选标记 */
.marker {
  position: absolute;
  width: 40px;
  height: 40px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 3px solid #FF7A26;
  background: rgba(255, 255, 255, .18);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .78), 0 5px 14px rgba(255, 96, 16, .35);
  display: grid;
  place-items: center;
  animation: markerPop .36s cubic-bezier(.2, 1.6, .4, 1);
}
.marker::before {
  content: "";
  width: 13px;
  height: 7px;
  border-left: 3px solid #fff;
  border-bottom: 3px solid #fff;
  border-radius: 1px;
  transform: rotate(-45deg) translate(-1px, -1px);
  filter: drop-shadow(0 1px 1px rgba(150, 60, 0, .35));
}
.marker::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .5);
  animation: markerRing .5s ease-out forwards;
}

/* 提示圈 */
.hint-ring {
  position: absolute;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 3px dashed #FF7A26;
  background: rgba(255, 138, 61, .15);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .55);
  animation: hintPulse 1s ease-in-out infinite;
}

/* 错误反馈 */
.wrong-ripple {
  position: absolute;
  width: 38px;
  height: 38px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2.5px solid var(--red);
  animation: wrongOut .48s ease-out forwards;
}
.wrong-ripple::before, .wrong-ripple::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 13px;
  height: 2.5px;
  border-radius: 2px;
  background: var(--red);
}
.wrong-ripple::before { transform: translate(-50%, -50%) rotate(45deg); }
.wrong-ripple::after { transform: translate(-50%, -50%) rotate(-45deg); }

.float {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(40, 20, 5, .3);
  animation: floatUp .85s cubic-bezier(.2, .7, .3, 1) forwards;
  z-index: 5;
}
.confetti {
  position: absolute;
  width: 5px;
  height: 8px;
  border-radius: 2px;
  animation: confettiOut .65s ease-out forwards;
  z-index: 4;
}

/* 底部操作区 */
.dock { margin-top: auto; padding-top: 13px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dock-tip { display: flex; align-items: center; gap: 6px; color: #A17C63; font-size: 11.5px; font-weight: 600; padding-left: 3px; }
.dock-tip .mp-icon { width: 17px; height: 17px; color: #C58B63; }
.hint-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 50px;
  padding: 0 16px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, #FFA55F 0%, #FF7B27 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .02em;
  box-shadow: 0 8px 18px rgba(238, 101, 24, .34), inset 0 1px 0 rgba(255, 255, 255, .4);
  transition: transform .12s ease, box-shadow .12s ease, filter .2s ease;
}
.hint-btn .mp-icon { width: 20px; height: 20px; color: #fff; }
.hint-btn:active { transform: translateY(1px) scale(.97); box-shadow: 0 4px 10px rgba(238, 101, 24, .3); }
.hint-btn .hint-count {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .24);
  font-size: 12px;
  font-weight: 900;
}
.hint-btn.empty {
  background: linear-gradient(180deg, #EFDACA, #E5C9B5);
  color: #9E7A60;
  box-shadow: 0 4px 10px rgba(140, 95, 60, .14);
}
.hint-btn.empty .hint-count { background: rgba(255, 255, 255, .4); }
.hint-btn.shake { animation: shake .3s ease; }

/* 轻提示 */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 88px);
  z-index: 40;
  transform: translate(-50%, 12px);
  max-width: calc(100vw - 48px);
  padding: 10px 17px;
  border-radius: 999px;
  background: rgba(46, 27, 13, .88);
  color: #FFF6EA;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 8px 22px rgba(53, 27, 8, .28);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 结算 / 通关弹层 */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(48, 26, 10, .48);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .24s ease;
}
.overlay[hidden] { display: none; }
.overlay.show { opacity: 1; }
.ov-card {
  position: relative;
  width: 100%;
  max-width: 336px;
  padding: 26px 22px 20px;
  border-radius: 28px;
  background:
    radial-gradient(90% 46% at 50% -6%, #FFE3C6 0%, rgba(255, 227, 198, 0) 70%),
    linear-gradient(180deg, #FFFDF8 0%, #FFF5E9 100%);
  border: 2px solid rgba(255, 255, 255, .95);
  box-shadow: 0 28px 64px rgba(58, 28, 8, .36), inset 0 1px 0 #fff;
  text-align: center;
  transform: translateY(16px) scale(.95);
  transition: transform .3s cubic-bezier(.2, 1.2, .3, 1);
}
.overlay.show .ov-card { transform: translateY(0) scale(1); }
.ov-card::before, .ov-card::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #FFC98F;
  box-shadow: 60px 34px 0 -2px #FFD9B0, -70px 70px 0 -3px #FFD9B0, 95px 150px 0 -2px #FFE3C4, -80px 178px 0 -3px #FFE3C4;
  top: 20px;
  left: 24px;
  opacity: .8;
  pointer-events: none;
}
.ov-emblem {
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  position: relative;
}
.ov-emblem::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 138, 61, .35);
  animation: spinSlow 12s linear infinite;
}
.ov-emblem .mp-icon { width: 38px; height: 38px; }
.ov-emblem.ok { background: linear-gradient(160deg, #63D69C, #26A268); box-shadow: 0 10px 22px rgba(38, 162, 104, .32); }
.ov-emblem.fail { background: linear-gradient(160deg, #FF9B8F, #E8493F); box-shadow: 0 10px 22px rgba(232, 73, 63, .3); }
.ov-kicker { margin: 0 0 4px; font-size: 11px; font-weight: 800; letter-spacing: .14em; color: #C17E4C; }
.ov-title { margin: 0; font-size: 25px; font-weight: 900; letter-spacing: .01em; color: #38210F; line-height: 1.2; }
.ov-sub { margin: 7px 0 0; font-size: 12.5px; font-weight: 600; line-height: 1.6; color: #967658; }
.ov-stats {
  display: flex;
  margin: 18px 0 16px;
  padding: 12px 4px;
  border-radius: 16px;
  background: rgba(255, 237, 219, .7);
  border: 1px solid #FFE3C9;
}
.ov-stat { flex: 1; display: flex; flex-direction: column; gap: 3px; position: relative; }
.ov-stat + .ov-stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 20px;
  background: #F2D6BC;
}
.ov-stat b { font-size: 18px; font-weight: 900; color: #E06D1D; font-variant-numeric: tabular-nums; line-height: 1.1; }
.ov-stat span { font-size: 10px; font-weight: 600; color: #A18267; }
.ov-btn {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, #FFA45C 0%, #FF7A26 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .03em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 9px 20px rgba(238, 101, 24, .34), inset 0 1px 0 rgba(255, 255, 255, .4);
  transition: transform .12s ease;
}
.ov-btn .mp-icon { width: 19px; height: 19px; }
.ov-btn:active { transform: scale(.975); }
.ov-ghost {
  width: 100%;
  height: 42px;
  margin-top: 3px;
  border: 0;
  background: transparent;
  color: #A07C60;
  font-size: 12.5px;
  font-weight: 700;
}
.ov-ghost:active { opacity: .6; }

/* 通关奖章 */
.medal-wrap { position: relative; width: 116px; height: 116px; margin: 0 auto 10px; display: grid; place-items: center; }
.medal-wrap::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(255, 190, 80, .1), rgba(255, 190, 80, .55), rgba(255, 190, 80, .1), rgba(255, 190, 80, .55), rgba(255, 190, 80, .1));
  animation: spinSlow 9s linear infinite;
  filter: blur(1px);
}
.medal {
  position: relative;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #FFE9AE 0%, #FFC54E 52%, #F5A21C 100%);
  border: 3px solid #FFF4D6;
  box-shadow: 0 14px 30px rgba(219, 139, 19, .38), inset 0 3px 6px rgba(255, 255, 255, .7), inset 0 -4px 8px rgba(190, 110, 10, .25);
}
.medal::before {
  content: "";
  position: absolute;
  inset: 11px;
  border-radius: 50%;
  border: 1.5px dashed rgba(173, 99, 8, .38);
}
.medal .mp-icon { width: 46px; height: 46px; color: #B45E05; filter: drop-shadow(0 2px 2px rgba(255, 255, 255, .5)); }
.medal-title {
  display: inline-block;
  margin: 2px 0 0;
  padding: 4px 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #FFF0C4, #FFD97D);
  color: #9C5308;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .16em;
  box-shadow: 0 3px 8px rgba(196, 128, 16, .18);
}
.ov-card.victory { padding-top: 22px; }
.ov-card.victory .ov-title { font-size: 27px; }

@keyframes sceneIn {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes markerPop {
  0% { transform: translate(-50%, -50%) scale(.3); opacity: 0; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
@keyframes markerRing {
  from { transform: scale(.8); opacity: .9; }
  to { transform: scale(1.5); opacity: 0; }
}
@keyframes hintPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(.92); opacity: .55; }
  50% { transform: translate(-50%, -50%) scale(1.06); opacity: 1; }
}
@keyframes wrongOut {
  from { transform: translate(-50%, -50%) scale(.7); opacity: 1; }
  to { transform: translate(-50%, -50%) scale(1.55); opacity: 0; }
}
@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, -40%) scale(.8); }
  25% { opacity: 1; transform: translate(-50%, -70%) scale(1.06); }
  100% { opacity: 0; transform: translate(-50%, -170%) scale(.96); }
}
@keyframes confettiOut {
  0% { opacity: 1; transform: translate(-50%, -50%) rotate(0deg) scale(1); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(var(--rot)) scale(.6); }
}
@keyframes scoreBump {
  0%, 100% { transform: scale(1); }
  35% { transform: scale(1.08); }
  65% { transform: scale(.97); }
}
@keyframes urgentPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
@keyframes spinSlow { to { transform: rotate(360deg); } }

@media (max-height: 800px) {
  .scene-card { aspect-ratio: 8 / 5; }
}
@media (max-width: 350px) {
  .game { padding-left: 12px; padding-right: 12px; }
  .dock-tip { display: none; }
  .hint-btn { width: 100%; justify-content: center; }
  .round-name { font-size: 14px; }
}
@media (min-height: 860px) {
  .hud { margin-bottom: 14px; }
  .scenes { gap: 12px; }
  .dock { padding-top: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
