.app {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100svh;
  min-height: 100dvh;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

@supports (height: 100dvh) {
  .app {
    height: 100svh;
    min-height: 100dvh;
  }
}

.header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 12px 16px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.title {
  margin: 0;
  font-family: 'Coming Soon', system-ui;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.stage {
  position: relative;
  overflow: hidden;
  min-height: 0;
  overscroll-behavior: contain;
  touch-action: none;
}

.canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: #070707;
  cursor: crosshair;
  touch-action: none;
  -ms-touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.footer {
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  text-align: center;
}

.controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: #181818;
  color: var(--fg);
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  background: #202020;
  border-color: #2a2a2a;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn.primary {
  background: var(--accent);
  color: #000;
  border-color: #d5b34c;
}

@media (max-width: 480px) {
  .btn {
    flex: 1 1 45%;
    min-width: 140px;
  }
}

@media (max-width: 640px) {
  .header {
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "brand timer score"
      "prompt progress progress";
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
  }

  .brand {
    grid-area: brand;
    justify-content: flex-start;
    gap: 6px;
  }

  .logo {
    width: 34px;
    height: 34px;
  }

  .title {
    font-size: 1.1rem;
    letter-spacing: 0.04em;
  }
}
