* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background: #0f0c29;
  color: #fff;
  min-height: 100vh;
}

/* ---------- Front page ---------- */
#landing {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: radial-gradient(circle at 30% 20%, #7b2ff7 0%, #302b63 40%, #0f0c29 100%);
}
.logo { font-size: 72px; }
#landing h1 {
  font-size: clamp(56px, 12vw, 120px);
  letter-spacing: 2px;
  background: linear-gradient(90deg, #ff6ec4, #7873f5, #4ade80);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tagline { font-size: 20px; opacity: 0.85; margin: 8px 0 32px; }

.big-btn {
  background: linear-gradient(90deg, #ff6ec4, #7873f5);
  color: #fff;
  border: none;
  border-radius: 40px;
  padding: 16px 44px;
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s;
}
.big-btn:hover { transform: scale(1.04); }
.big-btn:disabled { opacity: 0.5; cursor: wait; transform: none; }
.big-btn.small { padding: 12px 20px; font-size: 17px; width: 100%; margin-top: 8px; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #1b1740;
  padding: 10px 18px;
  position: sticky;
  top: 0;
  z-index: 5;
}
.brand { font-size: 20px; font-weight: 700; margin-right: auto; }
.tab {
  background: #2d2766;
  color: #fff;
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 15px;
  cursor: pointer;
}
.tab.active { border-color: #ff6ec4; }

/* ---------- Paint window ---------- */
.workspace { display: flex; min-height: calc(100vh - 56px); }

.tools {
  width: 230px;
  background: #1b1740;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tools h3 { font-size: 14px; margin-top: 8px; opacity: 0.85; }

.swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.swatch {
  aspect-ratio: 1;
  border-radius: 8px;
  border: 3px solid transparent;
  cursor: pointer;
}
.swatch.active { border-color: #fff; }

.picker { font-size: 13px; display: flex; justify-content: space-between; align-items: center; }
.picker input { width: 44px; height: 30px; border: none; background: none; cursor: pointer; }

input[type="range"] { width: 100%; }

.row { display: flex; gap: 8px; }
.tool {
  flex: 1;
  background: #2d2766;
  color: #fff;
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 10px 6px;
  font-size: 14px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}
.tool:hover { background: #3b3380; }
.tool.active { border-color: #ff6ec4; }
.tool.danger { background: #6b1d2a; }

.help { margin-top: auto; font-size: 13px; line-height: 1.7; background: #2d2766; padding: 12px; border-radius: 10px; }

.stage { flex: 1; padding: 18px; }
.status { margin-bottom: 12px; font-size: 15px; opacity: 0.9; }

.boxes { display: flex; gap: 16px; flex-wrap: wrap; }
.box { flex: 1; min-width: 300px; }
.box-title { font-size: 14px; margin-bottom: 6px; opacity: 0.8; }

.frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid #3b3380;
}
.frame.white { background: #fff; }
.frame video, .frame canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.frame video { object-fit: cover; transform: scaleX(-1); }

.cursor {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 6px #000;
  transform: translate(-50%, -50%);
  pointer-events: none;
  display: none;
}

/* ---------- After "Done drawing" ---------- */
#finish {
  padding: 28px 18px 60px;
  background: #15123a;
  border-top: 3px solid #7873f5;
}
#finish h2 { margin-bottom: 16px; }
.finish-grid { display: flex; gap: 24px; flex-wrap: wrap; }
.finish-left, .finish-right { flex: 1; min-width: 300px; display: flex; flex-direction: column; gap: 10px; }
.finish-left img, #resultImg {
  width: 100%;
  border-radius: 12px;
  background: #fff;
  border: 2px solid #3b3380;
}
.finish-right h3 { font-size: 15px; margin-top: 6px; opacity: 0.9; }

.desc-wrap { display: flex; gap: 8px; align-items: stretch; }
textarea {
  flex: 1;
  background: #1b1740;
  color: #fff;
  border: 2px solid #3b3380;
  border-radius: 10px;
  padding: 10px;
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
}
.mic { flex: 0 0 56px; font-size: 22px; }
.mic.active { background: #c0392b; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: #2d2766;
  color: #fff;
  border: 2px solid transparent;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
}
.chip:hover { background: #3b3380; }
.chip.active { border-color: #ff6ec4; background: #4a2f7a; }

/* ---------- Album ---------- */
#albumView { padding: 24px 18px 60px; }
#albumView h2 { margin-bottom: 14px; }
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.card {
  background: #1b1740;
  border-radius: 12px;
  padding: 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 2px solid transparent;
}
.card:hover { border-color: #7873f5; }
.card.nohover { cursor: default; }
.card.nohover:hover { border-color: transparent; }
.card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: #fff; }
.card .label { font-size: 13px; opacity: 0.9; }
.folder-head { max-width: 420px; margin-bottom: 14px; }

@media (max-width: 800px) {
  .workspace { flex-direction: column; }
  .tools { width: 100%; }
}
