:root {
  --bg: #0f172a;
  --bg-soft: #1e293b;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --secondary: #334155;
  --secondary-hover: #475569;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #1e293b, var(--bg));
  color: var(--text);
  display: flex;
  justify-content: center;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
}

.app {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.app__header {
  text-align: center;
}

.app__title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.app__subtitle {
  margin-top: 6px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Stage */
.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #ffffff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  touch-action: none;
}

.stage__canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}

.stage__canvas:active {
  cursor: grabbing;
}

.stage__tip {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: -8px;
}

/* Controls */
.controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.btn {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 14px 18px;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.06s ease, background 0.15s ease, opacity 0.15s ease;
  user-select: none;
}

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

.btn__icon {
  font-size: 1.1rem;
}

.btn--primary {
  background: var(--primary);
}

.btn--primary:hover {
  background: var(--primary-hover);
}

.btn--secondary {
  background: var(--secondary);
}

.btn--secondary:hover {
  background: var(--secondary-hover);
}

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

@media (min-width: 480px) {
  .app__title {
    font-size: 1.9rem;
  }
}
