:root {
    color-scheme: dark;
    --page: #090909;
    --surface: #151515;
    --surface-2: #1c1c1c;
    --surface-3: #101010;
    --border: #343434;
    --text: #f7f7f7;
    --muted: #b5b5b5;
    --yellow: #ffbd00;
    --red: #ed2b31;
    --radius: 16px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--page); }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 10% -5%, rgba(255,189,0,.14), transparent 31rem),
        radial-gradient(circle at 100% 20%, rgba(217,39,46,.12), transparent 34rem),
        linear-gradient(180deg, #0b0b0b, #080808 60%, #050505);
}
button, input { font: inherit; }
a { color: inherit; }

.app-shell { width: min(1480px, 100%); margin: 0 auto; padding: 12px; }
.site-header {
    min-height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 11px;
    position: sticky;
    top: 8px;
    z-index: 20;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 14px;
    background: rgba(16,16,16,.88);
    backdrop-filter: blur(14px);
    box-shadow: 0 14px 40px rgba(0,0,0,.22);
}
.site-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; color: #111; background: var(--yellow); font-size: 20px; }
.brand-copy strong, .brand-copy small { display: block; }
.brand-copy strong { font-size: 14px; letter-spacing: .04em; }
.brand-copy small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.register-button { min-height: 38px; display: inline-flex; align-items: center; padding: 8px 13px; border-radius: 10px; text-decoration: none; color: #fff; background: var(--red); font-size: 12px; font-weight: 900; }

.intro-section { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 30px 8px 20px; }
.kicker { margin: 0 0 8px; color: var(--yellow); font-size: 11px; font-weight: 900; letter-spacing: .16em; }
.intro-section h1 { margin: 0; font-size: clamp(30px, 5vw, 58px); line-height: .96; letter-spacing: -.045em; }
.intro-copy { max-width: 720px; margin: 12px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.privacy-chip { max-width: 430px; padding: 9px 11px; border: 1px solid rgba(255,196,0,.28); border-radius: 10px; color: #eadb93; background: rgba(255,196,0,.06); font-size: 11px; line-height: 1.45; }

.editor-grid { display: grid; grid-template-columns: minmax(340px, 445px) minmax(0, 1fr); gap: 14px; align-items: start; }
.editor-card, .preview-card { border: 1px solid var(--border); border-radius: var(--radius); background: rgba(20,20,20,.96); box-shadow: 0 22px 65px rgba(0,0,0,.26); }
.editor-card { padding: 14px; position: sticky; top: 82px; }
.section-title { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; }
.section-title > span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; color: #111; background: var(--yellow); font-size: 13px; font-weight: 900; }
.section-title strong, .section-title small { display: block; }
.section-title strong { font-size: 13px; }
.section-title small { margin-top: 2px; color: var(--muted); font-size: 10px; }

.field-block { min-width: 0; }
.field-label { display: block; margin-bottom: 6px; color: #ececec; font-size: 11px; font-weight: 850; }
.field-block input[type="text"] { width: 100%; min-height: 41px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 9px; outline: none; color: #fff; background: #0d0d0d; }
.field-block input[type="text"]:focus { border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(255,196,0,.11); }
.upload-box { min-height: 88px; display: grid; grid-template-columns: 44px 1fr; align-items: center; gap: 10px; padding: 12px; border: 1px dashed #626262; border-radius: 11px; background: #0d0d0d; cursor: pointer; }
.upload-box:hover { border-color: var(--yellow); background: #111; }
.upload-icon { font-size: 29px; }
.upload-box strong, .upload-box small { display: block; }
.upload-box strong { font-size: 12px; }
.upload-box small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.file-status { min-height: 17px; margin-top: 5px; color: var(--yellow); font-size: 10px; overflow-wrap: anywhere; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 11px; }
.form-grid .full-width { grid-column: 1 / -1; }

.adjustment-panel { margin-top: 12px; padding: 11px; border: 1px solid var(--border); border-radius: 11px; background: #101010; }
.range-field + .range-field { margin-top: 10px; }
.range-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.range-header label { color: #e5e5e5; font-size: 10px; font-weight: 800; }
.range-header output { color: var(--yellow); font-size: 10px; font-weight: 900; }
input[type="range"] { width: 100%; accent-color: var(--yellow); }
.drag-tip { margin: 8px 0 0; color: #999; font-size: 9px; }

.format-selector { margin: 12px 0 0; padding: 9px; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; border: 1px solid var(--border); border-radius: 11px; }
.format-selector legend { padding: 0 5px; color: #e5e5e5; font-size: 10px; font-weight: 850; }
.format-selector label { cursor: pointer; }
.format-selector input { position: absolute; opacity: 0; pointer-events: none; }
.format-selector span { min-height: 55px; display: flex; flex-direction: column; justify-content: center; padding: 8px 9px; border: 1px solid var(--border); border-radius: 9px; background: #0d0d0d; }
.format-selector strong { font-size: 11px; }
.format-selector small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.format-selector input:checked + span { border-color: var(--yellow); color: var(--yellow); background: rgba(255,196,0,.06); }

.message-box { margin-top: 11px; padding: 9px 10px; border: 1px solid rgba(237,43,49,.45); border-radius: 9px; color: #ffd7d7; background: rgba(237,43,49,.10); font-size: 10px; line-height: 1.4; }
.secondary-actions, .primary-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.secondary-actions { margin-top: 12px; }
.primary-actions { margin-top: 8px; }
.button { min-height: 42px; border: 0; border-radius: 9px; padding: 9px 10px; cursor: pointer; font-size: 11px; font-weight: 900; }
.button:hover { filter: brightness(1.08); }
.button-muted { color: #eee; background: #343434; }
.button-yellow { color: #111; background: var(--yellow); }
.button-red { color: #fff; background: var(--red); }

.preview-card { min-width: 0; padding: 12px; }
.preview-header { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.preview-header strong, .preview-header small { display: block; }
.preview-header strong { font-size: 12px; }
.preview-header small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.live-badge { padding: 4px 7px; border-radius: 99px; color: #111; background: var(--yellow); font-size: 8px; font-weight: 900; letter-spacing: .12em; }
.canvas-stage { display: grid; place-items: center; min-height: 610px; padding: 12px; border-radius: 11px; overflow: hidden; background: linear-gradient(45deg,#171717 25%,transparent 25%),linear-gradient(-45deg,#171717 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#171717 75%),linear-gradient(-45deg,transparent 75%,#171717 75%),#111; background-size: 20px 20px; background-position: 0 0,0 10px,10px -10px,-10px 0; }
#posterCanvas { display: block; max-width: 100%; max-height: min(78vh, 940px); width: auto; height: auto; border-radius: 4px; background: #111; box-shadow: 0 26px 80px rgba(0,0,0,.58); touch-action: none; cursor: grab; }
#posterCanvas.dragging { cursor: grabbing; }
.preview-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 10px 5px 1px; color: #858585; font-size: 9px; text-align: center; }
.preview-powered { color: #ffffff; font-size: 12px; font-weight: 900; letter-spacing: .02em; }

@media (max-width: 940px) {
    .intro-section { align-items: flex-start; flex-direction: column; }
    .editor-grid { grid-template-columns: 1fr; }
    .editor-card { position: static; }
    .canvas-stage { min-height: auto; }
    #posterCanvas { max-height: none; }
}
@media (max-width: 560px) {
    .app-shell { padding: 7px; }
    .site-header { top: 4px; }
    .brand-copy strong { max-width: 175px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .register-button { padding-inline: 9px; }
    .intro-section { padding: 23px 5px 16px; }
    .form-grid, .format-selector { grid-template-columns: 1fr; }
    .form-grid .full-width { grid-column: auto; }
    .canvas-stage { padding: 5px; }
    .secondary-actions, .primary-actions { grid-template-columns: 1fr; }
}
