:root {
  --bg: #050f16;
  --bg-alt: #071b29;
  --panel-bg: #0b2838;
  --accent: #2ecf7f;
  --accent-soft: rgba(46, 207, 127, 0.18);
  --text: #f4f9f7;
  --muted: #c1d7d0;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
  --radius-lg: 18px;
  --radius-xl: 24px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: radial-gradient(circle at top, #133a54 0, #050f16 55%, #010407);
  color: var(--text);
}

/* Topbar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  background: linear-gradient(
    to bottom,
    rgba(1, 8, 14, 0.95),
    rgba(1, 8, 14, 0.5)
  );
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-size: 1rem;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.brand-eco {
  text-transform: lowercase;
  font-weight: 600;
  color: var(--accent);
}

.brand-by {
  font-weight: 700;
}

.brand-tagline {
  font-size: 0.8rem;
  color: var(--muted);
}

.nav {
  display: flex;
  gap: 12px;
  font-size: 0.85rem;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

/* Layout */

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 20px 40px;
}

.stage-section {
  margin-bottom: 32px;
}

.stage-wrapper {
  display: grid;
  gap: 18px;
}

.stage-header h1 {
  margin: 0 0 8px;
  font-size: 1.8rem;
}

.stage-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.stage {
  background: linear-gradient(135deg, #071b29, #041019);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  padding: 14px;
  box-shadow: var(--shadow);
}

.stage-inner {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 ratio */
  border-radius: 16px;
  overflow: hidden;
  background: radial-gradient(circle at top, #163b52 0, #02070b 65%);
}

/* Placeholder */

.stage-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  padding: 0 18px;
}

.stage-placeholder span {
  font-size: 0.85rem;
  opacity: 0.9;
}

/* Base image */

.base-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

/* Overlay */

.overlay {
  position: absolute;
  inset: 0;
  pointer-events: none; /* enable individual elements only */
}

.sticker {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: rgba(2, 10, 8, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5);
  cursor: grab;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
}

.sticker:active {
  cursor: grabbing;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
}

/* Labels */

.stage-label {
  position: absolute;
  top: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(2, 10, 8, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--muted);
}

.stage-label--before {
  left: 10px;
}

.stage-label--after {
  right: 10px;
  color: var(--accent);
}

/* Controls */

.controls-section {
  margin-top: 8px;
}

.controls-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 18px;
}

.panel {
  background: var(--panel-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 16px 16px 18px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.55);
  font-size: 0.95rem;
}

.panel h2 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.panel p {
  margin: 0 0 10px;
  color: var(--muted);
}

.panel-note h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.panel-note p {
  margin: 0;
}

.file-label {
  display: inline-flex;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--accent);
  color: #041008;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 12px 30px rgba(46, 207, 127, 0.45);
  cursor: pointer;
  align-items: center;
  gap: 6px;
}

.file-label input {
  display: none;
}

.button-row,
.view-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Buttons */

.btn {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(4, 16, 24, 0.9);
  color: var(--text);
  padding: 7px 14px;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
}

.btn.secondary {
  border-color: var(--accent);
  color: var(--accent);
}

.btn.ghost {
  border-style: dashed;
  color: var(--muted);
}

/* Footer */

.footer {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.85);
  padding: 12px 20px;
}

.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted);
}

.footer-meta {
  opacity: 0.8;
}

/* Responsive */

@media (max-width: 900px) {
  .controls-inner {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 700px) {
  .stage-header h1 {
    font-size: 1.5rem;
  }

  .page {
    padding-inline: 14px;
  }

  .topbar-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .nav {
    flex-wrap: wrap;
  }
}
