:root {
  --red: #f23b26;
  --red-dark: #b92218;
  --yellow: #ffd82f;
  --cream: #fff7de;
  --ink: #312619;
  --muted: #8b7968;
  --green: #56b36b;
  --shadow: 0 12px 30px rgba(101, 45, 17, .16);
  --font-display: "FZLanTingHeiS-DB-GB", "Microsoft YaHei", "PingFang SC", sans-serif;
  --font-body: "LXGW WenKai", "STKaiti", "KaiTi", serif;
}

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

html, body { margin: 0; min-height: 100%; background: #f4ead1; color: var(--ink); }

body {
  font-family: var(--font-display);
  background-image:
    radial-gradient(circle at 15% 15%, rgba(255,255,255,.9) 0 1px, transparent 2px),
    linear-gradient(135deg, #fff9e7 0%, #f6ebce 55%, #fee8c3 100%);
  background-size: 18px 18px, 100% 100%;
  overscroll-behavior: none;
}

button { font: inherit; }
button:focus-visible { outline: 3px solid #2468ff; outline-offset: 3px; }

.app-shell {
  width: min(100%, 540px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 16px calc(178px + env(safe-area-inset-bottom));
  position: relative;
  overflow: hidden;
}

.ambient { position: absolute; border-radius: 999px; filter: blur(2px); pointer-events: none; opacity: .5; }
.ambient-a { width: 180px; height: 180px; right: -90px; top: 80px; background: rgba(255,216,47,.45); }
.ambient-b { width: 130px; height: 130px; left: -80px; top: 420px; background: rgba(242,59,38,.12); }

.topbar { display: flex; align-items: center; gap: 10px; position: relative; z-index: 2; }
.brand-mark {
  width: 42px; height: 42px; display: grid; place-items: center;
  background: var(--red); color: white; border: 3px solid white; border-radius: 13px 13px 17px 13px;
  box-shadow: 0 5px 0 var(--red-dark); font-size: 22px; font-weight: 900; transform: rotate(-3deg);
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.1; }
.brand-copy span { color: var(--muted); font-size: 10px; letter-spacing: .12em; font-weight: 700; }
.brand-copy strong { font-size: 18px; margin-top: 4px; letter-spacing: .03em; }
.round-button {
  margin-left: auto; width: 38px; height: 38px; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.78); color: var(--red); box-shadow: 0 4px 14px rgba(74,45,20,.12);
  font-weight: 900; font-size: 20px; cursor: pointer;
}
.round-button.muted { color: #aaa; }

.score-strip {
  margin: 16px 0 12px; display: grid; grid-template-columns: repeat(3, 1fr);
  background: rgba(255,255,255,.78); border: 1px solid rgba(122,86,45,.1); border-radius: 18px;
  box-shadow: 0 8px 24px rgba(86,47,13,.09); position: relative; z-index: 2; backdrop-filter: blur(10px);
}
.score-item { padding: 10px 9px; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.score-item + .score-item { border-left: 1px dashed rgba(89,64,34,.18); }
.score-item span { color: var(--muted); font-size: 10px; }
.score-item b { font-size: 17px; font-variant-numeric: tabular-nums; }
.score-item i { color: var(--red); font-style: normal; }

.mission-banner {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: var(--ink); color: #fff; border-radius: 14px 14px 14px 5px;
  box-shadow: 0 6px 0 #d5ae73; position: relative; z-index: 2;
}
.mission-icon { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--yellow); color: var(--ink); font-weight: 900; }
.mission-banner p { margin: 0; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mission-banner p strong { font-size: 13px; }
.mission-banner p span { font: 11px var(--font-body); opacity: .72; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rule-chip { margin-left: auto; white-space: nowrap; color: var(--ink); background: #fff; border-radius: 999px; padding: 5px 8px; font-size: 10px; font-weight: 900; }

.game-stage {
  margin-top: 14px; min-height: 425px; position: relative; border-radius: 25px 25px 16px 16px;
  background:
    linear-gradient(rgba(135,76,35,.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(135,76,35,.09) 1px, transparent 1px),
    #fffaf0;
  background-size: 22px 22px; border: 1px solid rgba(149,89,39,.17); box-shadow: var(--shadow);
  overflow: hidden; user-select: none;
}
.awning {
  height: 34px; width: 110%; margin-left: -5%;
  background: repeating-linear-gradient(90deg, var(--red) 0 34px, #fff4db 34px 68px);
  clip-path: polygon(0 0,100% 0,100% 70%,97% 100%,94% 70%,91% 100%,88% 70%,85% 100%,82% 70%,79% 100%,76% 70%,73% 100%,70% 70%,67% 100%,64% 70%,61% 100%,58% 70%,55% 100%,52% 70%,49% 100%,46% 70%,43% 100%,40% 70%,37% 100%,34% 70%,31% 100%,28% 70%,25% 100%,22% 70%,19% 100%,16% 70%,13% 100%,10% 70%,7% 100%,4% 70%,0 100%);
  filter: drop-shadow(0 5px 3px rgba(84,39,15,.16));
}
.shelf-label { padding: 10px 16px 2px; display: flex; justify-content: space-between; align-items: baseline; }
.shelf-label span { font-size: 13px; font-weight: 900; letter-spacing: .08em; }
.shelf-label i { font: normal 10px var(--font-body); color: var(--muted); }
.board { position: relative; width: 100%; height: 338px; }
.preview-badge {
  position: absolute; z-index: 70; left: 50%; top: 49px; transform: translate(-50%, -12px);
  min-width: 190px; padding: 8px 14px; border: 3px solid #fff; border-radius: 14px;
  color: white; background: var(--ink); box-shadow: 0 8px 22px rgba(43,26,12,.28);
  text-align: center; opacity: 0; pointer-events: none; transition: .25s ease;
}
.preview-badge.show { opacity: 1; transform: translate(-50%, 0); }
.preview-badge b { display: block; color: var(--yellow); font-size: 17px; }
.preview-badge small { display: block; margin-top: 2px; font: 9px var(--font-body); opacity: .72; }

.product-tile {
  position: absolute; width: 22.5%; aspect-ratio: .82; padding: 0; border: 0; border-radius: 12px;
  background: #fff; box-shadow: 0 5px 12px rgba(67,38,17,.19), 0 0 0 1px rgba(99,65,37,.08);
  transform: translate(-50%, -50%) rotate(var(--tilt)); transition: transform .22s ease, filter .2s, opacity .2s, box-shadow .2s;
  overflow: visible; cursor: pointer; touch-action: manipulation;
}
.product-tile::after {
  content: ""; position: absolute; inset: -3px; border: 2px solid transparent; border-radius: 14px; pointer-events: none;
}
.product-tile:not(:disabled):active { transform: translate(-50%, -50%) rotate(var(--tilt)) scale(.92); }
.product-tile.locked { filter: brightness(.72) saturate(.6); cursor: not-allowed; }
.product-tile.locked::before {
  content: ""; position: absolute; inset: 0; z-index: 4; border-radius: inherit; background: rgba(64,42,24,.16);
}
.product-tile.hint { animation: hintPulse .7s ease 3; }
.product-tile.hint::after { border-color: var(--yellow); box-shadow: 0 0 0 4px rgba(255,216,47,.28); }
.product-tile.selected { animation: flyOut .38s cubic-bezier(.3,.8,.45,1) forwards; pointer-events: none; }
.product-photo {
  display: block; width: 100%; height: 76%; object-fit: cover; border-radius: 11px 11px 5px 5px;
  mix-blend-mode: multiply;
}
.product-name {
  position: absolute; left: 5px; right: 5px; bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: #4f4032; text-align: left; font-size: clamp(8px, 2.3vw, 11px); font-weight: 800;
}
.price-tag {
  position: absolute; right: -7px; top: -8px; min-width: 38px; padding: 5px 5px 4px;
  background: var(--yellow); color: #472b12; border: 2px solid #fff; border-radius: 8px 8px 8px 2px;
  box-shadow: 0 3px 0 #d79b18; font-size: clamp(10px, 3vw, 13px); font-weight: 950; letter-spacing: -.03em;
}
.price-tag::before { content: "¥"; font-size: .7em; margin-right: 1px; }
.hard-mode:not(.previewing) .product-tile .price-tag {
  color: transparent; background: var(--ink); box-shadow: 0 3px 0 #120e0a;
}
.hard-mode:not(.previewing) .product-tile .price-tag::before {
  content: "?"; color: var(--yellow); font-size: 14px; margin: 0;
}
.hard-mode.previewing .product-tile { box-shadow: 0 0 0 2px rgba(255,216,47,.72), 0 7px 16px rgba(67,38,17,.22); }
.visual-match-mode .product-tile {
  width: 24%; aspect-ratio: .76; border: 0; border-radius: 42%; background: transparent; box-shadow: none;
  isolation: isolate;
}
.visual-match-mode .product-tile::before {
  content: ""; position: absolute; z-index: -1; left: 17%; right: 17%; bottom: 4%; height: 13%;
  border-radius: 50%; background: rgba(77,45,22,.28); filter: blur(6px); transform: scaleX(.9); pointer-events: none;
}
.visual-match-mode .product-tile::after { inset: 1%; border-radius: 44%; }
.visual-match-mode .product-tile.locked { filter: brightness(.72) saturate(.72); }
.visual-match-mode .product-tile.locked::before {
  inset: auto 17% 4%; height: 13%; border-radius: 50%; background: rgba(77,45,22,.22); filter: blur(6px);
}
.visual-match-mode .product-photo {
  width: 100%; height: 100%; border-radius: 0; object-fit: contain; mix-blend-mode: normal;
}
.visual-match-mode .product-cutout {
  transform: translateY(var(--object-lift, 0)) scale(var(--object-scale, 1)); transform-origin: 50% 72%;
  filter: drop-shadow(0 5px 3px rgba(62,34,16,.31)) drop-shadow(0 1px 1px rgba(62,34,16,.2));
}
.photo-mark { position: absolute; left: 4px; bottom: 4px; padding: 2px 4px; border-radius: 4px; color: white; background: rgba(39,28,19,.72); font-size: 7px; font-weight: 800; letter-spacing: .08em; backdrop-filter: blur(3px); }
.shelf-base { position: absolute; left: 11px; right: 11px; bottom: 9px; height: 14px; background: #d9a55c; border-radius: 5px; box-shadow: inset 0 -5px #b87838; display: flex; justify-content: space-around; }
.shelf-base span { width: 8px; height: 16px; margin-top: 9px; background: #8f582d; }

/* 第三关：手机优先的电子秤判断台 */
.scale-stage {
  margin-top: 14px; padding: 12px; position: relative; z-index: 2; border: 1px solid rgba(127,79,38,.18);
  border-radius: 24px; background: linear-gradient(155deg, #fffdf3 0%, #fff3d2 68%, #f6dfb3 100%);
  box-shadow: var(--shadow); overflow: hidden;
}
.scale-mode.game-stage { display: none; }
.app-shell.scale-mode { padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
.scale-mode .game-stage, .scale-mode .powerups, .scale-mode .cart-zone { display: none; }
.scale-progress { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px; margin: 1px 2px 10px; }
.scale-progress span, .scale-progress b { font-size: 10px; white-space: nowrap; }
.scale-progress b { color: var(--red-dark); }
.scale-progress > div { height: 7px; overflow: hidden; border-radius: 999px; background: #e5d2ad; }
.scale-progress > div i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--red), #ff7a2b); transition: width .3s ease; }
.scale-instruction { display: grid; gap: 3px; padding: 10px 12px; border-radius: 14px; background: var(--ink); color: #fff; }
.scale-instruction span { color: var(--yellow); font-size: 8px; font-weight: 900; letter-spacing: .14em; }
.scale-instruction b { font-size: 13px; }
.scale-instruction small { color: #e8daca; font: 9px/1.45 var(--font-body); }
.digital-scale { margin: 13px auto 0; filter: drop-shadow(0 10px 13px rgba(72,40,15,.19)); }
.scale-tray {
  min-height: 141px; padding: 11px; position: relative; display: grid; place-items: center; border: 5px solid #9ca5a6;
  border-bottom-width: 9px; border-radius: 24px 24px 15px 15px; background: linear-gradient(160deg, #f9ffff, #d6dddd 55%, #b8c0c1);
  box-shadow: inset 0 5px 9px rgba(255,255,255,.85), inset 0 -6px 10px rgba(74,86,87,.18);
}
.scale-tray::before { content: ""; position: absolute; inset: 10px; border: 1px dashed rgba(49,62,62,.22); border-radius: 14px; pointer-events: none; }
.scale-empty { display: grid; gap: 3px; color: #778081; text-align: center; pointer-events: none; }
.scale-empty b { font-size: 18px; }
.scale-empty span { font: 10px var(--font-body); }
.scale-selected { width: 100%; min-height: 108px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; }
.scale-console {
  width: 88%; min-height: 88px; margin: -2px auto 0; padding: 12px 14px; display: grid; grid-template-columns: 1.2fr .8fr; gap: 13px;
  border: 5px solid #35312b; border-radius: 4px 4px 19px 19px; background: linear-gradient(#5d554b, #3f3a34);
}
.scale-screen { min-width: 0; padding: 6px 9px; display: grid; grid-template-columns: 1fr auto; align-items: center; border: 3px inset #756d51; border-radius: 7px; background: #d7ed65; color: #263310; box-shadow: inset 0 0 12px rgba(37,62,12,.24); }
.scale-screen span { font: 7px monospace; letter-spacing: .14em; }
.scale-screen b { grid-row: 1 / 3; grid-column: 2; font: 900 22px/1 monospace; }
.scale-screen i { font: normal 8px var(--font-body); }
.scale-keys { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; }
.scale-keys i { min-height: 20px; border-radius: 4px; background: #eee5d6; box-shadow: inset 0 -3px rgba(63,50,36,.2); }
.scale-keys i:nth-child(3n) { background: var(--yellow); }
.digital-scale.loaded .scale-screen { animation: screenBlink .22s ease; }
.scale-basket {
  min-height: 220px; margin-top: 29px; padding: 11px 9px 14px; position: relative; isolation: isolate;
  border: 5px solid #cf2c1e; border-radius: 16px 16px 27px 27px; color: #fff;
  background: linear-gradient(160deg, #f35036 0%, #df3425 55%, #bd251a 100%);
  box-shadow: inset 0 4px rgba(255,255,255,.2), inset 0 -8px rgba(105,19,13,.18), 0 11px 22px rgba(87,33,18,.23);
}
.scale-basket::before {
  content: ""; position: absolute; z-index: -1; left: 15%; right: 15%; top: -25px; height: 35px;
  border: 7px solid #b92218; border-bottom: 0; border-radius: 30px 30px 0 0; background: transparent;
}
.scale-basket::after {
  content: ""; position: absolute; z-index: -1; inset: 42px 8px 9px; border-radius: 11px 11px 18px 18px; opacity: .2;
  background: repeating-linear-gradient(90deg, transparent 0 28px, #6f130e 28px 35px), repeating-linear-gradient(0deg, transparent 0 34px, #6f130e 34px 41px);
  pointer-events: none;
}
.scale-basket-head { min-height: 28px; padding: 1px 5px 8px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.scale-basket-head b { font-size: 12px; letter-spacing: .06em; }
.scale-basket-head span { padding: 4px 7px; border-radius: 999px; color: #8d1e16; background: #ffe46d; font-size: 9px; font-weight: 900; }
.scale-desk { min-height: 190px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); align-items: start; gap: 7px; }
.scale-product {
  min-width: 0; min-height: 0; padding: 5px 5px 6px; position: relative; z-index: 1; display: grid; grid-template-rows: auto auto auto; gap: 3px; align-content: start;
  border: 2px solid #ead8b8; border-radius: 14px; color: var(--ink); background: #fffdf8; box-shadow: 0 5px 11px rgba(68,35,12,.2);
  cursor: grab; touch-action: none; user-select: none; transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease, border-color .18s ease;
}
.scale-product:active { cursor: grabbing; }
.scale-product-photo { width: 100%; aspect-ratio: .94; padding: 2px; display: grid; place-items: center; min-width: 0; overflow: hidden; border-radius: 9px; background: #fff; }
.scale-product img { width: 100%; height: 100%; display: block; object-fit: contain; object-position: center; pointer-events: none; }
.scale-product b { min-width: 0; max-height: 29px; overflow: hidden; font-size: 9px; line-height: 1.35; }
.scale-product small { color: var(--muted); font: 7px var(--font-body); }
.scale-zoom { position: absolute; right: 4px; top: 4px; min-height: 25px; padding: 3px 6px; border: 1px solid rgba(49,38,25,.16); border-radius: 999px; color: var(--ink); background: rgba(255,255,255,.94); box-shadow: 0 3px 8px rgba(45,25,11,.15); font-size: 8px; font-weight: 900; cursor: zoom-in; touch-action: manipulation; }
.scale-product.dragging { z-index: 90; transform: translate(var(--drag-x), var(--drag-y)) rotate(2deg) scale(1.04); opacity: .9; box-shadow: 0 16px 25px rgba(45,22,8,.32); }
.scale-product.on-scale { width: min(23%, 82px); min-height: 88px; padding: 4px; grid-template-rows: auto auto; border-color: #98a09f; box-shadow: 0 4px 8px rgba(35,45,45,.18); }
.scale-product.on-scale small { display: none; }
.scale-product.on-scale b { font-size: 8px; line-height: 1.2; }
.scale-product.on-scale .scale-zoom { display: none; }
.scale-product.answer-right { border-color: var(--green); box-shadow: 0 0 0 3px rgba(86,179,107,.25); }
.scale-product.answer-wrong { border-color: var(--red); box-shadow: 0 0 0 3px rgba(242,59,38,.23); }
.scale-product.answer-missed { border-color: #e89920; box-shadow: 0 0 0 3px rgba(255,216,47,.42); animation: hintPulsePlain .65s ease 2; }
.scale-feedback { min-height: 0; margin-top: 0; overflow: hidden; display: grid; gap: 3px; border-radius: 12px; font-size: 10px; transition: .2s ease; }
.scale-feedback.correct, .scale-feedback.wrong { min-height: 56px; margin-top: 10px; padding: 9px 11px; }
.scale-feedback.correct { color: #245f31; background: #dff3e3; }
.scale-feedback.wrong { color: #8b281e; background: #ffe0da; }
.scale-feedback b { font-size: 12px; }
.scale-feedback span { font: 9px/1.45 var(--font-body); }
.scale-submit { width: 100%; min-height: 50px; margin-top: 10px; border: 0; border-radius: 14px; background: var(--red); color: #fff; box-shadow: 0 6px 0 var(--red-dark); font-weight: 950; font-size: 15px; cursor: pointer; }
.scale-submit:active { transform: translateY(3px); box-shadow: 0 3px 0 var(--red-dark); }
.scale-submit:disabled { opacity: .56; cursor: wait; }
.scale-review-card { margin-top: 7px; padding: 8px; display: grid; grid-template-columns: 112px 1fr; gap: 9px; align-items: center; border: 1px solid #ead8b8; border-radius: 12px; background: #fff; }
.scale-review-card > div { display: flex; overflow: hidden; }
.scale-review-card img { width: 57px; height: 57px; margin-right: -7px; object-fit: contain; border: 2px solid #fff; border-radius: 9px; background: #fff; }
.scale-review-card p { margin: 0; display: grid; gap: 4px; }
.scale-review-card b { color: var(--red-dark); font-size: 10px; }
.scale-review-card span { color: #675343; font: 9px/1.4 var(--font-body); }
.scale-preview-card { padding-top: 30px; text-align: center; }
.scale-preview-card > img { display: block; width: min(100%, 390px); max-height: 62dvh; margin: 8px auto 13px; object-fit: contain; border-radius: 18px; background: #fff; box-shadow: inset 0 0 0 1px #ead8b8, 0 10px 22px rgba(57,30,11,.12); }
.scale-preview-card h2 { margin: 0; font-size: 19px; line-height: 1.35; }
.scale-preview-card > p:last-child { margin: 8px 8px 2px; color: var(--muted); font: 10px/1.55 var(--font-body); }

.powerups { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 2px 0; position: relative; z-index: 2; }
.power-button {
  border: 1px solid rgba(101,65,34,.11); border-radius: 14px; padding: 8px 6px;
  background: rgba(255,255,255,.76); color: var(--ink); display: grid; grid-template-columns: 28px auto; grid-template-rows: auto auto;
  text-align: left; column-gap: 5px; box-shadow: 0 5px 14px rgba(69,41,17,.08); cursor: pointer;
}
.power-button:disabled { opacity: .38; cursor: not-allowed; }
.power-icon { grid-row: 1 / 3; align-self: center; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: #f2e4c7; font-size: 18px; font-weight: 900; }
.power-button b { font-size: 11px; }
.power-button small { color: var(--muted); font-size: 9px; }
.primary-power { background: var(--yellow); }
.primary-power .power-icon { background: #fff7ce; }

.cart-zone {
  position: fixed; z-index: 20; left: 50%; bottom: calc(9px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: min(calc(100% - 20px), 520px); filter: drop-shadow(0 10px 16px rgba(78,35,18,.27));
}
.cart-handle { position: absolute; right: 10px; top: 13px; width: 62px; height: 29px; border: 8px solid var(--red-dark); border-left: 0; border-radius: 0 20px 0 0; z-index: -1; }
.cart-title { width: calc(100% - 42px); height: 30px; display: flex; align-items: center; gap: 8px; background: var(--red-dark); color: white; padding: 5px 13px; border-radius: 10px 10px 0 0; }
.cart-title span { font-size: 12px; font-weight: 900; }
.cart-title em { font: normal 9px var(--font-body); opacity: .72; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cart-body { padding: 9px 10px 13px; border-radius: 0 10px 18px 18px; background: linear-gradient(160deg, #f85638, #e72c1d); border: 3px solid #fff; border-top: 0; box-shadow: inset 0 -6px rgba(141,20,11,.25); }
.cart-body::after { content: ""; position: absolute; inset: 38px 18px 18px; border-radius: 8px; opacity: .15; background: repeating-linear-gradient(90deg, transparent 0 22px, white 22px 25px); pointer-events: none; }
.cart-slots { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(var(--capacity, 7), 1fr); gap: 5px; }
.cart-slot { aspect-ratio: .8; min-width: 0; border: 2px dashed rgba(255,255,255,.48); border-radius: 8px; display: grid; place-items: center; background: rgba(122,15,11,.18); position: relative; }
.cart-slot::before { content: attr(data-index); color: rgba(255,255,255,.34); font-size: 10px; font-weight: 900; }
.cart-item { position: absolute; inset: 2px; border-radius: 6px; background: #fff; overflow: hidden; animation: cartIn .26s cubic-bezier(.2,.8,.2,1.25); box-shadow: 0 3px 7px rgba(49,20,10,.25); }
.cart-item img { width: 100%; height: 72%; object-fit: cover; display: block; }
.cart-item b { position: absolute; bottom: 2px; left: 2px; right: 2px; color: var(--red); font-size: clamp(8px,2.1vw,11px); text-align: center; }
.visual-match-mode .cart-slots { gap: 0; padding-inline: 3px; }
.visual-match-mode .cart-slot { aspect-ratio: .72; border: 0; border-radius: 0; background: transparent; overflow: visible; }
.visual-match-mode .cart-slot::before {
  content: ""; position: absolute; left: 50%; bottom: 1px; width: 4px; height: 4px; border-radius: 50%;
  background: rgba(255,255,255,.26); transform: translateX(-50%);
}
.cart-item.visual-cart-item {
  inset: -9px -8px -5px; z-index: 2; border-radius: 0; background: transparent; overflow: visible; box-shadow: none;
  transform: translateY(var(--cart-lift, 0)) rotate(var(--cart-tilt, 0)); transform-origin: 50% 78%;
  animation: realDrop .34s cubic-bezier(.16,.9,.26,1.2);
}
.cart-item.visual-cart-item img {
  width: 100%; height: 100%; object-fit: contain; background: transparent;
  filter: drop-shadow(0 5px 3px rgba(63,21,12,.4)) drop-shadow(0 1px 1px rgba(63,21,12,.28));
}
.cart-item.visual-cart-item.cutout-wide img { transform: scale(1.2); }
.visual-match-mode .cart-item.visual-cart-item.matching { animation: cutoutMatchPop .44s ease forwards; }
.cart-item.matching { animation: matchPop .44s ease forwards; }
.cart-wheels { display: flex; justify-content: space-between; padding: 0 42px; margin-top: -5px; }
.cart-wheels i { width: 22px; height: 22px; border: 6px solid var(--ink); border-radius: 50%; background: var(--yellow); }
.cart-zone.danger { animation: cartShake .32s ease; }
.cart-zone.danger .cart-body { background: #9e251d; }

.modal { position: fixed; z-index: 100; inset: 0; padding: 20px; display: grid; place-items: center; background: rgba(45,28,15,.72); backdrop-filter: blur(9px); opacity: 0; pointer-events: none; transition: opacity .28s ease; }
.modal.show { opacity: 1; pointer-events: auto; }
.modal-card { width: min(100%, 430px); max-height: 92dvh; overflow: auto; position: relative; border-radius: 28px; padding: 26px 22px 22px; background: var(--cream); box-shadow: 0 25px 60px rgba(28,14,7,.38), inset 0 0 0 2px rgba(255,255,255,.7); transform: translateY(22px) scale(.96); transition: transform .33s cubic-bezier(.2,.8,.2,1); }
.modal.show .modal-card { transform: translateY(0) scale(1); }
.start-card { text-align: center; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.start-card::before { content: ""; position: absolute; width: 240px; height: 240px; right: -130px; top: -120px; background: var(--yellow); border-radius: 50%; opacity: .65; }
.start-meta { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.receipt-tag { display: inline-block; padding: 6px 10px; background: var(--ink); color: white; font-size: 9px; letter-spacing: .12em; transform: rotate(-2deg); }
.visible-credit { display: grid; gap: 1px; padding: 4px 6px; border: 1px solid rgba(196,45,31,.38); border-radius: 8px; color: var(--red-dark); background: rgba(255,255,255,.72); text-align: right; }
.visible-credit b { font: 900 10px/1.25 var(--font-body); white-space: nowrap; }
.visible-credit span { color: #8b7763; font: 7px/1.25 var(--font-body); letter-spacing: .04em; }
.hero-cart { height: 116px; width: 250px; position: relative; margin: 17px auto -1px; }
.hero-basket { position: absolute; left: 37px; right: 25px; bottom: 12px; height: 63px; background: var(--red); border: 6px solid var(--red-dark); border-radius: 9px 9px 22px 22px; transform: skewX(-8deg); box-shadow: inset 0 -12px rgba(144,25,16,.25); }
.hero-basket::before { content: ""; position: absolute; inset: 9px 14px; opacity: .35; background: repeating-linear-gradient(90deg, transparent 0 18px, white 18px 22px); }
.hero-basket::after { content: ""; position: absolute; right: -34px; top: -30px; width: 43px; height: 31px; border: 7px solid var(--red-dark); border-left: 0; border-bottom: 0; border-radius: 0 18px 0 0; }
.hero-pack { position: absolute; z-index: 2; width: 55px; height: 68px; display: grid; place-items: center; border: 4px solid white; border-radius: 12px; font-weight: 950; box-shadow: 0 5px 10px rgba(69,30,14,.2); }
.pack-a { left: 57px; top: 3px; background: var(--yellow); transform: rotate(-12deg); }
.pack-b { left: 109px; top: 0; color: white; background: var(--red); transform: rotate(4deg); }
.pack-c { right: 45px; top: 9px; background: #fff; transform: rotate(13deg); }
.eyebrow { color: var(--red); text-transform: uppercase; font-size: 10px; font-weight: 900; letter-spacing: .18em; margin: 8px 0; }
.start-card h1 { margin: 0; font-size: clamp(44px, 13vw, 62px); line-height: .87; letter-spacing: -.07em; }
.start-card h1 span { display: inline-block; color: var(--red); transform: translateX(10px) rotate(-2deg); text-shadow: 3px 4px 0 var(--yellow); }
.intro { margin: 18px auto 14px; max-width: 320px; color: #6f5a47; font: 14px/1.65 var(--font-body); }
.intro strong { color: var(--red-dark); font-family: var(--font-display); }
.campaign-heading { display: flex; align-items: center; justify-content: space-between; margin: 13px 2px 9px; text-align: left; }
.campaign-heading strong { font-size: 12px; }
.campaign-heading span { color: var(--muted); font: 9px var(--font-body); }
.level-path { display: grid; gap: 0; }
.level-card {
  width: 100%; min-height: 67px; padding: 9px 10px; border: 2px solid #ead8b8; border-radius: 15px;
  display: grid; grid-template-columns: 52px minmax(0,1fr) auto; align-items: center; gap: 10px;
  color: var(--ink); background: rgba(255,255,255,.84); text-align: left; cursor: pointer; transition: .2s ease;
}
.level-card.active { border-color: var(--red); background: #fff0d6; box-shadow: inset 0 0 0 2px #fff, 0 5px 13px rgba(126,45,25,.1); }
.level-card:disabled { cursor: not-allowed; }
.level-card em { display: grid; place-items: center; min-height: 40px; border-radius: 11px; background: var(--red); color: #fff; font-style: normal; font-size: 11px; font-weight: 950; }
.level-card > span { min-width: 0; display: grid; gap: 4px; }
.level-card > span b { font-size: 14px; }
.level-card > span small { color: var(--muted); font: 9px var(--font-body); }
.level-card > i { padding: 4px 7px; border-radius: 999px; background: #f4e6cc; color: #7b6856; font-style: normal; font-size: 8px; font-weight: 900; white-space: nowrap; }
.level-card.completed > i { background: #daf1dd; color: #31723d; }
.level-card.locked { opacity: .58; filter: grayscale(.45); }
.level-card.locked em { background: #8f8174; }
.level-connector { height: 25px; display: flex; align-items: center; justify-content: center; gap: 7px; color: #a18a72; }
.level-connector span { width: 2px; height: 18px; background: repeating-linear-gradient(to bottom, #cdb89b 0 4px, transparent 4px 7px); }
.level-connector b { font: 8px var(--font-body); }
.campaign-complete { margin-top: 9px; padding: 9px; border-radius: 12px; background: #daf1dd; color: #276b35; font-size: 13px; font-weight: 950; }
.practice-panel { margin-top: 11px; border: 1px dashed #d6be99; border-radius: 14px; background: rgba(255,255,255,.55); text-align: left; }
.practice-panel summary { padding: 10px 12px; cursor: pointer; font-size: 11px; font-weight: 950; list-style: none; }
.practice-panel summary::-webkit-details-marker { display: none; }
.practice-panel summary::after { content: "+"; float: right; color: var(--red); font-size: 16px; line-height: .7; }
.practice-panel[open] summary::after { content: "−"; }
.practice-panel summary span { margin-left: 5px; color: var(--muted); font: 8px var(--font-body); }
.practice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; padding: 0 9px 8px; }
.practice-option { min-height: 52px; padding: 7px; border: 1px solid #e0c9a7; border-radius: 11px; display: grid; place-items: center; gap: 3px; background: #fff; color: var(--ink); cursor: pointer; }
.practice-option.active { border: 2px solid var(--red); background: #fff0d6; }
.practice-option b { font-size: 10px; }
.practice-option span { color: var(--muted); font: 8px var(--font-body); }
.practice-panel .rule-grid { padding: 0 9px 9px; margin: 0; }
.mode-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.mode-option.featured { grid-column: 1 / -1; min-height: 58px; }
.developer-credit { margin-top: 12px; padding-top: 10px; border-top: 1px dashed rgba(89,63,39,.2); display: grid; gap: 2px; color: #806c58; text-align: center; }
.developer-credit span { font: 800 10px/1.5 var(--font-body); letter-spacing: .04em; }
.developer-credit i { color: #a08e7c; font: normal 8px/1.5 var(--font-body); letter-spacing: .08em; }
.mode-option {
  position: relative; min-height: 66px; padding: 10px 7px; border: 2px solid #ead8b8; border-radius: 13px;
  color: var(--ink); background: rgba(255,255,255,.82); cursor: pointer; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px; transition: .2s ease;
}
.mode-option.active { border-color: var(--red); background: #fff0d6; box-shadow: inset 0 0 0 2px #fff; transform: translateY(-2px); }
.mode-option i { position: absolute; right: -4px; top: -8px; padding: 3px 6px; border-radius: 7px 7px 7px 2px; background: var(--red); color: white; font-style: normal; font-size: 8px; font-weight: 900; transform: rotate(4deg); }
.mode-option b { font-size: 12px; }
.mode-option span { color: var(--muted); font: 9px var(--font-body); }
.rule-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; margin: 12px 0 18px; }
.rule-grid div { background: #fff; border: 1px solid #ead8b8; padding: 9px 5px; border-radius: 12px; display: flex; flex-direction: column; gap: 3px; }
.rule-grid b { font-size: 11px; }
.rule-grid span { color: var(--muted); font: 10px var(--font-body); }
.cta-button { width: 100%; min-height: 52px; border: 0; border-radius: 15px; padding: 13px 18px; display: flex; align-items: center; justify-content: center; gap: 14px; background: var(--red); color: white; box-shadow: 0 7px 0 var(--red-dark); font-weight: 950; font-size: 16px; cursor: pointer; }
.cta-button:active { transform: translateY(4px); box-shadow: 0 3px 0 var(--red-dark); }
.cta-button span { font-size: 22px; }
.start-actions { position: relative; z-index: 4; }
.material-note { display: block; margin-top: 15px; color: #a18c78; font: 9px var(--font-body); }
.gallery-entry { margin-top: 16px; }

.result-card { text-align: center; }
.result-seal { width: 78px; height: 78px; margin: -5px auto 6px; display: grid; place-items: center; border: 6px double var(--red); border-radius: 50%; color: var(--red); font: 900 23px var(--font-body); transform: rotate(-8deg); }
.result-card h2, .catalog-card h2 { margin: 4px 0 16px; font-size: 27px; }
.result-score { display: grid; grid-template-columns: repeat(3,1fr); border: 1px solid #ead8b8; border-radius: 15px; background: #fff; overflow: hidden; }
.result-score div { padding: 10px 4px; display: flex; flex-direction: column; gap: 5px; }
.result-score div + div { border-left: 1px dashed #e1ccb0; }
.result-score span { color: var(--muted); font-size: 9px; }
.result-score b { font-size: 15px; }
.memory-review { margin: 14px 0 16px; text-align: left; }
.review-title { font-size: 11px; color: var(--muted); margin-bottom: 7px; }
.review-pair { display: flex; align-items: center; gap: 8px; background: #fff2ce; border-radius: 10px; padding: 8px 10px; margin-top: 6px; font-size: 11px; }
.review-pair b { color: var(--red); margin-left: auto; white-space: nowrap; }
.visual-memory-card { display: grid; grid-template-columns: 78px 1fr; gap: 9px; align-items: center; margin-top: 7px; padding: 7px; border-radius: 12px; background: white; border: 1px solid #ead8b8; }
.visual-memory-card img { width: 78px; height: 72px; border-radius: 8px; object-fit: contain; background: #ede4d4; }
.visual-memory-card div { min-width: 0; display: grid; gap: 3px; }
.visual-memory-card b { color: var(--red-dark); font-size: 10px; }
.visual-memory-card span { color: #675343; font: 9px/1.45 var(--font-body); }
.text-button { margin-top: 15px; border: 0; background: none; color: var(--red-dark); font-size: 12px; font-weight: 800; text-decoration: underline; cursor: pointer; }
.result-card .text-button + .text-button { margin-left: 8px; color: #675343; }
.result-card.failed .result-seal { color: #776859; border-color: #776859; }
.feedback-entry { width: 100%; min-height: 48px; margin-top: 17px; padding: 11px 15px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 2px solid var(--red); border-radius: 14px; background: #fff; color: var(--red-dark); font: 900 13px var(--font-body); cursor: pointer; }
.feedback-entry span { font-size: 17px; }
.feedback-entry:disabled { border-color: #d7c9ac; color: #8f8371; background: #f6f0e3; cursor: default; }
.feedback-entry[hidden] { display: none; }
.feedback-entry-home { margin-top: 8px; }
.feedback-modal { z-index: 230; }
.feedback-card { padding: 27px 22px 23px; }
.feedback-card h2 { margin: 3px 0 8px; font-size: 28px; }
.feedback-intro { margin: 0 0 17px; color: #675343; font: 13px/1.7 var(--font-body); }
.feedback-card form { display: grid; }
.feedback-card label { margin-bottom: 7px; font: 900 12px var(--font-body); }
.feedback-card textarea { width: 100%; min-height: 140px; resize: vertical; padding: 13px; border: 2px solid #dec8a5; border-radius: 13px; outline: none; background: #fff; color: var(--ink); font: 15px/1.55 var(--font-body); }
.feedback-card textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px #ef3d2720; }
.feedback-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 7px; color: var(--muted); font: 10px/1.4 var(--font-body); }
.feedback-meta span:last-child { flex: 0 0 auto; }
.feedback-status { min-height: 20px; margin: 10px 0 5px; color: #b52b20; font: 12px/1.5 var(--font-body); }
.feedback-status.success { color: #237344; }
.feedback-card .cta-button:disabled { opacity: .6; cursor: wait; }

.catalog-card { padding-top: 29px; }
.catalog-card .eyebrow, .catalog-card h2 { text-align: center; }
.modal-close { position: absolute; right: 14px; top: 13px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: #efe0c3; color: var(--ink); font-size: 24px; line-height: 1; cursor: pointer; }
.catalog-list { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.catalog-item { position: relative; background: white; border: 1px solid #ead8b8; border-radius: 12px; overflow: hidden; }
.catalog-item img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.catalog-item div { padding: 6px; }
.catalog-item span { display: block; height: 28px; overflow: hidden; font-size: 9px; line-height: 1.45; }
.catalog-item b { color: var(--red); font-size: 14px; }
.confusion-card { width: min(100%, 760px); padding: 28px 18px 22px; }
.confusion-card .eyebrow, .confusion-card h2, .confusion-intro { text-align: center; }
.confusion-card h2 { margin: 4px 0 8px; font-size: 26px; }
.confusion-intro { max-width: 520px; margin: 0 auto 15px; color: var(--muted); font: 12px/1.65 var(--font-body); }
.confusion-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
.confusion-group { overflow: hidden; border-radius: 13px; background: #fff; border: 1px solid #ead8b8; box-shadow: 0 5px 12px rgba(77,45,20,.08); }
.confusion-group img { display: block; width: 100%; aspect-ratio: 3/4; object-fit: contain; background: #ede4d4; }
.confusion-group div { display: flex; align-items: center; gap: 7px; padding: 7px 8px; }
.confusion-group i { flex: 0 0 auto; display: grid; place-items: center; width: 25px; height: 25px; border-radius: 8px; background: var(--yellow); color: var(--ink); font-style: normal; font-size: 9px; font-weight: 950; }
.confusion-group b { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 10px; }
.confusion-review { margin-top: 10px; padding: 8px; border-radius: 12px; background: #fff; border: 1px solid #ead8b8; }
.confusion-review img { width: 100%; aspect-ratio: 16/7; object-fit: cover; border-radius: 8px; display: block; }
.confusion-review p { margin: 7px 3px 2px; color: #665242; font: 10px/1.5 var(--font-body); }

.toast { position: fixed; z-index: 200; top: calc(18px + env(safe-area-inset-top)); left: 50%; transform: translate(-50%,-20px); width: min(calc(100% - 32px), 440px); padding: 11px 14px; border-radius: 12px; background: var(--ink); color: white; text-align: center; white-space: pre-line; font-size: 12px; line-height: 1.55; box-shadow: 0 10px 24px rgba(40,20,9,.28); opacity: 0; pointer-events: none; transition: .25s ease; }
.toast.show { opacity: 1; transform: translate(-50%,0); }
.toast.warning { background: #a9281f; }
.confetti-layer { position: fixed; z-index: 220; inset: 0; pointer-events: none; overflow: hidden; }
.confetti { position: absolute; top: -20px; width: 9px; height: 16px; animation: confettiFall 1.7s linear forwards; }

@keyframes hintPulse { 50% { transform: translate(-50%,-50%) rotate(var(--tilt)) scale(1.1); box-shadow: 0 0 0 6px rgba(255,216,47,.34), 0 8px 20px rgba(83,49,15,.25); } }
@keyframes flyOut { to { opacity: 0; transform: translate(-50%,40vh) rotate(12deg) scale(.35); } }
@keyframes cartIn { from { transform: translateY(-28px) scale(.7); opacity: 0; } }
@keyframes realDrop {
  from { transform: translateY(-66px) rotate(0deg) scale(.72); opacity: 0; }
  72% { transform: translateY(5px) rotate(var(--cart-tilt, 0deg)) scale(1.08); opacity: 1; }
  to { transform: translateY(var(--cart-lift, 0)) rotate(var(--cart-tilt, 0deg)) scale(1); opacity: 1; }
}
@keyframes matchPop { 45% { transform: scale(1.17); filter: brightness(1.25); } to { transform: scale(.15) rotate(12deg); opacity: 0; } }
@keyframes cutoutMatchPop {
  45% { transform: translateY(var(--cart-lift, 0)) rotate(var(--cart-tilt, 0deg)) scale(1.22); filter: brightness(1.25); }
  to { transform: translateY(-28px) rotate(18deg) scale(.08); opacity: 0; }
}
@keyframes cartShake { 25% { transform: translateX(calc(-50% - 6px)); } 75% { transform: translateX(calc(-50% + 6px)); } }
@keyframes confettiFall { to { transform: translate3d(var(--drift), 105vh, 0) rotate(720deg); } }
@keyframes screenBlink { 50% { filter: brightness(1.25); } }
@keyframes hintPulsePlain { 50% { transform: scale(1.035); } }

@media (min-width: 700px) {
  .app-shell { padding-bottom: 188px; }
  .board { height: 360px; }
  .game-stage { min-height: 447px; }
  .product-tile { width: 21%; }
  .confusion-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .scale-desk { grid-template-columns: repeat(4, minmax(0,1fr)); }
}

@media (max-width: 520px) {
  .app-shell { padding: max(10px, env(safe-area-inset-top)) 10px calc(168px + env(safe-area-inset-bottom)); }
  .topbar { padding: 0 3px; }
  .score-strip { margin: 11px 0 9px; }
  .score-item { padding: 8px 5px; }
  .mission-banner { padding: 9px 10px; gap: 8px; }
  .mission-banner p span { font-size: 10px; }
  .rule-chip { padding: 5px 7px; font-size: 9px; }
  .game-stage { margin-top: 11px; min-height: 408px; }
  .board { height: 322px; }
  .visual-match-mode .product-tile { width: 26.5%; aspect-ratio: .76; }
  .photo-mark { left: 3px; bottom: 3px; font-size: 6px; }
  .powerups { gap: 7px; margin-top: 10px; }
  .power-button { padding: 7px 4px; }
  .cart-zone { width: calc(100% - 12px); bottom: calc(6px + env(safe-area-inset-bottom)); }
  .cart-title { width: calc(100% - 36px); padding-inline: 10px; }
  .cart-title em { font-size: 8px; }
  .cart-body { padding: 8px 8px 11px; }
  .cart-slots { gap: 4px; }
  .toast { top: calc(9px + env(safe-area-inset-top)); font-size: 11px; }
  .scale-stage { margin-top: 11px; padding: 10px; border-radius: 20px; }
  .scale-tray { min-height: 128px; }
  .scale-selected { min-height: 95px; }
  .scale-console { width: 92%; min-height: 82px; padding: 10px 11px; }
  .scale-basket { min-height: 210px; margin-top: 27px; padding: 9px 7px 12px; }
  .scale-desk { min-height: 178px; gap: 6px; }
  .scale-product { min-height: 0; grid-template-rows: auto auto auto; padding: 5px; }
  .scale-product-photo { aspect-ratio: .94; }
  .scale-product.on-scale { min-height: 82px; grid-template-rows: auto auto; }
  .scale-preview-card > img { max-height: 58dvh; }

  /* 手机欢迎页：压缩首屏，并把主操作固定在 Netlify 浮标和浏览器底栏上方。 */
  #startModal { padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); place-items: start center; }
  .start-card {
    max-height: calc(100dvh - 16px - env(safe-area-inset-bottom));
    border-radius: 22px;
    padding: 16px 14px calc(104px + env(safe-area-inset-bottom));
  }
  .start-card::before { width: 190px; height: 190px; right: -108px; top: -104px; }
  .start-meta { align-items: flex-start; }
  .receipt-tag { padding: 5px 9px; font-size: 8px; }
  .visible-credit { padding: 3px 5px; }
  .visible-credit b { font-size: 9px; }
  .visible-credit span { font-size: 7px; }
  .hero-cart { height: 78px; margin: 4px auto -2px; transform: scale(.72); transform-origin: center bottom; }
  .eyebrow { margin: 4px 0; font-size: 9px; }
  .start-card h1 { font-size: clamp(39px, 11.5vw, 49px); line-height: .84; }
  .intro { margin: 8px auto 7px; font-size: 11px; line-height: 1.45; }
  .campaign-heading { margin: 8px 2px 6px; }
  .level-card { min-height: 56px; grid-template-columns: 46px minmax(0,1fr) auto; gap: 7px; padding: 7px 8px; }
  .level-card em { min-height: 36px; font-size: 10px; }
  .level-card > span b { font-size: 12px; }
  .level-card > span small { font-size: 8px; }
  .level-card > i { padding: 4px 6px; font-size: 7px; }
  .level-connector { height: 19px; }
  .level-connector span { height: 13px; }
  .practice-panel { margin-top: 8px; }
  .practice-panel summary { padding: 8px 10px; }
  .mode-picker { gap: 7px; margin: 9px 0 7px; }
  .mode-option { min-height: 58px; padding-block: 8px; }
  .mode-option.featured { min-height: 52px; }
  .rule-grid { gap: 5px; margin: 8px 0 10px; }
  .rule-grid div { padding: 7px 3px; }
  .rule-grid b { font-size: 10px; }
  .rule-grid span { font-size: 9px; }
  .start-actions {
    position: fixed;
    z-index: 180;
    left: 50%;
    bottom: calc(78px + env(safe-area-inset-bottom));
    width: min(calc(100% - 36px), 402px);
    padding: 7px;
    border-radius: 19px;
    background: rgba(255,248,222,.94);
    box-shadow: 0 10px 28px rgba(45,28,15,.26), inset 0 0 0 1px rgba(255,255,255,.75);
    backdrop-filter: blur(12px);
    transform: translateX(-50%);
  }
  .start-actions .cta-button { min-height: 50px; box-shadow: 0 5px 0 var(--red-dark); }
  .gallery-entry { margin-top: 10px; }
  .material-note { margin-top: 11px; }
  .developer-credit { margin-top: 9px; padding-top: 8px; }
  .feedback-modal { padding: 10px; align-items: start; }
  .feedback-card { max-height: calc(100dvh - 20px - env(safe-area-inset-bottom)); padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  .feedback-entry { font-size: 12px; }
}

@media (max-height: 760px) {
  .game-stage { min-height: 372px; }
  .board { height: 285px; }
  .score-strip { margin-top: 10px; }
}

@media (max-width: 520px) and (max-height: 760px) {
  .game-stage { min-height: 390px; }
  .board { height: 304px; }
  .hero-cart { height: 61px; margin-top: 0; transform: scale(.6); }
  .intro { margin-block: 7px; line-height: 1.42; }
  .campaign-heading { margin-block: 5px; }
  .level-card { min-height: 50px; }
  .level-card em { min-height: 32px; }
  .level-connector { height: 15px; }
  .practice-panel { margin-top: 6px; }
  .mode-picker { margin-block: 7px 5px; }
  .mode-option { min-height: 52px; }
  .rule-grid { margin-block: 6px 8px; }
  .start-actions { bottom: calc(70px + env(safe-area-inset-bottom)); }
}

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