:root {
    --bg: #05070b;
    --bg-card: #111827;
    --border: #1f2937;
    --accent: #3b82f6;
    --accent-soft: #1f2937;
    --text: #e5e7eb;
    --text-muted: #9ca3af;
    --danger: #f97373;
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(circle at top, #111827 0, #020617 45%, #000 100%);
    color: var(--text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app {
    width: 100%;
    max-width: 960px;
    padding: 24px;
}

h1 {
    margin: 0 0 24px;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: #f9fafb;
}

.card {
    background: radial-gradient(circle at top left, #0b1120 0, #020617 55%, #000 100%);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 20px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.8);
}

.hidden {
    display: none;
}

/* Login */

#login {
    max-width: 360px;
    margin: 0 auto;
}

#login h2 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 18px;
}

#pwd {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: #020617;
    color: var(--text);
    outline: none;
    margin-bottom: 12px;
}

#pwd:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.4);
}

#loginBtn {
    width: 100%;
}

#loginMsg {
    margin-top: 8px;
    font-size: 13px;
    color: var(--danger);
}

/* Main */

#main {
    margin-top: 0;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

#meta {
    font-size: 13px;
    color: var(--text-muted);
}

.buttons {
    display: flex;
    gap: 8px;
}

/* Buttons */

button {
    padding: 8px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--accent-soft);
    background: linear-gradient(135deg, #0f172a, #020617);
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

button:hover {
    border-color: var(--accent);
    background: linear-gradient(135deg, #1d2538, #020617);
}

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

/* Textarea */

#output {
    width: 100%;
    height: 420px;
    resize: vertical;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: #020617;
    color: var(--text);
    padding: 12px;
    font-family: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 13px;
    line-height: 1.4;
    outline: none;
    white-space: pre;
}

#output:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.3);
}

.logo-wrap {
    text-align: center;
    margin: 0 auto 16px;
    max-width: 420px;
}

.logo {
    display: block;
    max-width: 320px;
    width: 100%;
    height: auto;
    margin: 0 auto;
}


/* Small screens */

@media (max-width: 720px) {
    .app {
        padding: 16px;
    }

    .top-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .buttons {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    button {
        flex: 1 1 auto;
        justify-content: center;
    }

    .logo-wrap {
        text-align: center;
        margin-bottom: 12px;
    }

    .logo {
        max-width: 260px;
        filter: drop-shadow(0 0 18px rgba(59, 130, 246, 0.6));
    }

    #loginMsg {
        margin-top: 8px;
        font-size: 13px;
        color: #f97373;
    }

    #loginMsg.ok {
        color: #4ade80;
    }

    .exchange-selector {
        margin-bottom: 16px;
        padding: 12px;
        background: #f5f5f5;
        border-radius: 6px;
    }

    .exchange-selector label {
        font-weight: 600;
        margin-right: 8px;
    }

    .exchange-selector select {
        padding: 6px 12px;
        border: 1px solid #ddd;
        border-radius: 4px;
        font-size: 14px;
        background: white;
        cursor: pointer;
    }

    .exchange-selector select:hover {
        border-color: #0088cc;
    }


}