:root {
  color-scheme: dark;
  font-family: ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, sans-serif;
  background: #07100c;
  color: #f4f8f5;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 50% -10%, rgba(61, 184, 126, .18), transparent 42%),
    linear-gradient(180deg, #0d1713, #07100c 70%);
}

button, summary { font: inherit; }

.shell {
  width: min(100%, 540px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

header { text-align: center; }

.eyebrow {
  margin: 0 0 3px;
  color: #64ee95;
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .18em;
}

h1 {
  margin: 0;
  font-size: clamp(1.75rem, 8vw, 2.5rem);
  line-height: 1;
}

.subtitle {
  max-width: 34rem;
  margin: 10px auto 0;
  color: #b7c8be;
  font-size: .94rem;
  line-height: 1.45;
}

.stage {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(132, 255, 180, .24);
  border-radius: 24px;
  background: #00ff00;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .4), inset 0 0 0 1px rgba(255, 255, 255, .05);
  aspect-ratio: 1;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: manipulation;
}

.badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 999px;
  background: rgba(6, 18, 12, .78);
  backdrop-filter: blur(8px);
  color: #d7e5dc;
  font-size: .76rem;
  font-weight: 750;
}

.badge.live { color: #71f49d; }
.badge.error { color: #ffb0a6; }

.status {
  min-height: 1.5em;
  margin: 0;
  text-align: center;
  color: #ced9d2;
  font-size: .92rem;
}

.actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 9px;
}

button {
  min-height: 50px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 15px;
  font-weight: 800;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:disabled { cursor: default; opacity: .45; }

.primary {
  background: #5ee98d;
  color: #07120c;
}

.secondary {
  border-color: #31473a;
  background: #14221a;
  color: #edf5ef;
}

button:active:not(:disabled) { transform: translateY(1px); }

button:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(107, 244, 157, .55);
  outline-offset: 3px;
}

details {
  border-top: 1px solid #213128;
  padding-top: 12px;
  color: #b7c8be;
  font-size: .88rem;
  line-height: 1.45;
}

summary {
  min-height: 42px;
  color: #e4eee7;
  font-weight: 750;
  cursor: pointer;
}

details p { margin: 6px 0 0; }

@media (max-width: 390px) {
  .shell { padding-left: 12px; padding-right: 12px; }
  .actions { grid-template-columns: 1fr 1fr; }
  .primary { grid-column: 1 / -1; }
}

@media (display-mode: fullscreen) {
  header, .status, .actions, details { display: none; }
  .shell { width: 100%; padding: 0; justify-content: center; }
  .stage { width: min(100vw, 100vh); margin: auto; border: 0; border-radius: 0; }
}
