:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  background: #a0a39d;
  color: #151715;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  touch-action: none;
}

button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: #1c1f1d;
  color: #f8f8f4;
  cursor: pointer;
  font: inherit;
  font-weight: 750;
  min-height: 64px;
  min-width: 0;
  padding: 0 18px;
  transition: background 160ms ease, transform 160ms ease, opacity 160ms ease;
}

button:active {
  transform: translateY(1px) scale(0.99);
}

button.secondary {
  align-items: center;
  background: rgba(231, 232, 226, 0.44);
  color: #121411;
  display: flex;
  flex-direction: column;
  gap: 2px;
  justify-content: center;
}

button.secondary small {
  color: rgba(18, 20, 17, 0.55);
  font-size: 15px;
  font-weight: 650;
}

.app-shell {
  background: linear-gradient(#a3a6a0, #9ca09a);
  height: 100dvh;
  min-height: 100%;
  overflow: hidden;
  position: relative;
  width: 100vw;
}

.stage {
  inset: 0;
  position: absolute;
}

.stage canvas {
  display: block;
  height: 100%;
  width: 100%;
}

.status-panel {
  align-items: center;
  backdrop-filter: blur(22px);
  background: rgba(229, 231, 225, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.33);
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(20, 24, 20, 0.09);
  display: flex;
  gap: 13px;
  left: max(18px, env(safe-area-inset-left));
  max-width: calc(100vw - 36px);
  min-height: 56px;
  padding: 13px 18px;
  position: absolute;
  right: max(18px, env(safe-area-inset-right));
  top: max(18px, env(safe-area-inset-top));
  z-index: 4;
}

.status-panel p {
  font-size: clamp(15px, 2.6vw, 21px);
  font-weight: 720;
  line-height: 1.18;
  margin: 0;
}

.status-dot {
  background: #31d269;
  border-radius: 999px;
  flex: 0 0 auto;
  height: 12px;
  width: 12px;
}

.status-dot.error {
  background: #d93f35;
}

.controls {
  backdrop-filter: blur(24px);
  background: rgba(229, 231, 225, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 20px;
  bottom: max(18px, env(safe-area-inset-bottom));
  box-shadow: 0 22px 60px rgba(20, 24, 20, 0.12);
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  left: max(18px, env(safe-area-inset-left));
  padding: 12px;
  position: absolute;
  right: max(18px, env(safe-area-inset-right));
  z-index: 4;
}

@media (max-width: 899px) {
  .controls {
    left: 18px;
    max-width: calc(100% - 36px);
    right: auto;
    width: 354px;
  }

  .status-panel {
    left: 18px;
    max-width: calc(100% - 36px);
    right: auto;
    width: 354px;
  }
}

@media (min-width: 900px) {
  .status-panel {
    left: 32px;
    max-width: 560px;
    right: auto;
    top: 28px;
  }

  .controls {
    bottom: 28px;
    left: 50%;
    max-width: 680px;
    right: auto;
    transform: translateX(-50%);
    width: min(680px, calc(100vw - 64px));
  }
}

@media (max-width: 380px) {
  button {
    font-size: 14px;
    min-height: 58px;
    padding: 0 12px;
  }

  button.secondary small {
    font-size: 13px;
  }

  .status-panel {
    padding-inline: 14px;
  }
}
