.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; }

/* Zork-style status bar */
.lg-status { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(70px, 1fr) minmax(0, .9fr) minmax(76px, 1.1fr) minmax(0, 1.5fr); 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; }
