/* Roger Desk web client: a stand-in for the Pi + Whisplay. The page is the desk; the screen
   itself is drawn on the canvas by desk.js, exactly as the device will draw it. */

:root {
    --paper: #F1E4C3;
    --ink: #3B2314;
    --dim: #8A7A68;
    --wood: #5A3A22;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background: #E9DCC0;
    color: var(--ink);
    font-family: Georgia, "Times New Roman", serif;
}

.desk {
    max-width: 26rem;
    margin: 0 auto;
    padding: 2rem 1rem 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

/* ── The device ─────────────────────────────────────────────────────────── */
.device {
    position: relative;
    padding: 22px 18px 18px;
    background: #2A1A0E;
    border-radius: 34px;
    box-shadow: 0 2px 0 #1A0F08, 0 10px 24px rgba(59, 35, 20, 0.35);
}

#screen {
    display: block;
    width: 240px;
    height: 280px;
    border-radius: 30px;   /* the Whisplay's rounded corners */
    background: #111;
}

.led {
    position: absolute;
    top: 8px;
    left: 50%;
    width: 8px;
    height: 8px;
    margin-left: -4px;
    border-radius: 50%;
    background: #333;
    transition: background 0.2s, box-shadow 0.2s;
}
.led--boot     { background: #fff;    box-shadow: 0 0 6px #fff; }
.led--idle     { background: #3E6B3A; box-shadow: 0 0 4px #3E6B3A; }
.led--thinking { background: #E9B44C; box-shadow: 0 0 8px #E9B44C; animation: pulse 0.8s infinite alternate; }
.led--speaking { background: #4A86D0; box-shadow: 0 0 8px #4A86D0; }
.led--error    { background: #D0604A; box-shadow: 0 0 8px #D0604A; }
@keyframes pulse { to { opacity: 0.35; } }

.hw-button {
    position: absolute;
    right: -16px;
    top: 120px;
    width: 16px;
    height: 44px;
    border: none;
    border-radius: 0 6px 6px 0;
    background: #5A3A22;
    cursor: pointer;
}
.hw-button:active { right: -13px; width: 13px; }

/* ── Input and setup ─────────────────────────────────────────────────────── */
.say { display: flex; gap: 0.4rem; width: 100%; }
.say input, .setup input {
    flex: 1;
    min-width: 0;
    padding: 0.5rem 0.6rem;
    border: 1px solid #C9B48C;
    border-radius: 4px;
    background: var(--paper);
    font: inherit;
}
button {
    padding: 0.45rem 0.8rem;
    border: 1px solid var(--wood);
    border-radius: 4px;
    background: var(--wood);
    color: var(--paper);
    font: inherit;
    cursor: pointer;
}
.quick { display: flex; flex-wrap: wrap; gap: 0.35rem; justify-content: center; }
.quick button { background: transparent; color: var(--wood); padding: 0.25rem 0.6rem; font-size: 0.9rem; }

.sound { font-size: 0.9rem; color: var(--dim); }

.setup { width: 100%; font-size: 0.9rem; }
.setup summary { cursor: pointer; color: var(--dim); }
.setup form { display: flex; gap: 0.4rem; }
.setup code { font-size: 0.8rem; word-break: break-all; }
#key-status { color: var(--dim); }
