/* loading-console.css: field loading as a console terminal (PS1 skin; the first full-screen load and the small hold strip share it).
   Frames are the official observer images through --ob-frame-window / --ob-frame-inset / --ob-frame-btn (border-image); CSS only places them.
   Liz = the old observer: warm grey ink on near-black. Elvi = black and green terminal. The prompt and cursor are pseudo-elements, so the status text stays the plain message. */
.lc {
  --lc-face: #0b0a09; --lc-fg: var(--ob-ink, #e8e2d4); --lc-dim: var(--ob-ink-2, #958f83);
  font: 15px/1.6 ui-monospace, 'Cascadia Mono', Consolas, 'BIZ UDGothic', 'MS Gothic', 'Noto Sans Mono CJK JP', monospace;
  color: var(--lc-fg); box-sizing: border-box;
}
.lc[data-who=elvi] { --lc-face: #030704; --lc-fg: #7be28f; --lc-dim: #4f9a5f; }
.lc *, .lc *::before, .lc *::after { box-sizing: border-box; }
.lc[hidden] { display: none; }

/* first load / context rebuild: full screen, modal */
.lc--full {
  position: fixed; inset: 0; z-index: 1000; place-items: center;
  background-color: var(--ob-void, #0c0d10); background-image: var(--ob-backplate, none); background-size: cover;
}
.lc--full .lc__panel {
  width: min(420px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; margin: auto;
  padding: 20px 18px; text-align: left; outline: none;
  background: var(--lc-face); background-clip: padding-box;
  border: 12px solid transparent; border-image: var(--ob-frame-window);
}

/* later model preparation: small non-modal strip over the kept frame */
.lc--compact {
  position: fixed; left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 999;
  display: flex; align-items: center; gap: 10px; max-width: min(420px, calc(100vw - 24px));
  padding: 4px 10px; font-size: 13px; pointer-events: none;
  background: var(--lc-face); background-clip: padding-box;
  border: 8px solid transparent; border-image: var(--ob-frame-inset);
}

.lc__status { position: relative; margin: 0; padding-left: 1.4em; overflow-wrap: anywhere; text-wrap: balance; }
.lc__status::before { content: '>'; position: absolute; left: 0; color: var(--lc-dim); }
.lc[data-state=error] .lc__status::before { content: '!'; color: var(--lc-fg); }
.lc[data-state=loading] .lc__status::after {
  content: ''; display: inline-block; width: .6em; height: 1.1em; margin-left: .3em; vertical-align: text-bottom;
  background: var(--lc-fg); opacity: .8; animation: lc-blink 1.1s steps(1) infinite;
}
@keyframes lc-blink { 50% { opacity: 0; } }

.lc__retry {
  display: block; min-height: 44px; margin: 12px 0 0 1.4em; padding: 2px 14px; pointer-events: auto;
  font: inherit; color: var(--lc-fg); background: none; cursor: pointer;
  border: 6px solid transparent; border-image: var(--ob-frame-btn);
}
.lc--compact .lc__retry { min-height: 32px; margin: 0; }
.lc__retry[hidden] { display: none; }
.lc__log { display: none; }
.lc__retry::before { content: '> '; color: var(--lc-dim); }
.lc__retry:focus-visible { outline: 2px solid var(--lc-fg); outline-offset: 2px; }

/* Desktop/landscape: a full terminal face, not a small centred card. The
   console owns the viewport and keeps its prompt at the upper-left, where a
   person reads a terminal log. Phones keep the compact framed panel above. */
@media (min-width: 680px) {
  .lc--full {
    display: grid;
    place-items: stretch;
    padding: clamp(18px, 3.2vw, 48px);
  }
  .lc--full .lc__panel {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    padding: clamp(18px, 2.4vw, 38px);
    overflow: auto;
    border: 0;
    border-image: none;
    background: transparent;
  }
  .lc--full .lc__panel::before {
    content: 'SLEEPWELL // FIELD LOAD';
    display: block;
    margin: 0 0 clamp(12px, 2dvh, 28px);
    padding-bottom: 8px;
    border-bottom: 1px solid color-mix(in srgb, var(--lc-fg) 28%, transparent);
    color: var(--lc-dim);
    font-size: 12px;
    letter-spacing: .16em;
  }
  .lc--full .lc__log {
    display: block; margin: 0 0 6px; padding: 0; list-style: none;
    font-size: clamp(14px, 1vw, 18px); line-height: 1.55; color: var(--lc-dim); white-space: pre-wrap;
  }
  .lc--full .lc__log li:last-child[data-spin]::after { content: ' ' attr(data-spin); color: var(--lc-fg); }
  .lc--full .lc__log li:not(:last-child) { opacity: .85; }
  .lc--full .lc__status { font-size: clamp(16px, 1.15vw, 21px); padding-left: 1.6em; }
  .lc--full .lc__retry { margin-top: 18px; }
}

/* reduced motion: a still cursor (the OS setting, or the game's own reduced-motion setting via data-still) */
.lc[data-still='1'] .lc__status::after { animation: none; opacity: .8; }
@media (prefers-reduced-motion: reduce) { .lc[data-state=loading] .lc__status::after { animation: none; opacity: .8; } }

@media (max-width: 340px) {
  .lc { font-size: 14px; }
  .lc--full .lc__panel { padding: 16px 12px; }
  .lc--compact { flex-wrap: wrap; }
}
