/* 经典贪吃蛇玩法 —— 软萌卡通风单页游戏 */
:root {
  --orange: #FF8A3D;
  --orange-deep: #EC6A18;
  --orange-soft: #FFBA85;
  --cream: #FFF7EC;
  --cream-deep: #FFE9D1;
  --ink: #4B3325;
  --ink-soft: #7E5F4B;
  --muted: #AD8A72;
  --line: #FFDFC3;
  --snake: #FF8A3D;
  --snake-light: #FFC08A;
  --snake-dark: #DE661A;
  --shadow-card: 0 8px 20px rgba(190, 104, 42, 0.10);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(120% 70% at 50% -12%, #FFFDF9 0%, rgba(255, 253, 249, 0) 58%),
    radial-gradient(75% 46% at 6% 2%, #FFDFB9 0%, rgba(255, 223, 185, 0) 62%),
    radial-gradient(70% 44% at 100% 18%, #FFE3C6 0%, rgba(255, 227, 198, 0) 66%),
    linear-gradient(180deg, #FFF4E6 0%, #FFEEDC 52%, #FFE6CB 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

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

.mp-icon { flex: none; }

/* ---------- 背景装饰 ---------- */
.app {
  position: relative;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  padding: calc(10px + env(safe-area-inset-top)) 14px calc(12px + env(safe-area-inset-bottom));
  overflow-x: clip;
}

.deco {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.55;
}

.b1 {
  width: 190px; height: 190px;
  left: -86px; top: 6%;
  background: radial-gradient(circle at 36% 34%, rgba(255, 186, 133, 0.55), rgba(255, 186, 133, 0));
}
.b2 {
  width: 240px; height: 240px;
  right: -120px; top: 34%;
  background: radial-gradient(circle at 40% 40%, rgba(255, 214, 170, 0.7), rgba(255, 214, 170, 0));
}
.b3 {
  width: 260px; height: 260px;
  left: -110px; bottom: -80px;
  background: radial-gradient(circle at 50% 50%, rgba(255, 198, 149, 0.42), rgba(255, 198, 149, 0));
}
.dot {
  position: absolute;
  border-radius: 50%;
  background: #FFC893;
  opacity: 0.5;
}
.d1 { width: 8px; height: 8px; left: 7%; top: 17%; }
.d2 { width: 5px; height: 5px; right: 10%; top: 11%; opacity: 0.38; }
.d3 { width: 6px; height: 6px; right: 6%; bottom: 22%; opacity: 0.4; }
.d4 { width: 4px; height: 4px; left: 12%; bottom: 12%; opacity: 0.35; }

/* ---------- 页面骨架 ---------- */
.game {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 460px;
  min-height: calc(100dvh - 22px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ---------- 顶部计分 ---------- */
.hud {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.hud-pill {
  height: 46px;
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 0 14px;
  border-radius: 16px;
  background: rgba(255, 253, 247, 0.92);
  border: 2px solid #FFE5CE;
  box-shadow: var(--shadow-card), inset 0 1px 0 #FFFFFF;
}

.hud-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.hud-value {
  font-size: 23px;
  font-weight: 900;
  line-height: 1;
  color: var(--orange-deep);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  transform-origin: left center;
}

.hud-value.pop { animation: valuePop 0.34s cubic-bezier(0.2, 1.6, 0.4, 1); }

@keyframes valuePop {
  0% { transform: scale(1); }
  45% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.best-pill { gap: 6px; padding: 0 12px; }
.best-pill .mp-icon { width: 18px; height: 18px; color: #F5A623; align-self: center; }
.best-pill .hud-value { color: #C99445; }

.hud-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

.icon-btn {
  position: relative;
  width: 44px;
  height: 44px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  background: rgba(255, 253, 247, 0.92);
  border: 2px solid #FFE5CE;
  color: #B4784A;
  box-shadow: var(--shadow-card), inset 0 1px 0 #FFFFFF;
  transition: transform 0.12s ease, background 0.12s ease;
}
.icon-btn .mp-icon { width: 23px; height: 23px; }
.icon-btn:active { transform: scale(0.92); background: #FFEEDA; }

.icon-btn .ico-off { display: none; }
.icon-btn.muted .ico-on { display: none; }
.icon-btn.muted .ico-off { display: inline-block; }
.icon-btn .ico-play { display: none; }
.icon-btn.paused .ico-pause { display: none; }
.icon-btn.paused .ico-play { display: inline-block; }

/* ---------- 棋盘 ---------- */
.stage {
  position: relative;
  width: 100%;
  width: min(100%, calc((100dvh - 200px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) * 0.577));
  aspect-ratio: 15 / 26;
  margin: 0 auto;
  flex: none;
  border-radius: 27px;
  background: #FFFBF3;
  overflow: hidden;
  box-shadow:
    0 18px 34px rgba(186, 97, 32, 0.17),
    0 4px 0 rgba(246, 190, 142, 0.75),
    0 0 0 5px #FFE0C2;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.stage.shake { animation: stageShake 0.36s cubic-bezier(0.36, 0.07, 0.19, 0.97); }

@keyframes stageShake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 22px;
}

/* 内圈描边，压在画布上、浮层下 */
.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 27px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 0 0 2px rgba(255, 168, 96, 0.16);
  pointer-events: none;
  z-index: 3;
}

/* ---------- 浮层 ---------- */
.overlay {
  position: absolute;
  inset: 6px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 18px 20px;
  border-radius: 21px;
  background:
    radial-gradient(95% 55% at 50% 8%, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0) 72%),
    linear-gradient(180deg, rgba(255, 248, 237, 0.97) 0%, rgba(255, 239, 220, 0.98) 100%);
  animation: overlayIn 0.28s ease both;
}

.overlay[hidden] { display: none; }

@keyframes overlayIn {
  from { opacity: 0; transform: scale(0.985); }
  to { opacity: 1; transform: scale(1); }
}

/* 蛇头吉祥物 */
.mascot {
  position: relative;
  width: 118px;
  height: 100px;
  margin-bottom: 2px;
  animation: mascotBob 3s ease-in-out infinite;
}

.m-head {
  position: absolute;
  left: 15px;
  top: 6px;
  width: 88px;
  height: 80px;
  border-radius: 46% 46% 44% 44% / 48% 48% 42% 42%;
  background: linear-gradient(180deg, var(--snake-light) 0%, var(--snake) 58%, var(--snake) 100%);
  box-shadow:
    inset 0 -6px 0 rgba(0, 0, 0, 0.06),
    inset 0 5px 0 rgba(255, 255, 255, 0.32),
    0 10px 18px rgba(210, 100, 30, 0.24);
}
.m-eye {
  position: absolute;
  top: 25px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #FFFDF7;
  box-shadow: 0 2px 0 rgba(160, 70, 20, 0.16);
}
.m-eye.l { left: 14px; }
.m-eye.r { right: 14px; }
.m-eye i {
  position: absolute;
  left: 7px;
  top: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4B2B18;
}
.m-eye i::after {
  content: "";
  position: absolute;
  left: 1px;
  top: 1px;
  width: 3.5px;
  height: 3.5px;
  border-radius: 50%;
  background: #FFFFFF;
}
.m-cheek {
  position: absolute;
  top: 50px;
  width: 15px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 111, 128, 0.42);
}
.m-cheek.l { left: 8px; }
.m-cheek.r { right: 8px; }
.m-smile {
  position: absolute;
  left: 50%;
  top: 52px;
  width: 17px;
  height: 9px;
  margin-left: -8.5px;
  border-bottom: 3px solid #A94A17;
  border-radius: 0 0 50% 50%;
}
.m-tongue {
  position: absolute;
  left: 50%;
  top: 64px;
  width: 9px;
  height: 13px;
  margin-left: -4.5px;
  border-radius: 0 0 5px 5px;
  background: #FF7383;
  transform-origin: top center;
  animation: tongueWiggle 2.4s ease-in-out infinite;
}
.m-tongue::after {
  content: "";
  position: absolute;
  left: 4px;
  bottom: -4px;
  width: 5px;
  height: 5px;
  border-right: 3px solid #FF7383;
  border-bottom: 3px solid #FF7383;
  border-radius: 0 0 3px 0;
  transform: rotate(-45deg);
}
.m-tail {
  position: absolute;
  left: 6px;
  top: 54px;
  width: 42px;
  height: 38px;
  border-radius: 50%;
  border: 12px solid var(--snake);
  border-top-color: transparent;
  border-right-color: transparent;
  transform: rotate(-28deg);
  opacity: 0.9;
}

@keyframes mascotBob {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-6px) rotate(1deg); }
}
@keyframes tongueWiggle {
  0%, 68%, 100% { transform: rotate(0deg) scaleY(1); }
  76% { transform: rotate(8deg) scaleY(1.18); }
  84% { transform: rotate(-5deg) scaleY(0.94); }
}

.over-kicker {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #BE8354;
}

.over-title {
  margin: 3px 0 0;
  font-size: 34px;
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: #4B2B18;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.7);
}
.over-title.small { font-size: 25px; margin-top: 8px; }

.over-sub {
  margin: 8px 0 0;
  font-size: 13.5px;
  line-height: 1.62;
  font-weight: 600;
  color: #8C6A52;
}

.over-tip {
  margin: 11px 0 0;
  font-size: 11.5px;
  font-weight: 600;
  color: #B4937B;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 50px;
  padding: 0 26px;
  border-radius: 17px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.02em;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn .mp-icon { width: 21px; height: 21px; }

.btn.primary {
  margin-top: 17px;
  color: #FFFFFF;
  background: linear-gradient(180deg, #FFA460 0%, #FF8A3D 52%, #F87322 100%);
  box-shadow: 0 6px 0 #D95E12, 0 12px 20px rgba(226, 108, 31, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  text-shadow: 0 1px 0 rgba(171, 72, 12, 0.28);
}
.btn.primary:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #D95E12, 0 6px 12px rgba(226, 108, 31, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn.ghost {
  margin-top: 17px;
  color: #B06B3A;
  background: #FFF6EB;
  border: 2px solid #FFDEC2;
  box-shadow: 0 4px 0 #F6D4B4;
}
.btn.ghost:active { transform: translateY(3px); box-shadow: 0 1px 0 #F6D4B4; }

.round-badge {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 22px;
  background: linear-gradient(180deg, #FFE6CC, #FFD7B6);
  color: #E4762A;
  box-shadow: inset 0 2px 0 #FFFFFF, 0 8px 16px rgba(210, 110, 40, 0.15);
}
.round-badge .mp-icon { width: 32px; height: 32px; }

/* 结算 */
.over-screen { justify-content: center; }
.over-inner { width: 100%; display: flex; flex-direction: column; align-items: center; }
.final-score {
  margin: 1px 0 0;
  font-size: 64px;
  line-height: 1.08;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--orange-deep);
  text-shadow: 0 3px 0 #FFE1C6, 0 7px 16px rgba(232, 112, 34, 0.18);
  font-variant-numeric: tabular-nums;
}
.best-line {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: #9A755A;
}
.best-line .mp-icon { width: 16px; height: 16px; color: #F0A53C; }
.best-line strong { font-size: 15px; color: #C08A45; }
.record-tag {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 3px;
  padding: 3px 8px 3px 6px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  color: #FFFFFF;
  background: linear-gradient(180deg, #FFAE5C, #FF852F);
  box-shadow: 0 2px 6px rgba(232, 112, 34, 0.25);
}
.record-tag[hidden] { display: none; }
.record-tag .mp-icon { width: 12px; height: 12px; color: #FFF3D8; }
.over-actions { display: flex; gap: 8px; align-items: stretch; width: 100%; }
.over-actions .btn { flex: 1; min-width: 0; padding: 0 12px; font-size: 15px; gap: 5px; }

/* ---------- 底部控制 ---------- */
.deck {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: none;
  margin-top: auto;
}

.skin-chip {
  flex: 1;
  min-width: 0;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border-radius: 19px;
  background: rgba(255, 252, 246, 0.94);
  border: 2px solid #FFE4CC;
  box-shadow: var(--shadow-card), inset 0 1px 0 #FFFFFF;
  text-align: left;
  transition: transform 0.12s ease, background 0.12s ease;
}
.skin-chip:active { transform: scale(0.97); background: #FFEFDD; }

.chip-mini {
  position: relative;
  width: 62px;
  height: 38px;
  flex: none;
}
.cm-seg {
  position: absolute;
  top: 12px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--snake);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.3);
}
.cm-seg.a { left: 2px; opacity: 0.62; }
.cm-seg.b { left: 14px; opacity: 0.8; }
.cm-seg.c { left: 26px; }
.cm-head {
  position: absolute;
  left: 38px;
  top: 8px;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: var(--snake);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.32), 0 3px 6px rgba(200, 98, 30, 0.22);
}
.cm-eye {
  position: absolute;
  top: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #FFFDF7;
}
.cm-eye::after {
  content: "";
  position: absolute;
  left: 1.5px;
  top: 1.5px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #452A18;
}
.cm-eye:first-child { left: 5px; }
.cm-eye:last-child { right: 5px; }

.chip-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chip-copy strong {
  font-size: 15px;
  font-weight: 900;
  color: #5C3D29;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chip-copy small {
  font-size: 10.5px;
  font-weight: 600;
  color: #B08C72;
  white-space: nowrap;
}
.chip-icon { width: 20px; height: 20px; margin-left: auto; color: #D79A65; }

.dpad {
  flex: none;
  display: grid;
  grid-template-columns: repeat(3, 44px);
  grid-template-rows: repeat(2, 44px);
  gap: 5px;
}

.dpad-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  color: #C0783F;
  background: linear-gradient(180deg, #FFFCF7, #FFF0DE);
  border: 2px solid #FFE2C8;
  box-shadow: 0 3px 0 #F3CFAD, inset 0 1px 0 #FFFFFF;
  transition: transform 0.08s ease, background 0.08s ease, box-shadow 0.08s ease;
}
.dpad-btn .mp-icon { width: 27px; height: 27px; }
.dpad-btn:active {
  transform: translateY(3px);
  background: #FFE7D0;
  box-shadow: 0 0 0 #F3CFAD, inset 0 2px 4px rgba(212, 123, 55, 0.14);
  color: #A85E26;
}
.dpad-btn.up { grid-area: 1 / 2; }
.dpad-btn.left { grid-area: 2 / 1; }
.dpad-btn.down { grid-area: 2 / 2; }
.dpad-btn.right { grid-area: 2 / 3; }

/* ---------- 皮肤面板 ---------- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(64, 39, 23, 0.36);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.26s ease;
}

.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 21;
  width: min(100%, 480px);
  padding: 8px 16px calc(18px + env(safe-area-inset-bottom));
  border-radius: 28px 28px 0 0;
  background: linear-gradient(180deg, #FFF9F1 0%, #FFF4E6 100%);
  box-shadow: 0 -18px 48px rgba(109, 63, 30, 0.22), 0 -2px 0 #FFFFFF inset;
  transform: translate(-50%, 112%);
  transition: transform 0.34s cubic-bezier(0.2, 0.9, 0.2, 1), visibility 0s linear 0.34s;
  visibility: hidden;
  pointer-events: none;
}
body.sheet-open .sheet {
  transform: translate(-50%, 0);
  visibility: visible;
  pointer-events: auto;
  transition: transform 0.34s cubic-bezier(0.2, 0.9, 0.2, 1), visibility 0s linear 0s;
}
body.sheet-open .sheet-backdrop { opacity: 1; pointer-events: auto; }

.sheet-grab {
  width: 38px;
  height: 4px;
  margin: 1px auto 9px;
  border-radius: 999px;
  background: #F3D2B2;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.sheet-copy h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.01em;
  color: #4B2B18;
}
.sheet-copy p {
  margin: 3px 0 0;
  font-size: 11.5px;
  font-weight: 600;
  color: #AA856B;
}

.skin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.skin-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 102px;
  padding: 9px 8px;
  border-radius: 17px;
  text-align: center;
  background: #FFFDF8;
  border: 2px solid #FFE6D0;
  box-shadow: 0 3px 0 #F6DCC3;
  transition: transform 0.1s ease, border-color 0.15s ease, background 0.15s ease;
}
.skin-card:active { transform: scale(0.97); }
.skin-card.active {
  border-color: var(--orange);
  background: #FFF3E4;
  box-shadow: 0 3px 0 #FFC795, 0 0 0 2px rgba(255, 138, 61, 0.12);
}

.skin-preview {
  position: relative;
  width: 76px;
  height: 46px;
  flex: none;
}
.sp-seg {
  position: absolute;
  border-radius: 50%;
  background: var(--snake);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.32);
}
.sp-seg.a { left: 1px; top: 22px; width: 15px; height: 15px; opacity: 0.55; }
.sp-seg.b { left: 11px; top: 20px; width: 17px; height: 17px; opacity: 0.72; }
.sp-seg.c { left: 23px; top: 18px; width: 19px; height: 19px; opacity: 0.9; }
.sp-head {
  position: absolute;
  left: 38px;
  top: 13px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: var(--snake);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.32), 0 3px 7px rgba(196, 96, 28, 0.24);
}
.sp-eye {
  position: absolute;
  top: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #FFFDF7;
}
.sp-eye::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #452A18;
}
.sp-eye.l { left: 5px; }
.sp-eye.r { right: 5px; }

.skin-meta { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.skin-meta b {
  font-size: 13.5px;
  font-weight: 900;
  color: #573A27;
  white-space: nowrap;
}
.skin-meta small {
  font-size: 10px;
  font-weight: 600;
  color: #AD8A72;
  white-space: nowrap;
}

.skin-check {
  position: absolute;
  right: 7px;
  top: 7px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--orange);
  color: #FFFFFF;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.skin-check .mp-icon { width: 13px; height: 13px; }
.skin-card.active .skin-check { opacity: 1; transform: scale(1); }

.sheet-note {
  margin: 13px 0 1px;
  text-align: center;
  font-size: 10.5px;
  font-weight: 600;
  color: #BC9A80;
}

/* ---------- 小屏适配 ---------- */
@media (max-width: 356px) {
  .chip-copy small, .chip-icon { display: none; }
  .chip-mini { width: 54px; }
  .cm-head { left: 32px; }
  .cm-seg.c { left: 23px; }
  .dpad { grid-template-columns: repeat(3, 40px); grid-template-rows: repeat(2, 40px); }
  .dpad-btn .mp-icon { width: 25px; height: 25px; }
  .hud-pill { padding: 0 11px; }
  .hud-label { font-size: 10px; }
  .hud-value { font-size: 21px; }
  .hud-actions { gap: 4px; }
  .icon-btn { width: 41px; height: 41px; border-radius: 14px; }
}

@media (max-height: 660px) {
  .mascot { width: 96px; height: 80px; margin-bottom: 0; transform: scale(0.86); }
  .over-title { font-size: 28px; }
  .over-sub { margin-top: 5px; font-size: 12.5px; }
  .btn { min-height: 46px; }
  .btn.primary { margin-top: 12px; }
  .over-tip { margin-top: 8px; }
  .overlay { padding: 12px 16px; }
  .final-score { font-size: 54px; }
}

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