* {
  margin: 0;
  padding: 0;
}

body {
  background: #fff;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

canvas {
  display: block;
}

/* ---- corner anchors ---- */

#controls {
  position: fixed;
  top: max(20px, env(safe-area-inset-top));
  left: max(20px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10;
}

#bottom-left {
  position: fixed;
  bottom: max(20px, env(safe-area-inset-bottom));
  left: max(20px, env(safe-area-inset-left));
  max-width: 40vw;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 10;
}

#attribution {
  position: fixed;
  bottom: max(20px, env(safe-area-inset-bottom));
  right: max(20px, env(safe-area-inset-right));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  z-index: 10;
}

/* ---- control chips ---- */

.ctrl {
  font-family: "Nunito Sans", sans-serif;
  font-weight: 300;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: rgba(0, 0, 0, 0.75);
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  padding: 7px 20px;
  min-width: 140px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  text-align: center;
  appearance: none;
  -webkit-appearance: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.ctrl:hover {
  border-color: rgba(0, 0, 0, 0.6);
  color: #000;
}

.ctrl.active {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.5);
}

/* ---- hint text ---- */

#hint {
  font-family: "Nunito Sans", sans-serif;
  font-weight: 300;
  font-size: 12px;
  letter-spacing: 0.06em;
  line-height: 1.5;
  color: rgba(0, 0, 0, 0.6);
}

/* ---- attribution handles ---- */

#attribution a {
  font-family: "Nunito Sans", sans-serif;
  font-weight: 300;
  font-size: 12.6px;
  letter-spacing: 0.06em;
  color: rgba(0, 0, 0, 0.45);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}

#attribution a:hover {
  color: rgba(0, 0, 0, 0.85);
}

#attribution svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  flex-shrink: 0;
}

/* ---- start overlay ---- */

#start-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 20;
  transition: opacity 0.5s;
}

#start-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

#start-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 0, 0, 0.25);
  border-radius: 12px;
  padding: 28px 36px;
  margin: 20px;
}

#start-title {
  font-family: "Nunito Sans", sans-serif;
  font-weight: 300;
  font-size: 22px;
  letter-spacing: 0.12em;
  color: rgba(0, 0, 0, 0.85);
}

#start-text {
  font-family: "Nunito Sans", sans-serif;
  font-weight: 300;
  font-size: 13px;
  letter-spacing: 0.06em;
  line-height: 1.5;
  color: rgba(0, 0, 0, 0.6);
  text-align: center;
}

@media (max-width: 768px) {
  #bottom-left {
    max-width: 50vw;
  }
}
