/* §10: CRT treatment on the terminal pane only. Scanlines over a status table
   just make it hard to read. */

@font-face {
    font-family: "ModeSeven";
    src: url("/client/font/ModeSeven.woff2") format("woff2"),
         url("/client/font/ModeSeven.woff") format("woff"),
         url("/client/font/ModeSeven.ttf") format("truetype");
    font-display: swap;
}

:root {
    --bg: #141414;
    --fg: #ccccee;
    --dim: #6b6b85;
    --warn: #d8b26a;
    --bad: #c96a5a;
    --panel: #1b1b1b;
    --line: #2c2c34;
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: "ModeSeven", "Courier New", monospace;
    font-size: 16px;
    -webkit-font-smoothing: none;
}

.hidden {
    display: none !important;
}

.dim {
    color: var(--dim);
}

button {
    font: inherit;
    color: var(--fg);
    background: transparent;
    border: 1px solid var(--line);
    padding: 6px 10px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
}

button:hover:not(:disabled) {
    background: #23232b;
}

button:disabled {
    color: var(--dim);
    cursor: not-allowed;
}

input {
    font: inherit;
    color: var(--fg);
    background: #101014;
    border: 1px solid var(--line);
    padding: 6px 8px;
    text-transform: uppercase;
}

/* --- lobby ------------------------------------------------------------- */

.lobby {
    display: grid;
    place-items: center;
    height: 100%;
    padding: 20px;
}

.lobby-inner {
    width: min(640px, 100%);
}

.lobby h1 {
    font-size: 28px;
    letter-spacing: 4px;
    margin: 0 0 4px;
}

.sub {
    color: var(--dim);
    margin: 0 0 24px;
    letter-spacing: 2px;
}

.panel {
    border: 1px solid var(--line);
    background: var(--panel);
    padding: 16px;
    margin-bottom: 16px;
}

.panel label {
    display: block;
    margin-bottom: 12px;
    color: var(--dim);
}

.panel label input {
    display: block;
    margin-top: 6px;
    width: 100%;
}

.row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.row input {
    width: 90px;
}

.error {
    color: var(--bad);
    min-height: 1.2em;
    margin: 8px 0 0;
}

.hint {
    color: var(--dim);
    font-size: 14px;
}

.code strong {
    letter-spacing: 4px;
}

.roles {
    list-style: none;
    padding: 0;
    margin: 12px 0;
}

.roles li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid var(--line);
}

.roles .who {
    margin-left: auto;
    color: var(--dim);
}

/* --- game layout -------------------------------------------------------- */

.game {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    height: 100%;
}

.terminal-wrap {
    position: relative;
    overflow: hidden;
    background: #0f0f0f;
}

.terminal {
    height: 100%;
    margin: 0;
    padding: 20px;
    overflow-y: auto;
    white-space: pre;
    letter-spacing: 2px;
    line-height: 1.2;
    font-size: 17px;
    color: var(--fg);
    scrollbar-width: none;
}

.terminal::-webkit-scrollbar {
    display: none;
}

.crt {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    background:
        linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
        linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 2px, 3px 100%;
}

.chrome {
    border-left: 1px solid var(--line);
    background: var(--panel);
    overflow-y: auto;
    padding: 12px;
    font-size: 14px;
}

.chrome-head {
    display: flex;
    justify-content: space-between;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 12px;
}

.card {
    border: 1px solid var(--line);
    padding: 10px;
    margin-bottom: 12px;
}

.card h2 {
    font-size: 13px;
    letter-spacing: 2px;
    margin: 0 0 8px;
    color: var(--dim);
}

.card.private {
    border-color: var(--warn);
}

.card.private h2 {
    color: var(--warn);
}

.party, .supplies, .options {
    list-style: none;
    margin: 0;
    padding: 0;
}

.party li {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px;
    padding: 4px 0;
    border-bottom: 1px solid #232329;
}

.party li:last-child {
    border-bottom: 0;
}

.party .meta {
    grid-column: 1 / -1;
    color: var(--dim);
    font-size: 12px;
}

.cond-healthy { color: var(--fg); }
.cond-mild    { color: var(--warn); }
.cond-bad     { color: var(--warn); font-weight: bold; }
.cond-serious { color: var(--bad); font-weight: bold; }
.cond-dead    { color: var(--dim); text-decoration: line-through; }

.supplies li {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
}

.supplies .k {
    color: var(--dim);
}

.clock {
    color: var(--warn);
    margin-bottom: 8px;
    letter-spacing: 2px;
}

.options li {
    margin-bottom: 6px;
}

.options button {
    width: 100%;
    text-align: left;
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.options .count {
    color: var(--warn);
}

.options .voters {
    color: var(--dim);
    font-size: 12px;
}

.options button.chosen {
    border-color: var(--warn);
}

#prompt-body button {
    display: block;
    width: 100%;
    text-align: left;
    margin-bottom: 6px;
}

#prompt-body input {
    width: 100%;
    margin-bottom: 8px;
    font-size: 20px;
    letter-spacing: 4px;
}

.shoot-word {
    font-size: 32px;
    letter-spacing: 8px;
    color: var(--warn);
    text-align: center;
    margin: 8px 0;
}

@media (max-width: 860px) {
    .game {
        grid-template-columns: 1fr;
        grid-template-rows: 45vh 1fr;
    }

    .chrome {
        border-left: 0;
        border-top: 1px solid var(--line);
    }
}
