:root {
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #090a0d;
  color: #fff8e8;
}

* {
  box-sizing: border-box;
}

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

body {
  min-width: 320px;
}

#stage {
  display: block;
  width: 100vw;
  height: 100vh;
  touch-action: none;
}

.hud {
  position: fixed;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.brand,
.controls {
  display: flex;
  align-items: center;
  min-height: 40px;
  border: 1px solid rgba(255, 248, 232, 0.16);
  border-radius: 8px;
  background: rgba(10, 12, 16, 0.72);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(14px);
  pointer-events: auto;
}

.brand {
  gap: 10px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0;
}

.brand-mark {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background:
    linear-gradient(90deg, transparent 46%, rgba(10, 12, 16, 0.7) 46% 54%, transparent 54%),
    linear-gradient(0deg, transparent 46%, rgba(10, 12, 16, 0.7) 46% 54%, transparent 54%),
    linear-gradient(135deg, #ffe59b, #77c7f2 55%, #d6a84e);
  box-shadow: 0 0 18px rgba(255, 219, 129, 0.34);
}

.controls {
  gap: 12px;
  padding: 8px;
}

label {
  display: grid;
  grid-template-columns: auto 112px;
  align-items: center;
  gap: 8px;
  color: rgba(255, 248, 232, 0.82);
  font-size: 12px;
}

input[type="range"] {
  width: 112px;
  accent-color: #ffd56f;
}

button {
  display: grid;
  width: 34px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(255, 248, 232, 0.16);
  border-radius: 6px;
  background: rgba(255, 248, 232, 0.1);
  color: #fff8e8;
  font: inherit;
  font-size: 11px;
  line-height: 1;
}

button:hover {
  background: rgba(255, 213, 111, 0.18);
}

.fallback {
  position: fixed;
  inset: 0;
  z-index: 3;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 24px;
  background: #090a0d;
  color: #fff8e8;
  text-align: center;
}

.fallback[hidden] {
  display: none;
}

.fallback span {
  color: rgba(255, 248, 232, 0.72);
}

.rotate-hint {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 2;
  min-width: 92px;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 248, 232, 0.14);
  border-radius: 8px;
  padding: 6px 14px 7px;
  background: rgba(10, 12, 16, 0.52);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
  color: rgba(255, 248, 232, 0.72);
  font-family: "Segoe UI Mono", Consolas, ui-monospace, monospace;
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
  text-shadow: 0 0 10px rgba(255, 213, 111, 0.25);
  backdrop-filter: blur(12px);
  pointer-events: none;
  user-select: none;
}

@media (max-width: 760px) {
  .hud {
    align-items: stretch;
    flex-direction: column;
  }

  .brand,
  .controls {
    width: fit-content;
    max-width: 100%;
  }

  .controls {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  label {
    grid-column: 1 / -1;
    grid-template-columns: 44px minmax(0, 1fr);
  }

  input[type="range"] {
    width: 100%;
  }

  .rotate-hint {
    bottom: max(12px, env(safe-area-inset-bottom));
    min-width: 82px;
    padding-inline: 12px;
    font-size: 13px;
  }
}
