:root { color-scheme: light; --bg: #f7f5f0; --card: #fff; --text: #202b2a; --muted: #65746e; --accent: #266d59; --soft: #d8e8df; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--tg-theme-bg-color, var(--bg)); color: var(--tg-theme-text-color, var(--text)); font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
main { width: min(100%, 560px); margin: auto; padding: max(18px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom)); }
header { padding: 0 0 6px; }
h1 { font-size: clamp(26px, 7vw, 34px); line-height: 1.15; letter-spacing: -.04em; margin: 6px 0 8px; }
header p, .hint, footer { color: var(--tg-theme-hint-color, var(--muted)); }
header p { margin: 0; }
#status { border-radius: 14px; background: var(--soft); color: #204737; padding: 12px 16px; font-size: 14px; }
#status.error { background: #ffe4df; color: #8d241a; }
.selection { padding: 22px; margin: 18px 0 26px; background: var(--tg-theme-secondary-bg-color, var(--card)); border: 1px solid #b8c8bf55; border-radius: 20px; }
.selection span { display: block; color: var(--tg-theme-hint-color, var(--muted)); font-size: 11px; letter-spacing: .15em; }
.selection strong { display: block; font-size: 30px; letter-spacing: -.04em; font-variant-numeric: tabular-nums; margin: 5px 0; }
.selection small { color: var(--tg-theme-hint-color, var(--muted)); }
.timeline { position: relative; height: 42px; background: repeating-linear-gradient(90deg, #9fbbb055 0 3px, transparent 3px 7px); border-radius: 8px; overflow: hidden; }
#selected-bar { position: absolute; top: 0; bottom: 0; background: #266d5999; border-inline: 3px solid var(--accent); }
#playhead { position: absolute; top: 0; bottom: 0; width: 2px; background: #efb343; }
.ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--tg-theme-hint-color, var(--muted)); margin: 5px 0 22px; }
label { display: flex; justify-content: space-between; align-items: center; font-size: 14px; margin-top: 14px; font-weight: 600; }
output { font-variant-numeric: tabular-nums; color: var(--accent); }
input[type=range] { width: 100%; height: 38px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.hint { font-size: 12px; line-height: 1.6; }
button { min-height: 48px; padding: 12px 15px; border: 1px solid #b8c8bf99; border-radius: 13px; background: var(--tg-theme-secondary-bg-color, var(--card)); color: inherit; font: inherit; font-weight: 600; cursor: pointer; }
button:disabled { opacity: .45; cursor: wait; }
button:focus-visible, input:focus-visible { outline: 3px solid #e5b956; outline-offset: 3px; }
.transport { display: flex; gap: 10px; margin-top: 22px; }
#play { flex: 1; }
.loop { justify-content: flex-start; gap: 10px; font-weight: 400; margin: 10px 0 20px; }
.loop input { width: 18px; height: 18px; accent-color: var(--accent); }
.primary { width: 100%; border: none; background: var(--accent); color: white; margin-top: 12px; }
#close { width: 100%; margin-top: 12px; }
footer { margin-top: 28px; text-align: center; font-size: 11px; }
.steps { display: flex; list-style: none; padding: 0; gap: 12px; margin: 22px 0; font-size: 13px; }
.steps li { display: flex; align-items: center; gap: 8px; flex: 1; color: var(--tg-theme-hint-color, var(--muted)); border-bottom: 2px solid #b8c8bf55; padding-bottom: 12px; }
.steps b { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; background: #9fbbb033; font-size: 12px; }
.steps li[aria-current=step] { color: var(--accent); border-color: var(--accent); font-weight: 700; }
.steps li[aria-current=step] b { background: var(--accent); color: var(--bg); }
.style-carousel { position: relative; }
.style-track { border: 0; padding: 0 0 8px; margin: 0; display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 24px) / 2.5); gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; min-width: 0; max-width: 100%; }
.style-track::-webkit-scrollbar { display: none; }
.style-card { position: relative; display: flex; flex-direction: column; gap: 9px; margin: 0; padding: 10px; border-radius: 18px; border: 2px solid #b8c8bf55; cursor: pointer; background: var(--tg-theme-secondary-bg-color, var(--card)); scroll-snap-align: start; min-width: 0; }
.style-card:has(input:checked) { border-color: var(--accent); box-shadow: 0 4px 20px #266d5910; }
.style-card:has(input:focus-visible) { outline: 3px solid #e5b956; outline-offset: 3px; }
.style-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.style-card:has(input:disabled) { cursor: default; }
.style-copy { display: grid; gap: 4px; font-weight: 400; min-height: 92px; }
.style-copy strong { font-size: 15px; line-height: 1.25; }
.style-copy span { font-size: 11px; }
.style-copy small { color: var(--tg-theme-hint-color, var(--muted)); font-size: 10px; line-height: 1.55; }
.style-copy em { display: inline-block; font-style: normal; font-size: 8px; border-radius: 5px; padding: 2px 4px; background: var(--soft); color: #204737; vertical-align: middle; }
.choice-mark { position: absolute; top: 16px; right: 16px; width: 18px; height: 18px; border: 1px solid #9fbbb0; border-radius: 50%; background: #ffffffb0; }
input:checked ~ .choice-mark { border: 5px solid var(--accent); }
.style-art { position: relative; width: 100%; height: 118px; border-radius: 11px; overflow: hidden; background: #b5d0b8; }
.style-nav { position: absolute; top: 40px; z-index: 1; width: 34px; height: 34px; min-height: 34px; padding: 0; border-radius: 50%; border: 1px solid #b8c8bf55; font-size: 20px; line-height: 1; background: var(--tg-theme-secondary-bg-color, var(--card)); box-shadow: 0 2px 12px #0002; }
#style-prev { left: -8px; }
#style-next { right: -8px; }
.scene { display: block; position: absolute; inset: 0; background: radial-gradient(circle at 65% 28%, #f8daa1 0 14%, transparent 15%), linear-gradient(145deg, transparent 53%, #5e8d76 54% 72%, transparent 73%), linear-gradient(35deg, #31695a 30%, transparent 31%), linear-gradient(#d5b8a3, #f2e2cf); }
.scene.second { background: radial-gradient(circle at 34% 32%, #f6deaf 0 14%, transparent 15%), linear-gradient(35deg, #437f83 40%, transparent 41%), linear-gradient(145deg, transparent 50%, #7aa791 51% 75%, transparent 76%), linear-gradient(#a3c3c0, #e7d8be); }
.art-gentle .scene { animation: gentle-zoom 8s ease-in-out infinite alternate; }
.art-gentle .second { animation: gentle-fade 8s ease-in-out infinite alternate; }
.art-beat .scene { animation: gentle-zoom 3s ease-in-out infinite alternate; }
.art-beat .second { animation: beat-cut 5s steps(1) infinite; }
.art-dynamic .second { animation: dynamic-slide 3s ease-in-out infinite; }
.art-cinema .scene { animation: cinema-pan 10s ease-in-out infinite alternate; filter: saturate(.72) contrast(1.06) brightness(.9); }
.art-cinema .second { animation: gentle-fade 10s ease-in-out infinite alternate; filter: saturate(.72) brightness(.88); }
.art-travel .scene { animation: cinema-pan 6s ease-in-out infinite alternate; filter: hue-rotate(18deg); }
.art-travel .second { animation: dynamic-slide 4s ease-in-out infinite; filter: hue-rotate(18deg); }
.art-editorial .scene { animation: beat-cut 2.4s steps(1) infinite; filter: hue-rotate(45deg) contrast(1.12) saturate(.85); }
.art-editorial .second { animation: editorial-cut 2.4s steps(1) infinite; filter: hue-rotate(45deg) contrast(1.12); }
.art-retro .scene { animation: gentle-zoom 9s ease-in-out infinite alternate; filter: sepia(.42) contrast(.95); }
.art-retro .second { animation: gentle-fade 9s ease-in-out infinite alternate; filter: sepia(.45); }
.art-minimal .scene { animation: none; filter: grayscale(.25); }
.art-minimal .second { animation: minimal-cut 7s steps(1) infinite; filter: grayscale(.25); }
.art-airy .scene { animation: gentle-zoom 9s ease-in-out infinite alternate-reverse; filter: brightness(1.12) saturate(.75); }
.art-airy .second { animation: gentle-fade 9s ease-in-out infinite alternate-reverse; filter: brightness(1.14) saturate(.7); }
@keyframes gentle-zoom { from { transform: scale(1); } to { transform: scale(1.08); } }
@keyframes gentle-fade { 0%, 25% { opacity: 0; transform: scale(1.04); } 75%, 100% { opacity: 1; transform: scale(1); } }
@keyframes beat-cut { 0%, 49% { opacity: 0; } 50%, 100% { opacity: 1; } }
@keyframes dynamic-slide { 0%, 30% { transform: translateX(100%); } 45%, 80% { transform: translateX(0); } 95%, 100% { transform: translateX(-100%); } }
@keyframes cinema-pan { from { transform: scale(1.12) translateX(-5%); } to { transform: scale(1.12) translateX(5%); } }
@keyframes editorial-cut { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes minimal-cut { 0%, 69% { opacity: 0; } 70%, 100% { opacity: 1; } }
.art-polaroid .scene { animation: polaroid-land 5s ease-in-out infinite; border: 5px solid #fdfaf3; border-bottom-width: 12px; box-shadow: 0 6px 12px #0003, inset 0 0 0 1px #0001; }
.art-polaroid .second { animation: polaroid-fade 5s ease-in-out infinite; border: 5px solid #fdfaf3; border-bottom-width: 12px; box-shadow: 0 6px 12px #0003; }
.art-polaroid { background: #e9dbc4; }
.art-collage .scene { animation: collage-sweep 4.5s ease-in-out infinite; }
.art-collage .second { animation: collage-reveal 4.5s ease-in-out infinite; }
.art-analog .scene { animation: analog-roll 4s ease-in-out infinite; filter: sepia(.18) saturate(.85) contrast(.95); }
.art-analog .second { animation: analog-leak 4s ease-in-out infinite; filter: sepia(.18) saturate(.85); }
.art-tear .scene { animation: tear-apart 4s ease-in-out infinite; clip-path: polygon(0 0, 46% 0, 52% 12%, 47% 25%, 53% 38%, 48% 52%, 54% 66%, 49% 80%, 52% 92%, 48% 100%, 0 100%); }
.art-tear .second { animation: tear-reveal 4s ease-in-out infinite; }
.art-cinematic .scene { animation: cinematic-whip 3.2s ease-in-out infinite; filter: saturate(.78) contrast(1.08) brightness(.92); }
.art-cinematic .second { animation: cinematic-whip-in 3.2s ease-in-out infinite; filter: saturate(.78) contrast(1.08) brightness(.92); }
.art-prism .scene { animation: prism-sweep 4.5s ease-in-out infinite; }
.art-prism .second { animation: prism-glass 4.5s ease-in-out infinite; }
@keyframes polaroid-land { 0%, 25% { opacity: 0; transform: translateX(60%) rotate(18deg) scale(1.15); } 55%, 100% { opacity: 1; transform: translateX(4%) rotate(-2deg) scale(1); } }
@keyframes polaroid-fade { 0%, 25% { opacity: 1; transform: translateX(-8%) rotate(-5deg) scale(.96); } 60%, 100% { opacity: .55; transform: translateX(-14%) rotate(-7deg) scale(.92); } }
@keyframes collage-sweep { 0%, 30% { clip-path: inset(0 0 0 100%); } 65%, 100% { clip-path: inset(0 0 0 0); } }
@keyframes collage-reveal { 0%, 40% { opacity: 1; } 70%, 100% { opacity: 0; } }
@keyframes analog-roll { 0%, 20% { transform: translateY(0); } 38%, 100% { transform: translateY(-100%); } }
@keyframes analog-leak { 0%, 20% { opacity: 0; transform: translateY(100%); } 38%, 100% { opacity: 1; transform: translateY(0); } }
@keyframes tear-apart { 0%, 30% { transform: translateX(0) rotate(0); } 70%, 100% { transform: translateX(-30%) rotate(-4deg); opacity: 0; } }
@keyframes tear-reveal { 0%, 30% { filter: brightness(.85); } 70%, 100% { filter: brightness(1); } }
@keyframes cinematic-whip { 0%, 35% { transform: translateX(0); } 55%, 100% { transform: translateX(-130%); filter: blur(0); } }
@keyframes cinematic-whip-in { 0%, 35% { transform: translateX(130%); } 55%, 100% { transform: translateX(0); } }
@keyframes prism-sweep { 0%, 30% { clip-path: inset(0 0 0 100%); } 65%, 100% { clip-path: inset(0 0 0 0); } }
@keyframes prism-glass { 0%, 40% { opacity: 1; filter: blur(0) saturate(1); } 55% { filter: blur(2px) saturate(1.3); } 75%, 100% { opacity: 0; filter: blur(0); } }
.art-rhythm { background: #260b29; }
.art-rhythm .scene { inset: 0 45% 0 0; border-radius: 0; animation: rhythm-divider 4s ease-in-out infinite; }
.art-rhythm .second { inset: 8% 6% 55% 52%; border-radius: 0; animation: rhythm-panel 4s ease-in-out infinite; filter: sepia(.4) saturate(1.4) hue-rotate(-15deg); }
@keyframes rhythm-divider { 0%, 30% { clip-path: inset(0 55% 0 0); } 65%, 100% { clip-path: inset(0 35% 0 0); } }
@keyframes rhythm-panel { 0%, 30% { transform: translateY(0); } 65%, 100% { transform: translateY(10%); } }
.review { border-radius: 16px; padding: 18px; border: 1px solid #b8c8bf55; margin-top: 20px; }
.review > span { display: block; font-size: 10px; letter-spacing: .14em; color: var(--tg-theme-hint-color, var(--muted)); }
.review strong { display: block; font-size: 20px; margin-top: 5px; }
.review p { margin: 4px 0; font-size: 13px; font-variant-numeric: tabular-nums; }
.review small { font-size: 11px; color: var(--tg-theme-hint-color, var(--muted)); }
.step-actions { display: grid; grid-template-columns: auto 1fr; gap: 10px; margin-top: 24px; }
.step-actions .primary { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 380px) { main { padding-inline: 16px; } .style-card { padding: 8px; gap: 7px; } .style-art { height: 78px; } .style-copy small { display: none; } .style-copy { min-height: 60px; } .step-actions { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .style-art .scene { animation: none; } .style-art .second { opacity: .4; } }
.tabs { display: flex; gap: 6px; padding: 6px; border-radius: 16px; background: #9fbbb022; margin: 20px 0 24px; position: sticky; top: 0; z-index: 2; backdrop-filter: blur(16px); }
.tabs button { flex: 1; border: 0; min-height: 42px; padding: 8px 4px; font-size: 12px; background: transparent; }
.tabs button[aria-pressed=true] { background: var(--accent); color: var(--bg); }
h2 { font-size: 22px; letter-spacing: -.03em; line-height: 1.25; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.section-heading span { font-size: 12px; color: var(--tg-theme-hint-color, var(--muted)); }
.file-button { display: block; padding: 14px; margin: 10px 0; border-radius: 12px; border: 1px dashed var(--accent); text-align: center; color: var(--accent); cursor: pointer; }
.file-input { width: 100%; font-size: 12px; }
.gallery { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-top: 18px; }
.photo-tile { position: relative; border-radius: 12px; background: #9fbbb033; overflow: hidden; aspect-ratio: 1; }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-tile button { position: absolute; right: 4px; bottom: 4px; padding: 7px 9px; min-height: 36px; font-size: 11px; background: #fff; color: #72332b; }
.photo-tile { cursor: grab; }
.photo-tile.drag { opacity: .45; transform: scale(1.06); z-index: 2; box-shadow: 0 8px 22px #0006; cursor: grabbing; }
.empty-state { padding: 28px 16px; border: 1px dashed #9fbbb077; border-radius: 16px; text-align: center; color: var(--tg-theme-hint-color, var(--muted)); font-size: 13px; }
select { width: 100%; min-height: 48px; padding: 10px; border-radius: 12px; border: 1px solid #9fbbb077; background: var(--tg-theme-secondary-bg-color, var(--card)); color: inherit; font: inherit; font-size: 14px; margin: 8px 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row .field label { margin-top: 10px; }
.field-row select { margin-top: 4px; font-size: 13px; padding: 8px; }
.studio-actions { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 18px; }
.studio-actions .primary { margin-top: 0; }
.project-actions { display: flex; gap: 8px; margin-top: 20px; }
.project-actions button { flex: 1; font-size: 12px; }
#job-status { font-size: 14px; }
.project-list { display: grid; gap: 10px; margin-top: 12px; }
.project-item { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 12px 14px; border: 1px solid #b8c8bf55; border-radius: 14px; background: var(--tg-theme-secondary-bg-color, var(--card)); }
.project-item.current { border-color: var(--accent); }
.project-title { font-size: 14px; font-weight: 600; }
.project-title em { display: inline-block; font-style: normal; font-size: 9px; border-radius: 5px; padding: 2px 5px; margin-left: 6px; background: var(--soft); color: #204737; vertical-align: middle; }
.project-meta { font-size: 11px; color: var(--tg-theme-hint-color, var(--muted)); margin-top: 3px; }
.project-actions { display: flex; gap: 6px; }
.project-actions button { min-height: 36px; padding: 6px 10px; font-size: 12px; }
#result-video { width: 100%; max-height: 440px; margin-top: 16px; border-radius: 12px; background: #111; }
#view-result, #cancel { width: 100%; margin-top: 8px; }
#download-result { display: block; margin-top: 12px; color: var(--accent); }
body.busy .file-button { opacity: .5; pointer-events: none; }
.modal-backdrop { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 24px; background: #081c16aa; backdrop-filter: blur(6px); }
.modal-card { width: min(100%, 380px); padding: 26px; border-radius: 22px; background: var(--tg-theme-bg-color, var(--bg)); box-shadow: 0 15px 70px #0005; }
.modal-card h2 { margin-top: 0; }
.modal-card p { font-size: 14px; }
.modal-card button { width: 100%; margin-top: 10px; }
[hidden] { display: none !important; }
@media (prefers-color-scheme: dark) { :root { color-scheme: dark; --bg: #172420; --card: #21362d; --text: #f0f3ed; --muted: #a5b8ad; --accent: #80bb9e; --soft: #c5e3d5; } .primary { color: #172420; } output { color: var(--tg-theme-link-color, var(--accent)); } }
