/*
  Dark mode for Gaymes (Stuart, 10 Nov 2026: "apply the same treatment to gaymes"), the same soft charcoal as
  OMGay!'s: never black, the same cards, edges, blue and pastel rainbow as the light look, a step down in brightness.
  Loaded after light.css and dark-swaps.css. Every rule starts with :root[data-mode="dark"], so nothing in here can
  reach the light look. Game boards and art keep their own colours inside their frames.
*/
:root[data-mode="dark"] {
  color-scheme: dark;

  /* Surfaces: a soft charcoal page, cards a step lighter, anything set into a card lighter again */
  --bg: #1C1E23;
  --surface: #25282E;
  --surface-raised: #30333A;
  --border: #383C44;
  --edge: #15171B;            /* the bottom edge that gives a card its lift: darker, so it still reads as a lip */
  --hairline: #31343B;

  /* Text: soft white, never pure white */
  --text: #E8EAEE;
  --text-secondary: #B9BEC8;
  --text-muted: #9097A3;

  /* Blue: a touch brighter so it carries on charcoal */
  --accent: #4C80E8;
  --accent-hover: #5A8BEC;
  --accent-edge: #3462C4;
  --accent-ink: #94B6F6;      /* blue words on a dark card */

  --veil-hover: linear-gradient(rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.05));
  --veil-press: linear-gradient(rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.10));

  /* Status: the same colours, inks you can read on charcoal */
  --success: #2FA36D;  --success-ink: #7DD6AA;
  --warning: #D49A35;
  --danger: #E0545D;   --danger-ink: #F29299;
  --orange: #E8814F;   --orange-ink: #F3AE88;
  --gold: #E8AE1B;     --gold-edge: #B58A0E; --gold-ink: #F2CC5C;
  --silver: #8E95A1;   --silver-edge: #6E7581;

  /* Pop tiles keep their colour, a shade calmer so they don't glare off a dark page. Their inks stay dark. */
  --pop-rose: #E68FB0;   --pop-rose-edge: #B9637F;
  --pop-peach: #E9A076;  --pop-peach-edge: #B97650;
  --pop-lemon: #E6BF45;  --pop-lemon-edge: #AE8E22;
  --pop-mint: #74C7A1;   --pop-mint-edge: #4A9A76;
  --pop-sky: #84A7E8;    --pop-sky-edge: #5779BC;
  --pop-lilac: #AD9AEA;  --pop-lilac-edge: #7F6CC2;
  --pop-silver: #A9B0BC; --pop-silver-edge: #7E8591; --pop-silver-ink: #20242B; --pop-silver-shine: #C9CED6;

  /* Pastels turn into deep tints of themselves, and their inks into the pastel: a quiet rainbow on charcoal */
  --rose: #3A2A31;   --rose-ink: #F2AFC6;   --rose-edge: #5B3D49;
  --peach: #3B2D25;  --peach-ink: #F3BE9B;  --peach-edge: #5B4334;
  --lemon: #38321F;  --lemon-ink: #EED680;  --lemon-edge: #574C2B;
  --mint: #1F332C;   --mint-ink: #93DBBA;   --mint-edge: #2F5045;
  --sky: #222E42;    --sky-ink: #A9C4F6;    --sky-edge: #354868;
  --lilac: #2B283F;  --lilac-ink: #C7BAF6;  --lilac-edge: #443D66;

  --rainbow-1: #8A5566;
  --rainbow-2: #8C6249;
  --rainbow-3: #857439;
  --rainbow-4: #4A7D66;
  --rainbow-5: #4C6894;
  --rainbow-6: #645892;
  /* The pastel rainbow along the top stays: it's the brand */
  --rainbow-deep: linear-gradient(90deg, #E77FA0, #EC9A68, #DDB441, #4FBF8D, #6C98EE, #9C8BEA);
}

:root[data-mode="dark"] body { background: var(--bg); color: var(--text); }

/* The bars: a step up from the page on a phone, the page's own colour on a computer, as in light */
:root[data-mode="dark"] .site-header, :root[data-mode="dark"] .tab-bar { background: var(--surface); }
@media (min-width: 900px) {
  :root[data-mode="dark"] .site-header { background: var(--bg); }
}

/* Shadows: deeper, since a soft grey one vanishes on charcoal */
:root[data-mode="dark"] ::selection { background: rgba(76, 128, 232, .45); color: #FFFFFF; }

/* Photos and faces sit on a charcoal ring instead of a white one */
:root[data-mode="dark"] img { color-scheme: normal; }

/* Fields: a little darker than the card they're in, with a visible edge */
:root[data-mode="dark"] :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea) { background-color: var(--bg); color: var(--text); border-color: var(--border); }
/* The Maths Mini calculator's screen is the box: it keeps its glowing digits, not a box of its own (21 Nov 2026). */
:root[data-mode="dark"] .calc__screen input.calc__entry:not([type="checkbox"]):not([type="radio"]):not([type="range"]) { background-color: transparent; color: var(--mint-ink); }
:root[data-mode="dark"] ::placeholder { color: #7D8490; }


/* The wordmark: white letters by the rainbow G, as the logo was made for dark backgrounds */
:root[data-mode="dark"] img[src*="/img/gaymes-logo"] { content: url("../img/gaymes-logo-dark.png"); }

/* The top card's button on Home: dark like the card behind it, with light words (the light look's ink was #22252B). */
:root[data-mode="dark"] .hm-top.rd-look :is(.btn--join, .btn, .hm-btn-gold) { color: var(--text); }

/* ---------- Stuart's dark sweep (11 Nov 2026, 00:00) ---------- */
/* Gold pills keep dark words, as in light: your place on Results in the bottom bar, and the badge counts. */
:root[data-mode="dark"] :is(.tab-bar__rank, .nav-rank, .award__times) { color: #22252B; }
/* Live Gaymes Night stays the lemon-peach poster it is in light, with its own dark words, on Home, Play and Updates. */
:root[data-mode="dark"] :is(.lgn, .lgn--gayest-link) { background: radial-gradient(110% 80% at 100% 0%, rgba(255, 255, 255, .35), transparent 60%), linear-gradient(150deg, var(--pop-lemon), var(--pop-peach)); }
:root[data-mode="dark"] :is(.lgn-strip, .lgn-strip--gayest-link) { background: linear-gradient(150deg, var(--pop-lemon), var(--pop-peach)); }
:root[data-mode="dark"] :is(.lgn-icon, .lgn .lgn__go) { background: #FFFFFF; }
:root[data-mode="dark"] .lgn .lgn__go { color: #22252B; }
:root[data-mode="dark"] :is(.lgn__chip, .lgn__chip--till) { border: 0; background: rgba(255, 255, 255, .78); color: #22252B; }
:root[data-mode="dark"] :is(.lgn-strip__title, .lgn__title, .lgn__when) { color: #22252B; }
:root[data-mode="dark"] .lgn-strip__where { color: #3E2A12; }
:root[data-mode="dark"] :is(.lgn-strip__go, .lgn-strip__kicker) { color: #6A2F0E; }
@media (hover: hover) { :root[data-mode="dark"] .lgn .lgn__go:hover { background: #FFFFFF; } }
/* Words over a themed scene: the light look's white glow round them read as blurry on charcoal. A soft charcoal one
   keeps them readable over the picture instead. */
:root[data-mode="dark"] .quiz-card--season :is(.quiz-card__meta, .quiz-card__title, .quiz-card__chips),
:root[data-mode="dark"] .u-card:has(.season-deco--scene) :is(.u-card__title, .u-sub),
:root[data-mode="dark"] .rd-look:has(> .season-deco--scene) :is(.rd-kicker, .rd-latest__title, .rd-past__title, .rd-place) { text-shadow: 0 0 3px rgba(28, 30, 35, .85), 0 0 8px rgba(28, 30, 35, .7); }
/* Awards Cabinet: the badge's line icon on a charcoal disc inside its rainbow ring (it was a light icon on white). */
:root[data-mode="dark"] .award.is-won .award__icon { background: linear-gradient(var(--surface-raised), var(--surface-raised)) padding-box, conic-gradient(from 200deg, #D9577F, #DE7B43, #C99A1C, #2F9E73, #3F73DD, #7C68D8, #D9577F) border-box; }
:root[data-mode="dark"] :is(.award--gold, .award--silver, .award--bronze).is-won .award__icon .icon { stroke: #33363D; }

/* Stuart, 11 Nov 2026: "Can't see stars" on Rate this quiz. The empty stars were dark grey on charcoal.
   :where() keeps these below the gold rules for picked and hovered stars. */
:where(:root[data-mode="dark"]) .rate__star svg { fill: rgba(255, 255, 255, .06); stroke: rgba(255, 255, 255, .45); }
:where(:root[data-mode="dark"]) .stars__empty { fill: rgba(255, 255, 255, .2); }
:where(:root[data-mode="dark"]) .rating-stars { color: rgba(255, 255, 255, .25); }

/* Stuart, 11 Nov 2026: the footer's promise pills ("LGBTQ+ owned & run", "No ads"...) kept light's pale
   lip under a dark pill, which he hated. In dark they're glassy instead: a see-through tint with a fine
   edge, no lip. */
:root[data-mode="dark"] .site-footer__usps li { background: rgba(255, 255, 255, .07); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); color: var(--text); }

/* Stuart, 11 Nov 2026: "The dark mode in Gaymes is a mess". The sweep's smaller fixes:
   - "Up next" sparkle was the format's deep ink, lost on charcoal: the bright pop colour instead.
   - "None yet" on the Rating tile was light grey on the pop colour: the tile's own dark words, softened.
   - A greyed-out button was a pale grey slab: a quiet raised button instead.
   - Radio dots in the Look and How much you hear cards drew as black discs on iPhone: drawn here, ring and dot. */
:root[data-mode="dark"] .up-next__kicker .icon { color: var(--fp, var(--accent-ink)); }
:root[data-mode="dark"] .stats > .stat dd .muted { color: rgba(34, 37, 43, .62); }
:root[data-mode="dark"] :is(.btn:disabled, .btn[aria-disabled="true"]) { background: var(--surface-raised); box-shadow: 0 3px 0 var(--edge); color: var(--text-muted); }
:root[data-mode="dark"] .choice input[type="radio"] { -webkit-appearance: none; appearance: none; border: 2px solid rgba(255, 255, 255, .4); border-radius: 50%; background: transparent; }
:root[data-mode="dark"] .choice input[type="radio"]:checked { border-color: var(--accent); background: radial-gradient(circle, #FFFFFF 0 4px, var(--accent) 4.5px); }

/* Stuart, 11 Nov 2026 00:47 ("You still haven't fixed this"): in the iPhone app, the corners round the top of
   the keyboard showed light grey. That's the app's own backdrop (#F4F5F8), which shows wherever the page doesn't
   reach, like the space behind the keyboard or a bounce past the top. A charcoal sheet fixed behind the page,
   a screen taller than it each way, covers it. Nothing on the page changes. */
:root[data-mode="dark"]::before { content: ""; position: fixed; top: -100vh; right: 0; bottom: -100vh; left: 0; z-index: -1; background: var(--bg); pointer-events: none; }

/* The OMGay! apps poster (17 Nov 2026) stays sky to mint with its own dark words, like Live Gaymes Night. */
:root[data-mode="dark"] .omgay-apps { background: radial-gradient(110% 80% at 100% 0%, rgba(255, 255, 255, .35), transparent 60%), linear-gradient(150deg, var(--pop-sky), var(--pop-mint)); }
:root[data-mode="dark"] :is(.omgay-apps__title, .omgay-apps__perk) { color: #22252B; }
:root[data-mode="dark"] .omgay-apps__line { color: #1E2A40; }
:root[data-mode="dark"] .omgay-apps__kicker { color: #163C82; }
:root[data-mode="dark"] .omgay-apps__perk { background: rgba(255, 255, 255, .78); }
:root[data-mode="dark"] .omgay-apps__roundel { background: #FFFFFF; }
:root[data-mode="dark"] .u-card--omgay_apps .u-tile img { background: #FFFFFF; }
