
*{box-sizing:border-box}
html,body{
  width:100%;
  height:100%;
  margin:0;
  overflow:hidden;
  background:#08111d;
  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;
  color:#f7fbff;
  -webkit-user-select:none;
  user-select:none;
}
body{touch-action:none}
#app{position:fixed;inset:0;overflow:hidden}
#game{
  position:absolute;
  inset:0;
  width:100vw;
  height:100vh;
  display:block;
  touch-action:none;
  background:#08111d;
}
#hud{
  position:absolute;
  left:12px;
  right:12px;
  top:calc(env(safe-area-inset-top) + 10px);
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  z-index:30;
  pointer-events:none;
}
.hudBox{
  min-width:92px;
  padding:10px 14px 8px;
  border-radius:18px;
  text-align:center;
  background:linear-gradient(180deg, rgba(0,0,0,0.44), rgba(0,0,0,0.22));
  border:1px solid rgba(255,255,255,0.08);
  box-shadow:0 12px 30px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.hudBox.center{min-width:132px}
.hudBox .small{
  display:block;
  font-size:12px;
  letter-spacing:1.2px;
  opacity:.86;
  margin-bottom:3px;
  font-weight:800;
}
.hudBox span:last-child{
  font-size:28px;
  font-weight:900;
  line-height:1;
}
.overlay{
  position:absolute;
  inset:0;
  z-index:20;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(2, 8, 17, 0.44);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.overlay.hidden{display:none}
.card{
  width:min(520px, calc(100vw - 28px));
  padding:22px 18px 18px;
  border-radius:24px;
  background:linear-gradient(180deg, rgba(14, 24, 38, 0.88), rgba(8, 16, 28, 0.92));
  border:1px solid rgba(255,255,255,0.10);
  box-shadow:0 24px 60px rgba(0,0,0,0.45);
  text-align:center;
}
.card.wide{width:min(720px, calc(100vw - 28px))}
.title{
  font-size:clamp(26px, 4vw, 42px);
  font-weight:900;
  margin-bottom:8px;
}
.sub{
  font-size:15px;
  line-height:1.45;
  opacity:.92;
  margin-bottom:16px;
}
.hint{
  font-size:13px;
  opacity:.72;
  margin-top:12px;
}
.primary{
  appearance:none;
  border:0;
  cursor:pointer;
  padding:14px 22px;
  font-size:18px;
  font-weight:800;
  color:white;
  border-radius:16px;
  background:linear-gradient(180deg, #4a8cff, #2b64e8);
  box-shadow:0 12px 30px rgba(43,100,232,.35);
}
.primary:active{transform:translateY(1px)}
.barOuter{
  width:100%;
  height:14px;
  border-radius:999px;
  background:rgba(255,255,255,0.09);
  overflow:hidden;
}
.barInner{
  width:0%;
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg, #76ff7a, #43d0ff);
  transition:width .12s linear;
}
.faceGrid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(92px, 1fr));
  gap:12px;
  margin:16px 0 18px;
}
.facePick{
  appearance:none;
  border:2px solid rgba(255,255,255,0.12);
  background:rgba(255,255,255,0.04);
  border-radius:18px;
  padding:8px;
  cursor:pointer;
  position:relative;
  overflow:hidden;
}
.facePick img{
  width:100%;
  aspect-ratio:1/1;
  object-fit:cover;
  display:block;
  border-radius:14px;
}
.facePick.sel{
  border-color:#6ed0ff;
  box-shadow:0 0 0 2px rgba(110,208,255,0.22);
}
#controls{
  position:absolute;
  left:0;
  right:0;
  bottom:calc(env(safe-area-inset-bottom) + 14px);
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  padding:0 14px;
  z-index:25;
  pointer-events:auto;
}
.controlGroup{
  display:flex;
  gap:12px;
}
.controlBtn{
  width:84px;
  height:84px;
  border-radius:24px;
  border:1px solid rgba(255,255,255,0.12);
  background:linear-gradient(180deg, rgba(255,255,255,0.22), rgba(255,255,255,0.10));
  color:white;
  font-size:30px;
  font-weight:900;
  text-shadow:0 2px 6px rgba(0,0,0,.35);
  box-shadow:0 14px 30px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  touch-action:none;
  -webkit-tap-highlight-color: transparent;
}
.controlBtn.jump{
  width:96px;
  height:96px;
  border-radius:28px;
}
.controlBtn:active{
  transform:translateY(1px) scale(0.98);
}
@media (max-width: 900px){
  .hudBox{min-width:84px}
  .hudBox.center{min-width:120px}
  .hudBox span:last-child{font-size:25px}
  .controlBtn{width:74px;height:74px;font-size:26px;border-radius:22px}
  .controlBtn.jump{width:86px;height:86px;border-radius:24px}
}
@media (max-width: 420px){
  .controlBtn{width:70px;height:70px}
  .controlBtn.jump{width:82px;height:82px}
  .card{padding:18px 14px 14px}
}
