:root {
  --orange: #FF8A3D;
  --orange-light: #FFB066;
  --amber: #FFD39B;
  --cream: #F7E8D4;
  --muted: rgba(247, 232, 212, .6);
  --faint: rgba(247, 232, 212, .34);
  --glass: rgba(8, 24, 26, .72);
  --line: rgba(255, 170, 100, .22);
  --board-size: min(calc(100vw - 40px), 360px, calc(100vh - 350px));
}

@supports (height: 100dvh) {
  :root {
    --board-size: min(calc(100vw - 40px), 360px, calc(100dvh - 350px));
  }
}

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

html, body {
  margin: 0;
  min-height: 100%;
  background: #061315;
  color: var(--cream);
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  overflow: hidden;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
}

#app {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

/* ---------- 场景 ---------- */
.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: #061315;
}

.scene-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.scene-flash {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: radial-gradient(ellipse at 50% 26%, rgba(202, 244, 255, .22), rgba(120, 206, 214, .04) 42%, transparent 68%);
}

.scene-flash.flash {
  animation: lightning 1.15s ease-out;
}

@keyframes lightning {
  0% { opacity: 0; }
  8% { opacity: .9; }
  16% { opacity: .12; }
  24% { opacity: .55; }
  100% { opacity: 0; }
}

.rain-line {
  animation: rainFall var(--d, 1.2s) linear infinite;
  animation-delay: var(--delay, 0s);
  will-change: transform, opacity;
}

@keyframes rainFall {
  0% { transform: translateY(-40px); opacity: 0; }
  12% { opacity: .75; }
  78% { opacity: .5; }
  100% { transform: translateY(120px); opacity: 0; }
}

.lamp {
  transform-origin: 36px 0px;
  animation: lampSway 8s ease-in-out infinite alternate;
}

.lamp-right {
  transform-origin: 354px 0px;
  animation-duration: 10.5s;
  animation-delay: -2s;
}

@keyframes lampSway {
  from { transform: rotate(-.7deg); }
  to { transform: rotate(.7deg); }
}

.dust {
  animation: dustDrift 11s ease-in-out infinite alternate;
}

@keyframes dustDrift {
  from { transform: translate3d(0, 0, 0); opacity: .28; }
  to { transform: translate3d(10px, -16px, 0); opacity: .5; }
}

.steam path {
  animation: steamRise 4.2s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: bottom center;
}

.steam path:nth-child(2) { animation-delay: 1.1s; }
.steam path:nth-child(3) { animation-delay: 2.2s; }

@keyframes steamRise {
  0% { opacity: 0; transform: translateY(7px) scaleY(.7); }
  28% { opacity: .75; }
  100% { opacity: 0; transform: translateY(-14px) scaleY(1.2); }
}

.cat {
  transform-box: fill-box;
  transform-origin: 72% 100%;
  animation: catBreathe 5.6s ease-in-out infinite;
}

@keyframes catBreathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.014); }
}

/* ---------- 主布局 ---------- */
.stage {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 460px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 16px calc(env(safe-area-inset-bottom, 0px) + 18px);
  display: flex;
  flex-direction: column;
}

.hud {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.night-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(19, 42, 42, .88), rgba(8, 23, 25, .92));
  border: 1px solid rgba(255, 184, 122, .22);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .34), inset 0 1px 0 rgba(255, 224, 190, .1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 12.5px;
  letter-spacing: .1em;
  color: rgba(247, 232, 212, .84);
}

.night-badge .mp-icon {
  width: 15px;
  height: 15px;
  color: var(--orange-light);
  filter: drop-shadow(0 0 5px rgba(255, 138, 61, .55));
}

.night-badge b {
  color: var(--amber);
  font-size: 14px;
  margin: 0 1px;
}

.night-badge em {
  font-style: normal;
  font-size: 10.5px;
  letter-spacing: .04em;
  color: var(--faint);
}

.hud-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.moves-pill {
  display: flex;
  align-items: baseline;
  gap: 5px;
  height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(38, 31, 22, .92), rgba(14, 24, 24, .94));
  border: 1px solid rgba(255, 176, 102, .28);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .34), inset 0 1px 0 rgba(255, 224, 190, .12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color .25s, box-shadow .25s;
}

.moves-pill .mp-icon {
  width: 14px;
  height: 14px;
  align-self: center;
  color: #9fe0e2;
}

.moves-pill b {
  font-size: 18px;
  line-height: 1;
  font-weight: 800;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
  transition: color .25s;
}

.moves-pill span {
  font-size: 10.5px;
  color: rgba(247, 232, 212, .5);
  letter-spacing: .1em;
}

.moves-pill.low {
  border-color: rgba(255, 106, 84, .55);
  box-shadow: 0 0 20px rgba(255, 90, 60, .18), inset 0 1px 0 rgba(255, 224, 190, .12);
}

.moves-pill.low b { color: #ff8b72; }

.moves-pill.pulse {
  animation: pillPulse .4s ease-out;
}

@keyframes pillPulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: rgba(247, 232, 212, .68);
  background: rgba(8, 23, 25, .78);
  border: 1px solid rgba(255, 184, 122, .18);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform .12s, color .2s;
}

.icon-btn .mp-icon { width: 17px; height: 17px; }
.icon-btn:active { transform: scale(.92); }

/* ---------- 订单卡 ---------- */
.order {
  position: relative;
  flex: 0 0 auto;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 21px;
  background:
    radial-gradient(130% 150% at 88% -20%, rgba(255, 138, 61, .2), transparent 48%),
    linear-gradient(158deg, rgba(20, 44, 44, .94), rgba(8, 24, 26, .9));
  border: 1px solid rgba(255, 178, 112, .26);
  box-shadow: 0 16px 38px rgba(0, 0, 0, .34), inset 0 1px 0 rgba(255, 230, 200, .12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  overflow: hidden;
}

.order::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 176, 102, .32), transparent);
}

.order.bump {
  animation: orderBump .5s cubic-bezier(.2, 1.4, .4, 1);
}

@keyframes orderBump {
  0% { transform: scale(1); }
  35% { transform: scale(1.018); border-color: rgba(255, 196, 140, .6); }
  100% { transform: scale(1); }
}

.order-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.order-kicker {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 9.5px;
  letter-spacing: .15em;
  color: rgba(255, 184, 128, .82);
  white-space: nowrap;
}

.order-kicker .mp-icon {
  width: 13px;
  height: 13px;
  opacity: .8;
}

.recipe-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: .06em;
  color: rgba(247, 232, 212, .7);
  background: rgba(255, 180, 114, .08);
  border: 1px solid rgba(255, 180, 114, .18);
  transition: background .2s, transform .12s;
}

.recipe-btn .mp-icon { width: 12px; height: 12px; }
.recipe-btn:active { transform: scale(.94); background: rgba(255, 180, 114, .16); }

.order-row {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 7px;
}

.order-art {
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 186, 120, .24), transparent 68%),
    rgba(5, 17, 18, .56);
  border: 1px solid rgba(255, 186, 124, .24);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, .4), 0 4px 12px rgba(0, 0, 0, .22);
}

.order-art svg {
  width: 82%;
  height: 82%;
  display: block;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .35));
}

.order-name-wrap {
  min-width: 0;
  flex: 1;
}

.order-name {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.2;
  color: #fff2df;
  white-space: nowrap;
}

.order-name b {
  font-family: "Avenir Next", "PingFang SC", sans-serif;
  font-size: 14px;
  color: var(--orange-light);
  letter-spacing: 0;
}

.order-customer {
  margin-top: 3px;
  font-size: 10px;
  letter-spacing: .08em;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-pips {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  padding-left: 4px;
}

.pip {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1px solid rgba(255, 184, 124, .28);
  background: rgba(255, 255, 255, .035);
  position: relative;
  transition: background .25s, box-shadow .25s, border-color .25s;
}

.pip.on {
  border-color: rgba(255, 207, 147, .9);
  background: radial-gradient(circle at 38% 32%, #ffe3b5, var(--orange) 72%);
  box-shadow: 0 0 10px rgba(255, 138, 61, .65);
}

.pip.on::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 4px;
  margin: -2px 0 0 -2px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .85);
}

.order-sub {
  margin: 7px 0 0;
  font-size: 10.5px;
  line-height: 1.55;
  color: rgba(247, 232, 212, .48);
  letter-spacing: .015em;
}

/* ---------- 合成台 ---------- */
.board-area {
  flex: 0 0 auto;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.board-frame {
  position: relative;
  width: calc(100vw - 40px);
  max-width: 360px;
  width: var(--board-size);
  padding: 9px 9px 15px;
  border-radius: 26px;
  background:
    linear-gradient(150deg, rgba(255, 196, 140, .2), transparent 30%),
    repeating-linear-gradient(94deg, rgba(0, 0, 0, .14) 0px, rgba(0, 0, 0, .14) 2px, transparent 2px, transparent 7px),
    linear-gradient(158deg, #5d3929 0%, #372118 46%, #1d110e 100%);
  border: 1px solid rgba(255, 196, 146, .32);
  box-shadow:
    0 24px 48px rgba(0, 0, 0, .5),
    0 4px 0 rgba(10, 5, 4, .55),
    inset 0 1px 0 rgba(255, 227, 190, .38),
    inset 0 -4px 11px rgba(0, 0, 0, .5);
}

.frame-shine {
  position: absolute;
  inset: 1px;
  border-radius: 25px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 224, 188, .12), transparent 26%, transparent 76%, rgba(0, 0, 0, .22));
}

.board-label {
  position: absolute;
  left: 50%;
  bottom: 2px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 7px;
  letter-spacing: .32em;
  color: rgba(255, 204, 156, .28);
  white-space: nowrap;
}

.board-label span {
  width: 18px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 204, 156, .25));
}

.board-label span:last-child {
  background: linear-gradient(90deg, rgba(255, 204, 156, .25), transparent);
}

.board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  padding: 7px;
  width: 100%;
  border-radius: 19px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 155, 84, .12), transparent 64%),
    linear-gradient(180deg, rgba(9, 5, 4, .62), rgba(23, 13, 10, .58));
  box-shadow:
    inset 0 5px 16px rgba(0, 0, 0, .62),
    inset 0 -1px 0 rgba(255, 206, 156, .1);
  touch-action: none;
}

.tile {
  position: relative;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 14px;
  border: 1px solid rgba(255, 202, 154, .12);
  background:
    linear-gradient(152deg, rgba(255, 236, 210, .075), rgba(0, 0, 0, .18)),
    rgba(255, 255, 255, .012);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .12),
    inset 0 -3px 7px rgba(0, 0, 0, .34),
    0 2px 4px rgba(0, 0, 0, .2);
  transition: transform .12s ease, border-color .2s, box-shadow .2s, background .25s;
  touch-action: none;
  -webkit-user-drag: none;
}

.tile.empty::after {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 198, 146, .1);
  box-shadow: 0 0 0 1px rgba(255, 198, 146, .06);
}

.tile.has-item {
  background:
    radial-gradient(circle at 50% 36%, rgba(255, 183, 112, .2), transparent 70%),
    linear-gradient(155deg, rgba(31, 20, 16, .9), rgba(9, 8, 7, .82));
  border-color: rgba(255, 196, 142, .2);
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 215, .17),
    inset 0 -4px 9px rgba(0, 0, 0, .42),
    0 4px 8px rgba(0, 0, 0, .26);
}

.tile.tier-5 {
  border-color: rgba(255, 212, 140, .38);
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 215, .2),
    inset 0 -4px 9px rgba(0, 0, 0, .4),
    0 0 18px rgba(255, 184, 96, .16),
    0 4px 8px rgba(0, 0, 0, .26);
}

.tile:active { transform: scale(.955); }

.tile.pressed {
  transform: scale(.935);
  border-color: rgba(255, 196, 142, .48);
}

.tile.selected {
  border-color: rgba(255, 198, 142, .95);
  box-shadow:
    0 0 0 2px rgba(255, 138, 61, .35),
    0 0 24px rgba(255, 138, 61, .38),
    inset 0 1px 0 rgba(255, 240, 215, .2);
  transform: translateY(-2px) scale(1.015);
  z-index: 2;
}

.tile.drop-target {
  border-color: rgba(168, 240, 235, .85);
  box-shadow: 0 0 0 2px rgba(127, 222, 218, .28), 0 0 22px rgba(127, 222, 218, .32);
}

.tile.hint {
  animation: hintPulse 1.5s ease-in-out infinite;
}

@keyframes hintPulse {
  0%, 100% { box-shadow: inset 0 1px 0 rgba(255, 240, 215, .17), 0 0 0 0 rgba(255, 138, 61, 0); }
  50% { box-shadow: inset 0 1px 0 rgba(255, 240, 215, .17), 0 0 0 3px rgba(255, 138, 61, .22), 0 0 20px rgba(255, 138, 61, .3); }
}

.tile.nope {
  animation: tileNope .34s ease-in-out;
}

@keyframes tileNope {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); border-color: rgba(255, 110, 90, .6); }
  75% { transform: translateX(4px); border-color: rgba(255, 110, 90, .6); }
}

.tile .item {
  width: 82%;
  height: 82%;
  display: grid;
  place-items: center;
  pointer-events: none;
  filter: drop-shadow(0 5px 6px rgba(0, 0, 0, .42));
}

.tile .item svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.tile.pop .item {
  animation: itemPop .42s cubic-bezier(.18, 1.6, .36, 1);
}

@keyframes itemPop {
  0% { transform: scale(.35) rotate(-8deg); opacity: .2; }
  60% { transform: scale(1.16) rotate(3deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

.tile .lv {
  position: absolute;
  right: 5px;
  bottom: 3px;
  font-family: "Avenir Next", "PingFang SC", sans-serif;
  font-size: 7.5px;
  letter-spacing: .06em;
  color: rgba(255, 214, 170, .44);
  pointer-events: none;
}

/* ---------- 操作按钮 ---------- */
.actions {
  display: flex;
  gap: 10px;
  width: var(--board-size);
  max-width: 360px;
  margin-top: 11px;
}

.btn-primary {
  position: relative;
  flex: 1;
  min-height: 52px;
  padding: 0 16px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #2b1306;
  background: linear-gradient(180deg, #ffb168 0%, #ff933f 46%, #f1782c 100%);
  border: 1px solid rgba(255, 218, 172, .65);
  box-shadow:
    0 12px 26px rgba(255, 116, 45, .32),
    0 3px 0 rgba(122, 47, 12, .65),
    inset 0 1px 0 rgba(255, 249, 236, .7);
  font-weight: 800;
  letter-spacing: .02em;
  overflow: hidden;
  transition: transform .12s ease, box-shadow .2s;
}

.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 24%, rgba(255, 255, 255, .22) 46%, transparent 62%);
  transform: translateX(-120%);
  animation: sheen 4.8s ease-in-out infinite;
}

@keyframes sheen {
  0%, 58% { transform: translateX(-120%); }
  76%, 100% { transform: translateX(120%); }
}

.btn-primary:active {
  transform: translateY(2px) scale(.995);
  box-shadow: 0 6px 14px rgba(255, 116, 45, .28), 0 1px 0 rgba(122, 47, 12, .65), inset 0 1px 0 rgba(255, 249, 236, .5);
}

.btn-primary .mp-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.btn-primary .btn-label {
  font-size: 16px;
  line-height: 1;
  white-space: nowrap;
}

.btn-primary em {
  font-style: normal;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .02em;
  opacity: .62;
  white-space: nowrap;
}

.btn-primary.wide {
  width: 100%;
  flex: 0 0 auto;
  margin-top: 16px;
  height: 52px;
}

.btn-ghost {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: rgba(247, 232, 212, .62);
  background: linear-gradient(180deg, rgba(23, 41, 41, .9), rgba(9, 24, 25, .94));
  border: 1px solid rgba(255, 184, 122, .22);
  box-shadow: 0 10px 22px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 226, 192, .1);
  transition: transform .12s, color .2s;
}

.btn-ghost .mp-icon { width: 20px; height: 20px; }
.btn-ghost:active { transform: scale(.93); color: var(--orange-light); }

.btn-ghost:disabled,
.btn-primary:disabled {
  opacity: .46;
  filter: grayscale(.3);
}

/* ---------- 底部手记 ---------- */
.bottom {
  margin-top: auto;
  padding-top: 14px;
  flex: 0 0 auto;
}

.note {
  padding: 9px 12px 10px;
  border-left: 2px solid rgba(255, 138, 61, .5);
  border-radius: 0 13px 13px 0;
  background: linear-gradient(90deg, rgba(255, 138, 61, .07), rgba(255, 138, 61, 0) 82%);
}

.note-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 9.5px;
  letter-spacing: .16em;
  color: rgba(255, 184, 128, .76);
}

.note-head span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.note-head .mp-icon { width: 12px; height: 12px; opacity: .75; }

.note-head em {
  font-style: normal;
  font-size: 9px;
  color: var(--faint);
  letter-spacing: .1em;
}

.note p {
  margin: 5px 0 0;
  font-size: 11px;
  line-height: 1.55;
  color: rgba(247, 232, 212, .5);
}

.signature {
  display: block;
  margin-top: 4px;
  text-align: right;
  font-size: 8.5px;
  letter-spacing: .12em;
  color: rgba(247, 232, 212, .22);
}

/* ---------- 弹层 ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background:
    radial-gradient(ellipse at 50% 38%, rgba(255, 138, 61, .1), transparent 52%),
    rgba(2, 9, 10, .76);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.overlay.show { display: flex; }

.sheet {
  position: relative;
  width: 100%;
  max-width: 350px;
  padding: 25px 21px 21px;
  border-radius: 26px;
  text-align: center;
  background:
    radial-gradient(120% 100% at 50% -10%, rgba(255, 156, 88, .18), transparent 52%),
    linear-gradient(172deg, rgba(19, 43, 43, .98), rgba(6, 19, 21, .99));
  border: 1px solid rgba(255, 184, 122, .3);
  box-shadow:
    0 34px 70px rgba(0, 0, 0, .62),
    0 0 0 1px rgba(0, 0, 0, .3),
    inset 0 1px 0 rgba(255, 232, 202, .16);
  overflow: hidden;
  animation: sheetIn .38s cubic-bezier(.18, 1.2, .36, 1);
}

@keyframes sheetIn {
  0% { transform: translateY(18px) scale(.94); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

.sheet::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 130px;
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(255, 196, 140, .8), transparent);
}

.stamp {
  position: absolute;
  top: 17px;
  right: 17px;
  padding: 4px 8px;
  border: 2px solid rgba(255, 138, 61, .6);
  border-radius: 7px;
  transform: rotate(8deg);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .18em;
  color: rgba(255, 164, 104, .9);
  opacity: .9;
}

.sheet-art {
  width: 76px;
  height: 76px;
  margin: 2px auto 9px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 192, 128, .26), transparent 68%),
    rgba(5, 17, 18, .5);
  border: 1px solid rgba(255, 192, 128, .26);
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, .4), 0 0 30px rgba(255, 138, 61, .12);
}

.sheet-art svg {
  width: 70%;
  height: 70%;
  display: block;
  filter: drop-shadow(0 4px 7px rgba(0, 0, 0, .4));
}

.fail-art .mp-icon {
  width: 32px;
  height: 32px;
  color: rgba(255, 196, 146, .68);
}

.sheet-kicker {
  margin: 0;
  font-size: 9px;
  letter-spacing: .28em;
  color: rgba(255, 184, 128, .72);
}

.sheet h2 {
  margin: 7px 0 0;
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", serif;
  font-size: 26px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: .03em;
  color: #fff3e1;
}

.sheet-story {
  margin: 10px 4px 0;
  font-size: 12.5px;
  line-height: 1.75;
  color: rgba(247, 232, 212, .58);
}

.receipt {
  display: flex;
  margin: 18px 2px 0;
  padding: 12px 4px;
  border-top: 1px dashed rgba(255, 198, 146, .22);
  border-bottom: 1px dashed rgba(255, 198, 146, .22);
}

.receipt > div {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.receipt > div + div {
  border-left: 1px dashed rgba(255, 198, 146, .16);
}

.receipt span {
  font-size: 9.5px;
  letter-spacing: .12em;
  color: var(--faint);
}

.receipt b {
  font-size: 19px;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
}

.text-btn {
  margin-top: 13px;
  padding: 4px 8px;
  font-size: 10.5px;
  letter-spacing: .08em;
  color: rgba(247, 232, 212, .38);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(247, 232, 212, .18);
}

/* 配方弹层 */
.sheet-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: rgba(247, 232, 212, .5);
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 196, 146, .14);
}

.sheet-close .mp-icon { width: 15px; height: 15px; }

.recipe-sheet {
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

.recipe-sheet .sheet-story {
  margin-top: 7px;
  font-size: 11px;
  line-height: 1.6;
}

.recipe-list {
  margin: 14px 0 0;
  padding: 2px 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-height: 0;
  text-align: left;
}

.recipe-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}

.recipe-row + .recipe-row::before {
  content: "";
  position: absolute;
  left: 21px;
  top: -7px;
  width: 1px;
  height: 14px;
  background: linear-gradient(180deg, rgba(255, 190, 130, .32), rgba(255, 190, 130, .04));
}

.recipe-icon {
  width: 43px;
  height: 43px;
  flex: 0 0 43px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 36%, rgba(255, 186, 120, .18), transparent 72%), rgba(4, 15, 16, .5);
  border: 1px solid rgba(255, 190, 130, .16);
}

.recipe-icon svg { width: 78%; height: 78%; display: block; }

.recipe-meta {
  min-width: 0;
  flex: 1;
}

.recipe-meta b {
  display: block;
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  font-size: 14px;
  font-weight: 700;
  color: #ffe9ce;
}

.recipe-meta span {
  display: block;
  margin-top: 1px;
  font-size: 9.5px;
  color: rgba(247, 232, 212, .38);
  letter-spacing: .04em;
}

.recipe-tier {
  font-size: 9px;
  letter-spacing: .12em;
  color: rgba(255, 184, 128, .5);
}

/* ---------- 提示与特效 ---------- */
.toast {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 72px);
  left: 50%;
  z-index: 60;
  max-width: 82vw;
  padding: 9px 15px;
  border-radius: 999px;
  background: rgba(8, 23, 24, .94);
  border: 1px solid rgba(255, 184, 122, .32);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .45);
  font-size: 11.5px;
  letter-spacing: .04em;
  color: rgba(255, 238, 216, .9);
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, -8px);
  pointer-events: none;
  transition: opacity .22s, transform .22s;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.fx {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  overflow: hidden;
}

.drag-ghost {
  position: fixed;
  z-index: 46;
  width: 64px;
  height: 64px;
  transform: translate(-50%, -50%) scale(1.08);
  pointer-events: none;
  filter: drop-shadow(0 14px 16px rgba(0, 0, 0, .5));
  opacity: .96;
}

.drag-ghost svg { width: 100%; height: 100%; display: block; }

.fly-item {
  position: fixed;
  z-index: 44;
  width: 56px;
  height: 56px;
  pointer-events: none;
  will-change: transform, opacity;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .45));
}

.fly-item svg { width: 100%; height: 100%; display: block; }

.spark {
  position: fixed;
  z-index: 45;
  width: 5px;
  height: 5px;
  margin: -2.5px 0 0 -2.5px;
  border-radius: 50%;
  background: #ffc37d;
  box-shadow: 0 0 9px currentColor;
  pointer-events: none;
}

.spark.star {
  width: 7px;
  height: 7px;
  border-radius: 1px;
  transform: rotate(45deg);
}

/* ---------- 小屏适配 ---------- */
@media (max-height: 700px) {
  :root {
    --board-size: min(calc(100vw - 40px), 360px, calc(100vh - 320px));
  }
  @supports (height: 100dvh) {
    :root {
      --board-size: min(calc(100vw - 40px), 360px, calc(100dvh - 320px));
    }
  }

  .order-sub { display: none; }
  .order { padding: 10px 13px; }
  .order-row { margin-top: 5px; }
  .note { padding: 7px 11px 8px; }
  .signature { display: none; }
  .bottom { padding-top: 10px; }
  .board-area { margin-top: 10px; }
}

@media (max-height: 590px) {
  :root {
    --board-size: min(calc(100vw - 40px), 360px, calc(100vh - 275px));
  }
  @supports (height: 100dvh) {
    :root {
      --board-size: min(calc(100vw - 40px), 360px, calc(100dvh - 275px));
    }
  }

  .note { display: none; }
  .order-customer { display: none; }
  .order-name { font-size: 18px; }
  .board-frame { border-radius: 20px; padding: 7px 7px 12px; }
  .board { gap: 6px; padding: 6px; border-radius: 15px; }
  .tile { border-radius: 11px; }
  .actions { margin-top: 8px; }
}

@media (max-width: 350px) {
  .order-kicker { letter-spacing: .08em; font-size: 9px; }
  .btn-primary em { display: none; }
  .night-badge { padding: 0 10px; }
  .moves-pill { padding: 0 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .rain-line,
  .lamp,
  .dust,
  .steam path,
  .cat,
  .btn-primary::after,
  .tile.hint {
    animation: none !important;
  }
}
