*{
  box-sizing:border-box;
}

html,
body{
  width:100%;
  height:100%;
  margin:0;
  overflow:hidden;
  background:#08070f;
  color:#ffffff;
  font-family:system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button{
  font:inherit;
}

.runnerApp{
  position:fixed;
  inset:0;
  overflow:hidden;
  background:#08070f;
  touch-action:none;
}

#gameCanvas{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  display:block;
  outline:none;
  touch-action:none;
}

.hud{
  position:absolute;
  z-index:3;
  top:14px;
  left:14px;
  right:14px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  pointer-events:none;
}

.eyebrow{
  width:max-content;
  max-width:100%;
  padding:7px 10px;
  border:1px solid rgba(255,255,255,.22);
  border-radius:8px;
  background:rgba(6,8,15,.58);
  color:#ffe28a;
  font-size:13px;
  line-height:1;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:0;
  backdrop-filter:blur(8px);
}

.statusText{
  margin-top:8px;
  color:#ffffff;
  font-size:clamp(26px, 5vw, 58px);
  line-height:.96;
  font-weight:1000;
  text-shadow:0 8px 34px rgba(0,0,0,.58);
}

.stats{
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:8px;
}

.stat{
  min-width:92px;
  padding:8px 10px;
  border:1px solid rgba(255,255,255,.18);
  border-radius:8px;
  background:rgba(6,8,15,.62);
  box-shadow:0 12px 32px rgba(0,0,0,.24);
  backdrop-filter:blur(8px);
  text-align:right;
}

.stat span{
  display:block;
  color:rgba(255,255,255,.64);
  font-size:12px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:0;
}

.stat strong{
  display:block;
  margin-top:2px;
  color:#ffffff;
  font-size:25px;
  line-height:1;
  font-weight:1000;
}

.touchControls{
  position:absolute;
  z-index:4;
  left:50%;
  bottom:18px;
  width:min(760px, calc(100vw - 28px));
  transform:translateX(-50%);
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:8px;
}

.touchControls button{
  min-height:64px;
  border:2px solid rgba(255,255,255,.18);
  border-radius:8px;
  background:linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,.06)), rgba(8,11,22,.72);
  color:#ffffff;
  box-shadow:0 16px 34px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.16);
  cursor:pointer;
  font-size:clamp(18px, 2.2vw, 28px);
  font-weight:1000;
  touch-action:manipulation;
}

.touchControls button:active{
  transform:translateY(1px) scale(.99);
}

.overlay{
  position:absolute;
  z-index:7;
  inset:0;
  display:none;
  place-items:center;
  padding:18px;
  background:radial-gradient(circle at 50% 42%, rgba(255,190,72,.14), rgba(8,7,15,.78) 54%, rgba(8,7,15,.92));
}

.overlay.show{
  display:grid;
}

.panel{
  width:min(620px, 100%);
  padding:26px;
  border:1px solid rgba(255,255,255,.20);
  border-radius:10px;
  background:linear-gradient(180deg, rgba(23,20,35,.92), rgba(8,10,20,.88));
  box-shadow:0 28px 90px rgba(0,0,0,.54), inset 0 1px 0 rgba(255,255,255,.14);
  text-align:center;
  backdrop-filter:blur(14px);
}

.panel.small{
  width:min(440px, 100%);
}

.title{
  color:#ffffff;
  font-size:clamp(38px, 7vw, 76px);
  line-height:.94;
  font-weight:1000;
  text-shadow:0 10px 34px rgba(0,0,0,.45);
}

.panel p{
  margin:14px auto 20px;
  max-width:520px;
  color:rgba(255,255,255,.76);
  font-size:18px;
  line-height:1.38;
  font-weight:750;
}

.keys{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:8px;
  margin:0 0 20px;
}

.keys span{
  min-width:92px;
  padding:9px 12px;
  border:1px solid rgba(255,226,138,.24);
  border-radius:8px;
  background:rgba(255,226,138,.10);
  color:#ffe28a;
  font-weight:950;
}

.primaryBtn,
.secondaryBtn{
  min-width:170px;
  min-height:54px;
  margin:6px;
  border-radius:8px;
  cursor:pointer;
  font-size:20px;
  font-weight:1000;
}

.primaryBtn{
  border:2px solid rgba(255,226,138,.60);
  background:linear-gradient(180deg, #ffe28a, #f3a43a);
  color:#211407;
  box-shadow:0 16px 38px rgba(243,164,58,.24);
}

.secondaryBtn{
  border:2px solid rgba(255,255,255,.20);
  background:rgba(255,255,255,.08);
  color:#ffffff;
}

.loadText{
  min-height:20px;
  margin-top:12px;
  color:rgba(255,255,255,.58);
  font-size:13px;
  line-height:1.25;
  font-weight:800;
}

@media (max-width:760px){
  .hud{
    display:grid;
    gap:8px;
  }

  .stats{
    justify-content:flex-start;
  }

  .stat{
    min-width:74px;
    padding:7px 8px;
    text-align:left;
  }

  .stat strong{
    font-size:20px;
  }

  .touchControls{
    grid-template-columns:repeat(2, minmax(0, 1fr));
    bottom:10px;
  }

  .touchControls button{
    min-height:54px;
  }

  .panel{
    padding:20px;
  }
}
