/* ============================================================================
   SKIN.CSS (b167) - the portal's own look, after the in-game mod's: square edges,
   a condensed display face on the headings, slanted accent blocks, hairline
   accents. Adam: "capture the sharper corner styling of the beamng mod in the
   portal app everywhere except the commander play table ... im tired of the
   rounded pill design" / "be comprehensive in your redesign ... give it some
   more style ... not just pure AI classic style."
   Scoped under body.menus like menus.css: the play board (no .menus) is untouched.
   No filter / backdrop-filter / will-change (the flicker kill-list, b90).
   ========================================================================== */

body.menus {
  --display: "Bahnschrift", "Segoe UI Variable Display", "Segoe UI", "DIN Alternate", "Roboto Condensed", system-ui, -apple-system, Arial, sans-serif;
  --ink: #041416;                       /* text on the accent */
  --slant: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
  --cut: polygon(0 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%);
  --hair: color-mix(in srgb, var(--accent) 55%, transparent);
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.012) 0 2px, transparent 2px 14px),
    radial-gradient(1100px 500px at 88% -12%, rgba(54, 194, 206, 0.07), transparent 60%),
    radial-gradient(900px 520px at -10% 8%, rgba(206, 106, 58, 0.04), transparent 60%),
    radial-gradient(1300px 800px at 50% 115%, rgba(22, 25, 34, 0.9), transparent 70%),
    var(--bg);
}

/* ---------- square: one rule over every older radius; the round things stay round ---------- */
body.menus *, body.menus *::before, body.menus *::after { border-radius: 0 !important; }
body.menus :is(.avatar, .avatar img, .avatar--sm, .dot, .pip, .mpip, .ci-pip, .tdot, .chartlegend__dot, .cpick__btn, .userchip__av,
  .userchip__av img, .bvote__face, .bmpmod img, .pwho__av, .dcmsg__av, .avataform__pic, .avamenu__sum, .bmpnow__state i, .podium__av,
  .podium__av img, .medal, .pregame-cmdr__av, .herolv__av, .seattoken__crown, .drvcard .avatar, .podium__drv .avatar) { border-radius: 50% !important; }

/* ---------- type: a condensed display face on the headings ---------- */
body.menus h1.page, body.menus h2, body.menus .brand, body.menus .lvl__num, body.menus .herolv__n, body.menus .rec__num,
body.menus .podium__num, body.menus .rank__name, body.menus .statsec > summary .eyebrow, body.menus .card > .eyebrow:first-child {
  font-family: var(--display); font-stretch: 88%;
}
body.menus h1.page {
  position: relative; text-transform: uppercase; letter-spacing: 0.03em; font-weight: 800; font-size: clamp(24px, 4vw, 32px);
  padding-left: 16px;
}
body.menus h1.page::before {                       /* the slanted block before every page title */
  content: ""; position: absolute; left: 0; top: 0.18em; bottom: 0.18em; width: 6px; background: var(--accent); transform: skewX(-16deg);
}
/* eyebrows over a page title: the mod's slanted accent label */
body.menus .wrap > .eyebrow:first-child, body.menus .wrap > p.eyebrow:first-of-type, body.menus .eyebrow:has(+ h1.page) {
  display: inline-block; padding: 2px 12px; margin-bottom: 8px; color: var(--ink); background: var(--accent);
  clip-path: var(--slant); letter-spacing: 0.18em; font-weight: 900;
}
body.menus .wrap > .eyebrow:first-child a, body.menus .wrap > p.eyebrow:first-of-type a, body.menus .eyebrow:has(+ h1.page) a { color: var(--ink); }
/* eyebrows heading a card or a section: a skewed tick */
body.menus .card .eyebrow, body.menus .statsec > summary .eyebrow {
  display: inline-flex; align-items: center; gap: 8px; letter-spacing: 0.16em;
}
body.menus .card .eyebrow::before, body.menus .statsec > summary .eyebrow::before {
  content: ""; flex: 0 0 auto; width: 4px; height: 12px; background: var(--accent); transform: skewX(-16deg);
}
body.menus .sub { font-size: 14.5px; }

/* ---------- top bar ---------- */
body.menus .topbar { border-bottom: 1px solid var(--border); box-shadow: 0 1px 0 rgba(54, 194, 206, 0.08), 0 10px 30px rgba(0, 0, 0, 0.35); }
body.menus .topbar::after {                        /* an accent hairline under the bar, strongest on the left */
  content: ""; display: block; height: 1px; background: linear-gradient(90deg, var(--accent), transparent 55%); opacity: 0.55;
}
body.menus .brand { letter-spacing: 0.14em; font-weight: 900; font-size: 16px; text-transform: uppercase; }
body.menus .buildstamp { font-family: var(--mono, monospace); letter-spacing: 0.04em; }
body.menus .nav a { font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; font-size: 12px; padding: 7px 10px; }
body.menus .nav a:hover { background: rgba(54, 194, 206, 0.09); }
body.menus .nav a.active { color: var(--text); background: linear-gradient(180deg, rgba(54, 194, 206, 0.0), rgba(54, 194, 206, 0.14)); }
body.menus .nav a.active::after { left: 0; right: 0; height: 2px; background: var(--accent); }

/* ---------- panels: straight boxes with an accent corner ---------- */
body.menus .card {
  position: relative;
  background:
    linear-gradient(225deg, var(--hair) 0 7px, transparent 7px) top right / 16px 16px no-repeat,
    linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 10px 26px rgba(0, 0, 0, 0.32);
}
body.menus .card::before {                         /* a short accent line along the top edge */
  content: ""; position: absolute; left: -1px; top: -1px; width: 48px; height: 2px; background: var(--accent); opacity: 0.8;
  pointer-events: none;
}
body.menus details.statsec { position: relative; }
body.menus details.statsec::before { content: ""; position: absolute; left: -1px; top: -1px; width: 48px; height: 2px; background: var(--accent); opacity: 0.8; }
body.menus .empty { border-style: dashed; }

/* ---------- buttons: square, set in caps; the main ones with a cut corner ---------- */
body.menus .btn { font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; font-size: 12.5px; }
body.menus .btn.small { font-size: 11.5px; letter-spacing: 0.07em; }
body.menus .btn--primary, body.menus .bigcta {
  clip-path: var(--cut); padding-right: 18px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 96%, #fff), color-mix(in srgb, var(--accent) 80%, #04222a));
  text-shadow: none; color: var(--ink);
}
body.menus .btn--primary.small { padding-right: 12px; }
body.menus .btn--ghost:hover, body.menus .btn:not(.btn--primary):hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); }
body.menus .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- tags and chips: square, a coloured left edge ---------- */
body.menus .tag {
  border-left: 2px solid var(--accent); padding-left: 7px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 800; font-size: 11px;
}
body.menus .tag--gold { border-left-color: var(--gold); }

/* ---------- tabs: an underline drawn in from the left ---------- */
body.menus .tabs { border-bottom: 1px solid var(--border); gap: 2px; }
body.menus .tab { position: relative; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 800; font-size: 12px; }
body.menus .tab.is-active { color: var(--text); background: linear-gradient(180deg, transparent, rgba(54, 194, 206, 0.12)); }
body.menus .tab.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent);
  transform-origin: left; animation: skin-draw 0.28s cubic-bezier(.16, .84, .24, 1) backwards;
}
@keyframes skin-draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- forms: square wells, an accent rule on focus ---------- */
body.menus input[type="text"], body.menus input[type="number"], body.menus input[type="password"], body.menus input[type="search"],
body.menus input[type="email"], body.menus select, body.menus textarea {
  background-color: rgba(8, 10, 14, 0.55); border: 1px solid var(--border); border-bottom-color: color-mix(in srgb, var(--border) 60%, #fff 8%);
}
body.menus input:focus, body.menus select:focus, body.menus textarea:focus {
  border-color: color-mix(in srgb, var(--accent) 70%, var(--border)); box-shadow: inset 0 -2px 0 var(--accent);
}
body.menus .fld { text-transform: uppercase; letter-spacing: 0.12em; font-size: 11px; font-weight: 800; }

/* ---------- tables: caps headers, an accent edge on the row under the pointer ---------- */
body.menus .wins-table th { font-family: var(--display); font-stretch: 88%; text-transform: uppercase; letter-spacing: 0.12em; font-size: 11px; }
body.menus .wins-table tbody tr { transition: background 0.12s; }
body.menus .wins-table tbody tr:hover { background: linear-gradient(90deg, rgba(54, 194, 206, 0.10), transparent 70%); box-shadow: inset 2px 0 0 var(--accent); }

/* ---------- banners: a thick edge, no bubble ---------- */
body.menus .banner { border-left: 4px solid var(--accent); }
body.menus .banner--gold { border-left-color: var(--gold); }

/* ---------- the stats' records and the level cards: a slanted top accent ---------- */
body.menus .rec::before { left: 0; right: auto; width: 64px; height: 3px; opacity: 1; background: var(--accent); transform: skewX(-24deg); transform-origin: left; }
body.menus .lvl { position: relative; }
body.menus .lvl::before { content: ""; position: absolute; left: -1px; top: -1px; width: 40px; height: 3px; background: var(--accent); }
body.menus .lvl--magic::before { background: #b58cff; }
body.menus .lvl--beam::before { background: var(--accent-2, #ce6a3a); }
body.menus .lvl__bar, body.menus .herolv__bar, body.menus .statbar { overflow: hidden; }
body.menus .lvl__bar span, body.menus .herolv__bar i, body.menus .statbar__fill {
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0 4px, transparent 4px 9px),
              linear-gradient(90deg, color-mix(in srgb, var(--accent) 55%, #000), var(--accent));
}
body.menus .lvl--magic .lvl__bar span, body.menus .herolv__it--magic .herolv__bar i {
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0 4px, transparent 4px 9px), linear-gradient(90deg, #5b3fa0, #b58cff);
}
body.menus .lvl--beam .lvl__bar span, body.menus .herolv__it--beam .herolv__bar i {
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0 4px, transparent 4px 9px), linear-gradient(90deg, #7a3a1c, var(--accent-2, #ce6a3a));
}
body.menus .lvl--overall .lvl__bar span, body.menus .herolv__it--overall .herolv__bar i {
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0 4px, transparent 4px 9px), linear-gradient(90deg, #8a6a1e, var(--gold));
}

/* ---------- motion: calm, compositor-only; respect the OS setting ---------- */
@media (prefers-reduced-motion: reduce) {
  body.menus *, body.menus *::before, body.menus *::after { animation: none !important; transition: none !important; }
}

/* ============================== b168: pass 2 - the pages ============================== */
/* page heads: a hatch block off the top-right of the content column (decoration only) */
body.menus .wrap { position: relative; }
body.menus h1.page::after {
  content: ""; position: absolute; right: 0; top: -6px; width: min(38%, 340px); height: 64px; pointer-events: none; opacity: 0.55;
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--accent) 30%, transparent) 0 2px, transparent 2px 10px);
  clip-path: polygon(22% 0, 100% 0, 100% 100%, 0 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 60%); mask-image: linear-gradient(90deg, transparent, #000 60%);
}
/* a section label standing on its own in the page (GAMES, RECENT EVENTS...): the skewed tick */
body.menus .wrap > .eyebrow:not(:first-child):not(:has(+ h1.page)), body.menus .row > .eyebrow, body.menus .row > p.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; letter-spacing: 0.16em; font-family: var(--display); font-stretch: 88%;
}
body.menus .wrap > .eyebrow:not(:first-child):not(:has(+ h1.page))::before, body.menus .row > .eyebrow::before, body.menus .row > p.eyebrow::before {
  content: ""; width: 4px; height: 12px; background: var(--accent); transform: skewX(-16deg);
}

/* list rows (saved games, the roster, sessions): an accent edge and a little push on hover */
body.menus :is(.saved, .cmdrrow, .seatlist > a, .rosterrow) { transition: border-color 0.12s, background 0.12s, transform 0.12s; }
body.menus :is(.saved, .cmdrrow):hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); box-shadow: inset 3px 0 0 var(--accent); }
body.menus a.card:hover, body.menus a.saved:hover { transform: translateX(2px); }
body.menus a.card { transition: transform 0.12s, border-color 0.12s; }
body.menus a.card:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }

/* the level / count chips (Lv 3, the roster's tallies, the session's numbers): stamped, square */
body.menus .tag, body.menus .chip { box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.35); }

/* the podium: bevelled step tops, a sheen down the face */
body.menus .podium__step { clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%, 0 10px); border-width: 0;
  box-shadow: inset 0 2px 0 color-mix(in srgb, var(--podium-c) 70%, transparent); }
body.menus .podium__num { font-family: var(--display); font-stretch: 88%; font-size: 36px; }

/* the night's highlight tiles and the record cards: square tiles with a top accent */
body.menus .nighthi__it { position: relative; border: 1px solid var(--border); background: rgba(8, 10, 14, 0.35); }
body.menus .nighthi__it::before { content: ""; position: absolute; left: -1px; top: -1px; width: 28px; height: 2px; background: var(--gold); }
body.menus .nighthi__l, body.menus .rec__lbl { font-family: var(--display); font-stretch: 88%; letter-spacing: 0.12em; }

/* scrollbars and selection */
body.menus ::-webkit-scrollbar { width: 10px; height: 10px; }
body.menus ::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.02); }
body.menus ::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--accent) 35%, var(--surface-2)); }
body.menus * { scrollbar-color: color-mix(in srgb, var(--accent) 35%, var(--surface-2)) transparent; scrollbar-width: thin; }
body.menus ::selection { background: color-mix(in srgb, var(--accent) 45%, transparent); color: #fff; }

/* details / disclosure: a square chevron */
body.menus details > summary { cursor: pointer; }
body.menus details.statsec > summary::after { content: "+"; margin-left: auto; font-family: var(--display); font-weight: 900; color: var(--accent); }
body.menus details.statsec[open] > summary::after { content: "–"; }

/* the sign-in pages (b168: they carry body.menus.authpage now) */
body.authpage .login-card {
  position: relative; border: 1px solid var(--border); padding: 30px 30px 24px;
  background: linear-gradient(225deg, var(--hair) 0 9px, transparent 9px) top right / 20px 20px no-repeat, linear-gradient(180deg, var(--surface-2), var(--surface));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}
body.authpage .login-card::before { content: ""; position: absolute; left: -1px; top: -1px; width: 72px; height: 3px; background: var(--accent); }
body.authpage .login-card .brand { display: block; font-family: var(--display); font-stretch: 88%; font-size: 19px; letter-spacing: 0.07em; text-transform: uppercase; font-weight: 900; }
body.authpage .login-card .btn { font-size: 14px; letter-spacing: 0.1em; }
body.authpage .login-shell::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; opacity: 0.6;
  background: repeating-linear-gradient(135deg, rgba(54, 194, 206, 0.05) 0 2px, transparent 2px 16px);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, transparent 25%, #000 75%); mask-image: radial-gradient(circle at 50% 50%, transparent 25%, #000 75%);
}
