* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: #8fd3ff;
  font-family: "Quicksand", "Trebuchet MS", system-ui, sans-serif;
  touch-action: none; user-select: none; -webkit-user-select: none; overscroll-behavior: none;
}
#game, #game canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

button { font-family: inherit; border: none; cursor: pointer; touch-action: none; }

#stickZone { position: fixed; left: 0; top: 90px; bottom: 0; width: 55%; z-index: 2; }
#stickBase {
  position: fixed; width: 160px; height: 160px; margin: -80px 0 0 -80px; border-radius: 50%;
  background: rgba(255,255,255,.25); border: 4px solid rgba(255,255,255,.7);
  z-index: 3; pointer-events: none; display: none;
}
#stickKnob {
  position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px;
  border-radius: 50%; background: rgba(255,255,255,.9); box-shadow: 0 4px 10px rgba(0,0,0,.25);
}

#hud {
  position: fixed; top: 12px; left: 12px; right: 12px; display: flex; align-items: center;
  justify-content: space-between; z-index: 5; pointer-events: none;
}
#hud > * { pointer-events: auto; }
.small {
  width: 64px; height: 64px; border-radius: 20px; font-size: 34px;
  background: rgba(255,255,255,.85); box-shadow: 0 4px 0 rgba(0,0,0,.2);
}
#stars {
  font-size: 34px; font-weight: 800; color: #5a3b00; background: #ffe066;
  padding: 6px 22px; border-radius: 30px; box-shadow: 0 4px 0 #d4a400;
}
#stars.pop { animation: pop .35s; }
@keyframes pop { 50% { transform: scale(1.3); } }

#subtitle {
  position: fixed; top: 88px; left: 50%; transform: translateX(-50%); max-width: 80%;
  background: rgba(255,255,255,.92); color: #223; font-size: 26px; font-weight: 700;
  padding: 10px 22px; border-radius: 22px; box-shadow: 0 4px 12px rgba(0,0,0,.2);
  z-index: 5; text-align: center; opacity: 0; transition: opacity .3s; pointer-events: none;
}
#subtitle.show { opacity: 1; }

#buttons {
  position: fixed; right: 24px; bottom: 24px; z-index: 5;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.round {
  border-radius: 50%; background: rgba(255,255,255,.88);
  box-shadow: 0 6px 0 rgba(0,0,0,.22); transition: transform .08s;
}
.round.down { transform: scale(.9); }
.big { width: 130px; height: 130px; font-size: 66px; }
.mid { width: 104px; height: 104px; font-size: 52px; background: #ffe066; }
.hidden { display: none; }
#btnEnter.pulse { animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.12); } }

#menu {
  position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 28px;
  background: linear-gradient(#5ec4ff, #b7ecff 60%, #8ad86a 60%);
}
#menu.hidden { display: none; }
#menu h1 {
  margin: 0; font-size: 64px; line-height: 1; text-align: center; color: #fff;
  text-shadow: 0 5px 0 #e63b2e, 0 9px 12px rgba(0,0,0,.3);
}
#menu .row { display: flex; gap: 32px; flex-wrap: wrap; justify-content: center; }
.mode {
  width: 240px; height: 190px; border-radius: 34px; background: #fff; font-size: 30px; font-weight: 800;
  color: #234; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 8px 0 rgba(0,0,0,.2);
}
.mode .ico { font-size: 80px; line-height: 1; }
.mode:active { transform: translateY(4px); box-shadow: 0 4px 0 rgba(0,0,0,.2); }
.maps { display: flex; gap: 16px; }
.map {
  font-size: 26px; font-weight: 800; padding: 12px 24px; border-radius: 24px; color: #234;
  background: rgba(255,255,255,.6); box-shadow: 0 5px 0 rgba(0,0,0,.15);
}
.map.sel { background: #ffe066; box-shadow: 0 5px 0 #d4a400; }
#attrib { position: absolute; bottom: 8px; right: 12px; font-size: 13px; color: rgba(255,255,255,.9); }
#menu .hint { font-size: 26px; color: #fff; font-weight: 700; text-shadow: 0 2px 4px rgba(0,0,0,.4); }

#loading {
  position: fixed; inset: 0; z-index: 20; background: #5ec4ff; color: #fff; font-size: 40px;
  font-weight: 800; display: flex; align-items: center; justify-content: center;
}
#loading.hidden { display: none; }

@media (max-height: 500px) {
  .big { width: 104px; height: 104px; font-size: 52px; }
  .mid { width: 84px; height: 84px; font-size: 42px; }
  .mode { width: 200px; height: 150px; font-size: 24px; }
  .mode .ico { font-size: 60px; }
  #menu h1 { font-size: 46px; }
}

/* keyboard hints, only on computers without a touch screen */
.key, .keys { display: none; }
body.pc .key {
  display: inline-block; font-size: 15px; font-weight: 800; color: #234; background: #fff;
  border: 2px solid #9aa; border-bottom-width: 4px; border-radius: 8px; padding: 1px 8px; line-height: 1.3;
}
body.pc #buttons .key { margin-top: -12px; }
body.pc #btnMenu { position: relative; }
body.pc #btnMenu .key { position: absolute; bottom: -14px; left: 50%; transform: translateX(-50%); font-size: 12px; }
body.pc .mode .key { font-size: 20px; }
body.pc .keys { display: block; font-size: 20px; color: #fff; font-weight: 700; text-shadow: 0 2px 4px rgba(0,0,0,.45); }
body.pc #stickZone { display: none; }
body.pc #btnEnter.hidden + .key { display: none; }
