﻿/* ============================================================
   后厨限时出餐 · 婚礼小游戏
   独立页面，样式全部挂在 .kg- 前缀下，方便以后整块搬进请柬
   ============================================================ */


.kg-stage{
  --tomato:#e94e3b;
  --tomato-d:#b5372a;
  --mustard:#ffc72c;
  --cream:#fff3cf;
  --paper:#fffdf7;
  --teal:#2bd4c0;
  --orange:#ff8a3d;
  --night:#1a1230;
  --ink:#1a0c2a;
  --line:#3a1c07;
  --f-cn:"Smiley","PingFang SC","Microsoft YaHei",sans-serif;
  --f-display:"Titan","Impact","Arial Black",sans-serif;
  --f-num:"Baloo","PingFang SC","Microsoft YaHei",sans-serif;
  --f-en:"Baloo","PingFang SC","Microsoft YaHei",sans-serif;
  --stripe:repeating-linear-gradient(-45deg,var(--tomato) 0 11px,var(--mustard) 11px 22px);
}

/* 只作用于 .kg-stage 内部，方便整块搬进请柬而不污染原页面 */
.kg-stage,
.kg-stage *,
.kg-stage *::before,
.kg-stage *::after{
  box-sizing:border-box; margin:0; padding:0;
  -webkit-tap-highlight-color:transparent;
}
.kg-stage :where(img){ display:block; max-width:100%; }
.kg-stage :where(button){ font:inherit; color:inherit; border:0; background:none; cursor:pointer; touch-action:manipulation; }

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

/* ---------- 舞台 ---------- */
.kg-stage{
  height:100vh;
  height:var(--kg-h,100dvh);
  width:100%;
  display:flex;
  justify-content:center;
  align-items:stretch;
  overflow:hidden;
  position:relative;
  font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;
  color:var(--ink);
  -webkit-font-smoothing:antialiased;
  overscroll-behavior:none;
  background:
    radial-gradient(60% 45% at 50% 0%, rgba(255,138,61,.10), transparent 70%),
    #0d0819;
}

.kg-frame{
  position:relative;
  width:min(100%,440px);
  height:100%;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  isolation:isolate;
  background:
    radial-gradient(120% 55% at 50% -10%, rgba(255,138,61,.22), transparent 60%),
    radial-gradient(90% 60% at 50% 108%, rgba(43,212,192,.12), transparent 65%),
    linear-gradient(180deg,#291a4a 0%,#1d1237 48%,#150d28 100%);
  padding-top:env(safe-area-inset-top);
  padding-bottom:env(safe-area-inset-bottom);
}
/* 背景墙面纹理 */
.kg-frame::before{
  content:""; position:absolute; inset:0; z-index:-1; pointer-events:none;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size:44px 44px;
  mask-image:radial-gradient(80% 60% at 50% 30%, #000 20%, transparent 80%);
  -webkit-mask-image:radial-gradient(80% 60% at 50% 30%, #000 20%, transparent 80%);
}

.kg-stripe{ height:7px; flex:none; background:var(--stripe); background-size:200% 100%; }

/* ---------- 顶栏 ---------- */
.kg-bar{
  flex:none;
  display:flex; align-items:center; justify-content:space-between;
  padding:9px 16px 0;
}
.kg-logo{
  font-family:var(--f-en); font-weight:800; font-size:9.5px; letter-spacing:.28em;
  color:#9d8bd0;
}
.kg-logo b{ color:var(--mustard); font-weight:800; }

.kg-sound{
  width:30px; height:30px; border-radius:50%;
  display:grid; place-items:center;
  background:rgba(255,255,255,.07);
  border:2px solid rgba(255,255,255,.18);
  color:var(--cream); font-size:13px; line-height:1;
  position:relative;
}
.kg-sound .kg-sound-off{ display:none; }
.kg-sound::after{
  content:""; position:absolute; left:50%; top:50%; width:14px; height:2px;
  background:var(--tomato); border-radius:2px; transform:translate(-50%,-50%) rotate(-45deg) scaleX(0);
  transition:transform .15s;
}
.kg-sound[aria-pressed="false"]::after{ transform:translate(-50%,-50%) rotate(-45deg) scaleX(1); }
.kg-sound[aria-pressed="false"]{ color:#6f6094; }

/* ---------- HUD ---------- */
.kg-hud{
  flex:none;
  display:grid; grid-template-columns:1fr 1fr auto; align-items:end; gap:6px;
  padding:6px 18px 0;
}
.kg-hud span{
  display:block; font-family:var(--f-en); font-weight:800; font-size:8px;
  letter-spacing:.24em; color:#8b79bd; margin-bottom:2px;
}
.kg-hud b{
  display:block;
  font-family:var(--f-num); font-weight:800; font-size:26px; line-height:.95;
  color:#fff; letter-spacing:.01em; font-variant-numeric:tabular-nums;
}
.kg-hud-score.is-bump b{ animation:kg-bump .28s ease; }
.kg-hud-time b{ color:var(--mustard); }
.kg-hud-time.is-penalty b{ animation:kg-penalty .42s ease; }
.kg-hud-score{ text-align:center; }
.kg-hud-score b{ font-size:23px; }
.kg-hud-combo{
  min-width:60px; text-align:center;
  border:2px solid rgba(255,255,255,.16); border-radius:10px;
  padding:3px 8px 4px; background:rgba(255,255,255,.05);
  transition:background .15s, border-color .15s, transform .15s;
}
.kg-hud-combo b{ color:#8f80bd; font-size:19px; }
.kg-hud-combo.is-hot{
  border-color:var(--mustard); background:rgba(255,199,44,.16);
  transform:rotate(-3deg);
}
.kg-hud-combo.is-hot b{ color:var(--mustard); }
.kg-hud-combo.is-hot span{ color:var(--mustard); }

.kg-timebar{
  flex:none; height:8px; margin:8px 18px 0; border-radius:99px;
  background:rgba(0,0,0,.35); overflow:hidden;
  box-shadow:inset 0 1px 3px rgba(0,0,0,.6);
}
.kg-timebar i{
  display:block; height:100%; width:100%; border-radius:99px;
  background:linear-gradient(90deg,var(--teal),var(--mustard) 55%,var(--tomato));
  transition:width .1s linear;
}
.kg-timebar.is-urgent i{ animation:kg-urgent .6s ease-in-out infinite; }

.kg-names{
  flex:none; text-align:center;
  font-family:var(--f-en); font-weight:800; font-size:8.5px; letter-spacing:.2em;
  color:#6d5c96; margin-top:11px;
}

/* ---------- 主舞台 ---------- */
.kg-arena{
  flex:1; min-height:0; position:relative;
  display:flex; flex-direction:column; align-items:center; justify-content:space-evenly;
  gap:6px; padding:8px 18px 12px;
}
.kg-arena::after{
  content:""; position:absolute; left:-8%; right:-8%; top:40%; height:36%;
  background:radial-gradient(50% 50% at 50% 50%, rgba(255,150,60,.13), transparent 72%);
  pointer-events:none; z-index:-1;
}

/* ---------- 订单小票 ---------- */
.kg-ticket{
  position:relative;
  width:100%; flex:none;
  background:var(--paper);
  border:3px solid var(--line);
  border-radius:15px;
  padding:11px 14px 10px;
  box-shadow:0 5px 0 rgba(0,0,0,.35);
}
.kg-ticket.is-print{ animation:kg-print .42s cubic-bezier(.2,1.3,.4,1) both; }
.kg-ticket.is-served{ animation:kg-served .38s ease both; }

.kg-ticket-head{
  display:flex; align-items:center; justify-content:space-between; gap:8px;
  padding-bottom:7px; border-bottom:2px dashed #ddc9a4;
}
.kg-order-no{
  font-family:var(--f-display); font-size:9.5px; letter-spacing:.16em; color:#ad9673;
}
.kg-dish-wrap{ display:flex; align-items:center; gap:7px; min-width:0; }
.kg-dish-icon{
  width:40px; height:auto; flex:none;
  filter:drop-shadow(0 3px 3px rgba(58,28,7,.22));
  transition:transform .28s cubic-bezier(.2,1.5,.4,1);
  transform-origin:50% 60%;
}
.kg-dish{
  font-family:var(--f-cn); font-weight:400; font-size:19px; line-height:1.1; color:#3a1c07;
  white-space:nowrap;
}
.kg-ticket.is-done .kg-dish-icon{ transform:scale(1.35) rotate(-4deg); }
.kg-ticket.is-done .kg-slots{
  opacity:0; transform:scale(.92); transition:opacity .2s, transform .2s;
}

.kg-slots{
  display:flex; align-items:center; justify-content:center;
  gap:4px; margin-top:11px;
}
.kg-slot{
  width:44px; height:44px; flex:none;
  border:2.5px dashed #d5c29c; border-radius:12px;
  background:#f8efd9;
  display:grid; place-items:center;
  color:#cbb894;
}
.kg-slot img{ width:33px; height:33px; display:block; border-radius:50%; }
.kg-slot .kg-slot-q{ font-family:var(--f-num); font-size:16px; color:#cbb894; }
.kg-slot.is-filled{
  border-style:solid; border-color:var(--line); background:#fff;
  animation:kg-pop .3s cubic-bezier(.2,1.6,.4,1);
}
.kg-slot.is-current{
  border-style:solid; border-color:var(--tomato);
  background:#fff8e6;
  animation:kg-slot-pulse 1.1s ease-in-out infinite;
}
.kg-slot.is-filled.is-current{ animation:none; }
.kg-slots.is-five .kg-slot{ width:38px; height:38px; border-radius:10px; }
.kg-slots.is-five .kg-slot img{ width:28px; height:28px; }
.kg-slots.is-five .kg-arrow{ width:7px; font-size:13px; }
.kg-slots.is-five{ gap:3px; }
.kg-arrow{
  flex:none; width:9px; text-align:center;
  font-family:var(--f-display); font-size:15px; color:#d3c1a0; line-height:1;
}
.kg-ticket-foot{
  display:flex; align-items:center; justify-content:space-between;
  margin-top:9px; font-size:10.5px; color:#a08a6c; letter-spacing:.02em;
}
.kg-ticket-punched{
  width:26px; height:2px; border-radius:2px;
  background:repeating-linear-gradient(90deg,#cdb994 0 4px,transparent 4px 8px);
}

.kg-stamp{
  position:absolute; right:12px; top:46%;
  font-family:var(--f-display); font-size:14px; letter-spacing:.1em;
  color:#2f9e6a; border:3px solid #2f9e6a; border-radius:6px;
  padding:2px 7px; opacity:0; pointer-events:none;
  transform:rotate(-10deg) scale(1.4);
}
.kg-ticket.is-served .kg-stamp{ animation:kg-stamp .4s ease-out both; }

/* ---------- 食材九宫格 ---------- */
.kg-grid{
  --tile:90px;
  display:grid;
  grid-template-columns:repeat(3,var(--tile));
  grid-auto-rows:var(--tile);
  gap:9px;
  flex:none;
}
.kg-tile{
  position:relative;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:1px;
  background:linear-gradient(180deg,#fffdf6,#fdf3da);
  border:3px solid var(--line);
  border-radius:15px;
  box-shadow:0 4px 0 rgba(26,12,42,.8), inset 0 2px 0 rgba(255,255,255,.9);
  transition:transform .07s ease, box-shadow .07s ease, background .1s;
  user-select:none;
}
.kg-tile-img{ width:66%; height:auto; max-height:66%; display:block; pointer-events:none; filter:drop-shadow(0 2px 2px rgba(26,12,42,.18)); }
.kg-tile .kg-tile-name{
  font-family:var(--f-cn); font-size:11px; line-height:1; color:#8a6238;
  letter-spacing:.02em; pointer-events:none;
}
.kg-tile:active,
.kg-tile.is-press{
  transform:translateY(3px);
  box-shadow:0 1px 0 rgba(26,12,42,.8), inset 0 2px 0 rgba(255,255,255,.6);
  background:#ffeec9;
}
.kg-tile.is-right{ background:#d9f7c8; }
.kg-tile.is-wrong{
  background:#ffd9d2; border-color:var(--tomato-d);
  animation:kg-wrong .32s ease;
}

/* ---------- 出餐口 ---------- */
.kg-pass{
  position:relative; flex:none;
  width:100%; height:60px;
  display:flex; align-items:center; gap:8px;
  padding:0 10px 0 12px;
  border:3px solid var(--line); border-radius:14px;
  background:
    repeating-linear-gradient(90deg,#8a5a2b 0 30px,#815226 30px 60px);
  box-shadow:0 5px 0 rgba(0,0,0,.45), inset 0 3px 0 rgba(255,255,255,.16);
}
.kg-pass::before{
  content:""; position:absolute; left:0; right:0; bottom:-8px; height:8px;
  background:radial-gradient(circle at 50% 0, rgba(0,0,0,.28) 4px, transparent 4.5px) 0 0/12px 8px repeat-x;
  opacity:.5;
}
.kg-pass-label{
  font-family:var(--f-cn); font-size:14px; color:var(--mustard); flex:none;
  text-shadow:0 2px 0 rgba(0,0,0,.45);
}
.kg-plates{ display:flex; align-items:center; gap:3px; flex:1; min-width:0; overflow:hidden; }
.kg-plate{
  width:30px; height:auto; flex:none;
  filter:drop-shadow(0 1px 1px rgba(0,0,0,.4));
  animation:kg-plate-in .35s cubic-bezier(.2,1.6,.4,1) both;
}
.kg-pass-count{
  flex:none; display:flex; align-items:baseline; gap:2px;
  font-family:var(--f-num); font-weight:800; color:#fff; font-size:17px;
  text-shadow:0 2px 0 rgba(0,0,0,.5);
}
.kg-pass-count span{ font-family:var(--f-cn); font-size:10px; color:#ffe0a8; }

.kg-king{
  height:52px; width:auto; flex:none; margin-left:2px;
  transform-origin:50% 100%;
  filter:drop-shadow(0 3px 0 rgba(0,0,0,.35));
  animation:kg-king-idle 2.6s ease-in-out infinite;
}
.kg-king.is-happy{ animation:kg-king-happy .55s ease; }
.kg-king.is-mad{ animation:kg-king-mad .45s ease; }
.kg-king-line{
  position:absolute; right:6px; bottom:52px;
  background:var(--paper); color:var(--line);
  border:2px solid var(--line); border-radius:10px;
  padding:2px 7px; font-family:var(--f-cn); font-size:11px; white-space:nowrap;
  opacity:0; transform:translateY(4px) scale(.9); pointer-events:none;
  transition:opacity .15s, transform .15s;
  box-shadow:0 2px 0 rgba(0,0,0,.3);
}
.kg-king-line.is-on{ opacity:1; transform:translateY(0) scale(1); }
.kg-king-line::after{
  content:""; position:absolute; left:50%; bottom:-6px; width:8px; height:8px;
  background:var(--paper); border-right:2px solid var(--line); border-bottom:2px solid var(--line);
  transform:translateX(-50%) rotate(45deg);
}

/* ---------- 飘分 / 提示 ---------- */
.kg-fx{ position:absolute; inset:0; pointer-events:none; overflow:hidden; z-index:10; }
.kg-float{
  position:absolute; transform:translate(-50%,-50%);
  font-family:var(--f-num); font-weight:800; font-size:19px; color:var(--mustard);
  text-shadow:0 2px 0 rgba(0,0,0,.5), 0 0 12px rgba(255,199,44,.5);
  animation:kg-float .8s ease-out forwards; white-space:nowrap;
}
.kg-float.is-bad{ color:#ff6b5b; font-size:16px; }
.kg-float.is-big{ font-size:25px; }

.kg-fly{
  position:fixed; z-index:60; width:44px; height:44px;
  pointer-events:none;
  filter:drop-shadow(0 4px 0 rgba(0,0,0,.3));
}
.kg-fly img{ display:block; width:100%; height:100%; }
.kg-fly-dish{ width:72px; height:auto; }
.kg-close{
  position:absolute; top:12px; right:15px; z-index:45;
  width:30px; height:30px; margin:0;
  border-radius:50%; display:grid; place-items:center;
  background:rgba(255,255,255,.07);
  border:2px solid rgba(255,255,255,.18);
  color:var(--cream); font-size:12px; line-height:1;
}
.kg-close[hidden]{ display:none; }
.kg-close:not([hidden]) ~ .kg-sound{ margin-right:36px; }

.kg-toast{
  position:absolute; left:50%; bottom:104px; z-index:11;
  transform:translate(-50%,10px) scale(.94);
  background:rgba(12,7,24,.92);
  border:2px solid var(--mustard); border-radius:999px;
  padding:6px 15px 7px;
  font-family:var(--f-cn); font-size:13px; color:var(--cream);
  opacity:0; pointer-events:none;
  transition:opacity .18s, transform .18s;
  white-space:nowrap;
}
.kg-toast.is-on{ opacity:1; transform:translate(-50%,0) scale(1); }

/* ---------- 遮罩 / 卡片 ---------- */
.kg-overlay{
  position:absolute; inset:0; z-index:30;
  display:flex; align-items:center; justify-content:center;
  padding:22px;
  background:rgba(10,6,20,.66);
  -webkit-backdrop-filter:blur(5px);
  backdrop-filter:blur(5px);
  animation:kg-fade .25s ease both;
}
.kg-overlay[hidden]{ display:none !important; }
.kg-overlay.is-out{
  opacity:0; pointer-events:none; animation:none;
  transition:opacity .18s ease;
}
.kg-card{
  width:100%; max-width:352px;
  background:var(--paper);
  border:3.5px solid var(--line);
  border-radius:22px;
  padding:20px 18px 18px;
  text-align:center;
  box-shadow:0 10px 0 rgba(0,0,0,.4);
  animation:kg-card-in .4s cubic-bezier(.2,1.2,.4,1) both;
  position:relative;
  overflow:hidden;
}
.kg-card::before{
  content:""; position:absolute; inset:0 0 auto; height:6px;
  background:var(--stripe);
}
.kg-eyebrow{
  font-family:var(--f-en); font-weight:800; font-size:8.5px; letter-spacing:.26em;
  color:#b09a76; padding-top:4px;
}
.kg-start-title{
  font-family:var(--f-cn); font-weight:400; font-size:31px; line-height:1.06;
  color:#3a1c07; margin-top:8px;
}
.kg-start-title em{
  display:block; font-style:normal; color:var(--tomato);
  font-size:34px;
  text-shadow:0 3px 0 rgba(26,12,42,.12);
}
.kg-lead{
  font-size:12.5px; line-height:1.7; color:#7a6650; margin-top:10px;
}
.kg-rules{
  list-style:none; margin-top:14px; padding-top:12px;
  border-top:2px dashed #e2d2b0;
  display:grid; gap:8px;
}
.kg-rules li{ display:flex; align-items:center; gap:9px; text-align:left; }
.kg-rules b{
  flex:none; width:25px; height:25px; border-radius:8px;
  display:grid; place-items:center;
  background:#ffe7b0; border:2px solid var(--line);
  font-family:var(--f-display); font-weight:400; font-size:10.5px; color:#8a4b1a;
}
.kg-rules span{ font-size:12.5px; color:#5f4d38; line-height:1.35; }
.kg-goal{
  display:flex; justify-content:center; gap:9px;
  margin-top:10px;
  font-size:10px; color:#a08a6c; letter-spacing:.02em;
}
.kg-goal span{ display:inline-flex; align-items:center; gap:3px; white-space:nowrap; }
.kg-goal i{ font-style:normal; color:var(--mustard); font-size:9px; letter-spacing:-.06em; text-shadow:0 1px 0 rgba(58,28,7,.25); }

.kg-btn{
  width:100%; margin-top:16px;
  display:flex; align-items:center; justify-content:center; gap:8px;
  border:3px solid var(--line); border-radius:14px;
  padding:12px 14px;
  font-family:var(--f-cn); font-size:17px; letter-spacing:.01em;
  transition:transform .08s, box-shadow .08s, filter .15s;
}
.kg-btn-main{
  background:linear-gradient(180deg,#f2614c,var(--tomato));
  color:#fff;
  box-shadow:0 5px 0 #7d2116;
  text-shadow:0 2px 0 rgba(0,0,0,.18);
}
.kg-btn-main i{ font-style:normal; font-size:14px; opacity:.9; }
.kg-btn:active{ transform:translateY(3px); box-shadow:0 2px 0 #7d2116; }
.kg-result-actions{ display:flex; flex-direction:column; gap:0; }
.kg-btn-ghost{
  margin-top:10px;
  background:#f3e7cd; color:#7a5230;
  box-shadow:0 4px 0 #cdb894;
  font-size:15px;
}
.kg-btn-ghost i{ font-style:normal; font-size:13px; opacity:.8; }
.kg-btn-ghost:active{ box-shadow:0 1px 0 #cdb894; }
.kg-btn-ghost[hidden]{ display:none; }
.kg-best{ font-size:10.5px; color:#a08a6c; margin-top:10px; letter-spacing:.04em; }
.kg-best b{ font-family:var(--f-num); font-size:12px; color:#8a6238; }

/* ---------- 结算 ---------- */
.kg-result-title{
  font-family:var(--f-cn); font-weight:400; font-size:26px; color:#3a1c07; margin-top:6px;
}
.kg-stars{ display:flex; justify-content:center; gap:4px; margin-top:10px; }
.kg-star{
  width:52px; height:52px;
  fill:#e6dbc4; stroke:#cfc0a2; stroke-width:2;
  filter:grayscale(.4);
  transform:scale(.7); opacity:.55;
  transition:none;
}
.kg-star.is-on{
  animation:kg-star-in .45s cubic-bezier(.2,1.7,.4,1) both;
  fill:#ffc72c; stroke:#3a1c07; filter:none; opacity:1;
}
.kg-verdict{
  font-family:var(--f-cn); font-size:16px; color:var(--tomato-d);
  margin-top:6px; min-height:22px;
}
.kg-stats{
  display:grid; grid-template-columns:1fr 1fr 1fr;
  margin-top:14px; padding:11px 0;
  border-top:2px dashed #e2d2b0; border-bottom:2px dashed #e2d2b0;
}
.kg-stats > div{ display:block; position:relative; }
.kg-stats > div + div::before{
  content:""; position:absolute; left:0; top:10%; height:80%; width:1.5px;
  background:#ecdfc4;
}
.kg-stats span{ display:block; font-size:10px; color:#b09a76; letter-spacing:.12em; margin-bottom:3px; }
.kg-stats b{ display:inline-block; font-family:var(--f-num); font-weight:800; font-size:23px; color:#3a1c07; line-height:1; }
.kg-stats i{ font-style:normal; font-family:var(--f-cn); font-size:11px; color:#b09a76; margin-left:2px; }
.kg-record{
  margin-top:9px; font-family:var(--f-cn); font-size:12px; color:#2f9e6a;
  letter-spacing:.02em;
}
.kg-sign{
  font-family:var(--f-en); font-weight:800; font-size:8px; letter-spacing:.16em;
  color:#c0ae8c; margin-top:12px;
}

/* ---------- 横屏提示 ---------- */
.kg-rotate{
  position:absolute; inset:0; z-index:50; display:none;
  flex-direction:column; align-items:center; justify-content:center; gap:18px;
  background:
    radial-gradient(70% 60% at 50% 40%, rgba(255,138,61,.14), transparent 70%),
    #150d28;
  text-align:center; padding:24px;
}
.kg-rotate p{
  font-family:var(--f-cn); color:var(--cream); font-size:19px; line-height:1.6;
}
.kg-rotate-phone{
  width:44px; height:70px; border:3px solid var(--cream); border-radius:11px;
  position:relative; transform:rotate(90deg);
  animation:kg-tilt 1.8s ease-in-out infinite;
}
.kg-rotate-phone::before{
  content:""; position:absolute; left:50%; top:7px; width:16px; height:3px;
  border-radius:2px; background:var(--cream); transform:translateX(-50%); opacity:.55;
}
.kg-rotate-phone i{
  position:absolute; left:50%; bottom:7px; width:6px; height:6px;
  border-radius:50%; background:var(--mustard); transform:translateX(-50%);
}
@keyframes kg-tilt{
  0%,30%{ transform:rotate(90deg) }
  60%,100%{ transform:rotate(0deg) }
}
@media (orientation:landscape) and (max-height:540px){
  .kg-rotate{ display:flex; }
}

/* ---------- 动效 ---------- */
@keyframes kg-fade{ from{ opacity:0 } to{ opacity:1 } }
@keyframes kg-card-in{ from{ opacity:0; transform:translateY(16px) scale(.96) } to{ opacity:1; transform:none } }
@keyframes kg-print{ from{ opacity:.3; transform:translateY(-10px) rotate(-.6deg) } to{ opacity:1; transform:none } }
@keyframes kg-served{ 0%{ transform:none } 30%{ transform:translateY(-6px) rotate(-1.2deg) } 100%{ opacity:.15; transform:translateY(-14px) scale(.97) } }
@keyframes kg-stamp{ from{ opacity:0; transform:rotate(-10deg) scale(1.6) } 60%{ opacity:1; transform:rotate(-10deg) scale(.95) } to{ opacity:1; transform:rotate(-10deg) scale(1) } }
@keyframes kg-pop{ 0%{ transform:scale(.6) } 60%{ transform:scale(1.12) } 100%{ transform:scale(1) } }
@keyframes kg-slot-pulse{ 0%,100%{ box-shadow:0 0 0 0 rgba(233,78,59,.28) } 50%{ box-shadow:0 0 0 4px rgba(233,78,59,.16) } }
@keyframes kg-wrong{ 0%,100%{ transform:translateX(0) } 25%{ transform:translateX(-4px) } 50%{ transform:translateX(4px) } 75%{ transform:translateX(-2px) } }
@keyframes kg-float{ 0%{ opacity:0; transform:translate(-50%,-50%) scale(.7) } 25%{ opacity:1; transform:translate(-50%,-90%) scale(1.05) } 100%{ opacity:0; transform:translate(-50%,-190%) scale(1) } }
@keyframes kg-plate-in{ from{ opacity:0; transform:translateY(-14px) scale(.6) } to{ opacity:1; transform:none } }
@keyframes kg-king-idle{ 0%,100%{ transform:translateY(0) rotate(-1deg) } 50%{ transform:translateY(-3px) rotate(1.5deg) } }
@keyframes kg-king-happy{ 0%,100%{ transform:translateY(0) scale(1) } 30%{ transform:translateY(-9px) scale(1.08) rotate(-4deg) } 60%{ transform:translateY(0) scale(.98) } 80%{ transform:translateY(-3px) scale(1.02) } }
@keyframes kg-king-mad{ 0%,100%{ transform:translateX(0) rotate(0) } 25%{ transform:translateX(-3px) rotate(-5deg) } 75%{ transform:translateX(3px) rotate(5deg) } }
@keyframes kg-star-in{ 0%{ opacity:.4; transform:scale(.4) rotate(-16deg) } 60%{ opacity:1; transform:scale(1.18) rotate(4deg) } 100%{ opacity:1; transform:scale(1) rotate(0) } }
@keyframes kg-urgent{ 0%,100%{ opacity:1 } 50%{ opacity:.45 } }
@keyframes kg-bump{ 0%{ transform:scale(1) } 40%{ transform:scale(1.18); color:var(--mustard) } 100%{ transform:scale(1) } }
@keyframes kg-penalty{ 0%,100%{ transform:translateX(0); color:var(--mustard) } 20%{ transform:translateX(-3px); color:#ff6b5b } 50%{ transform:translateX(3px); color:#ff6b5b } 80%{ transform:translateX(-1px) } }

/* 屏幕抖动 */
.kg-frame.is-shake{ animation:kg-shake .32s ease; }
@keyframes kg-shake{
  0%,100%{ transform:translate(0,0) }
  20%{ transform:translate(-3px,2px) }
  40%{ transform:translate(3px,-1px) }
  60%{ transform:translate(-2px,-2px) }
  80%{ transform:translate(2px,1px) }
}

/* ---------- 小屏适配（由 JS 按容器高度打 class，嵌进请柬也能生效） ---------- */
.kg-frame.is-short .kg-bar{ padding-top:6px; }
.kg-frame.is-short .kg-hud b{ font-size:23px; }
.kg-frame.is-short .kg-hud-score b{ font-size:20px; }
.kg-frame.is-short .kg-arena{ gap:9px; padding:6px 16px 8px; }
.kg-frame.is-short .kg-dish{ font-size:17px; }
.kg-frame.is-short .kg-slot{ width:39px; height:39px; border-radius:10px; }
.kg-frame.is-short .kg-slot img{ width:29px; height:29px; }
.kg-frame.is-short .kg-slots{ margin-top:8px; }
.kg-frame.is-short .kg-ticket{ padding:9px 12px 8px; }
.kg-frame.is-short .kg-grid{ gap:7px; }
.kg-frame.is-short .kg-pass{ height:54px; }
.kg-frame.is-short .kg-king{ height:44px; }
.kg-frame.is-short .kg-king-line{ bottom:46px; }
.kg-frame.is-short .kg-ticket-foot{ margin-top:7px; }

.kg-frame.is-tiny .kg-lead{ display:none; }
.kg-frame.is-tiny .kg-start-title{ font-size:26px; }
.kg-frame.is-tiny .kg-start-title em{ font-size:28px; }
.kg-frame.is-tiny .kg-rules{ margin-top:10px; }

.kg-frame.is-micro .kg-ticket-foot{ display:none; }
.kg-frame.is-micro .kg-names{ display:none; }

/* 桌面：当成一台手机摆在桌上（只在独立页面生效，嵌进请柬时不套手机壳） */
@media (min-width:520px){
  .kg-page .kg-stage{
    align-items:center;
    background:
      radial-gradient(50% 40% at 50% 20%, rgba(255,138,61,.12), transparent 70%),
      radial-gradient(circle at 50% 110%, rgba(43,212,192,.10), transparent 60%),
      #0b0715;
  }
  .kg-page .kg-frame{
    height:min(var(--kg-h,100dvh),880px);
    border-radius:26px;
    box-shadow:0 0 0 2px #2c1f4d, 0 0 0 8px rgba(0,0,0,.25), 0 40px 90px rgba(0,0,0,.65);
  }
  .kg-page .kg-stripe{ border-radius:26px 26px 0 0; }
}

@media (prefers-reduced-motion:reduce){
  .kg-frame::before{ display:none; }
  .kg-king{ animation:none; }
  .kg-slot.is-current{ animation:none; }
  .kg-float{ animation-duration:.4s; }
  .kg-frame.is-shake{ animation:none; }
}
