/* Exodus server sheet: a cyanotype blueprint.
   Paper is Prussian blue, everything is drawn in white ink. Red pencil marks what is
   destructive or broken, yellow highlighter marks what needs attention.
   The background grid has a heavier line every 16 cells: one Minecraft chunk. */

@font-face { font-family: "Osifont"; src: url("/fonts/osifont.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/fonts/Barlow-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/fonts/Barlow-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/fonts/Barlow-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }

:root {
  --paper: #1b3f6e;
  --well: #14325a;        /* recessed areas: console, inputs */
  --ink: #eef3fb;
  --ink-soft: rgba(238, 243, 251, .66);
  --rule: rgba(238, 243, 251, .42);
  --hair: rgba(238, 243, 251, .16);
  --red: #ff8f7d;         /* red pencil */
  --hi: #ffd84a;          /* highlighter */
  --cell: 8px;
  --gap: 28px;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "DejaVu Sans Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
body {
  margin: 0; color: var(--ink);
  font: 400 16px/1.5 Barlow, "Segoe UI", system-ui, sans-serif;
}
html {
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--hair) 1px, transparent 1px),
    linear-gradient(90deg, var(--hair) 1px, transparent 1px),
    linear-gradient(rgba(238, 243, 251, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(238, 243, 251, .05) 1px, transparent 1px);
  background-size: calc(var(--cell) * 16) calc(var(--cell) * 16), calc(var(--cell) * 16) calc(var(--cell) * 16),
                   var(--cell) var(--cell), var(--cell) var(--cell);
}
.hidden { display: none !important; }
h1, h2, h3, p { margin: 0; }
.lettering { font-family: Osifont, Barlow, sans-serif; font-weight: 400; letter-spacing: .01em; line-height: 1; }
:focus-visible { outline: 2px dashed var(--hi); outline-offset: 3px; }

/* ---------- sheet frame ---------- */
.sheet {
  max-width: 1360px; margin: 24px auto; padding: 0 24px 48px;
}
.sheet > * + * { margin-top: var(--gap); }

/* ---------- title block ---------- */
.titleblock {
  position: relative;
  display: grid;
  grid-template-columns: minmax(260px, 1.6fr) minmax(220px, 1.4fr) repeat(3, minmax(120px, 1fr)) minmax(250px, 1.5fr);
  border: 2px solid var(--ink);
  background: var(--paper);
}
.tb-cell {
  display: grid; grid-template-rows: auto 1fr auto; align-items: end; gap: 10px;
  padding: 14px 16px 16px; border-left: 1px solid var(--rule); min-width: 0;
}
.tb-cell:first-child { border-left: 0; }
.tb-label { font-size: 13px; color: var(--ink-soft); }
.tb-sub { font-size: 13px; color: var(--ink-soft); min-height: 1.2em; }
.tb-cell strong { font-size: 34px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tb-project h1 { font-size: clamp(48px, 5.4vw, 76px); margin: 2px 0 -4px; }
.tb-state .state { font-size: clamp(40px, 4.2vw, 60px); }
.state.is-down, .red-text { color: var(--red); }
.state.is-busy, .hi-text { color: var(--hi); }
.tb-controls { display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.signout {
  position: absolute; right: -2px; top: -30px;
  background: none; border: 0; color: var(--ink-soft); font: inherit; font-size: 14px; cursor: pointer; padding: 4px 0;
}
.signout:hover { color: var(--ink); text-decoration: underline; }

/* ---------- bands (sections) ---------- */
.band { border-top: 1px solid var(--rule); padding-top: 14px; }
.band h2 { font-family: Osifont, Barlow, sans-serif; font-weight: 400; font-size: 24px; margin-bottom: 16px; }
.band h3 { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.band-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.band-head h2 { margin: 0; }
.aside { margin-top: 14px; font-size: 14px; color: var(--ink-soft); max-width: 72ch; }
.split { display: grid; grid-template-columns: 1.7fr 1fr; gap: 40px; }

/* ---------- controls ---------- */
.btn {
  font: 500 15px Barlow, sans-serif; color: var(--ink); background: transparent;
  border: 1.5px solid var(--ink); border-radius: 2px; padding: 7px 14px; cursor: pointer; white-space: nowrap;
}
.btn:hover:not(:disabled) { background: rgba(238, 243, 251, .1); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn.ink { background: var(--ink); color: var(--paper); font-weight: 600; }
.btn.ink:hover:not(:disabled) { background: #fff; }
.btn.red { color: var(--red); border-color: var(--red); }
.btn.red:hover:not(:disabled) { background: rgba(255, 143, 125, .12); }
.controls { display: flex; flex-wrap: wrap; gap: 8px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-soft); cursor: pointer; }
.check input { accent-color: var(--ink); width: 15px; height: 15px; }
.note { font-size: 14px; min-height: 1.3em; color: var(--ink-soft); }
.note.is-error { color: var(--red); }
.tag { font-size: 13px; border: 1px solid var(--rule); padding: 1px 8px; color: var(--ink-soft); }
.tag.is-live { color: var(--ink); border-color: var(--ink); }
.tag.is-busy { color: var(--hi); border-color: var(--hi); }

input.inline, .field input {
  font: inherit; color: var(--ink); background: var(--well);
  border: 0; border-bottom: 1.5px solid var(--ink); border-radius: 0; padding: 8px 10px; min-width: 0;
}
input::placeholder { color: rgba(238, 243, 251, .4); }

/* ---------- online players: inventory slots ---------- */
.slots { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; min-height: 92px; }
.slot {
  width: 112px; padding: 10px 8px 8px; border: 1.5px solid var(--ink); background: var(--well);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.slot img { width: 48px; height: 48px; image-rendering: pixelated; border: 1px solid var(--rule); }
.slot .who { font-weight: 600; font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.slot .acts { display: flex; gap: 10px; }
.slots .empty { align-self: center; color: var(--ink-soft); }
.linkish { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; color: var(--ink-soft); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.linkish:hover { color: var(--red); }

/* ---------- measurements: dimension lines ---------- */
.dims { display: grid; grid-template-columns: 1fr 1fr; gap: 26px 48px; }
.dim { display: grid; grid-template-columns: 150px 1fr auto; align-items: end; gap: 14px; }
.dim-name { font-size: 15px; padding-bottom: 1px; }
.dim-max { font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
.dim-line { position: relative; height: 36px; border-left: 1px solid var(--rule); border-right: 1px solid var(--rule); }
.dim-line::after {   /* extension line: the full scale */
  content: ""; position: absolute; left: 0; right: 0; bottom: 6px; border-bottom: 1px dashed var(--rule);
}
.dim-line i {        /* the measured part, drawn as a dimension line with ticks */
  position: absolute; left: 0; bottom: 6px; height: 0; width: 0; border-bottom: 2px solid var(--ink);
  transition: width .6s cubic-bezier(.2, .7, .2, 1);
}
.dim-line i::before, .dim-line i::after {
  content: ""; position: absolute; bottom: -7px; width: 2px; height: 12px; background: var(--ink);
}
.dim-line i::before { left: 0; }
.dim-line i::after { right: -1px; transform: skewX(-35deg); }
.dim-line b {
  position: absolute; bottom: 12px; left: 0; font: 400 19px Osifont, sans-serif; white-space: nowrap;
  transform: translateX(-50%); transition: left .6s cubic-bezier(.2, .7, .2, 1);
}
.dim.is-high .dim-line i, .dim.is-high .dim-line i::before, .dim.is-high .dim-line i::after { border-color: var(--hi); background-color: var(--hi); }
.dim.is-high .dim-line i { background: none; }
.dim.is-high b { color: var(--hi); }

/* ---------- console ---------- */
.console-tools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
#filter { width: 220px; padding: 5px 8px; }
.log {
  height: 480px; overflow: auto; margin: 0; padding: 12px 14px;
  background: var(--well); border: 1.5px solid var(--ink);
  font: 13px/1.55 var(--mono); white-space: pre-wrap; word-break: break-word; color: rgba(238, 243, 251, .82);
}
.log .l-warn { color: var(--hi); }
.log .l-err { color: var(--red); }
.log .l-chat { color: #fff; font-weight: 600; }
.log .l-join { color: #a9d8ff; }
.log .l-me { color: var(--paper); background: var(--ink); margin: 2px -14px; padding: 0 14px; }
.log .l-me.l-err { color: var(--paper); background: var(--red); }
.cmd { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--ink); border-top: 0; padding: 6px 6px 6px 14px; background: var(--well); }
.cmd .slash { font: 22px Osifont, sans-serif; }
.cmd input { flex: 1; min-width: 0; font: 15px var(--mono); color: var(--ink); background: transparent; border: 0; padding: 6px 0; }
.cmd input:focus-visible { outline: none; }
.cmd:focus-within { box-shadow: 0 0 0 2px var(--hi); }

/* ---------- player lists ---------- */
.player-form { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
#player-name { flex: 1 1 180px; }
.lists { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.names { list-style: none; margin: 0; padding: 0; }
.names li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--hair); }
.names img { width: 22px; height: 22px; image-rendering: pixelated; }
.names .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.names .empty { color: var(--ink-soft); border: 0; }
.chunky { white-space: pre-wrap; margin-bottom: 16px; font-size: 15px; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-sheet {
  width: min(380px, 100%); border: 2px solid var(--ink); background: var(--paper);
  display: grid; gap: 18px; padding: 0 0 20px;
}
.login-sheet .tb-project { padding: 14px 20px 16px; border-bottom: 1px solid var(--rule); display: grid; gap: 6px; }
.login-sheet .tb-project h1 { font-size: 64px; }
.login-sheet > :not(.tb-project) { margin: 0 20px; }
.field { display: grid; gap: 6px; font-size: 14px; color: var(--ink-soft); }
#code { font: 26px Osifont, sans-serif; letter-spacing: .25em; }
.login-sheet .note { color: var(--red); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .titleblock { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tb-project { grid-column: 1 / -1; border-bottom: 1px solid var(--rule); }
  .tb-state { border-left: 0; }
  .tb-controls { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--rule); flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; }
  .tb-cell:nth-child(n+3):nth-child(-n+5) { border-top: 1px solid var(--rule); }
  .tb-state { grid-column: 1 / -1; }
  .tb-cell:nth-child(3) { border-left: 0; }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .sheet { padding: 0 12px 32px; margin-top: 44px; }
  .dims { grid-template-columns: 1fr; }
  .dim { grid-template-columns: 1fr auto; }
  .dim-name { grid-column: 1 / -1; }
  .lists { grid-template-columns: 1fr; }
  .tb-cell strong { font-size: 28px; }
  .log { height: 360px; }
  .slot { width: calc(50% - 6px); }
}
@media (prefers-reduced-motion: reduce) {
  .dim-line i, .dim-line b { transition: none; }
}
