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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #0b0d14;
    color: #e6e8ee;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow-x: hidden;
}

body::before,
body::after {
    content: "";
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
}

body::before {
    width: 480px;
    height: 480px;
    background: rgba(91, 124, 250, 0.16);
    top: -120px;
    left: -100px;
}

body::after {
    width: 420px;
    height: 420px;
    background: rgba(173, 91, 250, 0.12);
    bottom: -100px;
    right: -80px;
}

.card {
    width: min(560px, 100%);
    background: rgba(23, 26, 35, 0.85);
    backdrop-filter: blur(14px);
    border: 1px solid #262b3a;
    border-radius: 20px;
    padding: 44px 40px 36px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

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

.logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #5b7cfa, #ad5bfa);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

h1 { font-size: 24px; }

.subtitle { color: #8b93a7; font-size: 14px; margin-bottom: 28px; }

form { display: flex; gap: 10px; }

input[type="url"] {
    flex: 1;
    padding: 13px 16px;
    background: #0f1117;
    border: 1px solid #2c3245;
    border-radius: 12px;
    color: #e6e8ee;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="url"]:focus {
    border-color: #5b7cfa;
    box-shadow: 0 0 0 3px rgba(91, 124, 250, 0.18);
}

button.submit-btn {
    padding: 13px 22px;
    background: linear-gradient(135deg, #5b7cfa, #7a6cf5);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.2s;
}

button.submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(91, 124, 250, 0.35);
}

button.submit-btn:active { transform: translateY(0); }

.result { margin-top: 22px; display: none; animation: fadeIn 0.3s ease; }

.result.visible { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.short-link {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #0f1117;
    border: 1px solid #2c3245;
    border-radius: 12px;
    padding: 13px 16px;
}

.short-link a {
    color: #8ea6ff;
    word-break: break-all;
    flex: 1;
    text-decoration: none;
    font-size: 14px;
}

.short-link a:hover { text-decoration: underline; }

.copy-btn {
    background: transparent;
    border: 1px solid #2c3245;
    color: #8b93a7;
    padding: 7px 14px;
    font-size: 13px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.copy-btn:hover { background: #262b3a; color: #e6e8ee; }

.history-title {
    margin-top: 32px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #5f6781;
}

.history { list-style: none; margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }

.history li {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    background: #131722;
    border: 1px solid #202534;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    transition: border-color 0.15s;
}

.history li:hover { border-color: #2c3245; }

.history .short { color: #b9acf7; font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 13px; font-weight: 500; text-decoration: none; }
.history .short:hover { color: #d6ceff; text-decoration: underline; }

.history .long { color: #5f6781; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

.empty-history { color: #5f6781; font-size: 13px; padding: 4px 2px; }

@media (max-width: 640px) {
    body { padding: 14px; }
    .card { padding: 26px 18px 22px; border-radius: 16px; }
    h1 { font-size: 20px; }
    .subtitle { margin-bottom: 20px; }
    form { flex-direction: column; }
    button.submit-btn { width: 100%; }
    .short-link { flex-wrap: wrap; }
    .history li { flex-wrap: wrap; }
    .history-title { margin-top: 24px; }
}

@media (max-width: 380px) {
    .header { gap: 10px; }
    .logo { width: 36px; height: 36px; font-size: 16px; }
    h1 { font-size: 18px; }
    .subtitle { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
