/* Harry Potter TCG site theme "Duelling Club": the table's own lakeside duelling terrace (harrypotter-lakeside.webp)
   fixed behind the page under a night-navy wash, the castle lit across the water and candle-light motes rising
   slowly through it. Panels are ink-navy inside fine aged-gold frames with a gold bead on the top edge, titles are
   set in a bookish Garamond, card rules sit on parchment like the scrolls on the cards, and buttons are aged gold.
   It re-skins the lobby, cards, decks, shop, pass, achievements and settings pages through the shell's custom
   properties plus overrides, and skips any page hosting a match board (.arena-app) so the table keeps the game's
   own look. Display type is EB Garamond. */

@font-face { font-family: 'Duelling Club Serif'; src: url('/playtests/theme-eb-garamond-500.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }

body[data-site-theme="duelling-club"]:not(:has(.arena-app)) {
  --dc-ink: #f0ecdd;
  --dc-muted: #b7bcc6;
  --dc-gold: #d3b67b;
  --dc-gold-bright: #f0d9a6;
  --dc-gold-deep: #98733d;
  --dc-accent: #e3c697;
  --dc-cool: #a9c3e6;
  --dc-hot: var(--dc-gold-bright);
  --dc-line: #3a4256;
  --dc-edge: #d3b67b80;
  --dc-solid: #111923f5;
  --dc-panel2: #182130e6;
  --dc-field: #0a0f18eb;
  --dc-wash: #d3b67b1c;
  --dc-glow: #f0d9a666;
  --dc-row: linear-gradient(90deg, #1a2436e6, #111923cc);
  --dc-chip-on: linear-gradient(180deg, #8c3a2e, #5e2119);
  --dc-chip-on-ink: #fbefd6;
  --dc-alert: #b3453a;
  --dc-bar: linear-gradient(90deg, #98733d, #f0d9a6);
  --dc-paper: linear-gradient(180deg, #f5ecd6, #e6d6b2);
  --dc-paper-ink: #2a2116;
  --dc-radius: 3px;
  --dc-radius-sm: 2px;
  --dc-display: 'Duelling Club Serif', 'Palatino Linotype', Georgia, serif;
  /* A gold bead on a panel's top edge, on a rule that fades out to both sides. */
  --dc-bead:
    radial-gradient(circle, var(--dc-gold-bright) 0 2.5px, transparent 3px) 50% -4px / 8px 8px no-repeat,
    linear-gradient(90deg, #d3b67b00, var(--dc-gold) 50%, #d3b67b00) 50% 0 / 70% 1px no-repeat;
  --dc-panel: var(--dc-bead), linear-gradient(170deg, #1a2436eb, #0d131df5);
  --dc-modal: var(--dc-bead), #111923fc;
  --dc-plate: inset 0 0 0 3px #0a0f18, inset 0 0 0 4px #d3b67b2e, 0 14px 34px #000c;
  --bg: transparent;
  --panel: var(--dc-solid);
  --panel2: var(--dc-panel2);
  --line: var(--dc-line);
  --muted: var(--dc-muted);
  --teal: var(--dc-accent);
  --teal-dark: var(--dc-panel2);
  --amber: var(--dc-hot);
  --site-bg: transparent;
  --site-panel: var(--dc-solid);
  --site-border: var(--dc-line);
  --site-accent: var(--dc-accent);
  --site-muted: var(--dc-muted);
  --site-text: var(--dc-ink);
  color: var(--dc-ink);
  background: #090d15;
  min-height: 100vh;
  isolation: isolate;

  & :is(h1, h2, h3, .brand) { font-family: var(--dc-display); }
  & .status-dot { background: var(--dc-gold); box-shadow: 0 0 8px var(--dc-gold); }
  & :is(.discovery-intro p, .hero-copy > p, .discovery-panel p) { color: var(--dc-muted); }
  & :is(a, button, summary, [tabindex]):focus-visible { outline: 2px solid var(--dc-hot); outline-offset: 3px; }
  & .brand, & .session-chip strong { color: var(--dc-ink); }
  & :is(.brand small, .brand-sub, .session-chip small) { color: var(--dc-muted); }
  & .site-header nav a { white-space: nowrap; }
  @media (min-width: 801px) {
    & .game-brand { max-width: none; }
    & .game-brand > span { white-space: nowrap; }
  }
  /* Ten sections: the nav takes its own row below the brand before it would have to wrap its labels. */
  @media (max-width: 1360px) {
    & .site-header { flex-wrap: wrap; height: auto; gap: 0 16px; padding-top: 12px; }
    & .site-header nav { order: 3; width: 100%; height: 46px; gap: 24px; overflow-x: auto; scrollbar-width: none; }
    & .brand-stack:has(.back-row) { margin-top: 16px; }
    & .site-header > .credits-chip + .session-chip { margin-left: -4px; }
  }

  /* Panels */
  & :is(.hero, .quests-panel, .battle-pass, .saved-deck-shelf, .product-card, .pass-tier,
        .discovery-panel, .modal, .history-pack, .lobby-loading-reserve, .empty, .deck-builder, .card-artwork,
        .card-rules, .card-set-panel, .achievement, .craft-panel, .trade-in, .avatar-tile) {
    background: var(--dc-panel);
    border: 1px solid var(--dc-edge);
    border-radius: var(--dc-radius);
    box-shadow: var(--dc-plate);
    color: var(--dc-ink);
  }
  & .modal { background: var(--dc-modal); }
  /* The milestone's art is the spotlight's own inline background, so only its frame changes. */
  & .pass-spotlight { border: 1px solid var(--dc-edge); border-radius: var(--dc-radius); box-shadow: var(--dc-plate); }
  & :is(.quests-panel, .battle-pass, .saved-deck-shelf, .product-card, .discovery-panel, .deck-builder, .empty, .achievement, .craft-panel) { backdrop-filter: blur(7px); }
  & :is(.quest-row, .pass-summary-reward, .saved-deck-tile, .card-details > div) { background: var(--dc-panel2); border-color: var(--dc-line); border-radius: var(--dc-radius-sm); }
  & .card-details { background: var(--dc-line); border-color: var(--dc-line); border-radius: var(--dc-radius-sm); }
  & .card-details :is(dt, dd) { color: inherit; }
  & .card-details dt { color: var(--dc-gold); font-family: var(--dc-display); letter-spacing: .06em; }
  & .saved-deck-tile.selected, & .avatar-tile.is-selected { border-color: var(--dc-hot); box-shadow: 0 0 0 1px var(--dc-hot), 0 0 16px var(--dc-glow); }
  & :is(.builder-sections h3, .deck-card-row, .card-title, .summary-list li) { border-color: var(--dc-line); }
  & :is(.builder-sections h3, .deck-name-field, .deck-card-name) { color: inherit; }
  & .quantity button { background: var(--dc-panel2); color: inherit; border: 1px solid var(--dc-line); border-radius: var(--dc-radius-sm); }
  & .quantity button:hover:not(:disabled) { border-color: var(--dc-accent); }
  & :is(.builder-sections h3 span, .quest-reward, .quest-reward span, .product-price, .owned-pack-action strong, .achievement-count) { color: var(--dc-hot); }
  & :is(.card-set-label a, .card-set-panel a) { color: var(--dc-accent); }
  & :is(.pass-equipped img, .pass-avatar img) { border-color: var(--dc-gold); }
  & .pass-tier.is-earned { border-color: var(--dc-accent); background: var(--dc-wash); }
  & .pass-tier.is-milestone { border-color: var(--dc-hot); }
  & .quest-bar { background: #0009; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--dc-line); }
  & .quest-bar > span { background: var(--dc-bar); box-shadow: 0 0 10px var(--dc-glow); border-radius: 999px; }
  & .achievement-badge { border-color: var(--dc-edge); color: var(--dc-gold); }
  & .achievement-reward { color: var(--dc-accent); }

  /* Play page */
  & .hero { backdrop-filter: none; }
  & .hero:after { display: none; }
  & .card-art { border-radius: 6px; border-color: var(--dc-line); background: var(--dc-field); }
  & .lobby :is(.quest-row, .pass-summary-reward) { background: var(--dc-panel2); }
  & :is(.lobby-row, .match-row) { background: var(--dc-row); border-color: var(--dc-line); border-radius: var(--dc-radius-sm); }
  & .match-symbol { background: var(--dc-chip-on); border-color: var(--dc-gold); color: var(--dc-chip-on-ink); }
  & :is(.text-button, .card-set-action) { color: var(--dc-accent); font-family: var(--dc-display); font-size: 1.06em; }
  & :is(.count-badge, .tag) { background: var(--dc-chip-on); color: var(--dc-chip-on-ink); border-radius: var(--dc-radius-sm); }
  & .credits-chip { background: var(--dc-field); color: var(--dc-hot); border: 1px solid var(--dc-edge); border-radius: 999px; }
  & .open-badge { background: var(--dc-alert); color: #fff; }
  & .avatar { background: var(--dc-chip-on); color: var(--dc-chip-on-ink); border: 1px solid var(--dc-edge); font-family: var(--dc-display); }

  /* Dialogs: deck choice, difficulty and game options. */
  & .deck-option { background: var(--dc-panel2); border-color: var(--dc-line); border-radius: var(--dc-radius-sm); color: var(--dc-ink); }
  & .deck-option:hover { border-color: var(--dc-edge); }
  & .deck-option.selected { background: var(--dc-wash); border-color: var(--dc-gold); box-shadow: 0 0 0 1px var(--dc-gold), 0 0 18px var(--dc-glow); }
  & .radio-mark { border-color: var(--dc-edge); }
  & .segmented { background: var(--dc-field); border-color: var(--dc-line); border-radius: var(--dc-radius-sm); }
  & .segmented button { color: var(--dc-muted); font-family: var(--dc-display); font-size: 1.06em; }
  & .segmented button.selected { background: var(--dc-chip-on); color: var(--dc-chip-on-ink); box-shadow: inset 0 0 0 1px var(--dc-gold); }
  & :is(.icon-button, fieldset.game-options) { border-color: var(--dc-line); border-radius: var(--dc-radius-sm); }
  & .icon-button:hover { border-color: var(--dc-accent); color: var(--dc-accent); }

  /* Cards, decks and search */
  & :is(input, select, .search-field, .deck-name-input) { background: var(--dc-field); color: var(--dc-ink); border: 1px solid var(--dc-line); border-radius: var(--dc-radius-sm); }
  & :is(input, select):focus-visible { border-color: var(--dc-gold); outline: none; box-shadow: 0 0 0 2px var(--dc-hot), 0 0 14px var(--dc-glow); }
  & .search-field input { border: 0; background: transparent; box-shadow: none; }
  & .search-field:focus-within { border-color: var(--dc-gold); box-shadow: 0 0 0 2px var(--dc-hot); }
  & input::placeholder { color: var(--dc-muted); opacity: .8; }
  & .catalog-card-copy strong { color: var(--dc-ink); font-family: var(--dc-display); font-size: 1.08em; }
  & .catalog-card-copy span { color: var(--dc-muted); }
  & .archive-grid img { background: var(--dc-field); border-radius: 6px; box-shadow: 0 0 0 1px #000, 0 10px 22px #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 1px var(--dc-gold), 0 0 24px var(--dc-glow), 0 16px 28px #000; }
  & .archive-grid :is(h2, h3) { color: var(--dc-ink); text-shadow: 0 1px 2px #000; }
  & .archive-grid a:hover :is(h2, h3) { color: var(--dc-accent); }
  & :is(.rarity-chip, .card-zoom) { background: var(--dc-field); border-color: var(--dc-line); border-radius: var(--dc-radius-sm); color: var(--dc-ink); }
  & .rarity-chip:hover { border-color: var(--dc-accent); }
  & :is(.rarity-chip[aria-pressed="true"], .archive-filters .rarity-chip:has(input:checked)) { background: var(--dc-chip-on); border-color: var(--dc-gold); color: var(--dc-chip-on-ink); }
  & .rarity-clear { color: var(--dc-accent); }
  & .card-zoom button:not(:disabled):hover { color: var(--dc-accent); }
  & :is(.catalog-status, .checkbox-label, .saved-deck-empty, .footer-dot, .card-zoom output) { color: var(--dc-muted); }
  & :is(.rarity-filter-label, .catalog-card-copy strong) { text-shadow: 0 1px 2px #000; }
  & .catalog-card-art img { border-radius: 6px; box-shadow: 0 0 0 1px #000, 0 10px 22px #000c; transition: transform .18s ease, box-shadow .18s ease; }
  & .catalog-card:hover .catalog-card-art img { transform: translateY(-3px); box-shadow: 0 0 0 1px var(--dc-gold), 0 0 22px var(--dc-glow), 0 14px 26px #000; }
  & .detail-image { border-radius: 10px; box-shadow: 0 0 0 1px var(--dc-edge), 0 0 40px var(--dc-glow), 0 24px 44px #000; }
  & :is(.breadcrumbs, .pagination, .card-breadcrumbs) a { color: var(--dc-accent); }
  & .pagination :is(a, span) { font-family: var(--dc-display); font-size: 1.06em; }
  & .discovery-footer { border-top: 1px solid var(--dc-line); color: var(--dc-muted); text-shadow: 0 1px 2px #000; }
  /* Rules text sits on parchment, like the scrolls the cards print it on. */
  & .card-rules {
    background: var(--dc-paper); color: var(--dc-paper-ink); border-color: var(--dc-gold-deep); backdrop-filter: none;
    box-shadow: inset 0 0 0 3px #ffffff59, inset 0 0 0 4px #98733d80, 0 14px 34px #000c;
  }
  & .card-rules :is(h2, h3, .rules-text, .card-lore) { color: inherit; text-shadow: none; }
  & .card-rules :is(.rules-text, .card-lore) { font-family: Georgia, 'Palatino Linotype', serif; }
  & .card-rules .rules-text { font-size: 16px; }
  & .card-rules .card-lore { border-top-color: #98733d80; }
  & .card-rules a { color: #6e2a1f; }

  /* Night over the lake: the castle stays lit under the header, the terrace falls into shadow. */
  &:before {
    content: ''; position: fixed; inset: 0; z-index: -2; pointer-events: none;
    background:
      linear-gradient(180deg, #090d15f0 0, #090d15a6 110px, #090d15b3 34%, #090d15e0 66%, #070a11fa 100%),
      url('/playtests/harrypotter-lakeside.webp') 50% 0 / cover no-repeat,
      #090d15;
  }
  /* Candle-light motes rising slowly through the night. Only the transform animates. */
  &:after {
    content: ''; position: fixed; inset: 0 0 -480px; z-index: -1; pointer-events: none;
    background-image:
      radial-gradient(2.5px 2.5px at 8% 82%, #ffe2a0, transparent), radial-gradient(2px 2px at 23% 36%, #f0d9a6, transparent),
      radial-gradient(3px 3px at 41% 64%, #ffcf7a, transparent), radial-gradient(2px 2px at 57% 18%, #fff0c8, transparent),
      radial-gradient(2.5px 2.5px at 74% 71%, #ffd890, transparent), radial-gradient(2px 2px at 91% 42%, #f0d9a6, transparent);
    background-size: 480px 480px;
    opacity: .5; will-change: transform; animation: dc-motes 60s linear infinite;
  }

  & :is(h1, h2, h3) { font-weight: 500; letter-spacing: .01em; }
  & :is(h1, h2) { text-shadow: 0 2px 2px #000, 0 0 22px #000; }
  & h1 { color: var(--dc-gold-bright); }
  & h2 { color: var(--dc-ink); }
  & :is(.eyebrow, .little-label, .pass-stamp, .hero-tag, .overline) { color: var(--dc-gold); letter-spacing: .24em; text-transform: uppercase; text-shadow: 0 1px 2px #000, 0 0 10px #000; }
  & :is(.discovery-intro p, .catalog-status, .checkbox-label) { color: var(--dc-ink); text-shadow: 0 1px 3px #000, 0 0 12px #000; }

  /* Header: night navy under a fine gold rule. */
  & .site-header { background: linear-gradient(#090d15f7, #111923eb); border-bottom: 1px solid #d3b67b59; box-shadow: 0 10px 24px #000a; backdrop-filter: blur(8px); }
  & .site-header .hub-link { color: var(--dc-muted); font-family: var(--dc-display); font-size: 15px; letter-spacing: .06em; }
  & .site-header .hub-link:hover { color: var(--dc-gold-bright); }
  & .game-brand { font-family: var(--dc-display); font-size: 25px; font-weight: 500; letter-spacing: .02em; }
  & .game-brand > span { color: var(--dc-gold-bright); text-shadow: 0 0 14px #f0d9a633, 0 2px 2px #000; }
  & .game-brand .brand-sub { color: var(--dc-muted); }
  @media (max-width: 800px) {
    & .game-brand { font-size: 20px; line-height: 1.1; max-width: none; }
    & .game-brand > span { white-space: nowrap; }
    & .game-brand .brand-sub { font-size: 13px; }
  }
  & .site-header nav a { color: #d8d4c8; font-family: var(--dc-display); font-size: 17px; letter-spacing: .02em; }
  & .site-header nav a:hover, & .site-header nav a.active { color: var(--dc-gold-bright); }
  & .site-header nav a.active:after { height: 1px; background: linear-gradient(90deg, transparent, var(--dc-gold-bright), transparent); box-shadow: 0 0 10px #f0d9a6b3; }
  & .site-header nav a.play-open { color: var(--dc-accent); }
  & .server-signin { color: var(--dc-gold-bright); font-family: var(--dc-display); font-size: 16px; letter-spacing: .04em; }

  /* Play page: the hero opens onto the lake; the title is set large in gold like the old club's. */
  & .hero { background: var(--dc-bead), linear-gradient(100deg, #090d15eb 0%, #090d1599 50%, #090d1526 100%); }
  & .hero h1 { font-size: clamp(36px, 4.4vw, 62px); font-weight: 500; line-height: 1.04; letter-spacing: 0; color: var(--dc-gold-bright); text-shadow: 0 3px 20px #000, 0 2px 2px #000; }
  & .hero-copy > p { font: italic 18px/1.5 Georgia, 'Palatino Linotype', serif; color: #e6dcc6; }
  /* A fine gold ring behind the cards, with a warm halo like torchlight. */
  & .hero-visual:before { display: none; }
  & .orbital-ring.r1 { border: 1px solid #d3b67b99; box-shadow: 0 0 0 6px #d3b67b14, inset 0 0 30px #f0d9a61f; }
  & .orbital-ring.r2 { border: 0; background: radial-gradient(circle closest-side, #ffcf7a00 50%, #ffcf7a33 70%, #f0d9a61f 80%, #ffcf7a00 100%); }
  & .fan-card { border: 1px solid var(--dc-gold); box-shadow: 0 0 0 1px #000, 0 0 28px #ffcf7a40, 0 22px 40px #000; }
  /* The hero's three characters are landscape cards (their scans are stored upright), so the fan is laid out sideways. */
  & .hero-visual .fan-card { width: 200px; aspect-ratio: 3.5 / 2.5; }
  & .hero-visual .fan-card img { position: absolute; left: 50%; top: 50%; width: 71.43%; height: 140%; max-width: none;
    object-fit: cover; transform: translate(-50%, -50%) rotate(90deg); }
  /* A staircase, each card's portrait (its right end) clear of the card in front. */
  & .hero-visual .fan-0 { left: 160px; top: 0; z-index: 1; transform: rotate(4deg); }
  & .hero-visual .fan-2 { left: 80px; top: 66px; z-index: 2; transform: rotate(-2deg); }
  & .hero-visual .fan-1 { left: -4px; top: 136px; width: 210px; z-index: 3; transform: rotate(-5deg); }

  /* Buttons: aged gold; secondary actions are gold line on navy. */
  & :is(.primary, .secondary, .discovery-button) { border-radius: 2px; font-family: var(--dc-display); font-size: 1.1em; font-weight: 600; letter-spacing: .03em; }
  & :is(.primary, .discovery-button) {
    background: linear-gradient(180deg, #f0d9a6 0%, #d3b67b 55%, #b8955a 100%); border: 1px solid #f6e2a8; color: #1c222a;
    box-shadow: inset 0 1px 0 #ffffff80, 0 0 0 1px #000, 0 0 18px #f0d9a633;
  }
  & :is(.primary, .discovery-button):hover:not(:disabled) { background: linear-gradient(180deg, #fbe9c0 0%, #e3c697 55%, #c4a265 100%); box-shadow: inset 0 1px 0 #ffffff99, 0 0 0 1px #000, 0 0 28px #f0d9a666; }
  & :is(.primary, .discovery-button):disabled { background: #2a3142; border-color: var(--dc-line); color: var(--dc-muted); box-shadow: none; }
  & .secondary { background: #111923d9; border: 1px solid var(--dc-edge); color: var(--dc-gold-bright); box-shadow: 0 0 0 1px #000; }
  & .secondary:hover:not(:disabled) { background: #d3b67b1f; border-color: var(--dc-gold-bright); color: #fff6e0; }
  & .credits-chip { border-color: var(--dc-edge); }
}
html:has(> body[data-site-theme="duelling-club"]:not(:has(.arena-app))) { background: #090d15; }
@keyframes dc-motes { to { transform: translate(30px, -480px); } }
:root[data-reduced-motion] body[data-site-theme="duelling-club"]:after { animation: none; }
