:root {
  --radius: 24px;
  --transition: 300ms ease;
}

body[data-theme="default"][data-mode="light"] {
  --bg: #f8f6f2;
  --ink: #1f1b16;
  --muted: #8d8377;
  --panel: #ffffff;
  --panel-soft: #f1f4f8;
  --panel-border: #e8e2d8;
  --preview-bg: #e9eef5;
  --control-bg: #f5f3ee;
  --chip-bg: #ebe6de;
  --chip-active: #f1c58b;
  --chip-text: #3b2f24;
  --accent: #f1c58b;
  --accent-strong: #e5a95a;
  --status-bg: #f4f4f4;
  --status-border: #f0ece6;
  --status-text: #8d8377;
  --icon-bg: #ffffff;
  --placeholder-text: #90a0b2;
  --placeholder-border: #c8d2de;
  --output-bg: #f1f4f8;
  --output-border: #d7e0ea;
  --slot-bg: #f8fafc;
  --slot-border: #d7e0ea;
  --slot-filled-border: #e4d8c8;
  --tip-bg: #f9f4ea;
  --tip-text: #8d8377;
  --tip-accent: #b07a33;
  --input-bg: #faf7f2;
  --input-border: #eadfd2;
  --button-bg: #efeae2;
  --button-ghost-border: #e0d6c8;
  --thumb-bg: #f1f4f8;
  --footer-dot: #3fb87a;
  --overlay-shadow: rgba(0, 0, 0, 0.35);
  --shadow-main: 0 18px 45px rgba(26, 18, 10, 0.1);
  --shadow-soft: 0 8px 20px rgba(30, 20, 10, 0.08);
  --shadow-card: 0 16px 30px rgba(20, 12, 6, 0.1);
  --shadow-lift: 0 12px 20px rgba(20, 12, 6, 0.12);
  --shadow-strong: 0 10px 20px rgba(20, 12, 6, 0.08);
  --shadow-shutter: 0 10px 16px rgba(40, 24, 10, 0.2);
  --slot-glow: rgba(241, 197, 139, 0.25);
  --chip-glow: rgba(229, 169, 90, 0.3);
  --shutter-border: #f0d3a1;
  --shutter-core: #efb971;
  --shutter-ring: #f5e0c1;
  --output-image-shadow: 0 16px 30px rgba(20, 12, 6, 0.1);
  --flash: #ffffff;
  --overlay-text: #ffffff;
  --emoji-opacity: 0.75;
  --emoji-blur: 0.2px;
  --emoji-filter: brightness(0.9) saturate(1.05);
  --emoji-shadow: drop-shadow(0 6px 14px rgba(20, 12, 6, 0.12));
}

body[data-theme="default"][data-mode="dark"] {
  --bg: #121212;
  --ink: #f1f1f1;
  --muted: #b5b0a8;
  --panel: #1c1c1c;
  --panel-soft: #20242b;
  --panel-border: #2d2d2d;
  --preview-bg: #1a1f26;
  --control-bg: #1f1f1f;
  --chip-bg: #2a2a2a;
  --chip-active: #d1a268;
  --chip-text: #f1f1f1;
  --accent: #d1a268;
  --accent-strong: #c18b4b;
  --status-bg: #1a1a1a;
  --status-border: #2b2b2b;
  --status-text: #b5b0a8;
  --icon-bg: #1e1e1e;
  --placeholder-text: #7f8a96;
  --placeholder-border: #3a4450;
  --output-bg: #222831;
  --output-border: #3a424d;
  --slot-bg: #1f242b;
  --slot-border: #3a424d;
  --slot-filled-border: #4a3d2b;
  --tip-bg: #252019;
  --tip-text: #c4bcb0;
  --tip-accent: #d1a268;
  --input-bg: #1f1f1f;
  --input-border: #343434;
  --button-bg: #2a2620;
  --button-ghost-border: #3a3330;
  --thumb-bg: #1f242b;
  --footer-dot: #3fb87a;
  --overlay-shadow: rgba(0, 0, 0, 0.5);
  --shadow-main: 0 18px 45px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 8px 20px rgba(0, 0, 0, 0.35);
  --shadow-card: 0 16px 30px rgba(0, 0, 0, 0.35);
  --shadow-lift: 0 12px 20px rgba(0, 0, 0, 0.4);
  --shadow-strong: 0 10px 20px rgba(0, 0, 0, 0.4);
  --shadow-shutter: 0 10px 16px rgba(0, 0, 0, 0.45);
  --slot-glow: rgba(209, 162, 104, 0.25);
  --chip-glow: rgba(209, 162, 104, 0.28);
  --shutter-border: #b98854;
  --shutter-core: #d1a268;
  --shutter-ring: #e0c198;
  --output-image-shadow: 0 16px 30px rgba(0, 0, 0, 0.45);
  --flash: #ffffff;
  --overlay-text: #ffffff;
  --emoji-opacity: 0.75;
  --emoji-blur: 0.4px;
  --emoji-filter: brightness(1.12) saturate(1.08);
  --emoji-shadow: drop-shadow(0 6px 16px rgba(255, 220, 190, 0.12));
}

body[data-theme="romantic"][data-mode="light"] {
  --bg: #fff6f8;
  --ink: #c2185b;
  --muted: #a15b78;
  --panel: #ffffff;
  --panel-soft: #f7f0f4;
  --panel-border: #f0d7e2;
  --preview-bg: #f1eaf0;
  --control-bg: #f7edf2;
  --chip-bg: #f1dbe4;
  --chip-active: #f3c0c8;
  --chip-text: #6a2f48;
  --accent: #f3c0c8;
  --accent-strong: #d48aa5;
  --status-bg: #fff0f4;
  --status-border: #f2dbe4;
  --status-text: #a15b78;
  --icon-bg: #ffffff;
  --placeholder-text: #b98aa0;
  --placeholder-border: #e2c5d3;
  --output-bg: #f7f0f4;
  --output-border: #e8cdd9;
  --slot-bg: #fbf5f8;
  --slot-border: #e8cdd9;
  --slot-filled-border: #e5c1d1;
  --tip-bg: #fbe7ef;
  --tip-text: #a15b78;
  --tip-accent: #c46a88;
  --input-bg: #fff1f6;
  --input-border: #f0d7e2;
  --button-bg: #f2e1e8;
  --button-ghost-border: #e6cbd6;
  --thumb-bg: #f3ecf1;
  --footer-dot: #f08bb0;
  --overlay-shadow: rgba(0, 0, 0, 0.35);
  --shadow-main: 0 18px 45px rgba(90, 40, 60, 0.12);
  --shadow-soft: 0 8px 20px rgba(90, 40, 60, 0.08);
  --shadow-card: 0 16px 30px rgba(90, 40, 60, 0.12);
  --shadow-lift: 0 12px 20px rgba(90, 40, 60, 0.12);
  --shadow-strong: 0 10px 20px rgba(90, 40, 60, 0.12);
  --shadow-shutter: 0 10px 16px rgba(120, 70, 90, 0.2);
  --slot-glow: rgba(243, 192, 200, 0.4);
  --chip-glow: rgba(212, 138, 165, 0.3);
  --shutter-border: #f3c0c8;
  --shutter-core: #e9a8bd;
  --shutter-ring: #f7d4e0;
  --output-image-shadow: 0 16px 30px rgba(90, 40, 60, 0.18);
  --flash: #ffffff;
  --overlay-text: #ffffff;
  --emoji-opacity: 0.75;
  --emoji-blur: 0.3px;
  --emoji-filter: brightness(0.92) saturate(1.08);
  --emoji-shadow: drop-shadow(0 6px 14px rgba(150, 70, 100, 0.12));
}

body[data-theme="romantic"][data-mode="dark"] {
  --bg: #1f0e17;
  --ink: #f8a1c4;
  --muted: #d28aa9;
  --panel: #2a1420;
  --panel-soft: #2f1a25;
  --panel-border: #3b2430;
  --preview-bg: #2a1a24;
  --control-bg: #2a1622;
  --chip-bg: #3a1f2c;
  --chip-active: #c9809b;
  --chip-text: #f8a1c4;
  --accent: #c9809b;
  --accent-strong: #e49ab8;
  --status-bg: #2a1420;
  --status-border: #3b2430;
  --status-text: #d28aa9;
  --icon-bg: #2a1420;
  --placeholder-text: #b67a94;
  --placeholder-border: #4a2c3a;
  --output-bg: #2f1a25;
  --output-border: #4a2c3a;
  --slot-bg: #2b1722;
  --slot-border: #4a2c3a;
  --slot-filled-border: #5a3446;
  --tip-bg: #2a1521;
  --tip-text: #d28aa9;
  --tip-accent: #f0a5c6;
  --input-bg: #2a1622;
  --input-border: #4a2c3a;
  --button-bg: #3a232f;
  --button-ghost-border: #5a3446;
  --thumb-bg: #2b1722;
  --footer-dot: #f08bb0;
  --overlay-shadow: rgba(0, 0, 0, 0.55);
  --shadow-main: 0 18px 45px rgba(0, 0, 0, 0.5);
  --shadow-soft: 0 8px 20px rgba(0, 0, 0, 0.4);
  --shadow-card: 0 16px 30px rgba(0, 0, 0, 0.45);
  --shadow-lift: 0 12px 20px rgba(0, 0, 0, 0.45);
  --shadow-strong: 0 10px 20px rgba(0, 0, 0, 0.5);
  --shadow-shutter: 0 10px 16px rgba(0, 0, 0, 0.55);
  --slot-glow: rgba(248, 161, 196, 0.25);
  --chip-glow: rgba(248, 161, 196, 0.25);
  --shutter-border: #b56b8a;
  --shutter-core: #c9809b;
  --shutter-ring: #d9a2b7;
  --output-image-shadow: 0 16px 30px rgba(0, 0, 0, 0.5);
  --flash: #ffffff;
  --overlay-text: #ffffff;
  --emoji-opacity: 0.75; 
  --emoji-blur: 0.4px;
  --emoji-filter: brightness(1.18) saturate(1.12);
  --emoji-shadow: drop-shadow(0 6px 16px rgba(255, 190, 220, 0.12));
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Montserrat", sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  transition: background-color var(--transition), color var(--transition);
}

.emoji-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  transition: opacity var(--transition);
  opacity: var(--emoji-opacity);
  filter: blur(var(--emoji-blur)) var(--emoji-filter) var(--emoji-shadow);
}

.emoji-field.fade {
  opacity: 0;
}

.emoji-field span {
  position: absolute;
  font-size: 24px;
  opacity: var(--emoji-opacity);
  filter: blur(var(--emoji-blur)) var(--emoji-filter) var(--emoji-shadow);
  animation: floaty ease-in-out infinite;
}

@keyframes floaty {
  0% {
    transform: translate3d(0, 0, 0) scale(0.95);
  }
  50% {
    transform: translate3d(0, -40px, 0) scale(1.05);
  }
  100% {
    transform: translate3d(0, -80px, 0) scale(0.98);
  }
}

.app {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 32px auto 48px;
  padding: 0 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand h1 {
  font-family: "Fraunces", serif;
  font-size: 32px;
  font-weight: 600;
}

.eyebrow {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.eyebrow-note {
  text-transform: none;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 500;
}

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

.status {
  background: var(--status-bg);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  color: var(--status-text);
  border: 1px solid var(--status-border);
  transition: background-color var(--transition), color var(--transition), border-color var(--transition);
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  transition: color var(--transition);
  position: relative;
}

.toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle .track {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: var(--panel-soft);
  border: 1px solid var(--panel-border);
  position: relative;
  transition: background-color var(--transition), border-color var(--transition);
}

.toggle .track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  transition: transform var(--transition), background-color var(--transition);
}

.toggle input:checked + .track {
  background: var(--accent);
  border-color: var(--accent-strong);
}

.toggle input:checked + .track::after {
  transform: translateX(18px);
}

.toggle.icon {
  gap: 0;
  width: 42px;
  height: 24px;
  justify-content: center;
}

.toggle.icon .icon-moon {
  position: absolute;
  width: 42px;
  height: 24px;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--ink);
  pointer-events: none;
}

.toggle .label-text {
  font-weight: 600;
}

.stage {
  display: grid;
  grid-template-columns: 1.4fr 0.7fr;
  gap: 22px;
  align-items: start;
}

.stage-left {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.preview-card {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow-main);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border: 1px solid var(--panel-border);
  transition: background-color var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.preview {
  position: relative;
  border-radius: 24px;
  background: var(--preview-bg);
  overflow: hidden;
  min-height: 360px;
  transition: background-color var(--transition);
}

video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scaleX(-1);
}

.preview-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--placeholder-text);
  gap: 10px;
}

.placeholder-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  border: 2px solid var(--placeholder-border);
  position: relative;
}

.placeholder-icon::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 2px solid var(--placeholder-border);
  border-radius: 6px;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 88px;
  font-weight: 600;
  color: var(--overlay-text);
  text-shadow: 0 10px 40px var(--overlay-shadow);
  opacity: 0;
  pointer-events: none;
}

.flash {
  position: absolute;
  inset: 0;
  background: var(--flash);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.control-bar {
  background: var(--control-bg);
  border-radius: 18px;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 1.2fr auto 1fr;
  align-items: center;
  gap: 12px;
  transition: background-color var(--transition);
}

.segmented {
  display: flex;
  gap: 8px;
}

.segmented button {
  padding: 8px 12px;
  border-radius: 12px;
  border: none;
  background: var(--chip-bg);
  color: var(--chip-text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 160ms ease, background-color var(--transition), color var(--transition);
}

.segmented button.active {
  background: var(--accent);
  box-shadow: 0 8px 20px var(--chip-glow);
}

.shutter {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 6px solid var(--shutter-border);
  background: var(--shutter-core);
  box-shadow: inset 0 0 0 3px var(--shutter-ring), var(--shadow-shutter);
  cursor: pointer;
}

.filter {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  font-size: 12px;
  color: var(--muted);
}

.filter select {
  border: none;
  background: transparent;
  font-family: inherit;
  font-weight: 600;
  color: var(--chip-text);
}

.panel {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-main);
  display: flex;
  flex-direction: column;
  gap: 16px;
  border: 1px solid var(--panel-border);
  transition: background-color var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.panel-header h2 {
  font-size: 18px;
  margin-bottom: 4px;
}

.panel-header p {
  font-size: 13px;
  color: var(--muted);
}

.output-area {
  background: var(--output-bg);
  border-radius: 20px;
  padding: 24px;
  display: grid;
  place-items: center;
  min-height: 220px;
  border: 1px solid var(--output-border);
  transition: background-color var(--transition), border-color var(--transition);
}

.output-area img {
  width: 100%;
  border-radius: 16px;
  box-shadow: var(--output-image-shadow);
}

.output-area img.printed {
  animation: print-pop 420ms ease;
}

@keyframes print-pop {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.output-slots {
  width: 100%;
  display: grid;
  gap: 12px;
}

.output-slots.printed .output-slot img {
  animation: print-pop 420ms ease;
}

.output-slots.strip {
  grid-template-columns: 1fr;
}

.output-slots.single {
  grid-template-columns: 1fr;
}

.output-slot {
  background: var(--slot-bg);
  border-radius: 16px;
  border: 1px dashed var(--slot-border);
  min-height: 110px;
  display: grid;
  place-items: center;
  position: relative;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background-color var(--transition);
  overflow: hidden;
}

.output-slot.filled {
  border-style: solid;
  border-color: var(--slot-filled-border);
  background: var(--panel);
  box-shadow: var(--shadow-card);
}

.output-slot.highlight {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--slot-glow);
}

.output-slot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
  transition: transform 200ms ease, opacity 200ms ease;
  touch-action: none;
}

.output-slot .slot-placeholder {
  font-size: 12px;
  color: var(--placeholder-text);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.output-placeholder {
  text-align: center;
  font-size: 12px;
  color: var(--placeholder-text);
  margin-top: -10px;
}

.panel-actions {
  display: grid;
  gap: 10px;
}

.btn {
  padding: 12px 16px;
  border-radius: 16px;
  border: none;
  font-weight: 600;
  font-family: inherit;
  background: var(--button-bg);
  cursor: pointer;
  transition: background-color var(--transition), color var(--transition), border-color var(--transition);
}

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

.btn.ghost {
  background: transparent;
  border: 1px solid var(--button-ghost-border);
  color: var(--muted);
}

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

.panel-footnote {
  background: var(--tip-bg);
  border-radius: 16px;
  padding: 10px 14px;
  font-size: 11px;
  color: var(--tip-text);
}

.panel-footnote span {
  color: var(--tip-accent);
  font-weight: 600;
}

.panel-settings {
  display: grid;
  gap: 16px;
}

.setting .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 8px;
  display: block;
}

.setting input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  font-family: inherit;
}

.session {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.session h3 {
  font-size: 16px;
  margin-bottom: 4px;
}

.session p {
  font-size: 12px;
  color: var(--muted);
}

.link-btn {
  border: none;
  background: transparent;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  cursor: pointer;
}

.thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, 120px);
  gap: 14px;
  justify-content: start;
}

.thumbs img,
.thumbs .thumb-placeholder {
  width: 120px;
  height: 120px;
  border-radius: 18px;
  background: var(--thumb-bg);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-strong);
}

.thumbs img {
  object-fit: contain;
  padding: 8px;
}

.thumbs img.draggable {
  cursor: grab;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
  touch-action: none;
}

.thumbs img.draggable:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-lift);
}

.dragging {
  opacity: 0.8;
  cursor: grabbing;
}

.drag-ghost {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  width: 110px;
  height: 110px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-main);
  transform: translate(-50%, -50%) scale(1.05);
  transition: transform 180ms ease, opacity 180ms ease;
}

.drag-ghost img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
  background: var(--panel);
}

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
  margin-top: 10px;
}

.footer a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.footer a:hover {
  border-bottom-color: var(--accent);
}

.blog {
  max-width: 980px;
}

.blog-content {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-main);
  border: 1px solid var(--panel-border);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.blog-content h2 {
  font-size: 20px;
  margin-top: 12px;
}

.blog-content h3 {
  font-size: 16px;
  margin-top: 8px;
}

.blog-content p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
}

.blog-content a {
  color: inherit;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--panel-border);
}

.blog-content a:hover {
  border-bottom-color: var(--accent);
}

.blog-links {
  margin-top: 8px;
}

.seo {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.seo-card {
  background: var(--panel);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--panel-border);
  transition: background-color var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.seo-card h2 {
  font-size: 18px;
  margin-bottom: 10px;
}

.seo-card p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 10px;
}

.seo-card ul {
  list-style: disc;
  padding-left: 18px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

.footer .system::before {
  content: "•";
  color: var(--footer-dot);
  margin-right: 6px;
}

.hidden {
  display: none;
}

@media (max-width: 980px) {
  .stage {
    grid-template-columns: 1fr;
  }

  .control-bar {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .filter {
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .footer {
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
  }
}
