*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Colors */
  --smash-bg: #1a5c3a;
  --smash-control-bg: rgba(0, 0, 0, 0.6);
  --smash-button-bg: rgba(255, 255, 255, 0.15);
  --smash-button-bg-active: rgba(255, 255, 255, 0.3);
  --smash-button-text: #fff;

  /* Spacing */
  --smash-space-0: 0;
  --smash-space-2: 8px;

  /* Layout */
  --smash-control-size: 44px;
  --smash-control-radius: 12px;
  --smash-button-radius: 8px;
  --smash-control-z: 100;
  --smash-hotspot-z: 99;
  --smash-control-blur: 4px;
  --smash-control-hidden-offset: -10px;

  /* Typography */
  --smash-control-font-size: 20px;

  /* Motion */
  --smash-duration-normal: 300ms;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--smash-bg);
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#smash-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

/* Parent controls — hidden by default, revealed via long-press */
.parent-controls {
  position: fixed;
  bottom: env(safe-area-inset-bottom, var(--smash-space-2));
  right: env(safe-area-inset-right, var(--smash-space-2));
  display: flex;
  gap: var(--smash-space-2);
  z-index: var(--smash-control-z);
  padding: var(--smash-space-2);
  border-radius: var(--smash-control-radius);
  background: var(--smash-control-bg);
  backdrop-filter: blur(var(--smash-control-blur));
  transition:
    opacity var(--smash-duration-normal) ease,
    transform var(--smash-duration-normal) ease;
}

.parent-controls.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(calc(-1 * var(--smash-control-hidden-offset)));
}

.ctrl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--smash-control-size);
  height: var(--smash-control-size);
  border: none;
  border-radius: var(--smash-button-radius);
  background: var(--smash-button-bg);
  color: var(--smash-button-text);
  font-size: var(--smash-control-font-size);
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
}

.ctrl-btn:active {
  background: var(--smash-button-bg-active);
}

/* Long-press target — tiny corner hotspot */
.long-press-target {
  position: fixed;
  bottom: env(safe-area-inset-bottom, var(--smash-space-0));
  right: env(safe-area-inset-right, var(--smash-space-0));
  width: var(--smash-control-size);
  height: var(--smash-control-size);
  z-index: var(--smash-hotspot-z);
  touch-action: none;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .parent-controls {
    transition: none;
  }
}
