@layer theme,base,components,utilities,legacy;
@layer legacy {

:root {
--st-header-h: 68px;
--st-dock-h: 0px;
--st-page-max: 1760px;
--st-page-gutter: clamp(16px, 3vw, 48px);
--st-page-compact-gutter: 16px;
--st-page-top: 16px;
--st-page-bottom: 56px;
--st-page-gap: 8px;

--st-bg: #f4f1ea;            
--st-surface: #fff;
--st-surface-tint: #f7f3ec;
--st-panel: #ebe4d8;
--st-panel-line: #e0d6c7;
--st-hover: #e8e0d3;         


--st-text: #2b211c;          
--st-text-2: #4a3f38;        
--st-text-muted: #6b5e55;    
--st-text-body: #3f342e;


--st-line: #e3d9cb;          
--st-line-soft: #eee7de;
--st-line-hover: #c9bba8;
--st-line-strong: #8c7c6e;   


--st-ink: #2b211c;
--st-ink-2: #3a2e28;
--st-ink-line: #4a3d35;
--st-on-ink: #fbf9f5;
--st-on-ink-2: #c9bdb2;
--st-on-ink-3: #a8998c;


--st-accent: #905f38;        
--st-accent-text: #7f5230;   
--st-cta: #f7b32b;           
--st-cta-hover: #e9a514;     
--st-on-cta: #2b211c;        
--st-band-subtle: #f3e6d8;   


--st-tile-bg: #faf3ea;
--st-tile-line: #c9a27a;
--st-tile-text: #5a3a22;


--st-red: #d9483b;   --st-red-text: #b83a2e;   --st-red-bg: #fff1f2;
--st-green: #3f9e4a; --st-green-text: #2f6f37; --st-green-bg: #f7fee7;
--st-blue: #3a7bd5;  --st-blue-text: #2a5ea8;  --st-blue-bg: #eff5fd;
--st-amber-text: #b45309; --st-amber-bg: #fffbeb;
--st-stripe: linear-gradient(90deg, #3a7bd5 0 25%, #d9483b 25% 50%, #f7b32b 50% 75%, #3f9e4a 75% 100%);


--st-focus: #2b211c;
--st-focus-on-dark: #f7b32b;
--st-focus-glow: 0 0 0 4px rgb(247 179 43 / .35);


--st-radius-panel: 24px;
--st-radius-modal: 20px;
--st-radius-card: 16px;
--st-radius-tile: 14px;
--st-radius-field: 12px;
--st-control-target: var(--st-control-medium);
--st-control-gap: 8px;
--st-cta-edge: color-mix(in srgb, var(--st-cta) 58%, var(--st-ink));
--st-control-small: 32px;
--st-control-compact: 36px;
--st-control-medium: 40px;
--st-control-tab: 42px;
--st-control-field: 44px;
--st-control-field-type: 15px;

--st-control-field-measure: 42.875em;
--st-radius-inner: 11px;
--st-radius-pill: 999px;
--st-shadow-picker: 0 12px 32px rgb(43 33 28 / .18);
--st-shadow-modal: 0 20px 60px rgb(0 0 0 / .3);
--st-scrim: rgb(28 21 18 / .75);


--st-font-display: "Fredoka", "Fredoka fallback", "Inter", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;
--st-font-body: "Inter", "Inter fallback", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
--st-tracking-display: -.015em;


--st-ease: .15s ease;


--navy: var(--st-ink);
--olive: var(--st-accent);
--border: var(--st-line);
--dark: var(--st-ink-2);
--font-heading-family: var(--st-font-display);
--font-heading-weight: 600;
--font-heading-letter-spacing: var(--st-tracking-display);
}

@media (max-width:768px), (pointer:coarse) { :root { --st-control-target:var(--st-control-field); } }

@media (max-width:767px) {
:root { --st-header-h:60px; --st-dock-h:64px; }
}



.st-page { box-sizing: border-box; width: 100%; max-width: var(--st-page-max); margin-inline: auto; padding: 16px 32px 56px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.st-stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; min-width: 0; align-content: start; }


.st-panel { box-sizing: border-box; min-width: 0; background: var(--st-panel); border: 1px solid var(--st-panel-line); border-radius: var(--st-radius-panel); padding: 8px; }
.st-panel-dark { background: var(--st-ink); border-color: var(--st-ink); color: var(--st-on-ink); }
.st-shead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 16px; padding: 22px 22px 18px; }
.st-shead-text { min-width: 0; }
.st-shead-title { margin: 4px 0 0; font-family: var(--st-font-display); font-weight: 600; letter-spacing: var(--st-tracking-display); font-size: 30px; line-height: 1.12; color: inherit; }
.st-shead-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.st-label { margin: 0; font: 600 11px/1.3 var(--st-font-body); letter-spacing: .12em; text-transform: uppercase; color: var(--st-text-muted); }
.st-panel-dark .st-label { color: var(--st-on-ink-3); }
.st-more { font-weight: 600; font-size: 14px; color: var(--st-accent-text); text-decoration: none; white-space: nowrap; }
.st-more:hover { text-decoration: underline; text-underline-offset: 3px; }

.st-panel-dark .st-more { color: var(--st-cta); }


.st-card { box-sizing: border-box; min-width: 0; background: var(--st-surface); border: 1px solid var(--st-line); border-radius: var(--st-radius-card); padding: 6px; color: var(--st-text); transition: border-color var(--st-ease); }
a.st-card { display: block; text-decoration: none; }
a.st-card:hover { border-color: var(--st-line-hover); }
.st-panel-dark .st-card { background: var(--st-ink-2); border-color: var(--st-ink-line); color: var(--st-on-ink); }
.st-card-top { border-top: 4px solid var(--st-card-accent, var(--st-accent)); }
.st-card-media { position: relative; overflow: hidden; border-radius: var(--st-radius-inner); aspect-ratio: 16 / 10; background: var(--st-surface-tint); }
.st-card-body { display: grid; gap: 6px; padding: 12px 12px 14px; }
.st-card-title { margin: 0; font-family: var(--st-font-display); font-weight: 600; letter-spacing: var(--st-tracking-display); font-size: 19px; line-height: 1.2; }


.st-band { position: relative; overflow: hidden; border-radius: var(--st-radius-modal); background: var(--st-accent); color: #fff; padding: 34px 32px 38px; }
.st-band::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: var(--st-stripe); }
.st-band-attached { border-radius: var(--st-radius-modal) var(--st-radius-modal) 0 0; }
.st-band .st-label { color: #fff; }  
.st-band-title { margin: 4px 0 0; font-family: var(--st-font-display); font-weight: 600; letter-spacing: var(--st-tracking-display); font-size: 44px; line-height: 1.1; color: #fff; overflow-wrap: anywhere; }
.st-band-subtitle { margin: 6px 0 0; color: #fff; }
.st-band-body { background: var(--st-surface); border: 1px solid var(--st-line); border-top: 0; border-radius: 0 0 var(--st-radius-modal) var(--st-radius-modal); padding: 8px; }


.st-hero { position: relative; overflow: hidden; isolation: isolate; border-radius: var(--st-radius-panel); background: var(--st-ink); color: var(--st-on-ink); padding: 56px; min-height: 360px; display: grid; align-content: end; gap: 16px; }
.st-hero-eyebrow, .st-hero-title, .st-hero-lead, .st-hero-actions { max-width: 640px; }
.st-hero-media { position: absolute; inset: 0; z-index: -1; }
.st-hero-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgb(43 33 28 / .96) 0 38%, rgb(43 33 28 / .35)); }

.st-hero-eyebrow { margin: 0; font: 600 11px/1.3 var(--st-font-body); letter-spacing: .12em; text-transform: uppercase; color: var(--st-cta); }
.st-hero-title { margin: 0; font-family: var(--st-font-display); font-weight: 600; letter-spacing: var(--st-tracking-display); font-size: 56px; line-height: 1.08; color: #fff; }
.st-hero-lead { margin: 0; font-size: 18px; color: var(--st-on-ink-2); }
.st-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }

.st-underline { position: relative; white-space: nowrap; }
.st-underline::after { content: ""; position: absolute; left: 0; right: 0; bottom: -.08em; height: .16em; pointer-events: none; background: no-repeat center / 100% 100% url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 10' preserveAspectRatio='none'%3E%3Cpath d='M2 7 Q60 1 110 5 T198 4' fill='none' stroke='%23f7b32b' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E"); }


.st-btn { position: relative; overflow: hidden; isolation: isolate; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 8px 24px; border: 1px solid transparent; border-radius: var(--st-radius-pill); font: 600 15px/1.2 var(--st-font-body); text-decoration: none; white-space: nowrap; cursor: pointer; transition: color .3s cubic-bezier(.3, 1, .3, 1), border-color var(--st-ease); }
.st-btn-sm { min-height: 40px; padding: 8px 16px; font-size: 14px; }
.st-btn-gold { background: var(--st-cta); color: var(--st-on-cta); }
.st-btn-ink { background: var(--st-ink); color: var(--st-on-ink); }
.st-btn-ghost { background: var(--st-surface); color: var(--st-text); border-color: var(--st-line-strong); font-weight: 500; }
.st-btn-ghost-dark { background: transparent; color: var(--st-on-ink); border-color: rgb(255 255 255 / .45); }
.st-btn:disabled, .st-btn[aria-disabled=true] { opacity: .45; cursor: not-allowed; }

.st-btn::after { content: ""; position: absolute; z-index: -1; left: -10%; right: -10%; top: 100%; height: 220%; border-radius: 50%; background: var(--st-ink); transition: top .5s cubic-bezier(.3, 1, .3, 1); pointer-events: none; }
.st-btn-ink::after, .st-btn-ghost-dark::after { background: var(--st-cta); }
@media (hover: hover) and (pointer: fine) {
.st-btn-gold:not(:disabled, [aria-disabled=true]):hover, .st-btn-ghost:not(:disabled, [aria-disabled=true]):hover { color: var(--st-on-ink); }
.st-btn-ink:not(:disabled, [aria-disabled=true]):hover, .st-btn-ghost-dark:not(:disabled, [aria-disabled=true]):hover { color: var(--st-on-cta); border-color: var(--st-cta); }
.st-btn:not(:disabled, [aria-disabled=true]):hover::after { top: -60%; }
}
.st-btn:focus-visible { outline: 2px solid var(--st-focus); outline-offset: 2px; box-shadow: var(--st-focus-glow); }

.st-btn-ghost-dark:focus-visible, .st-panel-dark .st-btn:focus-visible, .st-hero .st-btn:focus-visible { outline-color: var(--st-focus-on-dark); box-shadow: none; }


.st-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.st-chip { box-sizing: border-box; display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 12px; border: 1px solid var(--st-line); border-radius: var(--st-radius-pill); background: var(--st-surface); color: var(--st-text-2); font: 500 12px/1.2 var(--st-font-body); text-decoration: none; }
button.st-chip, a.st-chip { min-height:var(--st-control-target); padding-block:8px; cursor: pointer; transition: border-color var(--st-ease), background-color var(--st-ease); }
button.st-chip:hover, a.st-chip:hover { border-color: var(--st-line-hover); }
.st-chip[aria-pressed=true], .st-chip[aria-current], .st-chip-on { background: var(--st-ink); border-color: var(--st-ink); color: var(--st-on-ink); }
.st-panel-dark .st-chip, .st-hero .st-chip { background: rgb(255 255 255 / .06); border-color: rgb(255 255 255 / .16); color: var(--st-on-ink); }
.st-chip-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--st-chip-dot, var(--st-accent)); flex: none; }
.st-status { display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px; border-radius: var(--st-radius-pill); font: 600 11px/1.2 var(--st-font-body); letter-spacing: .06em; text-transform: uppercase; background: var(--st-surface-tint); color: var(--st-text-2); }
.st-status-green { background: var(--st-green-bg); color: var(--st-green-text); }
.st-status-amber { background: var(--st-amber-bg); color: var(--st-amber-text); }
.st-status-blue { background: var(--st-blue-bg); color: var(--st-blue-text); }
.st-status-red { background: var(--st-red-bg); color: var(--st-red-text); }


.st-tabs { display: flex; flex-wrap: wrap; gap: var(--st-control-gap); }
.st-tabs-scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
.st-tabs-scroll > .st-tab { flex: none; }
.st-tab { box-sizing: border-box; display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 16px; border: 1px solid var(--st-line-strong); border-radius: var(--st-radius-pill); background: var(--st-surface); color: var(--st-text-2); font: 600 14px/1.2 var(--st-font-body); text-decoration: none; cursor: pointer; transition: background-color var(--st-ease), border-color var(--st-ease); }
.st-tab:hover { background: var(--st-hover); color: var(--st-text); }
.st-tab[aria-selected=true], .st-tab[aria-current], .st-tab[aria-pressed=true] { background: var(--st-ink); border-color: var(--st-ink); color: var(--st-on-ink); }
.st-tab-count { padding: 0 7px; border-radius: var(--st-radius-pill); background: var(--st-surface-tint); color: var(--st-text-muted); font-size: 12px; }
.st-tab[aria-selected=true] .st-tab-count, .st-tab[aria-current] .st-tab-count { background: var(--st-ink-line); color: var(--st-on-ink); }


@media (max-width: 767px) {
.st-page { padding: 8px 16px 104px; }
.st-shead { padding: 18px 14px 14px; }
.st-shead-title { font-size: 24px; }
.st-band { padding: 24px 18px 28px; }
.st-band-title { font-size: 32px; }
.st-hero { padding: 28px 22px; min-height: 0; border-radius: var(--st-radius-modal); }
.st-hero-title { font-size: 36px; }
.st-hero-lead { font-size: 16px; }
.st-hero-media::after { background: linear-gradient(180deg, rgb(43 33 28 / .55), rgb(43 33 28 / .96) 55%); }
}
@media (prefers-reduced-motion: reduce) {
.st-btn, .st-btn::after, .st-card, .st-chip, .st-tab { transition: none; }
.st-btn::after { display: none; }
@media (hover: hover) and (pointer: fine) {
.st-btn-gold:not(:disabled, [aria-disabled=true]):hover { background: var(--st-cta-hover); color: var(--st-on-cta); }
.st-btn-ghost:not(:disabled, [aria-disabled=true]):hover { background: var(--st-hover); color: var(--st-text); }
.st-btn-ink:not(:disabled, [aria-disabled=true]):hover { background: var(--st-ink-2); color: var(--st-on-ink); }
.st-btn-ghost-dark:not(:disabled, [aria-disabled=true]):hover { background: rgb(255 255 255 / .08); color: var(--st-on-ink); }
}
}
@media (forced-colors: active) {
.st-btn::after { display: none; }
.st-btn, .st-chip, .st-tab, .st-card, .st-panel { border: 1px solid CanvasText; }
}

html:root { scroll-padding-block:calc(var(--st-header-h) + 8px) calc(var(--st-dock-h) + 8px); color: var(--st-text); background: var(--st-bg); font-family: var(--st-font-body); }

:root :is(a, button, input, select, textarea, summary, [tabindex]:not(:where([tabindex="-1"]))):focus-visible {
outline: 2px solid var(--st-focus); outline-offset: 3px; box-shadow: var(--st-focus-glow);
}
:root :is(.source-footer, .st-on-dark, .st-panel-dark, .st-hero) :focus-visible, :root .st-btn-ghost-dark:focus-visible { outline-color: var(--st-focus-on-dark); box-shadow: none; }
:root :is(h1, h2):not(:where(.project-update-rich-content, .forum-rich-content, .project-update-comment-content, .readonly-rich-description, .tiptap, .ProseMirror, .prose, .ql-editor, [contenteditable=true]) *) {
font-family: var(--st-font-display); font-weight: 600; letter-spacing: var(--st-tracking-display);
}
:root :is(input, textarea)::placeholder { color: var(--st-text-muted); opacity: 1; }
:root .skip-link { background: var(--st-cta); color: var(--st-on-cta); border-radius: var(--st-radius-pill); font-weight: 600; }
:root .eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .07em; color: var(--st-text-muted); }
:root .section-intro, :root .small-note, :root .result-count { color: var(--st-text-muted); }
:root dt { color: var(--st-text-muted); letter-spacing: .07em; }
:root .button { border-radius: var(--st-radius-pill); font-size: 14px; font-weight: 600; padding: 10px 22px; }
:root .primary { background: var(--st-cta); color: var(--st-on-cta); border-color: var(--st-cta); }
:root .primary:hover { background: var(--st-cta-hover); border-color: var(--st-cta-hover); }
:root .secondary { background: var(--st-surface); color: var(--st-text); border-color: var(--st-line-strong); font-weight: 500; }
:root .secondary:hover { border-color: var(--st-text); }
:root .text-button, :root .back-link { color: var(--st-accent); font-weight: 600; }
:root .search input { border-radius: var(--st-radius-pill); font-size: 14px; background: var(--st-surface); color: var(--st-text); }
:root .catalog-card { border-color: var(--st-line); border-radius: var(--st-radius-card); box-shadow: none; }
:root .catalog-card { color: var(--st-text); }
:root :is(.card-number, .card-label) { color: var(--st-text-muted); }
:root .card-sigil, :root .mechanic-mark { color: var(--st-line-hover); }
:root .view-project { color: var(--st-accent); border-top-color: var(--st-line-soft); }
:root .image-fallback { background: var(--st-surface-tint); color: var(--st-text-muted); }
:root :is(.group, .tag) { background: var(--st-surface); border-color: var(--st-line); color: var(--st-text-2); border-radius: var(--st-radius-pill); }
:root :is(.group:hover, a.tag:hover) { border-color: var(--st-line-hover); background: var(--st-surface-tint); }
:root .group.active { background: var(--st-ink); border-color: var(--st-ink); color: var(--st-on-ink); }
:root .state-box { background: var(--st-surface-tint); border: 1px dashed var(--st-line-hover); border-radius: var(--st-radius-tile); color: var(--st-text-muted); }
:root .state-box h3 { color: var(--st-text); }
:root .state-icon { background: var(--st-surface); border-color: var(--st-line); color: var(--st-accent); }
:root .error-box { background: var(--st-red-bg); border-color: #f0c4c0; color: var(--st-red-text); }
:root .error-box .state-icon { background: var(--st-surface); border-color: #f0c4c0; color: var(--st-red-text); }
:root .alternative-name, :root .gallery figcaption { color: var(--st-text-muted); }
:root :is(.comment-dialog, .update-comment-dialog, .reactors-dialog, .review-decision-dialog, .project-users-dialog, .forum-create-dialog, .forum-delete-dialog, .rich-editor-link-dialog, .public-project-qr-panel, .profile-avatar-dialog, .manage-feature-dialog) {
background: var(--st-surface); color: var(--st-text); border-color: var(--st-line); border-radius: var(--st-radius-modal); box-shadow: var(--st-shadow-modal);
}


@media (max-height:520px) {
#main :is(.source-project-tabs-wrap,.source-project-summary-wrap,.authoring-actions,.playtest-signup,.rte-full > .rte-toolbar,.source-browse-filters),
.background-private-preview > .background-preview-toolbar { position:static; }
:root:has(.source-project-tabs-wrap) { --st-viewer-tabs-h:0px; }
:root:has(#main .authoring-actions) { scroll-padding-bottom:8px; }
}
@media (max-height:300px) {
:root:has(.source-layout) { scroll-padding-block:8px; }
}
}