:root {
  --bg: #17111a;
  --panel: #221826;
  --pink: #ff5da2;
  --pink-soft: #ffb3d1;
  --text: #f6eef4;
  --muted: #b89cab;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(1200px 700px at 50% -10%, #2c1c31, var(--bg));
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  display: flex;
  justify-content: center;
}

main {
  width: min(720px, 100%);
  padding: 24px 16px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

header {
  text-align: center;
}

h1 {
  margin: 0;
  font-size: 2rem;
  letter-spacing: 0.02em;
}

.heart {
  display: inline-block;
  animation: beat 1.6s ease-in-out infinite;
}

@keyframes beat {
  0%, 100% { transform: scale(1); }
  12% { transform: scale(1.25); }
  24% { transform: scale(1); }
}

.tagline {
  margin: 8px 0 0;
  color: var(--muted);
}

.tagline strong {
  color: var(--pink-soft);
}

.stage {
  position: relative;
  line-height: 0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 0 0 1px #3a2a40, 0 18px 50px rgba(0, 0, 0, 0.5);
}

#canvas {
  max-width: 100%;
  height: auto;
  touch-action: none;
  display: block;
}

.stage:has(#hint:not(.hidden)) {
  cursor: pointer;
}

#hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
  pointer-events: none;
  transition: opacity 0.4s;
}

#hint small {
  color: var(--pink-soft);
}

#hint.hidden {
  opacity: 0;
}

.progress-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-track {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: #33243a;
  overflow: hidden;
}

#progressBar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--pink), var(--pink-soft));
  transition: width 0.2s linear;
}

#progressLabel {
  color: var(--pink-soft);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-size: 0.95rem;
}

.controls {
  width: 100%;
  background: var(--panel);
  border: 1px solid #3a2a40;
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  align-items: center;
}

.control {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  color: var(--text);
}

.control input[type="range"] {
  accent-color: var(--pink);
}

.file-button {
  border: 1px solid var(--pink);
  background: transparent;
  color: var(--pink-soft);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s;
}

.file-button:hover {
  background: #3a2941;
}

.control.checkbox {
  gap: 8px;
}

.control.checkbox input {
  accent-color: var(--pink);
}

.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

button {
  border: 1px solid #503a58;
  background: #2e2033;
  color: var(--text);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
}

button:hover {
  background: #3a2941;
}

button:active {
  transform: scale(0.97);
}

#btnMorph {
  background: var(--pink);
  border-color: var(--pink);
  color: #2a0d1c;
  font-weight: 600;
}

#btnMorph:hover {
  background: #ff77b2;
}

footer {
  max-width: 600px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}
