:root {
    --bg: #0a0a0f;
    --surface: #111118;
    --card: #16161f;
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(99, 179, 255, 0.3);
    --accent: #63b3ff;
    --accent-dim: rgba(99, 179, 255, 0.12);
    --accent-glow: rgba(99, 179, 255, 0.25);
    --text-primary: #f0f0f8;
    --text-secondary: #7a7a9a;
    --text-dim: #3a3a5a;
    --success: #4ade80;
    --font-display: 'Syne', sans-serif;
    --font-mono: 'DM Mono', monospace;
    --radius-sm: 10px;
}

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

body {
    background-color: var(--bg);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 20% 20%, rgba(99, 179, 255, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse 50% 60% at 80% 80%, rgba(245, 200, 66, 0.05) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.012) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.012) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
    z-index: 0;
}

.container {
    position: relative;
    z-index: 1;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 24px;
    width: 420px;
    padding: 36px 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.03),
        0 32px 80px rgba(0, 0, 0, 0.6),
        0 0 60px rgba(99, 179, 255, 0.04);
    animation: containerReveal 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes containerReveal {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header */
.name {
    display: flex;
    align-items: center;
    gap: 12px;
    animation: fadeUp 0.6s 0.1s both;
}

.name::before {
    content: '◈';
    color: var(--accent);
    font-size: 1.1rem;
    animation: pulse 2.5s ease-in-out infinite;
}

.name::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, var(--border), transparent);
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        text-shadow: 0 0 8px var(--accent);
    }

    50% {
        opacity: 0.4;
        text-shadow: none;
    }
}

.name h2 {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-primary);
}

/* Amount */
.amount {
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: fadeUp 0.6s 0.15s both;
}

.amount h5 {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.amount input {
    width: 100%;
    height: 52px;
    font-size: 1.5rem;
    font-family: var(--font-mono);
    font-weight: 500;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-primary);
    padding: 0 16px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.amount input::placeholder {
    color: var(--text-dim);
    font-size: 1rem;
    font-weight: 300;
}

.amount input:focus {
    border-color: var(--accent);
    background: rgba(99, 179, 255, 0.04);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Exchanger row */
.exchanger {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    animation: fadeUp 0.6s 0.2s both;
}

.from,
.to {
    flex: 1;
    background: var(--surface);
    display: flex;
    flex-direction: row;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    justify-content: center;
    align-items: center;
    padding: 10px 12px;
    gap: 8px;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.from:hover,
.to:hover {
    border-color: var(--border-hover);
    background: rgba(99, 179, 255, 0.03);
    box-shadow: 0 0 20px rgba(99, 179, 255, 0.06);
}

.from img,
.to img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid var(--border);
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease;
}

.from:hover img,
.to:hover img {
    transform: scale(1.08);
}

.from select,
.to select {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    outline: none;
    cursor: pointer;
    flex: 1;
    min-width: 0;
    appearance: none;
    -webkit-appearance: none;
}

.from select option,
.to select option {
    background: #1a1a28;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

/* Swap icon */
.icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-dim);
    border: 1px solid rgba(99, 179, 255, 0.2);
    border-radius: 50%;
    transition: background 0.2s, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s;
    cursor: pointer;
}

.icon:hover {
    background: rgba(99, 179, 255, 0.2);
    box-shadow: 0 0 16px var(--accent-glow);
    transform: rotate(180deg);
}

.icon i {
    font-size: 0.85rem;
    color: var(--accent);
}

/* Value display */
.value {
    font-family: var(--font-mono);
    font-size: 0.88rem;
    font-weight: 400;
    color: var(--text-secondary);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px 14px 20px;
    text-align: center;
    letter-spacing: 0.04em;
    transition: color 0.3s, border-color 0.3s;
    animation: fadeUp 0.6s 0.25s both;
    position: relative;
    overflow: hidden;
}

.value::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--accent), #f5c842);
    border-radius: 2px 0 0 2px;
}

.value.updated {
    color: var(--success);
    border-color: rgba(74, 222, 128, 0.25);
    animation: resultPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes resultPop {
    0% {
        transform: scale(0.97);
        opacity: 0.6;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Button */
.btn {
    animation: fadeUp 0.6s 0.3s both;
}

.btn button {
    width: 100%;
    height: 52px;
    font-size: 0.82rem;
    font-weight: 700;
    font-family: var(--font-display);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(99, 179, 255, 0.3);
    background: linear-gradient(135deg, #1a3a5c 0%, #0d2240 100%);
    color: var(--accent);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.25s, transform 0.2s, border-color 0.25s;
}

.btn button:hover {
    box-shadow: 0 0 30px rgba(99, 179, 255, 0.2), 0 8px 24px rgba(0, 0, 0, 0.4);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.btn button:active {
    transform: translateY(0) scale(0.99);
}

.btn button.loading {
    pointer-events: none;
    opacity: 0.6;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

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

@media (max-width: 500px) {
    .container {
        width: 92vw;
        padding: 28px 20px;
    }
}