* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #1b1035;
  font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif; color: #ffe9d0; }
#c { position: fixed; inset: 0; display: block; }
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#score { position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  font-size: clamp(16px, 3vw, 26px); font-weight: 800; letter-spacing: 1px;
  background: rgba(27,16,53,0.65); padding: 6px 18px; border-radius: 999px;
  border: 1px solid rgba(255,209,102,0.5); text-shadow: 0 0 12px rgba(255,158,100,0.6); }
#serveinfo { position: absolute; top: 52px; left: 50%; transform: translateX(-50%);
  color: #ffd166; font-size: 14px; letter-spacing: 2px; }
#msg { position: absolute; top: 38%; left: 50%; transform: translate(-50%,-50%);
  font-size: clamp(22px, 5vw, 44px); font-weight: 900; opacity: 0; transition: opacity .2s;
  color: #fff27a; text-shadow: 0 0 24px rgba(255,242,122,0.7); letter-spacing: 2px; }
#msg.show { opacity: 1; }
#hint { position: fixed; bottom: 10px; left: 50%; transform: translateX(-50%);
  font-size: 12px; opacity: 0.75; white-space: nowrap; }
#flash { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
#flash.go { animation: flash .5s ease-out; }
@keyframes flash { 0% { opacity: 1; } 100% { opacity: 0; } }
.tbtn { pointer-events: auto; touch-action: none; user-select: none;
  -webkit-user-select: none; position: absolute; width: 54px; height: 54px;
  border-radius: 14px; border: 1px solid rgba(122,231,255,0.55);
  background: rgba(27,16,53,0.55); color: #7ae7ff; font-size: 20px;
  display: flex; align-items: center; justify-content: center; }
.tbtn:active { background: rgba(122,231,255,0.35); }
#dpad { position: absolute; left: 14px; bottom: 14px; width: 180px; height: 180px; }
#tU { left: 63px; top: 0; } #tL { left: 0; top: 63px; }
#tR { left: 126px; top: 63px; } #tD { left: 63px; top: 126px; }
#swingbtn { position: absolute; right: 16px; bottom: 30px; width: 92px; height: 92px;
  border-radius: 50%; font-size: 16px; font-weight: 800; color: #0d0a1f;
  background: rgba(255,209,102,0.85); border-color: #ffe9d0; }
#startscreen, #endscreen { position: fixed; inset: 0; z-index: 10;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 24px; text-align: center;
  background: radial-gradient(circle at 50% 30%, rgba(255,94,122,0.28), rgba(13,10,31,0.93) 65%);
  backdrop-filter: blur(3px); }
.hidden { display: none !important; }
#startscreen h1, #endscreen h1 { font-size: clamp(30px, 7vw, 64px); margin: 0;
  letter-spacing: 4px; color: #ffd166; text-shadow: 0 0 30px rgba(255,209,102,0.6); }
#startscreen p, #endscreen p { max-width: 560px; line-height: 1.55; margin: 0; opacity: 0.9; }
.keys { list-style: none; padding: 0; margin: 0; font-size: 14px; line-height: 1.9; opacity: 0.85; }
.bigbtn { pointer-events: auto; cursor: pointer; font-size: 20px; font-weight: 800;
  letter-spacing: 2px; color: #0d0a1f; background: linear-gradient(120deg, #7ae7ff, #ffd166);
  border: none; border-radius: 999px; padding: 14px 42px; box-shadow: 0 0 30px rgba(122,231,255,0.45); }
#homebtn, #endscreen a { color: #7ae7ff; text-decoration: none; font-size: 14px; }
@media (pointer: fine) { #dpad, #swingbtn { opacity: 0.35; } }
