:root {
    --bg-dark: #0a0a0f;
    --bg-card: #14141f;
    --bg-card-strong: #171726;
    --bg-input: #1c1c2a;
    --accent: #81ff5e;
    --accent-green: #00d26a;
    --accent-red: #ff4757;
    --accent-gold: #ffd700;
    --accent-blue: #31a8ff;
    --accent-purple: #7d6cff;
    --accent-orange: #ff9f43;
    --text: #ffffff;
    --text-muted: #8a8aa1;
    --border: rgba(255, 255, 255, 0.08);
    --shadow-lg: 0 28px 60px rgba(0, 0, 0, 0.32);
    --shadow-md: 0 18px 40px rgba(0, 0, 0, 0.24);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

button {
    border: 0;
    background: none;
}

.hidden {
    display: none !important;
}

.splash-screen,
.auth-screen {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    display: none;
}

.splash-screen.active,
.auth-screen.active {
    display: flex;
    flex-direction: column;
}

.splash-screen {
    background: linear-gradient(180deg, #0a0a0f 0%, #151527 44%, #0a0a0f 100%);
}

.splash-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 18% 14%, rgba(255, 71, 87, 0.16) 0%, transparent 36%),
        radial-gradient(circle at 78% 80%, rgba(0, 210, 106, 0.14) 0%, transparent 42%),
        radial-gradient(circle at 58% 40%, rgba(125, 108, 255, 0.08) 0%, transparent 28%);
    z-index: 0;
}

.splash-content,
.auth-content,
.app-content {
    width: min(100%, 440px);
    margin: 0 auto;
}

.splash-content {
    flex: 1;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 42px 24px 148px;
}

.logo-large {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
    width: fit-content;
    color: inherit;
}

.logo-icon-large {
    width: 118px;
    height: 118px;
    margin-bottom: 22px;
    border-radius: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow-lg);
}

.logo-icon-large__image {
    width: 88px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.28));
}

.logo-text {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.logo-text span,
.auth-logo-text span {
    color: var(--accent);
}

.tagline {
    margin-top: 10px;
    text-align: center;
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.55;
}

.features-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 36px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 15px 18px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    backdrop-filter: blur(6px);
}

.feature-icon {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.feature-icon svg {
    width: 22px;
    height: 22px;
}

.feature-icon.green {
    background: rgba(0, 210, 106, 0.14);
}

.feature-icon.green svg {
    fill: var(--accent-green);
}

.feature-icon.red {
    background: rgba(255, 71, 87, 0.14);
}

.feature-icon.red svg {
    fill: var(--accent-red);
}

.feature-icon.gold {
    background: rgba(255, 215, 0, 0.14);
}

.feature-icon.gold svg {
    fill: var(--accent-gold);
}

.feature-text {
    font-size: 0.96rem;
    font-weight: 600;
    line-height: 1.45;
}

.splash-buttons,
.auth-footer,
.app-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    width: min(100%, 440px);
    margin: 0 auto;
    padding: 18px 24px calc(24px + env(safe-area-inset-bottom));
    display: grid;
    gap: 12px;
}

.splash-buttons {
    background: linear-gradient(to top, rgba(10, 10, 15, 0.98) 66%, rgba(10, 10, 15, 0));
}

.auth-footer,
.app-footer {
    background: rgba(10, 10, 15, 0.98);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(18px);
}

.app-footer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.btn {
    min-height: 58px;
    border-radius: 16px;
    padding: 16px 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease, border-color 0.18s ease;
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    width: 100%;
}

.btn:active {
    transform: scale(0.985);
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.62;
}

.btn-primary {
    color: #08110a;
    background: linear-gradient(135deg, var(--accent), #5b6e59);
    box-shadow: 0 16px 32px rgba(0, 210, 106, 0.14);
}

.btn-secondary {
    color: var(--text);
    background: var(--bg-input);
    border: 1px solid var(--border);
}

.auth-screen {
    background: var(--bg-dark);
}

.auth-header {
    width: min(100%, 440px);
    margin: 0 auto;
    padding: 18px 24px 8px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.back-btn,
.icon-btn {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
}

.back-btn svg,
.icon-btn svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.auth-title {
    font-size: 1.35rem;
    font-weight: 800;
}

.auth-content {
    flex: 1;
    padding: 20px 24px 146px;
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 26px;
    width: fit-content;
    color: inherit;
}

.auth-logo-icon {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-logo-icon__image {
    width: 40px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.24));
}

.auth-logo-text {
    font-size: 1.42rem;
    font-weight: 800;
}

.auth-logo--app {
    align-items: center;
    gap: 14px;
    margin-top: 8px;
    margin-bottom: 0;
}

.auth-logo--app .auth-logo-icon {
    width: 68px;
    height: 68px;
    border-radius: 18px;
}

.auth-logo--app .auth-logo-icon__image {
    width: 48px;
}

.auth-logo--app .auth-logo-text {
    font-size: 1.56rem;
    line-height: 1;
    transform: translateY(-2px);
}

.auth-subtitle {
    margin-bottom: 28px;
    font-size: 1rem;
    line-height: 1.55;
    color: var(--text-muted);
}

.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.input-with-icon {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    fill: var(--text-muted);
}

.form-input {
    width: 100%;
    min-height: 56px;
    padding: 16px 18px 16px 48px;
    border-radius: 15px;
    border: 2px solid var(--border);
    background: var(--bg-input);
    color: var(--text);
    transition: border-color 0.18s ease, background 0.18s ease;
}

.form-input:focus,
.copy-input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(129, 255, 94, 0.06);
}

.form-input::placeholder,
.copy-input::placeholder {
    color: var(--text-muted);
}

.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
}

.password-toggle svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 22px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox {
    width: 22px;
    height: 22px;
    border-radius: 7px;
    border: 2px solid var(--border);
    background: var(--bg-input);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox svg {
    width: 14px;
    height: 14px;
    fill: white;
    display: none;
}

.checkbox.checked {
    border-color: var(--accent);
    background: var(--accent);
}

.checkbox.checked svg {
    display: block;
}

.checkbox-label {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.auth-note,
.empty-state {
    padding: 16px 18px;
    border-radius: 15px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-size: 0.94rem;
    line-height: 1.55;
}

.input-hint {
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 0.84rem;
    line-height: 1.45;
}

.switch-text {
    margin-top: 2px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.94rem;
}

.switch-text a {
    color: var(--accent);
    font-weight: 700;
}

.app-screen {
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #0a0a0f 0%, #151527 44%, #0a0a0f 100%);
    overflow: hidden;
}

.app-content {
    position: relative;
    z-index: 1;
    flex: 1;
    padding: 22px 24px 154px;
}

.app-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 22px;
}

.topbar-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar-chip {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.05rem;
}

.wallet-card {
    margin-bottom: 18px;
    padding: 22px;
    border-radius: 24px;
    background:
        linear-gradient(160deg, rgba(20, 20, 31, 0.96), rgba(18, 28, 23, 0.96)),
        linear-gradient(135deg, rgba(129, 255, 94, 0.08), rgba(49, 168, 255, 0.08));
    border: 1px solid rgba(129, 255, 94, 0.14);
    box-shadow: var(--shadow-lg);
}

.wallet-card__top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.wallet-label {
    display: inline-block;
    margin-bottom: 6px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.wallet-amount {
    display: block;
    font-size: 2rem;
    line-height: 1;
    font-weight: 800;
    color: #fff0a4;
}

.wallet-badge {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(129, 255, 94, 0.12);
    color: var(--accent);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

.wallet-card h1 {
    margin-bottom: 10px;
    font-size: 1.72rem;
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.wallet-card p {
    color: var(--text-muted);
    line-height: 1.55;
}

.wallet-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.panel {
    margin-bottom: 18px;
    padding: 18px;
    border-radius: 20px;
    background: rgba(20, 20, 31, 0.96);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}

.section-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.section-title h2 {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.section-title a {
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
}

.section-kicker {
    display: inline-block;
    margin-bottom: 6px;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 800;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.stat-card {
    padding: 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
}

.stat-card strong {
    display: block;
    margin-bottom: 6px;
    font-size: 1.24rem;
    font-weight: 800;
}

.stat-card small {
    display: block;
    font-size: 0.84rem;
    line-height: 1.45;
    color: var(--text-muted);
}

.stat-label {
    display: inline-block;
    margin-bottom: 10px;
    color: var(--text-muted);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.value-positive {
    color: var(--accent);
}

.value-negative {
    color: var(--accent-red);
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.action-card {
    min-height: 132px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.action-card:active {
    transform: scale(0.985);
}

.action-card strong {
    font-size: 1rem;
    font-weight: 800;
}

.action-card span:last-child {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.action-card__icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.action-card__icon svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.action-card__icon--green {
    background: rgba(0, 210, 106, 0.14);
    color: var(--accent-green);
}

.action-card__icon--gold {
    background: rgba(255, 215, 0, 0.14);
    color: var(--accent-gold);
}

.action-card__icon--red {
    background: rgba(255, 71, 87, 0.14);
    color: var(--accent-red);
}

.action-card__icon--blue {
    background: rgba(49, 168, 255, 0.14);
    color: var(--accent-blue);
}

.action-card__icon--purple {
    background: rgba(125, 108, 255, 0.14);
    color: var(--accent-purple);
}

.action-card__icon--orange {
    background: rgba(255, 159, 67, 0.14);
    color: var(--accent-orange);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.history-item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.history-meta {
    min-width: 0;
}

.history-meta strong {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
}

.history-meta span {
    display: block;
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.history-values {
    text-align: right;
    display: grid;
    gap: 6px;
    justify-items: end;
}

.history-values span:first-child {
    color: var(--text-muted);
    font-size: 0.86rem;
}

.status-pill {
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
}

.status-pill--success {
    color: var(--accent);
    background: rgba(0, 210, 106, 0.14);
}

.status-pill--danger {
    color: var(--accent-red);
    background: rgba(255, 71, 87, 0.14);
}

.copy-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.copy-input {
    min-height: 52px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 2px solid var(--border);
    background: var(--bg-input);
    color: var(--text);
}

.copy-btn {
    min-width: 94px;
    padding: 0 16px;
    border-radius: 14px;
    background: rgba(129, 255, 94, 0.12);
    color: var(--accent);
    border: 1px solid rgba(129, 255, 94, 0.18);
    font-weight: 800;
    cursor: pointer;
}

.toast-container {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    width: min(calc(100% - 24px), 400px);
    z-index: 50;
    display: grid;
    gap: 10px;
    pointer-events: none;
}

.toast {
    padding: 14px 16px;
    border-radius: 14px;
    color: white;
    font-size: 0.92rem;
    line-height: 1.45;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(20, 20, 31, 0.98);
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: var(--shadow-md);
}

.toast.toast-show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    border-color: rgba(0, 210, 106, 0.26);
}

.toast-error {
    border-color: rgba(255, 71, 87, 0.26);
}

@media (min-width: 768px) {
    .action-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 380px) {
    .stats-grid,
    .wallet-actions,
    .app-footer {
        grid-template-columns: 1fr;
    }

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

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

    .history-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .history-values {
        width: 100%;
        justify-items: start;
        text-align: left;
    }
}
