:root{
  --ink: #02040a;
  --ink-2: #050a12;
  --gold: #f3cf8a;
  --gold-hot: #ffb45e;
  --amber: #ff8a3c;
  --ice: #a9ecff;
  --ice-dim: #66a9bd;
  --paper: #e7f1f6;
  --muted: #8ea5b5;
  --dim: #566a78;
  --line: rgba(178, 214, 232, .18);
  --line-strong: rgba(190, 226, 242, .34);
  --sans: "Bahnschrift", "DIN Alternate", "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", serif;
  --mono: "Cascadia Mono", "Consolas", "SFMono-Regular", monospace;
}

*{ box-sizing: border-box; }

html, body{
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: none;
  touch-action: none;
}

body{
  background:
    radial-gradient(120% 90% at 68% 48%, #08101e 0%, #03060c 48%, #010206 100%);
  cursor: default;
}
body.playing{ cursor: crosshair; }
body.touch .hud-keys{ display: none; }
body.touch .boost-key{ display: none; }
body.touch .hud-bl{
  top: 128px;
  bottom: auto;
  left: 18px;
  width: 176px;
}
body.touch .objective{ bottom: 16px; }
@media (max-width: 720px){
  body.touch .objective{ bottom: 190px; }
}

/* ============================= SHARE ============================= */
.share-btn{
  position: fixed;
  top: 12px;
  right: 54px;
  z-index: 21;
  height: 30px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(243, 207, 138, .28);
  border-radius: 999px;
  background: rgba(5, 9, 14, .42);
  color: rgba(243, 220, 178, .8);
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: .16em;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: color .25s, border-color .25s, background .25s;
}
.share-btn b{ font-weight: 400; color: var(--ice); font-size: 12px; line-height: 1; }
.share-btn:hover{ color: #fff2d8; border-color: rgba(243, 207, 138, .7); background: rgba(243, 207, 138, .1); }

.share-screen{
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background:
    radial-gradient(circle at 68% 38%, rgba(16, 33, 48, .42), rgba(1, 3, 8, .92) 68%),
    rgba(1, 3, 7, .86);
  backdrop-filter: blur(14px);
}
.share-shell{
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(350px, .98fr);
  gap: clamp(20px, 3vw, 38px);
  align-items: center;
  width: min(1220px, 95vw);
  max-height: 93vh;
  padding: clamp(18px, 2.2vw, 30px);
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(10, 18, 28, .78), rgba(3, 7, 13, .72));
  box-shadow: 0 30px 120px rgba(0, 0, 0, .7), inset 0 0 80px rgba(90, 170, 210, .035);
  overflow: auto;
  animation: rise .5s cubic-bezier(.16,.8,.24,1) both;
}
.share-close{
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(180, 215, 230, .18);
  border-radius: 50%;
  background: rgba(3, 8, 14, .5);
  color: #9fb5c1;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  transition: color .25s, border-color .25s;
}
.share-close:hover{ color: var(--gold); border-color: rgba(243, 207, 138, .55); }
.share-preview-wrap{
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
#share-canvas{
  display: block;
  width: min(100%, 63vh);
  height: auto;
  max-width: 100%;
  max-height: none;
  object-fit: contain;
  border: 1px solid rgba(190, 225, 240, .2);
  background: #02050a;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .55);
}
.share-preview-cap{
  font-size: 8px;
  letter-spacing: .28em;
  color: var(--dim);
  text-align: center;
}
.share-panel{
  padding: 8px 0 4px;
  min-width: 0;
}
.share-panel h2{
  margin: 8px 0 12px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 3.4vw, 48px);
  line-height: 1.35;
  letter-spacing: .14em;
  color: #f5e8d1;
}
.share-lede{
  margin: 0 0 10px;
  color: #8fa5b3;
  font-family: var(--serif);
  font-size: 12px;
  line-height: 1.9;
  letter-spacing: .06em;
}
.share-run-line{
  margin: 0 0 12px;
  color: #f0d9ad;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .1em;
}
.share-run-line b{ color: var(--ice); font-weight: 500; }
.share-tone-row{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}
.tone-chip{
  height: 25px;
  padding: 0 11px;
  border: 1px solid rgba(170, 215, 235, .18);
  border-radius: 999px;
  background: rgba(2, 7, 12, .35);
  color: #78909e;
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: .12em;
  cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
}
.tone-chip:hover{ color: #cfeaf4; border-color: rgba(160, 235, 255, .4); }
.tone-chip.active{
  color: #10202c;
  border-color: rgba(243, 207, 138, .8);
  background: linear-gradient(180deg, #f6e5c2, #d7b37a);
}
.share-benefits{
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 10px 0 0;
  color: #6d8491;
  font-size: 8px;
  letter-spacing: .14em;
}
.share-benefits span::before{
  content: '·';
  margin-right: 6px;
  color: var(--gold);
}
.share-copy-box{
  min-height: 78px;
  padding: 14px 16px;
  border-left: 1px solid rgba(243, 207, 138, .55);
  background: linear-gradient(90deg, rgba(243, 207, 138, .075), transparent);
  color: #dbe8ef;
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.9;
  letter-spacing: .06em;
}
.share-copy-box p{ margin: 0; }
.share-actions{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 16px 0 18px;
}
.share-actions .cta{ min-width: 0; flex: 1 1 160px; }
.share-adv{
  margin-top: 14px;
  border-top: 1px solid rgba(170, 210, 230, .1);
}
.share-adv summary{
  padding: 10px 0 0;
  color: #6e8491;
  font-size: 8px;
  letter-spacing: .16em;
  cursor: pointer;
  list-style: none;
}
.share-adv summary::-webkit-details-marker{ display: none; }
.share-adv summary::before{ content: '＋ '; color: var(--gold); }
.share-adv[open] summary::before{ content: '－ '; }
.share-url-block{
  padding-top: 10px;
}
.share-url-block label{
  display: block;
  margin-bottom: 8px;
  font-size: 8px;
  letter-spacing: .24em;
  color: var(--dim);
}
.share-url-row{ display: flex; gap: 8px; }
#share-url-input{
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(170, 215, 235, .18);
  background: rgba(2, 7, 12, .7);
  color: #cfe2ea;
  font-family: var(--mono);
  font-size: 10px;
  outline: none;
}
#share-url-input:focus{ border-color: rgba(160, 235, 255, .5); }
.mini-btn{
  height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(130, 220, 245, .3);
  background: rgba(40, 110, 135, .15);
  color: var(--ice);
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: .16em;
  cursor: pointer;
}
.share-note{
  margin: 8px 0 0;
  color: #c39a6a;
  font-size: 9px;
  line-height: 1.7;
  letter-spacing: .04em;
}
.challenge-banner{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin: 12px 0 2px;
  padding: 7px 12px;
  border: 1px solid rgba(243, 207, 138, .34);
  background: linear-gradient(90deg, rgba(243, 207, 138, .12), rgba(4, 10, 16, .2));
  color: #c3d3dc;
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: .1em;
  animation: rise .55s ease both;
}
.challenge-banner.hidden{ display: none; }
.challenge-tag{
  color: #1a2630;
  background: var(--gold);
  padding: 3px 6px;
  font-size: 8px;
  letter-spacing: .12em;
}
.challenge-banner b{ color: #fff1d2; font-weight: 500; font-family: var(--mono); }
.challenge-banner em{ color: #8fcfe4; font-style: normal; }
.share-tip{
  margin: 12px 0 0;
  color: #657b88;
  font-size: 9px;
  line-height: 1.8;
  letter-spacing: .04em;
}
.share-feedback{
  min-height: 16px;
  margin-top: 8px;
  color: var(--ice);
  font-size: 9px;
  letter-spacing: .12em;
  opacity: 0;
  transition: opacity .25s;
}
.share-feedback.show{ opacity: 1; }

/* touch D-pad */
.touch-dpad{
  position: absolute;
  left: 18px;
  bottom: 22px;
  width: 156px;
  height: 156px;
  z-index: 6;
  display: none;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  pointer-events: none;
}
body.touch #hud.active .touch-dpad{ display: grid; }
.dpad-btn{
  align-self: center;
  justify-self: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(150, 225, 245, .3);
  background: radial-gradient(circle, rgba(80, 180, 215, .16), rgba(3, 11, 17, .42));
  color: rgba(190, 240, 255, .8);
  font-size: 15px;
  line-height: 1;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  backdrop-filter: blur(4px);
}
.dpad-btn:active{ background: rgba(120, 225, 250, .25); border-color: rgba(170, 245, 255, .7); }
.dpad-btn.up{ grid-area: 1 / 2; }
.dpad-btn.left{ grid-area: 2 / 1; }
.dpad-btn.right{ grid-area: 2 / 3; }
.dpad-btn.down{ grid-area: 3 / 2; }
body.touch .touch-thrust{ width: 84px; height: 84px; right: 24px; bottom: 186px; font-size: 12px; }
body.touch .touch-boost{ width: 66px; height: 66px; right: 32px; bottom: 100px; font-size: 10px; }

canvas{ display: block; }

#gl{
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: #010206;
}

#scene{
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background: transparent;
  pointer-events: auto;
  touch-action: none;
}
body.no-gl #gl{
  background:
    radial-gradient(circle at 66% 47%, rgba(255, 190, 110, .22) 0 6%, rgba(255, 140, 60, .10) 18%, transparent 38%),
    radial-gradient(90% 60% at 66% 47%, #1a120d 0%, #070a10 45%, #02040a 75%);
}

#fx{
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

#flash{
  position: fixed;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 50% 50%, #f4fdff 0%, #a9e6ff 42%, #2a6f96 100%);
  mix-blend-mode: screen;
  transition: opacity .18s ease-out;
}

/* ============================= HUD ============================= */
#hud{
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease .1s;
}
#hud.active{ opacity: 1; }
#hud::before, #hud::after{
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  pointer-events: none;
}
#hud::before{
  top: 0;
  height: 190px;
  background: linear-gradient(180deg, rgba(1, 3, 8, .52) 0%, rgba(1, 3, 8, .18) 55%, transparent 100%);
}
#hud::after{
  bottom: 0;
  height: 150px;
  background: linear-gradient(0deg, rgba(1, 3, 8, .55) 0%, rgba(1, 3, 8, .14) 60%, transparent 100%);
}

.hud-block{
  position: absolute;
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--muted);
  text-shadow: 0 1px 8px rgba(0,0,0,.9);
}
.hud-block::before,
.hud-block::after{
  content: "";
  position: absolute;
  width: 12px;
  height: 1px;
  background: var(--line-strong);
  opacity: .9;
}
.hud-block::before{ left: 0; top: 0; }
.hud-block::after{ right: 0; bottom: 0; }
.hud-tl::before{ width: 34px; background: linear-gradient(90deg, var(--gold), transparent); }
.hud-tl{ top: clamp(26px, 4.2vh, 52px); left: clamp(24px, 3.4vw, 62px); min-width: 236px; padding-left: 14px; }
.hud-tr{ top: clamp(26px, 4.2vh, 52px); right: clamp(24px, 3.4vw, 62px); width: 246px; text-align: right; }
.hud-bl{ bottom: clamp(28px, 5vh, 58px); left: clamp(24px, 3.4vw, 62px); width: 250px; }
.hud-keys{
  position: absolute;
  right: clamp(24px, 3.4vw, 62px);
  bottom: clamp(26px, 4.6vh, 52px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  font-size: 10px;
  letter-spacing: .16em;
  color: var(--dim);
  text-shadow: 0 1px 8px #000;
}
.hud-keys > div{ display: flex; align-items: center; gap: 6px; }
.hud-keys span{ margin-right: 6px; }

kbd{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 19px;
  padding: 0 6px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: rgba(6, 14, 22, .55);
  color: #c8dbe6;
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: .1em;
  line-height: 1;
  box-shadow: inset 0 0 8px rgba(120, 200, 230, .06);
}

.hud-kicker{
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 9.5px;
  letter-spacing: .28em;
  color: var(--gold);
  margin-bottom: 10px;
  white-space: nowrap;
}
.hud-kicker i{
  width: 5px; height: 5px;
  background: var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--gold);
  animation: blink 2.4s ease-in-out infinite;
}
@keyframes blink{ 0%,100%{ opacity: 1; } 50%{ opacity: .25; } }

.frag-line{
  display: flex;
  align-items: baseline;
  gap: 4px;
  color: var(--paper);
  font-variant-numeric: tabular-nums;
}
#frag-num{
  font-size: 40px;
  line-height: .95;
  font-weight: 200;
  letter-spacing: .02em;
  color: #fff7e6;
  text-shadow: 0 0 24px rgba(255, 196, 110, .35);
}
.slash{ color: var(--dim); font-size: 19px; margin: 0 1px; }
.frag-total{ color: var(--muted); font-size: 19px; }
.frag-label{
  margin-left: 10px;
  font-size: 10px;
  letter-spacing: .26em;
  color: var(--gold);
}
.meter{
  position: relative;
  height: 2px;
  margin-top: 12px;
  background: rgba(160, 200, 220, .12);
  overflow: hidden;
}
.meter i{
  display: block;
  height: 100%;
  width: 0%;
  transition: width .35s cubic-bezier(.2,.7,.2,1);
}
.meter-gold i{ background: linear-gradient(90deg, #8e5d2a, var(--gold)); box-shadow: 0 0 10px rgba(255, 200, 120, .8); }
.meter-ice i{ background: linear-gradient(90deg, #2b5f74, var(--ice)); box-shadow: 0 0 10px rgba(150, 230, 255, .7); }
.meter-cyan i{ background: linear-gradient(90deg, #1d6070, #9ff3ff); box-shadow: 0 0 10px rgba(130, 240, 255, .75); }
.hud-note{
  margin-top: 9px;
  font-size: 9px;
  letter-spacing: .2em;
  color: var(--dim);
}

.hud-row{
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 7px;
  margin-bottom: 7px;
  font-size: 10px;
  letter-spacing: .18em;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.hud-row b{
  font-weight: 400;
  font-size: 15px;
  letter-spacing: .06em;
  color: #e6f2f8;
}
.hud-row em{ font-style: normal; font-size: 9px; color: var(--dim); }
.hud-row.sub b{ font-size: 12px; color: #a9bfcb; }
.hud-tr .meter{ margin: 4px 0 13px; }

.brand-mark{
  position: absolute;
  top: clamp(22px, 3.4vh, 38px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 9.5px;
  letter-spacing: .5em;
  color: rgba(220, 238, 247, .62);
  text-shadow: 0 1px 10px #000;
  white-space: nowrap;
}
.brand-mark span.cn{
  font-family: var(--serif);
  letter-spacing: .34em;
  font-size: 10px;
  color: rgba(243, 207, 138, .72);
  margin-left: 2px;
}
.brand-mark i{
  width: 28px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(190, 225, 240, .45), transparent);
}

.score-mark{
  position: absolute;
  top: clamp(48px, 7.6vh, 76px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 8.5px;
  letter-spacing: .34em;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.score-mark b{
  font-weight: 300;
  font-size: 15px;
  letter-spacing: .18em;
  color: rgba(225, 240, 246, .74);
}

.boost-key{
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 9px;
  letter-spacing: .2em;
  color: var(--dim);
}
.boost-key kbd{ color: var(--ice); border-color: rgba(130, 220, 245, .3); }
.boost-key #boost-ready{
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--ice);
  box-shadow: 0 0 10px var(--ice);
  margin-left: auto;
  opacity: .95;
  transition: opacity .2s, background .2s;
}
.boost-key #boost-ready.empty{ background: #4b3030; box-shadow: none; opacity: .6; }

/* warning / objective / combo */
.warning{
  position: absolute;
  left: 50%;
  top: clamp(92px, 14vh, 132px);
  transform: translateX(-50%);
  padding: 7px 18px;
  font-size: 10.5px;
  letter-spacing: .28em;
  color: #ffd9a0;
  border-top: 1px solid rgba(255, 170, 90, .42);
  border-bottom: 1px solid rgba(255, 170, 90, .18);
  background: linear-gradient(90deg, transparent, rgba(40, 15, 5, .55), transparent);
  opacity: 0;
  transition: opacity .25s;
  white-space: nowrap;
  text-shadow: 0 0 12px rgba(255, 130, 50, .5);
}
.warning.show{ opacity: 1; animation: warnPulse 1.15s ease-in-out infinite; }
.warning.danger{ color: #ffb0a0; border-color: rgba(255, 80, 60, .5); text-shadow: 0 0 16px rgba(255,60,30,.7); }
@keyframes warnPulse{ 0%,100%{ opacity: .55; } 50%{ opacity: 1; } }

.objective{
  position: absolute;
  left: 50%;
  bottom: clamp(28px, 4.6vh, 52px);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 9.5px;
  letter-spacing: .3em;
  color: #8095a2;
  white-space: nowrap;
  text-shadow: 0 1px 8px #000;
  transition: color .4s;
}
.objective::before, .objective::after{
  content: "";
  width: 40px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong));
}
.objective::after{ background: linear-gradient(90deg, var(--line-strong), transparent); }
.objective.live{ color: var(--ice); text-shadow: 0 0 14px rgba(120, 230, 255, .5); }

.combo-pop{
  position: absolute;
  left: 50%;
  top: 58%;
  transform: translate(-50%, 0) scale(.94);
  font-size: 11px;
  letter-spacing: .34em;
  color: var(--gold);
  opacity: 0;
  text-shadow: 0 0 18px rgba(255, 180, 90, .65);
  transition: opacity .3s, transform .3s;
  white-space: nowrap;
}
.combo-pop.show{ opacity: 1; transform: translate(-50%, -12px) scale(1); }

.toast{
  position: absolute;
  left: 50%;
  top: 30%;
  transform: translate(-50%, 10px);
  padding: 10px 22px;
  font-size: 10px;
  letter-spacing: .3em;
  color: #f6ecd7;
  background: rgba(8, 10, 14, .5);
  border: 1px solid var(--line);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .4s, transform .4s;
  white-space: nowrap;
}
.toast.show{ opacity: 1; transform: translate(-50%, 0); }

/* touch */
.touch-boost, .touch-thrust{
  position: absolute;
  right: 26px;
  width: 74px; height: 74px;
  border-radius: 50%;
  border: 1px solid rgba(130, 225, 250, .38);
  background: radial-gradient(circle, rgba(90, 190, 220, .16), rgba(4, 12, 18, .35));
  color: var(--ice);
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: .2em;
  display: none;
  pointer-events: auto;
  backdrop-filter: blur(4px);
  touch-action: none;
}
.touch-boost{ bottom: 96px; }
.touch-thrust{
  bottom: 184px;
  right: 30px;
  width: 64px; height: 64px;
  border-color: rgba(255, 205, 130, .34);
  color: var(--gold);
  background: radial-gradient(circle, rgba(235, 180, 100, .13), rgba(14, 10, 6, .35));
}
body.touch #hud.active .touch-boost,
body.touch #hud.active .touch-thrust{ display: block; }

.lock-hint{
  position: absolute;
  left: 50%;
  bottom: 74px;
  transform: translateX(-50%);
  padding: 6px 14px;
  font-size: 8px;
  letter-spacing: .22em;
  color: rgba(185, 225, 240, .55);
  border: 1px solid rgba(160, 215, 235, .12);
  background: rgba(2, 6, 12, .32);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .4s;
  white-space: nowrap;
  pointer-events: none;
}
.lock-hint.show{ opacity: 1; }

/* ============================= OVERLAYS ============================= */
.overlay{
  position: fixed;
  inset: 0;
  z-index: 10;
  opacity: 1;
  visibility: visible;
  transition: opacity .9s ease, visibility .9s;
}
.overlay.dismissed{
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.hidden{
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* title */
.title-screen{
  display: flex;
  align-items: center;
  background: radial-gradient(120% 120% at 70% 50%, transparent 20%, rgba(0,2,6,.5) 70%, rgba(0,2,6,.86) 100%);
}
.title-shade{
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(1, 3, 8, .92) 0%, rgba(1, 3, 8, .72) 32%, rgba(1, 3, 8, .2) 58%, transparent 72%);
  pointer-events: none;
}
.title-inner{
  position: relative;
  margin-left: clamp(26px, 7.2vw, 128px);
  width: min(560px, 46vw);
  padding: 3vh 0;
  animation: rise 1.6s cubic-bezier(.16,.8,.24,1) both;
}
@keyframes rise{
  from{ opacity: 0; transform: translateY(22px); }
  to{ opacity: 1; transform: translateY(0); }
}
.eyebrow{
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 9px;
  letter-spacing: .32em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 26px;
}
.eyebrow span{
  display: inline-block;
  width: 26px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}
.eyebrow.center{ justify-content: center; color: var(--ice-dim); }
.eyebrow.center span{ background: linear-gradient(90deg, transparent, var(--ice-dim)); }
.eyebrow.center span:last-child{ background: linear-gradient(90deg, var(--ice-dim), transparent); }

.title-inner h1{
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(52px, 7.4vw, 106px);
  line-height: 1;
  letter-spacing: .11em;
  background: linear-gradient(180deg, #fffaf0 2%, #f4dcb1 42%, #c1935a 88%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 32px rgba(255, 198, 120, .2));
}
@supports not ((-webkit-background-clip: text) or (background-clip: text)){
  .title-inner h1{ color: #f0d7a8; }
}
.title-en{
  margin-top: 14px;
  font-family: var(--sans);
  font-size: clamp(10px, 1.05vw, 13px);
  font-weight: 300;
  letter-spacing: .72em;
  color: rgba(240, 215, 172, .66);
}
.title-rule{
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 26px 0 22px;
}
.title-rule i{
  display: block;
  width: min(280px, 60%);
  height: 1px;
  background: linear-gradient(90deg, rgba(243, 207, 138, .6), transparent);
}
.title-rule em{
  font-style: normal;
  font-size: 9px;
  letter-spacing: .3em;
  color: var(--dim);
}
.lede{
  margin: 0 0 28px;
  font-family: var(--serif);
  font-size: clamp(13px, 1.12vw, 15.5px);
  line-height: 2.05;
  letter-spacing: .08em;
  color: #a7bac7;
  text-shadow: 0 1px 12px #000;
}
.controls-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-bottom: 34px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.controls-grid > div{
  padding: 14px 14px 15px 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  border-right: 1px solid rgba(170, 210, 230, .08);
}
.controls-grid > div:last-child{ border-right: 0; }
.controls-grid b{
  font-weight: 400;
  font-size: 10px;
  letter-spacing: .18em;
  color: #e2edf4;
  text-shadow: 0 1px 8px rgba(0,0,0,.95), 0 0 14px rgba(0,0,0,.7);
}
.controls-grid span{
  font-size: 9px;
  letter-spacing: .12em;
  color: #6f8491;
  line-height: 1.6;
  text-shadow: 0 1px 8px #000;
}

.cta{
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 16px 34px 15px;
  min-width: 246px;
  border: 1px solid rgba(243, 207, 138, .52);
  background: linear-gradient(100deg, rgba(243, 207, 138, .11), rgba(243, 207, 138, .015) 62%);
  color: var(--paper);
  font-family: var(--sans);
  cursor: pointer;
  overflow: hidden;
  transition: border-color .3s, background .3s, transform .3s;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}
.cta::after{
  content: "";
  position: absolute;
  left: 0; top: 0;
  width: 0%;
  height: 1px;
  background: var(--gold);
  box-shadow: 0 0 12px var(--gold);
  animation: ctaLine 3.6s ease-in-out infinite;
}
@keyframes ctaLine{
  0%, 15%{ width: 0; opacity: 0; }
  35%{ opacity: 1; }
  70%, 100%{ width: 100%; opacity: 0; }
}
.cta:hover{
  border-color: var(--gold);
  background: linear-gradient(100deg, rgba(243, 207, 138, .2), rgba(243, 207, 138, .04) 70%);
  transform: translateY(-1px);
}
.cta-main{
  font-size: 16px;
  letter-spacing: .24em;
  color: #fff4dd;
}
.cta-sub{
  font-size: 8px;
  letter-spacing: .26em;
  color: rgba(243, 207, 138, .62);
}
.cta.small{ min-width: 210px; padding: 13px 26px 12px; }
.cta.small .cta-main{ font-size: 14px; }

.footnote{
  margin-top: 20px;
  font-size: 9px;
  letter-spacing: .16em;
  color: #4c5e6b;
}

.title-side{
  position: absolute;
  right: clamp(24px, 4vw, 64px);
  bottom: clamp(30px, 5vh, 58px);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  font-size: 8.5px;
  letter-spacing: .22em;
  color: var(--dim);
  animation: rise 1.6s .35s cubic-bezier(.16,.8,.24,1) both;
}
.side-line{
  width: 120px;
  height: 1px;
  margin-bottom: 8px;
  background: linear-gradient(90deg, transparent, rgba(180, 215, 230, .3));
}
.side-data{ display: flex; align-items: baseline; gap: 12px; }
.side-data span{ color: #46545f; }
.side-data b{ font-weight: 400; color: #9fb4c1; font-variant-numeric: tabular-nums; }
.side-data.dim b{ color: #728692; }

/* pause & end */
.pause-screen, .end-screen{
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 45%, rgba(4, 10, 18, .55), rgba(1, 2, 6, .88) 70%);
  backdrop-filter: blur(10px);
}
.pause-card, .end-card{
  width: min(620px, 88vw);
  padding: 42px clamp(26px, 5vw, 58px) 38px;
  text-align: center;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(9, 16, 25, .72), rgba(3, 7, 13, .55));
  box-shadow: 0 30px 100px rgba(0,0,0,.6), inset 0 0 60px rgba(80, 150, 190, .035);
  animation: rise .5s cubic-bezier(.16,.8,.24,1) both;
}
.pause-card h2, .end-card h2{
  margin: 8px 0 14px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(32px, 4vw, 52px);
  letter-spacing: .18em;
  color: #f3e6cf;
}
.pause-card p, .end-card p{
  margin: 0 auto 26px;
  max-width: 440px;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: .1em;
  line-height: 2;
  color: var(--muted);
}
#resume-btn{ display: block; margin: 0 auto 12px; }
#share-pause-btn{
  display: block;
  margin: 0 auto 8px;
  padding: 8px 18px;
  border: 1px solid rgba(150, 225, 245, .28);
  background: rgba(40, 110, 135, .09);
  color: var(--ice);
  font-size: 9px;
  letter-spacing: .14em;
}
#share-pause-btn:hover{ border-color: rgba(160, 235, 255, .55); background: rgba(40, 110, 135, .2); }
#quit-btn{ display: block; margin: 0 auto; }
.pause-stats, .end-stats{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 28px 0 32px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.end-stats{ grid-template-columns: repeat(4, 1fr); }
.pause-stats > div, .end-stats > div{
  padding: 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-right: 1px solid rgba(170, 210, 230, .08);
}
.pause-stats > div:last-child, .end-stats > div:last-child{ border-right: 0; }
.pause-stats span, .end-stats span{
  font-size: 8.5px;
  letter-spacing: .22em;
  color: var(--dim);
}
.pause-stats b, .end-stats b{
  font-weight: 300;
  font-size: 15px;
  letter-spacing: .1em;
  color: #e8f3f8;
  font-variant-numeric: tabular-nums;
}
.end-actions{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.text-btn{
  border: 0;
  background: none;
  padding: 6px;
  color: var(--dim);
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: .22em;
  cursor: pointer;
  transition: color .25s;
}
.text-btn:hover{ color: var(--gold); }

/* muted / flash */
.mute-btn{
  position: fixed;
  top: 12px;
  right: 16px;
  z-index: 20;
  width: 30px; height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: rgba(190, 220, 235, .55);
  border: 1px solid rgba(170, 210, 230, .14);
  border-radius: 50%;
  background: rgba(4, 9, 15, .35);
  cursor: pointer;
  transition: color .25s, border-color .25s, opacity .25s;
}
.mute-btn:hover{ color: var(--gold); border-color: rgba(243, 207, 138, .5); }
.mute-btn.muted{ color: #5b4343; border-color: rgba(120, 80, 80, .3); }
.mute-btn.muted::after{
  content: "";
  position: absolute;
  width: 16px; height: 1px;
  background: #6b4b4b;
  transform: rotate(-45deg);
}

#rotate-hint{
  display: none;
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 30;
  padding: 8px 16px;
  font-size: 9px;
  letter-spacing: .2em;
  color: #b8cbd6;
  background: rgba(3, 8, 14, .8);
  border: 1px solid var(--line);
  white-space: nowrap;
}

.noscript{
  position: fixed;
  inset: 0;
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #02040a;
  color: var(--gold);
  letter-spacing: .2em;
}

/* 短屏 / 手机横屏：压缩标题与 HUD */
@media (max-height: 560px){
  .title-inner{
    width: min(640px, 66vw);
    margin-left: 5vw;
    padding: 0;
  }
  .eyebrow{ margin-bottom: 8px; font-size: 7px; letter-spacing: .26em; }
  .eyebrow span{ width: 18px; }
  .title-inner h1{ font-size: clamp(36px, 6.4vw, 58px); }
  .title-en{ margin-top: 6px; font-size: 8px; letter-spacing: .6em; }
  .title-rule{ margin: 9px 0; }
  .lede{ font-size: 10.5px; line-height: 1.7; margin-bottom: 10px; }
  .controls-grid{ margin-bottom: 12px; }
  .controls-grid > div{ padding: 7px 10px 7px 0; gap: 3px; }
  .controls-grid b{ font-size: 8px; }
  .controls-grid span{ font-size: 7.5px; }
  .cta{ padding: 9px 20px 8px; min-width: 190px; }
  .cta-main{ font-size: 13px; }
  .cta-sub{ font-size: 7px; }
  .footnote, .title-side{ display: none; }
  .hud-tl{ top: 14px; left: 18px; min-width: 0; padding-left: 10px; }
  .hud-tr{ top: 14px; right: 18px; width: 198px; }
  .hud-bl{ bottom: 16px; left: 18px; width: 178px; }
  .hud-keys, .brand-mark, .score-mark, .hud-note{ display: none; }
  .hud-kicker{ font-size: 7.5px; letter-spacing: .18em; margin-bottom: 5px; }
  #frag-num{ font-size: 26px; }
  .slash, .frag-total{ font-size: 15px; }
  .frag-label{ font-size: 8px; letter-spacing: .18em; margin-left: 6px; }
  .frag-line .meter{ margin-top: 7px; }
  .hud-row{ font-size: 8px; margin-bottom: 3px; letter-spacing: .12em; }
  .hud-row b{ font-size: 11px; }
  .hud-row.sub b{ font-size: 10px; }
  .hud-tr .meter{ margin: 2px 0 6px; }
  .hud-bl .meter{ margin-top: 6px; }
  .boost-key{ margin-top: 6px; font-size: 8px; }
  .objective{ bottom: 10px; font-size: 7.5px; letter-spacing: .18em; }
  .objective::before, .objective::after{ width: 16px; }
  .warning{ top: 56px; font-size: 8px; letter-spacing: .16em; padding: 5px 12px; }
  .toast{ top: 23%; font-size: 8px; padding: 7px 14px; }
  .combo-pop{ top: 52%; font-size: 9px; }
  .mute-btn{ display: none; }
  .touch-boost{ width: 58px; height: 58px; right: 16px; bottom: 64px; font-size: 9px; }
  .touch-thrust{ width: 52px; height: 52px; right: 19px; bottom: 134px; font-size: 8px; }
  .lock-hint{ bottom: 48px; font-size: 7px; }
  #rotate-hint{ bottom: auto; top: 118px; font-size: 8px; }
  .title-screen .title-shade{
    background: linear-gradient(90deg, rgba(1,3,8,.95) 0%, rgba(1,3,8,.82) 46%, rgba(1,3,8,.30) 72%, transparent 92%);
  }
  .pause-card, .end-card{ padding: 24px 28px 22px; }
  .pause-card h2, .end-card h2{ font-size: clamp(26px, 5vw, 38px); margin: 2px 0 8px; }
  .pause-card p, .end-card p{ font-size: 10px; margin-bottom: 14px; line-height: 1.7; }
  .pause-stats, .end-stats{ margin: 12px 0 16px; }
  .pause-stats > div, .end-stats > div{ padding: 9px 6px; gap: 4px; }
  .pause-stats b, .end-stats b{ font-size: 12px; }
  .end-actions{ gap: 10px; }
  .cta.small{ min-width: 180px; padding: 9px 20px; }
}

@media (max-width: 980px){
  .title-inner{ width: min(560px, 70vw); margin-left: 6vw; }
  .title-side{ display: none; }
  .hud-keys{ display: none; }
  .brand-mark{ display: none; }
  .score-mark{ top: 18px; }
  .hud-tl{ top: 42px; }
  .hud-tr{ top: 42px; }
}
@media (max-width: 720px){
  .title-inner{ width: 86vw; margin-left: 7vw; }
  .title-inner h1{ font-size: clamp(44px, 14vw, 72px); }
  .title-en{ letter-spacing: .5em; }
  .lede{ font-size: 12px; line-height: 1.9; }
  .title-screen .title-shade{ background: linear-gradient(180deg, rgba(1,3,8,.82), rgba(1,3,8,.5) 60%, rgba(1,3,8,.8)); }
  .controls-grid{ grid-template-columns: 1fr; }
  .controls-grid > div{ flex-direction: row; justify-content: space-between; border-right: 0; border-bottom: 1px solid rgba(170,210,230,.07); padding: 8px 0; }
  .pause-stats, .end-stats{ grid-template-columns: repeat(2, 1fr); }
  .pause-stats > div:nth-child(2), .end-stats > div:nth-child(2){ border-right: 0; }
  .hud-tl{ min-width: 0; }
  .hud-tr{ width: 180px; }
  #frag-num{ font-size: 30px; }
  .hud-bl{ width: 180px; }
  .hud-note{ display: none; }
  .objective{ font-size: 8px; letter-spacing: .16em; }
  .objective::before, .objective::after{ width: 14px; }
  .warning{ font-size: 9px; letter-spacing: .16em; }
}
@media (orientation: portrait) and (max-width: 820px){
  #rotate-hint{ display: block; }
  #hud.active ~ #rotate-hint{ display: none; }
}
@media (max-width: 700px){
  .share-shell{
    grid-template-columns: 1fr;
    width: min(620px, 94vw);
    max-height: 94vh;
    align-items: start;
    padding: 20px;
  }
  #share-canvas{ width: 100%; max-height: none; height: auto; }
  .share-panel{ padding-bottom: 14px; }
  .share-preview-cap{ display: none; }
  .share-panel h2{ font-size: clamp(28px, 8vw, 38px); }
  .share-actions .cta{ flex: 1 1 140px; }
}
@media (max-height: 560px) and (min-width: 701px){
  .share-shell{
    grid-template-columns: minmax(0, .88fr) minmax(300px, 1.12fr);
    width: min(980px, 96vw);
    max-height: 95vh;
    padding: 16px;
    gap: 18px;
    align-items: center;
  }
  #share-canvas{ width: min(100%, 60vh); max-height: none; height: auto; }
  .share-panel h2{ font-size: clamp(24px, 4.8vw, 34px); margin-bottom: 8px; }
  .share-lede{ margin-bottom: 10px; font-size: 10px; line-height: 1.7; }
  .share-copy-box{ min-height: 54px; padding: 9px 12px; font-size: 11px; line-height: 1.7; }
  .share-actions{ margin: 10px 0 12px; gap: 8px; }
  .share-actions .cta{ padding: 8px 14px; min-width: 0; }
  .share-actions .cta-main{ font-size: 11px; }
  .share-actions .cta-sub{ font-size: 6px; }
  .share-url-block{ padding-top: 8px; }
  .share-tip{ font-size: 8px; line-height: 1.6; }
  .share-btn{
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    top: 8px;
    height: 26px;
    padding: 0 10px;
    font-size: 8px;
  }
  body.touch .hud-bl{ top: 98px; }
  .touch-dpad{ width: 132px; height: 132px; left: 14px; bottom: 14px; }
  .dpad-btn{ width: 42px; height: 42px; font-size: 13px; }
  body.touch .touch-thrust{ width: 74px; height: 74px; right: 20px; bottom: 168px; font-size: 10px; }
  body.touch .touch-boost{ width: 60px; height: 60px; right: 27px; bottom: 92px; font-size: 9px; }
}
@media (max-height: 560px) and (max-width: 700px){
  .share-btn{
    left: 50%;
    right: auto;
    top: 8px;
    transform: translateX(-50%);
    height: 26px;
    font-size: 8px;
  }
  .share-shell{ max-height: 96vh; padding: 14px; }
  #share-canvas{ width: 100%; max-height: none; height: auto; }
  #share-canvas{ width: 100%; max-height: none; height: auto; }
  .share-panel h2{ font-size: 26px; }
  .share-lede{ font-size: 10px; }
  .share-copy-box{ font-size: 11px; min-height: 54px; }
  .share-actions .cta{ padding: 8px 12px; }
  .share-actions .cta-main{ font-size: 11px; }
  .share-tip{ font-size: 8px; }
  body.touch .hud-bl{ top: 98px; }
  .touch-dpad{ width: 132px; height: 132px; left: 14px; bottom: 14px; }
  .dpad-btn{ width: 42px; height: 42px; font-size: 13px; }
  body.touch .touch-thrust{ width: 74px; height: 74px; right: 20px; bottom: 168px; font-size: 10px; }
  body.touch .touch-boost{ width: 60px; height: 60px; right: 27px; bottom: 92px; font-size: 9px; }
}
body.playing .share-btn{ display: none; }
body.touch.playing .share-btn{
  display: inline-flex;
  left: 50%;
  right: auto;
  top: 8px;
  transform: translateX(-50%);
}
body.share-open .share-btn{ display: none; }
@media (prefers-reduced-motion: reduce){
  *{ animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}
