/* rl-preset: the game's garage look on the web, ported from the approved mockup (mockup/mockup.css).
   Tokens: item-swapper-preview design/tokens.md (each value's gfx: citation is there, @261013).
   sampled: measured from item-swapper-preview out/smoke/body720.png, the clone's render of the game's own UI bitmaps
   (tokens.md lists bitmap colours as untraced).  ours: our own choice, no source in the game. */

/* The game's display faces, from the web cook (cook/, gitignored game data): Bourgeois Thin ($HeaderThinFont) for the
   light weights, Bourgeois Medium ($HeaderFont) for the heavy ones. Without the web cook, Saira Condensed stands in. */
@font-face {
  font-family: "Bourgeois"; font-weight: 200 300;
  src: url("/webcook/fonts/BourgeoisThin.woff") format("woff"), url("/webcook/fonts/BourgeoisThin.ttf") format("truetype");
}
@font-face {
  font-family: "Bourgeois"; font-weight: 500 600;
  src: url("/webcook/fonts/BourgeoisMedium.woff") format("woff"), url("/webcook/fonts/BourgeoisMedium.ttf") format("truetype");
}

:root {
  /* quality colours: tokens.md 1 (ProductQuality.getColorByQuality) */
  --q-common: #999999; --q-uncommon: #85DDFF; --q-rare: #779CFF; --q-very-rare: #9C78FF; --q-import: #FF4040;
  --q-exotic: #FFE757; --q-black-market: #FF00BF; --q-premium: #7FFFBB; --q-limited: #FF7E45;
  /* UI colours: tokens.md 2 */
  --white: #FFFFFF; --dim: #999999; --light: #CCCCCC; --blue: #43AFFF; --on-hi: #005F8E; --hi: #00A8FF;
  --sky: #97D9FE;
  /* sampled */
  --strip: #1F61AB; --strip-edge: #5DAEE5; --bg-top: #18498C; --bg-mid: #081426; --bg-low: #181018;
  --ember: #401008; --panel: #162645; --edge: #1F2E56; --edge-hi: #5877A1;
  --on: #D5F5FF; --off: #02070A; --field: #03090D; --ring: #CF9A45;
  --hangar-lit: #2A2C21; --hangar-dark: #0F1417; --hangar-floor: #121F15;
  /* ours */
  --card: #0C1018;                   /* darker than the sampled card tints so quality-coloured names hold 4.5:1 */
  --team-blue: #2D7DFF; --team-orange: #FF8A2A;
  --radius: 6px;                     /* panel corners live in bitmaps: untraced */
  --shear: -10.6deg;                 /* tokens.md button-menu-icon: x-shear -0.187 */
  --display: "Bourgeois", "Saira Condensed", "Arial Narrow", sans-serif;  /* $HeaderFont, $HeaderThinFont: tokens.md 4 */
  --body: Arial, Helvetica, sans-serif;                      /* $NormalFont = Arial, tokens.md 4 */
}

* { box-sizing: border-box; }
html { color-scheme: dark; scrollbar-color: #4A79B8 #0A1626; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--white); font: 15px/1.5 var(--body);
  background:
    radial-gradient(110% 55% at 50% 108%, var(--ember), transparent 62%),
    linear-gradient(180deg, var(--bg-top) 0, #0E2A57 16%, var(--bg-mid) 42%, #0C0F1D 74%, var(--bg-low) 100%);
  background-attachment: fixed;
}
::selection { background: var(--hi); color: var(--white); }
input, textarea { caret-color: var(--blue); }
:focus-visible { outline: 2px solid var(--hi); outline-offset: 2px; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2;
     stroke-linecap: round; stroke-linejoin: round; }

.page { display: block; padding-bottom: 72px; }
[hidden] { display: none !important; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 16px; }
.block { margin-top: 40px; }
.block-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px;
              margin-bottom: 14px; }

/* type */
.h-thin { margin: 0; font: 200 clamp(40px, 7vw, 68px)/.95 var(--display); text-transform: uppercase; }
.h-sec { margin: 0; font: 500 28px/1.05 var(--display); text-transform: uppercase; }
.h-sub { margin: 0; font: 600 19px/1.1 var(--display); text-transform: uppercase; }
.keep { text-transform: none; }
.lead { color: var(--light); font-size: 17px; max-width: 46ch; }
.fine { color: var(--dim); font-size: 13px; }
.label { color: var(--blue); font: 600 15px/1.2 var(--display); text-transform: uppercase; }
.more { color: var(--blue); font: 600 16px/1 var(--display); text-transform: uppercase; min-height: 44px;
        display: inline-flex; align-items: center; }
.more:hover { color: var(--sky); }
.count { color: var(--blue); font: 600 17px/1.2 var(--display); text-transform: uppercase; }
.count b { color: var(--white); font-weight: 600; }

/* title strip: the shell's top band, its lit edge sampled */
.strip { position: sticky; top: 0; z-index: 20; background: linear-gradient(180deg, #2A73C2, var(--strip) 55%, #18508F);
         box-shadow: 0 2px 0 var(--strip-edge), 0 10px 26px rgba(0, 0, 0, .45); }
.strip-in { max-width: 1280px; margin: 0 auto; padding: 0 16px; height: 64px; display: flex; align-items: center; gap: 14px; }
.brand { min-height: 44px; display: inline-flex; align-items: center; font: 300 30px/1 var(--display);
         text-transform: uppercase; white-space: nowrap; letter-spacing: .02em; }
.nav { display: none; gap: 2px; }
.nav a, .menu-list a { min-height: 44px; padding: 0 12px; display: inline-flex; align-items: center; gap: 8px;
                       font: 600 17px/1 var(--display); text-transform: uppercase; color: #EAF6FF; border-radius: 3px; }
.nav a:hover, .menu-list a:hover { background: rgba(255, 255, 255, .12); }
.strip .strip-search { display: none; width: 260px; }   /* two classes: .field (later) would re-show it */
.strip .signin { margin-left: auto; }
.menu { position: relative; }
.menu > summary { list-style: none; min-width: 44px; min-height: 44px; display: grid; place-items: center; cursor: pointer;
                  border-radius: 3px; }
.menu > summary::-webkit-details-marker { display: none; }
.menu[open] > summary, .menu > summary:hover { background: rgba(255, 255, 255, .12); }
.menu-list { position: absolute; right: 0; top: 52px; width: min(280px, calc(100vw - 32px)); padding: 8px; display: grid;
             background: var(--panel); border: 1px solid var(--edge); border-top-color: var(--edge-hi);
             border-radius: var(--radius); box-shadow: 0 16px 40px rgba(0, 0, 0, .55); }
@media (min-width: 1000px) {
  .nav { display: flex; }
  .strip .strip-search { display: flex; margin-left: auto; }
  .strip .signin { margin-left: 0; }
  .menu { display: none; }
}

/* the search field (tokens.md search-field: dark field, icon right) */
.field { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; background: var(--field);
         border: 1px solid #2A3F66; border-radius: 3px; color: var(--light); }
.field:focus-within { border-color: var(--hi); }
.field input, .field select { all: unset; flex: 1; align-self: stretch; min-width: 0; min-height: 44px;
                              font: 16px/1.2 var(--body); color: var(--white); }   /* the input itself is the 44px tap target */
.field input::placeholder { color: #8C9AB0; }

/* slanted buttons: the house silhouette (tokens.md 6) */
.btn { position: relative; isolation: isolate; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
       min-height: 44px; padding: 0 22px; border: 0; background: none; color: var(--white); cursor: pointer;
       font: 600 18px/1 var(--display); text-transform: uppercase; white-space: nowrap; }
.btn::before { content: ""; position: absolute; inset: 0; z-index: -1; transform: skewX(var(--shear)); border-radius: 2px;
               background: linear-gradient(180deg, #3A8EE0, var(--strip)); transition: background .2s, box-shadow .2s;
               box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 3px 8px rgba(0, 0, 0, .4); }
.btn:hover::before { background: linear-gradient(180deg, #57AAF5, #2A73C2); }
.btn.primary { color: var(--on-hi); }
.btn.primary::before { background: linear-gradient(180deg, var(--on), #8FD6FA); }
.btn.primary:hover::before { background: linear-gradient(180deg, var(--white), var(--on)); }
.btn.ghost::before { background: rgba(2, 7, 10, .75); box-shadow: inset 0 0 0 1px var(--edge-hi); }
.btn.ghost:hover::before { box-shadow: inset 0 0 0 2px var(--hi); }
.btn[disabled] { opacity: .4; cursor: not-allowed; }

/* segmented toggle, as YOUR ITEM / SWAP TO: selected light cyan, the rest near-black (sampled) */
.seg { display: inline-flex; gap: 6px; padding-left: 4px; }
.seg > * { position: relative; isolation: isolate; min-height: 44px; padding: 0 18px; display: inline-flex; align-items: center;
           font: 600 16px/1 var(--display); text-transform: uppercase; color: var(--white); white-space: nowrap; }
.seg > *::before { content: ""; position: absolute; inset: 0; z-index: -1; transform: skewX(var(--shear));
                   background: var(--off); box-shadow: inset 0 0 0 1px var(--edge); }
.seg > .on { color: var(--on-hi); }
.seg > .on::before { background: var(--on); }
.seg > [aria-disabled="true"] { opacity: .4; cursor: not-allowed; }   /* tokens.md: disabled = up at alpha 0.40 */
.nw { white-space: nowrap; }   /* item names break at the dot between them, never inside one */

/* panels: blue header band into navy (sampled), lit top edge */
.panel { background: linear-gradient(180deg, rgba(28, 76, 113, .94), rgba(22, 38, 69, .95) 110px);
         border: 1px solid var(--edge); border-top-color: var(--edge-hi); border-radius: var(--radius);
         box-shadow: 0 12px 30px rgba(0, 0, 0, .45); }
.pad { padding: 20px; }
.badge { display: inline-flex; align-items: center; padding: 3px 7px; border-radius: 2px; background: var(--off);
         border: 1px solid var(--edge); color: var(--sky); font: 600 12px/1 var(--display); letter-spacing: .06em;
         text-transform: uppercase; vertical-align: middle; }

/* home: upload + today's top preset */
.hero { display: grid; gap: 16px; padding-top: 24px; }
.drop { padding: 24px; display: grid; gap: 16px; align-content: start; }
.dropzone { display: grid; justify-items: center; gap: 8px; padding: 28px 16px; text-align: center; cursor: pointer;
            border: 2px dashed #3F6596; border-radius: var(--radius); background: rgba(3, 9, 13, .55);
            transition: border-color .2s, background .2s; }
.dropzone:hover, .dropzone:focus-within { border-color: var(--hi); background: rgba(3, 9, 13, .75); }
.dropzone .i { width: 44px; height: 44px; color: var(--blue); stroke-width: 1.5; }
.dz-main { font: 500 22px/1.1 var(--display); text-transform: uppercase; }
.dz-main b { color: var(--blue); font-weight: 600; }
.dz-or { color: var(--dim); font-size: 13px; }
.feature { padding: 12px; display: grid; gap: 12px; }
.feature-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 0 6px 4px; }
.who { font: 600 22px/1 var(--body); }
a.who { min-height: 44px; display: inline-flex; align-items: center; }
.stats { display: inline-flex; gap: 14px; color: var(--light); font-size: 14px; }
.stats span { display: inline-flex; align-items: center; gap: 5px; }
.stats .i { width: 16px; height: 16px; }
@media (min-width: 900px) { .hero { grid-template-columns: 5fr 7fr; align-items: stretch; } }

/* the turntable stand-in: the shop's backdrop (sampled), a gold-ringed disc that spins, a flat car that turns */
.viewer { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius); cursor: grab;
          user-select: none; touch-action: pan-y; border: 1px solid var(--edge);
          background:
            radial-gradient(55% 45% at 50% 0%, rgba(214, 220, 190, .28), transparent 70%),
            radial-gradient(40% 70% at 100% 40%, rgba(51, 69, 70, .9), transparent 70%),
            linear-gradient(180deg, var(--hangar-lit) 0%, var(--hangar-dark) 48%, var(--hangar-floor) 78%, #060707 100%); }
.viewer:active { cursor: grabbing; }
.disc { position: absolute; left: 50%; top: 74%; width: 58%; aspect-ratio: 1; border-radius: 50%;
        transform: translate(-50%, -50%) rotateX(76deg) rotate(var(--spin, 0deg));
        background:
          radial-gradient(circle, #1A2030 0 14%, transparent 15%),
          radial-gradient(circle, transparent 0 60%, rgba(255, 255, 255, .5) 61% 62%, transparent 63%),
          repeating-conic-gradient(#4E5866 0 7.5deg, #353E4A 7.5deg 15deg);
        box-shadow: 0 0 0 12px var(--ring), 0 0 0 15px #6E5520, 0 40px 60px rgba(0, 0, 0, .7); }
.car { position: absolute; left: 50%; bottom: 23%; width: 44%; translate: -50% 0; overflow: visible; }
.viewer-tag { position: absolute; left: 12px; bottom: 10px; font: 600 13px/1 var(--display); letter-spacing: .06em;
              text-transform: uppercase; color: var(--light); background: rgba(2, 7, 10, .7); padding: 6px 8px; border-radius: 2px; }
.viewer-side { position: absolute; right: 12px; top: 12px; }
/* the WebGPU viewer's frame (site.js), shown once drawn; it covers the box as the stand-in's backdrop does */
.viewer canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.viewer.live canvas { opacity: 1; }
.viewer.live .disc, .viewer.live .car { display: none; }

/* RLCS events strip */
/* a quarter of the row at most, so one or two events keep the mockup's card size */
.events { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, calc((100% - 42px) / 4)); gap: 14px; overflow-x: auto;
          scroll-snap-type: x mandatory; padding-bottom: 8px; }
.event-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.ecard { display: grid; gap: 10px; padding: 16px; scroll-snap-align: start; transition: border-color .2s; }
.ecard:hover { border-color: var(--hi); }
.ecard h3 { margin: 0; font: 300 32px/1 var(--display); text-transform: uppercase; }
.ethumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }

/* car thumbnails (placeholders for the rendered ones) */
.thumb { display: grid; place-items: center; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 3px;
         background: radial-gradient(60% 50% at 50% 0%, rgba(214, 220, 190, .22), transparent 70%),
                     linear-gradient(180deg, var(--hangar-lit), var(--hangar-dark) 55%, #060707); }
.thumb svg { width: 100%; height: 100%; }

/* preset cards in the feed: two up on phones, as a store grid */
.presets { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) { .presets { gap: 14px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); } }
.feed-more { display: grid; justify-items: center; gap: 8px; margin-top: 20px; }
.pcard { display: block; overflow: hidden; border-radius: var(--radius); background: var(--panel);
         border: 1px solid var(--edge); transition: border-color .2s, transform .2s; }
.pcard:hover { border-color: var(--hi); transform: translateY(-2px); }
.pcard .thumb { border-radius: 0; }
.pmeta { display: grid; gap: 6px; padding: 10px 12px 12px; }
.pmeta .who { font-size: 17px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.pitems { color: var(--light); font-size: 13px; }

/* item cards: tokens.md 3.1, 110x124, quality glow at 0.4, name tinted by quality. Three up on a phone is the
   game's own card size; 12 slots fill whole rows at 3, 4 and 6. */
.cards { display: grid; gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); }   /* minmax: a long name wraps, never widens */
@media (min-width: 640px) { .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .cards { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.card { --q: var(--q-common); position: relative; aspect-ratio: 110 / 124; padding: 7px 8px 8px; display: flex;
        flex-direction: column; border-radius: 4px; transition: box-shadow .2s;
        background: radial-gradient(95% 70% at 50% 100%, color-mix(in srgb, var(--q) 40%, transparent), transparent 72%), var(--card);
        box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--q) 45%, #1A2233), 0 4px 10px rgba(0, 0, 0, .4); }
.card:hover { box-shadow: inset 0 0 0 2px var(--hi), 0 6px 14px rgba(0, 0, 0, .5); }
.card .art { flex: 1; min-height: 28px; display: grid; place-items: center; color: var(--q); opacity: .55; }
.card .art .gi { width: 54%; height: auto; max-height: 100%; aspect-ratio: 1; }
.card .name { margin-top: 4px; text-align: center; font: 13px/1.2 var(--body); color: var(--q); overflow-wrap: anywhere;
              text-shadow: 0 0 3px #000, 0 0 3px #000, 0 0 2px #000; }
.card .slot { color: var(--light); font: 600 13px/1.1 var(--display); letter-spacing: .04em; text-transform: uppercase; }
.card .paint, .card .tag { margin: 5px -8px 0; text-align: center; font: 600 12px/1.7 var(--display);
                           letter-spacing: .05em; text-transform: uppercase; }
@media (min-width: 640px) { .card { padding: 9px 10px 10px; } .card .paint, .card .tag { margin-inline: -10px; }
                            .card .name { font-size: 14px; } }
.card .tag { background: rgba(0, 0, 0, .55); color: var(--white); }
/* a title as PlayerTitleStyleManager draws it (gfx: SC methods 9744-9747 @261013): its category's colour with a
   GlowFilter (blur 10, strength 2), or at 60% alpha without one; a {Token}'s image as tall as the line, its
   BASE_LINE_Y 50 of 72 px on the baseline */
.card .name.title:not(.dim) { text-shadow: 0 0 5px var(--glow), 0 0 5px var(--glow); }
.card .name.dim { opacity: .6; }
.card .ticon { height: 1.2em; width: auto; vertical-align: -.37em; }
.card.none .art { opacity: .2; color: var(--white); }   /* noneIcon: white at alpha 51/256 (tokens.md card-none-icon) */
.q-uncommon { --q: var(--q-uncommon); } .q-rare { --q: var(--q-rare); } .q-very-rare { --q: var(--q-very-rare); }
.q-import { --q: var(--q-import); } .q-exotic { --q: var(--q-exotic); } .q-black-market { --q: var(--q-black-market); }
.q-premium { --q: var(--q-premium); } .q-limited { --q: var(--q-limited); }

/* upload result */
.facts { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 14px 0 0; }
.facts div { display: grid; }
.facts dt { color: var(--blue); font: 600 14px/1.2 var(--display); text-transform: uppercase; }
.facts dd { margin: 0; font: 500 22px/1.2 var(--display); text-transform: uppercase; }
.teams { display: grid; gap: 14px; margin-top: 14px; }
.team-head { margin: 0; padding: 12px 16px; font: 500 24px/1 var(--display); text-transform: uppercase;
             background: linear-gradient(90deg, color-mix(in srgb, var(--team) 55%, transparent), transparent 70%);
             border-radius: var(--radius) var(--radius) 0 0; }
.team.blue { --team: var(--team-blue); } .team.orange { --team: var(--team-orange); }
.prow { display: grid; grid-template-columns: auto 96px 1fr; align-items: center; gap: 12px; min-height: 76px;
        padding: 10px 16px; border-top: 1px solid rgba(255, 255, 255, .07); cursor: pointer; }
.prow:hover { background: rgba(255, 255, 255, .04); }
.prow .thumb { width: 96px; }
.pinfo { display: grid; gap: 3px; min-width: 0; }
.pinfo .who { font-size: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.prow.bot { cursor: default; color: var(--dim); }
.prow.bot .who { color: var(--dim); }
.check { appearance: none; margin: 0; width: 28px; height: 28px; display: grid; place-items: center; cursor: pointer;
         border: 2px solid var(--edge-hi); border-radius: 3px; background: var(--field); }
.check::after { content: ""; width: 12px; height: 7px; border: 3px solid transparent; border-top: 0; border-right: 0;
                transform: translate(1px, -2px) rotate(-45deg); }
.check:checked { background: var(--on); border-color: var(--on); }
.check:checked::after { border-color: var(--on-hi); }
.check:disabled { opacity: .3; cursor: default; }
.pick-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; }
.states { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.state { padding: 16px; display: grid; gap: 8px; }
.bar { height: 6px; border-radius: 3px; background: var(--off); overflow: hidden; }
.bar i { display: block; height: 100%; width: 62%; background: linear-gradient(90deg, var(--hi), var(--sky)); }
.state.err { border-color: #7A2A2A; }
.state.err .h-sub { color: #FF8C8C; }
@media (min-width: 768px) { .teams { grid-template-columns: 1fr 1fr; } .pick-bar { grid-column: 1 / -1; } }

/* preset page */
.preset-top { display: grid; gap: 16px; padding-top: 24px; }
.who-panel { padding: 20px; display: grid; gap: 14px; align-content: start; }
.who-panel .h-thin { font-size: clamp(40px, 6vw, 60px); overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: 10px 14px; }
.seen { display: grid; margin: 4px -20px 0; }   /* rows run edge to edge inside the panel's 20px padding */
.seen .h-sub { padding: 0 20px 8px; }
.seen a { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: baseline; min-height: 52px;
          padding: 8px 20px; border-top: 1px solid rgba(255, 255, 255, .07); }
.seen a:hover { background: rgba(255, 255, 255, .04); }
.seen .where { font: 600 16px/1.2 var(--body); }
.seen .when, .seen .ctx { color: var(--dim); font-size: 13px; }
.seen .ctx { grid-column: 1 / -1; }
@media (min-width: 1000px) {
  .preset-top { grid-template-columns: 2fr 1fr; }
  .preset-top > .viewer { aspect-ratio: auto; min-height: 420px; }   /* the stage fills its row: no band under it */
}

/* the garage colour pickers. Both panels share one structure: title and position, grid, finish. Side by side, the
   panels take widths in their grids' column ratio (10:15 here; ours: the real counts come from the colour sets), so
   both grids get the same swatch size and the same height. */
.pickers { display: grid; gap: 12px 14px; }
/* Each panel's fixed part (32px padding, its 9 or 14 gaps of 3px) comes off first and the rest splits 10:15, so the
   swatch pitch is equal; the panels share their rows (subgrid), so titles, grids and finish bars line up. */
@media (min-width: 640px) { .pickers { grid-template-columns: calc((100% - 147px) * .4 + 59px) 1fr; } }
.picker-panel { grid-row: span 3; display: grid; grid-template-rows: subgrid; padding: 16px; }
.picker-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.picker { display: grid; grid-template-columns: repeat(var(--cols, 10), 1fr); gap: 3px; }
.picker i { aspect-ratio: 1; border-radius: 2px; }
.picker i.sel { position: relative; z-index: 1; outline: 2px solid var(--white); outline-offset: -5px;
                box-shadow: 0 0 0 2px var(--hi); }
.pos { color: var(--blue); font: 600 17px/1.1 var(--display); text-transform: uppercase; white-space: nowrap; }
.pos b { color: var(--white); }
.finish { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 3px;
          background: rgba(2, 7, 10, .55); border: 1px solid var(--edge); }
.finish .gi { width: 20px; height: 20px; color: var(--blue); }
.finish .fname { margin-left: auto; color: var(--white); font: 14px/1.2 var(--body); }

/* player, search, event, admin */
.head-panel { padding: 22px; display: grid; gap: 10px; margin-top: 24px; }
.results { list-style: none; margin: 14px 0 0; padding: 0; }
.results a { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; min-height: 64px;
             padding: 10px 16px; border-top: 1px solid rgba(255, 255, 255, .07); }
.results li:first-child a { border-top: 0; }
.results a:hover { background: rgba(255, 255, 255, .04); }
.search-big { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.search-big .field { flex: 1 1 260px; min-height: 52px; }
.narrow { max-width: 860px; }
.teams-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); margin-top: 14px; }
.pro { display: grid; grid-template-columns: 112px 1fr; gap: 12px; align-items: center; min-height: 80px;
       padding: 10px 16px; border-top: 1px solid rgba(255, 255, 255, .07); }
.pro:hover { background: rgba(255, 255, 255, .04); }
.form { display: grid; gap: 14px; }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.form-grid > label > span:first-child { display: block; margin-bottom: 6px; color: var(--blue); font: 600 14px/1 var(--display);
                                         text-transform: uppercase; }
/* the dropdown keeps its arrow (tokens.md dropdown: the arrow sits right of the 9-slice) */
.field select { line-height: 44px; cursor: pointer; }
.field:has(select)::after { content: ""; flex: none; width: 9px; height: 9px; margin: 0 4px 4px 0; pointer-events: none;
                            border-right: 2px solid var(--blue); border-bottom: 2px solid var(--blue); transform: rotate(45deg); }
.admin-row { display: grid; grid-template-columns: 1fr; gap: 10px; padding: 12px 16px; border-top: 1px solid rgba(255, 255, 255, .07); }
@media (min-width: 768px) { .admin-row { grid-template-columns: 1fr 1.2fr auto; align-items: center; } }
.signin-box { max-width: 520px; margin: 48px auto 0; padding: 28px; display: grid; gap: 16px; }

/* footer */
.foot { max-width: 1280px; margin: 0 auto; padding: 24px 16px 48px; color: var(--dim); font-size: 13px;
        border-top: 1px solid rgba(255, 255, 255, .08); }

/* the site's additions to the mockup: real thumbnails in the thumb and card slots, forms that wrap one control */
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.card .art:has(img) { opacity: 1; }
.card .art img { width: 78%; height: 100%; min-height: 0; object-fit: contain; }
/* tokens.md card-thumb: the game draws item art added (BlendMode.ADD), so its black ground drops out and the card's
   quality glow shows through; screen first for browsers without plus-lighter */
.thumb img, .card .art img { mix-blend-mode: screen; mix-blend-mode: plus-lighter; }
/* a rendered thumbnail (PLAN.md Phase 7) is the whole turntable frame: it fills the slot, drawn as it is */
.thumb img.shot { object-fit: cover; mix-blend-mode: normal; }
/* the game's own textures as icons (webcook/ui): white on alpha, tinted with the text colour as the game tints them */
.gi { display: block; flex: none; background: currentColor;
      -webkit-mask: var(--gi) center / contain no-repeat; mask: var(--gi) center / contain no-repeat; }
/* the painted label, as ProductItemRenderer.setPaintedData draws it (gfx: SC method 15814, lines 309585-309780
   @261013): a tag sized to its text (width min(textWidth + 10, textField.width + 6), height textHeight + 4),
   centred on paintedColorContainer at (55,82) of the 110x124 card (char 1612 depth 20); its background,
   TintablePaintedItemLabelBackground (image 322, 9-slice grid 323 (-1,-1)-(1,1)), tinted COLOR_MODE_ADD by the
   paint: black inside, so the paint itself, with a lighter rim. No paintedFrame: the card (char 1612) has none. */
.card .paint { position: absolute; left: 50%; top: 66.13%; transform: translate(-50%, -50%); z-index: 1;
               margin: 0; max-width: 78%; padding: 2px 5px; font-size: 11px; line-height: 1.2; letter-spacing: .02em;
               border-radius: 3px; background: var(--paint); }   /* text 1594: $HeaderFont 11, words kept whole */
.card .paint::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
                       border-image: url(/webcook/ui/TintablePaintedItemLabelBackground.png) 7 fill / 5px;
                       mix-blend-mode: plus-lighter; }
.dz-form, .actions form { display: contents; }
.state[data-reading] { padding: 0; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
