@font-face {
  font-family: "OrbitronLocal";
  src: url("/photobooth/orbitron_variable.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "BangersLocal";
  src: url("/photobooth/bangers.ttf") format("truetype");
  font-display: swap;
}

:root {
  --bg: #080b12;
  --panel: rgba(17, 23, 36, 0.92);
  --line: rgba(255, 255, 255, 0.16);
  --text: #f5f8ff;
  --muted: #b6c3df;
  --pink: #ff2d55;
  --orange: #ff7e48;
  --blue: #45c5ff;
  --gold: #ffcf66;
  --ok: #45d39a;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "OrbitronLocal", "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(130deg, #0a0d17, #07090f 56%, #0b1120);
}

.orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(8px);
  opacity: 0.86;
}

.orb-a {
  width: 38vw;
  height: 38vw;
  left: -8vw;
  top: -10vw;
  background: radial-gradient(circle, rgba(255, 45, 85, 0.5), transparent 70%);
  animation: floatA 11s ease-in-out infinite;
}

.orb-b {
  width: 34vw;
  height: 34vw;
  right: -10vw;
  top: -8vw;
  background: radial-gradient(circle, rgba(69, 197, 255, 0.46), transparent 72%);
  animation: floatB 12s ease-in-out infinite;
}

.orb-c {
  width: 36vw;
  height: 36vw;
  left: 28vw;
  bottom: -18vw;
  background: radial-gradient(circle, rgba(255, 207, 102, 0.22), transparent 72%);
  animation: floatC 13s ease-in-out infinite;
}

@keyframes floatA {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(18px) scale(1.03); }
}

@keyframes floatB {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-14px) scale(1.02); }
}

@keyframes floatC {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(16px) scale(1.04); }
}

.topbar {
  padding: 14px 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto);
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 12, 20, 0.82);
  backdrop-filter: blur(8px);
}

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

.brand img {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  box-shadow: 0 0 22px rgba(255, 45, 85, 0.28), 0 0 18px rgba(69, 197, 255, 0.24);
}

.brand h1 {
  margin: 0;
  font-family: "BangersLocal", "OrbitronLocal", sans-serif;
  font-size: clamp(32px, 4vw, 50px);
  letter-spacing: 0.35px;
  line-height: 1;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.top-right {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.chip {
  border: 1px solid rgba(69, 197, 255, 0.45);
  background: rgba(69, 197, 255, 0.14);
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 12px;
}

.status-banner {
  border: 1px solid rgba(69, 211, 154, 0.55);
  background: rgba(69, 211, 154, 0.2);
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 12px;
  max-width: 430px;
}

.status-banner.error {
  border-color: rgba(255, 80, 122, 0.65);
  background: rgba(255, 80, 122, 0.2);
}

.shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px;
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: fadeIn 0.22s ease-out both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h2 {
  margin: 0;
  font-family: "BangersLocal", "OrbitronLocal", sans-serif;
  font-size: clamp(24px, 3.2vw, 40px);
  letter-spacing: 0.35px;
}

h3 {
  margin: 0;
}

.muted {
  color: var(--muted);
}

.hero-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  padding: 20px;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.34);
}

.hero-card p {
  margin: 8px 0 0;
  color: var(--muted);
}

.hero-actions {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.hero-btn {
  min-height: 132px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  font: inherit;
  font-family: "BangersLocal", "OrbitronLocal", sans-serif;
  font-size: clamp(34px, 5vw, 54px);
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hero-btn:hover {
  transform: translateY(-2px);
}

.hero-btn.primary {
  background: linear-gradient(135deg, rgba(255, 45, 85, 0.98), rgba(255, 126, 72, 0.9));
  box-shadow: 0 0 24px rgba(255, 45, 85, 0.35);
}

.hero-btn.ghost {
  background: rgba(19, 26, 42, 0.72);
}

.home-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.glass-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(14, 20, 32, 0.9);
  padding: 12px;
}

.glass-card ol {
  margin: 8px 0 0 18px;
  padding: 0;
  color: var(--muted);
}

.glass-card li + li {
  margin-top: 5px;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.wizard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.step {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  font-size: 12px;
  color: var(--muted);
  background: rgba(17, 24, 39, 0.8);
  cursor: pointer;
}

.step.active {
  color: #fff;
  border-color: rgba(69, 197, 255, 0.64);
  background: rgba(69, 197, 255, 0.2);
}

.wizard-body {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.34);
  padding: 16px;
  min-height: 560px;
}

.step-panel {
  display: none;
}

.step-panel.active {
  display: block;
  animation: fadeIn 0.2s ease-out both;
}

.subtitle {
  margin: 6px 0 14px;
  color: var(--muted);
  font-size: 14px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.choice-card {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  background: rgba(12, 18, 29, 0.9);
  padding: 12px;
  display: grid;
  gap: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.choice-card.active {
  border-color: rgba(69, 197, 255, 0.6);
  box-shadow: inset 0 0 0 1px rgba(69, 197, 255, 0.3), 0 0 16px rgba(69, 197, 255, 0.2);
}

.template-thumb,
.layout-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(135deg, #1b2438, #2a1f32);
  position: relative;
  overflow: hidden;
}

.template-thumb::before {
  content: "";
  position: absolute;
  inset: -30% -20%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.16), transparent 62%);
  transform: rotate(-12deg);
}

.template-thumb::after {
  content: "";
  position: absolute;
  inset: 12% 10% 18% 10%;
  border: 4px solid rgba(255, 255, 255, 0.88);
  border-radius: 12px;
}

.template-thumb.template-elegant {
  background: linear-gradient(135deg, #1f1a27, #594229);
}

.template-thumb.template-corporate {
  background: linear-gradient(135deg, #14263a, #202a3c);
}

.template-thumb.template-kids {
  background: linear-gradient(135deg, #222734, #3a404c);
}

.template-thumb.template-neon {
  background: linear-gradient(135deg, #2f2031, #5a4030);
}

.template-thumb.template-collage::after {
  border: none;
  inset: 0;
  content: "";
  background:
    linear-gradient(rgba(255,255,255,0.85), rgba(255,255,255,0.85)) 8% 12% / 54% 76% no-repeat,
    linear-gradient(rgba(255,255,255,0.85), rgba(255,255,255,0.85)) 66% 12% / 26% 34% no-repeat,
    linear-gradient(rgba(255,255,255,0.85), rgba(255,255,255,0.85)) 66% 54% / 26% 34% no-repeat;
}

.layout-thumb {
  background: linear-gradient(135deg, #12243b, #1a1f34);
}

.layout-thumb .box {
  position: absolute;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 8px;
}

.layout-1-2 .box.a { left: 6%; top: 12%; width: 56%; height: 72%; }
.layout-1-2 .box.b { left: 66%; top: 12%; width: 28%; height: 30%; }
.layout-1-2 .box.c { left: 66%; top: 54%; width: 28%; height: 30%; }

.layout-4 .box.a { left: 6%; top: 12%; width: 40%; height: 32%; }
.layout-4 .box.b { left: 54%; top: 12%; width: 40%; height: 32%; }
.layout-4 .box.c { left: 6%; top: 56%; width: 40%; height: 32%; }
.layout-4 .box.d { left: 54%; top: 56%; width: 40%; height: 32%; }

.layout-strip-3 .box.a { left: 11%; top: 10%; width: 24%; height: 78%; }
.layout-strip-3 .box.b { left: 38%; top: 10%; width: 24%; height: 78%; }
.layout-strip-3 .box.c { left: 65%; top: 10%; width: 24%; height: 78%; }

.layout-strip-4 .box.a { left: 6%; top: 10%; width: 20%; height: 78%; }
.layout-strip-4 .box.b { left: 29%; top: 10%; width: 20%; height: 78%; }
.layout-strip-4 .box.c { left: 52%; top: 10%; width: 20%; height: 78%; }
.layout-strip-4 .box.d { left: 75%; top: 10%; width: 20%; height: 78%; }

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  border-radius: 999px;
  font-size: 10px;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
}

.small-btn {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 10px 14px;
  font: inherit;
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.small-btn:hover {
  transform: translateY(-1px);
}

.small-btn.primary {
  background: linear-gradient(135deg, rgba(255, 45, 85, 0.98), rgba(255, 126, 72, 0.9));
  box-shadow: 0 0 16px rgba(255, 45, 85, 0.28);
}

.small-btn.ghost {
  background: rgba(18, 25, 42, 0.72);
}

.edit-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 12px;
}

.edit-card {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(12, 18, 29, 0.88);
  padding: 12px;
}

.fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

input,
select {
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(8, 12, 22, 0.88);
  color: #fff;
  padding: 10px 12px;
  font: inherit;
}

input[type="color"] {
  padding: 2px;
  min-height: 46px;
}

input[type="range"] {
  padding: 0;
}

input[type="file"] {
  padding: 8px;
}

.bg-meta-row {
  margin-top: 10px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.bg-meta-row .meta-text {
  flex: 1;
  min-width: 220px;
}

.palette-row {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.palette-btn {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(16, 22, 34, 0.8);
  color: #fff;
  padding: 7px 12px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.actions-row {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mini-preview-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mini-preview {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(8, 12, 22, 0.86);
  padding: 8px;
}

.mini-preview span {
  font-size: 11px;
  color: var(--muted);
}

.mini-preview img {
  margin-top: 6px;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
}

.advanced-panel {
  margin-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-top: 12px;
}

.advanced-panel h3 {
  margin-bottom: 10px;
}

.advanced-fields {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.quality-box {
  border: 1px solid rgba(69, 211, 154, 0.5);
  background: rgba(69, 211, 154, 0.18);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
}

.quality-box.mid {
  border-color: rgba(255, 207, 102, 0.62);
  background: rgba(255, 207, 102, 0.2);
}

.quality-box.low {
  border-color: rgba(255, 80, 122, 0.62);
  background: rgba(255, 80, 122, 0.2);
}

.quality-list {
  margin: 10px 0 12px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.quality-item {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(11, 16, 27, 0.9);
  padding: 7px 10px;
  font-size: 12px;
}

.quality-item.ok {
  border-color: rgba(69, 211, 154, 0.45);
}

.quality-item.warn {
  border-color: rgba(255, 207, 102, 0.45);
}

.quality-item.bad {
  border-color: rgba(255, 80, 122, 0.48);
}

.final-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.final-preview-card {
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  background: rgba(12, 18, 29, 0.9);
  padding: 10px;
}

.final-preview-card img {
  width: 100%;
  max-height: 430px;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.3);
}

.publish-actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.wizard-footer {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.projects-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.projects-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.project-card {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  background: rgba(12, 18, 29, 0.9);
  padding: 12px;
  display: grid;
  gap: 8px;
}

.project-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.32);
}

.meta-text {
  font-size: 11px;
  color: var(--muted);
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dialog {
  width: min(760px, 96vw);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  background: rgba(10, 14, 24, 0.98);
  color: #fff;
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.dialog-body {
  padding: 12px;
  display: grid;
  gap: 10px;
}

.toast {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 50;
  max-width: min(380px, 92vw);
  border-radius: 12px;
  border: 1px solid rgba(69, 211, 154, 0.56);
  background: rgba(69, 211, 154, 0.2);
  color: #fff;
  padding: 10px 12px;
}

.hidden {
  display: none !important;
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr;
  }
  .top-right {
    justify-items: start;
  }
  .home-grid,
  .hero-actions,
  .edit-grid,
  .final-preview-grid {
    grid-template-columns: 1fr;
  }
  .wizard-head {
    flex-direction: column;
    align-items: stretch;
  }
  .wizard-footer {
    flex-direction: column;
  }
}
