/* KLAX – Modern Remake – Stylesheet */
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  height: 100%;
  background:
    radial-gradient(1200px 700px at 20% -10%, #142042 0%, transparent 60%),
    radial-gradient(1000px 700px at 90% 110%, #2a1030 0%, transparent 55%),
    #05060d;
  color: #dfe6ff;
  font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  touch-action: manipulation;
  user-select: none; -webkit-user-select: none;
}

#stage { position: relative; border-radius: 16px; }

canvas#game {
  display: block;
  border-radius: 16px;
  box-shadow:
    0 0 70px rgba(64, 140, 255, .22),
    0 0 0 1px rgba(255, 255, 255, .08),
    0 20px 60px rgba(0, 0, 0, .6);
  background: #05060d;
}

/* ---------- HUD ---------- */
#hud {
  position: absolute; inset: 0 0 auto 0;
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 12px 18px;
  pointer-events: none;
  z-index: 2;
}
.hud-box { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 110px; }
.hud-box.center { align-items: center; }
.hud-box.right  { align-items: flex-end; }
.hud-label {
  font-size: 10px; font-weight: 700; letter-spacing: 2.5px;
  text-transform: uppercase; color: #7285bd;
}
.hud-value {
  font-size: 26px; font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 14px rgba(120, 190, 255, .45);
}
#wave-label {
  font-size: 19px; font-weight: 900; letter-spacing: 4px;
  text-shadow: 0 0 18px rgba(140, 210, 255, .5);
}
#objective { font-size: 13px; color: #9fd0ff; letter-spacing: .5px; }
#objective.done { color: #7dffbe; }

#lives { display: flex; gap: 4px; margin-top: 2px; }
.life {
  width: 17px; height: 14px;
  background: linear-gradient(180deg, #9fe6ff, #35aef0);
  clip-path: polygon(0 100%, 50% 0, 100% 100%);
  filter: drop-shadow(0 0 5px rgba(80, 200, 255, .7));
  animation: pop .25s ease;
}
.life.lost { background: #2a3450; filter: none; opacity: .55; }
@keyframes pop { from { transform: scale(0) } to { transform: scale(1) } }

#mute {
  pointer-events: auto; cursor: pointer;
  margin-top: 4px;
  font-size: 14px; line-height: 1;
  padding: 5px 9px; border-radius: 8px;
  background: rgba(20, 28, 52, .8); color: #9fd0ff;
  border: 1px solid rgba(120, 160, 255, .25);
}
#mute:hover { background: rgba(40, 55, 100, .9); }

/* ---------- Banner ---------- */
#banner {
  position: absolute; left: 0; right: 0; top: 34%;
  text-align: center;
  opacity: 0; transform: translateY(14px) scale(.96);
  transition: opacity .35s ease, transform .35s ease;
  pointer-events: none; z-index: 3;
}
#banner.show { opacity: 1; transform: translateY(0) scale(1); }
#banner-title {
  font-size: clamp(34px, 6vw, 62px);
  font-weight: 900; letter-spacing: 10px;
  color: #fff;
  text-shadow: 0 0 30px rgba(120, 200, 255, .8), 0 0 80px rgba(255, 90, 200, .35);
}
#banner-sub {
  margin-top: 8px;
  font-size: clamp(15px, 2.2vw, 21px);
  font-weight: 600; letter-spacing: 1px;
  color: #a8d4ff;
}

#hint {
  position: absolute; left: 0; right: 0; bottom: 10px;
  text-align: center; font-size: 12.5px;
  color: rgba(165, 185, 225, .66);
  letter-spacing: .4px;
  pointer-events: none; z-index: 2;
  transition: opacity .5s ease;
  opacity: 0;
}
#hint.show { opacity: 1; }
#hint b { color: #9fd0ff; }

/* ---------- Touch-Buttons ---------- */
#touch {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: none; justify-content: center; gap: 14px;
  padding: 0 14px 16px 14px;
  z-index: 3; pointer-events: none;
}
#touch button {
  pointer-events: auto;
  width: 106px; height: 92px;
  border-radius: 50%;
  border: 1px solid rgba(140, 200, 255, .35);
  background: radial-gradient(circle at 35% 30%, rgba(70, 110, 190, .55), rgba(10, 16, 34, .85));
  color: #cfe6ff; font-size: 13px; font-weight: 800; letter-spacing: 1px;
  backdrop-filter: blur(4px);
  cursor: pointer;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .5);
}
#touch button:active { transform: scale(.94); background: rgba(60, 110, 210, .6); }
@media (pointer: coarse) { #touch { display: flex; } }

/* ---------- Overlay (Titel / Game Over / Pause) ---------- */
#overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  background: rgba(4, 6, 14, .74);
  backdrop-filter: blur(7px);
  border-radius: 16px;
  z-index: 5;
  animation: fadein .3s ease;
}
#overlay.hidden { display: none; }
@keyframes fadein { from { opacity: 0 } to { opacity: 1 } }

.logo {
  margin: 0;
  font-size: clamp(58px, 11vw, 118px);
  font-weight: 900; letter-spacing: .18em; text-indent: .18em;
  background: linear-gradient(180deg, #ffffff 0%, #7fd4ff 55%, #ff77dd 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 26px rgba(120, 180, 255, .55));
}
.logo.small { font-size: clamp(40px, 7vw, 72px); }
.subtitle {
  font-size: 14px; font-weight: 700; letter-spacing: 9px; text-indent: 9px;
  color: #7d92c8; margin-top: 4px;
}
.desc {
  max-width: 600px; margin: 22px 20px 8px 20px;
  font-size: 14.5px; line-height: 1.65; color: #aab8df;
}
.controls {
  display: flex; flex-direction: column; gap: 7px;
  margin: 18px 0 4px 0; font-size: 13.5px; color: #93a2cc;
}
.controls .row { display: flex; align-items: center; gap: 9px; justify-content: center; }
.key {
  display: inline-block; min-width: 26px; text-align: center;
  padding: 3px 9px; border-radius: 7px;
  background: #131a2e; border: 1px solid #2c3a63;
  color: #9fd0ff; font-weight: 700; font-size: 12px;
  box-shadow: 0 2px 0 #0a0f1e;
}
.btn {
  margin-top: 18px;
  padding: 13px 42px; border: 0; border-radius: 999px;
  font-size: 17px; font-weight: 800; letter-spacing: 2px;
  color: #fff; cursor: pointer;
  background: linear-gradient(135deg, #37b6ff, #7a5cff);
  box-shadow: 0 8px 30px rgba(90, 130, 255, .45), inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(110, 150, 255, .6); }
.btn:active { transform: scale(.97); }
/* ---------- 4Fingr-Branding ---------- */
.brand {
  display: block; margin: 0 auto;
  pointer-events: none; user-select: none;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .55))
          drop-shadow(0 0 20px rgba(255, 70, 80, .3));
}
.brand-top {
  width: clamp(150px, 24vw, 235px);
  margin-top: -14px;
  margin-bottom: 6px;
  animation: brandFloat 4s ease-in-out infinite;
}
.brand-small {
  width: clamp(115px, 17vw, 155px);
  margin-bottom: 4px;
}
@keyframes brandFloat { 50% { transform: translateY(-6px) } }

.subtle { margin-top: 14px; font-size: 12.5px; color: #6d7dab; letter-spacing: 1px; }
.stat-line { font-size: 20px; font-weight: 800; color: #dfe8ff; margin-top: 16px; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 14px; color: #93a2cc; margin-top: 6px; }
.newbest {
  margin-top: 10px; font-size: 15px; font-weight: 800; letter-spacing: 2px;
  color: #ffd23f; text-shadow: 0 0 18px rgba(255, 210, 63, .7);
  animation: pulse 1.2s ease infinite;
}
@keyframes pulse { 50% { opacity: .55 } }
