/* Monomachia - web shell.
   The game draws into a fixed 72x20 character grid, so the page is only in charge of
   scaling that grid to the available space (itch.io iframe, full tab, phone, ...). */

:root {
    --bg: #0c0c0c;
    --fg: #f2f2f2;
    --dim: #767676;
    --accent: #c19c00;
    --font: "Cascadia Mono", "Consolas", "Menlo", "DejaVu Sans Mono", ui-monospace, monospace;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* No text selection : a drag on the screen must not highlight the sprites. */
    -webkit-user-select: none;
    user-select: none;
    -webkit-text-size-adjust: 100%;
}

#stage {
    flex: 1 1 auto;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}

#screen {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    /* Overwritten by main.js */
    line-height: 1.15;
    letter-spacing: 0;
    white-space: pre;
    font-variant-ligatures: none;
    font-kerning: none;
    text-rendering: optimizeSpeed;
}

/* One div per console line, one span per run of same colored cells.
   Runs are sized in "ch" so a glyph missing from the monospace font
   (and replaced by a wider one) can never shift the rest of the line. */
#screen .l {
    height: 1.15em;
}

#screen span {
    display: inline-block;
    overflow: hidden;
    white-space: pre;
    vertical-align: top;
}

/* --- Touch pad ---------------------------------------------------------- */

#pad {
    display: none;
    gap: 12px;
    padding: 10px 10px 16px;
    flex: 0 0 auto;
}

#pad button {
    min-width: 88px;
    min-height: 52px;
    font-family: var(--font);
    font-size: 20px;
    color: var(--fg);
    background: #1c1c1c;
    border: 2px solid var(--dim);
    border-radius: 8px;
}

#pad button:active {
    background: var(--accent);
    color: #0c0c0c;
}

@media (pointer: coarse) {
    #pad {
        display: flex;
    }
}

#probe {
    position: absolute;
    visibility: hidden;
    top: -1000px;
    left: -1000px;
    font-family: var(--font);
    font-size: 100px;
    line-height: 1;
    white-space: pre;
}
