:root { --acc: #e8a33d; --mono: Consolas, Menlo, 'DejaVu Sans Mono', 'Liberation Mono', monospace; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #000; color: #d6d6d6; font: 15px/1.55 var(--mono); }
body { overflow-x: hidden; }
a { color: var(--acc); }
code { color: var(--acc); }
::selection { background: var(--acc); color: #000; }

#ascii { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; display: block; }

#chrome { position: fixed; inset: 8px 12px auto 12px; z-index: 40; display: flex; gap: 14px; align-items: center; pointer-events: none; }
#chrome > * { pointer-events: auto; }
#logo { font-size: 22px; font-weight: 700; color: #fff; text-decoration: none; margin-right: auto; background: #000; padding: 0 6px; }
#chrome button { background: #000; color: #999; border: 1px solid #333; font: 13px var(--mono); padding: 2px 8px; cursor: pointer; }
#chrome button:hover { color: var(--acc); border-color: var(--acc); }

#logbook {
  position: fixed; top: 44px; right: 12px; z-index: 40; width: 340px; max-height: 78vh; overflow: auto;
  background: #000; border: 1px solid var(--acc); padding: 10px 12px; font-size: 13px; line-height: 1.5;
}
#logbook a { color: #ddd; text-decoration: none; }
#logbook a:hover { color: var(--acc); }

#stage { position: relative; z-index: 10; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 56px 16px; }

.panel { width: min(780px, 94vw); background: #000; border: 2px solid var(--acc); box-shadow: 8px 8px 0 #111; }
.bar { display: flex; justify-content: space-between; gap: 18px; background: var(--acc); color: #000; font-weight: 700; padding: 2px 10px; }
.puzzle { padding: 14px 18px 8px; overflow-x: auto; }
.puzzle p { margin: 0 0 12px; }
.dim { color: #808080; }
.center { text-align: center; }
pre { margin: 0 0 12px; font-family: var(--mono); line-height: 1.12; }
pre.center { display: block; width: max-content; max-width: 100%; margin-left: auto; margin-right: auto; text-align: left; }
.big { font-size: 11px; line-height: 11px; color: var(--acc); }
.small { font-size: 12px; line-height: 1.4; color: #bbb; }
.cipher { color: var(--acc); font-size: 15px; white-space: pre-wrap; line-height: 1.7; word-spacing: 2px; }
.ua { word-break: break-all; }
.blink { color: #ff0; animation: blink 1s steps(2, start) infinite; font-weight: 700; }
@keyframes blink { to { visibility: hidden; } }

.btn, #answer button, #wall button {
  background: #000; color: var(--acc); border: 1px solid var(--acc); font: 14px var(--mono);
  padding: 3px 12px; cursor: pointer; text-decoration: none; display: inline-block;
}
.btn:hover, #answer button:hover { background: var(--acc); color: #000; }
.btn:disabled { opacity: .4; cursor: default; }
.btn.on { background: var(--acc); color: #000; }
.lift { display: inline-block; border: 1px solid #444; padding: 8px; margin: 0 0 12px; }
.lift div { display: flex; gap: 6px; margin-bottom: 6px; }
.lift a { white-space: pre; min-width: 44px; text-align: center; }

input { background: #000; color: #fff; border: 1px solid #555; font: 15px var(--mono); padding: 3px 8px; outline: none; }
input:focus { border-color: var(--acc); }

#answer { display: flex; gap: 8px; align-items: center; padding: 10px 18px; border-top: 1px solid #222; }
#answer label { color: var(--acc); font-weight: 700; }
#answer input { flex: 1; min-width: 0; border: 0; border-bottom: 1px solid var(--acc); }
#status { min-height: 26px; padding: 0 18px 8px; color: #aaa; font-size: 13px; white-space: pre-wrap; }
#status.bad { color: #ff5a5a; }
#status.good { color: #7fe0a0; }
.shake { animation: shake .28s linear; }
@keyframes shake { 25% { transform: translateX(-7px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }

body.wide { overflow: hidden; }
body.wide #stage { display: block; padding: 0; min-height: 0; }
.panel.wide { position: fixed; left: 0; right: 0; bottom: 0; width: 100%; height: 158px; box-shadow: none; border-width: 2px 0 0; z-index: 20; }
.panel.wide .puzzle { padding: 6px 18px 0; overflow: visible; }
#loom {
  position: fixed; top: 0; left: 0; width: 100vw; bottom: 158px; overflow: hidden; background: #000; color: #bbb;
  font: 10px/10px var(--mono); white-space: pre-wrap; word-break: break-all; line-break: anywhere; z-index: 15; margin: 0; padding: 0;
}
.view { display: block; width: 100%; background: #000; margin: 0 0 12px; }
#sema-view { height: 400px; }
#keys-view { height: 230px; }
#dial-view { height: 240px; }
