/* ==========================================================================
   Light mode ("daylight parchment").

   The site's own look is the dark candle-lit tavern in app.css. This sheet is
   loaded LAST and every rule is scoped to `html.mode-light`, so with the class
   absent (the default, and every visitor who never touches the switch) nothing
   here applies. The class comes from the `bfmode` cookie, set server-side in
   views/partials/head.ejs and flipped live by the Dark / Light switch.

   Most of the site is built from the :root tokens, so the first block below
   re-points those and does the bulk of the work. Everything after it is a
   colour that app.css / main.css / menu.css wrote as a literal hex instead of
   a token — those have to be overridden one by one, and they carry the same
   !important the rules they beat carry (see the note in site-theme-tokens).

   ⚠️ --gold-bright GOES DARK here, because most of its 90-odd uses are plain
   emphasis text on a panel. But about a third are "text on a wine button / wine
   hover", and the wine stays burgundy in both modes — those rules are listed in
   the ON-WINE block below and pinned back to the light gold. A new rule in
   app.css that sets `color: var(--gold-bright)` on a wine background must be
   added to that list, or it renders dark-on-burgundy in light mode.
   ========================================================================== */

/* The switch's label: the mode it switches TO. ⚠️ The one rule in this file
   that applies in dark mode too — it hides "Dark" on the dark site. */
.modeswitch .ms-d { display: none; }
html.mode-light .modeswitch .ms-l { display: none; }
html.mode-light .modeswitch .ms-d { display: inline; }

html.mode-light {
  --ink:        #2e2014;   /* dark ink on parchment */
  --ink-soft:   #6b5434;
  --gold:       #8a5711;   /* accent / links: a deep ochre that reads on cream */
  --gold-bright:#6a3d0a;   /* emphasis: darker than --gold, as bright is on dark */
  --gold-deep:  #a9782f;
  --wine:       #7a2738;
  --wine-2:     #943548;
  --wine-deep:  #5a1d2a;
  --moss:       #55632f;
  --leather:    #f6eedc;   /* main panel */
  --leather-2:  #fbf6ea;   /* raised card */
  --leather-3:  #efe3c8;   /* inset / footer / streak */
  --edge:       #bd9a63;   /* brass border */
  --edge-soft:  #ddc89f;
  --field:      #fffaf0;   /* light-mode only: text-field fill */
  --field-hint: #9a8462;
  --ok:         #2f6b22;   /* light-mode only: inline greens */
  --bad:        #a3392b;   /* light-mode only: inline reds */
  color-scheme: light;
}

/* ---- The header stays dark ----------------------------------------
   The top bar, the banner art, the menu bar and the welcome strip are painted
   on dark leather (some of it is an image), so they keep the tavern tokens.
   Custom properties inherit, so re-declaring the dark values on these
   containers puts everything inside them back exactly as it is in dark mode. */
html.mode-light #topbarouter,
html.mode-light #topgraphic,
html.mode-light #menubar,
html.mode-light #textspace,
html.mode-light #mobnav,
html.mode-light .eventfixed {
  --ink:        #f1e4c6;
  --ink-soft:   #cdb98e;
  --gold:       #e0b24c;
  --gold-bright:#f6d888;
  --gold-deep:  #b6863a;
  --wine:       #732536;
  --wine-2:     #8f3446;
  --wine-deep:  #551c28;
  --leather:    #2b1d12;
  --leather-2:  #33241a;
  --leather-3:  #20130b;
  --edge:       #6f5027;
  --edge-soft:  #3a2a17;
  --field:      #3a2a1c;
  --field-hint: #a8946c;
  --ok:         #4caf50;
  --bad:        #ff9c8a;
  color-scheme: dark;
}

/* ---- Page ---------------------------------------------------------- */
html.mode-light {
  background:
    radial-gradient(1200px 360px at 50% -30px, rgba(255,240,200,0.7), rgba(255,240,200,0) 60%),
    radial-gradient(1100px 760px at 50% 0, #f1e6cd 0%, #e8d9b8 50%, #dccaa2 100%) !important;
  background-attachment: fixed !important;
}
html.mode-light body { color: var(--ink); }
html.mode-light p,
html.mode-light body p { color: var(--ink); }
html.mode-light h1 { text-shadow: none; }
html.mode-light h2 { color: var(--ink-soft); }
html.mode-light h3 { color: var(--gold); }
html.mode-light hr { border-top-color: var(--edge-soft); }
html.mode-light #newsetcright .streakleft h2,
html.mode-light #newsetcright .streakleft h3 { text-shadow: none; }


/* ---- Main column & rail ------------------------------------------- */
html.mode-light #newsetcleft {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.35), rgba(0,0,0,0.02)),
    var(--leather) !important;
  box-shadow: 0 6px 18px rgba(90,60,20,.16) !important;
}
html.mode-light #boxup,
html.mode-light #boxdown,
html.mode-light #boxdecks,
html.mode-light #boxgroups {
  background: var(--leather) !important;
  box-shadow: 0 4px 12px rgba(90,60,20,.12) !important;
}
html.mode-light #boxgroups { color: var(--ink); }
html.mode-light #eventsearch { background: var(--leather-3) !important; }

/* ---- Form fields --------------------------------------------------- */
/* --field / --field-hint are set on html.mode-light and set back to the dark
   values inside the header block above. */
html.mode-light input[type=text],
html.mode-light input[type=password],
html.mode-light input[type=email],
html.mode-light input[type=number],
html.mode-light input[type=datetime-local],
html.mode-light input[type=search],
html.mode-light select,
html.mode-light textarea {
  background: var(--field) !important;
}
/* Type-less inputs (the log-in form's "Email or handle") get main.css's grey. */
html.mode-light input:not([type]) {
  background: var(--field) !important;
  color: var(--ink) !important;
  border: 1px solid var(--edge) !important;
  border-radius: 5px;
}
html.mode-light input::placeholder,
html.mode-light textarea::placeholder { color: var(--field-hint) !important; }

/* ---- Literal colours from main.css / app.css, page by page -------- */
/* Footer: main.css paints it white text. */
html.mode-light #footer { color: var(--ink-soft) !important; }

/* Home: news feed "more" button, rail deck list. */
html.mode-light .feedmore-btn {
  background: var(--leather-3); border-color: var(--edge-soft); color: var(--ink-soft);
}
html.mode-light .feedmore-btn:hover { color: var(--gold); border-color: var(--edge); }
html.mode-light .deckrank,
html.mode-light .deckfoot,
html.mode-light .deckempty { color: var(--ink-soft); }
html.mode-light .deckfoot a { color: var(--gold); }
html.mode-light #boxdecks .deckrow { border-bottom-color: rgba(90,60,20,0.14); }

/* ---- ON-WINE: light gold text on a burgundy background --------------
   Every app.css rule that pairs a wine background with var(--gold-bright)
   text (generated from app.css on 2026-11-28). See the note at the top. */
html.mode-light .frbadge-pending,
html.mode-light #newsbuttons > div a:hover,
html.mode-light #newsbuttons > div a.on,
html.mode-light .chatmsg-file-x:hover,
html.mode-light .chatmsg-file-remove:hover,
html.mode-light .famact button:hover,
html.mode-light .chatpaste-x:hover,
html.mode-light .chatrx-chip:hover,
html.mode-light .chatrx-add:hover,
html.mode-light #retailnav a:hover,
html.mode-light #header_nav > li > ul li a:hover,
html.mode-light #sitesearchform input[type=submit],
html.mode-light input[type=submit],
html.mode-light button.btn,
html.mode-light .bigger,
html.mode-light .css-buttons-l:hover,
html.mode-light .css-buttons-r:hover,
html.mode-light .event-css-buttons:hover,
html.mode-light .storebox_button:hover,
html.mode-light .news-btn,
html.mode-light #mobnav a.feature,
html.mode-light .eventfixed > a,
html.mode-light #boxdecks #decksrc-moxfield:checked ~ .decksources .decksrc-for-moxfield,
html.mode-light #boxdecks #decksrc-archidekt:checked ~ .decksources .decksrc-for-archidekt,
html.mode-light #boxdecks #decksrc-goldfish:checked ~ .decksources .decksrc-for-goldfish,
html.mode-light .acctlinks a:hover,
html.mode-light .acctcount,
html.mode-light .evbtn:hover,
html.mode-light .evbtn-primary,
html.mode-light .remindbtn.on,
html.mode-light .codexbar a.on,
html.mode-light .css-buttons:hover,
html.mode-light .efway-act .css-buttons,
html.mode-light .bdbtn,
html.mode-light .mtgchip:has(input:checked),
html.mode-light #newsetcleft a.mtgtilenew,
html.mode-light a.mtgtilenew,
html.mode-light #newsetcleft a.mtgbadge.mtgbadgego,
html.mode-light a.mtgbadge.mtgbadgego,
html.mode-light #newsetcleft a.mtgnew,
html.mode-light a.mtgnew,
html.mode-light .deckbandhead a.deckbuild,
html.mode-light #homeintro a.introdecks,
html.mode-light .mtgmenuitem:hover,
html.mode-light .mtgmenuitem:focus-visible {
  color: #f6d888 !important;
}
html.mode-light input[type=submit]:hover,
html.mode-light button.btn:hover { color: #fff !important; }

/* The leather buttons (Source / Share, store links, news tabs): a dark
   gradient with gold text in app.css. */
html.mode-light .css-buttons-l,
html.mode-light .css-buttons-r,
html.mode-light .event-css-buttons,
html.mode-light .storebox_button,
html.mode-light .css-buttons,
html.mode-light #newsbuttons > div a {
  background: linear-gradient(#fffaf0, #efe3c8) !important;
  color: var(--gold) !important;
  border-color: var(--edge) !important;
}
html.mode-light .css-buttons-l:hover,
html.mode-light .css-buttons-r:hover,
html.mode-light .event-css-buttons:hover,
html.mode-light .storebox_button:hover,
html.mode-light .css-buttons:hover,
html.mode-light #newsbuttons > div a:hover,
html.mode-light #newsbuttons > div a.on {
  background: var(--wine) !important;
  color: #f6d888 !important;
}

/* ---- Text colours main.css hard-codes as white / pale -------------- */
html.mode-light #newsetcleft,
html.mode-light #newsetcright,
html.mode-light #boxgroups { color: var(--ink); }
html.mode-light div.streaknews h1,
html.mode-light div.miniright h4 { color: var(--ink); }
html.mode-light div.threaddate,
html.mode-light .fieldlabel { color: var(--ink-soft); }
html.mode-light .feedtitle:hover,
html.mode-light .deckname:hover { color: var(--gold-bright); }
html.mode-light .star,
html.mode-light .errmsg { color: #b3261e; }
html.mode-light .statenav-count { background: var(--leather-3); }
html.mode-light .chatmsg-text,
html.mode-light .bfv-err { color: var(--ink); }
html.mode-light .chatmsg-quote-text,
html.mode-light .w40ksimdonerow,
html.mode-light .w40ksimshockrow { color: var(--ink-soft); }
html.mode-light button.mtgflip[aria-pressed="true"],
html.mode-light .w40kdlgx:hover { color: var(--gold-bright); }

/* ---- Inline styles in the views ------------------------------------
   Dozens of templates carry style="color:#e0b24c" and friends from before the
   token system. An !important stylesheet rule beats a plain inline style, so
   they are matched by attribute here rather than edited in ~40 templates.
   (User name colours, style="color:#<%= u.color %>", are the member's own
   choice and are left alone.) */
html.mode-light [style*="color:#e0b24c"],
html.mode-light [style*="color:#eeba26"],
html.mode-light font[color="#e0b24c"] { color: var(--gold) !important; }
html.mode-light [style*="color:#fff;"],
html.mode-light [style*="color:#ccc"],
html.mode-light [style*="color:#bbb"],
html.mode-light font[color="#fff"] { color: var(--ink) !important; }
html.mode-light [style*="color:#aaa"],
html.mode-light [style*="color:#888"],
html.mode-light [style*="color:#777"],
html.mode-light [style*="color:#a8946c"] { color: var(--ink-soft) !important; }
html.mode-light [style*="color:#4caf50"],
html.mode-light [style*="color:#7ac043"],
html.mode-light [style*="color:green"],
html.mode-light font[color="lime"] { color: var(--ok) !important; }
html.mode-light [style*="color:#ff9c8a"],
html.mode-light [style*="color:#d98d7e"] { color: var(--bad) !important; }
html.mode-light [style*="background:#333"] { background: var(--leather-3) !important; }
/* Inside the header these resolve to the dark values again, because the
   header block re-declares the tokens (that is why green/red are tokens). */

/* ---- Dark surfaces app.css paints with a literal hex --------------- */
html.mode-light #boxonline,
html.mode-light #boxads { background: var(--leather) !important; }

/* Amber notices (unconfirmed email, the contact-page gate). */
html.mode-light #verifynotice,
html.mode-light .contactgate {
  background: linear-gradient(180deg, #fbecc4, #f3dca6);
  color: var(--ink);
}
html.mode-light #verifynotice b,
html.mode-light .contactgate b { color: var(--gold-bright); }

/* Row / card hovers. */
html.mode-light .evcard:hover,
html.mode-light .storeevent:target,
html.mode-light .codexcard:hover,
html.mode-light .codextable tbody tr:hover td,
html.mode-light .boardcard:hover { background: #efe0bf; }

/* Small leather buttons and chips. */
html.mode-light .evbtn,
html.mode-light .remindbtn,
html.mode-light .groupadd-chip,
html.mode-light .voicedock-btn,
html.mode-light #retailnav a {
  background: linear-gradient(#fffaf0, #efe3c8);
}
html.mode-light .chatmsg-file-x,
html.mode-light .chatmsg-file-remove,
html.mode-light .famact button,
html.mode-light .chatpaste-x,
html.mode-light .chatrx-chip,
html.mode-light .chatrx-add,
html.mode-light .chatgroup-count { background: var(--leather-3); }
html.mode-light .chatrx-picker { background: var(--leather-2); }
html.mode-light .codexformula,
html.mode-light .codexmath-warn { background: var(--leather-3); color: var(--ink); }

/* Chat in the browser. (The chat APP — installed or Battlefinder for
   Windows — stays dark: head.ejs / chat.ejs drop mode-light there.) */
html.mode-light .chatmessages { background: var(--leather-2) !important; }
html.mode-light .chatform textarea { background: var(--field); color: var(--ink); }
html.mode-light .chatnote,
html.mode-light .chatpaste-hint,
html.mode-light .chatkeep-note,
html.mode-light .chatempty { color: var(--ink-soft); }

/* Pale status text with no background of its own. */
html.mode-light div.threadtitle a,
html.mode-light .codexnote-open .codexnote-state,
html.mode-light .gi.on.wow,
html.mode-light .mtghave.mtgsome,
html.mode-light .w40kdp { color: var(--gold); }
html.mode-light .famact-state,
html.mode-light .voicescreen-title,
html.mode-light .voicedock-name,
html.mode-light .voicedevmenu-item.on,
html.mode-light .boardflash,
html.mode-light .bdrosterhere,
html.mode-light .bdstatus,
html.mode-light .mtghave.mtgyes,
html.mode-light .w40kmodels { color: var(--ok); }
html.mode-light .famact-state.off { color: #a8611a; }
html.mode-light .bdrosterblocked,
html.mode-light .bdstatus.bdbad,
html.mode-light .mtggroup li.mtgbadrow > a,
html.mode-light .mtgstatus.bad,
html.mode-light .mtgdanger summary,
html.mode-light .w40kover,
html.mode-light .w40kunitrow.w40kbad .w40kunitname::before,
html.mode-light .w40kunitwarn,
html.mode-light .w40kbadtext { color: var(--bad) !important; }
