/* quadcode-ui.css: the one stylesheet for every tool page of the kit (never for the game canvases).
   Taken from the Quadcode brand guidebook: League Spartan, near-black surfaces, white text, and the coral
   gradient (#DD344D to #FF9569) used only as a thin line: the underline of the selected tab, a key word in
   a heading, a focus ring. No corner brackets, no hex combs, no blurred glass, no colored fills on tabs,
   buttons or cards.

   Load in <head>, with the path relative to the page. The web fonts never block the page: the stylesheet loads
   as print media and switches on when it arrives (display=swap; until then the system-ui fallback shows):
     <link rel="preconnect" href="https://fonts.googleapis.com">
     <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
     <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=League+Spartan:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" media="print" onload="this.media='all'">
     <noscript><link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=League+Spartan:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap"></noscript>
     <link rel="stylesheet" href="../../files/ui/quadcode-ui.css">

   Markup (copy as is):
     <nav class="qc-sitebar"><div class="qc-tabs">
       <a class="qc-tab" href="...">Home</a> <a class="qc-tab" href="..." aria-current="page">Demo</a> ...
     </div></nav>
     <header class="qc-top"><h1>Pixel Game <span class="qc-ul">Kit</span></h1>
       <div class="qc-tabs qc-sub"> <button class="qc-tab" aria-selected="true">Level</button> ... </div></header>
*/
:root {
  --qc-page: #0B0D15;      /* page */
  --qc-panel: #13131E;     /* panels, bars */
  --qc-raised: #212233;    /* dropdowns, raised blocks, borders that need to read */
  --qc-line: rgba(255, 255, 255, .08);
  --qc-text: #FFFFFF;
  --qc-soft: rgba(255, 255, 255, .74);
  --qc-muted: rgba(255, 255, 255, .5);
  --qc-faint: rgba(255, 255, 255, .32);
  --qc-brand-a: #DD344D;
  --qc-brand-b: #FF9569;
  --qc-grad: linear-gradient(90deg, #DD344D, #FF9569);
  --qc-accent: #F26B5E;    /* flat mid-point of the gradient, for text accents and slider fills */
  --qc-bad: #F0766B;
  --qc-warn: #F2B45A;
  --qc-ok: #7FD8B0;
  --qc-ui: 'League Spartan', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --qc-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  --qc-ease: .25s ease;
  --qc-out: cubic-bezier(.22, 1, .36, 1);    /* quadcode.ai --ease-out-quint: presses, slides, reveals */
  --qc-inout: cubic-bezier(.76, 0, .24, 1);  /* quadcode.ai --ease-in-out-quart: size changes */
  --qc-fade: 48px;                           /* width of the edge fade on a scrolling tab bar */
}
html { scroll-behavior: smooth; }

html, body { background: var(--qc-page); color: var(--qc-text); font: 400 15px/1.45 var(--qc-ui); -webkit-font-smoothing: antialiased; }
body { margin: 0; min-height: 100vh; overflow-x: hidden; }
*, *::before, *::after { box-sizing: border-box; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--qc-text); text-decoration: none; }
::selection { background: rgba(242, 107, 94, .35); }
:focus-visible { outline: 1.5px solid var(--qc-brand-b); outline-offset: 3px; border-radius: 6px; }
code, kbd, .qc-mono, output { font-family: var(--qc-mono); }

/* tabs: text only. Selected = white text and a thin gradient line, never a fill.
   Motion is the quadcode.ai tab logic: color .18s ease, press scale .97 in .12s out-quint, hover only on real
   pointers, the bar scrolls smoothly and fades at the edge where more tabs wait, the selected tab is centered. */
.qc-tabs { display: flex; gap: 2px; overflow-x: auto; scroll-behavior: smooth; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.qc-tabs::-webkit-scrollbar { display: none; }
.qc-tabs[hidden], .qc-tabbar[hidden] { display: none; }  /* a row that is switched off (a sub-row with nothing to show) */
.qc-tab { position: relative; flex: none; background: none; border: 0; border-radius: 0; padding: 12px 14px 13px; font: 500 15px/1 var(--qc-ui); color: var(--qc-muted); white-space: nowrap; cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; transition: color .18s ease, transform .12s var(--qc-out); }
.qc-tab::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 2px; border-radius: 2px; background: var(--qc-grad); opacity: 0; transform: scaleX(.4); transition: opacity .18s ease, transform .26s var(--qc-out); }
.qc-tab:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) { .qc-tab:hover { color: var(--qc-soft); } }
.qc-tab[aria-current='page'], .qc-tab[aria-selected='true'], .qc-tab.on { color: var(--qc-text); }
.qc-tab[aria-current='page']::after, .qc-tab[aria-selected='true']::after, .qc-tab.on::after { opacity: 1; transform: none; }
.qc-tab:disabled, .qc-tab[aria-disabled='true'] { opacity: .35; cursor: default; pointer-events: none; }
.qc-sitebar { background: var(--qc-panel); border-bottom: 1px solid var(--qc-line); }
.qc-sitebar .qc-tabs { padding: 0 12px; }
.qc-sub .qc-tab { font-size: 14px; padding: 10px 12px 11px; min-height: 40px; }
.qc-sub .qc-tab::after { left: 12px; right: 12px; height: 1.5px; }

/* the edge fade: the 12-step eased ramp from quadcode.ai (smooth, no visible band). quadcode-ui.js sets
   fade-l / fade-r on the bar while more tabs wait on that side. */
.qc-tabs {
  --qc-fl: #0000 0, #00000001 calc(var(--qc-fade) * .0833), #00000009 calc(var(--qc-fade) * .1667), #0000001b calc(var(--qc-fade) * .25), #00000036 calc(var(--qc-fade) * .3333), #00000058 calc(var(--qc-fade) * .4167), #00000080 calc(var(--qc-fade) * .5), #000000a7 calc(var(--qc-fade) * .5833), #000000c9 calc(var(--qc-fade) * .6667), #000000e4 calc(var(--qc-fade) * .75), #000000f6 calc(var(--qc-fade) * .8333), #000000fe calc(var(--qc-fade) * .9167), #000 var(--qc-fade);
  --qc-fr: #000 calc(100% - var(--qc-fade)), #000000fe calc(100% - var(--qc-fade) * .9167), #000000f6 calc(100% - var(--qc-fade) * .8333), #000000e4 calc(100% - var(--qc-fade) * .75), #000000c9 calc(100% - var(--qc-fade) * .6667), #000000a7 calc(100% - var(--qc-fade) * .5833), #00000080 calc(100% - var(--qc-fade) * .5), #00000058 calc(100% - var(--qc-fade) * .4167), #00000036 calc(100% - var(--qc-fade) * .3333), #0000001b calc(100% - var(--qc-fade) * .25), #00000009 calc(100% - var(--qc-fade) * .1667), #00000001 calc(100% - var(--qc-fade) * .0833), #0000 100%;
}
.qc-tabs.fade-l { -webkit-mask-image: linear-gradient(90deg, var(--qc-fl), #000 100%); mask-image: linear-gradient(90deg, var(--qc-fl), #000 100%); }
.qc-tabs.fade-r { -webkit-mask-image: linear-gradient(90deg, #000 0, var(--qc-fr)); mask-image: linear-gradient(90deg, #000 0, var(--qc-fr)); }
.qc-tabs.fade-l.fade-r { -webkit-mask-image: linear-gradient(90deg, var(--qc-fl), var(--qc-fr)); mask-image: linear-gradient(90deg, var(--qc-fl), var(--qc-fr)); }

/* a tab bar with previous / next arrows (quadcode-ui.js builds .qc-tabbar around it when asked) */
.qc-tabbar { display: flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%; }
.qc-tabbar > .qc-tabs { flex: 1 1 auto; min-width: 0; }
.qc-arrow { flex: none; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 999px; background: none; color: var(--qc-soft); cursor: pointer; position: relative; transition: color .18s ease, transform .12s var(--qc-out), opacity .18s ease; }
.qc-arrow::before { content: ''; position: absolute; inset: -6px; }  /* a 44px touch target around the 32px button */
.qc-arrow svg { width: 18px; height: 18px; }
.qc-arrow:active { transform: scale(.92); }
@media (hover: hover) and (pointer: fine) { .qc-arrow:hover { color: var(--qc-text); } }
/* the arrows of a bar of links only scroll it: while every link fits (quadcode-ui.js sets qc-fit) there is nothing to scroll */
.qc-tabbar.qc-fit:not(:has([role='tab'])) > .qc-arrow, .qc-tabbar.qc-fit.qc-auto > .qc-arrow { display: none; }

/* a vertical tab list (a left rail on wide screens): same text tabs, the line sits on the left edge */
.qc-tabs.qc-vert { flex-direction: column; overflow: visible; gap: 2px; }
.qc-vert .qc-tab { justify-content: flex-start; padding: 10px 14px 10px 16px; }
.qc-vert .qc-tab::after { left: 0; right: auto; top: 9px; bottom: 9px; width: 2px; height: auto; transform: scaleY(.4); }
.qc-vert .qc-tab[aria-selected='true']::after, .qc-vert .qc-tab.on::after { transform: none; }

/* panels behind tabs. Stacked panels share one grid cell and cross-fade (180 ms ease-out, like quadcode.ai):
   the box is as tall as the tallest panel, so nothing below jumps when you switch. Without stacking, the
   panel that appears fades in. quadcode-ui.js marks the active one with .is-active and the rest inert. */
.qc-stack { display: grid; }
.qc-stack > .qc-pane { grid-area: 1 / 1; min-width: 0; transition: opacity .18s ease-out; }
.qc-stack > .qc-pane:not(.is-active) { opacity: 0; pointer-events: none; user-select: none; }
.qc-pane.qc-pane-in { animation: qc-pane-in .18s ease-out both; }
@keyframes qc-pane-in { from { opacity: 0; } to { opacity: 1; } }

/* page column: one width and one header position for the pages of a section */
.qc-main { max-width: 1200px; margin: 0 auto; padding: 0 16px 64px; }
.qc-main > .qc-top { padding: 28px 0 4px; }
.qc-main > .qc-top .qc-sub { max-width: 100%; }

/* page header: the key word of the title carries the brand underline */
.qc-top { display: flex; align-items: center; gap: 10px 24px; flex-wrap: wrap; padding: 22px 16px 6px; }
.qc-top h1 { margin: 0; font: 700 28px/1.1 var(--qc-ui); letter-spacing: -.01em; }
.qc-ul { background: var(--qc-grad) left bottom / 100% 2px no-repeat; padding-bottom: 3px; }
h2, .qc-h2 { font: 600 13px/1 var(--qc-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--qc-muted); margin: 28px 0 12px; }

/* surfaces */
.qc-panel { background: var(--qc-panel); border: 1px solid var(--qc-line); border-radius: 14px; padding: 16px; }
.qc-raised { background: var(--qc-raised); border-radius: 14px; }
.qc-card { display: block; padding: 16px 18px; border-radius: 12px; background: var(--qc-panel); border: 1px solid var(--qc-line); font: 500 16px/1.2 var(--qc-ui); transition: background-color var(--qc-ease), border-color var(--qc-ease); }
.qc-card:hover { background: var(--qc-raised); border-color: rgba(255, 255, 255, .14); }
.qc-card code { display: block; margin-top: 6px; font-size: 12px; color: var(--qc-muted); }

/* buttons: the white pill from the Download page; secondary is an outline */
.qc-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; padding: 10px 18px; background: #fff; color: #0B0D15; font: 600 14px/1 var(--qc-ui); cursor: pointer; transition: background-color var(--qc-ease), opacity var(--qc-ease); }
.qc-btn:hover { background: rgba(255, 255, 255, .86); }
.qc-btn.ghost { background: transparent; color: var(--qc-text); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); }
.qc-btn.ghost:hover { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .4); }
.qc-btn:disabled { opacity: .4; cursor: default; }
.qc-chip { display: inline-flex; padding: 7px 12px; border-radius: 999px; font: 500 13px/1 var(--qc-ui); color: var(--qc-soft); box-shadow: inset 0 0 0 1px var(--qc-line); background: none; cursor: pointer; transition: color var(--qc-ease), box-shadow var(--qc-ease); }
.qc-chip:hover { color: var(--qc-text); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); }
.qc-chip[aria-pressed='true'], .qc-chip.on { color: var(--qc-text); box-shadow: inset 0 0 0 1px var(--qc-brand-b); }

/* form controls: quiet, dark, the accent only on the filled part and the focus ring */
input[type=text], input[type=number], input[type=search], select, textarea { background: var(--qc-panel); border: 1px solid var(--qc-line); border-radius: 10px; padding: 9px 12px; transition: border-color var(--qc-ease); }
input[type=text]:focus, input[type=number]:focus, input[type=search]:focus, select:focus, textarea:focus { outline: none; border-color: rgba(255, 149, 105, .7); }
select { appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--qc-muted) 50%), linear-gradient(135deg, var(--qc-muted) 50%, transparent 50%); background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
input[type=range] { accent-color: var(--qc-accent); }
input[type=checkbox] { accent-color: var(--qc-accent); }
kbd { display: inline-block; padding: 3px 7px; border-radius: 6px; background: var(--qc-raised); color: var(--qc-soft); font-size: 12px; }
table { border-collapse: collapse; }
th { text-align: left; font-weight: 600; color: var(--qc-muted); }
th, td { padding: 8px 12px; border-bottom: 1px solid var(--qc-line); }

/* status colors for checks and reports: text only */
.qc-pass { color: var(--qc-ok); } .qc-fail { color: var(--qc-bad); } .qc-warn { color: var(--qc-warn); }

@media (max-width: 480px) { .qc-top h1 { font-size: 24px; } .qc-top { padding: 16px 16px 4px; } }
.qc-btn:active, .qc-chip:active { transform: scale(.97); }
.qc-btn, .qc-chip { transition-property: background-color, color, box-shadow, opacity, transform; transition-duration: .18s, .18s, .18s, .18s, .12s; transition-timing-function: ease, ease, ease, ease, var(--qc-out); }
@media (prefers-reduced-motion: reduce) {
  html, .qc-tabs { scroll-behavior: auto; }
  .qc-tab, .qc-tab::after, .qc-btn, .qc-card, .qc-chip, .qc-arrow, .qc-stack > .qc-pane { transition: none; }
  .qc-tab:active, .qc-btn:active, .qc-chip:active, .qc-arrow:active { transform: none; }
  .qc-pane.qc-pane-in { animation: none; }
}
