.setup { margin-bottom: 14px; }
.setup .note { margin: 8px 0 0; font-size: .85rem; color: rgba(20,73,54,.75); }
.setup .note.bad { color: #b3261e; font-weight: 600; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.small { font-size: .85rem; }
.lg-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 880px) { .lg-layout { grid-template-columns: 1fr; } }
.lg-layout aside { display: grid; gap: 16px; min-width: 0; }
.lg-main { min-width: 0; }

/* status bar (forked from legendofgrok/log.css) */
.lg-status { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(70px, 1fr) minmax(0, .8fr) minmax(76px, 1.1fr) minmax(0, .8fr) minmax(0, 1.4fr); gap: 8px; margin-bottom: 10px;
  padding: 8px 12px; border-radius: 12px; background: #0e7a36; color: #eaffef; }
.lg-status .k { display: block; font-size: .65rem; letter-spacing: .14em; text-transform: uppercase; opacity: .8; font-weight: 600; }
.lg-status .v { display: block; font-family: Chango, Georgia, serif; font-size: .9rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; line-height: 1.25; }
.lg-status .loc .v { font-size: .95rem; }
#s-score, #s-moves { white-space: nowrap; overflow-wrap: normal; }
.pips { display: inline-flex; gap: 2px; align-items: center; height: 1.2rem; }
.pips i { width: 6px; height: 14px; border-radius: 3px; background: rgba(255,255,255,.22); display: block; }
.pips i.on { background: #7dffa8; box-shadow: 0 0 6px rgba(125,255,168,.7); }
.pips i.low { background: #ffb4a8; box-shadow: 0 0 6px rgba(255,120,100,.7); }
@media (max-width: 560px) { .lg-status { grid-template-columns: 1fr 1fr 1fr; } .lg-status .loc { grid-column: 1 / -1; } .lg-status .rank { grid-column: span 2; } }

/* transcript */
.lg-log { height: clamp(300px, 52vh, 560px); overflow-y: auto; overscroll-behavior: contain; padding: 12px 14px; border-radius: 14px; background: #08150f;
  color: #d3f5de; border: 1px solid #0e7a36; box-shadow: inset 0 0 30px rgba(25,193,85,.12), 0 0 0 1px rgba(25,193,85,.12);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .95rem; line-height: 1.5; }
.lg-log:focus-visible { outline: 3px solid rgba(25,193,85,.5); }
.lg-log p { margin: 0 0 .55em; white-space: pre-line; overflow-wrap: anywhere; }
.lg-log .echo { color: #5dffa0; font-weight: 700; margin-top: .9em; }
.lg-log .room { font-family: Chango, Georgia, serif; color: #7dffa8; font-size: 1.05rem; margin-top: .4em; text-shadow: 0 0 10px rgba(125,255,168,.35); }
.lg-log .exits { color: #7ac8ff; }
.lg-log .items { color: #efe9a0; }
.lg-log .sys, .lg-log .amb { color: #8fb3a1; font-style: italic; }
.lg-log .warn { color: #ffcf6b; }
.lg-log .hint { color: #c8b6ff; }
.lg-log .pts { color: #ffe27a; font-weight: 600; }
.lg-log .trust { color: #7dffa8; }
.lg-log .trustdown { color: #ff9d8f; }
.lg-log .menuq { color: #fff; font-weight: 700; }
.lg-log .menuopt { padding-left: 1.2em; color: #bff3d1; }
.lg-log .choice { color: #bff3d1; }
.lg-log .divider { text-align: center; color: #5b8a70; letter-spacing: .2em; margin: .8em 0; }
.lg-log .endbox { border: 1px solid #7dffa8; border-radius: 12px; padding: 12px 14px; margin: .8em 0; background: rgba(25,193,85,.1); }
.lg-log .endbox h4 { font-family: Chango, Georgia, serif; font-weight: 400; margin: 0 0 .5em; color: #7dffa8; font-size: 1.25rem; }
.lg-log .endbox p { color: #e8fff0; }

/* chips */
.lg-cmd { margin-top: 10px; }
.lg-chips { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
@media (max-width: 560px) { .lg-log { height: clamp(220px, 40vh, 420px); font-size: .88rem; padding: 10px 11px; } .chip { padding: 5px 10px; font-size: .85rem; } }
.chiprow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chiprow .lab { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--brand-deep); font-weight: 600; min-width: 4.2em; }
.chip { font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; padding: 6px 12px; min-height: 36px; border-radius: 999px; border: 1px solid var(--brand); background: #fff; color: var(--ink); }
.chip:hover, .chip:focus-visible { background: rgba(25,193,85,.16); outline: none; border-color: var(--brand-deep); }
.chip.exit { background: rgba(25,193,85,.14); }
.chip.verb { border-style: dashed; }
.chip.menu { border-radius: 12px; text-align: left; max-width: 100%; }
.chip:disabled { opacity: .45; cursor: default; }

/* command line */
.lg-cmd { display: flex; align-items: center; gap: 8px; }
.lg-cmd .prompt { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; color: var(--brand-deep); font-size: 1.2rem; }
.lg-cmd input { margin-top: 0; font-size: 16px; font-family: ui-monospace, Menlo, Consolas, monospace; flex: 1 1 auto; min-width: 0; }
.lg-cmd .btn { flex: 0 0 auto; }
.tools { margin-top: 10px; gap: 8px; }
.tools .btn { flex: 1 1 auto; padding: 7px 12px; }
details.cmds { margin-top: 8px; font-size: .88rem; }
details.cmds summary { cursor: pointer; color: var(--brand-deep); font-weight: 600; }
details.cmds p { margin: 6px 0 0; }

/* side panels */
.slots { display: grid; gap: 6px; }
.slot { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.slot .nm { font-weight: 600; }
.slot .det { font-size: .82rem; color: rgba(20,73,54,.75); overflow-wrap: anywhere; }
.slot .acts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.slot .acts button { font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--brand); background: #fff; color: var(--brand-deep); }
.slot .acts button:hover:not(:disabled), .slot .acts button.sure { background: var(--brand); color: #fff; }
.slot .acts button:disabled { opacity: .4; cursor: default; }
.slot.empty .det { font-style: italic; }
.endlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.endlist li { display: flex; justify-content: space-between; gap: 8px; padding: 5px 9px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-size: .95rem; }
.endlist li.found { border-color: var(--brand); background: rgba(25,193,85,.12); font-weight: 600; }
.endlist li .kind { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--brand-deep); align-self: center; }
.end-card { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(25,193,85,.18), 0 10px 30px rgba(20,73,54,.1); }
.end-card h3 { margin-bottom: 6px; }
.end-card .big { font-family: Chango, Georgia, serif; font-size: 2rem; color: var(--brand-deep); margin: 4px 0; }
.end-card .btn { margin: 8px 8px 0 0; }
.end-card p { margin: .3em 0; }

/* ---- The Legend of El0n additions ---- */
.loe-title { font-size: clamp(2rem, 5vw, 3rem); margin: 6px 0 4px; }
.loe-tag { margin: 0 0 14px; color: var(--brand-deep); font-weight: 600; }
.lg-log .lesson { color: #9be7ff; font-weight: 700; }
.lg-log .build { color: #ffd27a; font-weight: 700; }
.lg-log .stall { color: #ffb4a8; font-weight: 700; border-left: 3px solid #ff8a7a; padding-left: 8px; }
.lg-log .picnote { color: #c8b6ff; font-style: italic; }
.lessons { margin: 0; padding-left: 1.2em; font-size: .92rem; }
.lessons li { margin: 2px 0; }
.lessons li.no { color: rgba(20,73,54,.45); list-style: circle; }
@media (max-width: 560px) { .lg-status { grid-template-columns: 1fr 1fr 1fr; } }
.lg-status { grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); }
.lg-status .loc { grid-column: span 2; }
@media (max-width: 560px) { .lg-status { grid-template-columns: 1fr 1fr 1fr; } .lg-status .loc { grid-column: 1 / -1; } }
/* header links + player docs pages (about.html, commands.html) */
.loe-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.loe-links { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.loe-links a { font-weight: 600; color: var(--brand-deep); text-decoration: none; padding: 5px 12px; min-height: 34px; display: inline-flex; align-items: center; border: 1px solid var(--brand); border-radius: 999px; background: #fff; }
.loe-links a:hover, .loe-links a:focus-visible { background: rgba(25,193,85,.16); outline: none; }
.doc-nav { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 14px; }
.doc-nav .back { font-weight: 600; }
.doc { line-height: 1.6; overflow-wrap: anywhere; }
.doc h1 { margin-top: 0; }
.doc h2 { font-family: Chango, Georgia, serif; font-weight: 400; font-size: 1.35rem; margin: 1.4em 0 .5em; color: var(--brand-deep); scroll-margin-top: 12px; }
.doc h3 { font-family: Gluten, Georgia, serif; font-weight: 600; font-size: 1.12rem; margin: 1.1em 0 .3em; scroll-margin-top: 12px; }
.doc ul { padding-left: 1.3em; margin: .4em 0 .8em; }
.doc li { margin: .2em 0; }
.doc code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .88em; background: #08150f; color: #7dffa8; padding: 1px 6px; border-radius: 6px; white-space: nowrap; }
.doc hr { border: 0; border-top: 1px dashed rgba(20,73,54,.25); margin: 1.4em 0; }
.doc a { color: var(--brand-deep); }
.doc-table { overflow-x: auto; margin: .6em 0 1em; }
.doc-table table { min-width: 520px; }
.doc-table td code { white-space: normal; }
.doc-toc { margin-bottom: 14px; }
.doc-toc ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.doc-toc a { display: inline-block; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: #fff; text-decoration: none; font-weight: 600; font-size: .9rem; }
.doc-foot { text-align: center; margin-top: 18px; }
.doc-foot .btn { text-decoration: none; display: inline-block; }
@media (max-width: 560px) { .doc { padding: 14px; font-size: .97rem; } .doc code { white-space: normal; } }
/* status grid in a narrower column (chat side rail): rank gets two cells and only breaks between words */
.lg-status .rank { grid-column: span 2; }
.lg-status .rank .v { overflow-wrap: break-word; }

/* Site neon chrome and one-screen shell (body.loe-page). Playfield size stays with the game JS. */
html:has(body.loe-page), body.loe-page {
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  color-scheme: dark;
}
body.loe-page {
  min-height: 0;
  touch-action: manipulation;
  background-image: none;
  background: transparent;
  color: var(--fx-text, #e6fff0);
}
body.loe-page, body.loe-page * { box-sizing: border-box; }
body.loe-page .game-wrap {
  width: 100%;
  max-width: 1500px;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 auto;
  padding: max(6px, env(safe-area-inset-top)) 12px max(8px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
  z-index: 1;
  box-sizing: border-box;
}
body.loe-page .back {
  margin: 0; flex-shrink: 0; color: var(--fx-neon, #3dff8a); font-size: 0.92rem; text-decoration: none;
}
body.loe-page .loe-title, body.loe-page h1 {
  margin: 0;
  color: var(--fx-text, #e6fff0);
  filter: drop-shadow(0 0 12px rgba(25, 193, 85, 0.4));
}
body.loe-page .loe-tag { color: var(--fx-dim, #a6d8bb); margin: 0; }
body.loe-page .loe-links a,
body.loe-page .loe-boards-btn,
body.loe-page .loe-boards-close {
  font-weight: 600;
  color: var(--fx-text, #e6fff0);
  text-decoration: none;
  padding: 4px 12px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--fx-edge, rgba(61, 255, 138, 0.24));
  border-radius: 999px;
  background: rgba(25, 193, 85, 0.08);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}
body.loe-page .loe-links a:hover,
body.loe-page .loe-boards-btn:hover,
body.loe-page .loe-boards-close:hover {
  background: rgba(25, 193, 85, 0.16);
  border-color: var(--fx-neon, #3dff8a);
  outline: none;
}
body.loe-page .loe-links { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
body.loe-page .loe-boards-btn { display: none; }
body.loe-page .loe-boards-close { display: none; font-size: 0.9rem; margin-left: auto; }
body.loe-page .loe-side-head { display: none; }
body.loe-page .panel {
  background: linear-gradient(160deg, rgba(10, 46, 28, 0.92), rgba(3, 15, 9, 0.92) 55%);
  border: 1px solid var(--fx-edge, rgba(61, 255, 138, 0.24));
  color: var(--fx-text, #e6fff0);
}
body.loe-page .lg-layout {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  align-items: stretch;
  grid-template-rows: minmax(0, 1fr);
}
body.loe-page .lg-main {
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
}
body.loe-page .lg-log {
  flex: 1 1 auto;
  min-height: 10rem;
  height: auto;
  max-height: none;
}
body.loe-page .lg-cmd,
body.loe-page .lg-chips,
body.loe-page .kit,
body.loe-page .tools {
  flex-shrink: 0;
}
body.loe-page .lg-layout aside { min-height: 0; overflow: auto; }
body.loe-page label.field { color: var(--fx-neon, #3dff8a); }
body.loe-page input[type=text],
body.loe-page select {
  color: var(--fx-text, #e6fff0);
  background: rgba(3, 15, 9, 0.72);
  border: 1px solid rgba(61, 255, 138, 0.3);
  border-radius: 12px;
}
body.loe-page input:focus, body.loe-page select:focus {
  outline: 2px solid var(--fx-neon, #3dff8a); outline-offset: 1px; border-color: var(--fx-neon, #3dff8a);
}
body.loe-page .btn {
  font: inherit; font-weight: 600; cursor: pointer; border: 0; padding: 8px 16px; border-radius: 999px;
  background: linear-gradient(180deg, #3dff8a, #19c155); color: #03140b; box-shadow: 0 0 18px rgba(25, 193, 85, 0.45);
}
body.loe-page .btn.ghost {
  background: rgba(25, 193, 85, 0.08); color: var(--fx-text, #e6fff0); box-shadow: none;
  border: 1px solid var(--fx-edge, rgba(61, 255, 138, 0.24));
}
body.loe-page .note, body.loe-page .muted, body.loe-page .small { color: var(--fx-dim, #a6d8bb); }
body.loe-page .tab {
  background: rgba(3, 15, 9, 0.55); color: var(--fx-dim, #a6d8bb);
  border-color: var(--fx-edge, rgba(61, 255, 138, 0.24));
}
body.loe-page .tab.on {
  background: rgba(25, 193, 85, 0.16); color: #7dffb0; border-color: var(--fx-neon, #3dff8a);
}
body.loe-page .msg { color: #7dffb0; }
#app > .loe-boards-check {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
  border: 0; padding: 0; margin: -1px;
}
#app > .loe-boards-mask { display: none; }
@media (min-width: 800px) {
  body.loe-page .ggc-fab { right: 20px; }
}
@media (max-width: 880px) {
  body.loe-page .loe-boards-btn { display: inline-flex; }
  body.loe-page .loe-side-head { display: flex; justify-content: flex-end; margin-bottom: 6px; }
  body.loe-page .lg-layout aside {
    display: none;
    position: fixed;
    inset: max(10px, env(safe-area-inset-top)) 12px max(10px, env(safe-area-inset-bottom));
    z-index: 90;
    max-width: 420px;
    margin: 0 auto;
    overflow: auto;
    background: linear-gradient(160deg, rgba(10, 46, 28, 0.98), rgba(3, 15, 9, 0.98) 55%);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7), 0 0 30px rgba(25, 193, 85, 0.25);
    padding: 12px;
    border-radius: 16px;
    border: 1px solid var(--fx-edge, rgba(61, 255, 138, 0.24));
  }
  #loe-show-boards:checked ~ .loe-boards-mask {
    display: block; position: fixed; inset: 0; z-index: 85; background: rgba(0, 0, 0, 0.62); cursor: pointer;
  }
  body.loe-page .loe-boards-close { display: inline-flex; }
  #loe-show-boards:checked ~ .lg-layout aside { display: grid; }
  #loe-show-boards:checked ~ .loe-head .loe-boards-btn,
  #loe-show-boards:checked ~ * .loe-boards-btn {
    border-color: var(--fx-neon, #3dff8a); background: rgba(25, 193, 85, 0.2);
  }
  body.loe-page .game-wrap { overflow: auto; }
  body.loe-page .lg-layout { overflow: visible; height: auto; flex: 0 0 auto; }
}
@media (max-width: 640px) {
  body.loe-page .back-full { display: none; }
  body.loe-page .game-wrap { padding-left: 6px; padding-right: 6px; gap: 6px; }
  body.loe-page #start, body.loe-page .setup .btn:not(.ghost) {
    width: calc(100% - 7rem);
    max-width: calc(100% - 7rem);
    box-sizing: border-box;
  }
}
@media (prefers-reduced-motion: reduce) {
  body.loe-page .btn:active { transform: none; }
}
