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

:root {
    --bg: #0f0f10;
    --card: #17171a;
    --card2: #1f1f24;
    --border: rgba(255, 255, 255, .08);
    --grid: rgba(255, 255, 255, .03);
    --text: #f2f2f2;
    --muted: #9a9aa3;
    --accent: #6557ff;
    --danger: #ff5b5b;
    --success: #3ddc97;
    --radius: 12px;
}

body {
    font-family: 'DM Mono', monospace;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    inset: 0;
    background-image:
        linear-gradient(var(--grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size: 48px 48px;
    z-index: 0;
}

.card {
    width: 100%;
    max-width: 520px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.title {
    /*font-family: 'Syne', sans-serif;
            font-size: 40px;
            margin-bottom: 6px;*/
    font-family: 'Syne', sans-serif;
    font-size: 40px;
    font-weight: 800;
    line-height: 1.0;
    letter-spacing: -.03em;
    margin-bottom: 1rem;
}

.sub {
    color: var(--muted);
    font-size: 15px;
    margin-bottom: 18px;
}

#result {
    background: var(--card2);
    padding: 14px;
    border-radius: var(--radius);
    text-align: center;
    font-size: 18px;
    margin-bottom: 18px;
    word-break: break-all;
    font-family: monospace;
}

.row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
}

input[type="number"] {
    width: 50px;
    padding: 10px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--card2);
    color: var(--text);
    appearance: textfield;
    outline: none;
    text-align: center;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

input[type="range"] {
    flex: 1;
    accent-color: var(--accent);
}

fieldset {
    border: none;
    margin: 16px 0;
}

legend {
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 8px;
}

label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    margin-bottom: 8px;
    position: relative;
}

input[type="checkbox"] {
    accent-color: var(--accent);
}

.buttons {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    padding-bottom: 5px;
}

button {
    flex: 1;
    padding: 12px;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    transition: .15s;
}

#generate {
    background: var(--accent);
    color: #fff;
}

#copy {
    background: var(--card2);
    color: var(--text);
}

button:active {
    transform: scale(0.98);
}

.text-red-500 {
    color: var(--danger);
}

.text-green-500 {
    color: var(--success);
}

.hidden {
    display: none;
}

#errorPopup {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .6);
    backdrop-filter: blur(6px);
}

.hidden {
    display: none !important;
}

.popup {
    background: var(--card);
    border: 1px solid var(--border);
    padding: 20px;
    border-radius: var(--radius);
    width: 280px;
    text-align: center;
}

.popup h2 {
    color: var(--danger);
    margin-bottom: 10px;
}

.popup button {
    margin-top: 14px;
    background: var(--danger);
    color: #fff;
    width: 100%;
}

.tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    cursor: pointer;
    color: var(--accent);
}

.tooltip-box {
    position: absolute;
    bottom: 140%;
    left: 50%;
    transform: translateY(-50%), translateX(-50%);
    background: var(--card);
    border: 1px solid var(--border);
    padding: 10px;
    border-radius: 10px;
    width: 400px;
    font-size: 14px;
    line-height: 1.4;
    opacity: 0;
    visibility: hidden;
    transition: .15s;
    z-index: 10;
    cursor: default;
    color: var(--text);
}

.tooltip-box b {
    color: var(--accent);
}

.tooltip:hover .tooltip-box {
    opacity: 1;
    visibility: visible;
}

.tooltip a {
    color: var(--accent);
    text-decoration: underline;
}

#infoPopup {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
}

#infoPopup a {
    color: var(--accent);
    text-decoration: underline;
}

#infoPopup b {
    color: var(--accent);
}

#infoPopup button {
    background-color: var(--accent);
}

@media (min-width: 768px) {
    .tooltip:hover .tooltip-box {
        display: block;
    }
}

@media (max-width: 768px) {
    .tooltip-box {
        display: none !important;
    }
}

#toastContainer {
    position: fixed;
    left: 50%;
    bottom: 2em;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text);
    opacity: 0;
    transform: translateY(10px);
    animation: toastIn 0.2s ease forwards;
}

.toast.success {
    border-color: var(--success);
    color: var(--success);
}

.toast.error {
    border-color: var(--danger);
    color: var(--danger);
}

@keyframes toastIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.description {
    font-size: 14px;
    color: var(--muted);
    margin-top: 4px;
}