:root {
    --bg: #0f1724;
    --card: #0b1220;
    --accent: #7c3aed;
    --muted: #9aa4b2;
    --on: #16a34a
}

* {
    box-sizing: border-box;
    font-family: Inter, ui-sans-serif, system-ui, Segoe UI, Roboto, "Helvetica Neue", Arial
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    background: linear-gradient(180deg, #071029 0%, #071833 100%);
    color: #e6eef6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    padding: 24px;
}

.wrap {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

h1 {
    font-size: clamp(18px, 2vw, 28px);
    margin: 0 0 10px 0;
    text-align: center;
}

p.lead {
    margin: 0;
    color: var(--muted);
    font-size: clamp(12px, 1.2vw, 15px);
    text-align: center;
}

.panel {
    margin-top: 14px;
    padding: 16px;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
    width: 100%;
    max-width: 100%;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(38px, 1fr));
    grid-auto-rows: 38px;
    gap: 6px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    width: 100%;
}

button.cell {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: transparent;
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.2s ease;
}

button.cell:hover {
    background: rgba(124, 58, 237, 0.15);
    transform: scale(1.05);
}

button.cell.on {
    background: linear-gradient(180deg, var(--accent), #5b21b6);
    box-shadow: 0 6px 18px rgba(124, 58, 237, 0.18);
    color: white;
}

.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    background: #021025;
    padding: 12px;
    border-radius: 8px;
    color: #dbeafe;
    overflow-x: auto;
}

.chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
    justify-content: center;
}

.chip {
    background: #071a2a;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 13px;
    color: #cfe8ff;
    cursor: pointer;
    transition: background 0.2s ease;
}

.chip:hover {
    background: #0b243a;
}

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
    justify-content: center;
}

.btn {
    background: var(--card);
    border: none;
    padding: 10px 14px;
    border-radius: 8px;
    color: #dbeafe;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:hover {
    background: var(--accent);
    color: white;
}

@media (max-width: 768px) {
    body {
        padding: 16px;
    }

    .wrap {
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }

    .panel {
        padding: 12px;
    }

    .grid {
        grid-template-columns: repeat(auto-fit, minmax(30px, 1fr));
        gap: 4px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 16px;
    }

    p.lead {
        font-size: 12px;
    }

    .btn {
        padding: 8px 10px;
        font-size: 13px;
    }

    .chip {
        font-size: 12px;
        padding: 5px 8px;
    }
}
