:root {
    --green: #8ea366;
    --blue: #57b0e3;
    --charcoal: #58585a;
    --slate: #4a7085;
    --night: #0f1c24;
    --text: #ffffff;
}

html, body {
    margin: 0;
    height: 100%;
    overflow: hidden;
    background: var(--night);
    color: var(--text);
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    overscroll-behavior: none;
}

main {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
             max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    box-sizing: border-box;
    pointer-events: none;
    z-index: 100; /* above the LittleJS touch gamepad overlay */
}

.menu {
    pointer-events: auto;
    width: min(440px, 100%);
    max-height: 100%;
    overflow-y: auto;
    box-sizing: border-box;
    padding: 28px 24px;
    border-radius: 18px;
    background: color-mix(in srgb, var(--slate) 92%, transparent);
    box-shadow: 0 12px 40px rgb(0 0 0 / 0.45);
    text-align: center;
    touch-action: manipulation;
}

.menu[hidden] { display: none; }

/* clear space around the logo, per the Sault College logo guidelines */
.logo {
    display: block;
    width: 202px;
    max-width: 70%;
    height: auto;
    margin: 4px auto 20px;
}

h1, h2 {
    font-family: Domine, Georgia, serif;
    margin: 0 0 10px;
    letter-spacing: 0.02em;
}

h1 { font-size: clamp(1.9rem, 8vw, 2.6rem); }
h2 { font-size: 1.8rem; }

.tagline { margin: 0 0 14px; line-height: 1.4; }

.how-to {
    list-style: none;
    padding: 0;
    margin: 0 0 14px;
    font-size: 0.92rem;
    line-height: 1.45;
    text-align: left;
}

.how-to li { margin: 6px 0; }
.how-to strong { color: #d8ecbf; }

.controls {
    font-size: 0.85rem;
    opacity: 0.85;
    margin: 0 0 18px;
}

.touch .keyboard-only, body:not(.touch) .touch-only { display: none; }

.result { font-size: 1.15rem; margin: 0 0 6px; }
.best { margin: 0 0 20px; opacity: 0.85; }

button {
    font: inherit;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--night);
    background: var(--green);
    border: 0;
    border-radius: 999px;
    padding: 14px 34px;
    cursor: pointer;
    min-height: 48px;
}

button:hover { background: #a3b77d; }
button:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

/* Kiosk: big screen at an open house, joined from phones */
.kiosk { cursor: none; }

#kiosk-panel {
    position: fixed;
    top: max(16px, env(safe-area-inset-top));
    right: max(16px, env(safe-area-inset-right));
    z-index: 100;
    width: clamp(240px, 22vw, 380px);
    max-height: calc(100% - 32px);
    overflow: hidden;
    box-sizing: border-box;
    padding: 16px;
    border-radius: 16px;
    background: color-mix(in srgb, var(--slate) 85%, transparent);
    box-shadow: 0 10px 30px rgb(0 0 0 / 0.4);
    font-size: clamp(14px, 1.1vw, 20px);
}

#kiosk-panel[hidden] { display: none; }

.join { display: flex; gap: 14px; align-items: center; }

#kiosk-qr {
    flex: 0 0 42%;
    background: #fff;
    border-radius: 8px;
    padding: 4px;
    line-height: 0;
}

#kiosk-qr svg { width: 100%; height: auto; }

.join-text p { margin: 0 0 4px; }
.scan { font-family: Domine, Georgia, serif; font-weight: 700; font-size: 1.4em; }
.room strong { font-size: 1.3em; letter-spacing: 0.12em; color: #d8ecbf; }
.url { font-size: 0.7em; opacity: 0.8; overflow-wrap: anywhere; }

#scoreboard { list-style: none; margin: 14px 0 0; padding: 0; }

#scoreboard li {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 5px 0;
    border-top: 1px solid rgb(255 255 255 / 0.12);
}

#scoreboard .dot { width: 0.9em; height: 0.9em; border-radius: 50%; }
#scoreboard .who { font-weight: 700; }
#scoreboard .score { white-space: nowrap; }

#scoreboard-empty { margin: 14px 0 0; font-size: 0.9em; opacity: 0.9; }
#kiosk-status { margin: 8px 0 0; color: var(--blue); font-size: 0.9em; }
#kiosk-status:empty { display: none; }

#kiosk-panel .logo { display: block; width: 50%; height: auto; margin: 18px auto 2px; }
