@font-face { font-family: MPBadge; src: url(/assets/fonts/InterDisplay-Black.woff) format("woff"); font-weight: 900; font-display: swap; }
@font-face { font-family: MPBadgeI; src: url(/assets/fonts/InterDisplay-BlackItalic.woff) format("woff"); font-weight: 900; font-display: swap; }

.gs { max-width: 1320px; margin: 0 auto; padding: 36px clamp(16px, 3vw, 32px) 80px; --gs-ac: var(--ind, #776BFF); --gs-ac2: var(--cy, #42D9F5); }
.gs-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.gs-top .pg-head { margin: 0; }

/* tabs: one segmented control */
.gs-tabs { display: inline-flex; padding: 4px; gap: 2px; border-radius: 12px; background: var(--deck); box-shadow: 0 0 0 1px var(--line) inset; }
.gs-tabs button { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border: 0; border-radius: 9px; background: none; color: var(--muted); font: 600 14px/1 var(--body); cursor: pointer; }
.gs-tabs button svg { width: 17px; height: 17px; }
.gs-tabs button:hover { color: var(--runway); }
.gs-tabs button[aria-selected="true"] { color: #fff; background: linear-gradient(135deg, var(--gs-ac), color-mix(in srgb, var(--gs-ac) 70%, var(--gs-ac2))); box-shadow: 0 6px 18px -8px var(--gs-ac); }

/* studio: preview + styles on the left, inspector on the right */
.gs-studio { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 20px; align-items: start; }
.gs-stage { min-width: 0; }
.gs-canvas { display: grid; place-items: center; min-height: 520px; padding: 28px; border-radius: 18px; box-shadow: 0 0 0 1px var(--line) inset;
  background: repeating-conic-gradient(color-mix(in srgb, var(--runway) 5%, transparent) 0 25%, transparent 0 50%) 0 0 / 22px 22px, var(--deck); }
.gs-preview { width: min(100%, 560px); max-height: 72vh; display: grid; place-items: center; }
.gs-preview svg { width: 100%; height: 100%; max-height: 72vh; filter: drop-shadow(0 20px 36px rgba(0, 0, 0, .45)); }
.gs-strip-head { display: flex; align-items: baseline; gap: 12px; margin: 22px 2px 10px; flex-wrap: wrap; }
.gs-strip-head b { font-size: 15px; font-weight: 650; }
.gs-strip-head small { color: var(--muted); font-size: 13px; }
.gs-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 10px; padding: 4px 2px 12px; }
.gs-style { display: grid; gap: 7px; padding: 8px; border-radius: 12px; border: 0; background: var(--deck); box-shadow: 0 0 0 1px var(--line) inset; color: var(--runway); cursor: pointer; scroll-snap-align: start; font: 500 12px/1.2 var(--body); text-align: center; }
.gs-style:hover { box-shadow: 0 0 0 1px color-mix(in srgb, var(--gs-ac) 60%, transparent) inset; }
.gs-style.on { box-shadow: 0 0 0 2px var(--gs-ac) inset; background: color-mix(in srgb, var(--gs-ac) 10%, var(--deck)); }
.gs-thumb { display: grid; place-items: center; width: 100%; border-radius: 8px; background: color-mix(in srgb, var(--runway) 4%, transparent); overflow: hidden; }
.gs-thumb svg { width: 100%; height: 100%; }

/* inspector */
.gs-panel { position: sticky; top: 86px; display: flex; flex-direction: column; max-height: calc(100vh - 100px); border-radius: 18px; background: var(--deck); box-shadow: 0 0 0 1px var(--line) inset; overflow: hidden; }
.gs-inspector { overflow-y: auto; padding: 6px 0; flex: 1; }
.gs-group + .gs-group { border-top: 1px solid var(--line); }
.gs-group > summary { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; cursor: pointer; list-style: none; font: 650 13px/1 var(--body); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.gs-group > summary::-webkit-details-marker { display: none; }
.gs-group > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-3px); transition: transform .2s; }
.gs-group[open] > summary::after { transform: rotate(225deg) translateY(-2px); }
.gs-group > summary:hover { color: var(--runway); }
.gs-body { display: grid; gap: 14px; padding: 2px 18px 18px; }
.gs-field { display: grid; gap: 7px; }
.gs-field > span { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; }
.gs-field output { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.gs-hint { color: var(--muted); font-size: 12px; line-height: 1.45; }
.gs-in { width: 100%; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--sky); color: var(--runway); font: 500 14px/1 var(--body); }
.gs-in.up { letter-spacing: .12em; font-weight: 700; }
.gs-in:focus, .gs-ta:focus { outline: none; border-color: var(--gs-ac); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gs-ac) 25%, transparent); }
select.gs-in { appearance: none; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.gs-ta { height: auto; padding: 10px 12px; line-height: 1.5; resize: vertical; font-family: var(--fm, monospace); font-size: 13px; }
.gs-seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 3px; border-radius: 10px; background: var(--sky); box-shadow: 0 0 0 1px var(--line) inset; }
.gs-seg button { flex: 1 1 auto; min-height: 32px; padding: 0 10px; border: 0; border-radius: 7px; background: none; color: var(--muted); font: 600 12.5px/1 var(--body); cursor: pointer; }
.gs-seg button:hover { color: var(--runway); }
.gs-seg button[aria-checked="true"] { background: var(--deck); color: var(--runway); box-shadow: 0 0 0 1px color-mix(in srgb, var(--gs-ac) 55%, transparent), 0 2px 8px -4px rgba(0, 0, 0, .5); }
.gs-toggle { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; cursor: pointer; }
.gs-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.gs-toggle i { position: relative; width: 36px; height: 20px; border-radius: 20px; background: var(--line); transition: background-color .2s; flex: none; }
.gs-toggle i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; }
.gs-toggle input:checked + i { background: var(--gs-ac); }
.gs-toggle input:checked + i::after { transform: translateX(16px); }
.gs-toggle input:focus-visible + i { box-shadow: 0 0 0 3px color-mix(in srgb, var(--gs-ac) 35%, transparent); }
.gs-range { width: 100%; accent-color: var(--gs-ac); }

.gs-colours { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gs-colours .gs-palettes { grid-column: 1 / -1; }
.gs-palettes { display: flex; flex-wrap: wrap; gap: 8px; }
.gs-pal { display: grid; grid-template-columns: repeat(4, 9px); height: 30px; padding: 4px; gap: 0; border: 0; border-radius: 8px; background: var(--sky); box-shadow: 0 0 0 1px var(--line) inset; cursor: pointer; overflow: hidden; }
.gs-pal i { display: block; height: 22px; }
.gs-pal i:first-child { border-radius: 4px 0 0 4px; } .gs-pal i:last-child { border-radius: 0 4px 4px 0; }
.gs-pal:hover { box-shadow: 0 0 0 2px var(--gs-ac) inset; }
.gs-swatch { display: flex; align-items: center; gap: 9px; padding: 6px; border-radius: 10px; background: var(--sky); box-shadow: 0 0 0 1px var(--line) inset; font-size: 12.5px; font-weight: 600; cursor: pointer; min-width: 0; }
.gs-swatch input { flex: none; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 7px; background: none; cursor: pointer; }
.gs-swatch input::-webkit-color-swatch-wrapper { padding: 0; } .gs-swatch input::-webkit-color-swatch { border: 0; border-radius: 7px; } .gs-swatch input::-moz-color-swatch { border: 0; border-radius: 7px; }
.gs-swatch span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* row editors (teams, matches): one small card per row */
.gs-rows { display: grid; gap: 8px; }
.gs-row { display: grid; gap: 8px; padding: 10px; border-radius: 12px; background: var(--sky); box-shadow: 0 0 0 1px var(--line) inset; }
.gs-row-main { display: flex; align-items: center; gap: 8px; }
.gs-row-main .gs-in { flex: 1; min-width: 0; height: 36px; }
.gs-row-small { display: grid; grid-template-columns: repeat(auto-fit, minmax(52px, 1fr)); gap: 6px; }
.gs-mini { display: grid; gap: 4px; min-width: 0; }
.gs-mini span { font-size: 10.5px; font-weight: 650; letter-spacing: .04em; color: var(--muted); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-mini .gs-in { height: 32px; padding: 0 6px; font-size: 13px; background: var(--deck); }
.gs-mini .gs-in.c-num { text-align: center; font-variant-numeric: tabular-nums; }
.gs-dot { flex: none; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.gs-dot::-webkit-color-swatch-wrapper { padding: 0; } .gs-dot::-webkit-color-swatch { border: 2px solid var(--line); border-radius: 50%; } .gs-dot::-moz-color-swatch { border: 2px solid var(--line); border-radius: 50%; }
.gs-ib { width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.gs-ib:hover { color: var(--red, #e5484d); background: color-mix(in srgb, var(--red, #e5484d) 12%, transparent); }
.gs-ib svg { width: 15px; height: 15px; }
.gs-paste summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--gs-ac); }
.gs-paste[open] { display: grid; gap: 8px; } .gs-paste[open] summary { margin-bottom: 2px; }

.gs-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 10px; border: 0; font: 600 14px/1 var(--body); cursor: pointer; }
.gs-btn svg { width: 16px; height: 16px; }
.gs-btn.ghost { background: transparent; color: var(--runway); box-shadow: 0 0 0 1px var(--line) inset; }
.gs-btn.ghost:hover { box-shadow: 0 0 0 1px var(--gs-ac) inset; }
.gs-btn[disabled] { opacity: .45; cursor: not-allowed; }
.gs-add { justify-self: start; height: 34px; font-size: 13px; }
.gs-btn.primary { width: 100%; height: 46px; color: #fff; font-size: 15px; background: linear-gradient(135deg, var(--gs-ac), color-mix(in srgb, var(--gs-ac) 55%, var(--gs-ac2))); box-shadow: 0 10px 24px -12px var(--gs-ac); }
.gs-btn.primary:hover { filter: brightness(1.08); }
.gs-export { padding: 14px 18px 16px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--deck) 92%, var(--gs-ac)); }
.gs-export-more { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.gs-export-more .gs-btn { height: 34px; font-size: 13px; }
.gs-foot { margin-top: 18px; color: var(--muted); font-size: 13px; }
.gs-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); padding: 10px 16px; border-radius: 10px; background: var(--runway); color: var(--sky); font: 500 14px/1.2 var(--body); z-index: 60; }

@media (max-width: 1000px) {
  .gs-studio { grid-template-columns: 1fr; }
  .gs-panel { position: static; max-height: none; }
  .gs-canvas { min-height: 0; padding: 16px; }
  .gs-export { position: sticky; bottom: 0; z-index: 2; }
}
@media (max-width: 560px) { .gs-tabs { width: 100%; } .gs-tabs button { flex: 1; justify-content: center; padding: 0 8px; } .gs-colours { grid-template-columns: 1fr 1fr; } }
@media (prefers-reduced-motion: reduce) { .gs-toggle i, .gs-toggle i::after, .gs-group summary::after { transition: none; } }

/* your templates */
.gs-style.mine { box-shadow: 0 0 0 1px color-mix(in srgb, var(--gs-ac2) 45%, transparent) inset; }
.gs-style.mine.on { box-shadow: 0 0 0 2px var(--gs-ac2) inset; }
.gs-new { color: var(--muted); border: 1px dashed var(--line); box-shadow: none; }
.gs-new .gs-thumb { display: grid; place-items: center; }
.gs-new .gs-thumb svg { width: 28px; height: 28px; }
.gs-new:hover { color: var(--runway); border-color: var(--gs-ac); }
.gs-ownerbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--gs-ac2); }
.gs-ownerbar .gs-btn { height: 32px; font-size: 12.5px; }
.gs-edit { display: grid; gap: 16px; padding: 16px 18px 18px; }
.gs-edit-head { display: grid; gap: 4px; } .gs-edit-head b { font-size: 16px; } .gs-edit-head small { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.gs-slot { border-radius: 12px; background: var(--sky); box-shadow: 0 0 0 1px var(--line) inset; }
.gs-slot + .gs-slot { margin-top: 8px; }
.gs-slot > summary { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 11px 12px; cursor: pointer; list-style: none; font-size: 13px; }
.gs-slot > summary::-webkit-details-marker { display: none; }
.gs-slot > summary small { color: var(--muted); font-size: 11.5px; }
.gs-slot .gs-body { padding: 0 12px 12px; gap: 10px; }
.gs-slot .gs-in { background: var(--deck); }
.gs-upload { justify-self: start; cursor: pointer; }
.gs-danger { color: var(--red, #e5484d) !important; }
.gs-edit-actions { display: grid; gap: 8px; position: sticky; bottom: 0; padding-top: 8px; background: var(--deck); }
.gs-preview.editing { outline: 2px dashed color-mix(in srgb, #ff4fd8 60%, transparent); outline-offset: 6px; border-radius: 6px; touch-action: none; }
.gs-panel:has(.gs-edit) .gs-export { display: none; }
.gs-logo { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--deck); box-shadow: 0 0 0 1px var(--line) inset; color: var(--muted); cursor: pointer; overflow: hidden; }
.gs-logo:hover { box-shadow: 0 0 0 2px var(--gs-ac) inset; color: var(--runway); }
.gs-logo img { width: 100%; height: 100%; object-fit: contain; }
.gs-logo svg { width: 16px; height: 16px; }
