/* Star Trek: The Card Game site theme "Beam Down": a painted alien world under a 1960s sky (startrekfleer-planet.webp)
   fixed behind the page, a slowly drifting starfield, the table's navy console plates with a gold rim and a coloured
   end cap, the three ratings' colours (combat red, humanity gold, logic blue) as the header's rule, condensed italic
   capitals like the cards' "CORE CREW" headings, gold rating-pill buttons, and a transporter pad whose golden shimmer
   rises behind Spock, Kirk and Scotty. It re-skins the lobby, cards, decks, shop and pass pages through the shell's
   custom properties plus overrides, and skips any page hosting a match board (.arena-app) so the table keeps the
   plugin's own look. */
@font-face { font-family: 'Beam Down Condensed'; src: url('/playtests/theme-barlow-condensed-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Beam Down Condensed'; src: url('/playtests/theme-barlow-condensed-700.woff2') format('woff2'); font-weight: 600 900; font-display: swap; }

body[data-site-theme="beam-down"]:not(:has(.arena-app)) {
  --bd-ink: #f1ecd9;
  --bd-soft: #d4d6e0;
  --bd-muted: #a9b2c4;
  --bd-gold: #e5b940;
  --bd-gold-hi: #ffd96a;
  --bd-gold-dim: #8a6d22;
  --bd-blue: #4a9be8;
  --bd-red: #d4533a;
  --bd-night: #080b18;
  --bd-line: #2a3552;
  --bd-edge: #3a4a72;
  --bd-panel: linear-gradient(150deg, #151d33ed, #0e1424e6 70%);
  --bd-panel-solid: #0f1526f5;
  --bd-panel2: #151d33e6;
  --bd-cond: 'Beam Down Condensed', 'Arial Narrow', 'Segoe UI', sans-serif;
  --bd-sans: 'Segoe UI', 'Helvetica Neue', system-ui, sans-serif;
  --bd-ratings: linear-gradient(90deg, #d4533a 0 33.33%, #e5b940 0 66.66%, #4a9be8 0);
  --bd-plate: inset 0 0 18px #000a, inset 0 1px 0 #ffffff14, 0 8px 24px #000b;
  --bd-cap: 4px 16px 4px 16px;
  --bg: transparent;
  --panel: var(--bd-panel-solid);
  --panel2: var(--bd-panel2);
  --line: var(--bd-line);
  --muted: var(--bd-muted);
  --teal: var(--bd-gold);
  --teal-dark: var(--bd-panel2);
  --amber: var(--bd-red);
  --site-bg: transparent;
  --site-panel: var(--bd-panel-solid);
  --site-border: var(--bd-edge);
  --site-accent: var(--bd-gold);
  --site-muted: var(--bd-muted);
  --site-text: var(--bd-ink);
  color: var(--bd-ink);
  font-family: var(--bd-sans);
  background: var(--bd-night);
  min-height: 100vh;
  isolation: isolate;

  /* The planet: the painting under a night-blue veil, darkest at the top and on the left where text sits. */
  &:before {
    content: ''; position: fixed; inset: 0; z-index: -2; pointer-events: none;
    background:
      linear-gradient(180deg, #080b18f2 0, #080b18a6 96px, #080b1833 36%, #080b1840 64%, #080b18f0 100%),
      linear-gradient(90deg, #080b18cc 0, #080b1859 44%, transparent 72%),
      url('/playtests/startrekfleer-planet.webp') 62% 40% / cover no-repeat,
      linear-gradient(180deg, #0c1024, #2a1236 60%, #080b18);
  }
  /* Stars: small points over the sky that drift slowly sideways, as seen from orbit; only the transform animates. */
  &:after {
    content: ''; position: fixed; top: 0; bottom: 0; left: -600px; width: calc(100% + 600px); z-index: -1; pointer-events: none;
    background-image:
      radial-gradient(1.5px 1.5px at 7% 12%, #fff, transparent), radial-gradient(1px 1px at 21% 31%, #ffe7b0, transparent),
      radial-gradient(1px 1px at 36% 8%, #cfe4ff, transparent), radial-gradient(2px 2px at 52% 22%, #fff, transparent),
      radial-gradient(1px 1px at 67% 39%, #fff, transparent), radial-gradient(1.5px 1.5px at 81% 15%, #ffd2c4, transparent),
      radial-gradient(1px 1px at 93% 33%, #e9f2ff, transparent);
    background-size: 600px 420px;
    mask-image: linear-gradient(#000 0, #000 30%, transparent 62%);
    opacity: .75; will-change: transform; animation: bd-drift 150s linear infinite;
  }

  & :is(h1, h2, h3, .brand, .eyebrow, .little-label, .pass-stamp, .hero-tag) { font-family: var(--bd-cond); }
  & :is(h1, h2) { font-weight: 800; font-style: italic; text-transform: uppercase; letter-spacing: .04em; color: var(--bd-ink); text-shadow: 0 2px 0 #000, 0 0 18px #080b18; }
  & h2 { color: var(--bd-gold); }
  & h3 { font-weight: 700; letter-spacing: .02em; }
  & :is(.eyebrow, .little-label, .pass-stamp, .hero-tag) { color: var(--bd-blue); font-weight: 700; letter-spacing: .28em; text-transform: uppercase; }
  & .status-dot { background: var(--bd-gold); box-shadow: 0 0 8px var(--bd-gold); }
  & :is(.discovery-intro p, .hero-copy > p, .pass-trail-heading small, .discovery-panel p) { color: var(--bd-soft); }
  & a:focus-visible { outline: 2px solid var(--bd-gold-hi); outline-offset: 3px; }

  /* Header: a console band ruled underneath by the three ratings' colours; the game name in condensed gold capitals. */
  & .site-header { position: relative; background: linear-gradient(#0a0e1ef7, #111830eb); border-bottom: 0; box-shadow: 0 10px 26px #000a; backdrop-filter: blur(8px); }
  & .site-header:after { content: ''; position: absolute; left: 0; right: 0; bottom: -3px; height: 3px; background: var(--bd-ratings); box-shadow: 0 0 12px #e5b94044; pointer-events: none; }
  & .site-header .hub-link { color: var(--bd-muted); }
  & .site-header .hub-link:hover { color: var(--bd-gold); }
  & .game-brand > span {
    font-family: var(--bd-cond); font-weight: 800; font-style: italic; text-transform: uppercase; letter-spacing: .08em; white-space: nowrap;
    color: var(--bd-gold); text-shadow: 0 0 12px #e5b94055;
  }
  & .game-brand .brand-sub { color: var(--bd-blue); font-style: normal; letter-spacing: .3em; text-shadow: none; }
  & .brand, & .session-chip strong { color: var(--bd-ink); }
  & .brand small, & .session-chip small { color: var(--bd-muted); }
  & .site-header nav a { white-space: nowrap; color: var(--bd-soft); font-family: var(--bd-cond); font-size: 15px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
  & .site-header nav a:hover, & .site-header nav a.active { color: var(--bd-gold); }
  & .site-header nav a.active:after { background: var(--bd-gold); box-shadow: 0 0 10px #e5b940cc; }
  & .site-header nav a.play-open { color: var(--bd-blue); }
  & .server-signin { color: var(--bd-gold); font-weight: 700; }
  & .avatar { background: linear-gradient(160deg, #2a3f70, #0e1424); color: var(--bd-ink); border: 1px solid var(--bd-gold); }
  @media (max-width: 1180px) {
    & .site-header { flex-wrap: wrap; height: auto; gap: 0 16px; padding-top: 12px; }
    & .site-header nav { order: 3; width: 100%; height: 46px; gap: 22px; overflow-x: auto; scrollbar-width: none; }
  }

  /* Panels: the table's console plates, a gold rim with a thick end cap on the left and clipped corners. */
  & :is(.hero, .quests-panel, .battle-pass, .saved-deck-shelf, .product-card, .pass-tier, .pass-trail-card,
        .discovery-panel, .modal, .history-pack, .lobby-loading-reserve, .empty, .deck-builder, .card-artwork,
        .card-rules, .card-set-panel, .pass-spotlight, .first-run) {
    background: var(--bd-panel);
    border: 1px solid var(--bd-gold-dim);
    border-left: 6px solid var(--bd-gold);
    border-radius: var(--bd-cap);
    box-shadow: var(--bd-plate);
    color: var(--bd-ink);
  }
  & .modal { background: var(--bd-panel-solid); }
  & :is(.quests-panel, .battle-pass, .saved-deck-shelf, .product-card, .discovery-panel, .deck-builder, .card-rules, .empty) { backdrop-filter: blur(6px); }
  /* The quests take the logic blue cap and the pass the combat red one, like the table's zones. */
  & :is(.quests-panel, .card-rules) { border-left-color: var(--bd-blue); }
  & :is(.battle-pass, .pass-spotlight) { border-left-color: var(--bd-red); }
  & :is(.quest-row, .pass-summary-reward, .saved-deck-tile, .card-details > div) { background: var(--bd-panel2); border-color: var(--bd-line); border-radius: 3px 10px 3px 10px; }
  & .card-details { background: var(--bd-line); border-color: var(--bd-line); border-radius: 3px 10px 3px 10px; }
  & .card-details :is(dt, dd) { color: inherit; }
  & .card-details dt { color: var(--bd-gold); font-family: var(--bd-cond); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
  & .saved-deck-tile.selected { border-color: var(--bd-gold); box-shadow: 0 0 0 1px var(--bd-gold), 0 0 16px #e5b94055; }
  & :is(.builder-sections h3, .deck-card-row, .card-title, .summary-list li) { border-color: var(--bd-line); }
  & :is(.builder-sections h3, .deck-name-field, .deck-card-name) { color: inherit; }
  & .quantity button { background: var(--bd-panel2); color: inherit; border: 1px solid var(--bd-edge); border-radius: 999px; }
  & .quantity button:hover:not(:disabled) { border-color: var(--bd-gold); color: var(--bd-gold); }
  & :is(.builder-sections h3 span, .quest-reward, .quest-reward span, .product-price, .card-set-label a, .card-set-panel a, .owned-pack-action strong) { color: var(--bd-gold); }
  & :is(.pass-equipped img, .pass-avatar img) { border-color: var(--bd-gold); }
  & .pass-tier.is-earned { border-color: var(--bd-gold); background: #e5b9401f; }
  & .pass-tier.is-milestone { border-color: var(--bd-blue); }
  & .first-run h2 { color: var(--bd-gold); }
  & .quest-bar { background: #05070f; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--bd-line); }
  & .quest-bar > span { background: linear-gradient(90deg, var(--bd-gold-dim), var(--bd-gold), var(--bd-gold-hi)); box-shadow: 0 0 10px #e5b94088; border-radius: 999px; }

  /* Play page: the hero opens onto the planet. A transporter pad glows under the cards and a column of golden
     sparkles rises through them, as the Landing Party beams down. */
  & .hero { background: linear-gradient(100deg, #0a0e1ee6 0%, #0a0e1e8c 44%, #0a0e1e14 100%); border-color: #8a6d2266; backdrop-filter: none; }
  & .hero:after { display: none; }
  & .hero h1 {
    font-size: clamp(42px, 4.6vw, 66px); line-height: .98; letter-spacing: .02em;
    background: linear-gradient(180deg, #fff6d8 0%, #ffd96a 40%, #e5b940 62%, #b07a1c 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none;
    filter: drop-shadow(0 3px 0 #000) drop-shadow(0 0 18px #e5b94044);
  }
  & .hero-copy > p { font-size: 16px; color: var(--bd-soft); }
  & .hero-visual:before { display: none; }
  & .orbital-ring.r1 {
    width: 380px; height: 96px; transform: none; translate: 0 150px; border: 0; border-radius: 50%;
    background: radial-gradient(ellipse at 50% 50%, #fff6d8 0 6%, #ffd96acc 18%, #e5b94066 42%, transparent 70%);
    box-shadow: 0 0 60px 10px #e5b94033; /* steady: animating big blurs flickers */
  }
  & .orbital-ring.r2 {
    width: 380px; height: 420px; transform: none; translate: 0 -40px; border: 0; border-radius: 0; overflow: hidden;
    -webkit-mask: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent), linear-gradient(transparent, #000 25%, #000 80%, transparent);
    -webkit-mask-composite: source-in;
    mask: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent), linear-gradient(transparent, #000 25%, #000 80%, transparent);
    mask-composite: intersect;
  }
  & .orbital-ring.r2:before {
    content: ''; position: absolute; left: 0; right: 0; top: 0; height: 200%;
    background-image:
      radial-gradient(1.5px 1.5px at 12% 14%, #fff8, transparent), radial-gradient(2px 2px at 30% 52%, #ffd96a, transparent),
      radial-gradient(1px 1px at 44% 26%, #fff, transparent), radial-gradient(2px 2px at 58% 78%, #ffe9a8, transparent),
      radial-gradient(1.5px 1.5px at 71% 38%, #fff, transparent), radial-gradient(1px 1px at 86% 64%, #ffd96a, transparent),
      radial-gradient(2px 2px at 20% 90%, #fff6d8, transparent), radial-gradient(1px 1px at 64% 6%, #fff, transparent);
    background-size: 190px 140px;
    will-change: transform; animation: bd-shimmer 9s linear infinite;
  }
  & .card-art { border-radius: 10px; border-color: var(--bd-gold-dim); background: #0e1424; }
  & .fan-card { border: 2px solid #f1ecd9; border-radius: 10px; box-shadow: 0 0 0 1px #000, 0 0 26px #e5b94040, 0 22px 40px #000c; }
  & .fan-0 { box-shadow: 0 0 0 1px #000, 0 0 22px #4a9be855, 0 22px 40px #000c; }
  & .fan-2 { box-shadow: 0 0 0 1px #000, 0 0 22px #d4533a55, 0 22px 40px #000c; }
  & .lobby .hero-visual .card-fan { transform: scale(.8); }
  @media (max-width: 760px) { & .lobby .hero-visual .card-fan { transform: scale(.6); } }
  & :is(.lobby .quests-panel, .lobby .battle-pass, .lobby .lobby-loading-reserve, .lobby .empty, .lobby .discovery-panel) { background: linear-gradient(150deg, #151d33d9, #0a0e1ee0 70%); }
  & .lobby :is(.quest-row, .pass-summary-reward) { background: #111830d9; }
  & :is(.lobby-row, .match-row) { background: linear-gradient(90deg, #151d33eb, #0e1424d9); border-color: var(--bd-line); border-left: 4px solid var(--bd-blue); border-radius: 3px 10px 3px 10px; }
  & .match-symbol { background: #0e1424; border-color: var(--bd-gold-dim); color: var(--bd-gold); }

  /* Buttons and chips: the cards' gold rating pill for the main call to action, a navy console key for the rest. */
  & :is(.primary, .discovery-button) {
    background: linear-gradient(180deg, #ffe9a0 0%, #ffd96a 28%, #e5b940 64%, #b8871e 100%);
    border: 1px solid #fff0c0; color: #10162a; border-radius: 999px;
    font-family: var(--bd-cond); font-size: 15px; font-weight: 800; font-style: italic; letter-spacing: .08em; text-transform: uppercase;
    box-shadow: inset 0 -3px 0 #8a6d22, inset 0 2px 0 #ffffffaa, 0 3px 0 #000, 0 8px 22px #e5b94040;
  }
  & :is(.primary, .discovery-button):hover:not(:disabled) { background: linear-gradient(180deg, #fff3c8 0%, #ffe28a 28%, #f0c650 64%, #c8952a 100%); box-shadow: inset 0 -3px 0 #8a6d22, inset 0 2px 0 #ffffffcc, 0 3px 0 #000, 0 8px 28px #ffd96a77; }
  & .secondary {
    background: linear-gradient(180deg, #1d2a4ae6, #121a33e6); border: 1px solid var(--bd-edge); border-left: 4px solid var(--bd-blue); color: var(--bd-ink);
    border-radius: 3px 999px 999px 3px; font-family: var(--bd-cond); font-size: 14px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    box-shadow: inset 0 1px 0 #ffffff22, 0 3px 0 #000, 0 6px 16px #0008;
  }
  & .secondary:hover:not(:disabled) { border-color: var(--bd-gold); color: var(--bd-gold); box-shadow: inset 0 1px 0 #ffffff22, 0 3px 0 #000, 0 0 18px #e5b94044; }
  & :is(.text-button, .card-set-action) { color: var(--bd-gold); font-weight: 700; }
  & :is(.count-badge, .tag) { background: var(--bd-red); color: #fff; border-radius: 999px; }
  & .credits-chip { background: #0a0e1ecc; color: var(--bd-gold); border: 1px solid var(--bd-gold); border-radius: 999px; font-weight: 700; }
  & .open-badge { background: var(--bd-red); color: #fff; }

  /* Dialogs: deck choice, difficulty and game options. */
  & .deck-option { background: #111830cc; border-color: var(--bd-line); color: var(--bd-ink); border-radius: 3px 10px 3px 10px; }
  & .deck-option:hover { border-color: var(--bd-edge); }
  & .deck-option.selected { background: linear-gradient(90deg, #2a2a1ecc, #111830cc); border-color: var(--bd-gold); box-shadow: 0 0 0 1px #e5b94044, 0 0 18px #e5b94033; }
  & .radio-mark { border-color: var(--bd-edge); }
  & .segmented { background: #0a0e1ee6; border-color: var(--bd-line); border-radius: 999px; }
  & .segmented button { color: var(--bd-muted); font-weight: 700; border-radius: 999px; }
  & .segmented button.selected { background: #1d2a4a; color: var(--bd-gold); box-shadow: inset 0 0 0 1px var(--bd-gold); }
  & :is(.icon-button, fieldset.game-options) { border-color: var(--bd-line); }
  & .icon-button:hover { border-color: var(--bd-gold); color: var(--bd-gold); }

  /* Cards, decks and search */
  & :is(input, select, .search-field, .deck-name-input) { background: #080b18e6; color: var(--bd-ink); border: 1px solid var(--bd-edge); border-radius: 3px 10px 3px 10px; }
  & :is(input, select):focus-visible { border-color: var(--bd-gold); outline: none; box-shadow: 0 0 0 1px var(--bd-gold); }
  & .search-field input { border: 0; background: transparent; box-shadow: none; }
  & input::placeholder { color: var(--bd-muted); opacity: .8; }
  & .catalog-card-copy strong { color: var(--bd-ink); font-weight: 700; }
  & .catalog-card-copy span { color: var(--bd-muted); }
  & .archive-grid img { border-radius: 8px; box-shadow: 0 0 0 1px #000, 0 10px 18px #000c; transition: transform .18s ease, box-shadow .18s ease; }
  & .archive-grid a:hover { text-decoration: none; }
  & .archive-grid a:hover img { transform: translateY(-4px); box-shadow: 0 0 0 2px var(--bd-gold), 0 0 18px #e5b94088, 0 14px 20px #000; }
  & .archive-grid :is(h2, h3) { color: var(--bd-ink); font-style: normal; text-transform: none; letter-spacing: 0; text-shadow: 0 1px 2px #000; }
  & .archive-grid a:hover :is(h2, h3) { color: var(--bd-gold); }
  & :is(.rarity-chip, .card-zoom) { background: #0a0e1ee6; border-color: var(--bd-line); color: var(--bd-ink); border-radius: 999px; }
  & .rarity-chip:hover { border-color: var(--bd-edge); }
  & :is(.rarity-chip[aria-pressed="true"], .archive-filters .rarity-chip:has(input:checked)) { background: linear-gradient(180deg, #ffd96a, #e5b940); border-color: #fff0c0; color: #10162a; font-weight: 700; }
  & .rarity-clear { color: var(--bd-gold); }
  & .card-zoom button:not(:disabled):hover { color: var(--bd-gold); }
  & :is(.catalog-status, .checkbox-label, .saved-deck-empty, .footer-dot, .card-zoom output) { color: var(--bd-muted); }
  & :is(.rarity-filter-label, .catalog-card-copy strong, .archive-grid article) { text-shadow: 0 1px 2px #000; }
  & .catalog-card-art .card-art { border-color: transparent; background: transparent; }
  & .catalog-card-art img { border-radius: 8px; box-shadow: 0 0 0 1px #000, 0 8px 14px #000c; transition: transform .18s ease, box-shadow .18s ease; }
  & .catalog-card:hover .catalog-card-art img { transform: translateY(-3px); box-shadow: 0 0 0 2px var(--bd-gold), 0 0 16px #e5b94088, 0 12px 18px #000; }
  & .detail-image { border-radius: 12px; box-shadow: 0 0 0 2px #f1ecd9, 0 0 44px #e5b94044, 0 24px 44px #000; }
  & :is(.rules-text, .card-lore) { text-shadow: 0 1px 2px #000; }
  & :is(.breadcrumbs, .pagination) a { color: var(--bd-gold); }
  & .pagination :is(a, span) { font-weight: 700; }
  & .discovery-footer { border-top: 1px solid var(--bd-line); color: var(--bd-muted); text-shadow: 0 1px 2px #000; }
}
html:has(> body[data-site-theme="beam-down"]:not(:has(.arena-app))) { background: #080b18; }
@keyframes bd-drift { to { transform: translateX(600px); } }
@keyframes bd-shimmer { to { transform: translateY(-50%); } }
:root[data-reduced-motion] body[data-site-theme="beam-down"]:after { animation: none; }
:root[data-reduced-motion] body[data-site-theme="beam-down"] .orbital-ring.r2:before { animation: none; }
