/* ATDT terminal page (SPEC §7.1): 640×400 canvas, integer-scaled,
   centered on black, pixelated. */

html, body {
    margin: 0;
    height: 100%;
    background: #000;
    overflow: hidden;
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#term {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    transform-origin: center center;
    background: #000;
}

/* Hidden input summons the mobile keyboard (§7.7) without being seen. */
#kbd {
    position: absolute;
    left: -9999px;
    top: 0;
    width: 1px;
    height: 1px;
    opacity: 0;
    border: 0;
    padding: 0;
}

/* Slim on-screen key row, shown only on coarse pointers (§7.7). */
#keyrow {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: #111;
    text-align: center;
}

#keyrow button {
    background: #222;
    color: #aaa;
    border: 1px solid #444;
    border-radius: 4px;
    font: 14px/1 monospace;
    padding: 8px 10px;
    margin: 0 2px;
}

#keyrow button:active {
    background: #333;
}

@media (pointer: coarse) {
    #keyrow {
        display: block;
    }
}

noscript pre {
    color: #aaaaaa;
    font: 16px/1.2 monospace;
}

/* Sysop broadcast strip (owner round 3): above the canvas, times itself out. */
#banner {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 20;
    background: #3a2a00;
    color: #ffd75f;
    border-bottom: 1px solid #7a5c00;
    font: 16px/1.6 ui-monospace, "Cascadia Mono", Consolas, monospace;
    text-align: center;
    padding: 6px 12px;
    text-shadow: 0 0 6px rgba(255, 215, 95, 0.45);
}

/* The door bar (1.8.0): a strip above the canvas while a door runs,
   after ATO's play page. Built by term.js when a door starts; the
   body class moves the canvas under it and it grows downward. */
#doorbar {
    display: none;
    width: 100%;
    box-sizing: border-box;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    padding: 6px 14px;
    background: #111;
    color: #aaa;
    border-bottom: 1px solid #333;
    font: 14px/1.4 ui-monospace, "Cascadia Mono", Consolas, monospace;
}

#doorbar .board { color: #777; }
#doorbar .door { color: #fff; font-weight: bold; }
#doorbar .dim:empty { display: none; }
/* The door's own status line (its switch on the DOS doors page): the
   machine screen's bottom rows, a row of terminal text under the facts. */
#doorbar .line {
    flex-basis: 100%;
    min-height: 2.6em;      /* two rows, always, once the row has shown */
    margin-top: 2px;
    color: #ddd;
    white-space: pre;
    overflow: hidden;
    font: 14px/1.3 ui-monospace, "Cascadia Mono", Consolas, monospace;
}
#doorbar .controls { margin-left: auto; display: flex; gap: 8px; }

#doorbar button {
    background: #222;
    color: #aaa;
    border: 1px solid #444;
    border-radius: 4px;
    font: 13px/1 ui-monospace, "Cascadia Mono", Consolas, monospace;
    padding: 6px 10px;
    cursor: pointer;
}

#doorbar button:hover { color: #fff; border-color: #777; }
#doorbar button.leave:hover { color: #ff6b6b; border-color: #a33; }

body.doorbar-on { justify-content: flex-start; }
body.doorbar-on #term { transform-origin: top center; margin-top: 8px; }

#doorkeys {
    position: fixed;
    right: 14px;
    top: 48px;
    max-width: 440px;
    z-index: 30;
    background: #111;
    color: #ccc;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 12px 16px;
    font: 14px/1.5 ui-monospace, "Cascadia Mono", Consolas, monospace;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}

#doorkeys[hidden] { display: none; }
#doorkeys h2 { margin: 0 0 8px; font-size: 14px; color: #fff; }
#doorkeys ul { margin: 0; padding-left: 18px; }
#doorkeys li { margin: 4px 0; }
#doorkeys p { margin: 10px 0 0; }

#doorkeys button {
    background: #222;
    color: #aaa;
    border: 1px solid #444;
    border-radius: 4px;
    font: 13px/1 ui-monospace, "Cascadia Mono", Consolas, monospace;
    padding: 6px 10px;
    cursor: pointer;
}

@media (max-width: 720px) {
    #doorbar { gap: 8px; padding: 6px 10px; }
    #doorbar .controls { margin-left: 0; }
}
