/* ============================================================
   Union Gaming Network: the polish layer.

   Loaded LAST on every gaming page, after site.css, union-theme.css
   and any page styles, so it can settle the things the audit of
   27 Sep 2026 found without rewriting those files:

     1. The painting behind every page is dimmed, so it frames the
        content instead of competing with it.
     2. Text never sits bare on the picture: intros get a panel.
     3. Readable type: 16px body, normal weight, left-aligned, and
        the faint small print brightened.
     4. One header for every page, with a real phone menu.
     5. The footer, the not-found page and the status page.
   ============================================================ */

:root {
  --muted: rgba(255,255,255,0.90);
  --dim:   rgba(255,255,255,0.74);
  --uPaper:       rgba(4,14,10,0.84);
  --uPaperBright: rgba(4,14,10,0.90);
  --panel: rgba(4,14,10,0.84);
  --panelLine: rgba(64,255,170,0.22);
}

/* ── 1. A calmer backdrop ──────────────────────────────────────────── */
body::before {
  background:
    linear-gradient(180deg, rgba(2,6,8,0.46) 0%, rgba(2,6,8,0.52) 45%, rgba(2,6,8,0.76) 100%),
    url('/assets/bg-union.webp') center 35% / cover no-repeat !important;
}

/* ── 2. No text straight on the picture ────────────────────────────── */
section.sectionPreview > h2,
section.sectionPreview > p.lead,
#liveServers > div:first-child {
  position: relative;
}
section.sectionPreview > p.lead,
.dlHero,
.coWrap > div:first-child,
.dnWrap > div:first-child {
  background: var(--panel);
  border: 1px solid var(--panelLine);
  border-radius: 12px;
  padding: 16px 20px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
section.sectionPreview > p.lead { max-width: none; margin-top: 12px; }
section.sectionPreview > h2,
#liveServers h2 {
  text-shadow: 0 2px 14px rgba(0,0,0,0.85), 0 0 2px rgba(0,0,0,0.9);
}
#liveServers > div:first-child {
  background: var(--panel);
  border: 1px solid var(--panelLine);
  border-radius: 12px;
  padding: 10px 16px;
}
#serverCount { color: var(--muted) !important; }
.coCard { background: var(--panel) !important; }
/* The backdrop (body::before) is a fixed layer at z-index 0, so anything not
   positioned paints under it. .pageWrap lifts itself; the checkout pages and
   /donate/ use their own <main> and didn't, which hid the basket and the
   whole payment panel: only the buttons, which are positioned, showed. */
main#main:not(.pageWrap) { position: relative; z-index: 1; }

/* ── 3. Readable type ──────────────────────────────────────────────── */
body { font-size: 16px; }
p, li { font-weight: 400; }
p.lead, .lead { font-size: 16.5px !important; font-weight: 400 !important; color: rgba(255,255,255,0.92) !important; }
.card p, .card li, .svProse p, .svProse li, .acctSection p.help { font-size: 15.5px; line-height: 1.7; }
.footDesc { font-weight: 400 !important; color: var(--muted) !important; font-size: 14px !important; }
footer .footColLabel, .card .tag { font-size: 11px !important; color: #e3c46a !important; }
.footCompliance p { font-size: 12px; color: var(--muted); }
/* Server pages centred every paragraph; long text reads better aligned left. */
.svProse { text-align: left !important; }
.svProse h1, .svProse h2, .svProse h3 { text-align: left !important; }
.svProse table { margin-left: 0 !important; }

/* ── 4. One header, and a phone menu ───────────────────────────────── */
header .nav { display: flex; align-items: center; gap: 18px; }
header .navlinks { display: flex; align-items: center; gap: 4px; margin-left: auto; flex-wrap: nowrap; }
header .navlinks a {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(255,255,255,0.86); text-decoration: none; padding: 7px 10px; border-radius: 6px; white-space: nowrap;
}
header .navlinks a:hover { color: var(--green); background: rgba(64,255,170,0.07); }
header .navlinks a.active { color: var(--green); background: rgba(64,255,170,0.09); }
header .navlinks .navJoin {
  color: #04140c !important; background: var(--green); font-weight: 600; margin-left: 6px;
}
header .navlinks .navJoin:hover { background: #7dffc2; }
/* Signed in: the auth slot shows an Account link, and Join goes away. */
header .navlinks:has(#ugnAuthSlot a[href="/account/"]) .navJoin { display: none; }
#ugnAuthSlot.navAuth {
  display: inline-flex; align-items: center; gap: 8px; margin-left: 8px; padding-left: 12px;
  border-left: 1px solid rgba(64,255,170,0.2);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; color: var(--muted);
}
.navToggle { display: none; }

@media (max-width: 900px) {
  header .nav { position: relative; height: 64px; flex-wrap: nowrap; padding: 0 14px; }
  header .brand { min-width: 0; gap: 8px; }
  header .brand span { font-size: 11px !important; letter-spacing: 0.1em !important; overflow: hidden; text-overflow: ellipsis; }
  .navToggle {
    display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
    margin-left: auto; flex: 0 0 auto; width: 44px; height: 40px; padding: 0;
    background: rgba(64,255,170,0.08); border: 1px solid rgba(64,255,170,0.32); border-radius: 8px; cursor: pointer;
  }
  .navToggle span { display: block; width: 20px; height: 2px; background-color: #eafff4 !important; border-radius: 2px; transition: transform .2s, opacity .2s; }
  header.navOpen .navToggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  header.navOpen .navToggle span:nth-child(2) { opacity: 0; }
  header.navOpen .navToggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  header .navlinks {
    display: none; position: absolute; top: calc(100% + 6px); left: 10px; right: 10px; z-index: 60;
    flex-direction: column; align-items: stretch; gap: 2px; margin: 0; padding: 8px;
    background: #03100b; border: 1px solid rgba(64,255,170,0.28); border-radius: 12px;
    box-shadow: 0 18px 50px rgba(0,0,0,0.7);
  }
  header.navOpen .navlinks { display: flex; }
  header .navlinks a { font-size: 13px; padding: 12px 12px; }
  header .navlinks .navJoin { margin: 6px 0 0; text-align: center; }
  #ugnAuthSlot.navAuth { margin: 8px 0 0; padding: 10px 12px 4px; border-left: 0; border-top: 1px solid rgba(64,255,170,0.15); flex-wrap: wrap; }
}
/* Nothing on a phone should be wider than the phone. */
html, body { max-width: 100%; overflow-x: hidden; }

/* ── 5. Footer with four columns ───────────────────────────────────── */
.footMain.footMainUnion { grid-template-columns: 1.5fr 1fr 1fr 1fr; }
.footMain.footMainUnion.withServer { grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr; }
@media (max-width: 900px) { .footMain.footMainUnion, .footMain.footMainUnion.withServer { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footMain.footMainUnion, .footMain.footMainUnion.withServer { grid-template-columns: 1fr; } }
.footNav a { color: rgba(255,255,255,0.86); }
.footNav a:hover { color: var(--green); }

/* ── 6. Not-found page ─────────────────────────────────────────────── */
.nf { max-width: 640px; margin: 40px auto 0; text-align: center; background: var(--panel);
  border: 1px solid var(--panelLine); border-radius: 14px; padding: 38px 30px; }
.nf .nfCode { font-family: var(--mono); color: #e3c46a; letter-spacing: 0.2em; font-size: 12px; }
.nf h1 { font-family: var(--serif); font-size: 34px; margin: 10px 0 12px; }
.nf p { color: var(--muted); }
.nf .nfLinks { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }

/* ── 7. Status page ────────────────────────────────────────────────── */
.stOverall { display: flex; align-items: center; gap: 14px; background: var(--panel); border: 1px solid var(--panelLine);
  border-radius: 12px; padding: 18px 22px; margin-bottom: 18px; }
.stOverall .dot { width: 14px; height: 14px; border-radius: 50%; flex: 0 0 auto; }
.stOverall b { font-family: var(--serif); font-size: 20px; }
.stList { display: grid; gap: 12px; }
.stRow { background: var(--panel); border: 1px solid var(--panelLine); border-radius: 12px; padding: 16px 20px; }
.stHead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stHead .name { font-family: var(--serif); font-size: 17px; color: #fff; }
.stHead .meta { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.stBars { display: grid; grid-template-columns: repeat(30, 1fr); gap: 3px; margin-top: 12px; }
.stBars i { height: 26px; border-radius: 3px; background: rgba(255,255,255,0.10); }
.stBars i.ok { background: #36d98a; } .stBars i.part { background: #e8b040; } .stBars i.bad { background: #e85a5a; }
.stFoot { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--dim); margin-top: 6px; }
.dot.online { background: #36d98a; box-shadow: 0 0 10px rgba(54,217,138,.7); }
.dot.degraded, .dot.maintenance { background: #e8b040; }
.dot.offline { background: #e85a5a; }
/* An on-demand server that is asleep: not down, starts when someone asks. */
.dot.sleeping { background: #7b8494; }

/* Skip link: first thing a keyboard user reaches, invisible until then. */
.skipLink { position: absolute; left: 12px; top: -48px; z-index: 1000; padding: 10px 14px; border-radius: 8px;
  background: #0d1a14; color: var(--green, #40ffaa); border: 1px solid rgba(64,255,170,.4); text-decoration: none;
  font-family: var(--mono, monospace); font-size: 13px; transition: top .15s; }
.skipLink:focus { top: 12px; outline: 2px solid var(--green, #40ffaa); outline-offset: 2px; }
#main:focus { outline: none; }

/* Phones get the half-size background (124 KB rather than 300 KB). */
@media (max-width: 700px) {
  body::before {
    background:
      linear-gradient(180deg, rgba(2,6,8,0.46) 0%, rgba(2,6,8,0.52) 45%, rgba(2,6,8,0.76) 100%),
      url('/assets/bg-union-960.webp') center 35% / cover no-repeat !important;
  }
}
