* { box-sizing: border-box; }
:root { color-scheme: light; --ink: #1a201e; --lime: #d7f668; --line: #d9ddd5; --muted: #596158; }
body { margin: 0; background: #f3f4ed; color: var(--ink); font: 16px/1.4 "Inter", "Segoe UI", Arial, sans-serif; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button, input[type=color], .sports label { cursor: pointer; }
button, input, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #346cd6; outline-offset: 3px; }
.shell { width: min(1328px, 92%); margin-inline: auto; }
.masthead { background: #171d1b; color: white; }
.topbar { height: 63px; display: flex; align-items: center; gap: 19px; }
.brand { font: italic 900 27px/1 "Arial Black", Arial, sans-serif; letter-spacing: -2px; }
.brand span { color: var(--lime); }
.studio-tag { color: #d6dbd3; border-left: 1px solid #555d56; padding-left: 19px; font-size: 13px; }
.store-link { margin-left: auto; font-size: 14px; font-weight: 600; }
.store-link span, .order a span { color: var(--lime); padding-left: 6px; }
.store-link:hover, .order a:hover { text-decoration: underline; text-underline-offset: 4px; }
.intro { padding: 34px 0 24px; }
h1, h2, p, figure { margin: 0; }
h1, h2 { line-height: 1.08; }
h1 { font-family: "Barlow Condensed", Impact, "Arial Narrow", sans-serif; font-weight: 400; text-transform: uppercase; font-size: clamp(38px,4.3vw,68px); letter-spacing: -.01em; }
h1 span { color: #698725; }
.intro p, .order p { color: var(--muted); margin-top: 8px; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(310px, 345px); gap: 20px; align-items: stretch; }
.preview-card, .controls { background: #fff; border: 1px solid #cdd2c9; border-radius: 12px; overflow: hidden; }
.preview-card { display: flex; flex-direction: column; min-width: 0; }
.board { display: flex; flex-direction: column; flex: 1; position: relative; color: #222720; background: radial-gradient(ellipse at 48% 38%, white 30%, #f3f2ee 100%); border-bottom: 1px solid var(--line); }
.board-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 21px 24px 0; }
.board-header h2 { font-size: 17px; letter-spacing: -.03em; }
.live, figcaption, .export-meta span, .color-row output { font: 11px/1.4 "IBM Plex Mono", Consolas, monospace; }
.live { display: inline-flex; align-items: center; gap: 7px; color: #475244; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: #659036; }
.views { flex: 1; display: grid; grid-template-columns: 1fr 1fr; align-items: center; padding: 13px clamp(10px,2vw,30px) 20px; }
.views figure { min-width: 0; position: relative; text-align: center; }
.views canvas { display: block; width: min(100%, 314px); height: auto; margin: auto; }
figcaption { color: #526052; font-weight: bold; text-transform: uppercase; letter-spacing: .16em; margin: 2px auto 0; }
.export-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 23px 12px; }
.export-meta { display: grid; gap: 3px; }
.export-meta strong { font-size: 15px; }
.export-meta span { color: var(--muted); }
.export-meta b { padding: 0 3px; }
.download { display: flex; align-items: center; justify-content: center; gap: 9px; background: var(--lime); color: #20291b; border: 1px solid #b2d144; font-size: 14px; font-weight: 750; border-radius: 7px; padding: 12px 17px; }
.download:hover { background: #c8ec50; }
.download:disabled { opacity: .65; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.notice, #status { margin: 0 23px 15px; color: var(--muted); font-size: 12px; }
.notice span { display: inline-grid; place-items: center; font-weight: 700; font-family: Georgia, serif; width: 14px; height: 14px; border: 1px solid; border-radius: 50%; margin-right: 4px; }
#status:empty { display: none; }
#png-result { margin:0 23px 15px; font-size:14px; }
#png-result a, #png-result summary { color:#354a15; font-weight:650; text-decoration:underline; cursor:pointer; }
#png-result details { margin-top:7px; }
#png-result p { margin:8px 0; }
#png-result img { display:block; max-width:100%; height:auto; border:1px solid var(--line); }
.controls { padding: 23px; }
.control-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 20px; }
.control-header h2, .order h2 { font-size: 25px; letter-spacing: -.05em; }
.jump-preview { display: none; }
#reset { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border: 0; background: transparent; color: var(--muted); font-size: 13px; }
#reset span { font-size: 20px; }
#reset:hover { color: #111; }
fieldset { padding: 0; margin: 0; min-width: 0; border: 0; }
legend { padding: 0; font-size: 14px; font-weight: 750; margin-bottom: 9px; }
.divided { margin-top: 19px; }
.divided legend { float: left; border-top: 1px solid var(--line); padding-top: 15px; width: 100%; }
.divided > div { clear: both; }
.sports { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.sports label { position: relative; }
.sports input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.sports span { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 6px; padding: 10px; font-size: 13px; font-weight: 600; }
.sports input:checked + span { background: #e8f7bf; border-color: #849e4c; }
.sports input:focus-visible + span { outline: 3px solid #346cd6; outline-offset: 2px; }
.sports svg { pointer-events: none; flex: 0 0 auto; }
.fields { display: grid; grid-template-columns: 1fr 78px; gap: 10px; }
.fields label { font-size: 12px; color: var(--muted); }
.team-field { grid-column: 1 / -1; }
.fields input { width: 100%; padding: 9px 10px; border-radius: 6px; border: 1px solid #cbd1c8; background: #fff; color: var(--ink); margin-top: 4px; font-size: 16px; }
.color-row { display: flex; align-items: center; gap: 11px; position: relative; padding: 5px 0; cursor: pointer; font-size: 14px; }
.color-row output { margin-left: auto; color: var(--muted); pointer-events: none; }
.color-row input { width: 34px; height: 29px; padding: 2px; background: #fff; border: 1px solid var(--line); border-radius: 5px; }
.color-row input::-webkit-color-swatch-wrapper { padding: 0; }
.color-row input::-webkit-color-swatch { border-radius: 3px; border: 0; }
.order { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 22px 0 30px; padding: 21px 25px; border: 1px solid var(--line); border-left: 4px solid #9dbe49; border-radius: 8px; }
.order h2 { font-size: 22px; }
.order p { font-size: 14px; margin-top: 5px; }
.order a { font-weight: 700; font-size: 14px; white-space: nowrap; }
.order a span { color: var(--ink); }
@media (max-width: 860px) {
  .shell { width: 94%; }
  .workspace { grid-template-columns: minmax(0,1fr) 288px; gap: 12px; }
  .controls { padding: 17px; }
  .views { padding-inline: 0; }
  .export-row { padding-inline: 15px; }
  .notice { margin-inline: 15px; }
}
@media (max-width: 700px) {
  .shell { width: calc(100% - 28px); }
  .topbar { height: 54px; gap: 12px; }
  .studio-tag { padding-left: 12px; font-size: 12px; }
  .brand { font-size: 23px; }
  .store-link { font-size: 12px; }
  .intro { padding: 22px 0 17px; }
  h1 { font-size: clamp(31px,7.6vw,46px); }
  .intro p { font-size: 14px; }
  .workspace { grid-template-columns: 1fr; gap: 14px; }
  .board-header { margin: 16px 16px 0; }
  .views { padding: 6px 5px 14px; }
  .views canvas { max-width: 192px; }
  .download { padding: 11px 12px; }
  .export-meta strong { font-size: 13px; }
  .order { align-items: flex-start; flex-direction: column; padding: 17px; }
  .control-header { margin-bottom: 14px; }
  .jump-preview { display: block; margin-top: 15px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; text-align: center; font-size: 14px; font-weight: 600; }
}
@media (max-width: 360px) { .studio-tag { display: none; } .export-row { padding-inline: 10px; gap: 5px; } }
[hidden] { display: none !important; }
.mode-switch, #setting-tabs { display:flex; gap:4px; align-items:center; }
.mode-switch { margin:0 0 16px; padding:4px; border-radius:8px; background:#edf0e7; }
.mode-switch button, #setting-tabs button { border:0; color:var(--muted); font-family:inherit; font-weight:600; font-size:13px; background:transparent; border-radius:5px; min-height:38px; cursor:pointer; }
.mode-switch button { flex:1; }
.mode-switch [aria-pressed=true] { background:#212920; color:#fff; font-weight:700; }
#setting-tabs { margin-bottom:14px; border-bottom:1px solid var(--line); padding-bottom:5px; }
#setting-tabs button { padding:5px 8px; }
#setting-tabs [aria-pressed=true] { background:#e8f7bf; color:var(--ink); font-weight:700; }
.setting { font-size:13px; font-weight:600; display:block; margin-top:10px; }
.setting select, .setting input:not([type=range]), .background-label select { display:block; width:100%; min-width:0; min-height:40px; margin-top:4px; border:1px solid #c5ccc1; border-radius:6px; padding:6px 8px; font-family:inherit; font-weight:400; font-size:15px; color:var(--ink); background:white; }
.setting input[type=range] { display:block; width:100%; accent-color:#476323; min-height:28px; }
.setting output { float:right; font-weight:400; }
.setting-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 9px; }
.fabric-setting { display:grid; grid-template-columns:minmax(0,1fr) 72px; gap:10px; align-items:end; }
.fabric-setting canvas { width:72px; height:40px; border:1px solid var(--line); border-radius:6px; }
.jersey-stage { position:relative; width:min(100%,314px); margin:auto; }
.views .jersey-stage canvas { width:100%; max-width:none; }
#setting-tabs { flex-wrap:wrap; }
#artwork-panel h3 { margin:15px 0 6px; font-size:16px; }
#artwork-panel p,#artwork-panel small { color:var(--muted); font-size:13px; line-height:1.45; }
#artwork-panel small { display:block; margin:6px 0; }
#artwork-panel button,.file-button { color:var(--ink); background:#fff; border:1px solid #b4beae; border-radius:6px; padding:7px 10px; font-family:inherit; font-size:13px; font-weight:600; line-height:1.25; cursor:pointer; }
#artwork-panel button:disabled { opacity:.5; cursor:default; }
.file-button { position:relative; display:inline-flex; align-items:center; min-height:36px; }
.file-button:focus-within { outline:3px solid #346cd6; }
.file-button input { position:absolute; inset:0; opacity:0; width:100%; height:100%; cursor:pointer; }
#artwork-panel > .file-button,#patch-reset,.patch-actions { margin-top:8px; }
.patch-actions,.patch-sample { display:flex; align-items:center; flex-wrap:wrap; gap:6px; }
.patch-sample { margin:12px 0; }
.patch-sample span { flex:1; overflow-wrap:anywhere; font-size:13px; }
.checker { background:repeating-conic-gradient(#e0e4dd 0 25%,white 0 50%) 0 0/14px 14px; }
.patch-sample img { width:48px; height:48px; object-fit:contain; border:1px solid var(--line); border-radius:5px; }
.patch-compare { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:10px; }
.patch-compare img { width:100%; height:95px; object-fit:contain; display:block; }
.patch-compare figcaption { font-size:12px; margin:4px 0; }
#patch-status:not(:empty),#placement-warning:not(:empty) { margin:9px 0; padding:7px 9px; background:#f2f4ea; border-left:3px solid #899965; }
.patch-selection { position:absolute; box-sizing:border-box; border:1px dashed #fff; outline:1px solid #30432a; cursor:move; touch-action:none; }
.patch-move { position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); width:calc(100% + 6px); height:calc(100% + 6px); min-width:20px; min-height:20px; padding:0; border:0; background:transparent; cursor:move; touch-action:none; }
.patch-resize,.patch-rotate { position:absolute; width:20px; height:20px; padding:0; background:#fff; color:#20321d; border:1px solid #385435; border-radius:50%; font:700 12px/18px Arial; touch-action:none; }
.patch-rotate { left:50%; top:-20px; transform:translate(-50%,-50%); cursor:grab; }
.patch-resize { right:-4px; bottom:-4px; transform:translate(50%,50%); cursor:nwse-resize; }
@media(max-width:700px) {
  .jersey-stage { max-width:192px; }
  .views.editing-patch { grid-template-columns:1fr; }
  .views.editing-patch figure:not(.active-face) { display:none; }
  .views.editing-patch .jersey-stage { max-width:300px; }
  .patch-resize,.patch-rotate { width:30px; height:30px; }
  .patch-resize { right:-17px; bottom:-17px; }
  .patch-rotate { top:-28px; }
  .patch-move { min-width:44px; min-height:44px; }
  #artwork-panel button,.file-button { min-height:42px; }
}
#advanced-panel h3 { margin:18px 0 8px; padding-top:14px; border-top:1px solid var(--line); font-size:15px; }
.check, .swatch, .swatch label { display:flex; align-items:center; gap:8px; font-size:14px; }
.check { margin-top:12px; min-height:40px; }
.swatch { justify-content:space-between; min-height:42px; }
.swatch input, .color-row input { width:42px; height:34px; border:1px solid var(--line); border-radius:5px; padding:2px; background:#fff; }
.swatch button { border:0; background:transparent; color:#445539; font-size:12px; min-height:36px; text-decoration:underline; }
.background-label { display:flex; align-items:center; gap:7px; font-size:13px; font-weight:600; }
.background-label select { display:inline-block; width:auto; min-height:34px; margin:0; }
.workspace { align-items:start; }
.preview-card { position:sticky; top:10px; }
.board { min-height:420px; background:#fff; }
.controls { max-height:calc(100vh - 30px); overflow-y:auto; scrollbar-gutter:stable; }
.board.transparent { background:repeating-conic-gradient(#f0f1ed 0 25%,#fff 0 50%) 0 0/20px 20px; }
@media(max-width:700px) {
  .preview-card { position:static; }
  .board { min-height:0; }
  .controls { max-height:none; overflow:visible; }
  .export-row { flex-wrap:wrap; }
  .export-meta { flex:1 0 135px; }
  .download { min-height:44px; }
  .mode-switch button,#setting-tabs button { min-height:44px; }
}

