:root {
  --bg: #121212;
  --text: #f7f7f7;
  --muted: #bdbdbd;
  --panel: rgba(14, 14, 14, 0.9);
  --line: rgba(255, 255, 255, 0.14);
  --accent: #ffffff;
  --accent-text: #000000;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

.teddy-app {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 40px);
}

.teddy-hero {
  position: relative;
  width: min(88vmin, 920px);
  aspect-ratio: 1 / 1;
  isolation: isolate;
}

#teddy-stage {
  display: block;
  width: 100%;
  height: 100%;
  background: #121212;
}

.teddy-hotspot {
  position: absolute;
  inset: 0;
  z-index: 3;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
}

.teddy-loader {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
}

.teddy-loader.hidden { display: none; }

.teddy-panel {
  width: min(100%, 680px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  padding: clamp(18px, 4vw, 30px);
  box-shadow: 0 22px 80px rgba(0, 0, 0, 0.48);
}

.version {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

h1 {
  margin: 0 0 10px;
  font-size: clamp(32px, 5vw, 54px);
  line-height: 0.95;
}

.subline, .hint, .progress-detail {
  color: var(--muted);
  line-height: 1.5;
}

.progress {
  margin-top: 22px;
}

.progress-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.progress-track {
  height: 13px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.08);
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #808080, #fff);
  transition: width 120ms linear;
}

.progress-detail {
  margin-top: 10px;
  font-size: 14px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 12px 22px;
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.button-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.hint {
  margin: 18px 0 0;
  font-size: 14px;
}

.debug-panel {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 5;
  min-width: 280px;
  max-width: calc(100% - 24px);
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(0,0,0,0.78);
  color: #fff;
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  white-space: pre-line;
  pointer-events: none;
}

.hidden { display: none !important; }

@media (max-width: 640px) {
  .teddy-app { padding: 14px; }
  .teddy-hero { width: min(94vmin, 920px); }
}
