/* Graphics maker (#graphics, public/graphics.js). Fonts for designs: our own files under public/fonts (OFL / Apache). */
@font-face { font-family: 'Bebas Neue'; font-weight: 400; font-display: swap; src: url('/fonts/bebas-neue-400.woff2') format('woff2'); }
@font-face { font-family: 'Anton'; font-weight: 400; font-display: swap; src: url('/fonts/anton-400.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-weight: 800; font-display: swap; src: url('/fonts/montserrat-800.woff2') format('woff2'); }
@font-face { font-family: 'Press Start 2P'; font-weight: 400; font-display: swap; src: url('/fonts/press-start-2p-400.woff2') format('woff2'); }
@font-face { font-family: 'Permanent Marker'; font-weight: 400; font-display: swap; src: url('/fonts/permanent-marker-400.woff2') format('woff2'); }
@font-face { font-family: 'Oswald'; font-weight: 700; font-display: swap; src: url('/fonts/oswald-700.woff2') format('woff2'); }
@font-face { font-family: 'Archivo Black'; font-weight: 400; font-display: swap; src: url('/fonts/archivo-black-400.woff2') format('woff2'); }
@font-face { font-family: 'Russo One'; font-weight: 400; font-display: swap; src: url('/fonts/russo-one-400.woff2') format('woff2'); }
@font-face { font-family: 'Bungee'; font-weight: 400; font-display: swap; src: url('/fonts/bungee-400.woff2') format('woff2'); }
@font-face { font-family: 'Rubik Mono One'; font-weight: 400; font-display: swap; src: url('/fonts/rubik-mono-one-400.woff2') format('woff2'); }
@font-face { font-family: 'Righteous'; font-weight: 400; font-display: swap; src: url('/fonts/righteous-400.woff2') format('woff2'); }
@font-face { font-family: 'Lilita One'; font-weight: 400; font-display: swap; src: url('/fonts/lilita-one-400.woff2') format('woff2'); }
@font-face { font-family: 'Orbitron'; font-weight: 800; font-display: swap; src: url('/fonts/orbitron-800.woff2') format('woff2'); }
@font-face { font-family: 'Pacifico'; font-weight: 400; font-display: swap; src: url('/fonts/pacifico-400.woff2') format('woff2'); }
@font-face { font-family: 'Caveat'; font-weight: 700; font-display: swap; src: url('/fonts/caveat-700.woff2') format('woff2'); }
@font-face { font-family: 'Cinzel'; font-weight: 700; font-display: swap; src: url('/fonts/cinzel-700.woff2') format('woff2'); }
@font-face { font-family: 'Playfair Display'; font-weight: 800; font-display: swap; src: url('/fonts/playfair-display-800.woff2') format('woff2'); }
@font-face { font-family: 'MedievalSharp'; font-weight: 400; font-display: swap; src: url('/fonts/medievalsharp-400.woff2') format('woff2'); }
@font-face { font-family: 'Great Vibes'; font-weight: 400; font-display: swap; src: url('/fonts/great-vibes-400.woff2') format('woff2'); }
@font-face { font-family: 'Audiowide'; font-weight: 400; font-display: swap; src: url('/fonts/audiowide-400.woff2') format('woff2'); }
@font-face { font-family: 'Monoton'; font-weight: 400; font-display: swap; src: url('/fonts/monoton-400.woff2') format('woff2'); }
@font-face { font-family: 'Black Ops One'; font-weight: 400; font-display: swap; src: url('/fonts/black-ops-one-400.woff2') format('woff2'); }
@font-face { font-family: 'Teko'; font-weight: 600; font-display: swap; src: url('/fonts/teko-600.woff2') format('woff2'); }
@font-face { font-family: 'Fredoka'; font-weight: 600; font-display: swap; src: url('/fonts/fredoka-600.woff2') format('woff2'); }
@font-face { font-family: 'Silkscreen'; font-weight: 400; font-display: swap; src: url('/fonts/silkscreen-400.woff2') format('woff2'); }

#tab-graphics { min-width: 0; }
.gx-sub { max-width: 720px; margin: 4px 0 8px; }
.gx-h2 { font-size: 17px; font-weight: 600; margin: 26px 0 10px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.gx-h2 .muted { font-size: 13px; font-weight: 400; }
.gx-h3 { font-size: 13px; font-weight: 600; margin: 14px 0 8px; color: var(--muted); }
.gx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.gx-card { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); color: inherit; text-decoration: none; text-align: left; cursor: pointer; font: inherit; min-width: 0; }
.gx-card:hover { border-color: var(--accent); }
.gx-thumb { display: flex; align-items: center; justify-content: center; min-height: 70px; background: var(--panel2); border-radius: var(--r-md); overflow: hidden; }
.gx-thumb canvas { display: block; width: 100%; height: auto; max-height: 220px; object-fit: contain; }
.gx-blank { width: 100%; max-height: 220px; color: var(--muted); }
.gx-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gx-meta b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gx-meta .muted { font-size: 12px; }
.gx-x { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border: 0; border-radius: var(--r-md); background: var(--panel); color: var(--text); font-size: 18px; line-height: 1; cursor: pointer; opacity: 0; }
.gx-card:hover .gx-x, .gx-x:focus-visible { opacity: 1; }
.gx-checker { background-color: #d9d9d9; background-image: linear-gradient(45deg, #b8b8b8 25%, transparent 25%), linear-gradient(-45deg, #b8b8b8 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #b8b8b8 75%), linear-gradient(-45deg, transparent 75%, #b8b8b8 75%); background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; }
.gx-row { display: flex; gap: 8px; align-items: flex-end; min-width: 0; }
.gx-wrap { flex-wrap: wrap; }
.gx-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); margin: 6px 0; min-width: 0; flex: 1; }
.gx-field textarea, .gx-field input:not([type="color"]):not([type="checkbox"]) { width: 100%; box-sizing: border-box; }
.gx-field input[type="color"] { width: 100%; height: 34px; padding: 2px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel2); cursor: pointer; }
.gx-num input { min-width: 0; }
.gx-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; background: var(--panel2); border-radius: var(--r-md); font-size: 13px; }
.gx-chip i { width: 14px; height: 14px; border-radius: var(--r-sm); border: 1px solid var(--line); }
.gx-brand { margin-top: 10px; max-width: 520px; }
.gx-pals { margin: 6px 0 16px; }
.gx-pal { display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.gx-pal i { width: 14px; height: 14px; border-radius: var(--r-sm); border: 1px solid rgba(128,128,128,.4); }
.gx-pal i + i { margin-right: 4px; }
.gx-pal:hover { background: var(--panel2); }
.gx-pal.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.gx-size { font-size: 13px; font-weight: 400; }

/* editor */
.gx-ed { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.gx-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.gx-back { white-space: nowrap; }
.gx-name { max-width: 240px; min-width: 0; flex: 0 1 240px; font-weight: 500; }
.gx-sp { flex: 1; }
.gx-ic { width: 38px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.gx-ic svg, .gx-tool svg, .gx-li-b svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.gx-body { display: grid; grid-template-columns: 200px minmax(0, 1fr) 270px; gap: 16px; align-items: start; }
.gx-left, .gx-right { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px; min-width: 0; }
.gx-right { max-height: calc(100vh - 160px); overflow: auto; }
.gx-add { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.gx-tool { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; background: var(--panel2); border: 1px solid transparent; border-radius: var(--r-md); color: var(--text); font: inherit; font-size: 12px; font-weight: 500; cursor: pointer; }
.gx-tool:hover { border-color: var(--accent); }
.gx-layers { display: flex; flex-direction: column; gap: 2px; max-height: 50vh; overflow: auto; }
.gx-li { display: flex; align-items: center; gap: 4px; padding: 4px 4px 4px 8px; border-radius: var(--r-md); cursor: pointer; font-size: 13px; min-width: 0; }
.gx-li:hover { background: var(--panel2); }
.gx-li.on { background: var(--accent); color: var(--on-accent); }
.gx-li.off .gx-li-name { opacity: .5; }
.gx-li-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gx-li-b { width: 26px; height: 26px; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-sm); opacity: .75; }
.gx-li-b:hover { opacity: 1; }
.gx-li-b svg { width: 15px; height: 15px; }
.gx-empty { font-size: 13px; }
.gx-stagewrap { display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 0; }
.gx-stage { border: 1px solid var(--line); line-height: 0; max-width: 100%; }
.gx-stage canvas { display: block; touch-action: none; max-width: 100%; }
.gx-tip { font-size: 12px; margin: 6px 0; max-width: 640px; }
.gx-small { display: flex; flex-direction: column; gap: 6px; width: 100%; max-width: 640px; }
.gx-small-row { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.gx-yt { display: flex; flex-direction: column; gap: 5px; }
.gx-yt canvas { border-radius: var(--r-lg); display: block; }
.gx-yt-l canvas { width: 240px; height: 135px; }
.gx-yt-s canvas { width: 168px; height: 94px; }
.gx-yt i { display: block; height: 9px; width: 90%; background: var(--panel2); border-radius: var(--r-sm); }
.gx-yt i.s { width: 55%; }
.gx-seg { display: flex; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; margin: 6px 0; }
.gx-seg button { flex: 1; padding: 7px 4px; border: 0; background: var(--panel2); color: var(--text); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.gx-seg button + button { border-left: 1px solid var(--line); }
.gx-seg button.on { background: var(--accent); color: var(--on-accent); }
.gx-sw { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 6px; }
.gx-swb { width: 20px; height: 20px; padding: 0; border: 1px solid rgba(128,128,128,.5); border-radius: var(--r-sm); cursor: pointer; }
.gx-acts { margin-top: 10px; gap: 6px; }
.gx-acts .btn { padding: 6px 10px; font-size: 13px; }
.gx-right .check-row { margin: 4px 0; }
.gx-right textarea { resize: vertical; }

@media (max-width: 1100px) {
  .gx-body { grid-template-columns: minmax(0, 1fr) 260px; }
  .gx-left { grid-column: 1 / -1; display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
  .gx-left .gx-add { grid-template-columns: repeat(5, minmax(0, 1fr)); flex: 1 1 320px; }
  .gx-left .gx-h3 { display: none; }
  .gx-left .gx-layers { flex: 1 1 220px; max-height: 140px; }
}
@media (max-width: 760px) {
  .gx-body { grid-template-columns: minmax(0, 1fr); }
  .gx-stagewrap { order: -1; }
  .gx-right { max-height: none; }
  .gx-name { flex: 1 1 140px; max-width: none; }
  .gx-bar .gx-size { display: none; }
  .gx-bar .btn { min-height: 40px; }
  .gx-left .gx-add { grid-template-columns: repeat(5, minmax(0, 1fr)); flex-basis: 100%; }
  .gx-left .gx-layers { flex-basis: 100%; }
  .gx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .gx-x { opacity: 1; }
  .gx-small-row { gap: 10px; }
  .gx-yt-l canvas { width: 200px; height: 112px; }
}
@media (max-width: 360px) {
  .gx-tool { font-size: 11px; padding: 8px 2px; }
}

/* v2: drawers, menus, sections */
.gx-add { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gx-tool.on { background: var(--accent); color: var(--on-accent); }
.gx-drawer { margin-top: 8px; padding: 8px; background: var(--panel2); border-radius: var(--r-md); max-height: 46vh; overflow: auto; }
.gx-dgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.gx-dgrid + .gx-dgrid { margin-top: 8px; }
.gx-dbtn { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gx-dbtn:hover { border-color: var(--accent); }
.gx-dbtn.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.gx-dtext .gx-dbtn { font-size: 15px; }
.gx-dshape { flex-direction: column; gap: 2px; font-size: 12px; }
.gx-dbtn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.gx-dicons { grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); }
.gx-dicon { padding: 0; }
.gx-iconpick { max-height: 180px; overflow: auto; margin-bottom: 8px; }
.gx-dstk { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gx-dstick { flex-direction: column; min-height: 76px; font-size: 12px; white-space: normal; }
.gx-dstick canvas { display: block; max-width: 100%; }
.gx-li-k { display: inline-flex; width: 16px; height: 16px; flex: none; opacity: .7; }
.gx-li-k svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.gx-li[draggable="true"] { cursor: grab; }
.gx-split { position: relative; display: inline-flex; gap: 2px; }
.gx-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; width: 280px; max-height: 70vh; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: 0 8px 24px rgba(0,0,0,.35); padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.gx-menu button { text-align: left; padding: 8px 10px; background: none; border: 0; border-radius: var(--r-md); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.gx-menu button:hover { background: var(--panel2); }
.gx-menu-h { font-size: 12px; color: var(--muted); padding: 10px 10px 4px; border-top: 1px solid var(--line); margin-top: 4px; }
.gx-menu-sizes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gx-menu-sizes button { font-size: 13px; padding: 6px 10px; }
.gx-sec { border-top: 1px solid var(--line); padding: 4px 0; }
.gx-sec:first-child { border-top: 0; }
.gx-sec summary { cursor: pointer; font-size: 13px; font-weight: 600; padding: 8px 0; color: var(--text); }
.gx-secb { padding-bottom: 8px; }
.gx-range span { display: flex; justify-content: space-between; }
.gx-range output { color: var(--text); font-variant-numeric: tabular-nums; }
.gx-range input { width: 100%; accent-color: var(--accent); }
.gx-align { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.gx-align .btn { padding: 6px 4px; font-size: 12px; min-height: 0; }
.gx-fxp { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin-bottom: 8px; }
.gx-fxb { padding: 7px 4px; background: var(--panel2); border: 1px solid var(--line); border-radius: var(--r-md); color: var(--text); font: inherit; font-size: 12px; cursor: pointer; }
.gx-fxb:hover { border-color: var(--accent); }
.gx-brandbtn { margin: 8px 0; width: 100%; }
.gx-acts2 { position: absolute; top: 4px; right: 4px; display: flex; gap: 4px; }
.gx-acts2 .gx-x { position: static; display: inline-flex; align-items: center; justify-content: center; }
.gx-x svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.gx-card:hover .gx-acts2 .gx-x, .gx-acts2 .gx-x:focus-visible { opacity: 1; }
.gx-chatbg { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: var(--r-md); margin-top: 6px; }
.gx-chat-l { background: #ffffff; color: #111114; }
.gx-chat-d { background: #18181b; color: #efeff1; }
.gx-chatlbl { font-size: 11px; opacity: .6; width: 34px; }
.gx-chatline { font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
.gx-chatbg canvas { display: block; }
.gx-modal textarea { width: 100%; box-sizing: border-box; margin: 8px 0; }
.gx-end { justify-content: flex-end; }
@media (max-width: 1100px) {
  .gx-left .gx-add { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .gx-drawer { flex: 1 1 100%; }
}
@media (max-width: 760px) {
  .gx-left .gx-add { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gx-menu { position: fixed; left: 12px; right: 12px; top: auto; bottom: 80px; width: auto; }
  .gx-acts2 .gx-x { opacity: 1; }
}
.gx-seg { flex-wrap: wrap; }
.gx-seg button { flex: 1 0 30%; min-width: 0; }
.gx-seg button + button { border-left: 0; box-shadow: inset 1px 0 0 var(--line); }

/* stream packages */
.gx-showall { margin-top: 12px; }
.gx-packhead { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.gx-packhead > div { min-width: 0; flex: 1 1 320px; }

/* color set dropdown */
.gx-pals { align-items: center; gap: 12px; flex-wrap: wrap; margin: 6px 0 14px; }
.gx-palpick { position: relative; display: inline-block; max-width: 100%; }
.gx-paltrig { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 6px 10px; background: var(--panel2); border: 1px solid var(--line); border-radius: var(--r-md); color: var(--text); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; max-width: 100%; }
.gx-paltrig:hover { border-color: var(--accent); }
.gx-paltrig i, .gx-palopt i { width: 14px; height: 14px; border-radius: var(--r-sm); border: 1px solid rgba(128,128,128,.45); flex: none; }
.gx-palcap { color: var(--muted); font-weight: 400; margin-right: 2px; }
.gx-chev { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; margin-left: 2px; }
.gx-palmenu { position: absolute; left: 0; top: calc(100% + 6px); z-index: 60; width: 320px; max-width: calc(100vw - 32px); max-height: 60vh; overflow: auto; padding: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.gx-right .gx-palpick { display: block; }
.gx-right .gx-palmenu { position: static; margin-top: 6px; width: auto; max-width: none; max-height: none; box-shadow: none; }
.gx-palgrp { display: block; font-size: 12px; color: var(--muted); padding: 6px 4px 4px; }
.gx-palgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.gx-palopt { display: flex; align-items: center; gap: 4px; padding: 7px 8px; background: none; border: 1px solid transparent; border-radius: var(--r-md); color: var(--text); font: inherit; font-size: 13px; text-align: left; cursor: pointer; min-width: 0; }
.gx-palopt span { margin-left: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gx-palopt:hover { background: var(--panel2); }
.gx-palopt.on { background: var(--accent); color: var(--on-accent); }
@media (max-width: 760px) {
  .gx-palmenu { position: fixed; left: 12px; right: 12px; top: auto; bottom: 80px; width: auto; max-width: none; }
  .gx-right .gx-palmenu { left: 12px; right: 12px; width: auto; }
}

/* free photos and art (Pixabay) */
.gx-tool-wide { grid-column: 1 / -1; flex-direction: row; justify-content: center; gap: 8px; }
.gx-stockq { display: flex; gap: 6px; margin-bottom: 6px; }
.gx-stockq input { flex: 1; min-width: 0; }
.gx-stockgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 6px; }
.gx-stockgrid .gx-full { grid-column: 1 / -1; }
.gx-stockb { padding: 0; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); overflow: hidden; cursor: pointer; aspect-ratio: 4 / 3; }
.gx-stockb:hover { border-color: var(--accent); }
.gx-stockb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gx-knock { margin-top: 8px; gap: 6px; }
@media (max-width: 1100px) { .gx-tool-wide { grid-column: auto; flex-direction: column; } }
@media (max-width: 760px) { .gx-stockgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.gx-stockq { flex-wrap: wrap; }
.gx-stockq input { flex: 1 1 100%; }
.gx-stockq .btn { flex: 1 1 100%; }
