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

:root {
    --bg: #000;
    --surface: rgba(40, 2, 2, 0.35);
    --surface-2: rgba(20, 0, 0, 0.45);
    --border: rgba(224, 26, 26, 0.35);
    --text: #ffe7e7;
    --muted: #c98f8f;
    --red: #e01a1a;
    --red-dark: #a30000;
    --blood: #e01a1a;
    --radius: 12px;
}

::selection {
    background: var(--red);
    color: #fff;
}

html {
    scroll-behavior: smooth;
}

body {
    background: #000;
    color: var(--text);
    font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Ambient red lights ── */
.ambient-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.light {
    position: absolute;
    width: 460px;
    height: 460px;
    border-radius: 50%;
    background: radial-gradient(circle,
            rgba(232, 0, 45, 0.30),
            rgba(232, 0, 45, 0.08) 45%,
            transparent 72%);
    filter: blur(16px);
    opacity: 0.12;
    animation: lightPulse 7s ease-in-out infinite;
}

.light:nth-child(2) { animation-duration: 9s; animation-delay: 1.2s; }
.light:nth-child(3) { animation-duration: 8s; animation-delay: 2.1s; }
.light:nth-child(4) { animation-duration: 10s; animation-delay: 0.6s; }
.light:nth-child(5) { animation-duration: 7.5s; animation-delay: 3.4s; }

@keyframes lightPulse {
    0%, 100% { opacity: 0.06; transform: scale(0.95); }
    50% { opacity: 0.55; transform: scale(1.18); }
}

.topbar, main, footer {
    position: relative;
    z-index: 1;
}

#particles {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* ── Top bar ── */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    border-bottom: 1px solid var(--border);
    background: rgba(30, 2, 2, 0.30);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 650;
    font-size: 16px;
    letter-spacing: 0.5px;
}

.brand img {
    height: 28px;
    width: 28px;
    object-fit: contain;
    border-radius: 6px;
    background: #000;
    padding: 3px;
}

.topnav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topnav-btn {
    padding: 6px 12px;
    font-size: 12.5px;
    text-decoration: none;
    background: rgba(0, 0, 0, 0.45);
    border-color: var(--border);
    color: var(--text);
}

.topnav-btn:hover {
    border-color: var(--red);
    color: #fff;
    box-shadow: 0 0 12px rgba(224, 26, 26, 0.35);
}

/* ── Main ── */
main {
    flex: 1;
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    padding: 40px 24px 30px;
}

.intro {
    margin-bottom: 28px;
}

.intro h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.4px;
    margin-bottom: 8px;
}

.intro p {
    color: var(--muted);
    max-width: 520px;
}

/* ── Card ── */
.card {
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(224, 26, 26, 0.35);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 0 0 1px rgba(224, 26, 26, 0.04),
        0 0 24px rgba(224, 26, 26, 0.10),
        0 0 64px rgba(224, 26, 26, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.form-card {
    position: relative;
    padding: 0;
    overflow: hidden;
    border-radius: 24px;
}

.form-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('smt.png') center / 260px no-repeat;
    filter: blur(8px);
    transform: scale(1.15);
    opacity: 0.55;
    pointer-events: none;
    z-index: 0;
}

.form-card form,
.form-card .gen-panel {
    position: relative;
    z-index: 1;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    padding: 16px 0 12px;
    border-bottom: 1px solid var(--border);
}

.card-head h2 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 6px;
    color: var(--red);
    text-shadow: 0 0 10px rgba(224, 26, 26, 0.55),
        0 0 26px rgba(224, 26, 26, 0.25);
    animation: loggerFlash 6s ease-in-out infinite;
}

@keyframes loggerFlash {
    0%, 80%, 100% { opacity: 0.75; text-shadow: 0 0 8px rgba(224, 26, 26, 0.4), 0 0 20px rgba(224, 26, 26, 0.2); }
    90% { opacity: 1; text-shadow: 0 0 18px rgba(224, 26, 26, 0.95), 0 0 46px rgba(224, 26, 26, 0.55); }
}

/* ── Form ── */
.form-card form {
    padding: 24px 24px 26px;
}

.field {
    margin-bottom: 16px;
}

.field label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 6px;
}

.field input {
    width: 100%;
    padding: 10px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    transition: border-color 0.15s ease;
}

.field input::placeholder {
    color: #5c5c64;
}

.field input:focus {
    outline: none;
    border-color: var(--red);
}

.preview {
    margin-top: 6px;
    font-size: 13px;
    color: var(--muted);
    word-break: break-all;
}

.preview #namePreview {
    color: var(--red);
    font-weight: 600;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.btn:hover {
    border-color: var(--muted);
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    width: 100%;
    background: var(--red);
    border-color: var(--red);
    color: #fff;
}

.btn-primary:hover {
    background: var(--red-dark);
    border-color: var(--red-dark);
}

.btn-primary.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* ── Footer ── */
footer {
    border-top: 1px solid var(--border);
    padding: 18px 24px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

/* ── Generated link panel + skull ── */
.gen-panel {
    display: flex;
    align-items: center;
    gap: 18px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0 24px;
    border-top: 1px solid transparent;
    transition: max-height 0.5s ease, opacity 0.4s ease,
        padding 0.4s ease, border-color 0.3s ease;
}

.gen-panel.show {
    max-height: 460px;
    opacity: 1;
    padding: 16px 24px 18px;
    border-top-color: var(--border);
}

.gen-panel {
    flex-wrap: wrap;
}

.term {
    flex: 0 0 auto;
    max-width: 100%;
    background: #0b0506;
    border: 1px solid #3a1216;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(180, 10, 20, 0.14),
        inset 0 0 26px rgba(180, 10, 20, 0.05);
    overflow: hidden;
}

.term-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    background: #170a0b;
    border-bottom: 1px solid #3a1216;
}

.term-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.t-red { background: #ff5f56; }
.t-yellow { background: #ffbd2e; }
.t-green { background: #27c93f; }

.term-title {
    margin-left: 8px;
    font: 600 11px/1 "Courier New", Consolas, monospace;
    color: #8a4548;
    letter-spacing: 0.5px;
}

#asciiSkull {
    margin: 0;
    padding: 10px 12px 12px;
    width: 76ch;
    height: 270px;
    font: 600 12px/1.2 "Courier New", Consolas, monospace;
    color: #e01a1a;
    text-shadow: 0 0 7px rgba(224, 26, 26, 0.6),
        0 0 18px rgba(140, 8, 8, 0.35);
    white-space: pre;
    letter-spacing: 0;
    user-select: none;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #7a1a1a #150707;
}

#asciiSkull::-webkit-scrollbar {
    width: 8px;
}

#asciiSkull::-webkit-scrollbar-track {
    background: #150707;
}

#asciiSkull::-webkit-scrollbar-thumb {
    background: #7a1a1a;
    border-radius: 4px;
}

#asciiSkull::-webkit-scrollbar-thumb:hover {
    background: #a32323;
}

.skull-cursor {
    animation: skullBlink 1s steps(2, start) infinite;
    background: currentColor;
    color: #e01a1a;
}

@keyframes skullBlink {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

.gen-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.gen-title {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #ff3b4d;
}

.gen-link-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.gen-link {
    font-size: 12px;
    color: var(--muted);
    word-break: break-all;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.gen-link:hover {
    color: var(--accent);
}

.copy-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    cursor: pointer;
    transition: all 0.15s ease;
}

.copy-btn svg {
    width: 15px;
    height: 15px;
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.9))
        drop-shadow(0 0 10px rgba(255, 255, 255, 0.45));
}

.copy-btn:hover,
.copy-btn.copied {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.55);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.35);
}

/* ── Toast ── */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--red);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.2s ease;
    pointer-events: none;
    max-width: min(420px, calc(100vw - 40px));
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 520px) {
    main {
        padding: 24px 16px;
    }
}