/* =========================================================================
   Golden Saga Field Guide
   Original brand styling. No game assets are used or reproduced here.
   ========================================================================= */

:root {
  --fhw-gold:      #e0a43c;
  --fhw-gold-soft: #f0c476;
  --fhw-ink:       #0e1116;
  --fhw-panel:     #161b22;
  --fhw-line:      #232a34;
  --fhw-live:      #3fb950;
  --fhw-soon:      #e0a43c;
  --fhw-hold:      #8b949e;
}

/* ---------- Dark scheme: the default for this site ---------------------- */
[data-md-color-scheme="saga"] {
  --md-hue: 215;
  --md-default-fg-color:             #e6edf3;
  --md-default-fg-color--light:      #b6c2cf;
  --md-default-fg-color--lighter:    #7d8899;
  --md-default-fg-color--lightest:   #3a434f;
  --md-default-bg-color:             var(--fhw-ink);
  --md-default-bg-color--light:      #151a21;
  --md-default-bg-color--lighter:    #1c222b;
  --md-default-bg-color--lightest:   #232a34;

  --md-primary-fg-color:             #11151b;
  --md-primary-bg-color:             #e6edf3;
  --md-accent-fg-color:              var(--fhw-gold);

  --md-typeset-color:                #e6edf3;
  --md-typeset-a-color:              var(--fhw-gold);
  --md-typeset-mark-color:           rgba(224,164,60,.28);

  --md-code-bg-color:                #11161d;
  --md-code-fg-color:                #d7dee7;

  --md-footer-bg-color:              #0b0e12;
  --md-footer-bg-color--dark:        #080a0d;

  color-scheme: dark;
}

/* ---------- Header: alliance wordmark ---------------------------------- */
.md-header {
  border-bottom: 1px solid var(--fhw-line);
  box-shadow: none;
}
.md-header__title {
  font-weight: 700;
  letter-spacing: .06em;
}
[data-md-color-scheme="saga"] .md-tabs {
  background: transparent;
  border-bottom: 1px solid var(--fhw-line);
}

/* ---------- Typography -------------------------------------------------- */
.md-typeset h1 {
  font-weight: 750;
  letter-spacing: -.015em;
  margin-bottom: .4em;
}
.md-typeset h2 {
  font-weight: 700;
  letter-spacing: -.01em;
  padding-top: .35em;
  border-top: 1px solid var(--fhw-line);
  margin-top: 2.2em;
}
.md-typeset h2:first-of-type { border-top: 0; margin-top: 1.2em; padding-top: 0; }
.md-typeset h3 { font-weight: 650; }

/* The "short version" checklist that opens every guide */
.md-typeset h2#the-short-version + ol {
  background: var(--md-default-bg-color--light);
  border: 1px solid var(--fhw-line);
  border-left: 3px solid var(--fhw-gold);
  border-radius: 6px;
  padding: 1em 1em 1em 2.6em;
}
.md-typeset h2#the-short-version + ol li { margin-bottom: .35em; }

/* ---------- Card grid on the landing page ------------------------------ */
.md-typeset .grid.cards > ul > li {
  border: 1px solid var(--fhw-line);
  border-radius: 8px;
  background: var(--md-default-bg-color--light);
  transition: border-color .15s ease, transform .15s ease;
}
.md-typeset .grid.cards > ul > li:hover {
  border-color: var(--fhw-gold);
  transform: translateY(-2px);
}

/* ---------- Schedule board --------------------------------------------- */
.fhw-board { margin: 1.2em 0 2em; }

.fhw-row {
  display: flex;
  align-items: flex-start;
  gap: .8em;
  padding: .7em .9em;
  border: 1px solid var(--fhw-line);
  border-radius: 6px;
  margin-bottom: .5em;
  background: var(--md-default-bg-color--light);
}
.fhw-row .fhw-when {
  flex: 0 0 8.5em;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding-top: .12em;
}
.fhw-row .fhw-body { flex: 1 1 auto; min-width: 0; }
.fhw-row .fhw-name { font-weight: 650; }
.fhw-row .fhw-bank {
  font-size: .8rem;
  color: var(--md-default-fg-color--light);
  margin-top: .25em;
}
.fhw-live  { border-left: 3px solid var(--fhw-live); }
.fhw-live  .fhw-when { color: var(--fhw-live); }
.fhw-soon  { border-left: 3px solid var(--fhw-soon); }
.fhw-soon  .fhw-when { color: var(--fhw-soon); }
.fhw-later { border-left: 3px solid var(--fhw-line); }
.fhw-later .fhw-when { color: var(--fhw-hold); }

.fhw-hold-list, .fhw-spend-list {
  border: 1px solid var(--fhw-line);
  border-radius: 8px;
  padding: 1em 1.2em;
  margin: 1em 0;
}
.fhw-hold-list  { border-left: 3px solid var(--fhw-soon); }
.fhw-spend-list { border-left: 3px solid var(--fhw-live); }
.fhw-hold-list h4, .fhw-spend-list h4 { margin: 0 0 .5em; font-size: .95rem; }
.fhw-hold-list ul, .fhw-spend-list ul { margin: 0; }

.fhw-stale {
  font-size: .75rem;
  color: var(--md-default-fg-color--lighter);
  margin-top: 1em;
  font-style: italic;
}

/* ---------- Light scheme: keep Golden Saga styling legible on white ----------- */
/* Components below use --fhw-line for borders. In dark that is near-black;
   on a white page it must be a light rule or every panel looks like a box. */
[data-md-color-scheme="default"] {
  --fhw-line:  #dfe4ea;
  --fhw-gold:  #a86f12;   /* darkened so gold text passes contrast on white */
  --fhw-live:  #1a7f37;
  --fhw-hold:  #6b7684;
}

/* ---------- Announce banner: next event countdown ---------------------- */
/* The banner is dark in BOTH schemes, so its text colours are set
   explicitly rather than inherited - otherwise light mode renders
   dark-on-dark and the countdown disappears. */
.md-banner {
  background: linear-gradient(90deg, #12161d 0%, #1a1f28 100%);
  border-bottom: 1px solid #232a34;
  color: #b6c2cf;
}
.md-banner a { color: #f0c476; }
.md-banner__inner { margin: .45rem auto; font-size: .72rem; }

.fhw-announce {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: .35rem .8rem;
  line-height: 1.4;
}
.fhw-announce-brand { letter-spacing: .03em; color: #8b97a6; }
.fhw-announce-brand strong { color: #f0c476; }

.fhw-announce-next {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem;
  padding-left: .8rem;
  border-left: 1px solid #2c3540;
}
.fhw-announce-label {
  font-size: .6rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #77828f;
}
.fhw-announce-event a {
  color: #f0c476 !important;
  font-weight: 700;
  text-decoration: none;
}
.fhw-announce-event a:hover { text-decoration: underline; }
.fhw-announce-in strong {
  color: #e6edf3;
  font-family: var(--md-code-font-family, monospace);
  font-variant-numeric: tabular-nums;
}
.fhw-announce-local {
  color: #8b97a6;
  font-size: .68rem;
}
.fhw-announce-idle { color: #77828f; font-style: italic; }

@media screen and (max-width: 44em) {
  .fhw-announce-brand { display: none; }
  .fhw-announce-next  { border-left: 0; padding-left: 0; }
  .fhw-announce-label { display: none; }
}

/* ---------- In-game clock (header) ------------------------------------- */
.fhw-clock-header {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  justify-content: end;
  column-gap: .5rem;
  row-gap: .05rem;
  margin-left: auto;
  padding: 0 .9rem;
  line-height: 1.2;
  white-space: nowrap;
  cursor: default;
}
/* Both clocks are the same information at the same importance, so they are
   set at the same size. Only the labels are smaller. */
.fhw-clock-header .fhw-clock-label {
  font-size: .56rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .6;
  justify-self: end;
}
.fhw-clock-header .fhw-clock-val {
  font-family: var(--md-code-font-family, monospace);
  font-size: .82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  justify-self: end;
}
.fhw-clock-header .fhw-clock-val--game { color: var(--fhw-gold); }
.fhw-clock-header .fhw-clock-primary {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: .4rem;
}
.fhw-clock-header .fhw-clock-time {
  font-family: var(--md-code-font-family, monospace);
  font-size: .95rem;
  font-weight: 700;
  color: var(--fhw-gold);
  font-variant-numeric: tabular-nums;
}
.fhw-clock-header .fhw-clock-basis,
.fhw-clock-header .fhw-clock-meta {
  font-size: .6rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  opacity: .65;
}

/* ---------- Clock panel (on /now/) ------------------------------------- */
.fhw-clockpanel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: .8rem;
  margin: 1.2em 0 1.6em;
}
.fhw-clockpanel .fhw-cell {
  border: 1px solid var(--fhw-line);
  border-radius: 8px;
  padding: .85rem 1rem;
  background: var(--md-default-bg-color--light);
}
.fhw-clockpanel .fhw-cell-label {
  font-size: .66rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--md-default-fg-color--lighter);
  margin-bottom: .3rem;
}
.fhw-clockpanel .fhw-cell-value {
  font-family: var(--md-code-font-family, monospace);
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.fhw-clockpanel .fhw-cell-sub {
  font-size: .7rem;
  color: var(--md-default-fg-color--light);
  margin-top: .2rem;
}
.fhw-clockpanel .fhw-cell-game .fhw-cell-value  { color: var(--fhw-gold); }
.fhw-clockpanel .fhw-cell-local .fhw-cell-value { color: var(--md-default-fg-color); }
.fhw-clockpanel .fhw-cell-reset .fhw-cell-value { color: var(--fhw-live); }
.fhw-clockpanel .fhw-cell-local .fhw-cell-sub {
  font-family: var(--md-code-font-family, monospace);
  font-size: .65rem;
  opacity: .8;
}

/* ---------- Calendar: Sun-Sat week grid -------------------------------- */
.fhw-calendar {
  margin: 1em 0 1.6em;
  padding-bottom: .25rem;
  overflow-x: auto;
}
.fhw-page-calendar .md-main__inner {
  max-width: none;
  padding-inline: 1.2rem;
}
.fhw-page-calendar .md-sidebar { display: none; }
.fhw-page-calendar .md-content { min-width: 0; max-width: none; }

.fhw-week {
  display: grid;
  /* minmax(0,1fr) - NOT a rem minimum. A floor of 11rem x 7 plus min-width
     forced the grid to 1232px and side-scrolled on any normal screen. */
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: .38rem;
  margin-bottom: .5rem;
}

.fhw-wk-day {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--fhw-line);
  border-radius: 8px;
  background: var(--fhw-panel, var(--md-default-bg-color--light));
  /* Grow to fit the day. A square with inner scrollers hid content and gave
     no scrollbar to hint at it, so the cell sizes to content instead. */
  min-height: 7.5rem;
}
.fhw-wk-day.is-past  { opacity: .58; }
.fhw-wk-day.is-today {
  border-color: var(--fhw-live);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--fhw-live), transparent 52%);
}
.fhw-wk-day.is-flag  { border-top: 2px solid var(--fhw-gold); }

.fhw-wk-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .25rem;
  border-bottom: 1px solid var(--fhw-line);
  padding: .48rem .55rem .4rem;
  background: color-mix(in srgb, var(--fhw-gold), transparent 93%);
}
.fhw-wk-dow {
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  opacity: .78;
}
.fhw-wk-date { color: var(--fhw-gold); font-size: .78rem; font-weight: 800; }
.is-today .fhw-wk-dow, .is-today .fhw-wk-date { color: var(--fhw-live); opacity: 1; }

.fhw-wk-section {
  padding: .5rem .55rem;
}
.fhw-wk-active {
  flex: 1 1 auto;
}
.fhw-wk-actions {
  display: block;
  flex: 0 0 auto;
  margin-top: auto;
  border-top: 1px solid var(--fhw-line);
  background: color-mix(in srgb, var(--md-default-bg-color), transparent 28%);
}


/* (inner scrollbars removed - cells size to content now) */
.fhw-wk-section-label {
  display: block;
  margin-bottom: .36rem;
  color: var(--md-default-fg-color--lighter);
  font-size: .52rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.fhw-wk-events {
  display: block;
}
.fhw-wk-event {
  display: block;
  margin-bottom: 0;
  padding-left: .42rem;
  border-left: 2px solid var(--fhw-gold);
  color: var(--md-default-fg-color) !important;
  font-size: .55rem;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.fhw-wk-event:hover { color: var(--fhw-gold) !important; text-decoration: underline; }
.fhw-wk-empty,
.fhw-wk-quiet {
  color: var(--md-default-fg-color--lighter);
  font-size: .56rem;
  font-style: italic;
}

.fhw-wk-group { margin-top: .15rem; }
.fhw-wk-tag {
  display: block;
  font-size: .52rem;
  font-weight: 800;
  letter-spacing: .09em;
  margin-bottom: .18rem;
}
.fhw-wk-spend .fhw-wk-tag { color: var(--fhw-live); }
.fhw-wk-save  .fhw-wk-tag { color: #f0616d; }

.fhw-wk-chip {
  display: inline-block;
  font-size: .55rem;
  line-height: 1.35;
  padding: .08rem .28rem;
  margin: 0 .16rem .18rem 0;
  border-radius: 4px;
  max-width: 100%;
  vertical-align: top;
  white-space: nowrap;
}
.fhw-wk-spend .fhw-wk-chip {
  color: var(--fhw-live);
  background: rgba(63, 185, 80, .13);
  border: 1px solid rgba(63, 185, 80, .3);
}
.fhw-wk-save .fhw-wk-chip {
  color: #f0616d;
  background: rgba(240, 97, 109, .13);
  border: 1px solid rgba(240, 97, 109, .32);
}

/* Phones: turn the week into readable daily cards. */
@media screen and (max-width: 52em) {
  /* column count is handled by the responsive block at the end of this file */
  .fhw-wk-day { min-height: 5.2rem; }
  .fhw-wk-head { padding: .25rem .3rem; }
  .fhw-wk-dow { font-size: .5rem; }
  .fhw-wk-date { font-size: .62rem; }
  .fhw-wk-day { display: flex; flex-direction: column; }

  .fhw-wk-section { padding: .3rem .3rem; }

  .fhw-wk-actions { border-top: 0; }
  .fhw-wk-events { grid-template-columns: 1fr; }
  .fhw-wk-event { font-size: .67rem; }
  .fhw-wk-chip { font-size: .62rem; }
  .fhw-wk-section-label,
  .fhw-wk-tag { font-size: .56rem; }

  /* the rest of the page was simply too tall on a phone */
  .fhw-clockpanel { gap: .4rem; margin: .8em 0 1em; }
  .fhw-clockpanel .fhw-cell { padding: .5rem .6rem; }
  .fhw-clockpanel .fhw-cell-value { font-size: 1.1rem; }
  .fhw-clockpanel .fhw-cell-label { font-size: .58rem; }
  .fhw-clockpanel .fhw-cell-sub   { font-size: .6rem; }

  .fhw-row { padding: .5rem .6rem; margin-bottom: .35rem; }
  .fhw-row .fhw-when { font-size: .68rem; }
  .fhw-row .fhw-bank { font-size: .72rem; }

  .md-typeset h1 { font-size: 1.35rem; margin-bottom: .3em; }
  .md-typeset h2 { margin-top: 1.3em; font-size: 1.1rem; }
  .md-typeset h3 { font-size: .95rem; }
  .md-typeset   { font-size: .76rem; }
  .md-typeset p { margin: .5em 0; }
  .md-main__inner { margin-top: .4rem; }
  .md-content__inner { padding-top: .2rem; }
  .md-content__inner::before { height: .2rem; }
}

/* ---------- Tag pills --------------------------------------------------- */
.md-typeset .md-tag {
  font-size: .68rem;
  letter-spacing: .03em;
  text-transform: uppercase;
  font-weight: 700;
}

/* ---------- Print / mobile --------------------------------------------- */
@media screen and (max-width: 46em) {
  .fhw-row { flex-direction: column; gap: .25em; }
  .fhw-row .fhw-when { flex: none; }
  .md-typeset h2 { margin-top: 1.6em; }
}

/* ---------- Light scheme: contrast for the week grid -------------------- */
/* Green/red at dark-mode saturation washes out on white, and the dimmed
   past-day opacity that reads as "faded" on black reads as "broken" here. */
[data-md-color-scheme="default"] .fhw-wk-day {
  background: #fffdf8;
  border-color: #dfe4ea;
}
[data-md-color-scheme="default"] .fhw-wk-day.is-past  { opacity: .55; }
[data-md-color-scheme="default"] .fhw-wk-day.is-today { background: #f2fbf4; border-color: #1a7f37; }
[data-md-color-scheme="default"] .fhw-wk-actions { background: #f7f5ef; }
[data-md-color-scheme="default"] .fhw-wk-event { color: #26313e !important; }

[data-md-color-scheme="default"] .fhw-wk-spend .fhw-wk-tag  { color: #15803d; }
[data-md-color-scheme="default"] .fhw-wk-spend .fhw-wk-chip {
  color: #14652f; background: #e6f6ec; border-color: #9fd9b4;
}
[data-md-color-scheme="default"] .fhw-wk-save .fhw-wk-tag   { color: #b3261e; }
[data-md-color-scheme="default"] .fhw-wk-save .fhw-wk-chip  {
  color: #9f1f18; background: #fdecec; border-color: #f0b4b0;
}
[data-md-color-scheme="default"] .fhw-wk-event { border-left-color: #c9922e; }

/* Board rows and panels pick up the same treatment */
[data-md-color-scheme="default"] .fhw-row,
[data-md-color-scheme="default"] .fhw-clockpanel .fhw-cell { background: #fbfcfd; }
[data-md-color-scheme="default"] .fhw-clockpanel .fhw-cell-game .fhw-cell-value { color: #8a5a0a; }

/* ---------- Pin the banner above the header ---------------------------- */
/* Keep the countdown fixed at the viewport edge. The header remains sticky
   immediately below it; its top margin replaces the banner's removed flow
   height so the two bars never overlap at the top of the page. */
:root { --fhw-banner-h: 1.99rem; }
.md-banner {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 5;
}
.md-header {
  position: sticky;
  top: var(--fhw-banner-h, 0px);
  margin-top: var(--fhw-banner-h, 0px);
}
/* Heading anchors must clear both bars, not just the header. */
html {
  scroll-padding-top: calc(var(--fhw-banner-h, 0px) + 3.6rem);
}

/* =========================================================================
   Command-center refinement
   Restrained fantasy surfaces, clearer status hierarchy, and denser action
   panels. This section intentionally overrides the earlier baseline styles.
   ========================================================================= */
:root {
  --fhw-gold: #d6a84f;
  --fhw-gold-soft: #f0cf83;
  --fhw-ink: #080f1a;
  --fhw-panel: #101a28;
  --fhw-panel-raised: #162235;
  --fhw-line: #27364b;
  --fhw-live: #3ecf8e;
  --fhw-soon: #e6ad48;
  --fhw-danger: #e06363;
  --fhw-hold: #9aa8ba;
  --fhw-radius: 10px;
  --fhw-shadow: 0 12px 32px rgba(0, 0, 0, .18);
}

[data-md-color-scheme="saga"] {
  --md-default-bg-color: #080f1a;
  --md-default-bg-color--light: #101a28;
  --md-default-bg-color--lighter: #162235;
  --md-default-bg-color--lightest: #223149;
  --md-default-fg-color: #edf3fa;
  --md-default-fg-color--light: #b9c6d6;
  --md-default-fg-color--lighter: #8291a5;
  --md-primary-fg-color: #0b1320;
  --md-accent-fg-color: var(--fhw-gold-soft);
  --md-typeset-a-color: #efc66f;
}

[data-md-color-scheme="default"] {
  --fhw-line: #d4c8ad;
  --fhw-panel: #faf7ef;
  --fhw-panel-raised: #fffdf8;
  --fhw-gold: #946617;
  --fhw-gold-soft: #a77720;
  --fhw-live: #16734c;
  --fhw-soon: #9a650e;
  --fhw-danger: #a83535;
  --fhw-hold: #607083;
  --fhw-shadow: 0 12px 28px rgba(47, 35, 16, .09);
  --md-default-bg-color: #f4f1e9;
  --md-default-bg-color--light: #faf7ef;
  --md-default-bg-color--lighter: #fffdf8;
}

body {
  background:
    radial-gradient(circle at 72% -10%, rgba(214, 168, 79, .08), transparent 32rem),
    var(--md-default-bg-color);
}

.md-grid { max-width: 80rem; }
.md-typeset { font-size: .84rem; line-height: 1.72; }
.md-content__inner { padding-bottom: 3rem; }
.md-typeset h1 {
  color: var(--md-default-fg-color);
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  line-height: 1.12;
  letter-spacing: -.025em;
}
.md-typeset h2 {
  border-top-color: color-mix(in srgb, var(--fhw-line), transparent 18%);
  letter-spacing: -.02em;
}
.md-typeset a { text-underline-offset: .18em; }
.md-typeset code { border: 1px solid color-mix(in srgb, var(--fhw-line), transparent 28%); }

/* Banner + header read as one compact instrument bar. */
.md-banner {
  background: #070d16;
  border-color: #1d2b3e;
  box-shadow: 0 1px 0 rgba(214, 168, 79, .12);
}
.md-banner__inner {
  margin: .32rem auto;
  min-height: 1.35rem;
  font-size: .68rem;
}
.fhw-announce { flex-wrap: nowrap; overflow: hidden; }
.fhw-announce-next { flex-wrap: nowrap; min-width: 0; }
.fhw-announce-event {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fhw-announce-in,
.fhw-announce-local,
.fhw-announce-also { white-space: nowrap; }
.md-header {
  background: linear-gradient(110deg, #0b1422 0%, #101a2a 72%, #172033 100%);
  border-bottom: 0;
}
.md-header__inner { min-height: 3.25rem; }
.md-header__title { letter-spacing: .055em; }
.md-tabs {
  background: #0b1422 !important;
  border-bottom: 1px solid #24324a !important;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .12);
}
.md-tabs__link {
  margin-top: .55rem;
  margin-bottom: .55rem;
  opacity: .72;
}
.md-tabs__link--active,
.md-tabs__link:hover { color: var(--fhw-gold-soft); opacity: 1; }
.md-search__form {
  background: rgba(3, 8, 15, .46);
  border: 1px solid #25344a;
  border-radius: 8px;
}

/* Shared elevated surfaces. */
.md-typeset .grid.cards > ul > li,
.fhw-row,
.fhw-clockpanel .fhw-cell,
.fhw-command-panel,
.fhw-hold-list,
.fhw-spend-list,
.fhw-dump-list {
  background: linear-gradient(145deg, var(--fhw-panel-raised), var(--fhw-panel));
  border-color: var(--fhw-line);
  border-radius: var(--fhw-radius);
  box-shadow: var(--fhw-shadow);
}
.md-typeset .grid.cards > ul > li {
  padding: 1rem 1.05rem;
  border-top: 2px solid color-mix(in srgb, var(--fhw-gold), transparent 42%);
}
.md-typeset .grid.cards > ul > li:hover {
  border-color: var(--fhw-gold);
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, .22);
}
.md-typeset .md-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  border-radius: 8px;
  min-height: 2.65rem;
}
.md-typeset .md-button svg { flex: 0 0 auto; }
.md-typeset .md-button--primary {
  background: linear-gradient(135deg, #b5842d, #d8aa51);
  border-color: #e8c375;
  color: #10131a;
}

/* Event cards: status and timing first, action and resources second. */
.fhw-board { display: grid; gap: .72rem; }
.fhw-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(7.4rem, .32fr) minmax(0, 1fr);
  gap: .7rem 1rem;
  margin: 0;
  padding: .9rem 1rem;
  overflow: hidden;
}
.fhw-row::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--fhw-line);
}
.fhw-row.fhw-live::before { background: var(--fhw-live); }
.fhw-row.fhw-soon::before { background: var(--fhw-soon); }
.fhw-row.fhw-deadline::before { background: var(--fhw-danger); }
.fhw-row .fhw-when {
  flex: none;
  padding: .05rem 0 0;
  font-size: .69rem;
  line-height: 1.35;
}
.fhw-row .fhw-timing {
  display: block;
  margin-top: .22rem;
  color: var(--md-default-fg-color--lighter);
  font-family: var(--md-code-font-family, monospace);
  font-size: .61rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.fhw-row .fhw-name { font-size: .94rem; line-height: 1.35; }
.fhw-row .fhw-action {
  margin-top: .28rem;
  color: var(--md-default-fg-color--light);
  font-size: .72rem;
  line-height: 1.48;
}
.fhw-resources {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin-top: .5rem;
}
.fhw-chip {
  display: inline-flex;
  align-items: center;
  min-height: 1.35rem;
  padding: .13rem .46rem;
  border: 1px solid color-mix(in srgb, var(--fhw-gold), transparent 56%);
  border-radius: 999px;
  background: color-mix(in srgb, var(--fhw-gold), transparent 88%);
  color: var(--fhw-gold-soft);
  font-size: .61rem;
  font-weight: 700;
  line-height: 1.2;
}
.fhw-live .fhw-chip {
  border-color: color-mix(in srgb, var(--fhw-live), transparent 58%);
  background: color-mix(in srgb, var(--fhw-live), transparent 90%);
  color: var(--fhw-live);
}
#fhw-now-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#fhw-now-strip .fhw-row { grid-template-columns: 1fr; min-height: 9.3rem; }
#fhw-now-strip .fhw-when { padding-right: 4.2rem; }
#fhw-now-strip .fhw-action {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Event-page command panel, injected from schedule data and existing copy. */
.fhw-command-panel {
  margin: 1rem 0 1.75rem;
  padding: 1rem;
  border: 1px solid var(--fhw-line);
  border-top: 2px solid var(--fhw-gold);
}
.fhw-command-kicker {
  margin-bottom: .65rem;
  color: var(--fhw-gold-soft);
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.fhw-command-facts {
  display: grid;
  grid-template-columns: 1.2fr .75fr 1fr 1.7fr;
  gap: .7rem;
}
.fhw-command-fact {
  min-width: 0;
  padding: .68rem .72rem;
  border: 1px solid color-mix(in srgb, var(--fhw-line), transparent 22%);
  border-radius: 7px;
  background: color-mix(in srgb, var(--md-default-bg-color), transparent 26%);
}
.fhw-command-label {
  display: block;
  margin-bottom: .24rem;
  color: var(--md-default-fg-color--lighter);
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.fhw-command-value { display: block; font-size: .72rem; line-height: 1.45; }
.fhw-command-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .7rem;
  margin-top: .7rem;
}
.fhw-command-action {
  padding: .72rem;
  border-left: 2px solid var(--fhw-live);
  background: color-mix(in srgb, var(--fhw-live), transparent 94%);
}
.fhw-command-action.is-bank {
  border-left-color: var(--fhw-soon);
  background: color-mix(in srgb, var(--fhw-soon), transparent 94%);
}
.fhw-command-action.is-avoid {
  border-left-color: var(--fhw-danger);
  background: color-mix(in srgb, var(--fhw-danger), transparent 95%);
}
.fhw-command-action strong {
  display: block;
  margin-bottom: .2rem;
  font-size: .63rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.fhw-command-action span { font-size: .7rem; line-height: 1.45; }

.md-typeset h2#the-short-version + ol {
  border-color: var(--fhw-line);
  border-left-color: var(--fhw-gold);
  border-radius: var(--fhw-radius);
  background: linear-gradient(145deg, var(--fhw-panel-raised), var(--fhw-panel));
  box-shadow: var(--fhw-shadow);
}
.md-typeset .admonition,
.md-typeset details {
  border-radius: var(--fhw-radius);
  background: var(--fhw-panel-raised);
  color: var(--md-default-fg-color);
  box-shadow: none;
}
.md-typeset .admonition-title,
.md-typeset summary {
  background-color: color-mix(in srgb, var(--md-accent-fg-color), transparent 88%);
}

@media screen and (max-width: 76.1875em) {
  .fhw-command-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media screen and (max-width: 52em) {
  .md-typeset { font-size: .82rem; line-height: 1.66; }
  .md-main__inner { margin-top: .7rem; }
  .md-header__inner { min-height: 3rem; }
  .md-header__title { display: none; }
  .fhw-clock-header { margin-left: auto; padding: 0 .35rem; }
  .fhw-clock-header .fhw-clock-time { font-size: .86rem; }
  .fhw-clock-header .fhw-clock-meta { font-size: .52rem; }
  .md-banner__inner { padding: 0 .6rem; }
  .fhw-announce { justify-content: flex-start; }
  .fhw-announce-next { width: 100%; justify-content: center; }
  .fhw-announce-local { display: none; }
  .fhw-announce-also { font-size: .6rem; }
  .fhw-row { grid-template-columns: 1fr; gap: .3rem; padding: .75rem .8rem; }
  .fhw-row .fhw-when { display: flex; align-items: baseline; gap: .48rem; }
  .fhw-row .fhw-timing { display: inline; margin-top: 0; }
  #fhw-now-strip { grid-template-columns: 1fr; }
  #fhw-now-strip .fhw-row { min-height: 0; }
  .fhw-command-panel { padding: .8rem; }
  .fhw-command-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .fhw-command-fact:first-child,
  .fhw-command-fact:last-child { grid-column: 1 / -1; }
  .fhw-command-actions { grid-template-columns: 1fr; gap: .5rem; }
  .md-typeset .md-button { width: 100%; padding-inline: .8rem; }
}

@media screen and (max-width: 25em) {
  .fhw-announce-also { display: none; }
  .fhw-announce-event { max-width: 9.5rem; }
  .fhw-announce-in { font-size: .62rem; }
}

/* ---------- Artwork -----------------------------------------------------
   hero.jpg is the full scene on the home page. bg.jpg is the same image
   pre-darkened and blurred, sitting behind every page at low strength so it
   reads as texture rather than decoration competing with the text. */

.fhw-hero {
  position: relative;
  margin: 0 0 1.4rem;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--fhw-line);
  background: #0b0f14 url("hero.jpg") center 38% / cover no-repeat;
  min-height: clamp(150px, 26vw, 300px);
}
/* Only a whisper of shading at the edges so the band sits on the page
   instead of floating as a bright rectangle. */
.fhw-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8,11,15,.10) 0%, rgba(8,11,15,0) 45%, rgba(8,11,15,.30) 100%);
}

.fhw-sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.fhw-hero-inner {
  position: relative;
  z-index: 1;
  padding: 1rem 1.2rem;
}
.fhw-hero-inner h1 {
  margin: 0;
  font-size: clamp(1.5rem, 4.4vw, 2.4rem);
  font-weight: 750;
  letter-spacing: .02em;
  color: #f2d9a0;
  text-shadow: 0 2px 12px rgba(0,0,0,.65);
}
.fhw-hero-inner p {
  margin: .15rem 0 0;
  font-size: clamp(.68rem, 1.7vw, .82rem);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: #cbd5e1;
  text-shadow: 0 1px 8px rgba(0,0,0,.7);
}

/* Site-wide texture. Fixed so it does not scroll, and very low contrast. */
[data-md-color-scheme="saga"] body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url("bg.jpg") center / cover no-repeat;
  opacity: .16;
  pointer-events: none;
}
[data-md-color-scheme="saga"] body { background-color: var(--fhw-ink); }

/* Light mode gets no photographic background - it destroys contrast on white. */
[data-md-color-scheme="default"] body::before { display: none; }

@media screen and (max-width: 52em) {
  .fhw-hero { min-height: 128px; margin-bottom: 1rem; }
  .fhw-hero-inner { padding: .7rem .8rem; }
}

/* ---------- Calendar density pass --------------------------------------
   Content now flows instead of hiding behind inner scrollbars, so the only
   remaining lever is whitespace. Tightened so a fortnight fits one screen. */
.fhw-wk-section      { padding: .35rem .4rem; }
.fhw-wk-head         { padding: .3rem .4rem; }
.fhw-wk-section-label{ margin: 0 0 .1rem; line-height: 1.1; }
.fhw-wk-group        { margin: 0 0 .25rem; }
.fhw-wk-group:last-child { margin-bottom: 0; }
.fhw-wk-chip {
  font-size: .56rem;
  line-height: 1.25;
  padding: .04rem .26rem;
  margin: 0 .14rem .14rem 0;
}
.fhw-wk-event  { font-size: .58rem; line-height: 1.25; margin-bottom: .12rem; }
.fhw-wk-events { margin-bottom: .1rem; }
.fhw-wk-duel   { margin-bottom: .2rem; line-height: 1.2; }
.fhw-wk-day    { min-height: 0; }

/* ---------- Calendar: responsive column count ---------------------------
   A true Sun-Sat row only works when a column can hold a readable chip.
   Below roughly 150px per column the labels shred, so the grid steps down
   rather than shrinking: 7 across on desktop, 4 on tablets, 2 on phones. */
.fhw-week { grid-template-columns: repeat(7, minmax(0, 1fr)); }

@media screen and (max-width: 76em) {
  .fhw-week { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media screen and (max-width: 48em) {
  .fhw-week { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .3rem; }
  /* Section captions cost a line each and the colour already says which is
     which, so they go once space is tight. */
  .fhw-wk-section-label { display: none; }
  .fhw-wk-day  { min-height: 0; }
  .fhw-wk-chip { font-size: .62rem; padding: .06rem .3rem; }
  .fhw-wk-event { font-size: .64rem; }
  .fhw-wk-dow  { font-size: .6rem; }
  .fhw-wk-date { font-size: .74rem; }
}
/* Never side-scroll: the grid always fits its container now. */
.fhw-calendar { overflow-x: visible; }

/* The duel entry carries that day's theme, so it is marked out from the
   ordinary event links rather than reading as just another event. */
.fhw-wk-event--duel {
  color: var(--fhw-gold) !important;
  border-left-color: var(--fhw-gold);
  font-weight: 750;
}

/* ---------- Server timeline picker ------------------------------------- */
/* Only rendered when schedule.json enables "servers". Built from the
   scheme-aware tokens above, so it follows both palettes with no overrides. */
.fhw-srv {
  margin: 0 0 1rem;
  padding: .7rem .85rem;
  border: 1px solid var(--fhw-line);
  border-radius: 8px;
  background: var(--md-default-bg-color--lighter);
}

.fhw-srv-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .45rem .7rem;
}

.fhw-srv-label {
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--md-default-fg-color--lighter);
}

.fhw-srv-sel,
.fhw-srv-off {
  font: inherit;
  font-size: .78rem;
  padding: .28rem .45rem;
  color: var(--md-default-fg-color);
  background: var(--md-default-bg-color);
  border: 1px solid var(--fhw-line);
  border-radius: 5px;
}

.fhw-srv-sel { max-width: 100%; }
.fhw-srv-off { width: 4.5rem; text-align: center; }

.fhw-srv-cal {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}

.fhw-srv-btn {
  font: inherit;
  line-height: 1;
  width: 1.7rem;
  height: 1.7rem;
  cursor: pointer;
  color: var(--fhw-gold);
  background: var(--md-default-bg-color);
  border: 1px solid var(--fhw-line);
  border-radius: 5px;
}

.fhw-srv-btn:hover { border-color: var(--fhw-gold); }

.fhw-srv-unit {
  font-size: .68rem;
  color: var(--md-default-fg-color--lighter);
}

.fhw-srv-note {
  margin: .5rem 0 0;
  font-size: .7rem;
  line-height: 1.5;
  color: var(--md-default-fg-color--light);
}

.fhw-srv-note strong { color: var(--fhw-gold); }

@media screen and (max-width: 480px) {
  .fhw-srv-row { gap: .4rem .5rem; }
  .fhw-srv-sel { flex: 1 1 100%; }
}
