* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #000000;
    color: #ffffff;
    height: 100vh;
    overflow: hidden;
    touch-action: manipulation;
    -ms-touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.app {
    width: 100%;
    height: 100vh;
    position: relative;
    perspective: 1000px;
    overflow: hidden;
    max-width: 480px;
    margin: 0 auto;
    touch-action: manipulation;
    -ms-touch-action: manipulation;
}

.loading-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.telegram-logo {
    opacity: 0;
    animation: appearWaitAndUp 1.6s forwards ease-out;
    filter: drop-shadow(0 0 8px rgba(232, 232, 232, 0.7));
}

.logo img {
    filter: drop-shadow(0 0 5px rgba(232, 232, 232, 0.6));
}

.telegram-star {
    font-size: 80px;
    opacity: 0;
    animation: appearWaitAndUp 1.6s forwards ease-out;
    color: #ffffff;
}

.progress-container {
    width: 40%;
    max-width: 300px;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    opacity: 0;
    animation: fadeIn 0.5s forwards 1.6s ease-out;
}

.progress-bar {
    height: 100%;
    background-color: #ffffff;
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}

@keyframes appearWaitAndUp {
    0% {
        opacity: 0;
        transform: scale(0.5);
        filter: blur(10px);
    }
    30% {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }
    60% {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: blur(0);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(-25px);
        filter: blur(0);
    }
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

.main-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 20px;
    padding-bottom: 0px;
    overflow-y: auto;
    background-color: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(2px);
    z-index: 2;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 16px 20px;
    background-color: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.logo {
    color: #ffffff;
    display: flex;
    align-items: center;
}

.logo img {
    filter: brightness(1.2);
}

.login-container {
    display: flex;
    align-items: center;
}

.login-button {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.login-button:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.login-button:active {
    transform: scale(0.98);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding: 16px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
    color: #ffffff;
    overflow: hidden;
    flex-shrink: 0;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-username {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-id-section {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-id {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
}

.copy-button {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-button:hover {
    color: rgba(255, 255, 255, 0.8);
    background-color: rgba(255, 255, 255, 0.05);
}

.copy-button:active {
    transform: scale(0.95);
}

.copy-button.copied {
    color: #4caf50;
}

.notification-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}

.notification {
    min-width: 250px;
    max-width: 90%;
    margin-top: 20px;
    padding: 12px 16px;
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    pointer-events: auto;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.8);
    background-color: rgba(0, 0, 0, 0.85);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    transform: translateY(-20px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.notification::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.notification.success {
    border-color: rgba(46, 213, 115, 0.8);
    box-shadow: 0 0 15px rgba(46, 213, 115, 0.6), 0 4px 12px rgba(0, 0, 0, 0.5);
}

.notification.success::after {
    background-color: #2ed573;
    box-shadow: 0 0 10px #2ed573;
}

.notification.error {
    border-color: rgba(255, 71, 87, 0.8);
    box-shadow: 0 0 15px rgba(255, 71, 87, 0.6), 0 4px 12px rgba(0, 0, 0, 0.5);
}

.notification.error::after {
    background-color: #ff4757;
    box-shadow: 0 0 10px #ff4757;
}

.notification.warning {
    border-color: rgba(255, 165, 2, 0.8);
    box-shadow: 0 0 15px rgba(255, 165, 2, 0.6), 0 4px 12px rgba(0, 0, 0, 0.5);
}

.notification.warning::after {
    background-color: #ffa502;
    box-shadow: 0 0 10px #ffa502;
}

.notification.info {
    border-color: rgba(55, 66, 250, 0.8);
    box-shadow: 0 0 15px rgba(55, 66, 250, 0.6), 0 4px 12px rgba(0, 0, 0, 0.5);
}

.notification.info::after {
    background-color: #3742fa;
    box-shadow: 0 0 10px #3742fa;
}

.notification.default {
    border-color: rgba(116, 125, 140, 0.8);
    box-shadow: 0 0 15px rgba(116, 125, 140, 0.6), 0 4px 12px rgba(0, 0, 0, 0.5);
}

.notification.default::after {
    background-color: #747d8c;
    box-shadow: 0 0 10px #747d8c;
}

.main-screen {
    scroll-padding-top: 96px;
}

.pages-container {
    margin-top: 20px;
    min-height: 70vh;
}

.page-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    margin-bottom: 20px;
}

.page-content.active {
    display: block;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 16px 0;
}

.page-content p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    line-height: 1.5;
}

.auth-required {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    min-height: 200px;
}

.auth-message {
    margin-bottom: 24px;
}

.auth-message p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 16px;
}

.auth-button {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-button:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.auth-button:active {
    transform: scale(0.98);
}

.gifts-content, .profile-content {
    padding: 20px;
    text-align: center;
}

.bottom-navbar {
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 12px 10px 0px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.85));
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 40;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.3);
    margin: 0 -20px -20px;
    width: calc(100% + 40px);
    border-radius: 24px 24px 0 0;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 8px 12px;
    border-radius: 16px;
    position: relative;
    min-width: 50px;
}

.nav-item::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 70%);
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
    z-index: -1;
}

.nav-item:hover::before {
    width: 50px;
    height: 50px;
}

.nav-item:hover {
    transform: translateY(-3px);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
    transform: translateY(-3px);
}

.nav-item.active::before {
    width: 50px;
    height: 50px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 70%);
}

.nav-icon {
    width: 28px;
    height: 28px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

#homeIcon img {
    width: 20px;
    height: 20px;
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
    transform: scale(1.1);
}

.nav-label {
    font-size: 11px;
    color: #ffffff;
    opacity: 0.7;
    transition: all 0.3s ease;
    font-weight: 500;
    letter-spacing: 0.2px;
}

.nav-item:hover .nav-label {
    opacity: 0.9;
}

.nav-item.active .nav-label {
    opacity: 1;
    font-weight: 600;
}

/* Стили для модального окна авторизации */
.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.auth-modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.auth-modal {
    background-color: #000000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    padding: 0;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.auth-modal-overlay.visible .auth-modal {
    transform: translateY(0);
}

.auth-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.auth-modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.auth-modal-close:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
}

.auth-modal-close:active {
    transform: scale(0.95);
}

.auth-modal-content {
    padding: 20px;
    text-align: center;
}

.auth-modal-text {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 24px;
    line-height: 1.5;
}

.auth-modal-submit {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-radius: 8px;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.auth-modal-submit:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.auth-modal-submit:active {
    transform: scale(0.98);
}

/* Стили для заставки Telegram */
.telegram-splash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.05);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    transition: opacity 0.3s ease, backdrop-filter 0.3s ease, background-color 0.3s ease;
}

.telegram-splash.visible {
    opacity: 1;
    visibility: visible;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    background-color: rgba(0, 0, 0, 0.35);
}

.telegram-splash.visible.closing {
    opacity: 0;
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    background-color: rgba(0, 0, 0, 0.05);
}

.splash-content {
    width: 90%;
    max-width: 420px;
    background-color: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
    position: relative;
}

.splash-track {
    display: flex;
    width: 300%;
    transform: translateX(0);
    transition: transform 0.45s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    z-index: 1;
}

.splash-content.phone-step .splash-track {
    transform: translateX(-33.3333%);
}

.splash-content.code-step .splash-track {
    transform: translateX(-66.6667%);
}

.splash-panel {
    width: 33.3333%;
    padding: 40px 28px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 24px;
    min-height: 360px;
}

.splash-panel-phone {
    background: radial-gradient(circle at top, rgba(34, 158, 217, 0.08), transparent 65%);
}

.telegram-splash.visible .splash-content {
    transform: translateY(0);
    opacity: 1;
}

.telegram-splash.closing .splash-content {
    transform: translateY(24px);
    opacity: 0;
}

.splash-logo img {
    width: 80px;
    height: 80px;
    filter: brightness(1.2);
}

.splash-logo-small img {
    width: 64px;
    height: 64px;
}

.splash-text {
    text-align: center;
}

.splash-text h2 {
    font-size: 24px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 16px;
}

.splash-text p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
}

.btn-telegram {
    width: 100%;
    background: linear-gradient(135deg, #2AABEE, #229ED9);
    border: none;
    color: #ffffff;
    border-radius: 999px;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    box-shadow: 0 12px 30px rgba(34, 158, 217, 0.35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-telegram:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 36px rgba(34, 158, 217, 0.4);
}

.btn-telegram:active {
    transform: scale(0.98);
}

.btn-telegram:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-telegram-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: none;
}

.btn-telegram-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    box-shadow: none;
}

.btn-telegram.loading {
    opacity: 0.85;
}

.btn-telegram.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    display: inline-block;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
    margin-left: 6px;
}

.splash-footnote {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.4;
}

.code-hint {
    font-weight: 600;
    color: #ffffff;
}

.code-input-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.code-hidden-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.code-slots {
    display: flex;
    gap: 12px;
}

.code-slot {
    width: 48px;
    height: 64px;
    border-radius: 14px;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    background: rgba(9, 14, 20, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 600;
    color: #ffffff;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.code-slot.filled {
    border-color: rgba(42, 171, 238, 0.8);
    box-shadow: 0 0 12px rgba(34, 158, 217, 0.4);
}

.code-slot.success {
    border-color: rgba(46, 213, 115, 0.9);
    background: rgba(46, 213, 115, 0.1);
    color: #2ed573;
    box-shadow: 0 0 12px rgba(46, 213, 115, 0.6);
}

.code-slot.error {
    border-color: rgba(255, 71, 87, 0.9);
    background: rgba(255, 71, 87, 0.1);
    color: #ff4757;
    animation: codeShake 0.18s ease-in-out 2;
}

.code-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.code-status {
    min-height: 24px;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
}

.code-status.pending {
    color: rgba(255, 255, 255, 0.7);
}

.code-status.success {
    color: #2ed573;
}

.code-status.error {
    color: #ff4757;
}

.btn-ghost {
    border: none;
    background: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 4px;
    transition: color 0.2s ease;
}

.btn-ghost:hover {
    color: #ffffff;
}

.btn-ghost:active {
    opacity: 0.8;
}

@keyframes codeShake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    50% { transform: translateX(4px); }
    75% { transform: translateX(-4px); }
    100% { transform: translateX(0); }
}

.splash-timer {
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
    text-align: center;
    padding: 10px 16px;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.05);
}

.splash-error {
    font-size: 14px;
    color: #ff6b6b;
    text-align: center;
    min-height: 20px;
}

.splash-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background-color: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
    backdrop-filter: blur(6px);
    z-index: 2;
}

.splash-close:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.splash-close:active {
    transform: scale(0.95);
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .bottom-navbar {
        padding-bottom: 40px;
    }
    
    .main-screen {
        padding-top: 100px;
    }
    
    .notification-container {
        top: 11vh;
    }

    .notification {
        font-size: 13px;
    }

    .auth-modal,
    .splash-content {
        width: 95%;
        margin: 0 10px;
    }

    .splash-panel {
        padding: 32px 20px 28px;
        min-height: 320px;
    }
}

