/* Flat, minimal, dark. One accent colour (red). No shadows, borders or gradients. */

:root {
    /* Same palette as the DLBB forum */
    --bg: #121212;
    --surface: #1a1a1a;
    --surface-hover: #212121;
    --text: #dddddd;
    --muted: #9f9f9f;
    --accent: #d32f2f;
    --on-accent: #ffffff;
    --radius: 16px;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
}

/* --- Layout --- */
.page {
    flex: 1;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 48px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 40px;
}

.intro {
    text-align: center;
}

.logo {
    display: block;
    margin: 0 auto 24px;
}

h1 {
    margin: 0 0 8px;
    font-size: clamp(1.6rem, 5vw, 2.25rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.lead {
    margin: 0;
    color: var(--muted);
    font-size: 1.05rem;
}

.hint {
    margin: -16px 0 0;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}

/* --- Buttons: three flat tiles, left / both / right --- */
.controls {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.controls button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: clamp(150px, 28vw, 210px);
    padding: 16px;
    border: 0;
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.15s, color 0.15s, opacity 0.15s;
}

.glyph {
    font-size: clamp(2.75rem, 9vw, 4.5rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
}

.name {
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

@media (hover: hover) {
    .controls button:not(.active):not(:disabled):hover {
        background: var(--surface-hover);
    }
}

.controls button.active {
    background: var(--accent);
    color: var(--on-accent);
}

.controls button.active .name {
    color: var(--on-accent);
}

.controls button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.controls button:focus-visible,
.site-footer a:focus-visible {
    outline: 3px solid var(--text);
    outline-offset: 3px;
}

/* --- Footer --- */
.site-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px));
    color: var(--muted);
    font-size: 0.85rem;
}

.site-footer a {
    display: inline-flex;
    padding: 4px;
    border-radius: 6px;
    color: inherit;
    transition: color 0.15s;
}

.site-footer a:hover {
    color: var(--text);
}

/* --- Phones: Left and Right side by side, Both underneath --- */
@media (max-width: 560px) {
    .page {
        padding: 32px 16px;
        gap: 32px;
    }

    .controls {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "left right"
            "both both";
    }

    #test-left   { grid-area: left; }
    #test-right  { grid-area: right; }
    #test-center { grid-area: both; min-height: 110px; }

    .hint {
        margin-top: -12px;
    }
}

/* --- Accessibility --- */
/* Visible to screen readers only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (prefers-reduced-motion: reduce) {
    .controls button,
    .site-footer a {
        transition: none;
    }
}
