:root {
  --theme: #FF8A3D;
  --theme-deep: #F26A1B;
  --cream: #FFF2DE;
  --ink: #2B160C;
  --appw: min(100vw, 520px);
  --arena-h: 66vh;
  --arena-h: max(calc(var(--appw) * 1.2890625), 66dvh);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #140b06;
  color: var(--cream);
  overscroll-behavior: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

body::before {
  content: "";
  position: fixed;
  inset: -30px;
  background: url("images/gen/scene.jpg") center / cover no-repeat;
  filter: blur(30px) brightness(.34) saturate(1.15);
  z-index: -1;
}

button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
b { font-weight: 900; }

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

.app {
  position: relative;
  width: min(100vw, 520px, calc((100dvh - 160px) / 1.2890625));
  width: min(100vw, 520px, calc((100dvh - 160px) / 1.2890625));
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #1a0e06;
  box-shadow: 0 0 60px rgba(0, 0, 0, .65);
}

.ambient {
  position: absolute;
  inset: 0;
  background: url("images/gen/scene.jpg") center / cover no-repeat;
  filter: blur(18px) brightness(.48) saturate(1.08);
  transform: scale(1.08);
  opacity: .9;
  pointer-events: none;
}

/* ---------- arena ---------- */
.arena {
  position: relative;
  z-index: 2;
  width: 100%;
  height: var(--arena-h);
  flex: 0 0 auto;
  overflow: hidden;
  background: #1b0f08;
  touch-action: none;
}

.scene {
  position: absolute;
  inset: 0;
  background: url("images/gen/scene.jpg") center top / cover no-repeat;
  transform: scale(1.004);
  transform-origin: center top;
}

.scene-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(18, 9, 4, .72) 0%, rgba(18, 9, 4, .28) 7%, rgba(18, 9, 4, 0) 19%),
    linear-gradient(0deg, rgba(18, 9, 4, .5) 0%, rgba(18, 9, 4, 0) 12%);
}

/* ---------- top hud ---------- */
.hud {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 8px);
  left: 10px;
  right: 10px;
  height: 52px;
  z-index: 20;
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.hud-pill {
  display: flex;
  align-items: center;
  border-radius: 18px;
  background: rgba(41, 22, 11, .93);
  border: 1px solid rgba(255, 213, 164, .24);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .08);
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
}

.score-pill {
  flex: 1 1 auto;
  min-width: 0;
  gap: 7px;
  padding: 0 11px;
  overflow: hidden;
}

.fish-mini { width: 27px; height: 17px; flex: 0 0 auto; display: block; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .35)); }

.score-num {
  font-size: clamp(19px, 5.2vw, 24px);
  font-weight: 900;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  color: #FFF7E9;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .22);
  line-height: 1;
  white-space: nowrap;
}

.score-pill.bump { animation: scoreBump .24s cubic-bezier(.2, .9, .3, 1.2); }
.score-pill.gold { border-color: rgba(255, 205, 105, .75); box-shadow: 0 0 18px rgba(255, 190, 70, .45), inset 0 1px 0 rgba(255, 255, 255, .12); }

.timer-pill {
  flex: 0 0 88px;
  justify-content: center;
  gap: 5px;
  padding: 0 6px;
  color: #FFEFD8;
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
}

.timer-pill .mp-icon { width: 15px; height: 15px; color: #FFC98A; flex: 0 0 auto; }
.timer-pill.low { color: #FFD36B; border-color: rgba(255, 180, 80, .55); }
.timer-pill.low .mp-icon { color: #FFD36B; animation: clockShake .7s infinite; }
.timer-pill.critical { color: #FF7A62; border-color: rgba(255, 90, 60, .7); background: rgba(63, 22, 12, .95); }
.timer-pill.critical .mp-icon { color: #FF7A62; }

.lives-pill {
  flex: 0 0 82px;
  justify-content: center;
  gap: 3px;
  padding: 0 6px;
}

.heart {
  width: 15px;
  height: 15px;
  color: #FF6B57;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .25));
  transition: color .2s, opacity .2s, transform .2s;
}

.heart.lost { color: rgba(255, 226, 205, .24); opacity: .7; filter: none; }
.heart.just-lost { animation: heartBreak .45s ease-out; }

/* ---------- alert band ---------- */
.alert-band {
  --state-color: #8BD17C;
  position: absolute;
  top: 45.3%;
  left: 8px;
  right: 8px;
  height: 48px;
  z-index: 18;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 9px;
  border-radius: 15px;
  background: linear-gradient(180deg, rgba(55, 32, 17, .96), rgba(35, 19, 9, .97));
  border: 1px solid rgba(255, 199, 136, .24);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 228, 190, .12);
  transition: border-color .2s, box-shadow .2s;
}

.alert-band.danger {
  border-color: rgba(255, 90, 60, .7);
  box-shadow: 0 0 22px rgba(255, 70, 40, .35), inset 0 1px 0 rgba(255, 228, 190, .12);
}

.cat-face {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #FFF7EA, #F5D7B4);
  border: 1px solid rgba(255, 255, 255, .7);
  box-shadow: 0 2px 5px rgba(0, 0, 0, .25);
}

.cat-face .mp-icon { width: 19px; height: 19px; color: #5A3820; }

.alert-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }

.alert-track {
  position: relative;
  height: 12px;
  border-radius: 7px;
  background: #190d06;
  border: 1px solid rgba(255, 210, 160, .18);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .55);
  overflow: hidden;
}

.alert-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0%;
  z-index: 2;
  border-radius: 6px;
  background: linear-gradient(90deg, #5FBF6A, #8BD17C);
  box-shadow: 0 0 9px rgba(139, 209, 124, .55);
  transition: width .06s linear, background .25s;
}

.st-turn .alert-fill { background: linear-gradient(90deg, #E7B93C, #FFD166); box-shadow: 0 0 9px rgba(255, 209, 102, .5); }
.st-ears .alert-fill { background: linear-gradient(90deg, #F09A32, #FFB347); box-shadow: 0 0 10px rgba(255, 179, 71, .55); }
.st-half .alert-fill { background: linear-gradient(90deg, #F2762A, #FF8A3D); box-shadow: 0 0 11px rgba(255, 138, 61, .6); }
.st-open .alert-fill { background: linear-gradient(90deg, #E8452F, #FF5B43); box-shadow: 0 0 13px rgba(255, 77, 61, .7); }

.alert-extreme {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 6%;
  z-index: 3;
  background: rgba(255, 210, 110, .26);
  border-left: 1.5px dashed rgba(255, 230, 160, .92);
  box-shadow: 0 0 8px rgba(255, 210, 110, .6);
  pointer-events: none;
}

.alert-gloss {
  position: absolute;
  inset: 0;
  z-index: 4;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 55%);
  pointer-events: none;
}

.alert-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 11px;
  line-height: 11px;
  white-space: nowrap;
  overflow: hidden;
}

.state-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--state-color);
  box-shadow: 0 0 7px var(--state-color);
}

.state-label { font-size: 10px; font-weight: 800; color: var(--state-color); transition: color .2s; }
.alert-pct { font-size: 9px; color: rgba(255, 231, 204, .48); margin-left: auto; letter-spacing: .02em; }

.warn-icon {
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 191, 100, .55);
  transition: color .2s, transform .2s, opacity .2s;
}

.warn-icon .mp-icon { width: 23px; height: 23px; }
.warn-icon.on { color: #FFB347; opacity: 1; animation: warnPing 1s ease-in-out infinite; }
.warn-icon.hot { color: #FF4D3D; animation: warnPing .42s ease-in-out infinite; }

/* ---------- combo ---------- */
.combo {
  position: absolute;
  left: 12px;
  top: 56.5%;
  z-index: 16;
  opacity: 0;
  transform: translateY(8px) rotate(-4deg) scale(.92);
  transform-origin: left center;
  transition: opacity .18s, transform .22s;
  pointer-events: none;
}

.combo.show { opacity: 1; transform: translateY(0) rotate(-4deg) scale(1); }
.combo.pop { animation: comboPop .34s cubic-bezier(.2, .9, .3, 1.2); }

.combo-main {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: clamp(21px, 6.8vw, 29px);
  font-weight: 900;
  font-style: italic;
  line-height: 1;
  letter-spacing: -.03em;
  color: #FFE39A;
  text-shadow: 0 2px 0 #8A3B00, 0 3px 0 #5E2500, 0 0 18px rgba(255, 138, 61, .85);
}

.combo-main .mp-icon {
  width: 27px;
  height: 27px;
  color: #FF9A3D;
  filter: drop-shadow(0 2px 0 #8A3B00);
}

.combo-sub {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 7px;
  border-radius: 7px;
  background: rgba(57, 29, 10, .82);
  border: 1px solid rgba(255, 205, 120, .4);
  color: #FFD98A;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .04em;
}

/* ---------- cat alert ---------- */
.cat-alert {
  position: absolute;
  left: 37%;
  top: 13%;
  z-index: 19;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #FFB347, #F26A1B);
  border: 2px solid #FFF2DE;
  color: #FFF8EE;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(160, 55, 10, .4);
  opacity: 0;
  transform: scale(.4) rotate(-12deg);
  transition: opacity .15s, transform .2s;
  pointer-events: none;
}

.cat-alert.show { opacity: 1; transform: scale(1) rotate(-8deg); animation: catAlertShake .7s ease-in-out infinite; }
.cat-alert.hot { background: linear-gradient(180deg, #FF5B43, #CC2418); animation-duration: .38s; }
.cat-alert::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid rgba(255, 160, 70, .55);
  animation: catAlertPing 1.1s ease-out infinite;
}

/* ---------- pad ---------- */
.pad-label {
  position: absolute;
  left: 50%;
  top: 61%;
  transform: translate(-50%, -100%);
  z-index: 15;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(37, 19, 9, .82);
  border: 1px solid rgba(255, 210, 160, .32);
  color: #FFE4BE;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .06em;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .3);
  transition: opacity .2s, transform .2s;
  pointer-events: none;
}

.pad-label.hidden { opacity: 0; transform: translate(-50%, -100%) scale(.9); }

.press-pad {
  position: absolute;
  left: 50%;
  top: 77%;
  width: clamp(112px, 38vw, 160px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  z-index: 14;
  pointer-events: none;
  transition: transform .12s ease-out;
}

.press-pad.holding { transform: translate(-50%, -50%) scale(.955); }

.pad-ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; transform: rotate(-90deg); }
.pad-track { fill: none; stroke: rgba(255, 232, 200, .18); stroke-width: 3; }
.pad-progress {
  fill: none;
  stroke: #FFE0A0;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 326.73;
  stroke-dashoffset: 326.73;
  filter: drop-shadow(0 0 5px rgba(255, 200, 100, .9));
  transition: stroke-dashoffset .05s linear;
}

.pad-inner {
  position: absolute;
  inset: 17%;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  color: #FFF3DC;
  background: radial-gradient(circle at 50% 38%, rgba(255, 222, 170, .26), rgba(70, 132, 160, .12) 58%, rgba(20, 50, 65, .18) 100%);
  border: 1px solid rgba(255, 232, 200, .4);
  box-shadow: inset 0 0 22px rgba(255, 214, 150, .18), 0 6px 18px rgba(0, 0, 0, .24);
  -webkit-backdrop-filter: blur(2.5px);
  backdrop-filter: blur(2.5px);
  text-shadow: 0 2px 3px rgba(0, 0, 0, .5);
  transition: background .15s, border-color .15s;
}

.pad-inner .mp-icon { width: 24px; height: 24px; color: #FFE2B4; }
.pad-inner span { font-size: 10px; font-weight: 800; letter-spacing: .08em; }

.press-pad.idle .pad-inner { animation: padBreathe 2.1s ease-in-out infinite; }
.press-pad.idle::after {
  content: "";
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  border: 1px solid rgba(255, 214, 150, .5);
  animation: padPing 2.1s ease-out infinite;
}
.press-pad.holding .pad-inner { background: radial-gradient(circle at 50% 38%, rgba(255, 238, 190, .42), rgba(120, 170, 190, .2) 60%, rgba(30, 70, 90, .22) 100%); border-color: rgba(255, 236, 190, .7); }

/* ---------- banners ---------- */
.danger-banner {
  position: absolute;
  left: 50%;
  top: 54.5%;
  z-index: 22;
  transform: translate(-50%, -50%) scale(.9);
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(70, 16, 8, .9);
  border: 1px solid rgba(255, 90, 60, .7);
  color: #FFB4A0;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .03em;
  white-space: nowrap;
  box-shadow: 0 0 20px rgba(255, 60, 30, .25);
  opacity: 0;
  transition: opacity .12s, transform .12s;
  pointer-events: none;
}

.danger-banner.show { opacity: 1; transform: translate(-50%, -50%) scale(1); animation: dangerPulse .7s ease-in-out infinite; }

.extreme-banner {
  position: absolute;
  left: 50%;
  top: 55%;
  z-index: 23;
  display: flex;
  align-items: center;
  gap: 5px;
  transform: translate(-50%, -50%) scale(.82);
  padding: 7px 13px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(92, 49, 8, .95), rgba(62, 29, 4, .96));
  border: 1px solid rgba(255, 210, 110, .85);
  color: #FFE6A6;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .03em;
  white-space: nowrap;
  box-shadow: 0 0 26px rgba(255, 190, 70, .45);
  opacity: 0;
  pointer-events: none;
}

.extreme-banner .mp-icon { width: 18px; height: 18px; color: #FFC24B; }
.extreme-banner b { color: #FFF7DE; font-size: 13px; }
.extreme-banner.show { animation: extremePop 1.15s cubic-bezier(.2, .9, .3, 1) forwards; }

/* ---------- fx ---------- */
.fx { position: absolute; inset: 0; z-index: 30; pointer-events: none; overflow: hidden; }

.fly-fish {
  position: absolute;
  left: 0;
  top: 0;
  width: 40px;
  height: 25px;
  margin: -12px 0 0 -20px;
  filter: drop-shadow(0 4px 5px rgba(0, 0, 0, .35));
  will-change: transform, opacity;
}
.fly-fish svg { width: 100%; height: 100%; display: block; }

.pop {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  font-size: clamp(18px, 5.4vw, 26px);
  font-weight: 900;
  letter-spacing: -.02em;
  line-height: 1;
  color: #9EE6FF;
  text-shadow: 0 2px 0 rgba(9, 48, 72, .85), 0 3px 0 rgba(9, 48, 72, .6), 0 0 12px rgba(120, 215, 255, .6);
  animation: popFloat .92s cubic-bezier(.2, .7, .3, 1) forwards;
  white-space: nowrap;
}
.pop.gold { color: #FFD36B; text-shadow: 0 2px 0 #7A3B00, 0 3px 0 #5A2900, 0 0 14px rgba(255, 190, 60, .75); font-size: clamp(21px, 6.2vw, 30px); }
.pop.extreme { color: #FFF2C9; text-shadow: 0 2px 0 #8A3B00, 0 0 16px rgba(255, 190, 70, .9); }

.vignette {
  position: absolute;
  inset: 0;
  z-index: 26;
  pointer-events: none;
  box-shadow: inset 0 0 78px 16px rgba(220, 40, 25, .5);
  opacity: 0;
  transition: opacity .18s;
}
.arena.danger .vignette { opacity: 1; animation: vignettePulse .9s ease-in-out infinite; }

.flash {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}
.flash.red { background: #FF4D3D; }
.flash.gold { background: #FFD36B; }
.flash.on { animation: flashOut .42s ease-out; }

.paw {
  position: absolute;
  top: 35%;
  right: -22%;
  width: 60%;
  max-width: 260px;
  z-index: 35;
  opacity: 0;
  transform-origin: 70% 30%;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .42));
  pointer-events: none;
}
.paw svg { width: 100%; height: auto; display: block; }
.paw.swipe { animation: pawSwipe .82s cubic-bezier(.18, .8, .22, 1) forwards; }

.toast {
  position: absolute;
  left: 50%;
  top: 59%;
  z-index: 32;
  transform: translate(-50%, -50%) translateY(6px);
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(36, 18, 8, .94);
  border: 1px solid rgba(255, 180, 120, .4);
  color: #FFE8C4;
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s, transform .18s;
}
.toast.show { opacity: 1; transform: translate(-50%, -50%) translateY(0); }

/* ---------- deck ---------- */
.deck {
  position: relative;
  z-index: 10;
  flex: 1 1 auto;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 170, 90, .16), rgba(255, 130, 50, 0) 62%),
    linear-gradient(180deg, rgba(56, 30, 15, .93) 0%, rgba(35, 18, 9, .97) 42%, rgba(23, 11, 5, .99) 100%);
  border-top: 1px solid rgba(255, 199, 136, .26);
  box-shadow: 0 -12px 28px rgba(0, 0, 0, .38);
}

.deck::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0) 0 43px, rgba(0, 0, 0, .1) 43px 45px);
  opacity: .45;
  pointer-events: none;
}

.deck-paw {
  position: absolute;
  right: -26px;
  bottom: -30px;
  width: 180px;
  height: 180px;
  color: rgba(255, 196, 140, .055);
  pointer-events: none;
}

.deck-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.deck-row { display: flex; align-items: center; gap: 7px; }

.mini-chip {
  height: 30px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  border-radius: 15px;
  background: rgba(255, 235, 210, .075);
  border: 1px solid rgba(255, 210, 160, .18);
  color: rgba(255, 235, 210, .7);
  font-size: 10px;
  white-space: nowrap;
}
.mini-chip .mp-icon { width: 15px; height: 15px; color: #FFC46B; }
.mini-chip b { color: #FFF2D8; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.mult-chip { margin-left: auto; }
.mult-chip b { color: #FFD36B; }

.icon-btn {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 235, 210, .08);
  border: 1px solid rgba(255, 210, 160, .2);
  color: #FFD9A8;
  transition: transform .12s, background .15s, color .15s;
}
.icon-btn .mp-icon { width: 18px; height: 18px; }
.icon-btn:active { transform: scale(.92); background: rgba(255, 235, 210, .16); }
.icon-btn.muted { color: rgba(255, 220, 180, .38); }

.hold-btn {
  position: relative;
  width: 100%;
  height: clamp(64px, 8.6dvh, 88px);
  flex: 0 0 auto;
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(180deg, #FFB163 0%, #FF8A3D 46%, #F26A1B 100%);
  box-shadow: 0 6px 0 #A33E0D, 0 12px 26px rgba(255, 110, 30, .26), inset 0 2px 0 rgba(255, 255, 255, .45);
  touch-action: none;
  transition: transform .09s ease-out, box-shadow .09s ease-out;
}

.hold-btn:active, .hold-btn.pressed {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #A33E0D, 0 6px 14px rgba(255, 110, 30, .22), inset 0 2px 0 rgba(255, 255, 255, .38);
}

.hold-glow {
  position: absolute;
  top: -55%;
  left: -12%;
  width: 62%;
  height: 210%;
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, .4), rgba(255, 255, 255, 0) 62%);
  transform: rotate(16deg);
  animation: shimmer 3.4s ease-in-out infinite;
  pointer-events: none;
}

.hold-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  padding: 0 16px;
}

.hold-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .2);
  border: 1px solid rgba(255, 255, 255, .38);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3);
}
.hold-icon .mp-icon { width: 24px; height: 24px; color: #FFF8EC; }

.hold-text { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; }
.hold-text b {
  font-size: clamp(17px, 4.7vw, 20px);
  font-weight: 900;
  letter-spacing: .02em;
  color: #FFF9EE;
  line-height: 1.2;
  text-shadow: 0 2px 0 rgba(145, 55, 8, .55);
}
.hold-text small { font-size: 9.5px; color: rgba(255, 246, 232, .86); letter-spacing: .01em; }

.hold-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 4px;
  width: 0%;
  z-index: 3;
  background: linear-gradient(90deg, #FFF0C2, #FFD166);
  box-shadow: 0 0 10px #FFD166;
  transition: width .05s linear;
}

.live-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 9.5px;
  color: rgba(255, 235, 210, .52);
  letter-spacing: .01em;
}
.live-stats b { color: #FFE1B4; font-size: 10.5px; font-variant-numeric: tabular-nums; }
.live-stats .sep { width: 1px; height: 8px; background: rgba(255, 220, 180, .18); }

.tip-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 9px;
  color: rgba(255, 235, 210, .38);
  text-align: center;
  line-height: 1.2;
}
.tip-row .dot { color: rgba(255, 200, 140, .35); }

/* ---------- modal ---------- */
.modal {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .24s, visibility .24s;
}
.modal.show { opacity: 1; visibility: visible; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 5, 2, .7);
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
}

.result-card {
  position: relative;
  width: min(90%, 340px);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 20px 16px;
  border-radius: 27px;
  background: linear-gradient(180deg, #FFF9ED 0%, #FFF1DC 100%);
  border: 2px solid #F2C995;
  box-shadow: 0 26px 60px rgba(0, 0, 0, .5), inset 0 1px 0 #FFFFFF;
  color: var(--ink);
  text-align: center;
  transform: translateY(18px) scale(.96);
  transition: transform .28s cubic-bezier(.2, .9, .3, 1.05);
}
.modal.show .result-card { transform: translateY(0) scale(1); }

.result-badge {
  width: 52px;
  height: 52px;
  margin: 0 auto 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #FFB25E, #F26A1B);
  border: 3px solid #FFF6E6;
  box-shadow: 0 7px 16px rgba(200, 80, 20, .3);
  color: #FFF9EE;
}
.result-badge .mp-icon { width: 27px; height: 27px; }

.result-eyebrow {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .18em;
  color: #B47A45;
  text-transform: uppercase;
}

.result-title {
  margin: 2px 0 8px;
  font-size: 23px;
  font-weight: 900;
  letter-spacing: -.02em;
  color: #2B160C;
}

.result-score {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 0 auto 7px;
}
.fish-result { width: 36px; height: 23px; }
.result-score b {
  font-size: 46px;
  line-height: 1;
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
  color: #E8590C;
  text-shadow: 0 2px 0 rgba(255, 255, 255, .7);
}
.result-score span { align-self: flex-end; margin-bottom: 5px; font-size: 10px; color: #A4805E; }

.record-line {
  display: inline-block;
  margin: 0 auto 13px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #FDEBD2;
  border: 1px solid #F1D6B2;
  color: #8A4B1C;
  font-size: 10.5px;
  font-weight: 700;
}
.record-line.new {
  background: linear-gradient(180deg, #FFE6A4, #FFCE62);
  border-color: #E8AC3A;
  color: #6B3400;
  font-weight: 900;
  box-shadow: 0 3px 10px rgba(230, 160, 40, .22);
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-bottom: 14px;
}
.result-cell {
  background: #FFF9ED;
  border: 1px solid #F1DDC2;
  border-radius: 13px;
  padding: 8px 6px 7px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.result-cell span { font-size: 9px; color: #A4805E; }
.result-cell b { font-size: 16px; color: #3A2110; font-variant-numeric: tabular-nums; }

.restart-btn {
  width: 100%;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(180deg, #FFAB5C, #F26A1B);
  box-shadow: 0 5px 0 #B94A12, 0 10px 20px rgba(220, 90, 20, .24), inset 0 2px 0 rgba(255, 255, 255, .4);
  color: #FFF9EE;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: .02em;
  transition: transform .09s, box-shadow .09s;
}
.restart-btn .mp-icon { width: 21px; height: 21px; }
.restart-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #B94A12, 0 5px 10px rgba(220, 90, 20, .2), inset 0 2px 0 rgba(255, 255, 255, .35); }

.result-hint { margin: 9px 0 0; font-size: 9.5px; color: #A4805E; }

/* ---------- animations ---------- */
@keyframes scoreBump {
  0% { transform: scale(1); }
  35% { transform: scale(1.12); }
  100% { transform: scale(1); }
}
@keyframes comboPop {
  0% { transform: rotate(-4deg) scale(.72); opacity: .2; }
  60% { transform: rotate(-3deg) scale(1.1); opacity: 1; }
  100% { transform: rotate(-4deg) scale(1); opacity: 1; }
}
@keyframes popFloat {
  0% { opacity: 0; transform: translate(-50%, -20%) scale(.55); }
  18% { opacity: 1; transform: translate(-50%, -58%) scale(1.06); }
  100% { opacity: 0; transform: translate(-50%, -190%) scale(1.12); }
}
@keyframes padBreathe {
  0%, 100% { transform: scale(1); box-shadow: inset 0 0 22px rgba(255, 214, 150, .18), 0 0 0 0 rgba(255, 190, 100, .18), 0 6px 18px rgba(0, 0, 0, .24); }
  50% { transform: scale(1.025); box-shadow: inset 0 0 26px rgba(255, 224, 170, .28), 0 0 22px 5px rgba(255, 180, 80, .16), 0 6px 18px rgba(0, 0, 0, .24); }
}
@keyframes padPing {
  0% { transform: scale(.92); opacity: .65; }
  80%, 100% { transform: scale(1.22); opacity: 0; }
}
@keyframes warnPing {
  0%, 100% { transform: scale(1); opacity: .75; }
  50% { transform: scale(1.12); opacity: 1; }
}
@keyframes catAlertShake {
  0%, 100% { transform: scale(1) rotate(-8deg); }
  50% { transform: scale(1.06) rotate(-1deg); }
}
@keyframes catAlertPing {
  0% { transform: scale(.9); opacity: .8; }
  100% { transform: scale(1.5); opacity: 0; }
}
@keyframes dangerPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 70, 40, .1); }
  50% { box-shadow: 0 0 22px 4px rgba(255, 70, 40, .3); }
}
@keyframes extremePop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.7) rotate(-3deg); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1.08) rotate(1deg); }
  30% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0); }
  78% { opacity: 1; transform: translate(-50%, -64%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -84%) scale(.94); }
}
@keyframes vignettePulse {
  0%, 100% { opacity: .55; }
  50% { opacity: 1; }
}
@keyframes flashOut {
  0% { opacity: .85; }
  100% { opacity: 0; }
}
@keyframes pawSwipe {
  0% { opacity: 0; transform: translate(64%, -62%) rotate(22deg) scale(1.12); }
  16% { opacity: 1; }
  42% { opacity: 1; transform: translate(0, 0) rotate(-8deg) scale(1); }
  64% { opacity: 1; transform: translate(-4%, 2%) rotate(-10deg) scale(1.01); }
  100% { opacity: 0; transform: translate(-22%, 16%) rotate(-16deg) scale(.94); }
}
@keyframes clockShake {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-8deg); }
  75% { transform: rotate(8deg); }
}
@keyframes heartBreak {
  0% { transform: scale(1); }
  40% { transform: scale(1.35) rotate(-12deg); }
  100% { transform: scale(1); }
}
@keyframes shimmer {
  0%, 100% { transform: translateX(-18%) rotate(16deg); opacity: .55; }
  50% { transform: translateX(34%) rotate(16deg); opacity: .95; }
}
@keyframes shakeArena {
  0%, 100% { transform: translate(0, 0); }
  15% { transform: translate(-7px, 3px); }
  30% { transform: translate(6px, -3px); }
  45% { transform: translate(-5px, 2px); }
  60% { transform: translate(4px, -2px); }
  80% { transform: translate(-2px, 1px); }
}
.arena.shake { animation: shakeArena .42s ease-out; }

/* ---------- responsive ---------- */
@media (min-height: 800px) {
  .deck-inner { gap: 11px; }
  .hold-btn { height: clamp(76px, 9.2dvh, 92px); }
  .live-stats { font-size: 10px; }
}

@media (max-height: 700px) {
  .deck-inner { gap: 6px; }
  .hold-btn { height: 58px; border-radius: 18px; }
  .hold-icon { width: 34px; height: 34px; }
  .hold-icon .mp-icon { width: 20px; height: 20px; }
  .hold-text b { font-size: 16px; }
  .hold-text small { font-size: 8.5px; }
  .mini-chip { height: 27px; font-size: 9px; }
  .mini-chip b { font-size: 11.5px; }
  .tip-row { display: none; }
  .live-stats { font-size: 8.5px; }
}

@media (max-height: 600px) {
  .live-stats { display: none; }
  .hud { height: 46px; }
  .hold-btn { height: 52px; }
  .alert-band { height: 44px; }
}

@media (max-width: 340px) {
  .timer-pill { flex-basis: 78px; font-size: 12.5px; }
  .lives-pill { flex-basis: 72px; }
  .score-num { font-size: 18px; }
  .fish-mini { width: 23px; height: 15px; }
  .heart { width: 13px; height: 13px; }
  .alert-band { left: 6px; right: 6px; }
  .cat-alert { left: 33%; }
}

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

/* ---------- level & goal (闯关目标) ---------- */
[hidden] { display: none !important; }

.mini-chip.level-chip {
  gap: 5px;
  padding: 0 8px;
  border-color: rgba(255, 190, 120, .3);
  background: rgba(255, 170, 80, .12);
}
.level-chip span { font-size: 9px; color: rgba(255, 235, 210, .6); }
.level-chip span b { display: inline; font-size: 10.5px; color: #FFD9A8; }
.level-chip > b { font-size: 11.5px; color: #FFD36B; letter-spacing: .01em; }
.level-chip.done > b { color: #9BE38B; }

.goal-strip {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 6;
  background: rgba(255, 220, 180, .09);
  pointer-events: none;
}
.goal-strip-fill {
  height: 100%;
  width: 0%;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(90deg, #FFD36B, #FF8A3D);
  box-shadow: 0 0 9px rgba(255, 170, 70, .85);
  transition: width .18s ease-out;
}

/* cat state colours */
.st-turn .state-dot { background: #FFD166; box-shadow: 0 0 7px #FFD166; }
.st-turn .state-label { color: #FFD166; }
.st-ears .state-dot { background: #FFB347; box-shadow: 0 0 7px #FFB347; }
.st-ears .state-label { color: #FFB347; }
.st-half .state-dot { background: #FF8A3D; box-shadow: 0 0 8px #FF8A3D; }
.st-half .state-label { color: #FF9A4D; }
.st-open .state-dot { background: #FF5B43; box-shadow: 0 0 9px #FF5B43; }
.st-open .state-label { color: #FF7A62; }
.st-open .alert-band { border-color: rgba(255, 90, 60, .7); }

/* ---------- guard interference tools ---------- */
.tools {
  position: absolute;
  right: 8px;
  top: 55.5%;
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 5px;
  border-radius: 16px;
  background: rgba(41, 22, 11, .76);
  border: 1px solid rgba(255, 210, 160, .24);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .07);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  touch-action: manipulation;
}
.tool-pool {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 16px;
  padding: 0 2px;
  color: rgba(255, 226, 196, .72);
  font-size: 8.5px;
  font-weight: 800;
  white-space: nowrap;
}
.tool-pool .mp-icon { width: 12px; height: 12px; color: #FFC46B; }
.tool-pool b { color: #FFE6A6; font-size: 11px; font-variant-numeric: tabular-nums; }
.tool-pool.empty b { color: #FF7A62; }

.tool-btn {
  width: 52px;
  height: 49px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  background: linear-gradient(180deg, rgba(255, 185, 105, .2), rgba(255, 138, 61, .1));
  border: 1px solid rgba(255, 190, 130, .36);
  color: #FFE8C4;
  transition: transform .1s, background .15s, border-color .15s, opacity .15s;
}
.tool-btn .mp-icon { width: 19px; height: 19px; color: #FFC46B; }
.tool-btn span { font-size: 9px; font-weight: 800; line-height: 1.1; }
.tool-btn small { font-size: 8px; line-height: 1; color: rgba(255, 230, 200, .58); }
.tool-btn:active { transform: scale(.92); background: rgba(255, 180, 100, .3); }
.tool-btn.active {
  border-color: rgba(255, 211, 107, .9);
  background: linear-gradient(180deg, rgba(255, 205, 110, .36), rgba(255, 138, 61, .2));
  box-shadow: 0 0 13px rgba(255, 190, 60, .4);
}
.tool-btn:disabled { opacity: .34; }
.tool-btn:disabled:active { transform: none; }

.tool-effect {
  display: none;
  width: 52px;
  padding: 1px 0 2px;
  color: #FFD36B;
  font-size: 8px;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  letter-spacing: .01em;
}
.tool-effect.show { display: block; }

/* ---------- intro card ---------- */
.intro-card { padding: 22px 20px 15px; }
.intro-badge { background: linear-gradient(180deg, #FFC46B, #F26A1B); }
.intro-desc {
  margin: 3px auto 14px;
  max-width: 272px;
  font-size: 11.5px;
  line-height: 1.6;
  color: #6F4A2A;
}
.intro-goal {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-bottom: 11px;
}
.intro-stat {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 7px 4px 6px;
  border-radius: 13px;
  background: #FFF9ED;
  border: 1px solid #F1DDC2;
}
.intro-stat span { font-size: 9px; color: #A4805E; }
.intro-stat b { font-size: 11px; color: #3A2110; font-weight: 800; }
.intro-stat em { font-style: normal; font-size: 20px; line-height: 1.1; color: #E8590C; letter-spacing: -.02em; }
.intro-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 5px;
  font-size: 9.5px;
  color: #8A5A32;
}
.intro-note span { display: flex; align-items: center; gap: 3px; }
.intro-note .mp-icon { width: 13px; height: 13px; color: #E8590C; }
.intro-note b { font-size: 9.5px; color: #8A4B1C; }
.intro-hint { margin: 0 0 13px; font-size: 9px; color: #A4805E; }

/* ---------- result extras ---------- */
.result-sub {
  margin: -3px auto 9px;
  max-width: 260px;
  font-size: 10.5px;
  line-height: 1.45;
  color: #8A6542;
}
.goal-result {
  display: inline-block;
  margin: -4px auto 12px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #FFF5E3;
  border: 1px dashed #E7C79B;
  color: #8A5A32;
  font-size: 9.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.result-card.fail .result-badge { background: linear-gradient(180deg, #FF9B7A, #D6452C); }
.result-card.fail .result-title { color: #C63A22; }
.result-card.fail .result-score b { color: #C63A22; }

@media (max-width: 340px) {
  .tool-btn { width: 47px; height: 46px; }
  .tool-btn span { font-size: 8.5px; }
  .tool-effect { width: 47px; }
  .tools { right: 6px; }
  .intro-card { padding: 18px 16px 13px; }
  .intro-desc { font-size: 11px; }
}

@media (max-height: 700px) {
  .tools { top: 54%; }
  .tool-btn { height: 44px; }
  .tool-btn .mp-icon { width: 17px; height: 17px; }
  .intro-desc { margin-bottom: 10px; }
  .intro-goal { margin-bottom: 8px; }
}
