*{box-sizing:border-box}
html,body{
  width:100%;
  height:100%;
  margin:0;
  overflow:hidden;
  background:#060912;
  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;
  color:#fff;
  -webkit-user-select:none;
  user-select:none;
}
body{
  touch-action:none;
  overscroll-behavior:none;
}
#app{
  position:fixed;
  inset:0;
  overflow:hidden;
}
#game{
  position:absolute;
  inset:0;
  width:100vw;
  height:100vh;
  display:block;
  touch-action:none;
  background:#060912;
}
#hud{
  position:absolute;
  left:10px;
  right:10px;
  top:calc(env(safe-area-inset-top) + 8px);
  display:grid;
  grid-template-columns:1fr auto 1fr;
  gap:10px;
  align-items:start;
  z-index:20;
  pointer-events:none;
}
.panel,.centerPanel{
  border-radius:22px;
  border:1px solid rgba(255,255,255,.08);
  background:linear-gradient(180deg, rgba(11,16,25,.88), rgba(18,24,38,.64));
  box-shadow:0 14px 26px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
}
.panel{
  padding:10px 12px 12px;
}
.centerPanel{
  min-width:130px;
  padding:8px 16px 10px;
  text-align:center;
}
.labelRow{
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-size:12px;
  font-weight:900;
  letter-spacing:1px;
  opacity:.95;
}
.percent{
  margin-top:6px;
  font-size:34px;
  font-weight:1000;
  line-height:1;
  text-shadow:0 3px 12px rgba(0,0,0,.4);
}
.percent.enemy{
  color:#8ee5ff;
}
#roundText{
  font-size:12px;
  font-weight:900;
  letter-spacing:1.4px;
  opacity:.9;
}
#timer{
  font-size:clamp(24px, 3.2vw, 40px);
  font-weight:1000;
  line-height:1;
  margin-top:2px;
}
.announce{
  margin-top:4px;
  display:inline-block;
  padding:4px 12px;
  border-radius:999px;
  background:#ff2f4c;
  box-shadow:0 10px 24px rgba(255,47,76,.36);
  font-weight:1000;
  letter-spacing:1px;
}
.overlay{
  position:absolute;
  inset:0;
  z-index:30;
  display:flex;
  align-items:center;
  justify-content:center;
  background:radial-gradient(circle at center, rgba(10,14,21,.20), rgba(0,0,0,.68));
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
}
.hidden{display:none !important}
.card{
  width:min(760px, calc(100vw - 24px));
  padding:22px 18px 18px;
  border-radius:28px;
  background:linear-gradient(180deg, rgba(16,20,30,.94), rgba(8,10,15,.97));
  border:1px solid rgba(255,255,255,.08);
  box-shadow:0 30px 80px rgba(0,0,0,.44);
  text-align:center;
}
.title{
  font-size:clamp(28px, 4vw, 52px);
  line-height:1;
  font-weight:1000;
  margin-bottom:10px;
}
.subtitle,.hint{
  font-size:15px;
  line-height:1.45;
  opacity:.86;
}
.hint{
  margin-top:10px;
  font-size:13px;
  opacity:.74;
}
.faceGrid{
  margin:18px auto 18px;
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(92px,1fr));
  gap:12px;
}
.facePick{
  appearance:none;
  border:2px solid rgba(255,255,255,.08);
  background:linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03));
  border-radius:18px;
  padding:8px;
  box-shadow:0 10px 22px rgba(0,0,0,.18);
}
.facePick.sel{
  border-color:#7ad9ff;
  box-shadow:0 0 0 2px rgba(122,217,255,.18), 0 12px 24px rgba(0,0,0,.22);
}
.facePick img{
  width:100%;
  aspect-ratio:1/1;
  display:block;
  object-fit:cover;
  border-radius:14px;
}
.cta{
  appearance:none;
  border:0;
  cursor:pointer;
  padding:14px 22px;
  border-radius:16px;
  font-size:18px;
  font-weight:1000;
  color:#fff;
  background:linear-gradient(180deg,#4b8dff,#3457f3);
  box-shadow:0 16px 30px rgba(52,87,243,.34);
}
#controls{
  position:absolute;
  left:0;
  right:0;
  bottom:calc(env(safe-area-inset-bottom) + 12px);
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:12px;
  padding:0 12px;
  z-index:25;
}
.actions{
  display:flex;
  gap:10px;
}
.ctrl{
  appearance:none;
  width:72px;
  height:72px;
  border-radius:22px;
  border:1px solid rgba(255,255,255,.08);
  background:linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,255,255,.08));
  color:#fff;
  font-size:28px;
  font-weight:1000;
  box-shadow:0 14px 28px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.12);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
  touch-action:none;
  -webkit-tap-highlight-color:transparent;
}
.ctrl.action{
  width:76px;
  height:76px;
}
.ctrl.heavy{
  background:linear-gradient(180deg, rgba(255,196,78,.30), rgba(120,74,18,.20));
}
.ctrl.special{
  background:linear-gradient(180deg, rgba(92,117,255,.44), rgba(61,79,174,.28));
}
.joystick{
  width:176px;
  height:176px;
  position:relative;
  touch-action:none;
}
.joyBase{
  position:absolute;
  inset:0;
  border-radius:50%;
  background:radial-gradient(circle at 50% 50%, rgba(255,255,255,.08), rgba(255,255,255,.02) 54%, rgba(255,255,255,.01) 74%, rgba(255,255,255,.00) 75%);
  border:1px solid rgba(255,255,255,.08);
  box-shadow:0 18px 34px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.10);
  overflow:hidden;
}
.joyGlow{
  position:absolute;
  inset:20px;
  border-radius:50%;
  background:radial-gradient(circle at 50% 50%, rgba(122,217,255,.14), rgba(122,217,255,0));
}
.joyKnob{
  position:absolute;
  left:50%;
  top:50%;
  width:76px;
  height:76px;
  margin-left:-38px;
  margin-top:-38px;
  border-radius:50%;
  background:linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,.08));
  border:1px solid rgba(255,255,255,.12);
  box-shadow:0 14px 24px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.16);
  transform:translate(0px, 0px);
  pointer-events:none;
}
.joyLabel{
  position:absolute;
  left:50%;
  bottom:8px;
  transform:translateX(-50%);
  font-size:11px;
  font-weight:900;
  letter-spacing:1.4px;
  opacity:.78;
}
@media (max-width: 900px){
  #hud{left:8px; right:8px; gap:8px}
  .panel{padding:9px 10px 10px; border-radius:18px}
  .percent{font-size:30px}
  .ctrl{width:66px;height:66px}
  .ctrl.action{width:70px;height:70px}
  .joystick{width:156px;height:156px}
  .joyKnob{width:68px;height:68px;margin-left:-34px;margin-top:-34px}
}
@media (max-width: 430px){
  .actions{gap:8px}
  .ctrl{width:60px;height:60px;border-radius:18px;font-size:24px}
  .ctrl.action{width:64px;height:64px}
  .panel{padding:18px 14px 14px}
  .joystick{width:142px;height:142px}
  .joyKnob{width:62px;height:62px;margin-left:-31px;margin-top:-31px}
}
