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

body {
    background-color: #0f172a; /* Dark blue/slate background */
    color: #f8fafc;
    overflow-x: hidden;
}

#app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    padding-bottom: 80px; /* Space for bottom nav */
}

/* Header */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
}

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

.avatar img, .avatar-large img {
    border-radius: 50%;
    object-fit: cover;
}
.avatar img { width: 40px; height: 40px; }
.avatar-large img { width: 64px; height: 64px; }

.user-details h3 {
    font-size: 16px;
    font-weight: 600;
}
.user-details span {
    font-size: 12px;
    color: #94a3b8;
}

.coins {
    background: #1e293b;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Screens */
.screen {
    display: none;
    padding: 0 16px;
    animation: fadeIn 0.3s ease;
}

.screen.active {
    display: block;
}

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

/* Home Screen */
.balance-card {
    background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

.balance-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.balance-amount {
    font-size: 36px;
    font-weight: 700;
    margin: 8px 0 24px 0;
}
.balance-amount span {
    font-size: 16px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
}

.action-buttons {
    display: flex;
    gap: 12px;
}

.action-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 12px 8px;
    color: white;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}
.action-btn:active {
    background: rgba(255, 255, 255, 0.25);
}
.action-btn i {
    font-size: 18px;
}
.action-btn span {
    font-size: 11px;
    font-weight: 500;
}

.tabs {
    display: flex;
    background: #1e293b;
    border-radius: 16px;
    padding: 4px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 10px 0;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    background: #334155;
    color: white;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.game-card {
    background: #1e293b;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    text-align: center;
    padding-bottom: 12px;
}

.game-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    margin-bottom: 8px;
}

.game-card h4 {
    font-size: 11px;
    font-weight: 500;
    padding: 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge, .badge-center {
    position: absolute;
    font-size: 9px;
    font-weight: 700;
    padding: 4px 6px;
    border-radius: 8px;
    color: white;
}
.badge { top: 6px; right: 6px; }
.badge.global { background: #3b82f6; }
.badge.sng { background: #4f46e5; }
.badge.avto { background: #6366f1; }
.badge i { color: #FFD700; margin-right: 2px; }

.badge-center.texnik {
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ea580c;
    width: 80%;
}

.star-placeholder {
    height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle, #3b2c6b 0%, #1e1b4b 100%);
}
.star-placeholder span {
    margin-top: 8px;
    font-weight: 700;
    color: #FFD700;
    font-size: 14px;
}

/* History Screen */
.page-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
}

.filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 40px;
    overflow-x: auto;
    padding-bottom: 8px;
}
.filter-tabs::-webkit-scrollbar { display: none; }

.filter-btn {
    background: #1e293b;
    border: 1px solid #334155;
    color: #94a3b8;
    padding: 8px 16px;
    border-radius: 20px;
    white-space: nowrap;
    font-size: 13px;
    cursor: pointer;
}
.filter-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.empty-state {
    text-align: center;
    color: #64748b;
    font-size: 14px;
    margin-top: 80px;
}

/* Settings Screen */
.settings-profile {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    background: #1e293b;
    padding: 20px;
    border-radius: 20px;
}

.profile-info h2 { font-size: 20px; margin-bottom: 4px; }
.profile-info span { color: #94a3b8; font-size: 14px; }
.user-id {
    margin-top: 8px;
    background: #0f172a;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    color: #cbd5e1;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.finance-cards {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.finance-card {
    flex: 1;
    background: #1e293b;
    border-radius: 16px;
    padding: 16px;
}

.finance-card .label {
    font-size: 11px;
    color: #94a3b8;
    letter-spacing: 1px;
}
.finance-card .value {
    font-size: 20px;
    font-weight: 700;
    margin-top: 8px;
}
.finance-card .value span { font-size: 14px; font-weight: 400; }
.text-warning { color: #eab308; }

.settings-section {
    margin-bottom: 24px;
}
.section-label {
    font-size: 11px;
    color: #64748b;
    letter-spacing: 1px;
    margin-bottom: 12px;
    display: block;
}

.phone-connect-btn {
    width: 100%;
    background: #1e293b;
    border: none;
    color: white;
    padding: 16px;
    border-radius: 16px;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}
.phone-connect-btn i { color: #94a3b8; }

.lang-selector {
    display: flex;
    gap: 12px;
}
.lang-btn {
    flex: 1;
    background: #1e293b;
    border: none;
    color: #94a3b8;
    padding: 14px;
    border-radius: 16px;
    font-size: 15px;
    cursor: pointer;
}
.lang-btn.active {
    background: #334155;
    color: white;
}

.services-list {
    background: #1e293b;
    border-radius: 16px;
    overflow: hidden;
}
.service-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #334155;
}
.service-item:last-child { border-bottom: none; }
.service-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    color: #a78bfa;
}
.service-icon i { font-size: 18px; }
.service-text h4 { font-size: 15px; font-weight: 500; margin-bottom: 4px; }
.service-text p { font-size: 12px; color: #94a3b8; }
.arrow { margin-left: auto; color: #64748b; }

/* Top-up Screen */
.subtitle {
    color: #94a3b8;
    font-size: 14px;
    margin-bottom: 24px;
}

.guide-banner {
    background: #1e293b;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.guide-content { display: flex; align-items: center; gap: 12px; font-weight: 500; }
.guide-content i { color: #818cf8; }
.guide-link { color: #818cf8; font-size: 13px; }

.payment-methods {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.payment-card {
    background: #1e293b;
    border-radius: 16px;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    cursor: pointer;
}
.payment-card:first-child { background: #f8fafc; color: #0f172a; }
.payment-card:first-child .icon { color: #2563eb; font-size: 32px; }
.payment-card span { font-weight: 500; font-size: 14px; }
.icon { font-size: 32px; }
.atm-icon { color: #22c55e; }
.sbp-icon { color: #ec4899; }
.stars-icon { color: #eab308; }


/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: #1e293b;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 12px 16px;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: #64748b;
    font-size: 10px;
    cursor: pointer;
    transition: color 0.2s;
}

.nav-item.active {
    color: white;
}

.nav-item i {
    font-size: 20px;
}

.rent-btn {
    background: #0f172a;
    border: 1px solid #3b82f6;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: -24px;
    color: #eab308;
}
.rent-btn i { margin-bottom: 2px; }

.bot-username {
    position: fixed;
    bottom: 80px;
    left: 0;
    width: 100%;
    text-align: center;
    color: #64748b;
    font-size: 12px;
}
