@font-face {
    font-family: 'Gilroy';
    src: url('fonts/Gilroy-Black_0.ttf') format('truetype');
    font-weight: 900;
}
@font-face {
    font-family: 'Comfortaa';
    src: url('fonts/Comfortaa.ttf') format('truetype');
}
@font-face {
    font-family: 'Uncage';
    src: url('fonts/ofont.ru_Uncage.ttf') format('truetype');
}

:root {
    --bg-color: #0b0c10;
    --accent: #ff8c00;
    --accent-bright: #ffae00;
    --accent-glow: rgba(255, 140, 0, 0.4);
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text: #ffffff;
    --hint: #8a96a3;
    --tg-blue: #24a1de;
    --success: #00e676;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    text-decoration: none !important;
}

img {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    pointer-events: none;
}

a, button, i, .sub-btn, .claim-btn, .nav-item, .link-copy-box, .main-btn, .search-item, .delete-btn {
    pointer-events: auto;
}

a, button, i {
    text-decoration: none !important;
    border: none;
    outline: none;
}

body {
    background: var(--bg-color);
    color: var(--text);
    font-family: 'Gilroy', sans-serif;
    margin: 0;
    padding: 0;
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.bg-glow-container {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
}

.glow-orb {
    position: absolute;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    filter: blur(80px);
    border-radius: 50%;
    animation: moveOrb 15s infinite alternate ease-in-out;
}

.orb-1 { top: -10%; right: -10%; animation-duration: 12s; }
.orb-2 { bottom: -10%; left: -10%; animation-duration: 18s; animation-delay: -5s; }

@keyframes moveOrb {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(100px, 50px) scale(1.1); }
    66% { transform: translate(-50px, 100px) scale(0.9); }
    100% { transform: translate(50px, -50px) scale(1); }
}

#loading-screen {
    position: fixed;
    inset: 0;
    background: var(--bg-color);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    transition: opacity 0.5s ease;
}

#maintenance-screen {
    position: fixed;
    inset: 0;
    background: var(--bg-color);
    z-index: 11000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
}

.loader-logo, .maintenance-logo { 
    max-width: 160px;
    width: 45%;
    height: auto;
    margin-bottom: 25px; 
}

.loader-logo {
    animation: loaderPulse 1.5s infinite; 
}

#maint-title {
    font-family: 'Uncage', sans-serif;
    color: var(--accent);
    margin: 0 0 10px 0;
    letter-spacing: 2px;
    font-size: 1.5rem;
}

#maint-text {
    font-family: 'Comfortaa', sans-serif;
    font-size: 0.9rem;
    color: var(--hint);
    margin: 0 0 30px 0;
    line-height: 1.5;
    max-width: 80%;
}

.maint-socials {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.maint-btn-social {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
    transition: 0.3s;
}

.maint-btn-social:active {
    transform: scale(0.9);
}

.maint-btn-social.tg:hover { background: var(--tg-blue); border-color: var(--tg-blue); }
.maint-btn-social.ds:hover { background: #5865F2; border-color: #5865F2; }

.loader-text {
    font-family: 'Gilroy';
    letter-spacing: 3px;
    font-size: 12px;
    color: var(--accent);
}

@keyframes loaderPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }

#app-container {
    margin: 0 auto;
    padding: 15px;
    flex: 1;
    overflow-y: auto;
    padding-bottom: 110px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

#app-container::-webkit-scrollbar { display: none; }

.tab-content { 
    display: none; 
    animation: fadeIn 0.4s ease;
    width: 100%;
    flex-direction: column;
    gap: 15px;
}
.tab-content.active { display: flex; }

/* Ограничиваем ширину контента для обычных вкладок */
#tab-home, #tab-roulette, #tab-profile {
    max-width: 500px;
    margin: 0 auto;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.glass {
    background: var(--glass);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-radius: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.card { padding: 20px; margin-bottom: 5px; }

/* Сетка для админки */
.admin-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

@media (min-width: 650px) {
    .admin-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1000px) {
    .admin-grid { grid-template-columns: repeat(3, 1fr); }
}

.card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 15px; }
.card-header h2 { font-family: 'Uncage', sans-serif; font-size: 0.95rem; margin: 0; color: var(--accent); letter-spacing: 1px; }
.header-icon { font-size: 1.3rem; color: #fff; }
.highlight .header-icon { color: var(--accent); }

.info-box { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.info-item {
    display: flex; justify-content: space-between; padding: 15px; background: rgba(255,255,255,0.03);
    border-radius: 18px; font-size: 0.8rem; align-items: center;
}
.info-item .label { color: var(--hint); }
.info-item .value { color: var(--accent); font-weight: 900; }

/* КНОПКИ */
.main-btn { width: 100%; padding: 15px; background: var(--accent); border: none; border-radius: 15px; color: #fff; font-family: 'Gilroy'; font-weight: 900; margin-top: 10px; cursor: pointer; transition: 0.3s; }
.main-btn:active { transform: scale(0.98); }

.claim-btn {
    width: 100%; height: 60px;
    background: linear-gradient(45deg, #ff8c00, #ffae00);
    border: none; border-radius: 18px; color: #fff;
    font-family: 'Gilroy'; font-weight: 900; font-size: 1rem;
    cursor: pointer; box-shadow: 0 8px 25px rgba(255, 140, 0, 0.3);
    transition: 0.3s; display: flex; align-items: center; justify-content: center;
    margin-top: 10px;
}
.claim-btn:disabled { background: rgba(255,255,255,0.05); color: #555; box-shadow: none; cursor: not-allowed; }
.claim-btn:active:not(:disabled) { transform: translateY(2px); }

/* БЛЮР */
.blur-sensitive { filter: blur(5px); transition: filter 0.3s ease; cursor: pointer; }
.blur-sensitive.unblur { filter: blur(0); }

/* РЕФЕРАЛКА ТЕКСТ */
.ref-hint { display: block; text-align: center; font-size: 0.65rem; color: var(--hint); margin-top: 15px; font-family: 'Comfortaa'; }

/* ФОРМЫ */
input[type="text"], textarea, select { 
    width: 100%; padding: 15px; background: rgba(255,255,255,0.05); 
    border: 1px solid var(--glass-border); border-radius: 15px; color: #fff; 
    font-family: 'Gilroy'; outline: none; transition: 0.3s;
}
input:focus, textarea:focus, select:focus { background: rgba(255,255,255,0.1); border-color: var(--accent); }

/* Глобальное уведомление (Раскрывающееся) */
.global-notice-container { position: absolute; top: 20px; left: 20px; z-index: 1000; pointer-events: none; }
.notice-bar {
    pointer-events: auto; width: 38px; height: 38px;
    background: rgba(255, 255, 255, 0.07); backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px); border: 1px solid var(--glass-border);
    border-radius: 12px; display: flex; align-items: center; overflow: hidden;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1), height 0.5s, border-radius 0.3s, background 0.3s;
    cursor: pointer; box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: noticePulse 2s infinite ease-in-out;
}
.notice-bar i { min-width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; color: var(--accent); font-size: 1.1rem; transition: transform 0.3s ease; }
.notice-text { opacity: 0; white-space: nowrap; transition: opacity 0.3s ease; font-family: 'Comfortaa'; font-size: 0.8rem; padding-right: 15px; color: #eee; overflow: hidden; }
.notice-bar.expanded { width: 320px; max-width: 85vw; height: auto; min-height: 38px; border-radius: 15px; background: rgba(20, 20, 25, 0.95); animation: none; }
.notice-bar.expanded i { transform: rotate(90deg); color: #fff; }
.notice-bar.expanded .notice-text { opacity: 1; white-space: normal; padding: 10px 15px 10px 0; }
@keyframes noticePulse { 0% { transform: scale(1); opacity: 0.8; } 50% { transform: scale(1.1); opacity: 1; } 100% { transform: scale(1); opacity: 0.8; } }

.avatar-wrapper { width: 80px; height: 80px; margin-bottom: 12px; }
#user-photo { width: 100%; height: 100%; border-radius: 50%; border: 3px solid var(--accent); object-fit: cover; box-shadow: 0 0 20px var(--accent-glow); }

.profile-header { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 20px; width: 100%; }
.greeting-box { text-align: center; width: 100%; }
#user-name-title { font-size: 1.1rem; margin: 0; color: #fff; font-family: 'Uncage'; letter-spacing: 1px; }
.fade-subtext { font-family: 'Comfortaa'; font-size: 0.8rem; color: var(--hint); margin: 5px 0 0 0; }

/* Навигация */
.bottom-nav {
    position: fixed; bottom: 20px; left: 20px; right: 20px; height: 75px;
    background: rgba(15, 17, 22, 0.9); backdrop-filter: blur(30px); border: 1px solid var(--glass-border);
    border-radius: 25px; display: flex; justify-content: space-around; align-items: center; z-index: 9000;
}
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--hint); font-size: 0.6rem; font-family: 'Gilroy'; font-weight: 900; transition: all 0.3s ease; background: none; border: none; opacity: 0.4; cursor: pointer; }
.nav-icon { font-size: 22px; color: #fff; }
.nav-item.active { opacity: 1; color: var(--accent); }
.nav-item.active .nav-icon { color: var(--accent); transform: translateY(-3px); filter: drop-shadow(0 0 5px var(--accent-glow)); }

/* Анимация подсказки профиля */
.pulse-guide {
    animation: pulseGuide 1s ease-in-out 3;
    opacity: 1 !important;
    color: #fff !important;
}
.pulse-guide .nav-icon {
    color: #fff !important;
}
@keyframes pulseGuide {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Рулетка */
.roulette-wrapper { position: relative; width: 100%; height: 160px; background: rgba(0, 0, 0, 0.3); border-radius: 20px; overflow: hidden; margin-bottom: 20px; border: 1px solid var(--glass-border); }
.roulette-track { display: flex; position: absolute; top: 10px; left: 0; height: 140px; transition: transform 5s cubic-bezier(0.15, 0, 0.15, 1); will-change: transform; }
.roulette-track.idle { animation: idleScroll 60s linear infinite; transition: none; }
@keyframes idleScroll { from { transform: translateX(0); } to { transform: translateX(-2400px); } }
.roulette-item { flex-shrink: 0; width: 120px; height: 140px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 10px; }
.roulette-item img { width: 75px; height: 75px; object-fit: contain; margin-bottom: 10px; border-radius: 12px; background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.1); padding: 5px; }
.roulette-item span { font-size: 0.6rem; font-family: 'Gilroy'; color: #fff; line-height: 1.2; }
.roulette-pointer { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 0; height: 100%; z-index: 10; }
.roulette-pointer::before { content: '\f0d7'; font-family: 'Font Awesome 6 Free'; font-weight: 900; position: absolute; top: -5px; left: 50%; transform: translateX(-50%); color: var(--accent); font-size: 1.2rem; }

.live-history { display: flex; gap: 10px; overflow-x: auto; padding: 5px 15px 15px 5px; cursor: grab; }
.live-history::-webkit-scrollbar { display: none; }
.live-indicator {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    animation: livePulse 1.5s infinite ease-in-out;
}
@keyframes livePulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

.history-item { flex-shrink: 0; width: 115px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); border-radius: 18px; padding: 12px; text-align: center; pointer-events: none; }
.history-item img { width: 50px; height: 50px; object-fit: contain; margin-bottom: 8px; border-radius: 8px; }
.history-prize { display: block; font-size: 0.6rem; color: #fff; margin-bottom: 4px; font-weight: 900; }
.history-nick { display: block; font-size: 0.55rem; color: var(--accent); font-family: 'Uncage'; }

/* Каналы */
.channel-item { display: flex; justify-content: space-between; align-items: center; padding: 12px; background: rgba(255,255,255,0.02); border-radius: 15px; margin-bottom: 8px; border: 1px solid rgba(255,255,255,0.03); }
.channel-item.subscribed { opacity: 0.4; filter: grayscale(1); }
.channel-info { display: flex; align-items: center; gap: 10px; }
.channel-name { font-size: 0.85rem; font-weight: 900; font-family: 'Comfortaa'; }
.sub-btn { background: var(--tg-blue); color: #fff; padding: 6px 12px; border-radius: 10px; font-size: 0.65rem; font-weight: 900; }
.tg-icon { font-size: 1.2rem; color: var(--tg-blue); }

/* Инлайн блокировка */
.lock-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 35px 25px;
    margin: 10px 0;
    text-align: center;
}
.lock-icon-box {
    width: 65px;
    height: 65px;
    background: rgba(255, 140, 0, 0.08);
    border: 2px solid var(--accent);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--accent);
    margin-bottom: 15px;
    box-shadow: 0 10px 30px rgba(255, 140, 0, 0.2);
}
.lock-channel-box {
    width: 100%;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 10px;
}

/* Рефералы */
.link-copy-box { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--glass-border); border-radius: 18px; margin-top: 15px; cursor: pointer; }
#ref-link-display { font-family: 'Comfortaa'; font-size: 0.75rem; color: var(--hint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-right: 15px; }

/* Админ-контролы */
.control-list { display: flex; flex-direction: column; gap: 10px; }
.control-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 15px; background: rgba(255,255,255,0.02); border-radius: 12px; font-size: 0.8rem; }
input[type="checkbox"] { width: 45px; height: 25px; appearance: none; background: #333; border-radius: 20px; position: relative; cursor: pointer; outline: none; }
input[type="checkbox"]:checked { background: var(--success); }
input[type="checkbox"]::before { content: ''; position: absolute; width: 19px; height: 19px; background: #fff; border-radius: 50%; top: 3px; left: 3px; transition: 0.3s; }
input[type="checkbox"]:checked::before { left: 23px; }

.admin-channels-list { max-height: 200px; overflow-y: auto; margin-bottom: 10px; }
.admin-channel-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 15px; background: rgba(255,255,255,0.03); border-radius: 15px; margin-bottom: 8px; font-size: 0.8rem; border: 1px solid transparent; transition: 0.3s; }
.admin-channel-row:hover { border-color: var(--glass-border); background: rgba(255,255,255,0.05); }
.delete-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    color: #fff;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.delete-btn:hover { background: rgba(255,77,77,0.2); border-color: #ff4d4d; color: #ff4d4d; }
.reset-btns { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.main-btn.small { padding: 10px; font-size: 0.65rem; }
.danger { background: rgba(255, 0, 0, 0.2) !important; color: #ff5252 !important; border: 1px solid rgba(255,0,0,0.3) !important; }

/* Рулетка История */
.history-prize { display: block; font-size: 0.65rem; color: #fff; margin-bottom: 4px; font-weight: 900; }
.history-nick { display: block; font-size: 0.55rem; color: var(--accent); font-family: 'Uncage'; }
.history-time { 
    display: block; 
    font-size: 0.4rem; 
    color: var(--hint) !important; 
    font-weight: 400 !important; 
    margin-top: 3px; 
    font-family: 'Comfortaa'; 
    opacity: 0.6;
}

/* Модалки */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); backdrop-filter: blur(10px); display: none; justify-content: center; align-items: center; z-index: 12000; }
.prize-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.95); z-index: 15000; display: none; flex-direction: column; padding: 40px 20px; overflow-y: auto; }
.prize-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; width: 100%; margin-top: 20px; }
@media (min-width: 500px) { .prize-grid { grid-template-columns: repeat(3, 1fr); } }
.prize-card { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--glass-border); border-radius: 20px; padding: 15px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; }
.prize-card img { width: 60px; height: 60px; object-fit: contain; }
.prize-card span { font-size: 0.65rem; font-family: 'Gilroy'; font-weight: 900; color: #fff; }
.update-content { width: 85%; max-width: 380px; background: #16181d; border: 1px solid var(--glass-border); border-radius: 30px; padding: 30px; position: relative; animation: modalSlide 0.5s cubic-bezier(0.1, 0, 0.1, 1); }
@keyframes modalSlide { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.update-body { font-family: 'Comfortaa'; font-size: 0.85rem; color: #aaa; line-height: 1.6; max-height: 250px; overflow-y: auto; margin-bottom: 25px; white-space: pre-wrap; }

/* Скроллбары */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 10px; }

/* Прочее */
.copyright { text-align: center; color: var(--hint); font-size: 0.6rem; font-family: 'Comfortaa'; margin-top: 20px; opacity: 0.5; padding-bottom: 10px; }
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 20000; display: flex; flex-direction: column; gap: 10px; }
.toast { background: rgba(20, 22, 28, 0.95); backdrop-filter: blur(15px); border-left: 4px solid var(--accent); color: #fff; padding: 12px 20px; border-radius: 10px; font-family: 'Gilroy'; font-size: 0.8rem; box-shadow: 0 10px 30px rgba(0,0,0,0.5); transform: translateX(130%); transition: transform 0.4s; }
.toast.show { transform: translateX(0); }
