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

:root {
    --bg-deep: #1a1525;
    --bg-mid: #262335;
    --neon-pink: #f92aad;
    --neon-cyan: #36f9f6;
    --neon-green: #72f1b8;
    --neon-yellow: #f3f99d;
    --text: #f0eff1;
    --text-dim: #a89fb8;
    --panel-bg: rgba(38, 35, 53, 0.85);
    --panel-border: rgba(249, 42, 173, 0.45);
}

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

body {
    font-family: "Rajdhani", sans-serif;
    color: var(--text);
    background: linear-gradient(180deg, #120f1a 0%, var(--bg-deep) 40%, #2d1b4e 100%);
    overflow-x: hidden;
}

.landing {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem 8rem;
}

.grid-floor {
    position: fixed;
    bottom: 0;
    left: -50%;
    width: 200%;
    height: 45vh;
    background:
        linear-gradient(transparent 0%, rgba(249, 42, 173, 0.08) 100%),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 49px,
            rgba(54, 249, 246, 0.25) 49px,
            rgba(54, 249, 246, 0.25) 50px
        ),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 49px,
            rgba(249, 42, 173, 0.2) 49px,
            rgba(249, 42, 173, 0.2) 50px
        );
    transform: perspective(500px) rotateX(65deg);
    transform-origin: center bottom;
    pointer-events: none;
    mask-image: linear-gradient(to top, black 30%, transparent 100%);
}

.sun {
    position: fixed;
    bottom: 18vh;
    left: 50%;
    transform: translateX(-50%);
    width: min(420px, 70vw);
    height: min(420px, 70vw);
    border-radius: 50%;
    background: linear-gradient(180deg, var(--neon-yellow) 0%, var(--neon-pink) 55%, #ff6a00 100%);
    box-shadow: 0 0 80px rgba(249, 42, 173, 0.5);
    pointer-events: none;
    mask-image: repeating-linear-gradient(
        0deg,
        black,
        black 8px,
        transparent 8px,
        transparent 14px
    );
    opacity: 0.85;
}

.panel {
    position: relative;
    z-index: 1;
    width: min(520px, 100%);
    padding: 2.5rem 2rem;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 4px;
    box-shadow:
        0 0 30px rgba(249, 42, 173, 0.15),
        inset 0 0 40px rgba(54, 249, 246, 0.03);
    backdrop-filter: blur(8px);
}

.title {
    margin: 0 0 0.5rem;
    font-family: "Orbitron", sans-serif;
    font-size: clamp(2.5rem, 8vw, 3.5rem);
    font-weight: 900;
    letter-spacing: 0.35em;
    text-indent: 0.35em;
    text-align: center;
    color: var(--text);
    text-shadow:
        0 0 10px var(--neon-pink),
        0 0 30px rgba(249, 42, 173, 0.6),
        0 0 60px rgba(54, 249, 246, 0.3);
}

.tagline {
    margin: 0 0 2rem;
    text-align: center;
    color: var(--text-dim);
    font-size: 1.1rem;
    line-height: 1.4;
}

.seed-form {
    margin-bottom: 1.25rem;
}

.seed-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--neon-cyan);
}

.seed-row {
    display: flex;
    gap: 0.75rem;
}

.seed-row input {
    flex: 1;
    min-width: 0;
    padding: 0.75rem 1rem;
    font-family: "Rajdhani", monospace;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text);
    background: rgba(18, 15, 26, 0.8);
    border: 1px solid rgba(54, 249, 246, 0.35);
    border-radius: 2px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.seed-row input:focus {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 12px rgba(54, 249, 246, 0.25);
}

.seed-row input::placeholder {
    color: rgba(168, 159, 184, 0.6);
}

.form-error {
    margin: 0.75rem 0 0;
    color: #fe4450;
    font-weight: 600;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.25rem;
    font-family: "Orbitron", sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

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

.btn-enter {
    color: var(--bg-deep);
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-green));
    box-shadow: 0 0 16px rgba(54, 249, 246, 0.35);
}

.btn-enter:hover {
    box-shadow: 0 0 24px rgba(54, 249, 246, 0.5);
}

.actions {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.btn-random {
    color: var(--neon-pink);
    background: transparent;
    border: 1px solid rgba(249, 42, 173, 0.5);
    box-shadow: 0 0 12px rgba(249, 42, 173, 0.15);
}

.btn-random:hover {
    background: rgba(249, 42, 173, 0.1);
    box-shadow: 0 0 20px rgba(249, 42, 173, 0.3);
}

.recent h2 {
    margin: 0 0 1rem;
    font-family: "Orbitron", sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.recent-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.recent-item {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
}

.recent-link {
    flex: 1;
    min-width: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text);
    background: rgba(18, 15, 26, 0.5);
    border: 1px solid rgba(249, 42, 173, 0.2);
    border-radius: 2px;
    transition: border-color 0.2s, background 0.2s;
}

.recent-actions {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex-shrink: 0;
}

.btn-recent {
    min-width: 4.75rem;
    padding: 0.45rem 0.65rem;
    font-family: "Orbitron", sans-serif;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 2px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-share {
    color: var(--neon-cyan);
    background: rgba(54, 249, 246, 0.08);
    border: 1px solid rgba(54, 249, 246, 0.35);
}

.btn-share:hover:not(:disabled) {
    background: rgba(54, 249, 246, 0.16);
}

.btn-delete {
    color: #fe4450;
    background: rgba(254, 68, 80, 0.08);
    border: 1px solid rgba(254, 68, 80, 0.35);
}

.btn-delete:hover {
    background: rgba(254, 68, 80, 0.16);
}

.btn-recent:disabled {
    opacity: 0.7;
    cursor: default;
}

.recent-link:hover {
    border-color: rgba(249, 42, 173, 0.5);
    background: rgba(249, 42, 173, 0.08);
}

.recent-seed {
    font-family: "Rajdhani", monospace;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--neon-cyan);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-theme {
    flex-shrink: 0;
    font-size: 0.85rem;
    color: var(--text-dim);
}

@media (max-width: 480px) {
    .landing {
        padding: 1.5rem 0.75rem 6rem;
        padding-left: max(0.75rem, env(safe-area-inset-left));
        padding-right: max(0.75rem, env(safe-area-inset-right));
        padding-bottom: max(6rem, calc(4rem + env(safe-area-inset-bottom)));
    }

    .panel {
        padding: 1.75rem 1.25rem;
    }

    .title {
        letter-spacing: 0.2em;
        text-indent: 0.2em;
    }

    .sun {
        width: min(280px, 85vw);
        height: min(280px, 85vw);
        bottom: 14vh;
    }

    .grid-floor {
        height: 35vh;
    }

    .seed-row {
        flex-direction: column;
    }

    .seed-row input,
    .btn {
        min-height: 2.75rem;
        font-size: 16px;
    }

    .recent-item {
        flex-direction: column;
    }

    .recent-actions {
        flex-direction: row;
    }

    .btn-recent {
        flex: 1;
        min-height: 2.5rem;
        font-size: 0.7rem;
    }

    .recent-link {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}
