:root {
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  color-scheme: light;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

html,
body {
  margin: 0;
  height: 100%;
  background: #7ec8f8;
  overflow: hidden;
  position: fixed;
  inset: 0;
  width: 100%;
  touch-action: none;
}

#game-root {
  position: fixed;
  inset: 0;
  overflow: hidden;
  touch-action: none;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  background: #7ec8f8;
}

#mute {
  position: absolute;
  z-index: 5;
  top: calc(8px + var(--sat));
  right: calc(10px + var(--sar));
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid rgba(43, 33, 24, 0.75);
  background: rgba(255, 248, 240, 0.88);
  color: #2b2118;
  font: 800 18px/1 "Avenir Next", "Trebuchet MS", Arial, sans-serif;
  padding: 0;
  display: grid;
  place-items: center;
}

#mute.muted {
  opacity: 0.55;
}

#controls {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

#controls button {
  pointer-events: auto;
  border: 3px solid rgba(43, 33, 24, 0.72);
  background: rgba(255, 255, 255, 0.28);
  color: white;
  padding: 0;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 0 rgba(43, 33, 24, 0.28);
}

#controls button.held {
  transform: translateY(2px) scale(0.96);
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 1px 0 rgba(43, 33, 24, 0.28);
}

.pad {
  position: absolute;
  left: calc(12px + var(--sal));
  bottom: calc(12px + var(--sab));
  display: flex;
  gap: 10px;
}

#btn-left,
#btn-right {
  width: clamp(64px, 20vh, 86px);
  height: clamp(64px, 20vh, 86px);
  border-radius: 18px;
}

#btn-jump {
  position: absolute;
  right: calc(14px + var(--sar));
  bottom: calc(14px + var(--sab));
  width: clamp(78px, 26vh, 104px);
  height: clamp(78px, 26vh, 104px);
  border-radius: 50%;
  background: rgba(255, 122, 20, 0.92);
  border-color: rgba(122, 48, 8, 0.9);
}

#btn-jump.held {
  background: rgba(255, 150, 64, 0.98);
}

#controls svg {
  width: 46%;
  height: 46%;
  display: block;
}

#rotate {
  position: absolute;
  inset: 0;
  z-index: 8;
  background: #ffe7c4;
  color: #2b2118;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  gap: 8px;
}

#rotate[hidden],
#controls[hidden] {
  display: none !important;
}

#rotate h2 {
  margin: 0;
  font: 800 28px/1.1 "Avenir Next", "Trebuchet MS", Arial, sans-serif;
  color: #f27013;
}

#rotate p {
  margin: 0;
  font: 600 16px/1.4 "Avenir Next", "Trebuchet MS", Arial, sans-serif;
}

.phone {
  width: 72px;
  height: 44px;
  border: 4px solid #2b2118;
  border-radius: 8px;
  margin-bottom: 8px;
  position: relative;
}

.phone::after {
  content: "";
  position: absolute;
  width: 4px;
  height: 14px;
  border-radius: 2px;
  background: #2b2118;
  right: -10px;
  top: 14px;
}

noscript {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: grid;
  place-items: center;
  background: #ffe7c4;
  font: 700 18px/1.4 Arial, sans-serif;
  padding: 24px;
  text-align: center;
}
