@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(/fonts/inter-latin-ext.woff2) format("woff2");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
    U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(/fonts/inter-latin.woff2) format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
    U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/instrument-serif-latin-ext.woff2) format("woff2");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
    U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/instrument-serif-latin.woff2) format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
    U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/instrument-serif-italic-latin-ext.woff2) format("woff2");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
    U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/instrument-serif-italic-latin.woff2) format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
    U+2215, U+FEFF, U+FFFD;
}
:root {
  --bg: #151516;
  --bg-grad: radial-gradient(
    125% 120% at 50% -8%,
    #26262a 0%,
    #141416 58%,
    #0e0e10 100%
  );
  --panel: #1a1a1c;
  --card: #232326;
  --card2: rgba(99, 124, 255, 0.06);
  --hover: rgba(99, 124, 255, 0.13);
  --line: rgba(255, 255, 255, 0.07);
  --line2: rgba(255, 255, 255, 0.13);
  --track: #35353d;
  --fg: #f4f4f7;
  --muted: #9a9aa4;
  --muted2: #6a6a74;
  --accent: #3346ff;
  --accent-2: #5f6dff;
  --cyan: #79c9ff;
  --accent-soft: rgba(51, 70, 255, 0.15);
  --accent-ring: rgba(51, 70, 255, 0.3);
  --on-accent: #ffffff;
  --grad: linear-gradient(103deg, #2b3cf5 0%, #4d7bff 46%, #79c9ff 100%);
  --grad-soft: linear-gradient(103deg, #3346ff, #79c9ff);
  --serif: "Instrument Serif", "Times New Roman", Georgia, serif;
  --sans:
    "Inter", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --radius: 15px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 8px 26px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 26px 64px rgba(0, 0, 0, 0.62);
  --glow: 0 8px 30px rgba(51, 70, 255, 0.35);
  --ease: cubic-bezier(0.22, 0.68, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.4, 0.5, 1);
  --fast: 0.14s;
  --med: 0.26s;
}
* {
  box-sizing: border-box;
}
html,
body,
#root {
  height: 100%;
  margin: 0;
  overflow-x: hidden;
}
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 13px;
  letter-spacing: -0.01em;
}
button,
input,
textarea,
select {
  font-family: inherit;
  letter-spacing: inherit;
}
::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}
::-webkit-scrollbar-thumb {
  background: #2a2a30;
  border-radius: 8px;
  border: 3px solid var(--panel);
}
::-webkit-scrollbar-thumb:hover {
  background: #3a3a44;
}
::-webkit-scrollbar-track {
  background: transparent;
}
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}
.topbar {
  position: relative;
  height: 58px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 22px;
  background: linear-gradient(180deg, #1e1e2299, #101012e6), var(--panel);
  border-bottom: 1px solid var(--line);
}
.topbar:after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1.5px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    #2b3cf5 20%,
    #4d7bff 40%,
    #79c9ff 60%,
    transparent 88%
  );
  background-size: 220% 100%;
  opacity: 0.85;
  animation: stripeShift 7s linear infinite;
}
.logo {
  display: flex;
  align-items: center;
  gap: 11px;
}
.logo .mark {
  color: var(--cyan);
  flex: none;
  filter: drop-shadow(0 0 10px rgba(77, 123, 255, 0.55));
}
.wordmark {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 25px;
  line-height: 1;
  color: #fff;
  letter-spacing: 0.01em;
}
.wordmark span {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tagline {
  font-size: 12.5px;
  color: var(--muted);
  position: relative;
  padding-left: 17px;
}
.tagline:before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 18px;
  background: var(--line2);
}
.spacer {
  flex: 1;
}
.kbd-hint {
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.kbd-hint b {
  display: inline-block;
  color: #e6e6ea;
  background: #232329;
  border: 1px solid var(--line2);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1.5px 6px;
  font-weight: 600;
  font-size: 10px;
  margin: 0 1px;
}
.main {
  flex: 1;
  display: flex;
  min-height: 0;
}
.viewport {
  position: relative;
  flex: 1;
  min-width: 0;
  background: var(--bg-grad);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.viewport:before {
  content: "";
  position: absolute;
  top: -10%;
  right: 0;
  width: 55%;
  height: 70%;
  background: radial-gradient(
    circle at 70% 30%,
    rgba(51, 70, 255, 0.16),
    transparent 62%
  );
  pointer-events: none;
  filter: blur(10px);
}
.stage {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  max-width: 100%;
  max-height: 100%;
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    var(--shadow-lg),
    0 0 0 1px #ffffff12;
  animation: stageIn 0.7s var(--ease) both;
}
.stage canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}
.scene-loading {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0 0 26px;
  pointer-events: none;
}
.scene-loading-bar {
  width: 180px;
  height: 2px;
  border-radius: 2px;
  overflow: hidden;
  background: var(--track);
}
.scene-loading-bar span {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width 0.25s var(--ease);
}
.scene-loading-label {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.scene-error {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 24px;
  background: var(--bg);
}
.scene-error-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
}
.scene-error-hint {
  font-size: 13px;
  color: var(--muted);
  max-width: 320px;
}
.film-frame {
  position: absolute;
  top: 16px;
  right: 16px;
  bottom: 16px;
  left: 16px;
  pointer-events: none;
  z-index: 4;
}
.film-frame span {
  position: absolute;
  width: 17px;
  height: 17px;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
}
.film-frame span:nth-child(1) {
  top: 0;
  left: 0;
  border-right: 0;
  border-bottom: 0;
  border-top-left-radius: 4px;
}
.film-frame span:nth-child(2) {
  top: 0;
  right: 0;
  border-left: 0;
  border-bottom: 0;
  border-top-right-radius: 4px;
}
.film-frame span:nth-child(3) {
  bottom: 0;
  right: 0;
  border-left: 0;
  border-top: 0;
  border-bottom-right-radius: 4px;
}
.film-frame span:nth-child(4) {
  bottom: 0;
  left: 0;
  border-right: 0;
  border-top: 0;
  border-bottom-left-radius: 4px;
}
.hud,
.caption,
.toggle,
.viewmode {
  background: #0e0e108c;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
}
.hud {
  position: absolute;
  left: 16px;
  top: 15px;
  z-index: 6;
  font-size: 11.5px;
  color: #eeeef2;
  padding: 6px 12px;
  border-radius: 9px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 7px;
  animation: rise var(--med) var(--ease) both;
}
.caption {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translate(-50%);
  z-index: 6;
  color: #fff;
  padding: 7px 16px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  animation: riseCenter var(--med) var(--ease) both;
}
.viewmode {
  position: absolute;
  left: 50%;
  top: 14px;
  transform: translate(-50%);
  z-index: 6;
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 11px;
  animation: riseCenter var(--med) var(--ease) both;
}
.viewmode button {
  background: none;
  border: none;
  color: #dcdce2;
  cursor: pointer;
  padding: 6px 13px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 600;
  transition: all 0.16s var(--ease);
}
.viewmode button:hover {
  color: #fff;
}
.viewmode button.active {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 3px 12px #3346ff66;
}
.puck-label {
  transform: translateY(-30px);
  background: #0e0d10d9;
  border: 1px solid var(--line2);
  color: #fff;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  -webkit-user-select: none;
  user-select: none;
  font-family: var(--sans);
  box-shadow: 0 2px 8px #0006;
}
.pose-fab {
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  background: var(--grad);
  border: none;
  padding: 8px 16px;
  border-radius: 22px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow:
    var(--glow),
    0 4px 14px #0006;
  transition:
    transform 0.14s var(--spring),
    box-shadow 0.15s ease;
  animation: fabPop 0.28s var(--spring) both;
}
.pose-fab:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 10px 30px #3346ff80;
}
.pose-fab:active {
  transform: scale(0.96);
}
.pose-bar {
  display: flex;
  gap: 8px;
}
.pose-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pose-btns .btn.full {
  margin-top: 0;
}
.pose-studio {
  position: absolute;
  top: 14px;
  right: 14px;
  bottom: 14px;
  width: 344px;
  z-index: 12;
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 16px;
  background: #16161adb;
  border: 1px solid var(--line2);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  font-family: var(--sans);
  animation: studioIn 0.34s var(--spring) both;
}
.pose-studio.closing {
  animation: studioOut 0.2s var(--ease) both;
}
.pose-studio:before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  border-radius: 18px 18px 0 0;
  background: linear-gradient(90deg, #2b3cf5, #4d7bff 50%, #79c9ff);
  background-size: 200% 100%;
  animation: stripeShift 6s linear infinite;
  opacity: 0.9;
}
.studio-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.studio-head span {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 20px;
  letter-spacing: 0.01em;
  color: var(--fg);
}
.studio-head .x {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 17px;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 8px;
  transition:
    color var(--fast),
    background var(--fast);
}
.studio-head .x:hover {
  color: var(--fg);
  background: var(--card2);
}
.studio-hint {
  font-size: 11.5px;
  color: var(--muted);
  margin: -2px 0 0;
  line-height: 1.45;
}
.studio-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.studio-actions .btn.full {
  margin-top: 0;
}
.pose-grid {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-content: start;
  grid-auto-rows: min-content;
  padding-right: 3px;
  margin: 2px -3px 0 0;
}
.pose-tile {
  position: relative;
  display: block;
  padding: 0;
  cursor: pointer;
  aspect-ratio: 1 / 1;
  background: var(--card2);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  transition:
    border-color 0.16s ease,
    transform 0.16s var(--spring),
    box-shadow 0.16s ease;
  animation: tileIn 0.4s var(--ease) both;
}
.pose-tile:hover {
  border-color: #ffffff3d;
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.pose-tile.active {
  border-color: var(--accent);
  box-shadow:
    0 0 0 1.5px var(--accent),
    0 6px 20px #3346ff4d;
}
.pose-tile img,
.pose-tile .tile-blank {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #101014;
}
.pose-tile span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(transparent, #06060aeb);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  padding: 18px 6px 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}
.pose-tile.active span {
  color: var(--cyan);
}
.pose-tile .del {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #08080cd1;
  color: #fff;
  font-size: 10px;
  font-style: normal;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition:
    opacity 0.14s,
    background 0.14s;
}
.pose-tile:hover .del {
  opacity: 1;
}
.pose-tile .del:hover {
  background: #e5484d;
}
.pose-tile.add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: transparent;
  border-style: dashed;
  border-color: var(--line2);
  color: var(--muted);
}
.pose-tile.add:hover {
  border-color: var(--accent);
  color: var(--cyan);
  background: var(--accent-soft);
}
.pose-tile.add span {
  position: static;
  background: none;
  padding: 0;
  color: inherit;
  text-shadow: none;
}
.pose-tile.add .add-plus {
  font-size: 30px;
  font-weight: 300;
  line-height: 1;
}
.pose-tile.add .add-text {
  font-size: 11px;
  font-weight: 700;
}
.vp-toggles {
  position: absolute;
  right: 15px;
  top: 15px;
  z-index: 6;
  display: flex;
  gap: 7px;
}
.toggle {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  cursor: pointer;
  color: #dcdce2;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    transform var(--fast) var(--ease),
    color var(--fast),
    background var(--fast),
    border-color var(--fast);
}
.toggle:hover {
  color: #fff;
  border-color: var(--line2);
  transform: translateY(-1px);
}
.toggle:active {
  transform: scale(0.92);
}
.toggle.on {
  color: #fff;
  border-color: #4d7bff99;
  background: var(--accent-soft);
}
.thirds {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
  z-index: 5;
  animation: fade var(--fast) ease;
}
.thirds:before,
.thirds:after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}
.thirds:before {
  background-image:
    linear-gradient(
      to right,
      transparent calc(33.33% - 1px),
      rgba(255, 255, 255, 0.18) 33.33%,
      transparent calc(33.33% + 1px)
    ),
    linear-gradient(
      to right,
      transparent calc(66.66% - 1px),
      rgba(255, 255, 255, 0.18) 66.66%,
      transparent calc(66.66% + 1px)
    );
}
.thirds:after {
  background-image:
    linear-gradient(
      to bottom,
      transparent calc(33.33% - 1px),
      rgba(255, 255, 255, 0.18) 33.33%,
      transparent calc(33.33% + 1px)
    ),
    linear-gradient(
      to bottom,
      transparent calc(66.66% - 1px),
      rgba(255, 255, 255, 0.18) 66.66%,
      transparent calc(66.66% + 1px)
    );
}
.panel {
  width: 380px;
  flex: none;
  background: var(--panel);
  border-left: 1px solid var(--line);
  overflow-y: auto;
  padding: 18px 16px 34px;
}
.card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #141417, #0b0b0d);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 17px 18px 19px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  transition: border-color var(--med) var(--ease);
  animation: cardIn 0.5s var(--ease) both;
}
.card:hover {
  border-color: #ffffff1f;
}
.card:after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2.5px;
  background: linear-gradient(90deg, #1a2acc, #3b6bff, #79c9ff 92%);
  opacity: 0.95;
}
.panel .card:nth-child(1) {
  animation-delay: 0.02s;
}
.panel .card:nth-child(2) {
  animation-delay: 0.07s;
}
.panel .card:nth-child(3) {
  animation-delay: 0.12s;
}
.panel .card:nth-child(4) {
  animation-delay: 0.17s;
}
.panel .card:nth-child(5) {
  animation-delay: 0.22s;
}
.card h3 {
  margin: 0 0 13px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card h3:before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--grad-soft);
  box-shadow: 0 0 8px #4d7bffb3;
}
.presets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.presets button {
  background: var(--card2);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: #cdcdd6;
  padding: 10px 8px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition:
    transform var(--fast) var(--ease),
    background var(--fast),
    border-color var(--fast),
    color var(--fast),
    box-shadow var(--fast);
}
.presets button:hover {
  background: var(--hover);
  border-color: #4d7bff73;
  color: #fff;
  transform: translateY(-1px);
}
.presets button:active {
  transform: scale(0.97);
}
.presets button.active {
  border-color: #4d7bffbf;
  color: #fff;
  font-weight: 600;
  background: linear-gradient(180deg, #4d7bff42, #3346ff1f);
  box-shadow:
    0 0 0 1px #4d7bff40,
    0 5px 16px #3346ff33;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 13px 0;
  font-size: 12px;
  color: var(--muted);
}
.row > span:first-child {
  width: 82px;
  flex: none;
}
.row .val {
  width: 46px;
  text-align: right;
  color: #eeeef2;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
input[type="range"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: var(--track);
  cursor: pointer;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--accent);
  box-shadow: 0 1px 3px #00000080;
  transition:
    transform var(--fast),
    box-shadow var(--fast);
}
input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.14);
}
input[type="range"]:active::-webkit-slider-thumb {
  transform: scale(1.22);
  box-shadow: 0 0 0 6px var(--accent-ring);
}
input[type="range"]::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--accent);
  box-shadow: 0 1px 3px #00000080;
  cursor: pointer;
}
.check {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  transition: color var(--fast);
}
.check input {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
  cursor: pointer;
}
.check:hover {
  color: #ccccd4;
}
.field {
  margin: 11px 0;
}
.field label {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 6px;
}
.field input[type="text"],
.field textarea {
  width: 100%;
  background: var(--card2);
  border: 1px solid var(--line);
  color: var(--fg);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12.5px;
  transition:
    border-color var(--fast),
    box-shadow var(--fast);
}
.field input[type="text"]::placeholder {
  color: var(--muted2);
}
.field input[type="text"]:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.field textarea {
  min-height: 114px;
  line-height: 1.55;
  resize: vertical;
  animation: rise var(--med) var(--ease);
}
.field select {
  width: 100%;
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 32px 10px 12px;
  font-size: 12.5px;
  cursor: pointer;
  -moz-appearance: none;
  appearance: none;
  -webkit-appearance: none;
  background: var(--card2)
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239a9aa4' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>")
    no-repeat right 11px center;
  transition:
    border-color var(--fast),
    box-shadow var(--fast);
}
.field select:hover {
  border-color: var(--line2);
}
.field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.field select option {
  background: #212127;
  color: var(--fg);
}
.segmented {
  position: relative;
  display: flex;
  background: #101012;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 4px;
  margin-bottom: 6px;
}
.segmented:before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  background: var(--grad);
  border-radius: 8px;
  box-shadow: 0 3px 12px #3346ff59;
  transition: transform var(--med) var(--spring);
  z-index: 0;
}
.segmented[data-active="video"]:before {
  transform: translate(100%);
}
.segmented button {
  position: relative;
  z-index: 1;
  flex: 1;
  background: none;
  border: none;
  cursor: pointer;
  padding: 9px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  transition: color var(--fast);
}
.segmented button:hover {
  color: #ccccd4;
}
.segmented button.active {
  color: #fff;
}
.sheet-checks {
  margin-bottom: 4px;
}
.sheet-checks .check {
  margin-top: 9px;
}
.actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 4px;
}
.btn {
  position: relative;
  overflow: hidden;
  padding: 11px 14px;
  border-radius: 11px;
  border: 1px solid var(--line2);
  background: var(--card2);
  color: var(--fg);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow);
  transition:
    transform var(--fast) var(--ease),
    background var(--fast),
    border-color var(--fast),
    box-shadow var(--fast);
}
.btn:hover {
  background: var(--hover);
  border-color: #4d7bff73;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn:active {
  transform: translateY(0) scale(0.985);
  box-shadow: var(--shadow);
}
.btn.ghost {
  background: none;
  border-color: var(--line);
  margin-top: 12px;
  width: 100%;
  font-weight: 500;
  font-size: 12px;
  padding: 10px;
  box-shadow: none;
  color: var(--muted);
}
.btn.ghost:hover {
  color: var(--fg);
  background: var(--card2);
}
.btn.full {
  width: 100%;
  margin-top: 6px;
}
.btn.generate,
.btn.cta {
  margin-top: 10px;
  padding: 14px;
  font-size: 14px;
}
.btn.primary {
  background: var(--grad);
  background-size: 160% 100%;
  background-position: 0% 50%;
  border: none;
  color: var(--on-accent);
  box-shadow:
    var(--glow),
    inset 0 1px #fff3;
  transition:
    transform var(--fast) var(--ease),
    background-position var(--med) var(--ease),
    box-shadow var(--fast);
}
.btn.primary:hover {
  background-position: 100% 50%;
  box-shadow: 0 12px 34px #3346ff80;
  transform: translateY(-1px);
}
.btn.primary:after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 45%;
  height: 100%;
  background: linear-gradient(
    100deg,
    transparent,
    rgba(255, 255, 255, 0.28),
    transparent
  );
  transform: skew(-18deg);
  transition: left 0.5s var(--ease);
}
.btn.primary:hover:after {
  left: 130%;
}
.hint {
  font-size: 11.5px;
  color: var(--muted);
  margin: 12px 0 0;
  line-height: 1.6;
}
.hint b {
  color: #dcdce2;
  font-weight: 600;
}
.subjects-row {
  display: flex;
  gap: 11px;
}
.subject-box {
  flex: 1;
  min-width: 0;
  position: relative;
  background: var(--card2);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 13px;
  padding: 12px 13px 13px;
}
.subject-box.new {
  animation: subjectIn 0.42s var(--spring) both;
  transform-origin: right center;
}
@keyframes subjectIn {
  0% {
    opacity: 0;
    transform: translate(18px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translate(0) scale(1);
  }
}
.subject-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
}
.sb-name {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sb-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: none;
}
.cam-toggle {
  width: 30px;
  height: 25px;
  border-radius: 8px;
  border: 1px solid var(--line2);
  background: #ffffff05;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    transform var(--fast) var(--ease),
    background var(--fast),
    border-color var(--fast),
    color var(--fast),
    box-shadow var(--fast);
}
.cam-toggle svg {
  width: 14px;
  height: 14px;
}
.cam-toggle:hover {
  color: var(--fg);
  border-color: #4d7bff80;
}
.cam-toggle:active {
  transform: scale(0.92);
}
.cam-toggle.active {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 3px 12px #3346ff80;
}
.sb-remove {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: none;
  background: none;
  color: var(--muted2);
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    color var(--fast),
    background var(--fast);
}
.sb-remove:hover {
  color: #fff;
  background: #e5484d;
}
.cslider {
  margin-top: 11px;
}
.cslider-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
  white-space: nowrap;
}
.cslider-head > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
}
.cslider-head .val {
  color: #eeeef2;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  flex: none;
}
.cslider input[type="range"] {
  width: 100%;
  display: block;
}
.add-subject {
  width: 100%;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  border: 1.5px dashed var(--line2);
  border-radius: 12px;
  padding: 12px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition:
    border-color var(--fast),
    color var(--fast),
    background var(--fast);
}
.add-subject:hover {
  border-color: var(--accent);
  color: var(--cyan);
  background: var(--accent-soft);
}
.add-subject .as-plus {
  font-size: 17px;
  font-weight: 300;
  line-height: 1;
}
.dropdown {
  position: relative;
}
.dropdown-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--card2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--fg);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12.5px;
  cursor: pointer;
  text-align: left;
  transition:
    border-color var(--fast),
    background var(--fast),
    box-shadow var(--fast);
}
.dropdown-trigger span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dropdown-trigger:hover {
  border-color: #4d7bff73;
}
.dropdown.open .dropdown-trigger {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.dd-caret {
  width: 14px;
  height: 14px;
  flex: none;
  color: var(--muted);
  transition: transform var(--med) var(--ease);
}
.dropdown.open .dd-caret {
  transform: rotate(180deg);
}
.dropdown-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 7px);
  z-index: 25;
  background: #16161b;
  border: 1px solid var(--line2);
  border-radius: 13px;
  padding: 6px;
  box-shadow: var(--shadow-lg);
  max-height: 288px;
  overflow-y: auto;
  animation: ddIn 0.16s var(--ease) both;
}
.dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: none;
  border: none;
  color: #d6d6de;
  padding: 9px 11px;
  border-radius: 8px;
  font-size: 12.5px;
  cursor: pointer;
  text-align: left;
  transition:
    background var(--fast),
    color var(--fast);
}
.dropdown-item span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dropdown-item:hover {
  background: var(--hover);
  color: #fff;
}
.dropdown-item.active {
  color: var(--cyan);
  font-weight: 600;
}
.dd-check {
  width: 14px;
  height: 14px;
  flex: none;
}
.modal-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  background: #050508b8;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fade 0.2s ease;
}
.modal {
  position: relative;
  width: 480px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--line2);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  animation: pop var(--med) var(--spring);
}
.modal:before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  border-radius: 20px 20px 0 0;
  background: linear-gradient(90deg, #2b3cf5, #4d7bff 50%, #79c9ff);
  background-size: 200% 100%;
  animation: stripeShift 6s linear infinite;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.modal-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 24px;
  letter-spacing: 0.01em;
}
.modal .x {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  line-height: 1;
  transition:
    color var(--fast),
    background var(--fast);
}
.modal .x:hover {
  color: #fff;
  background: var(--card2);
}
.preview {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  display: block;
}
.modal-label {
  display: block;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--muted);
  margin: 16px 0 7px;
}
.modal-label em {
  color: var(--cyan);
  font-style: normal;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}
.promptbox {
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 14px;
  font-size: 12px;
  line-height: 1.6;
  color: #dcdce2;
}
.modal-actions {
  display: flex;
  gap: 9px;
  margin-top: 16px;
}
.modal-actions .btn {
  flex: 1;
}
.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translate(-50%);
  background: #202027;
  border: 1px solid var(--line2);
  color: var(--fg);
  padding: 11px 18px;
  border-radius: 11px;
  z-index: 40;
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.28s var(--spring);
}
@media (max-width: 1040px) {
  .app {
    height: auto;
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
  }
  html,
  body,
  #root {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
  }
  .main {
    flex-direction: column;
    width: 100%;
    max-width: 100%;
  }
  .viewport {
    flex: none;
    height: 54vh;
    min-width: 0;
    max-width: 100%;
    padding: 14px;
  }
  .panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    border-left: none;
    border-top: 1px solid var(--line);
    overflow: visible;
    padding: 16px 16px 40px;
  }
  .stage {
    width: 100%;
    height: 100%;
    max-width: 100%;
    aspect-ratio: auto;
    max-height: none;
  }
  .tagline {
    display: none;
  }
  .pose-studio {
    top: 15%;
    right: 8px;
    left: 8px;
    bottom: 8px;
    width: auto;
    height: auto;
  }
  .pose-grid {
    grid-template-columns: 1fr 1fr 1fr;
    grid-auto-rows: min-content;
  }
}
@media (max-width: 680px) {
  body {
    font-size: 12.5px;
  }
  .topbar {
    padding: 0 14px;
    gap: 10px;
    height: 54px;
  }
  .kbd-hint {
    display: none;
  }
  .wordmark {
    font-size: 22px;
  }
  .viewport {
    min-height: 46vh;
    padding: 10px;
  }
  .stage {
    border-radius: 13px;
  }
  .pose-grid {
    grid-template-columns: 1fr 1fr;
  }
  .hud,
  .caption {
    font-size: 10.5px;
  }
  .caption {
    letter-spacing: 0.08em;
    padding: 6px 11px;
  }
}
@keyframes fade {
  0% {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes rise {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes riseCenter {
  0% {
    opacity: 0;
    transform: translate(-50%, 6px);
  }
  to {
    opacity: 1;
    transform: translate(-50%);
  }
}
@keyframes pop {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes toastIn {
  0% {
    opacity: 0;
    transform: translate(-50%, 14px);
  }
  to {
    opacity: 1;
    transform: translate(-50%);
  }
}
@keyframes cardIn {
  0% {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes stageIn {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes studioIn {
  0% {
    opacity: 0;
    transform: translate(26px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate(0) scale(1);
  }
}
@keyframes studioOut {
  0% {
    opacity: 1;
    transform: translate(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translate(26px) scale(0.96);
  }
}
@keyframes tileIn {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes fabPop {
  0% {
    opacity: 0;
    transform: translateY(6px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes stripeShift {
  0% {
    background-position: 0% 50%;
  }
  to {
    background-position: 200% 50%;
  }
}
@keyframes ddIn {
  0% {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
