:root {
    --background: #1e1e1e;
    --panel: #2b2b2b;
    --text: #f2f2f2;
    --muted: #a8a8a8;
    --accent: #c2339a;
    --border: #444;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font: 18px/1.5 "Segoe UI", system-ui, sans-serif;
}

header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 24px;
    padding: 12px 16px;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
}

header a { color: var(--text); text-decoration: none; }

/* Links in the text: the accent, lightened to read clearly on the dark background. */
main a { color: #e98ad0; }
main a:hover { color: #f5b3e3; }
header nav { display: flex; gap: 16px; }
header nav a { color: var(--muted); }
header nav a:hover { color: var(--text); }
.brand { font-size: 1.3em; font-weight: 600; }

main { max-width: 560px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.6em; margin: 8px 0 16px; }

form { display: flex; flex-direction: column; }
label { margin-top: 12px; color: var(--muted); }

input {
    width: 100%;
    padding: 12px;
    font: inherit;
    color: var(--text);
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 6px;
}

input:focus { outline: 2px solid var(--accent); border-color: transparent; }

button {
    margin-top: 24px;
    padding: 14px;
    font: inherit;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    border: 0;
    border-radius: 6px;
    cursor: pointer;
}

.error { color: #ff8a8a; font-size: 0.9em; }
.notice { padding: 12px 16px; background: var(--panel); border-left: 4px solid var(--accent); border-radius: 4px; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 400; }

.results { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.results .none { margin: 4px 0; color: var(--muted); }

button.song {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 10px 12px;
    text-align: left;
    font-weight: 400;
    color: var(--text);
    background: var(--panel);
    border: 1px solid var(--border);
}

button.song span { color: var(--muted); font-size: 0.9em; }
button:disabled { opacity: 0.5; cursor: default; }
.chosen { margin: 16px 0 0; padding: 12px 16px; background: var(--panel); border-left: 4px solid var(--accent); border-radius: 4px; }
.hint { margin: 6px 0 0; color: var(--muted); font-size: 0.9em; }

.offer { display: flex; flex-direction: column; margin-top: 16px; padding: 16px; background: var(--panel); border: 1px solid var(--border); border-radius: 6px; }
.offer ul { margin: 0; padding-left: 20px; color: var(--muted); }
.offer .notice { background: var(--background); }
.price { margin: 16px 0 0; font-size: 2em; font-weight: 600; }
.offers { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.offers .offer { margin-top: 0; text-align: center; }
.offers h2 { margin: 0; font-size: 1.1em; }
.offers .price { margin: 8px 0 12px; font-size: 1.6em; }
.licence-key { font-family: Consolas, monospace; font-size: 1.4em; letter-spacing: 0.05em; user-select: all; overflow-wrap: anywhere; }

/* Front page */
a.button { display: inline-block; margin-top: 8px; padding: 12px 24px; color: #fff; font-weight: 600; text-decoration: none; background: var(--accent); border-radius: 6px; }

main.landing { max-width: 1080px; }
main.legal { max-width: 760px; }
main.legal h2 { margin: 28px 0 8px; font-size: 1.25em; }
main.legal h3 { margin: 20px 0 6px; font-size: 1.05em; }
main.legal li { margin-bottom: 6px; }

footer { margin-top: 48px; padding: 24px 16px 32px; border-top: 1px solid var(--border); text-align: center; color: var(--muted); font-size: 0.9em; }
footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; margin-bottom: 8px; }
footer a { color: var(--muted); }
footer a:hover { color: var(--text); }
footer p { margin: 0; }
.hero { max-width: 680px; margin: 24px auto 32px; text-align: center; }
.hero h1 { font-size: 2.2em; line-height: 1.2; }
.hero p { color: var(--muted); }

.screenshot { margin: 0 0 48px; }
.screenshot img { display: block; width: 100%; height: auto; border: 1px solid #3a3a3a; border-radius: 8px; box-shadow: 0 1.5em 4em rgba(0, 0, 0, 0.6); }
.screenshot figcaption { margin-top: 12px; text-align: center; color: var(--muted); font-size: 0.9em; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; margin: 48px 0; }
.features h2 { margin: 0 0 4px; font-size: 1.1em; }
.features p { margin: 0; color: var(--muted); }

.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 24px; }
.hero-actions a.button { margin-top: 0; }
a.button.secondary { color: var(--text); background: var(--panel); border: 1px solid var(--border); }

.requests-feature { max-width: 680px; margin: 0 auto 24px; text-align: center; }
.requests-feature h2 { margin: 0 0 8px; }
.requests-feature p { margin: 0; color: var(--muted); }

.join { margin: 0 auto 48px; }
.join h1 { margin: 0 0 8px; }

/* The picture of EasyKJ: everything is sized in em, and the em follows the picture's width, so it scales like a screenshot. */
.showcase { container-type: inline-size; position: relative; padding-bottom: 8%; }
.window, .phone { font-size: 1.4cqw; line-height: 1.3; }

.window { width: 79%; background: #1e1e1e; border: 1px solid #3a3a3a; border-radius: 0.5em; overflow: hidden; box-shadow: 0 1.5em 4em rgba(0, 0, 0, 0.6); }
.titlebar { display: flex; align-items: center; gap: 0.5em; padding: 0.45em 0.8em; font-size: 0.8em; background: #202020; }
.app-icon { width: 1em; height: 1em; border-radius: 0.2em; background: var(--accent); }
.controls { display: flex; gap: 2.2em; margin-left: auto; color: var(--muted); }

.window-body { display: flex; gap: 0.6em; height: 30em; padding: 0.4em 0.6em 0.6em; }
.sidebar { display: flex; flex-direction: column; gap: 0.5em; width: 8em; }
.sidebar span { padding: 0.35em 0; text-align: center; background: #2b2b2b; border: 1px solid #555; border-radius: 0.2em; }
.sidebar span.active { background: #3c3c3c; border-color: #888; }
.sidebar span.spacer { flex: 1; visibility: hidden; }

.requests-view { display: flex; flex: 1; flex-direction: column; gap: 0.5em; min-width: 0; }
.toolbar { display: flex; gap: 0.4em; }
.toolbar span { padding: 0.2em 0.6em; background: #2b2b2b; border: 1px solid #555; border-radius: 0.2em; }
.requests-main { display: flex; flex: 1; gap: 0.6em; min-height: 0; }

.grid { flex: 1; min-width: 0; background: #1a1a1a; border: 1px solid #333; overflow: hidden; }
.grid-row { display: grid; grid-template-columns: 5em 6em 1fr 1fr; border-bottom: 1px solid #333; }
.grid-row span { padding: 0.3em 0.5em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid-head { background: #252525; }
.grid-row.selected { background: #264f78; }
.grid-row.arriving { animation: arrive 1.6s ease-out; }
@keyframes arrive {
    from { background: var(--accent); transform: translateY(-0.6em); }
    25% { background: var(--accent); transform: none; }
}

.session-panel { display: flex; flex-direction: column; align-items: center; gap: 0.3em; width: 12em; }
.qr { width: 100%; background: #fff; border-radius: 0.2em; }
.qr rect { fill: #111; }
.session-code { font-size: 1.6em; font-weight: 600; letter-spacing: 0.08em; }
.session-url { color: var(--muted); font-size: 0.75em; overflow-wrap: anywhere; text-align: center; }
.status { color: var(--muted); }

.phone { position: absolute; right: 0; bottom: 0; width: 24%; padding: 0.6em; background: #0b0b0b; border: 1px solid #444; border-radius: 2.2em; box-shadow: 0 1.5em 4em rgba(0, 0, 0, 0.7); }
.phone-screen { height: 36em; overflow: hidden; background: var(--background); border-radius: 1.7em; }
.phone-header { padding: 1.6em 1em 0.6em; font-weight: 600; background: var(--panel); border-bottom: 1px solid var(--border); }
.phone-page { display: flex; flex-direction: column; padding: 0.4em 1em; }
.phone-title { margin: 0.3em 0; font-size: 1.3em; font-weight: 600; }
.phone-label { margin-top: 0.5em; color: var(--muted); font-size: 0.9em; }
.phone-input { min-height: 2.2em; padding: 0.45em 0.6em; background: var(--panel); border: 1px solid var(--border); border-radius: 0.35em; }
.phone-input.typing::after { content: "|"; color: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.phone-results { display: flex; flex-direction: column; gap: 0.3em; margin-top: 0.4em; min-height: 9.6em; }
.phone-song { padding: 0.35em 0.6em; background: var(--panel); border: 1px solid var(--border); border-radius: 0.35em; transition: border-color 0.2s; }
.phone-song small { display: block; color: var(--muted); font-size: 0.85em; }
.phone-song.chosen-song { border-color: var(--accent); }
.phone-send { margin-top: 0.6em; padding: 0.6em; text-align: center; font-weight: 600; color: #fff; background: var(--accent); border-radius: 0.35em; opacity: 0.5; transition: opacity 0.2s, transform 0.1s; }
.phone-send.ready { opacity: 1; }
.phone-send.pressed { transform: scale(0.95); }
.phone-thanks { padding: 0.4em 0.6em; font-size: 0.85em; background: var(--panel); border-left: 0.25em solid var(--accent); border-radius: 0.2em; }

@media (max-width: 640px) {
    .hero h1 { font-size: 1.6em; }
    .window, .phone { font-size: 1.9cqw; }
    .window { width: 100%; }
    .showcase { padding-bottom: 0; }
    .phone { display: none; }
}
