@font-face {
  font-family: Studio Display;
  src: url("barlow-condensed.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: Studio Sans;
  src: url("dm-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
:root {
  --studio-paper: #eeece4;
  --studio-ink: #151713;
  --studio-lime: #d8fa00;
  --studio-rule: #cbcabe;
  --studio-gutter: clamp(22px, 4.5vw, 86px);
  --studio-display: "Studio Display", "Arial Narrow", sans-serif;
  --studio-sans: "Studio Sans", Arial, sans-serif;
}
body { height: 100dvh; font-family: var(--studio-sans); }
body::before, .bar::after, .entry-mode .ca::before, .entry-mode .ca::after { display: none; }
.bar {
  background: #060705; border-bottom: 1px solid #30322c; gap: clamp(16px, 2.5vw, 40px);
  height: 74px; padding-inline: max(var(--studio-gutter), calc((100vw - 1600px) / 2));
}
.bar .logo { line-height: 0; flex: none; }
.bar .logo img { width: 155px; height: auto; }
#barLbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.studio-nav, .bar-actions, .studio-project-actions { display: flex; align-items: center; gap: 8px; }
.studio-nav { margin-left: auto; gap: 18px; height: 100%; }
.studio-nav button, .studio-return button {
  background: none; font: 600 14px/1.3 var(--studio-sans); cursor: pointer; border: 0;
}
.studio-nav button { color: #c6c9c1; height: 100%; position: relative; }
.entry-mode .studio-nav-home, .editor-mode .studio-nav-editor { color: white; }
.entry-mode .studio-nav-home::after, .editor-mode .studio-nav-editor::after {
  content: ""; position: absolute; bottom: 15px; left: 0; right: 0; height: 2px; background: var(--studio-lime);
}
.bar-actions { margin: 0; }
.bar .btn, .studio-titlebar .btn, .editor-preview-head .btn {
  font: 600 13px/1.2 var(--studio-sans); text-transform: none; letter-spacing: 0; padding: 9px 12px; box-shadow: none;
}
.bar .btnG { color: #e5e7de; border-color: #404239; }
.bar .btnY, .studio-titlebar .btnY { background: var(--studio-lime); color: #13160d; }
.entry-mode #garageBtn { display: inline-flex !important; }
.entry-mode #entryStage { padding: 0; max-width: none; display: block; background: #151714; }
.studio-hero { height: clamp(490px, 39vw, 670px); position: relative; overflow: hidden; background: #d3cbc1; color: var(--studio-ink); }
.studio-hero-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 57%; }
.studio-wrap, .studio-hero-inner, .studio-titlebar, .editor-mode .ws {
  width: min(calc(100% - 2 * var(--studio-gutter)), 1600px); margin-inline: auto;
}
.studio-hero-inner { height: 100%; position: relative; display: flex; align-items: center; pointer-events: none; }
.studio-hero-copy { width: 37%; padding-bottom: 3%; pointer-events: auto; }
.studio-hero h1, .studio-titlebar h1, .studio-gallery h2 {
  font: 700 clamp(53px, 5.45vw, 100px)/.93 var(--studio-display); letter-spacing: -.035em;
}
.studio-hero-copy p { margin: 20px 0 29px; max-width: 29ch; font-size: clamp(16px, 1.26vw, 22px); line-height: 1.4; }
.studio-primary {
  display: inline-flex; align-items: center; gap: 24px; padding: 15px 20px; border: 0; border-radius: 3px;
  background: var(--studio-lime); color: #11150c; font: 700 15px/1.2 var(--studio-sans); cursor: pointer;
}
.studio-primary b { font-size: 20px; }
.studio-primary:hover { background: #e5ff50; }
.studio-return { display: flex; flex-wrap: wrap; gap: 12px; }
.studio-return button { margin-top: 12px; text-decoration: underline; text-underline-offset: 3px; color: #1d2019; }
.studio-gallery { background: #151714; color: #f6f5ed; padding: clamp(30px, 3vw, 58px) 0 clamp(40px, 4vw, 74px); }
.studio-gallery h2 { font-size: clamp(35px, 3.8vw, 66px); margin-bottom: 24px; }
.studio-looks { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(14px, 2vw, 32px); }
.studio-look { min-width: 0; border: 0; background: none; color: inherit; padding: 0; text-align: left; font: inherit; cursor: pointer; }
.studio-look img { display: block; width: 100%; height: auto; aspect-ratio: 2.22; object-fit: cover; }
.studio-look:hover img { filter: brightness(1.06); }
.studio-caption { display: flex; align-items: baseline; justify-content: space-between; padding: 12px 0; gap: 6px; border-bottom: 1px solid #55574e; }
.studio-caption > span { font-size: 12px; color: #d5d7c9; }
.studio-caption b { color: var(--studio-lime); font-size: 17px; }
.entry-footer { background: #10120f; margin: 0; padding: 20px max(var(--studio-gutter), calc((100vw - 1600px) / 2)); }
.entry-footer a { color: #c6c8c0; }
.entry-footer-note, .entry-footer-nav a { font: 500 12px/1.6 var(--studio-sans); text-transform: none; letter-spacing: normal; }
.editor-mode #main-content { background: var(--studio-paper); padding-bottom: clamp(12px, 2vh, 26px); }
.studio-titlebar { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 8px 0 10px; color: var(--studio-ink); }
.studio-titlebar h1 { font-size: clamp(24px, 2.1vw, 32px); line-height: 1.05; letter-spacing: -.02em; }
.studio-crumb { font-size: 12px; margin-bottom: 3px; color: #585c52; }
.studio-crumb span { padding: 0 4px; }
.studio-project-actions { flex-wrap: wrap; justify-content: flex-end; }
.studio-titlebar .btnG { color: var(--studio-ink); border: 1px solid #a5a79a; }
.studio-titlebar .btnG:hover { background: #e2e4d9; }
.studio-titlebar #exportBtn { border: 1px solid #adbe17; }
.editor-mode .ws {
  --dock: var(--editor-left-panel-width); --gap: clamp(14px, 1.8vw, 32px);
  grid-template-columns: minmax(0, 1fr) var(--dock); gap: var(--gap); grid-template-rows: minmax(0, 1fr);
}
.editor-mode:not([data-studio-tool="design"]) .ws { --dock: var(--editor-right-panel-width); }
.editor-mode .ca { grid-column: 1; grid-row: 1; display: flex; background: transparent; overflow: hidden; min-width: 0; }
.editor-mode .editor-panel-resize-handle { right: calc(var(--dock) + var(--gap) / 2); left: auto; transform: translateX(50%); border: none; }
body[data-studio-tool="design"] .editor-panel-resize-handle.right,
body:not([data-studio-tool="design"]) .editor-panel-resize-handle.left { display: none; }
.editor-mode .editor-panel-resize-handle::before { background: transparent; }
.editor-mode .editor-panel-resize-handle::after { background: #747b6a; }
.editor-mode #editorStage { padding: 0; max-width: none; background: #242924; border: 1px solid #373b34; }
.editor-preview-head, .studio-canvas-foot {
  display: flex; flex-wrap: wrap; flex-direction: row; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px clamp(12px, 1.3vw, 20px); background: #1b1e19; border: 0; color: #f7f8f1;
}
.editor-preview-head { border-bottom: 1px solid #40463d; }
.editor-preview-head::before, .editor-preview-viewer::before, .editor-preview-viewer::after, .template-editor-wrap::before { display: none; }
.editor-head-car { font: 700 clamp(21px, 2vw, 32px)/1 var(--studio-display); letter-spacing: -.01em; text-transform: none; }
.editor-head-badge { font-size: 14px; color: var(--studio-lime); }
.editor-head-sub { font: 500 12px var(--studio-sans); text-transform: none; color: #c1c6b9; }
.editor-head-tail { width: auto; display: flex; flex-wrap: wrap; gap: 6px; }
.editor-preview-head .btn { font-size: 12px; padding: 8px 10px; }
.editor-preview-head #iracingOpenBtn { color: #f6f7ed; border: 1px solid #626a58; background: #30362e; }
.editor-preview-viewer {
  min-height: 0; border: 0; background-color: #252a26;
  background-image: linear-gradient(#ffffff09 1px, transparent 1px), linear-gradient(90deg,#ffffff09 1px, transparent 1px);
  background-size: 22px 22px;
}
.editor-preview-surface { padding: clamp(6px, 1.2vw, 20px); }
.studio-canvas-foot { border-top: 1px solid #40463d; font-size: 12px; color: #c2c6b9; }
.studio-canvas-foot .workspace-pill { margin-left: auto; }
.studio-inspector {
  grid-column: 2; grid-row: 1; min-height: 0; display: flex; flex-direction: column;
  background: #faf9f3; color: #151713; border: 1px solid var(--studio-rule);
  --p1: #faf9f3; --p2: #fffefa; --p3: #eeefe6; --bd: #d8d8cd; --bd2: #a7aa9a;
  --tx: #1b1e16; --mu: #585c50; --mu2: #515648; --Y: #4f6400; --ok: #365c25; --info: #165463;
}
.studio-tools { display: grid; grid-template-columns: 1fr 1.45fr 1fr; border-bottom: 1px solid var(--studio-rule); }
.studio-tools button { background: transparent; border: 0; border-bottom: 3px solid transparent; color: #5c6053; cursor: pointer; font: 600 13px var(--studio-sans); min-height: 48px; }
.studio-tools button[aria-pressed="true"] { border-color: #839c11; color: #151713; background: #f0f1e5; }
.studio-properties { overflow-y: auto; min-height: 0; flex: 1; scrollbar-width: thin; scrollbar-color: #afb4a2 transparent; }
.studio-inspector .sb, .studio-inspector .sbr { padding: 20px clamp(14px, 1.5vw, 26px) 0; overflow: visible; border: 0; }
body[data-studio-tool="design"] .studio-inspector .sbr, body:not([data-studio-tool="design"]) .studio-inspector .sb,
body[data-studio-tool="text"] #secLogos, body[data-studio-tool="logos"] #secTexts { display: none; }
.studio-inspector .st { font: 700 27px/1 var(--studio-display); letter-spacing: -.015em; text-transform: none; padding-bottom: 8px; }
.studio-inspector .st::before { display: none; }
.studio-inspector .tip { color: #525b34; background: #eef0df; border-color: #bbc29e; }
.studio-inspector .fld label, .studio-inspector .tab-btn, .studio-inspector .layer-title { font-family: var(--studio-sans); letter-spacing: .01em; text-transform: none; }
.studio-inspector .fld label { font-size: 12px; color: #454a3c; }
.studio-inspector .fld input, .studio-inspector .ei { font-family: var(--studio-sans); }
.studio-inspector .pd { height: 25px; aspect-ratio: auto; border-color: #a2a598; }
.studio-inspector .btnY { background: var(--studio-lime); box-shadow: none; }
.studio-inspector .prem-label { color: white; }
.studio-inspector .premium-mapping-note { color: #673c00; }
.studio-settings { border-top: 1px solid var(--studio-rule); padding: 12px clamp(14px, 1.5vw, 26px); }
.studio-settings summary { cursor: pointer; font: 600 13px var(--studio-sans); }
.studio-settings .sec { margin: 14px 0 0; }
.studio-inspector-foot { padding: 11px 15px; border-top: 1px solid var(--studio-rule); }
.studio-inspector-foot #saveState { padding: 0; border: 0; font: 500 12px var(--studio-sans); letter-spacing: 0; text-transform: none; }
.studio-inspector-foot #saveState::before { content: ""; display: inline-block; background: #798239; border-radius: 50%; margin-right: 7px; height: 8px; width: 8px; }
button:focus-visible, summary:focus-visible, .studio-inspector input:focus-visible { outline: 2px solid #859b21; outline-offset: 2px; }
@media (max-width: 980px) {
  :root { --studio-gutter: clamp(15px, 3vw, 32px); }
  .studio-hero { height: 45vw; min-height: 400px; }
  .studio-hero-copy { width: 40%; }
  .studio-hero h1 { font-size: clamp(43px, 6.1vw, 59px); }
  .studio-hero-copy p { font-size: 15px; }
  .bar { gap: 14px; }
  .bar .logo img { width: 135px; }
  .editor-head-tail { justify-content: flex-start; }
}
@media (max-width: 720px) {
  .bar { min-height: 61px; height: auto; flex-wrap: wrap; row-gap: 2px; padding-block: 8px; justify-content: space-between; }
  .studio-nav { margin: 0; height: 35px; }
  .entry-mode .studio-nav-home::after, .editor-mode .studio-nav-editor::after { bottom: 0; }
  .bar-actions { flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
  .bar .btn { padding: 7px 9px; }
  .editor-mode #main-content { overflow-y: auto; display: block; }
  .editor-mode .ws { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; gap: 14px; }
  .editor-mode .editor-panel-resize-handle { display: none; }
  .studio-inspector { grid-column: 1; grid-row: 2; }
  .studio-properties { overflow: visible; }
  .editor-mode #editorStage { flex: auto; }
  .editor-preview-viewer { flex: none; height: clamp(250px, 72vw, 435px); }
  .editor-preview-surface { padding: 6px; }
  .editor-preview-head, .studio-canvas-foot { padding: 9px; gap: 6px; }
  .studio-titlebar { align-items: flex-start; flex-wrap: wrap; }
  .studio-project-actions { flex-wrap: wrap; justify-content: flex-start; gap: 5px; }
  .studio-titlebar .btn { padding: 7px 9px; }
  .studio-inspector-foot { margin-top: 10px; }
}
@media (max-width: 640px) {
  .studio-hero { height: auto; min-height: 0; display: flex; flex-direction: column; background: #ded8ce; }
  .studio-hero-inner { height: auto; }
  .studio-hero-copy { width: 100%; max-width: 400px; padding: 25px 0 9px; }
  .studio-hero h1 { font-size: clamp(49px, 11.5vw, 69px); }
  .studio-hero-copy p { margin: 12px 0 17px; max-width: 32ch; }
  .studio-hero-photo { order: 1; position: static; height: clamp(175px, 49vw, 280px); object-position: 94% 57%; }
  .studio-primary { padding: 12px 16px; }
  .studio-looks { grid-template-columns: 1fr; gap: 20px; }
  .studio-gallery h2 { margin-bottom: 17px; }
  .entry-footer { gap: 8px; }
}
@media (max-width: 540px) {
  .bar-actions { width: 100%; justify-content: flex-start; }
  .bar .auth-user-name { max-width: 22vw; }
  .bar .lang-switch { margin-left: auto; }
  .bar-actions .lang-switch { order: 4; }
}
#entryStage::before, #entryStage::after, .studio-canvas-foot .workspace-pill { display: none; }
.studio-arrow { display: inline-block; width: 10px; height: 10px; position: relative; border-top: 2px solid currentColor; border-right: 2px solid currentColor; }
.studio-arrow::before { content: ""; position: absolute; top: -1px; right: 0; width: 12px; height: 2px; background: currentColor; transform: rotate(-45deg); transform-origin: right center; }
.studio-caption .studio-arrow { width: 8px; height: 8px; margin-left: 5px; color: var(--studio-lime); }
.studio-caption .studio-arrow::before { width: 10px; }
.studio-canvas-foot .template-zoom-controls { margin-left: auto; }
.mo .mbox { max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); overflow-y: auto; border-top-color: var(--studio-lime); }
.mo .mbox h2 { font: 700 34px/1 var(--studio-display); text-transform: none; letter-spacing: -.015em; }
#authModal .mbox, #garageModal .mbox, #carModal .mbox { background: #191c17; --p2: #242820; --mu: #acb1a2; --mu2: #cdd1c5; --bd: #43493d; --bd2: #575e50; }
#authModal .btn, #garageModal .btn, #carModal .btn { font: 600 13px var(--studio-sans); text-transform: none; letter-spacing: normal; }
#carModal .car-class-card { border-width: 1px; border-radius: 3px; }

#iracingHelpModal .mbox {
  width: min(550px, calc(100% - 24px));
  padding: clamp(14px, 2.2vw, 28px);
}
#iracingHelpModal .mbox:has(#iracingPreviewResult:not([hidden])),
#iracingHelpModal .mbox:has(#cupViewPanel:not([hidden])) {
  width: min(1200px, calc(100% - 24px));
}
.iracing-preview-heading {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.iracing-preview-heading h2 { flex: 1; min-width: 0; overflow-wrap: anywhere; }
#iracingHelpModal .iracing-preview-heading h2 { margin: 0; }
#iracingPreviewResult:not([hidden]), #cupViewResult:not([hidden]) {
  display: block; position: relative; width: 100%; margin: 0 0 12px;
  color: #f5f6ee; background: #191c18; border: 1px solid #41473b; padding: 0; cursor: zoom-in;
}
#iracingRenderImage, #cupViewCanvas { display: block; width: 100%; max-height: 62dvh; object-fit: contain; }
#iracingPreviewResult span, #cupViewResult span {
  position: absolute; right: 8px; bottom: 8px; background: #11150ff2;
  border: 1px solid #69735f; border-radius: 3px; padding: 6px 10px;
  font: 600 13px/1.2 var(--studio-sans);
}
#iracingRenderPanel:has(#iracingPreviewResult:not([hidden])) #iracingPreviewWindowsControls p { display: none; }

#cupViewSelector:not([hidden]) {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 14px;
}
#cupViewSelector [aria-pressed="true"] { color: #10120f; background: var(--studio-lime); }
#cupViewStatus { margin: 6px 0; color: #c1c5bc; font: 500 14px/1.4 var(--studio-sans); }
#cupViewCanvas { height: auto; box-sizing: border-box; padding: 14px 2% 34px; }

#iracingLargeView[open] {
  position: fixed; inset: 0; display: flex; flex-direction: column;
  width: 100%; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; color: #f5f6ee; background: #171a16;
}
#iracingLargeView::backdrop { background: #171a16; }
#iracingLargeView .iracing-preview-heading {
  flex: none; margin: 0; background: #10120f; border-bottom: 1px solid #41473b;
  padding: max(10px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 10px max(14px, env(safe-area-inset-left));
}
#iracingLargeTitle { font: 700 clamp(19px, 2.2vw, 29px)/1.1 var(--studio-display); }
#iracingZoomBtn[aria-pressed="true"] { background: var(--studio-lime); color: #10120f; }
#iracingImageViewport {
  flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; container-type: size;
}
.iracing-large-sheet {
  display: grid; place-items: center; min-width: 100%; min-height: 100%; width: max-content;
}
#iracingLargeImage {
  width: min(100cqw, calc(100cqh * var(--render-aspect))); height: auto; display: block; max-width: none;
}
#iracingLargeView.zoomed #iracingLargeImage { width: min(200cqw, calc(200cqh * var(--render-aspect))); }

/* The Cup starts with finished looks. Manual layers stay one disclosure away. */
#cupLooks { margin-bottom: 18px; }
#cupLooks .st { margin: 0 0 8px; }
.cup-look-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
.cup-look-card { display: grid; grid-template-columns: minmax(0,1fr); align-content: center; gap: 3px; padding: 6px 9px; width: 100%; border: 1px solid var(--studio-rule); border-radius: 4px; background: #ecece4; color: #1b211c; text-align: left; font: 700 14px/1.15 var(--studio-sans); cursor: pointer; }
.cup-look-card[aria-pressed="true"] { border-color: #586600; box-shadow: inset 4px 0 #879d00; background: #f0f3db; }
.cup-look-card:hover { border-color: #879170; }
.cup-look-art { position: relative; display: block; aspect-ratio: 1260 / 386; }
.cup-look-art img, .cup-look-art canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.cup-look-art:has(canvas:not([hidden])) img { visibility: hidden; }
#cupLookPalette { margin: 17px 0 6px; }
.cup-look-colors { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.cup-look-colors label { display: grid; gap: 3px; font: 500 12px var(--studio-sans); }
.cup-look-colors input { display: block; width: 100%; min-width: 0; height: 30px; padding: 1px 3px; background: #fff; border: 1px solid var(--studio-rule); cursor: pointer; }
.cup-look-clear { border: 0; padding: 6px 0; margin-top: 3px; background: transparent; color: #465039; text-decoration: underline; cursor: pointer; font: 500 12px var(--studio-sans); }
.cup-look-status { display: block; color: #7b3027; font: 500 13px var(--studio-sans); }
#studioFine > summary { padding: 10px 0; border-top: 1px solid var(--studio-rule); cursor: pointer; font: 700 14px var(--studio-sans); }
#studioFine[open] > summary:not([hidden]) { margin-bottom: 9px; }

#cupReview {
  box-sizing: border-box; width: min(1000px, calc(100% - 24px)); max-height: 90dvh;
  padding: clamp(14px, 2.2vw, 26px); color: #f5f6ee; background: #191c18;
  border: 1px solid #555d50; border-radius: 3px; overflow: auto;
}
#cupReview::backdrop { background: #080908cc; }
#cupReview .iracing-preview-heading h2 { margin: 0; }
#cupReviewGrid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,210px),1fr)); gap: 10px; }
#cupReviewGrid button {
  min-width: 0; display: grid; align-content: end; padding: 0; overflow: hidden;
  color: inherit; background: #10130f; border: 1px solid #40463d; text-align: left; cursor: zoom-in;
}
#cupReviewGrid button:disabled { opacity: .62; cursor: default; }
#cupReviewGrid img { display: block; width: 100%; height: 105px; object-fit: contain; }
#cupReviewGrid img[hidden] { display: none; }
#cupReviewGrid button:disabled::before { content: ""; display: block; height: 105px; }
#cupReviewGrid span { padding: 6px 10px; font-weight: 600; }
.cup-review-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cup-review-actions [hidden], #cupReviewOpen[hidden] { display: none; }
