:root {
    color-scheme: dark;
    font-family:
        Inter, ui-sans-serif, system-ui, -apple-system,
        BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #07101f;
    color: #f6f8fc;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(
            circle at top right,
            rgba(61, 154, 255, 0.14),
            transparent 35%
        ),
        linear-gradient(180deg, #081425, #050b15);
}

button,
input {
    font: inherit;
}

.site-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(4, 11, 22, 0.78);
    backdrop-filter: blur(16px);
}

.brand {
    width: min(760px, 100%);
    margin: 0 auto;
    display: flex;
    gap: 12px;
    align-items: center;
}

.brand strong,
.brand span {
    display: block;
}

.brand strong {
    font-size: 18px;
}

.brand span {
    margin-top: 2px;
    color: #93a3bb;
    font-size: 13px;
}

.coin-logo {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(145deg, #79b8ff, #2866d8);
    box-shadow: 0 8px 30px rgba(40, 102, 216, 0.35);
    font-size: 25px;
    font-weight: 800;
}

.container {
    width: min(760px, calc(100% - 28px));
    margin: 0 auto;
    padding: 42px 0 70px;
}

.intro {
    text-align: center;
    margin-bottom: 28px;
}

.intro h1 {
    margin: 0;
    font-size: clamp(29px, 6vw, 46px);
    line-height: 1.08;
}

.intro p {
    max-width: 580px;
    margin: 14px auto 0;
    color: #aebbd0;
    line-height: 1.6;
}

.card,
.security-note {
    margin-top: 18px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 20px;
    background: rgba(12, 25, 45, 0.92);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
}

.step-header {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 22px;
}

.step-number {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #2878ed;
    font-weight: 800;
}

.step-header h2 {
    margin: 1px 0 5px;
    font-size: 21px;
}

.step-header p {
    margin: 0;
    color: #96a8c1;
    line-height: 1.5;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #dce6f5;
    font-weight: 650;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 9px;
}

input[type="text"] {
    width: 100%;
    min-width: 0;
    padding: 14px 15px;
    border: 1px solid #354863;
    border-radius: 12px;
    outline: none;
    background: #081321;
    color: #ffffff;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 15px;
}

input[type="text"]:focus {
    border-color: #4b91ff;
    box-shadow: 0 0 0 3px rgba(75, 145, 255, 0.15);
}

.button {
    min-height: 48px;
    padding: 12px 18px;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 750;
    transition:
        transform 120ms ease,
        opacity 120ms ease,
        background 120ms ease;
}

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

.button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    transform: none;
}

.button.primary {
    background: linear-gradient(145deg, #4091ff, #1d61d1);
    color: white;
}

.button.secondary {
    border: 1px solid #405470;
    background: #12233a;
    color: #e7edf7;
}

.button.full {
    width: 100%;
    margin-top: 12px;
}

.button-row {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 18px;
}

.message {
    margin-top: 16px;
    padding: 13px 15px;
    border-radius: 12px;
    line-height: 1.5;
}

.message.error {
    border: 1px solid rgba(255, 93, 113, 0.4);
    background: rgba(128, 18, 36, 0.26);
    color: #ffb7c0;
}

.message.success {
    border: 1px solid rgba(68, 214, 145, 0.35);
    background: rgba(15, 113, 72, 0.24);
    color: #baf6d9;
}

.message.success span,
.message.success p {
    display: block;
    margin-top: 7px;
}

.result {
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.balance-label {
    color: #98a9c1;
}

.balance {
    display: flex;
    gap: 8px;
    align-items: baseline;
    margin-top: 6px;
    font-size: clamp(32px, 8vw, 51px);
    font-weight: 850;
    letter-spacing: -0.04em;
}

.balance small {
    color: #7eb6ff;
    font-size: 18px;
    letter-spacing: 0;
}

.details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 20px 0 0;
}

.details div {
    padding: 13px;
    border-radius: 12px;
    background: rgba(2, 9, 18, 0.44);
}

.details dt {
    color: #8799b2;
    font-size: 12px;
}

.details dd {
    margin: 5px 0 0;
    font-weight: 750;
}

.security-note {
    border-color: rgba(71, 146, 255, 0.26);
    background: rgba(17, 48, 88, 0.45);
}

.security-note p {
    margin: 7px 0 0;
    color: #aebdd1;
    line-height: 1.5;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 16px;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(5px);
}

.modal-card {
    position: relative;
    width: min(520px, 100%);
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 18px;
    border: 1px solid #344c6d;
    border-radius: 18px;
    background: #0a1728;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.modal-header h2 {
    margin: 0;
}

.close-button {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    background: #16283f;
    color: white;
    font-size: 27px;
}

#reader {
    width: 100%;
    overflow: hidden;
    border-radius: 14px;
    background: black;
}

#reader video {
    border-radius: 14px;
}

.scanner-message {
    color: #aab8ca;
    text-align: center;
}

.file-button {
    text-align: center;
}

.file-button input {
    display: none;
}

@media (max-width: 620px) {
    .container {
        padding-top: 28px;
    }

    .card,
    .security-note {
        padding: 19px;
    }

    .input-row {
        grid-template-columns: 1fr;
    }

    .scan-button {
        width: 100%;
    }

    .details {
        grid-template-columns: 1fr;
    }

    .button-row {
        flex-direction: column-reverse;
    }

    .button-row .button {
        width: 100%;
    }
}

/* BEGIN TRANSACTION SUMMARY */

.transaction-summary {
    margin-top: 18px;
    padding: 20px;
    border: 1px solid rgba(77, 151, 255, 0.28);
    border-radius: 16px;
    background: rgba(4, 14, 27, 0.55);
}

.transaction-summary h3 {
    margin: 0 0 16px;
    font-size: 20px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 0;
}

.summary-grid div {
    padding: 14px;
    border-radius: 12px;
    background: rgba(10, 28, 49, 0.9);
}

.summary-grid dt {
    color: #91a4be;
    font-size: 12px;
}

.summary-grid dd {
    margin: 6px 0 0;
    font-weight: 750;
    overflow-wrap: anywhere;
}

.summary-grid .summary-important {
    grid-column: 1 / -1;
    border: 1px solid rgba(75, 145, 255, 0.3);
    background: rgba(29, 79, 143, 0.28);
}

.summary-important dd {
    color: #8fc2ff;
    font-size: 25px;
}

.message.warning {
    border: 1px solid rgba(255, 184, 77, 0.42);
    background: rgba(128, 77, 8, 0.25);
    color: #ffd89a;
}

.summary-footnote {
    margin: 17px 0 0;
    color: #98a9c0;
    line-height: 1.55;
    font-size: 13px;
}

@media (max-width: 620px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }

    .summary-grid .summary-important {
        grid-column: auto;
    }
}

/* END TRANSACTION SUMMARY */


/* BEGIN PRIVATE KEY STEP */

#privateKeyStep {
    border-color: rgba(255, 184, 77, 0.28);
}

#privateKeyStep .step-number {
    background: linear-gradient(145deg, #d98b21, #a85e0c);
}

.private-key-warning p,
.private-key-success p {
    margin: 9px 0 0;
}

.private-key-success span {
    display: inline;
    color: #ffffff;
    font-weight: 800;
}

/* END PRIVATE KEY STEP */


/* BEGIN PRIVATE KEY SCANNER */

#privateKeyReader {
    width: 100%;
    overflow: hidden;
    border-radius: 14px;
    background: #000000;
}

#privateKeyReader video {
    border-radius: 14px;
}

.private-scanner-note {
    padding: 11px 13px;
    border: 1px solid rgba(255, 184, 77, 0.28);
    border-radius: 11px;
    background: rgba(128, 77, 8, 0.18);
    color: #ffd89a;
    font-size: 13px;
    line-height: 1.5;
}

/* END PRIVATE KEY SCANNER */
