:root {
  color-scheme: dark;
  font-family: Inter, "DM Sans", system-ui, sans-serif;
  background: #0b1120;
  color: #f5f2eb;
  --border: #28354a;
  --muted: #aab6c9;
  --gold: #f2c778;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 300px; }
button, input { font: inherit; }
button {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #152033;
  color: inherit;
  padding: .58rem .85rem;
  font-size: .875rem;
  font-weight: 650;
  cursor: pointer;
}
button:hover { background: #202f46; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
button:disabled { opacity: .5; cursor: default; }
.primary { background: var(--gold); border-color: var(--gold); color: #1c1520; }
.primary:hover { background: #ffe0a7; }
.shell { max-width: 1328px; margin: 0 auto; padding: 20px 24px 28px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.identity { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 1.35rem; }
.identity img { border-radius: 12px; }
.status { color: var(--muted); font-size: .875rem; text-align: right; }
.stage {
  width: 100%;
  aspect-ratio: 16 / 9;
  position: relative;
  isolation: isolate;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: #080d17 url("/forest.webp") center / cover;
}
.stage:focus { outline: none; }
.stage:focus-visible { border-color: #ae8848; }
.stage.playing { cursor: none; touch-action: none; background: #000; }
.stage video { inset: 0; position: absolute; width: 100%; height: 100%; object-fit: contain; opacity: 0; pointer-events: none; }
.stage.playing video { opacity: 1; }
.launch {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  position: absolute;
  inset: 0;
  padding: clamp(16px, 6vw, 72px);
  background: linear-gradient(90deg, rgba(7,14,26,.91), rgba(7,14,26,.38) 48%, rgba(7,14,26,.06)),
              linear-gradient(0deg, rgba(7,14,26,.70), transparent 54%);
}
.launch h1 { margin: 0; font-size: clamp(1.7rem, 6vw, 4.6rem); letter-spacing: -.06em; line-height: 1.02; }
.launch p { margin: .65rem 0 1.35rem; color: #d9e2ef; }
.launch button { min-width: 110px; padding: .75rem 1.1rem; }
.launch .message { margin: .8rem 0 0; max-width: 32rem; font-size: .875rem; }
.actions, .actions-group, .text-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.actions { justify-content: space-between; padding: 10px 0 3px; }
.text-entry, .touch { margin-top: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; }
.text-entry label { display: block; margin-bottom: 6px; font-size: .875rem; }
.text-entry p { margin: 8px 0 0; font-size: .875rem; color: var(--muted); }
.text-entry input { width: min(100%, 350px); border-radius: 8px; border: 1px solid var(--border); padding: 8px; background: #101929; color: inherit; }
.touch, .touch-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.touch { justify-content: space-between; touch-action: none; user-select: none; }
.touch button { min-width: 36px; min-height: 36px; padding: .42rem .55rem; }
.touch button:active { color: #1c1520; background: var(--gold); }
.direction { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.direction button:first-child { grid-column: 2; }
.direction button:nth-child(2) { grid-column: 1; }
.play-area:fullscreen {
  overflow: auto;
  background: #080d17;
  padding: 6px;
  max-width: none;
  width: 100%;
  display: flex;
  align-items: center;
  flex-direction: column;
}
.play-area:fullscreen .stage { width: min(100%, calc((100dvh - 56px) * 16 / 9)); flex: 0 0 auto; border-radius: 0; }
.play-area:fullscreen:has(.touch:not([hidden])) .stage { width: min(100%, calc((100dvh - 130px) * 16 / 9)); }
.play-area:fullscreen .actions { width: min(100%, 1280px); }
@media (max-width: 680px) {
  .shell { padding: 10px; }
  .top { margin-bottom: 9px; }
  .identity img { height: 38px; width: 38px; }
  .identity { font-size: 1.15rem; }
  .stage { border-radius: 10px; }
  .launch p { margin: .35rem 0 .65rem; font-size: .85rem; }
  .launch .message { font-size: .78rem; margin-top: .4rem; }
  .launch button { padding: .42rem .8rem; }
  .actions { gap: 6px; }
  .actions button { padding: .44rem .65rem; }
}
