:root{
  --gold:#f2c26b;
  --gold-bright:#ffdf9e;
  --gold-dim:#b98a43;
  --cream:#f7ead2;
  --muted:#b9a9a0;
  --ink:#0b0812;
  --panel:rgba(20,14,28,.94);
  --line:rgba(242,194,107,.28);
  --teal:#5fd6c2;
  --red:#ff6f61;
}

*{box-sizing:border-box;}
html,body{height:100%;}
body{
  margin:0;
  background:
    radial-gradient(ellipse at 50% 20%, #21152c 0%, #0b0812 58%, #050409 100%);
  color:var(--cream);
  font-family:"Microsoft YaHei UI","Microsoft YaHei","PingFang SC","Noto Sans SC",system-ui,sans-serif;
  overflow:hidden;
  user-select:none;
  -webkit-user-select:none;
  touch-action:none;
  overscroll-behavior:none;
}

#stage{
  position:fixed;
  inset:0;
  display:grid;
  place-items:center;
  overflow:hidden;
}

#game{
  display:block;
  background:#0c0916;
  box-shadow:0 30px 120px rgba(0,0,0,.75);
  image-rendering:auto;
}

#ui{
  position:absolute;
  inset:0;
  pointer-events:none;
}

.screen{
  position:absolute;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  padding:clamp(12px,2.4vw,34px);
  background:
    radial-gradient(ellipse at 50% 40%, rgba(39,25,51,.48), rgba(5,4,9,.84) 72%),
    rgba(5,4,9,.42);
  -webkit-backdrop-filter:blur(7px) saturate(.9);
  backdrop-filter:blur(7px) saturate(.9);
  pointer-events:auto;
  z-index:10;
}
.screen.show{display:flex;}
.screen::before{
  content:"";
  position:absolute;
  inset:0;
  background-image:radial-gradient(rgba(242,194,107,.11) 1px, transparent 1px);
  background-size:34px 34px;
  mask-image:radial-gradient(ellipse at center, rgba(0,0,0,.8), transparent 72%);
  -webkit-mask-image:radial-gradient(ellipse at center, rgba(0,0,0,.8), transparent 72%);
  pointer-events:none;
}

.title-card{
  position:relative;
  z-index:1;
  display:grid;
  grid-template-columns:minmax(220px, 310px) minmax(0, 640px);
  gap:clamp(24px,4vw,58px);
  align-items:center;
  width:min(1080px, 94vw);
  max-height:94vh;
  padding:clamp(24px,3.4vw,46px);
  background:
    linear-gradient(145deg, rgba(35,23,45,.96), rgba(14,10,21,.97) 58%, rgba(24,15,29,.97));
  border:1px solid rgba(242,194,107,.38);
  border-radius:26px;
  box-shadow:
    0 40px 120px rgba(0,0,0,.72),
    inset 0 1px 0 rgba(255,239,199,.16),
    inset 0 0 80px rgba(242,194,107,.035);
  overflow:auto;
  touch-action:pan-y;
  scrollbar-width:thin;
  scrollbar-color:var(--gold-dim) transparent;
}
.title-card::before{
  content:"";
  position:absolute;
  left:8%;
  right:8%;
  top:0;
  height:2px;
  background:linear-gradient(90deg, transparent, var(--gold-bright), transparent);
  opacity:.8;
}
.title-card::after{
  content:"";
  position:absolute;
  inset:10px;
  border:1px solid rgba(242,194,107,.12);
  border-radius:18px;
  pointer-events:none;
}

.title-art{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  align-self:center;
}
.art-glow{
  position:absolute;
  width:78%;
  height:78%;
  border-radius:50%;
  background:radial-gradient(circle, rgba(242,194,107,.24), rgba(242,194,107,0) 68%);
  filter:blur(8px);
  z-index:-1;
}
.mascot{
  width:100%;
  max-width:300px;
  height:auto;
  filter:drop-shadow(0 22px 32px rgba(0,0,0,.55));
  animation:mascot-bob 4.8s ease-in-out infinite;
}
@keyframes mascot-bob{
  0%,100%{transform:translateY(0) rotate(-.6deg);}
  50%{transform:translateY(-8px) rotate(.6deg);}
}

.eyebrow{
  margin:0 0 12px;
  font-family:ui-monospace,"Cascadia Mono","Consolas",monospace;
  font-size:11px;
  font-weight:700;
  letter-spacing:.22em;
  color:var(--gold);
  text-transform:uppercase;
}
h1{
  margin:0;
  font-family:"Microsoft YaHei UI","Microsoft YaHei","PingFang SC",sans-serif;
  font-size:clamp(42px,5.1vw,68px);
  line-height:1.02;
  letter-spacing:.015em;
  font-weight:900;
  color:#fff6e4;
  text-shadow:0 3px 0 #6d3b23, 0 0 30px rgba(242,194,107,.16);
}
h1 span{
  display:block;
  margin-top:6px;
  background:linear-gradient(180deg,#ffe6a8 0%,#f2c26b 48%,#c98b3e 100%);
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
  filter:drop-shadow(0 3px 0 rgba(62,31,20,.5));
}
.tagline{
  margin:18px 0 22px;
  color:#d7c6b9;
  font-size:clamp(13px,1.25vw,16px);
  line-height:1.75;
}

.howto{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:7px;
  margin-bottom:18px;
}
.howto-item{
  padding:10px 4px 9px;
  border:1px solid rgba(242,194,107,.16);
  border-radius:10px;
  background:rgba(255,239,199,.035);
  text-align:center;
}
.howto-item b{
  display:block;
  margin-top:6px;
  font-size:10.5px;
  font-weight:600;
  color:#cbbbae;
  white-space:nowrap;
}
.keys{display:flex;justify-content:center;gap:3px;height:22px;align-items:center;}
kbd{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:22px;
  height:21px;
  padding:0 5px;
  border-radius:5px;
  border:1px solid rgba(242,194,107,.34);
  border-bottom-width:2px;
  background:linear-gradient(180deg,rgba(255,244,215,.13),rgba(255,244,215,.03));
  color:var(--gold-bright);
  font-family:ui-monospace,"Cascadia Mono","Consolas",monospace;
  font-size:10.5px;
  font-weight:700;
  line-height:1;
  white-space:nowrap;
}

.goal-strip{
  display:flex;
  gap:10px;
  align-items:center;
  padding:10px 12px;
  margin-bottom:22px;
  border-left:2px solid var(--gold);
  background:linear-gradient(90deg, rgba(242,194,107,.10), rgba(242,194,107,0));
  border-radius:0 9px 9px 0;
}
.goal-strip svg{width:23px;height:23px;flex:none;}
.goal-strip p{margin:0;font-size:12px;line-height:1.6;color:#cdbbaa;}
.goal-strip b{color:var(--gold-bright);margin-right:6px;}
.touch-note{
  display:none;
  margin:0 0 12px;
  font-size:10px;
  line-height:1.55;
  color:#a9988e;
  text-align:center;
}
body.touch .touch-note{display:block;}

.primary-btn,.ghost-btn{
  appearance:none;
  border:0;
  cursor:pointer;
  font-family:inherit;
  font-weight:800;
  font-size:16px;
  transition:transform .16s ease, filter .16s ease, background .16s ease, border-color .16s ease;
}
.primary-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:18px;
  min-width:210px;
  padding:14px 26px;
  border-radius:11px;
  color:#2b170b;
  background:linear-gradient(180deg,#ffe1a0 0%,#f1bd63 55%,#d3983f 100%);
  border:1px solid #ffe8b7;
  box-shadow:0 6px 0 #7b4b1e, 0 14px 28px rgba(0,0,0,.35), inset 0 1px 0 #fff4d5;
  text-shadow:0 1px 0 rgba(255,255,255,.35);
}
.primary-btn span{font-size:20px;line-height:0;transition:transform .16s ease;}
.primary-btn:hover{filter:brightness(1.06);transform:translateY(-1px);}
.primary-btn:hover span{transform:translateX(3px);}
.primary-btn:active{transform:translateY(4px);box-shadow:0 2px 0 #7b4b1e, 0 7px 16px rgba(0,0,0,.35);}
.ghost-btn{
  min-width:150px;
  padding:13px 24px;
  border-radius:11px;
  color:var(--gold-bright);
  background:rgba(255,239,199,.045);
  border:1px solid rgba(242,194,107,.34);
}
.ghost-btn:hover{background:rgba(255,239,199,.10);border-color:rgba(242,194,107,.62);}
.ghost-btn:active{transform:translateY(2px);}
.footnote{
  margin:15px 0 0;
  font-size:10.5px;
  letter-spacing:.05em;
  color:#8f8078;
}

.panel{
  position:relative;
  z-index:1;
  width:min(560px,92vw);
  padding:clamp(24px,4vw,44px);
  border-radius:22px;
  border:1px solid var(--line);
  background:
    linear-gradient(150deg, rgba(34,22,43,.97), rgba(13,9,20,.98));
  box-shadow:0 36px 100px rgba(0,0,0,.72), inset 0 1px 0 rgba(255,239,199,.12);
  text-align:center;
  touch-action:pan-y;
}
.panel h2{
  margin:0;
  font-size:clamp(30px,4.4vw,46px);
  line-height:1.1;
  color:#fff5e2;
  text-shadow:0 3px 0 #5e3320;
}
.pause-controls{
  display:grid;
  grid-template-columns:1fr;
  gap:1px;
  margin:24px 0 18px;
  border:1px solid rgba(242,194,107,.14);
  border-radius:12px;
  overflow:hidden;
  background:rgba(242,194,107,.10);
}
.pause-controls>div{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:8px 13px;
  background:rgba(12,9,18,.72);
}
.pause-controls span{display:flex;gap:4px;}
.pause-controls b{font-size:12px;font-weight:600;color:#c9b8aa;}
.tip-line{
  margin:0 0 22px;
  font-size:11.5px;
  line-height:1.65;
  color:#9f8f86;
}
.button-row{display:flex;justify-content:center;gap:12px;flex-wrap:wrap;}

.result-panel{width:min(620px,92vw);}
.result-panel h2{font-size:clamp(36px,5vw,54px);}
.result-copy{margin:14px 0 4px;font-size:13px;line-height:1.7;color:#bfae9f;}
.rating{
  display:flex;
  justify-content:center;
  align-items:flex-end;
  gap:8px;
  min-height:56px;
  margin:12px 0 4px;
}
.rating .star{
  width:34px;
  height:34px;
  opacity:.18;
  transform:scale(.86);
  transition:opacity .4s ease, transform .4s cubic-bezier(.2,1.5,.4,1);
}
.rating .star.lit{opacity:1;transform:scale(1);}
.rating .grade{
  margin-left:16px;
  font-family:Georgia,"Times New Roman",serif;
  font-size:56px;
  line-height:.9;
  font-style:italic;
  color:var(--gold-bright);
  text-shadow:0 0 28px rgba(242,194,107,.4);
}
.stats{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:8px;
  margin:20px 0 26px;
}
.stat{
  padding:11px 7px;
  border:1px solid rgba(242,194,107,.13);
  border-radius:9px;
  background:rgba(255,239,199,.035);
}
.stat b{display:block;font-size:19px;color:var(--gold-bright);line-height:1.25;}
.stat span{display:block;margin-top:3px;font-size:10px;color:#9d8c83;}

#touch-controls{
  position:absolute;
  inset:0;
  z-index:7;
  display:none;
  pointer-events:none;
}
body.touch #touch-controls{display:block;}
body.touch #touch-controls.hidden{display:none;}
.touch-pad{
  position:absolute;
  left:max(14px, env(safe-area-inset-left));
  bottom:max(12px, env(safe-area-inset-bottom));
  width:178px;
  height:178px;
  display:grid;
  grid-template-columns:repeat(3,1fr);
  grid-template-rows:repeat(3,1fr);
  gap:5px;
  pointer-events:none;
}
.tbtn{
  pointer-events:auto;
  appearance:none;
  border:1px solid rgba(242,194,107,.30);
  background:rgba(19,13,27,.62);
  -webkit-backdrop-filter:blur(5px);
  backdrop-filter:blur(5px);
  color:#f4e5ca;
  border-radius:14px;
  font-family:inherit;
  font-weight:800;
  font-size:16px;
  box-shadow:0 3px 12px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.09);
  touch-action:none;
  transition:background .08s ease, transform .08s ease;
}
.tbtn:active,.tbtn.pressed{background:rgba(242,194,107,.28);transform:scale(.95);}
.touch-pad .up{grid-area:1/2;}
.touch-pad .left{grid-area:2/1;}
.touch-pad .down{grid-area:3/2;}
.touch-pad .right{grid-area:2/3;}
.pad-center{
  grid-area:2/2;
  align-self:center;
  justify-self:center;
  width:10px;
  height:10px;
  border-radius:50%;
  background:rgba(242,194,107,.28);
}
.touch-actions{
  position:absolute;
  right:max(14px, env(safe-area-inset-right));
  bottom:max(12px, env(safe-area-inset-bottom));
  display:grid;
  grid-template-columns:repeat(2, 76px);
  grid-template-rows:repeat(2, 64px);
  gap:8px;
  pointer-events:none;
}
.tbtn.act{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:1px;
  border-radius:18px;
}
.tbtn.act b{font-size:17px;line-height:1;color:var(--gold-bright);}
.tbtn-ico{width:18px;height:18px;display:block;filter:drop-shadow(0 1px 2px rgba(0,0,0,.5));}
.tbtn.act span{font-size:9.5px;font-weight:600;color:#cbb9a8;letter-spacing:.08em;}
.tbtn.act.interact{background:rgba(242,194,107,.13);}
.tbtn.act.throw{border-color:rgba(255,143,96,.4);}
.tbtn.act.throw b{color:#ffb07f;}

#rotate-hint{
  display:none;
  position:absolute;
  top:max(10px, env(safe-area-inset-top));
  left:50%;
  transform:translateX(-50%);
  z-index:20;
  padding:7px 13px;
  border-radius:999px;
  background:rgba(17,11,24,.8);
  border:1px solid rgba(242,194,107,.24);
  color:#d9c7b5;
  font-size:10.5px;
  letter-spacing:.06em;
  pointer-events:none;
}
@media (orientation:portrait){
  body.touch #rotate-hint{display:block;}
}

@media (max-width:900px){
  .title-card{
    grid-template-columns:1fr;
    gap:12px;
    width:min(620px,94vw);
    padding:24px 22px;
    max-height:94vh;
  }
  .title-art{max-width:190px;margin:0 auto;}
  .mascot{max-width:190px;}
  h1{font-size:clamp(36px,9vw,50px);text-align:center;}
  .eyebrow{text-align:center;}
  .tagline{text-align:center;margin:12px 0 16px;}
  .howto{grid-template-columns:repeat(5,1fr);}
  .howto-item{padding:8px 2px;}
  .goal-strip{margin-bottom:16px;}
  .primary-btn{width:100%;}
  .footnote{text-align:center;}
  .title-copy{display:flex;flex-direction:column;align-items:center;}
  .title-copy .goal-strip{width:100%;}
  .rating .grade{font-size:44px;}
}
@media (max-height:620px){
  .title-art{display:none;}
  .title-card{grid-template-columns:1fr;width:min(720px,94vw);padding:22px 28px;}
  .title-copy{display:flex;flex-direction:column;align-items:center;}
  h1{font-size:clamp(32px,6vw,46px);text-align:center;}
  .eyebrow{text-align:center;}
  .tagline{text-align:center;margin:10px 0 14px;}
  .howto{width:100%;}
  .goal-strip{width:100%;}
  .primary-btn{width:auto;}
  .footnote{margin-top:10px;}
  .screen{padding:10px;}
}
@media (prefers-reduced-motion:reduce){
  .mascot{animation:none;}
}

/* 横屏手机 / 矮窗口：把标题卡压缩成一屏可开始 */
@media (max-height:500px){
  .screen{padding:8px;}
  .title-card{
    width:min(780px,96vw);
    max-height:96vh;
    padding:12px 20px;
    gap:6px;
    grid-template-columns:1fr;
    border-radius:16px;
  }
  .title-art{display:none;}
  .title-copy{display:flex;flex-direction:column;align-items:center;}
  .eyebrow{font-size:8px;letter-spacing:.18em;margin-bottom:4px;}
  h1{font-size:clamp(30px,6.4vh,38px);line-height:1;text-align:center;}
  h1 span{margin-top:5px;}
  .tagline{display:none;}
  .howto{width:100%;gap:4px;margin-top:8px;margin-bottom:8px;}
  .howto-item{padding:6px 2px;border-radius:7px;}
  .howto-item b{font-size:9px;margin-top:3px;}
  .keys{height:18px;gap:2px;}
  kbd{min-width:18px;height:17px;padding:0 3px;font-size:9px;}
  .goal-strip{width:100%;margin-bottom:10px;padding:6px 8px;}
  .goal-strip svg{width:18px;height:18px;}
  .goal-strip p{font-size:10px;line-height:1.4;}
  .touch-note{font-size:9px;margin:0 0 7px;line-height:1.4;}
  .primary-btn{padding:9px 18px;font-size:14px;min-width:170px;box-shadow:0 4px 0 #7b4b1e,0 8px 18px rgba(0,0,0,.32),inset 0 1px 0 #fff4d5;}
  .footnote{display:none;}
  .panel{max-height:96vh;overflow:auto;padding:18px 22px;}
  .panel h2{font-size:30px;}
  .pause-controls{margin:10px 0 8px;}
  .pause-controls>div{padding:5px 10px;}
  .pause-controls b{font-size:10.5px;}
  .tip-line{font-size:10px;margin-bottom:12px;}
  .result-panel h2{font-size:34px;}
  .result-copy{font-size:11px;margin:8px 0 2px;}
  .rating{min-height:38px;margin:4px 0;}
  .rating .star{width:24px;height:24px;}
  .rating .grade{font-size:40px;margin-left:10px;}
  .stats{margin:10px 0 13px;gap:5px;}
  .stat{padding:6px 4px;}
  .stat b{font-size:15px;}
  .stat span{font-size:9px;}
  .ghost-btn{min-width:120px;padding:9px 16px;font-size:14px;}
  .button-row{gap:8px;}
  .tbtn.act{font-size:14px;}
  .touch-pad{width:112px;height:112px;gap:4px;left:max(6px, env(safe-area-inset-left));bottom:max(8px, env(safe-area-inset-bottom));}
  .touch-actions{grid-template-columns:repeat(2,56px);grid-template-rows:repeat(2,48px);gap:6px;right:max(8px, env(safe-area-inset-right));bottom:max(8px, env(safe-area-inset-bottom));}
  .tbtn{border-radius:12px;font-size:14px;}
  .tbtn.act b{font-size:15px;}
  .tbtn.act span{font-size:8px;}
}

