:root {
    --bg: #050509;
    --bg-accent: rgba(200,162,255,0.1);
    --card: #0c0c12;
    --text: #f3f3f7;
    --muted: #b3b3c2;
    --primary: #c8a2ff;
    --danger: #ff6b6b;
    --link: #c8a2ff;
    --border: rgba(255,255,255,0.06);
    --button-primary-bg: #c8a2ff;
    --button-primary-text: #0b0b11;
    --button-secondary-bg: rgba(255,255,255,0.1);
    --button-secondary-text: #f3f3f7;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: radial-gradient(circle at 20% 20%, var(--bg-accent), transparent 30%), var(--bg);
    color: var(--text);
    padding: 24px 16px 48px;
}
a { color: var(--link); }
.container { max-width: 900px; margin: 0 auto; }
h1 { margin: 0 0 8px; }
h2 { margin-top: 0; }
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.45);
}
.header { margin-bottom: 16px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-size: 12px; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.checkbox { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.checkbox input { width: 18px; height: 18px; }
.camera { background: #000; border-radius: 12px; overflow: hidden; border: 1px solid rgba(255,255,255,0.1); }
.preview { width: 100%; height: 320px; object-fit: cover; background: #000; }
.actions { display: flex; gap: 12px; margin: 12px 0; }
button { border: none; border-radius: 8px; padding: 12px 16px; color: var(--bg); font-weight: 700; cursor: pointer; font-size: 15px; }
button.primary { background: var(--button-primary-bg); color: var(--button-primary-text); }
button.secondary { background: var(--button-secondary-bg); color: var(--button-secondary-text); }
button.danger { background: var(--danger); color: #0b0b11; }
button.secondary.danger { background: rgba(255,107,107,0.18); color: #fff; border: 1px solid rgba(255,107,107,0.6); }
button:disabled { opacity: 0.4; cursor: not-allowed; }
.button-link { text-decoration: none; padding: 10px 14px; border-radius: 8px; border: 1px solid var(--border); color: var(--link); font-weight: 700; }
.field { display: flex; flex-direction: column; gap: 6px; color: var(--muted); }
.field input, .field textarea, .field select { padding: 10px 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.1); background: #0f0f17; color: var(--text); }
.table, table { width: 100%; border-collapse: collapse; }
table th, table td { padding: 8px; border-bottom: 1px solid var(--border); }
.event-banner { width: 100%; max-height: 260px; object-fit: cover; border-radius: 12px; border: 1px solid var(--border); margin-top: 12px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--card); color: var(--text); padding: 12px 16px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.1); }
.hidden { display: none; }
.alert { margin-top: 12px; padding: 12px; border-radius: 8px; }
.alert.success { background: rgba(0,255,127,0.12); border: 1px solid rgba(0,255,127,0.4); }
.alert.warning { background: rgba(255,107,107,0.12); border: 1px solid rgba(255,107,107,0.4); }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.inline-form { display: flex; gap: 12px; align-items: flex-end; }
.photos { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.photo { background: var(--card); padding: 8px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.05); }
.photo img { width: 100%; border-radius: 6px; }
.photo .actions { flex-direction: column; align-items: flex-start; }
.qr-preview { margin-top: 12px; display: flex; align-items: center; gap: 12px; }
.qr-preview svg, .qr-preview canvas { background: #fff; padding: 6px; border-radius: 12px; }
.table-wrapper { overflow-x: auto; }
.upload-status { margin-top: 8px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.flash { animation: flash 0.4s ease; }
@keyframes flash {
    0% { filter: brightness(1); }
    20% { filter: brightness(1.4); }
    100% { filter: brightness(1); }
}
.editor-layout { display: flex; flex-direction: column; gap: 12px; }
#editor-canvas { width: 100%; background: #000; border-radius: 12px; border: 1px solid rgba(255,255,255,0.08); min-height: 320px; touch-action: none; }
#editor-tools { background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.editor-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.editor-badge { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--border); background: rgba(200,162,255,0.12); color: var(--text); font-weight: 700; }
.editor-badge .dot { width: 10px; height: 10px; border-radius: 50%; background: #5cf5a9; box-shadow: 0 0 12px rgba(92,245,169,0.7); display: inline-block; }
.tabbed-editor { gap: 16px; }
.editor-canvas-shell { background: linear-gradient(135deg, rgba(200,162,255,0.12), rgba(5,5,9,0.8)); border: 1px solid var(--border); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 12px 30px rgba(0,0,0,0.35); }
.canvas-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 4px; }
.pill-group { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--button-secondary-bg); color: var(--text); cursor: pointer; }
.pill input { accent-color: var(--primary); }
.tab-shell { background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.tab-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.tab-list.tab-list-floating { padding: 8px; background: rgba(5,5,9,0.72); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 28px rgba(0,0,0,0.35); }
.tab-btn { background: transparent; color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; cursor: pointer; font-weight: 700; letter-spacing: 0.01em; transition: all 0.2s ease; }
.tab-btn.active { background: linear-gradient(120deg, rgba(200,162,255,0.3), rgba(200,162,255,0.12)); border-color: rgba(200,162,255,0.6); box-shadow: 0 8px 24px rgba(0,0,0,0.35); }
.tab-panels { display: flex; flex-direction: column; gap: 10px; }
.tab-panel { background: rgba(255,255,255,0.02); border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.panel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.panel-grid.compact-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.panel-card { background: rgba(0,0,0,0.2); border: 1px solid var(--border); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; box-shadow: inset 0 1px 0 rgba(255,255,255,0.03); }
.panel-card.actions-row { flex-direction: row; align-items: center; justify-content: space-between; }
.transform-panel { background: rgba(255,255,255,0.02); border: 1px solid var(--border); border-radius: 12px; padding: 12px; box-shadow: 0 8px 18px rgba(0,0,0,0.2); }
.transform-panel.collapsed { padding-bottom: 10px; }
.field.compact { gap: 4px; }
.tool-header { display: flex; flex-direction: column; gap: 2px; }
.tool-header.collapsible { flex-direction: row; justify-content: space-between; align-items: center; gap: 12px; }
.tool-header-text { display: flex; flex-direction: column; gap: 2px; }
.collapse-btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--button-secondary-bg); color: var(--text); font-weight: 700; cursor: pointer; }
.collapse-btn .chevron { font-size: 14px; transition: transform 0.2s ease; }
.transform-panel.collapsed .collapse-btn .chevron { transform: rotate(-90deg); }
.sticker-palette { display: flex; gap: 10px; overflow-x: auto; padding: 4px 0; }
.sticker-btn { width: 72px; height: 72px; border-radius: 12px; border: 1px solid var(--border); background: var(--button-secondary-bg); padding: 8px; display: grid; place-items: center; cursor: pointer; }
.sticker-btn img { width: 100%; height: 100%; object-fit: contain; }
.overlay-browser { display: flex; flex-direction: column; gap: 8px; }
.overlay-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px; }
.overlay-tab { border: 1px solid var(--border); background: rgba(255,255,255,0.04); color: var(--text); border-radius: 10px; padding: 8px 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.overlay-tab.active { background: linear-gradient(120deg, rgba(200,162,255,0.28), rgba(200,162,255,0.12)); border-color: rgba(200,162,255,0.6); box-shadow: 0 8px 22px rgba(0,0,0,0.32); }
.overlay-slider-shell { display: flex; flex-direction: column; gap: 6px; }
.overlay-slider { display: flex; gap: 10px; overflow-x: auto; padding: 6px 2px 2px; scroll-snap-type: x proximity; }
.overlay-thumb { min-width: 92px; max-width: 92px; border-radius: 12px; border: 1px solid var(--border); background: var(--button-secondary-bg); display: flex; flex-direction: column; gap: 6px; align-items: center; padding: 8px; scroll-snap-align: start; }
.overlay-thumb img { width: 100%; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid rgba(255,255,255,0.08); background: #000; }
.overlay-thumb-label { font-size: 11px; color: var(--muted); text-align: center; line-height: 1.2; }
.overlay-palette { align-items: center; }
.overlay-btn.active { outline: 2px solid var(--primary); outline-offset: 2px; }
.frame-palette { padding-bottom: 8px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.frame-btn { background: rgba(200,162,255,0.1); }
.frame-btn.no-frame { color: var(--text); font-weight: 700; }
.tool-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: space-between; }
.overlay-scope-row { justify-content: flex-start; gap: 16px; }
.radio { display: inline-flex; gap: 8px; align-items: center; color: var(--muted); font-size: 14px; }
.font-select { padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--button-secondary-bg); color: var(--text); min-width: 200px; }
.font-select:focus { outline: 2px solid var(--primary); }
.transform-buttons { display: flex; gap: 8px; }
.transform-buttons button { width: 44px; height: 44px; padding: 0; font-size: 18px; }
#editor-actions { justify-content: space-between; }
.editor-selection { outline: 2px dashed var(--primary); outline-offset: 4px; }
@media (min-width: 768px) {
    .editor-layout { flex-direction: row; align-items: flex-start; gap: 16px; }
    #editor-canvas { flex: 2; }
    #editor-tools { flex: 1; }
}
.gallery-grid { margin-top: 12px; }
.gallery-grid .photo { display: flex; flex-direction: column; gap: 6px; }
.gallery-grid .photo img { cursor: zoom-in; }
.photo-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.8); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 1000; }
.photo-modal.hidden { display: none; }
.photo-modal .modal-content { position: relative; max-width: min(1200px, 90vw); max-height: 90vh; }
.photo-modal .modal-content.form-modal { width: min(480px, 90vw); max-height: none; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; box-shadow: 0 12px 30px rgba(0,0,0,0.45); }
.photo-modal img { width: 100%; height: 100%; object-fit: contain; border-radius: 12px; box-shadow: 0 24px 60px rgba(0,0,0,0.6); }
.photo-modal button { position: absolute; top: -12px; right: -12px; background: var(--card); color: var(--text); border: 1px solid rgba(255,255,255,0.16); border-radius: 999px; width: 40px; height: 40px; cursor: pointer; font-size: 18px; }
.photo-modal .modal-content.form-modal button { position: static; width: auto; height: auto; border-radius: 8px; }
