:root {
  --bg: #03060a;
  --panel: rgba(7, 11, 18, 0.86);
  --line: rgba(236, 240, 243, 0.22);
  --text: #f3f6f8;
  --muted: #9db0bc;
  --accent: #55d5ff;
  --warm: #ffa43c;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top, rgba(36, 59, 86, 0.35), transparent 40%),
    linear-gradient(180deg, #020306 0%, #090d14 58%, #020306 100%);
  color: var(--text);
  font-family: "SF Mono", "Menlo", "Monaco", "Cascadia Mono", monospace;
}

body {
  display: flex;
  justify-content: center;
  padding: 32px 18px 48px;
  overscroll-behavior: none;
}

.app {
  width: min(1100px, 100%);
}

.hero {
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 0.95;
}

.summary {
  max-width: 760px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.6;
}

.summary span,
.notes strong {
  color: var(--text);
}

.shell {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0)),
    var(--panel);
  box-shadow:
    0 26px 80px rgba(0, 0, 0, 0.45),
    inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(85, 213, 255, 0.1), transparent 38%),
    radial-gradient(circle at 85% 15%, rgba(255, 164, 60, 0.12), transparent 28%);
  pointer-events: none;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: #020305;
  image-rendering: pixelated;
  touch-action: none;
}

.touch-ui {
  display: none;
  position: relative;
  z-index: 1;
  margin-top: 14px;
  gap: 12px;
  align-items: stretch;
  justify-content: space-between;
}

.touch-pad {
  flex: 1 1 auto;
  display: grid;
  gap: 10px;
  justify-items: center;
}

.touch-pad__row {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.touch-actions {
  width: min(250px, 38vw);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.touch-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  min-height: 62px;
  padding: 0 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03)),
    rgba(4, 8, 14, 0.92);
  color: var(--text);
  font: 700 1rem "SF Mono", "Menlo", "Monaco", "Cascadia Mono", monospace;
  letter-spacing: 0.04em;
  touch-action: none;
  user-select: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 30px rgba(0, 0, 0, 0.35);
}

.touch-btn--ghost {
  width: min(92px, 28vw);
}

.touch-btn--primary {
  grid-column: span 2;
  min-height: 70px;
  color: var(--warm);
}

.touch-btn--small {
  min-height: 54px;
  font-size: 0.82rem;
}

.touch-btn:active,
.touch-btn.is-active {
  transform: translateY(1px);
  border-color: rgba(85, 213, 255, 0.54);
  background:
    linear-gradient(180deg, rgba(85, 213, 255, 0.18), rgba(255, 255, 255, 0.04)),
    rgba(6, 11, 18, 0.96);
}

.notes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.notes > div {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.02);
}

.notes p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

@media (pointer: coarse), (max-width: 900px) {
  body {
    padding: 18px 12px 28px;
  }

  .shell {
    padding: 14px;
    border-radius: 20px;
  }

  .touch-ui {
    display: flex;
  }
}

@media (max-width: 640px) {
  body {
    padding: 14px 10px 22px;
  }

  .summary {
    font-size: 0.92rem;
  }

  .shell {
    padding: 12px;
    border-radius: 18px;
  }

  .touch-ui {
    flex-direction: column;
  }

  .touch-actions {
    width: 100%;
  }

  .touch-btn {
    min-height: 58px;
  }

  .touch-btn--primary {
    min-height: 64px;
  }
}
