/* Arcwyrd — webclient overrides.
 *
 * Evennia's webclient.html loads this after webclient.css, and the game dir's
 * static tree wins over the library's, so this file is the override hook.
 *
 * Three aims, in priority order:
 *
 * 1. LEGIBILITY. A photograph behind a live text stream is the one place in
 *    this project where decoration can genuinely hurt play: the text IS the
 *    game (CLAUDE.md rule 5). The image is pushed back and every text surface
 *    keeps an opaque ground of its own. If in doubt, favour the text.
 *
 * 2. NO CHROME. GoldenLayout is a dockable-workspace library and dresses every
 *    pane with maximise, close, popout and add-tab controls. This is a MUD,
 *    not an IDE: the layout is a design decision (§4.1), and a stray click
 *    should not be able to spawn an "UNTITLED" tab or close the map.
 *
 * 3. OLDER, NOT MODERN. Monospace throughout, square corners, hard 1px rules
 *    and a bevelled inset edge. No rounded corners, no blur, no gradients, no
 *    soft shadows -- the visual language of a terminal client, not a web app.
 */

:root {
  --aw-ink:      #dfe6ec;
  --aw-dim:      #8b98a5;
  --aw-faint:    #55616d;
  --aw-cyan:     #6fd8ea;
  --aw-edge:     #2b3a45;
  --aw-edge-lit: #3f5563;
  --aw-ground:   #05070a;
  --aw-mono: ui-monospace, "DejaVu Sans Mono", "Liberation Mono", Menlo,
             Consolas, monospace;
}

html, body {
  background: var(--aw-ground);
  font-family: var(--aw-mono);
}

/* ── background ─────────────────────────────────────────────────────────── */
/* Fixed layer so it never scrolls with the message window or repaints as
   panes resize. Same art as the rest of the site. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: url("../../website/images/bg-seam.webp");
  background-size: cover;
  background-position: 58% center;
  background-repeat: no-repeat;
  filter: blur(2px) saturate(0.75);
  transform: scale(1.04);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: rgba(5, 7, 10, 0.70);
}
@media (max-width: 900px) and (orientation: portrait) {
  body::before { background-image: url("../../website/images/bg-seam-portrait.webp"); }
}

/* ── the client sits in the page, not over it ───────────────────────────── */
/* Inset and capped so the art shows around the whole client: a window onto
   the world rather than a replacement for the browser chrome. */
#clientwrapper {
  box-sizing: border-box;
  height: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: clamp(10px, 2vh, 26px) clamp(10px, 2.5vw, 40px);
}

/* Layout containers stay transparent so the backdrop shows between panes. */
#main, #main-sub, #messagewindow,
.lm_goldenlayout, .lm_item, .lm_stack, .lm_items, .lm_root {
  background: transparent !important;
}

/* ── panes: hard edges, bevelled inset ──────────────────────────────────── */
.lm_content {
  background: rgba(6, 9, 13, 0.88) !important;
  border: 1px solid var(--aw-edge);
  /* Inner highlight + inner shade: a bevel, the way old GUI toolkits did it. */
  box-shadow: inset 1px 1px 0 rgba(120, 160, 185, 0.12),
              inset -1px -1px 0 rgba(0, 0, 0, 0.7);
  border-radius: 0 !important;
  overflow: auto;
  color: var(--aw-ink);
}

/* Gaps between panes show the background through. */
.lm_splitter { background: transparent !important; }
.lm_splitter:hover { background: rgba(111, 216, 234, 0.25) !important; }

/* ── headers: a label, nothing else ─────────────────────────────────────── */
.lm_header {
  background: transparent !important;
  height: 18px !important;
  margin-bottom: 1px;
}
.lm_header .lm_tab {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 0 0 2px !important;
  height: 16px !important;
  font-family: var(--aw-mono);
  font-size: 10px !important;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--aw-faint) !important;
}
.lm_header .lm_tab.lm_active { color: var(--aw-cyan) !important; }

/* Strip every interactive control GoldenLayout and Evennia add.
   - .lm_controls  : maximise / popout / close
   - .lm_close_tab : the x on a tab
   - .lm_header > .lm_title : Evennia's "+" split control, placed after the
     tab list (goldenlayout.js:279)
   - .lm_tab .lm_title ~ .lm_title : Evennia's per-tab rename / type / update
     arrows, appended after the real title as further .lm_title spans
     (goldenlayout.js:373-376) -- so everything after the first is chrome. */
.lm_controls,
.lm_close_tab,
.lm_header > .lm_title,
.lm_tab .lm_title ~ .lm_title,
.lm_maximise,
.lm_popout {
  display: none !important;
}

/* Panes are not draggable or reorderable; stop the cursor implying otherwise. */
.lm_header .lm_tab, .lm_drag_handle { cursor: default !important; }

/* ── text stream ────────────────────────────────────────────────────────── */
#messagewindow {
  padding: 0.5rem 0.7rem;
  font-family: var(--aw-mono);
  font-size: 14px;
  line-height: 1.5;
}
.out { color: var(--aw-ink); }
.prompt { color: var(--aw-cyan); }
.sys { color: #9ad0a8; }
.err { color: #e2777a; }

/* An empty pane should say why. Until the server sends the §4.2 OOB messages
   these are blank, and a blank box reads as breakage rather than the supported
   "no image" state (§7.2).

   Per-pane wording would be better, but GoldenLayout does not put the
   component name on the DOM -- doing it properly needs a small plugin that
   tags each pane as it registers, which is worth it in Phase 2 when the panes
   have content, not before. */
.lm_item .lm_content > div:empty::before {
  content: "nothing here yet";
  display: block;
  padding: 0.7rem;
  font-family: var(--aw-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--aw-faint);
}

/* ── input ──────────────────────────────────────────────────────────────── */
#input, #inputform, #inputcontrol { background: transparent !important; }

#inputfield {
  background: rgba(2, 4, 6, 0.92) !important;
  color: var(--aw-ink) !important;
  border: 1px solid var(--aw-edge) !important;
  border-radius: 0 !important;
  box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.8);
  font-family: var(--aw-mono);
  font-size: 16px;   /* below 16px, iOS zooms the page every time it is focused */
  padding: 4px 6px;
}
#inputfield:focus { outline: 1px solid var(--aw-cyan); outline-offset: -1px; }

#inputsend {
  background: rgba(10, 16, 20, 0.95) !important;
  border: 1px solid var(--aw-edge-lit) !important;
  border-radius: 0 !important;
  color: var(--aw-cyan) !important;
  font-family: var(--aw-mono);
  box-shadow: inset 1px 1px 0 rgba(120, 160, 185, 0.14),
              inset -1px -1px 0 rgba(0, 0, 0, 0.7);
}
#inputsend:hover { background: rgba(18, 28, 34, 0.95) !important; }

#toolbar {
  background: rgba(5, 7, 10, 0.92) !important;
  border-bottom: 1px solid var(--aw-edge);
}
