:root {
    --bg-color: #050a0f;
    --text-color: #ffffff;
    --hint-color: #9ab4c2;
    --card-bg: rgba(10, 18, 25, 0.6);
    --card-border: rgba(85, 136, 163, 0.3);
    --input-bg: rgba(5, 10, 15, 0.7);
    --accent: #5588a3;
    --accent-text: #ffffff;
    --danger: #ff453a;
    
    --tg-theme-bg-color: #050a0f;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.47059;
    font-weight: 400;
    letter-spacing: -0.022em;
    -webkit-font-smoothing: antialiased;
    padding: 24px;
    height: 100vh;
    overflow-x: hidden;
}

.bg-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: url('bg_premium.png') no-repeat center center;
    background-size: cover;
    z-index: -1;
    filter: brightness(0.6) blur(2px);
}

.app-container {
    max-width: 500px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Screens Toggle logic */
.screen {
    display: none;
    flex-direction: column;
    gap: 40px;
}

.screen.active {
    display: flex;
    animation: fadeIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Header UI - Apple/Tesla esque minimal */
.header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.hero-image-container {
    width: 100%;
    /* Huge scaling out of bounds */
    max-width: 600px;
    height: auto;
    margin-top: 20px;
    margin-bottom: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: scale(1.8); /* Doubling size making it pop outside borders! */
    filter: drop-shadow(0 25px 40px rgba(85, 136, 163, 0.6));
}

.hero-image {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.logo-wrapper {
    width: 68px;
    height: 68px;
    background: rgba(11, 232, 249, 0.05);
    border: 1px solid rgba(11, 232, 249, 0.2);
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 32px;
    margin-bottom: 12px;
    box-shadow: inset 0 0 20px rgba(11, 232, 249, 0.1);
}

.title {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-shadow: 0 0 20px rgba(11, 232, 249, 0.3);
}

.subtitle {
    font-size: 15px;
    color: var(--hint-color);
    max-width: 90%;
    font-weight: 400;
}

.dash-subtitle {
    font-family: monospace;
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    border-radius: 12px;
    color: #fff;
    margin-top: 4px;
    letter-spacing: 0.5px;
}

.unlink-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--hint-color);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    margin-top: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.unlink-btn:hover {
    color: var(--danger);
    border-color: rgba(255, 69, 58, 0.3);
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.info-card {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 16px;
    border-radius: 16px;
    font-size: 14px;
    color: var(--hint-color);
    text-align: center;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* Input Minimalista */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.input-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--hint-color);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-left: 4px;
}

.input-wrapper {
    position: relative;
    border-radius: 20px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    transition: all 0.3s ease;
}

.input-wrapper:focus-within {
    border-color: var(--accent);
    background: rgba(8, 15, 22, 0.9);
    box-shadow: 0 0 15px rgba(85, 136, 163, 0.2);
}

input {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-color);
    padding: 20px;
    font-size: 17px;
    font-weight: 500;
    outline: none;
}

input::placeholder {
    color: rgba(255, 255, 255, 0.3);
    font-weight: 400;
}

.error-msg {
    color: var(--danger);
    font-size: 13px;
    margin-left: 4px;
    font-weight: 500;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.error-msg.visible {
    display: block;
    opacity: 1;
}

/* DASHBOARD STYLES */
.dash-header {
    margin-top: 5px;
    gap: 4px;
}

.hero-image-container.mini {
    max-width: 280px;
    width: 100%;
    margin-top: 20px;
    margin-bottom: 5px;
    filter: drop-shadow(0 15px 30px rgba(85, 136, 163, 0.5));
}

.dashboard-content {
    gap: 20px;
}

.dash-copy-block {
    width: 100%;
    margin-top: 5px;
    background: rgba(85, 136, 163, 0.1);
    border: 1px solid rgba(85, 136, 163, 0.25);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-family: monospace;
    transition: background 0.2s;
    backdrop-filter: blur(10px);
}

.dash-copy-block:active {
    background: rgba(85, 136, 163, 0.4);
}

.dash-wallet-hash {
    font-size: 16px;
    color: var(--text-color);
    letter-spacing: 0.05em;
}

.copy-icon {
    font-size: 18px;
    color: var(--accent);
}

.balances-container {
    display: flex;
    gap: 12px;
}

.balance-card {
    flex: 1;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    backdrop-filter: blur(10px);
}

.balance-card.usdt { border-color: rgba(48, 209, 88, 0.4); }

.balance-label {
    font-size: 16px;
    text-transform: uppercase;
    color: var(--hint-color);
    letter-spacing: 0.05em;
    font-weight: 700;
}

.balance-val {
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qr-container {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    backdrop-filter: blur(10px);
    margin-bottom: 20px;
}

.qr-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--hint-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#qrcode-box {
    background: #ffffff;
    padding: 12px;
    border-radius: 16px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
}

#qrcode-box img {
    margin: 0 auto;
    display: block;
}

.history-container {
    margin-top: 10px;
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--hint-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-left: 4px;
}

#tx-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tx-loading {
    text-align: center;
    color: var(--hint-color);
    font-size: 13px;
    padding: 20px;
    font-style: italic;
}

.tx-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
    transition: transform 0.2s ease;
}

.tx-card:active {
    transform: scale(0.98);
}

.tx-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tx-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
}

.tx-icon.in {
    background: rgba(48, 209, 88, 0.15);
    color: #30d158;
}

.tx-icon.out {
    background: rgba(255, 69, 58, 0.15);
    color: #ff453a;
}

.tx-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.tx-hash {
    font-size: 13px;
    color: #ffffff;
    font-family: monospace;
}

.tx-date {
    font-size: 11px;
    color: var(--hint-color);
}

.tx-value {
    font-size: 15px;
    font-weight: 700;
    font-family: monospace;
}

.tx-value.in { color: #30d158; }
.tx-value.out { color: #ff453a; }

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
