/* =====================================================================================================
   The Deck: nullmc.net's new design (owner-only preview until launch; see deck_lib.php).
   Mockups: claude.ai canvas JXoR3kKBiS4HBovytLtZPX (desktop s11-s19, mobile m-*).
   Every class starts with "d-" so nothing here touches the current design's style.css.
   Sections: 1 tokens  2 base  3 type  4 layout  5 buttons  6 chips/tags/tabs  7 cards + foil
             8 rarity  9 bars/meters/pips  10 forms  11 lists/tables/faq  12 shell (bar, header, menu, footer)
   ===================================================================================================== */

/* 1 ---------------------------------------------------------------- tokens */
:root {
  --d-bg: #0A0D14;        /* page */
  --d-deep: #070A10;      /* wells, footer, inputs */
  --d-face: #10141D;      /* card faces */
  --d-panel: #161C28;     /* panels */
  --d-line: #1E2533;      /* borders */
  --d-line2: #2A3345;     /* stronger borders */
  --d-tx: #e6ebf5;        /* body text */
  --d-mu: #c3cbe6;        /* muted text (4.5:1+ on panel) */
  --d-mu2: #8a93ad;       /* small labels (4.5:1 on bg) */
  --d-or: #FF7A1A;        /* NullMC orange */
  --d-or-hi: #ff9447;
  --d-on-or: #1A0B00;
  --d-bl: #38BDF8;        /* NullMC blue */
  --d-bl-hi: #7DD3FC;
  --d-on-bl: #04141F;
  --d-green: #34D399;
  --d-red: #ff6b6b;
  --d-discord: #8EA1FF;
  /* realm colours: the same as store_lib.php and the Hub selector */
  --d-fc: #FF7A1A; --d-ps: #F5B70A; --d-sb: #34D399; --d-sv: #38BDF8; --d-cr: #F472B6; --d-mg: #C084FC;
  /* rarity ladder */
  --d-common: #c3cbe6; --d-uncommon: #34D399; --d-rare: #38BDF8; --d-epic: #C084FC; --d-legendary: #F5B70A; --d-mythic: #FF7A1A;
  --d-foil: linear-gradient(135deg, var(--d-or), var(--d-bl));
  --d-display: 'Outfit', system-ui, sans-serif;
  --d-body: 'Plus Jakarta Sans', system-ui, sans-serif;
  --d-pixel: 'Press Start 2P', ui-monospace, monospace;
  --d-r: 18px;            /* panel radius */
  --d-r-sm: 12px;
  --d-wrap: 1320px;
}

/* 2 ---------------------------------------------------------------- base */
body.d-page { margin: 0; background: var(--d-bg); color: var(--d-tx); font-family: var(--d-body); font-size: 16px; line-height: 1.5;
              -webkit-font-smoothing: antialiased; }
.d-page *, .d-page *::before, .d-page *::after { box-sizing: border-box; }
.d-page a { color: var(--d-or); }
.d-page a:hover { color: #fff; }
.d-page img { max-width: 100%; }
.d-page :focus-visible { outline: 3px solid var(--d-bl); outline-offset: 2px; border-radius: 6px; }
.d-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .d-page * { transition: none !important; animation: none !important; } }

/* 3 ---------------------------------------------------------------- type */
.d-display { font-family: var(--d-display); font-weight: 900; letter-spacing: -.01em; line-height: 1; color: #fff; margin: 0; }
.d-h1 { font-size: clamp(40px, 6vw, 84px); line-height: .95; }
.d-h2 { font-size: clamp(28px, 3.4vw, 40px); }
.d-h3 { font-size: clamp(22px, 2.4vw, 28px); }
.d-pixel { font-family: var(--d-pixel); font-weight: 400; line-height: 1.5; }
.d-label { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.d-lead { font-size: 18px; line-height: 1.65; color: var(--d-mu); margin: 0; max-width: 620px; }
.d-muted { color: var(--d-mu); }
.d-small { font-size: 13px; color: var(--d-mu2); }
.d-gradient-text { display: inline-block; background: linear-gradient(90deg, var(--d-or), #FFB46B 45%, var(--d-bl)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.d-page code, .d-code { font-family: var(--d-pixel); font-size: 10px; background: var(--d-deep); border: 1px solid var(--d-line2); border-radius: 6px;
                        padding: 6px 8px; color: var(--d-bl); white-space: nowrap; }

/* 4 ---------------------------------------------------------------- layout */
.d-wrap { width: 100%; max-width: var(--d-wrap); margin: 0 auto; padding: 0 32px; } /* width: auto margins in a flex column would shrink it */
.d-main { display: flex; flex-direction: column; gap: 80px; padding: 48px 0 88px; }
.d-stack { display: flex; flex-direction: column; gap: var(--d-gap, 16px); }
.d-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--d-gap, 12px); }
.d-spread { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.d-grid { display: grid; gap: var(--d-gap, 20px); grid-template-columns: repeat(auto-fit, minmax(var(--d-min, 260px), 1fr)); }
.d-split { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.d-split > .d-split-main { flex: 999 1 640px; min-width: 0; }
.d-split > .d-split-side { flex: 1 1 300px; min-width: 280px; }
.d-hscroll { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.d-hscroll > * { flex: 0 0 auto; scroll-snap-align: start; }
.d-section-head { display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 700px) {
  .d-wrap { padding: 0 16px; }
  .d-main { gap: 48px; padding: 28px 0 56px; }
}

/* 5 ---------------------------------------------------------------- buttons */
.d-btn { font-family: var(--d-display); font-weight: 800; font-size: 17px; line-height: 1; display: inline-flex; align-items: center; justify-content: center;
         gap: 10px; min-height: 48px; padding: 14px 22px; border-radius: var(--d-r-sm); border: 0; cursor: pointer; text-decoration: none;
         background: var(--d-or); color: var(--d-on-or); transition: background .15s, border-color .15s, color .15s; }
.d-page a.d-btn { color: var(--d-on-or); }
.d-btn:hover, .d-page a.d-btn:hover { background: var(--d-or-hi); color: var(--d-on-or); }
.d-btn--lg { min-height: 56px; font-size: 19px; padding: 16px 26px; }
.d-btn--block { width: 100%; }
.d-btn--ghost, .d-page a.d-btn--ghost { background: transparent; color: var(--d-tx); border: 2px solid var(--d-line2); }
.d-btn--ghost:hover, .d-page a.d-btn--ghost:hover { background: transparent; color: #fff; border-color: var(--d-bl); }
.d-btn--blue, .d-page a.d-btn--blue { background: var(--d-bl); color: var(--d-on-bl); }
.d-btn--blue:hover, .d-page a.d-btn--blue:hover { background: var(--d-bl-hi); color: var(--d-on-bl); }
.d-btn--done, .d-page a.d-btn--done { background: var(--d-panel); color: var(--d-green); border: 1px solid var(--d-line); }
.d-btn[disabled] { opacity: .5; cursor: not-allowed; }
.d-icon-btn { width: 44px; height: 44px; border-radius: 10px; background: var(--d-panel); border: 1px solid var(--d-line2); color: #fff;
              display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.d-strike { text-decoration: line-through; opacity: .7; font-size: .85em; }

/* 6 ---------------------------------------------------------------- chips, tags, tabs */
.d-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--d-deep); border: 1px solid var(--d-line2); border-radius: 999px;
          padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--d-tx); white-space: nowrap; }
.d-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--d-green); flex: 0 0 8px; }
.d-swatch { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 10px; background: var(--d-c, var(--d-or)); }
.d-tag { display: inline-flex; align-items: center; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
         border-radius: 6px; padding: 4px 8px; background: var(--d-c, var(--d-or)); color: var(--d-bg); }
.d-tag--soft { background: var(--d-line); color: var(--d-c, var(--d-tx)); }
/* realm tabs / filter pills: aria-pressed or aria-current marks the chosen one */
.d-pill { font: inherit; font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 12px 18px;
          border-radius: var(--d-r-sm); background: var(--d-panel); color: var(--d-mu); border: 1px solid var(--d-line); cursor: pointer; text-decoration: none; }
.d-page a.d-pill { color: var(--d-mu); }
.d-pill:hover, .d-page a.d-pill:hover { color: #fff; border-color: var(--d-line2); }
.d-pill[aria-pressed="true"], .d-pill[aria-current], .d-page a.d-pill[aria-current] { background: var(--d-or); color: var(--d-on-or); border-color: var(--d-or); }
.d-pill--round { border-radius: 999px; min-height: 44px; padding: 10px 16px; font-size: 14px; }
.d-pill--blue[aria-pressed="true"], .d-pill--blue[aria-current] { background: var(--d-bl); color: var(--d-on-bl); border-color: var(--d-bl); }
.d-tabs { display: flex; flex-wrap: wrap; gap: 8px 28px; border-bottom: 1px solid var(--d-line); }
.d-tab, .d-page a.d-tab { font: inherit; font-weight: 700; font-size: 15px; background: transparent; color: var(--d-mu); border: 0; border-bottom: 3px solid transparent;
         padding: 14px 4px; min-height: 48px; cursor: pointer; text-decoration: none; }
.d-tab:hover, .d-page a.d-tab:hover { color: #fff; }
.d-tab[aria-pressed="true"], .d-tab[aria-current], .d-page a.d-tab[aria-current] { color: #fff; border-bottom-color: var(--d-or); }

/* 7 ---------------------------------------------------------------- cards and foil */
.d-panel { background: var(--d-panel); border: 1px solid var(--d-line); border-radius: var(--d-r); padding: 24px; }
.d-panel--hot { border-color: var(--d-or); }
.d-panel--top { border-top: 4px solid var(--d-c, var(--d-or)); }
/* foil: a gradient border around a dark face. Set --d-foil on the card for realm-coloured foils. */
.d-foil { display: block; border-radius: 20px; padding: 5px; background: var(--d-foil); text-decoration: none; color: inherit; }
.d-foil--plain { background: var(--d-line); }
.d-foil > .d-face { height: 100%; }
.d-face { background: var(--d-face); color: var(--d-tx); border-radius: 15px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
a.d-foil { transition: transform .2s ease; }
a.d-foil:hover { transform: translateY(-4px); color: inherit; }
/* card art: a radial glow in the card's colour with a pixel code in the middle */
.d-art { border-radius: 10px; height: var(--d-art-h, 170px); display: flex; align-items: center; justify-content: center;
         background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--d-c, var(--d-or)) 35%, transparent), var(--d-face) 72%); }
.d-art > .d-pixel { color: var(--d-c, var(--d-or)); font-size: var(--d-art-size, 30px); text-shadow: 4px 4px 0 var(--d-deep); text-align: center; }
.d-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.d-well { background: var(--d-deep); border: 1px dashed var(--d-line2); border-radius: 8px; padding: 8px 12px; }
.d-stat { background: var(--d-panel); border-radius: 10px; padding: 12px; }
.d-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.d-logo img { width: 44px; height: 44px; border-radius: 10px; }
.d-logo span { font-family: var(--d-display); font-weight: 900; font-size: 26px; color: #fff; }
.d-logo b { color: var(--d-or); font-weight: 900; }

/* 8 ---------------------------------------------------------------- rarity (set on any element: colour + --d-c) */
.d-r-common    { --d-c: var(--d-common); }
.d-r-uncommon  { --d-c: var(--d-uncommon); }
.d-r-rare      { --d-c: var(--d-rare); }
.d-r-epic      { --d-c: var(--d-epic); }
.d-r-legendary { --d-c: var(--d-legendary); }
.d-r-mythic    { --d-c: var(--d-mythic); }
.d-c { color: var(--d-c); }
/* realm colour helpers */
.d-realm-fc { --d-c: var(--d-fc); } .d-realm-ps { --d-c: var(--d-ps); } .d-realm-sb { --d-c: var(--d-sb); }
.d-realm-sv { --d-c: var(--d-sv); } .d-realm-cr { --d-c: var(--d-cr); } .d-realm-mg { --d-c: var(--d-mg); }
.d-realm-np { --d-c: var(--d-or); }
.d-foil-realm { --d-foil: linear-gradient(135deg, var(--d-c), var(--d-bl) 55%, var(--d-or)); }

/* 9 ---------------------------------------------------------------- bars, meters, pips */
.d-meter { height: 12px; border-radius: 6px; background: var(--d-line); overflow: hidden; }
.d-meter > span { display: block; height: 100%; width: var(--d-v, 0%); background: linear-gradient(90deg, var(--d-or), var(--d-bl)); }
.d-statbar { display: grid; grid-template-columns: 76px 1fr; gap: 8px; align-items: center; font-size: 12px; font-weight: 600; }
.d-statbar > .d-meter { height: 7px; }
.d-pips { display: flex; gap: 4px; }
.d-pips > span { flex: 1; height: 6px; border-radius: 3px; background: var(--d-line); }
.d-pips > span.on { background: var(--d-c, var(--d-or)); }

/* 10 --------------------------------------------------------------- forms */
.d-field { font: inherit; font-size: 15px; width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 10px;
           background: var(--d-deep); color: #fff; border: 1px solid var(--d-line2); }
.d-field::placeholder { color: var(--d-mu2); }
.d-field:focus { border-color: var(--d-bl); outline: none; }
textarea.d-field { min-height: 90px; resize: vertical; }
.d-inline-form { display: flex; flex-wrap: wrap; gap: 10px; }
.d-inline-form > .d-field { flex: 1 1 200px; width: auto; }

/* 11 --------------------------------------------------------------- lists, tables, faq */
.d-list > * { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--d-line); font-size: 15px; }
.d-list > *:last-child { border-bottom: 0; }
.d-specs { display: grid; grid-template-columns: 220px 1fr; border-top: 1px solid var(--d-line); }
.d-specs > * { padding: 14px 0; border-bottom: 1px solid var(--d-line); }
@media (max-width: 700px) { .d-specs { grid-template-columns: 1fr; } .d-specs > :nth-child(odd) { padding-bottom: 0; border-bottom: 0; } }
.d-board { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--d-line); font-size: 14px; }
/* FAQ: native <details>, so it works without JavaScript */
.d-faq { display: flex; flex-direction: column; gap: 12px; }
.d-faq details { background: var(--d-panel); border: 1px solid var(--d-line); border-radius: var(--d-r-sm); }
.d-faq summary { list-style: none; cursor: pointer; padding: 18px 20px; min-height: 56px; display: flex; justify-content: space-between; gap: 16px;
                 font-weight: 600; font-size: 16px; color: var(--d-tx); }
.d-faq summary::-webkit-details-marker { display: none; }
.d-faq summary::after { content: '+'; font-family: var(--d-display); font-weight: 900; color: var(--d-or); }
.d-faq details[open] summary::after { content: '\2212'; }
.d-faq details > div { padding: 0 20px 18px; color: var(--d-mu); line-height: 1.65; }

/* 12 --------------------------------------------------------------- shell: announcement bar, header, menu, footer */
.d-announce { background: var(--d-or); color: var(--d-on-or); }
.d-announce .d-wrap { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 16px; padding-top: 10px; padding-bottom: 10px;
                      font-size: 14px; font-weight: 700; }
.d-announce .d-pixel { background: var(--d-bg); color: var(--d-or); padding: 6px 8px; border-radius: 6px; font-size: 9px; }
.d-page .d-announce a { color: var(--d-on-or); }
.d-header { border-bottom: 1px solid var(--d-line); background: var(--d-bg); }
.d-header .d-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; padding-top: 16px; padding-bottom: 16px; }
.d-nav { display: flex; flex-wrap: wrap; gap: 8px 22px; font-weight: 600; font-size: 15px; }
.d-page .d-nav a { color: var(--d-tx); text-decoration: none; }
.d-page .d-nav a:hover { color: #fff; }
.d-page .d-nav a[aria-current] { color: var(--d-or); }
.d-header-end { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.d-menu-btn { display: none; }
/* phone: the nav folds into a menu opened by .d-menu-btn (header sets [data-open] on .d-header) */
@media (max-width: 900px) {
  .d-header .d-wrap { flex-wrap: nowrap; padding-top: 12px; padding-bottom: 12px; }
  .d-header .d-nav { display: none; }
  .d-menu-btn { display: inline-flex; }
  .d-header[data-open] .d-nav { display: flex; flex-direction: column; gap: 0; position: absolute; left: 0; right: 0; top: 100%; z-index: 60;
                                background: var(--d-bg); border-bottom: 1px solid var(--d-line); padding: 8px 16px 16px; }
  .d-header[data-open] .d-nav a { padding: 14px 4px; border-bottom: 1px solid var(--d-line); font-size: 17px; font-weight: 700; }
  .d-header { position: relative; }
  .d-logo img { width: 36px; height: 36px; }
  .d-logo span { font-size: 21px; }
  .d-header-end .d-chip-ip { display: none; }
}
.d-footer { background: var(--d-deep); border-top: 1px solid var(--d-line); padding: 48px 0 36px; }
.d-footer .d-wrap { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.d-footer-col { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.d-page .d-footer-col a { color: var(--d-mu); text-decoration: none; }
.d-page .d-footer-col a:hover { color: #fff; }
/* owner-only reminder that the preview is on */
.d-preview-flag { position: fixed; right: 16px; bottom: 16px; z-index: 90; display: flex; align-items: center; gap: 10px; background: var(--d-deep);
                  border: 1px solid var(--d-or); border-radius: 999px; padding: 8px 8px 8px 14px; font-size: 13px; font-weight: 700; color: var(--d-tx);
                  box-shadow: 0 10px 30px -10px #000; }
.d-page .d-preview-flag a { background: var(--d-panel); color: var(--d-tx); border-radius: 999px; padding: 6px 12px; text-decoration: none; }

/* 13 --------------------------------------------------------------- header extras: account menu, small button, menu-only links */
.d-btn--sm { min-height: 44px; padding: 10px 18px; font-size: 16px; }
.d-account { position: relative; }
.d-account-btn { font: inherit; display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 12px 6px 6px; border-radius: 12px;
                 background: var(--d-panel); border: 1px solid var(--d-line2); color: var(--d-tx); cursor: pointer; font-weight: 700; font-size: 14px; }
.d-account-btn:hover { border-color: var(--d-bl); }
.d-account-btn img { width: 28px; height: 28px; border-radius: 7px; image-rendering: pixelated; }
.d-account-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 70; width: 220px; padding: 6px; border-radius: 14px;
                  background: var(--d-panel); border: 1px solid var(--d-line2); box-shadow: 0 20px 40px -16px #000; display: flex; flex-direction: column; }
.d-account-menu[hidden] { display: none; }
.d-page .d-account-menu a { padding: 11px 12px; border-radius: 9px; color: var(--d-tx); text-decoration: none; font-weight: 600; font-size: 15px; }
.d-page .d-account-menu a:hover { background: var(--d-line); color: #fff; }
.d-page .d-account-menu a.d-or { color: var(--d-or); }
.d-page .d-account-menu a.d-bl { color: var(--d-bl); }
.d-page .d-account-menu a.d-discord { color: var(--d-discord); }
.d-page .d-account-menu a.d-red { color: var(--d-red); }
.d-account-menu hr { border: 0; border-top: 1px solid var(--d-line); margin: 4px 0; width: 100%; }
.d-nav-only-menu { display: none; }
@media (max-width: 900px) {
  .d-header[data-open] .d-nav .d-nav-only-menu { display: block; }
  .d-account-name, .d-header-end .d-btn--sm { display: none; }
  .d-theme-btn { display: none; }
}
@media (max-width: 380px) { .d-header-end { gap: 8px; } }

/* 14 --------------------------------------------------------------- shield from the current design's style.css
   While pages are half-converted, the new header and footer sit inside old pages that load style.css, which styles
   bare header/nav/footer/section/h1-h3. These resets have the same weight as those rules and load later, so they win;
   every d- class above still beats them. Remove this block once style.css is gone. */
:where(.d-shell) :is(header, nav, footer, section) { position: static; top: auto; z-index: auto; padding: 0; margin: 0; border: 0; background: none;
                                                     box-shadow: none; font-size: inherit; color: inherit; justify-self: auto; }
:where(.d-shell) nav a, :where(.d-shell) nav a:hover, :where(.d-shell) nav a[aria-current] {
  padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; text-transform: none; letter-spacing: normal; font-size: inherit;
  font-weight: inherit; transition: color .15s; }
:where(.d-shell) :is(h1, h2, h3) { font-family: var(--d-display); text-shadow: none; letter-spacing: -.01em; margin: 0; }
.d-shell { font-family: var(--d-body); color: var(--d-tx); line-height: 1.5; }
.d-shell .d-header { position: relative; z-index: 50; }
.d-shell .d-nav { gap: 8px 22px; }
.d-shell .d-footer { padding: 48px 0 36px; border-top: 1px solid var(--d-line); margin-top: 40px; }

/* 15 --------------------------------------------------------------- light mode (theme_head.php inverts the whole page)
   The Deck is designed dark. Inverting the shell back keeps it exactly as designed in either mode; images inside it,
   which theme_head flips a second time, are set straight again. */
html[data-theme="light"] :is(.d-shell, .d-preview-flag) { filter: invert(1) hue-rotate(180deg); }
html[data-theme="light"] .d-shell :is(img, video, canvas, picture, .no-invert) { filter: none; }
html[data-theme="light"] .d-shell * { text-shadow: none; }
/* The shell sits above the old page's own layers (light mode's filter gives it a stacking context of its own). */
.d-shell { position: relative; z-index: 100; }
/* Phones: keep the sale bar to one or two short lines. */
@media (max-width: 700px) {
  .d-announce .d-wrap { gap: 2px 10px; font-size: 13px; padding-top: 8px; padding-bottom: 8px; }
  .d-announce .d-pixel { display: none; }
}

/* 16 --------------------------------------------------------------- updates timeline */
.d-day { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 24px; }
.d-day-date { display: flex; flex-direction: column; gap: 4px; padding-top: 8px; }
@media (max-width: 760px) { .d-day { grid-template-columns: 1fr; gap: 10px; } .d-day-date { flex-direction: row; align-items: baseline; gap: 10px; } }
.d-entry { background: var(--d-face); border: 1px solid var(--d-line); border-radius: 14px; }
.d-entry[open] { border-color: color-mix(in srgb, var(--d-c, var(--d-or)) 55%, transparent); }
.d-entry > summary { list-style: none; cursor: pointer; padding: 18px 54px 18px 20px; display: flex; flex-direction: column; gap: 10px; position: relative; }
.d-entry > summary::-webkit-details-marker { display: none; }
.d-entry > summary::after { content: '+'; position: absolute; right: 20px; top: 16px; font-family: var(--d-display); font-weight: 900; font-size: 22px; color: var(--d-or); }
.d-entry[open] > summary::after { content: '\2212'; }
.d-entry-body { padding: 0 20px 18px; display: flex; flex-direction: column; gap: 14px; }
.d-entry-body > img { border-radius: 10px; max-height: 320px; object-fit: cover; }
/* post text from bbcode() */
.d-bb { color: var(--d-mu); line-height: 1.7; font-size: 15px; overflow-wrap: anywhere; }
.d-bb strong { color: #fff; }
.d-bb .bb-center { text-align: center; }
.d-bb .bb-img { border-radius: 10px; margin: 8px 0; }
.d-bb .bb-quote { margin: 8px 0; padding: 10px 14px; border-left: 3px solid var(--d-line2); background: var(--d-deep); border-radius: 0 8px 8px 0; }
.d-bb .bb-code { background: var(--d-deep); border: 1px solid var(--d-line2); border-radius: 8px; padding: 12px; overflow-x: auto; font-size: 13px; }
.d-bb .bb-spoiler summary { cursor: pointer; color: var(--d-bl); }

/* 17 --------------------------------------------------------------- homepage update cards */
.d-update-card { display: flex; flex-direction: column; background: var(--d-panel); border: 1px solid var(--d-line); border-radius: 16px; overflow: hidden;
                 text-decoration: none; color: var(--d-tx); transition: border-color .15s, transform .2s; }
.d-page a.d-update-card { color: var(--d-tx); }
.d-update-card:hover { border-color: var(--d-c, var(--d-or)); transform: translateY(-3px); }
.d-update-card .d-art { border-radius: 0; }
.d-page .d-panel a { font-weight: 600; }

/* 18 --------------------------------------------------------------- store */
.d-foil-mid { --d-foil: linear-gradient(135deg, var(--d-realm, var(--d-or)), var(--d-line)); }
.d-perks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--d-mu); }
.d-perks li { display: flex; gap: 8px; line-height: 1.4; }
.d-perks li::before { content: '\2713'; color: var(--d-green); font-weight: 800; flex: 0 0 auto; }
.d-perks--full { font-size: 15px; gap: 0; max-height: 50vh; overflow-y: auto; }
.d-perks--full li { padding: 10px 0; border-bottom: 1px solid var(--d-line); }
.d-linkbtn { font: inherit; font-size: 13px; font-weight: 700; background: none; border: 0; padding: 6px 0; min-height: 32px; color: var(--d-bl); cursor: pointer; text-align: left; }
.d-linkbtn:hover { color: #fff; }
.d-linkbtn--danger { color: var(--d-mu2); font-size: 12px; padding: 2px 0; min-height: 28px; }
.d-linkbtn--danger:hover { color: var(--d-red); }
.d-cart-rows { display: flex; flex-direction: column; }
.d-cart-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--d-line); font-size: 14px; }
.d-cart-row > div:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.d-cart-row b { color: #fff; }
.d-cart-price { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; white-space: nowrap; }
.d-cart-price s { color: var(--d-mu2); font-size: 12px; }
/* Store: recent purchases strip (heads, name, item, realm + time). */
.d-recent { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 10px; }
.d-recent-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--d-panel); border: 1px solid var(--d-line);
                 border-left: 3px solid var(--d-c, var(--d-bl)); border-radius: 12px; min-width: 0; }
.d-recent-item img { width: 40px; height: 40px; border-radius: 6px; flex: 0 0 40px; image-rendering: pixelated; }
.d-recent-item > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; font-size: 14px; }
.d-recent-item b { color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-recent-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.d-recent-what { color: var(--d-tx); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.d-recent-qty { flex: 0 0 auto; font-size: 11px; font-weight: 800; line-height: 1; padding: 3px 6px; border-radius: 6px;
                color: var(--d-c, var(--d-bl)); background: color-mix(in srgb, var(--d-c, var(--d-bl)) 16%, transparent);
                border: 1px solid color-mix(in srgb, var(--d-c, var(--d-bl)) 40%, transparent); }
.d-recent-item .d-small { display: flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; }
.d-recent-item .d-swatch { width: 8px; height: 8px; flex-basis: 8px; }
/* Wide screens: its own column left of the products (stays in view while scrolling). Narrower: a strip above them. */
.d-split > .d-split-left { flex: 1 1 100%; min-width: 0; }
@media (min-width: 1300px) {
  .d-split > .d-split-left { flex: 0 0 230px; position: sticky; top: 20px; }
  .d-split-left .d-recent { grid-template-columns: 1fr; }
}
/* Phones: one swipeable row so the products aren't pushed far down. */
@media (max-width: 699px) {
  .d-recent { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 78%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
  .d-recent-item { scroll-snap-align: start; }
}
.d-checkout-msg { margin: 8px 0 0; padding: 10px 12px; border-radius: 10px; font-size: 14px; font-weight: 600; background: rgba(255,107,107,.12); color: var(--d-red); border: 1px solid rgba(255,107,107,.35); }
.d-checkout-msg.ok { background: rgba(56,189,248,.12); color: var(--d-bl-hi); border-color: rgba(56,189,248,.35); }
#paypal-button-container { min-height: 0; margin-top: 12px; color-scheme: light; }
#paypal-button-container[hidden] { display: none; }
.d-dialog { background: var(--d-panel); color: var(--d-tx); border: 1px solid var(--d-line2); border-radius: var(--d-r); padding: 28px; width: min(560px, calc(100vw - 32px));
            box-shadow: 0 30px 60px -20px #000; }
.d-dialog::backdrop { background: rgba(5, 7, 12, .75); }
/* Phones: a bar at the bottom jumps to the cart once it holds something. */
.d-hand-bar { display: none; }
@media (max-width: 900px) {
  .d-hand-bar:not([hidden]) { display: flex; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 80; align-items: center; justify-content: space-between;
                              gap: 12px; padding: 10px 10px 10px 16px; border-radius: 14px; background: var(--d-deep); border: 1px solid var(--d-line2);
                              box-shadow: 0 16px 30px -12px #000; text-decoration: none; color: #fff; font-weight: 700; }
  .d-page a.d-hand-bar { color: #fff; }
  body.d-page:has(.d-hand-bar:not([hidden])) .d-preview-flag { bottom: 84px; }
}
@media (min-width: 1100px) { .d-hand { position: sticky; top: 20px; } }
.d-page a.d-pill--blue[aria-current], .d-page a.d-pill--blue[aria-pressed="true"] { background: var(--d-bl); color: var(--d-on-bl); border-color: var(--d-bl); }

/* 19 --------------------------------------------------------------- Null Pass track and leaderboard */
.d-track-wrap { display: flex; gap: 14px; align-items: stretch; }
.d-track-labels { flex: 0 0 74px; display: flex; flex-direction: column; gap: 8px; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.d-track-labels span { height: 112px; display: flex; align-items: center; }
.d-track-labels span + span { height: 78px; }
.d-track { flex: 1 1 auto; min-width: 0; gap: 10px; padding-bottom: 12px; }
.d-tier { width: 128px; display: flex; flex-direction: column; gap: 8px; }
.d-tier[hidden] { display: none; }
.d-slot { height: 112px; border-radius: 12px; padding: 10px; display: flex; flex-direction: column; justify-content: space-between; gap: 4px; font-size: 12px; line-height: 1.3;
          background: var(--d-face); border: 1px solid color-mix(in srgb, var(--d-c, var(--d-line)) 45%, transparent); }
.d-slot b { color: #fff; }
.d-slot.is-empty { border: 1px dashed var(--d-line); color: #4b5670; justify-content: center; align-items: center; }
.d-slot--free { height: 78px; border-color: var(--d-line); }
.d-slot--free.has-cos { background: #0c1a24; border-color: rgba(56, 189, 248, .4); }
.d-tier-num { font-family: var(--d-pixel); font-size: 10px; text-align: center; padding: 8px 0; border-radius: 8px; background: var(--d-panel); color: var(--d-mu2); }
.d-tier.is-reached .d-tier-num { background: var(--d-or); color: var(--d-on-or); }
.d-tier:nth-child(10n) .d-tier-num { color: #fff; }
.d-tier.is-reached:nth-child(10n) .d-tier-num { color: var(--d-on-or); }
@media (max-width: 600px) { .d-track-labels { display: none; } .d-tier { width: 116px; } }
.d-top { list-style: none; margin: 0; padding: 0; }
.d-top li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--d-line); flex-wrap: wrap; }
.d-top li:last-child { border-bottom: 0; }
.d-top img { border-radius: 6px; image-rendering: pixelated; }

/* 20 --------------------------------------------------------------- vote cards */
.d-vote.is-done { background: var(--d-line); } /* beats the card's inline foil colour */
.d-vote.is-done .d-art { filter: grayscale(1); opacity: .5; }
.d-vote.is-done .d-vote-state { color: var(--d-green); }

/* 21 --------------------------------------------------------------- Xyphor page: launcher window, install steps */
/* Windows 11 window: the screenshot already has Xyphor's own title bar, so the frame is just
   W11's 8px corners, hairline edge and two-layer drop shadow (no fake title bar on top). */
.d-window { position: relative; border-radius: 8px; overflow: hidden; background: #000;
            box-shadow: 0 0 0 1px rgba(0,0,0,.55), 0 2px 21px rgba(0,0,0,.45), 0 32px 64px rgba(0,0,0,.55); }
.d-window::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
                   box-shadow: inset 0 0 0 1px rgba(255,255,255,.09); }
.d-window img { display: block; width: 100%; height: auto; }
.d-step { display: grid; grid-template-columns: 52px 1fr; gap: 14px; align-items: start; }
.d-step-n { width: 52px; height: 52px; border-radius: 12px; background: var(--d-or); color: var(--d-on-or); display: flex; align-items: center; justify-content: center;
            font-family: var(--d-pixel); font-size: 13px; }
.d-xy-mobile-note { display: none; }
@media (max-width: 700px) { .d-xy-mobile-note { display: block; color: var(--d-bl); } }

/* 22 --------------------------------------------------------------- realm page hero */
.d-realm-hero { padding: clamp(24px, 5vw, 52px); display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 36px; align-items: center; }
.d-realm-card { transform: rotate(3deg); }
@media (max-width: 860px) { .d-realm-hero { grid-template-columns: 1fr; } .d-realm-card { display: none; } }

/* 23 --------------------------------------------------------------- profile: player card, rank tiles, theme picker, wall */
.d-player-card { flex: 0 1 380px; min-width: 280px; border-radius: 22px; padding: 6px; }
.d-player-card > .d-face { height: 100%; border-radius: 17px; }
.d-player-head { width: 120px; height: 120px; border-radius: 14px; border: 3px solid var(--d-deep); image-rendering: pixelated; }
.d-rank-tile { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 12px; background: var(--d-face); border: 1px solid color-mix(in srgb, var(--d-c) 45%, transparent); }
.d-rank-tile b { color: #fff; font-family: var(--d-display); font-size: 18px; font-weight: 900; }
.d-rank-tile.is-none { border-color: var(--d-line); }
.d-rank-tile.is-none b { color: #4b5670; }
.d-skin { font: inherit; font-size: 12px; font-weight: 700; display: flex; flex-direction: column; gap: 6px; padding: 6px; min-height: 44px; cursor: pointer; border-radius: 12px; background: var(--d-face); color: var(--d-mu); border: 2px solid var(--d-line); }
.d-skin span { height: 36px; border-radius: 8px; }
.d-skin:hover { color: #fff; border-color: var(--d-line2); }
.d-skin[aria-pressed="true"] { border-color: var(--d-or); color: #fff; }
.d-wall-post { display: grid; grid-template-columns: 40px 1fr; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--d-line); }
.d-wall-post:last-child { border-bottom: 0; }
.d-wall-post img { border-radius: 9px; image-rendering: pixelated; }
.d-pill[aria-current] .d-swatch, .d-pill[aria-pressed="true"] .d-swatch { box-shadow: 0 0 0 2px var(--d-on-or); }

/* ---- 24. Pictures: realm icons and crate keys (img/realms, img/keys; pixel art drawn for NullMC) ---- */
.d-art { position: relative; }
.d-realm-img, .d-key-img { image-rendering: pixelated; display: block; filter: drop-shadow(0 6px 14px color-mix(in srgb, var(--d-c, #000) 35%, transparent)); transition: transform .25s ease; }
.d-realm-img { width: 132px; height: 132px; }
.d-key-img { width: 150px; height: auto; }
.d-key-img.d-pack-img { width: auto; height: 96px; } /* coin / token / crystal piles and booster flasks (img/store) */
.d-foil:hover .d-realm-img, .d-foil:hover .d-key-img { transform: translateY(-4px) scale(1.04); }
.d-key-qty { position: absolute; right: 10px; bottom: 8px; padding: 2px 9px; border-radius: 999px; background: var(--d-deep, #05070b); border: 1px solid color-mix(in srgb, var(--d-c) 60%, transparent);
             color: #fff; font: 800 14px/1.4 'Outfit', system-ui, sans-serif; }
@media (prefers-reduced-motion: reduce) { .d-realm-img, .d-key-img { transition: none; } }

/* rank crests (img/ranks/tier1-6.svg) */
.d-rank-img { width: auto; height: 140px; margin: 0; image-rendering: pixelated; display: block; filter: drop-shadow(0 6px 14px color-mix(in srgb, var(--d-c) 40%, transparent)); transition: transform .25s ease; }
.d-foil:hover .d-rank-img { transform: translateY(-4px) scale(1.04); }
@media (prefers-reduced-motion: reduce) { .d-rank-img { transition: none; } }

/* Xyphor page: logo + name lockup (colours from the Xyphor logo) */
.d-xy-brand { display: flex; align-items: center; gap: 20px; }
.d-xy-brand img { width: 96px; height: 96px; flex-shrink: 0; filter: drop-shadow(0 0 26px rgba(139, 92, 246, .45)) drop-shadow(0 0 10px rgba(56, 189, 248, .35)); animation: d-xy-float 5s ease-in-out infinite; }
.d-xy-name { margin: 0; white-space: nowrap; font: 900 clamp(34px, 4.4vw, 64px)/1 'Outfit', system-ui, sans-serif; letter-spacing: -.02em;
             background: linear-gradient(100deg, #a78bfa 0%, #8b5cf6 35%, #38bdf8 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.d-xy-name span { font-weight: 800; background: linear-gradient(100deg, #e2e8f0, #94a3b8); -webkit-background-clip: text; background-clip: text; }
.d-xy-by { display: block; margin-top: 8px; color: var(--d-mu); font: 700 12px/1.4 'Plus Jakarta Sans', system-ui, sans-serif; text-transform: uppercase; letter-spacing: .14em; }
@keyframes d-xy-float { 50% { transform: translateY(-5px); } }
@media (max-width: 520px) { .d-xy-brand { gap: 14px; } .d-xy-brand img { width: 68px; height: 68px; } }
@media (prefers-reduced-motion: reduce) { .d-xy-brand img { animation: none; } }

/* ---- 25. Starter guide (deck/guide.php) ---- */
.d-guide-intro { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 28px; align-items: center; padding: clamp(20px, 3.5vw, 34px); }
.d-guide-icons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.d-guide-icons a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border-radius: 14px; text-decoration: none; color: #fff; font-weight: 700; font-size: 14px;
                   background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--d-c) 22%, transparent), var(--d-deep) 75%); border: 1px solid color-mix(in srgb, var(--d-c) 35%, var(--d-line)); transition: transform .2s, border-color .2s; }
.d-guide-icons a:hover { transform: translateY(-3px); border-color: var(--d-c); }
.d-guide-icons img { width: 64px; height: 64px; image-rendering: pixelated; }
.d-guide-nav { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--d-bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--d-line); padding: 10px 0; margin: -28px 0; }
.d-guide-nav .d-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.d-guide-nav .d-row::-webkit-scrollbar { display: none; }
.d-guide-nav .d-pill { flex: 0 0 auto; text-decoration: none; }
.d-guide-sec { scroll-margin-top: 84px; }
.d-guide-mode { display: flex; flex-direction: column; gap: 20px; padding: clamp(20px, 3.5vw, 34px); border-radius: 20px; background: var(--d-panel);
                border: 1px solid var(--d-line); border-top: 4px solid var(--d-c); box-shadow: 0 30px 60px -40px color-mix(in srgb, var(--d-c) 60%, transparent); }
.d-guide-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.d-guide-head img { width: 84px; height: 84px; image-rendering: pixelated; filter: drop-shadow(0 6px 16px color-mix(in srgb, var(--d-c) 45%, transparent)); }
.d-guide-head h2 { margin: 0; }
.d-guide-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); gap: 28px 40px; align-items: start; }
.d-guide-tips { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.d-guide-tips li { position: relative; padding: 12px 14px 12px 34px; border-radius: 12px; background: var(--d-deep); border: 1px solid var(--d-line); color: var(--d-mu); line-height: 1.6; font-size: 14px; }
.d-guide-tips li::before { content: ""; position: absolute; left: 14px; top: 19px; width: 8px; height: 8px; border-radius: 2px; background: var(--d-c); transform: rotate(45deg); }
.d-guide-tips b { color: #fff; }
.d-guide-try { display: grid; gap: 6px; padding: 16px 18px; border-radius: 14px; border: 1px dashed color-mix(in srgb, var(--d-c) 55%, transparent);
               background: color-mix(in srgb, var(--d-c) 8%, var(--d-deep)); color: var(--d-tx); }
.d-guide-table { overflow-x: auto; border-radius: 16px; border: 1px solid var(--d-line); background: var(--d-panel); }
.d-guide-table table { width: 100%; border-collapse: collapse; min-width: 900px; font-size: 14px; }
.d-guide-table th { text-align: left; padding: 14px 14px; background: var(--d-deep); color: var(--d-mu); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.d-guide-table td { padding: 10px 14px; border-top: 1px solid var(--d-line); color: var(--d-mu); white-space: nowrap; }
.d-guide-table td b { color: #fff; }
.d-guide-table tbody tr:hover td { background: color-mix(in srgb, var(--d-or) 5%, transparent); }
.d-guide-th { display: inline-flex; align-items: center; gap: 8px; }
.d-guide-th img { image-rendering: pixelated; }
.d-guide-lvl { display: inline-flex; align-items: center; gap: 8px; color: #fff; font-weight: 700; }
.d-guide-lvl img { width: 52px !important; height: 40px !important; max-width: none; flex: 0 0 52px; object-fit: contain; image-rendering: pixelated; }
.d-guide-table td:first-child { min-width: 150px; }
@media (max-width: 860px) { .d-guide-intro { grid-template-columns: 1fr; } .d-guide-head .d-btn { margin-left: 0 !important; } }
@media (max-width: 420px) { .d-guide-icons img { width: 52px; height: 52px; } }

/* Null Pass ticket (img/store/pass.svg) */
.d-pass-img { width: auto; height: 130px; image-rendering: pixelated; display: block; filter: drop-shadow(0 8px 18px rgba(255, 122, 26, .4)); transition: transform .25s ease; animation: d-pass-bob 4s ease-in-out infinite; }
.d-foil:hover .d-pass-img { transform: rotate(-3deg) scale(1.05); }
@keyframes d-pass-bob { 50% { translate: 0 -4px; } }
@media (prefers-reduced-motion: reduce) { .d-pass-img { animation: none; transition: none; } }

/* vote site pictures (img/vote/*.svg) */
.d-vote-img { width: 120px; height: 120px; image-rendering: pixelated; display: block; filter: drop-shadow(0 6px 14px color-mix(in srgb, var(--d-c) 40%, transparent)); transition: transform .25s ease; }
.d-vote:hover .d-vote-img { transform: translateY(-4px) scale(1.05); }
@media (prefers-reduced-motion: reduce) { .d-vote-img { transition: none; } }

/* Realm videos (deck_video_card in deck_data.php): our picture until clicked, then the YouTube player */
.d-video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--d-r); overflow: hidden; background: #000; border: 1px solid var(--d-line); box-shadow: 0 0 0 1px color-mix(in srgb, var(--c, var(--d-or)) 25%, transparent); }
.d-video iframe, .d-video-play, .d-video-play img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.d-video-play { padding: 0; margin: 0; background: none; cursor: pointer; }
.d-video-play img { object-fit: cover; transition: transform .35s ease, filter .35s ease; }
.d-video-play:hover img, .d-video-play:focus-visible img { transform: scale(1.03); filter: brightness(1.08); }
.d-video-btn { position: absolute; left: 50%; top: 50%; width: 74px; height: 52px; margin: -26px 0 0 -37px; border-radius: 14px; background: color-mix(in srgb, #FF0033 88%, transparent); box-shadow: 0 6px 24px #0008; transition: transform .2s ease; }
.d-video-btn::after { content: ""; position: absolute; left: 30px; top: 15px; border-style: solid; border-width: 11px 0 11px 18px; border-color: transparent transparent transparent #fff; }
.d-video-play:hover .d-video-btn, .d-video-play:focus-visible .d-video-btn { transform: scale(1.1); }
.d-video-play:focus-visible { outline: 3px solid var(--d-bl); outline-offset: -3px; }
.d-videos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 22px; }
.d-videos figure { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.d-videos figcaption { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-weight: 700; }
