/* =====================================================================
   SLEEPLESS DYSTOPIAN: "THE LAST CALL LOUNGE"   (Stage 1: global theme)

   CONCEPT
   A bar on a space station, as imagined in 1957, at 3:47am. Tobacco-
   stained walls, oxblood booths, tarnished brass, a Wurlitzer glow,
   one neon sign still buzzing. Tom Waits supplies the grit and the
   after-hours poetry; retro-futurism supplies the porthole windows,
   atomic-age curves and amber-phosphor terminals.

   COLOUR LOGIC (colour carries meaning, not just mood)
     amber   = content you can read or open  (links, headings)
     aqua    = people                         (member names, avatars)
     ember   = action / the neon              (buttons, hover, sign)
     brass   = structure                      (rules, frames, trim)

   ONE LOUD THING: the neon sign (site title). Everything else stays
   low-lit and quiet so long-form fiction stays readable.

   INSTALL (Ning): Admin > Appearance > Advanced > Custom CSS.
   Paste this whole file. The @import MUST stay on the first line of
   code. Selectors were written against Ning's known class patterns
   plus broad element/URL fallbacks; check with browser DevTools and
   send me any class names that don't take.
   ===================================================================== */

@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400&family=Josefin+Sans:wght@300;400;600&family=Monoton&family=Spectral:ital,wght@0,400;0,600;1,400;1,600&display=swap");

/* ---------- 1. DESIGN TOKENS ---------- */
:root {
  /* surfaces */
  --sd-smoke:      #16100c;   /* page: tobacco-stained black */
  --sd-smoke-2:    #1f1611;   /* raised: bar top */
  --sd-booth:      #2b1215;   /* panels: oxblood leather */
  --sd-booth-hi:   #3f1a1f;   /* panel highlight */
  /* trim + type */
  --sd-brass:      #b58f4e;
  --sd-brass-dim:  rgba(181, 143, 78, .32);
  --sd-paper:      #ecdfc6;   /* body text */
  --sd-ash:        #a99b84;   /* secondary text */
  --sd-ink:        #16100c;   /* text on amber */
  /* signals */
  --sd-amber:      #e9a83a;
  --sd-amber-glow: rgba(233, 168, 58, .35);
  --sd-ember:      #ff6b3d;
  --sd-ember-glow: rgba(255, 107, 61, .55);
  --sd-aqua:       #6fc4b3;

  /* type */
  --sd-font-sign:    "Monoton", "Josefin Sans", sans-serif;
  --sd-font-ui:      "Josefin Sans", "Century Gothic", "Avenir Next", sans-serif;
  --sd-font-text:    "Spectral", Georgia, "Times New Roman", serif;
  --sd-font-readout: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;

  /* shape: asymmetric "booth" curve; hierarchy comes from size */
  --sd-curve-panel:  3px 22px 3px 22px;
  --sd-curve-media:  2px 14px 2px 14px;
  --sd-curve-pill:   999px;

  --sd-measure: 66ch;         /* comfortable reading line length */
}

/* ---------- 2. BASE + ATMOSPHERE ---------- */
html { color-scheme: dark; }

html body {
  margin: 0;
  background-color: var(--sd-smoke) !important;
  background-image:
    radial-gradient(ellipse 70% 38% at 50% -6%, var(--sd-amber-glow), transparent 70%),   /* stage lamp */
    radial-gradient(ellipse 120% 90% at 50% 50%, transparent 55%, rgba(0, 0, 0, .55) 100%), /* room vignette */
    linear-gradient(180deg, var(--sd-smoke-2), var(--sd-smoke) 40%) !important;
  background-attachment: fixed !important;
  color: var(--sd-paper);
  font-family: var(--sd-font-text);
  font-size: 1.0625rem;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* faint CRT scanlines over the whole room (never blocks clicks) */
html body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99999;
  background: repeating-linear-gradient(
    0deg, rgba(0, 0, 0, .0) 0, rgba(0, 0, 0, .0) 2px,
    rgba(0, 0, 0, .09) 3px, rgba(0, 0, 0, .0) 4px);
  opacity: .5;
}

/* Ning wrappers: let the page background show through */
html body #xg, html body #xg_body, html body #xg_head,
html body .xg_theme, html body .xg_body, html body #xn_bar_wrapper,
html body .xg_widget_main_index_index {
  background: transparent !important;
  color: inherit;
}

::selection { background: var(--sd-ember); color: var(--sd-ink); }

/* ---------- 3. TYPOGRAPHY ---------- */
html body h1, html body h2, html body h3,
html body h4, html body h5, html body h6 {
  font-family: var(--sd-font-text);
  font-weight: 600;
  color: var(--sd-paper);
  line-height: 1.2;
  letter-spacing: -.005em;
  margin-top: 0;
}
html body h1 { font-size: clamp(2rem, 4.4vw, 3rem); font-style: italic; }
html body h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
html body h3 { font-size: 1.35rem; font-style: italic; font-weight: 400; }
html body h4, html body h5, html body h6 {
  font-family: var(--sd-font-ui);
  font-size: 1rem;
  letter-spacing: .06em;
  color: var(--sd-ash);
}

html body p { margin: 0 0 1.15em; }
html body strong, html body b { color: #fff2d6; font-weight: 600; }
html body em, html body i { color: var(--sd-paper); }

/* content links = amber */
html body a {
  color: var(--sd-amber);
  text-decoration-line: underline;
  text-decoration-color: var(--sd-brass-dim);
  text-underline-offset: .22em;
  text-decoration-thickness: 1px;
  transition: color .15s ease, text-decoration-color .15s ease, text-shadow .15s ease;
}
html body a:hover {
  color: var(--sd-ember);
  text-decoration-color: var(--sd-ember);
  text-shadow: 0 0 10px var(--sd-ember-glow);
}

/* people = aqua */
html body a[href*="/members/"] { color: var(--sd-aqua); }
html body a[href*="/members/"]:hover { color: #a6efe0; text-shadow: 0 0 10px rgba(111, 196, 179, .5); }

html body blockquote {
  margin: 1.6em 0;
  padding: .2em 0 .2em 1.4em;
  border-left: 3px solid var(--sd-ember);
  box-shadow: -8px 0 18px -10px var(--sd-ember-glow);
  font-style: italic;
  color: var(--sd-paper);
}

html body hr {
  border: 0;
  height: 1px;
  margin: 2.2em 0;
  background: linear-gradient(90deg, transparent, var(--sd-brass), transparent);
  overflow: visible;
}

html body code, html body pre, html body kbd {
  font-family: var(--sd-font-readout);
  font-size: .9em;
  color: var(--sd-amber);
  background: #0e0906;
  border: 1px solid var(--sd-brass-dim);
  border-radius: 3px;
  padding: .1em .4em;
}
html body pre { padding: 1em 1.2em; overflow-x: auto; border-radius: var(--sd-curve-media); }

html body ul, html body ol { padding-left: 1.4em; }
html body li::marker { color: var(--sd-brass); }

/* ---------- 4. TOP BAR + HEADER + THE NEON SIGN ---------- */
html body #xn_bar, html body .xn_bar, html body #xn_bar_wrapper {
  background: #0e0906 !important;
  border-bottom: 1px solid var(--sd-brass-dim) !important;
  font-family: var(--sd-font-ui);
}
html body #xn_bar a, html body .xn_bar a { color: var(--sd-ash); text-decoration: none; }
html body #xn_bar a:hover { color: var(--sd-amber); }

html body #xg_head, html body .xg_head, html body header {
  position: relative;
  padding-top: 1.2rem;
  padding-bottom: .4rem;
  text-align: center;
}

/* retire the stock theme logo; the neon title replaces it */
html body img[src*="/themes/v2/gaming/logo.png"] { display: none !important; }

/* THE SIGN */
html body #xg_sitename, html body .xg_sitename, html body .site-title,
html body #xg_sitename a, html body .xg_sitename a, html body .site-title a,
html body header h1, html body header h1 a {
  font-family: var(--sd-font-sign) !important;
  font-style: normal;
  font-weight: 400 !important;
  font-size: clamp(2rem, 6.2vw, 4rem) !important;
  letter-spacing: .05em;
  line-height: 1.1;
  color: #ffe3d2 !important;
  text-decoration: none !important;
  text-shadow:
    0 0 3px #ffd2b8,
    0 0 10px var(--sd-ember),
    0 0 26px var(--sd-ember),
    0 0 60px var(--sd-ember-glow);
  animation: sd-neon-strike 2.6s linear 1 both;
}

/* tagline under the sign: a quieter brass tube */
html body #xg_sitedesc, html body .xg_sitedesc, html body header h2 {
  font-family: var(--sd-font-ui);
  font-style: normal;
  font-weight: 300;
  font-size: 1rem;
  letter-spacing: .14em;
  color: var(--sd-brass);
  text-shadow: 0 0 12px rgba(181, 143, 78, .35);
}

/* ---------- 5. NAVIGATION: the bar rail ---------- */
html body #xg_navigation, html body .xg_navigation, html body nav {
  background: linear-gradient(180deg, var(--sd-booth-hi), var(--sd-booth)) !important;
  border-top: 1px solid var(--sd-brass);
  border-bottom: 1px solid var(--sd-brass);
  box-shadow: 0 8px 24px -10px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 220, 160, .12);
}
html body #xg_navigation a, html body .xg_navigation a, html body nav a {
  font-family: var(--sd-font-ui);
  font-weight: 400;
  font-size: .98rem;
  letter-spacing: .07em;
  color: var(--sd-paper) !important;
  text-decoration: none;
  padding: .7em 1em;
  display: inline-block;
  border-bottom: 2px solid transparent;
}
html body #xg_navigation a:hover, html body .xg_navigation a:hover, html body nav a:hover,
html body #xg_navigation li.this > a, html body #xg_navigation .active > a {
  color: var(--sd-amber) !important;
  border-bottom-color: var(--sd-ember);
  text-shadow: 0 0 12px var(--sd-ember-glow);
  background: rgba(0, 0, 0, .18);
}
/* dropdown trays */
html body #xg_navigation ul ul, html body nav ul ul {
  background: #1a0d0f !important;
  border: 1px solid var(--sd-brass-dim);
  border-radius: 0 0 14px 14px;
  box-shadow: 0 18px 34px -12px rgba(0, 0, 0, .95);
}

/* ---------- 6. MODULES = BOOTHS ---------- */
html body .xg_module, html body .xg_widget_main_index_index .xg_module {
  background: linear-gradient(160deg, var(--sd-booth-hi) 0%, var(--sd-booth) 45%, #1d0d10 100%) !important;
  border: 1px solid var(--sd-brass-dim) !important;
  border-radius: var(--sd-curve-panel) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 220, 160, .10),     /* leather sheen */
    inset 0 0 0 5px rgba(0, 0, 0, .18),          /* piping gap */
    0 16px 34px -16px rgba(0, 0, 0, .9);
  color: var(--sd-paper);
  margin-bottom: 1.6rem;
  overflow: hidden;
}
html body .xg_module_head {
  background: transparent !important;
  border-bottom: 1px solid var(--sd-brass-dim) !important;
  padding: .9rem 1.3rem .7rem;
}
html body .xg_module_head h2, html body .xg_module_head h3 {
  margin: 0;
  font-family: var(--sd-font-text);
  font-style: italic;
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--sd-amber);
  text-shadow: 0 0 14px var(--sd-amber-glow);
}
html body .xg_module_head h2 a, html body .xg_module_head h3 a { color: inherit; text-decoration: none; }
html body .xg_module_body { background: transparent !important; padding: 1.1rem 1.3rem; }
html body .xg_module_foot { background: transparent !important; border-top: 1px solid var(--sd-brass-dim) !important; padding: .7rem 1.3rem; }

/* ---------- 7. READING EXPERIENCE (fiction, essays) ---------- */
html body .xg_user_generated, html body .postbody, html body .rich,
html body .xg_module_body .description {
  font-family: var(--sd-font-text);
  font-size: 1.125rem;
  line-height: 1.8;
  max-width: var(--sd-measure);
  color: var(--sd-paper);
}
/* opening initial: the typeset first line of a story */
html body .xg_user_generated > p:first-of-type::first-letter,
html body .postbody > p:first-of-type::first-letter {
  float: left;
  font-size: 3.6em;
  line-height: .82;
  padding: .06em .12em 0 0;
  font-style: italic;
  font-weight: 600;
  color: var(--sd-ember);
  text-shadow: 0 0 16px var(--sd-ember-glow);
}

/* post / article titles */
html body .xg_headline, html body .entry-title, html body .xg_module_body h3 a {
  font-family: var(--sd-font-text);
  font-style: italic;
  font-weight: 600;
  line-height: 1.2;
}

/* byline, dates, view counts: the small print */
html body .byline, html body .timestamp, html body .small, html body small,
html body .xg_module_body .meta, html body .postedby {
  font-family: var(--sd-font-ui);
  font-size: .9rem;
  letter-spacing: .04em;
  color: var(--sd-ash);
}

/* tags = matchbook labels (works off the real URL pattern) */
html body a[href*="/list/tag/"] {
  display: inline-block;
  margin: .15em .25em .15em 0;
  padding: .12em .8em;
  font-family: var(--sd-font-ui);
  font-size: .85rem;
  letter-spacing: .03em;
  color: var(--sd-paper);
  text-decoration: none;
  background: rgba(0, 0, 0, .28);
  border: 1px solid var(--sd-brass-dim);
  border-radius: var(--sd-curve-pill);
}
html body a[href*="/list/tag/"]:hover {
  color: var(--sd-ink);
  background: var(--sd-amber);
  border-color: var(--sd-amber);
  text-shadow: none;
  box-shadow: 0 0 16px var(--sd-amber-glow);
}

/* "Read more" / "See more" */
html body a[href*="chapter"], html body .xg_module_body a.more { text-underline-offset: .3em; }

/* ---------- 8. IMAGES: portholes + framed photos ---------- */
/* member avatars become portholes */
html body img[src*="RESIZE_180x180"], html body img.photo, html body .avatar img, html body .xg_avatar img {
  border-radius: 50% !important;
  border: 2px solid var(--sd-brass) !important;
  box-shadow: 0 0 0 3px #0e0906, 0 0 18px -2px var(--sd-aqua);
  background: #0e0906;
}
/* post images: warm, slightly bruised, like a photo pinned behind the bar */
html body img[src*="storage.ning.com"]:not([src*="RESIZE_180x180"]) {
  max-width: 100%;
  height: auto;
  border-radius: var(--sd-curve-media);
  border: 1px solid var(--sd-brass-dim);
  filter: sepia(.25) saturate(.9) contrast(1.05) brightness(.92);
  transition: filter .25s ease;
}
html body img[src*="storage.ning.com"]:not([src*="RESIZE_180x180"]):hover { filter: none; }

/* third-party embeds (Spotify, RedCircle, Facebook) */
html body iframe {
  max-width: 100%;
  border: 1px solid var(--sd-brass-dim);
  border-radius: var(--sd-curve-media);
  background: #0e0906;
}

/* ---------- 9. FORMS + BUTTONS: jukebox keys ---------- */
html body input[type="text"], html body input[type="email"], html body input[type="password"],
html body input[type="search"], html body input[type="url"], html body input[type="number"],
html body textarea, html body select {
  font-family: var(--sd-font-ui);
  font-size: 1rem;
  color: var(--sd-paper) !important;
  background: #0e0906 !important;
  caret-color: var(--sd-amber);
  border: 1px solid var(--sd-brass-dim) !important;
  border-bottom: 2px solid var(--sd-brass) !important;
  border-radius: 3px 10px 3px 10px;
  padding: .6em .8em;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, .7);
}
html body input::placeholder, html body textarea::placeholder { color: var(--sd-ash); opacity: .8; }
html body input:focus, html body textarea:focus, html body select:focus {
  outline: none;
  border-bottom-color: var(--sd-ember) !important;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, .7), 0 6px 18px -8px var(--sd-ember-glow);
}

html body .button, html body a.button, html body button,
html body input[type="submit"], html body input[type="button"] {
  font-family: var(--sd-font-ui);
  font-weight: 600;
  font-size: .98rem;
  letter-spacing: .06em;
  color: var(--sd-ink) !important;
  background: linear-gradient(180deg, #f3bf5c, var(--sd-amber) 55%, #c98a22) !important;
  border: 1px solid #7a5513 !important;
  border-radius: var(--sd-curve-pill) !important;
  padding: .55em 1.4em;
  text-decoration: none;
  text-shadow: none;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 6px 14px -6px rgba(0, 0, 0, .9);
  transition: box-shadow .15s ease, transform .08s ease;
}
html body .button:hover, html body a.button:hover, html body button:hover,
html body input[type="submit"]:hover, html body input[type="button"]:hover {
  color: var(--sd-ink) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 0 22px var(--sd-ember-glow);
}
html body .button:active, html body button:active, html body input[type="submit"]:active {
  transform: translateY(1px);
}

/* sign up / sign in links in the bar become ghost keys */
html body a[href*="/main/authorization/signIn"], html body a[href*="/main/authorization/signUp"] {
  font-family: var(--sd-font-ui);
  text-decoration: none;
}

/* ---------- 10. TABLES, TABS, PAGINATION, COMMENTS ---------- */
html body table { border-collapse: collapse; width: 100%; }
html body th {
  font-family: var(--sd-font-ui);
  font-weight: 600;
  letter-spacing: .05em;
  text-align: left;
  color: var(--sd-amber);
  border-bottom: 2px solid var(--sd-brass);
  padding: .6em .8em;
}
html body td { padding: .6em .8em; border-bottom: 1px solid var(--sd-brass-dim); }

html body .tabs a, html body ul.tabs li a {
  font-family: var(--sd-font-ui);
  color: var(--sd-ash);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
html body .tabs .this a, html body .tabs a:hover { color: var(--sd-amber); border-bottom-color: var(--sd-ember); }

html body .pagination a, html body .pagination span {
  font-family: var(--sd-font-ui);
  display: inline-block;
  min-width: 2em;
  text-align: center;
  padding: .25em .6em;
  border: 1px solid var(--sd-brass-dim);
  border-radius: var(--sd-curve-pill);
  text-decoration: none;
}
html body .pagination .this, html body .pagination a:hover {
  background: var(--sd-amber); color: var(--sd-ink); border-color: var(--sd-amber);
}

html body .comment, html body .xg_module .comment {
  border-left: 2px solid var(--sd-brass-dim);
  padding-left: 1rem;
  margin: 1.2rem 0;
}

/* ---------- 11. FOOTER, COOKIE NOTICE, PAYWALL NOTE ---------- */
html body #xg_foot, html body .xg_foot, html body footer {
  background: #0e0906 !important;
  border-top: 1px solid var(--sd-brass);
  box-shadow: 0 -14px 30px -18px var(--sd-amber-glow);
  color: var(--sd-ash);
  font-family: var(--sd-font-ui);
  font-size: .92rem;
  padding: 1.4rem 0;
}
html body #xg_foot a, html body footer a { color: var(--sd-ash); }
html body #xg_foot a:hover, html body footer a:hover { color: var(--sd-amber); }

html body [class*="cookie"], html body [id*="cookie"] {
  background: #0e0906 !important;
  color: var(--sd-paper) !important;
  border-top: 1px solid var(--sd-brass) !important;
  font-family: var(--sd-font-ui);
}

/* overlays/dialogs (e.g. "this page contains paid content") */
html body .xg_floating_module, html body .xg_lightbox, html body [role="dialog"] {
  background: linear-gradient(160deg, var(--sd-booth-hi), var(--sd-booth)) !important;
  border: 1px solid var(--sd-brass) !important;
  border-radius: var(--sd-curve-panel) !important;
  color: var(--sd-paper);
  box-shadow: 0 30px 70px -20px #000, 0 0 40px -10px var(--sd-ember-glow);
}

/* ---------- 12. APP KIT (.sd-*) for the web apps in Stage 2 ----------
   Every future tool (Cognitive Shield, engines, etc.) can reuse these so
   apps look like they belong in the same bar. */
.sd-app {
  font-family: var(--sd-font-ui);
  color: var(--sd-paper);
  background: linear-gradient(160deg, var(--sd-booth-hi), var(--sd-booth) 50%, #1d0d10);
  border: 1px solid var(--sd-brass-dim);
  border-radius: var(--sd-curve-panel);
  box-shadow: inset 0 1px 0 rgba(255, 220, 160, .10), 0 20px 44px -18px #000;
  padding: 1.4rem;
}
.sd-app__title { font-family: var(--sd-font-text); font-style: italic; font-size: 1.6rem; color: var(--sd-amber); margin: 0 0 .8rem; }

/* amber-phosphor terminal readout */
.sd-readout {
  font-family: var(--sd-font-readout);
  font-size: .98rem;
  line-height: 1.6;
  color: var(--sd-amber);
  background: #0a0603;
  border: 1px solid var(--sd-brass-dim);
  border-radius: 4px 16px 4px 16px;
  padding: 1rem 1.2rem;
  text-shadow: 0 0 6px var(--sd-amber-glow);
  box-shadow: inset 0 0 40px rgba(233, 168, 58, .07), inset 0 2px 10px #000;
}
.sd-readout--alert { color: var(--sd-ember); text-shadow: 0 0 8px var(--sd-ember-glow); }
.sd-readout--calm  { color: var(--sd-aqua);  text-shadow: 0 0 8px rgba(111, 196, 179, .5); }

/* neon tube text, for one hero line per app */
.sd-neon { font-family: var(--sd-font-sign); color: #ffe3d2; text-shadow: 0 0 4px #ffd2b8, 0 0 14px var(--sd-ember), 0 0 34px var(--sd-ember-glow); }

/* meter / gauge track (e.g. bias score, sleep debt) */
.sd-meter { height: .7rem; background: #0a0603; border: 1px solid var(--sd-brass-dim); border-radius: var(--sd-curve-pill); overflow: hidden; }
.sd-meter > span { display: block; height: 100%; background: linear-gradient(90deg, var(--sd-aqua), var(--sd-amber), var(--sd-ember)); box-shadow: 0 0 14px var(--sd-amber-glow); }

/* chips and toggles */
.sd-chip { display: inline-block; padding: .15em .85em; border: 1px solid var(--sd-brass-dim); border-radius: var(--sd-curve-pill); background: rgba(0, 0, 0, .28); font-size: .88rem; }
.sd-chip[aria-pressed="true"], .sd-chip.is-on { background: var(--sd-amber); color: var(--sd-ink); border-color: var(--sd-amber); }

/* ---------- 13. MOTION + ACCESSIBILITY ---------- */
/* the one orchestrated moment: the sign catching, once, on load */
@keyframes sd-neon-strike {
  0%   { opacity: .08; }
  6%   { opacity: .9; }
  8%   { opacity: .1; }
  14%  { opacity: 1; }
  17%  { opacity: .2; }
  22%  { opacity: 1; }
  48%  { opacity: 1; }
  50%  { opacity: .55; }
  52%  { opacity: 1; }
  100% { opacity: 1; }
}

html body :focus-visible {
  outline: 2px solid var(--sd-aqua);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  html body * { animation: none !important; transition: none !important; }
}

/* ---------- 14. RESPONSIVE + PRINT ---------- */
@media (max-width: 720px) {
  html body { font-size: 1rem; line-height: 1.65; }
  html body .xg_module_body, html body .xg_module_head { padding-left: 1rem; padding-right: 1rem; }
  html body #xg_navigation a, html body nav a { padding: .6em .75em; }
  html body::after { opacity: .3; }   /* lighter scanlines on small screens */
  html body .xg_user_generated, html body .postbody { max-width: 100%; }
}

@media print {
  html body::after { display: none; }
  html body { background: #fff !important; color: #000; }
}