:root {
    --bg-main: #07090e;
    --bg-card: #111620;
    --bg-input: #18202d;
    --accent-yellow: #ffd000;
    --1win-blue: #0076ff;
    --text-main: #ffffff;
    --text-muted: #7b8b9a;
    --green: #00e701;
    --green-glow: rgba(0, 231, 1, 0.4);
    --red: #ff334b;
    --red-glow: rgba(255, 51, 75, 0.4);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 75px;
    overflow-x: hidden;
}

/* Верхнее меню */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background-color: var(--bg-card);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 20px;
    font-weight: 900;
    cursor: pointer;
    letter-spacing: 0.5px;
}
.logo-1 { color: var(--text-main); }
.logo-win { 
    background: linear-gradient(135deg, #0081ff, #00d2ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.balance-container {
    display: flex;
    align-items: center;
    background-color: #0b0f16;
    border-radius: 12px;
    padding: 2px;
    border: 1px solid rgba(255,255,255,0.08);
    cursor: pointer;
}

.balance-box {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    font-weight: 700;
    font-size: 13px;
}

.currency-icon {
    background: var(--1win-blue);
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
}

.dropdown-arr { font-size: 9px; color: var(--accent-yellow); margin-left: 2px; }

.wallet-btn {
    background: linear-gradient(135deg, #ffd000, #ff9500);
    color: #000;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

.profile-avatar img {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
}

/* Основной контейнер */
.main-container {
    max-width: 440px;
    width: 100%;
    margin: 12px auto;
    padding: 0 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.view-section { display: none; width: 100%; }
.view-section.active { display: block; animation: fadeIn 0.25s ease; }

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

/* Лобби с картинками игр */
.lobby-header-text {
    margin-bottom: 14px;
    text-align: center;
}
.lobby-header-text h2 {
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 0.5px;
}
.lobby-header-text p {
    font-size: 12px;
    color: var(--text-muted);
}

.games-grid-visual {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.visual-game-card {
    position: relative;
    height: 190px;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.visual-game-card:active {
    transform: scale(0.95);
    border-color: var(--1win-blue);
}

.card-bg-image {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.4s ease;
}

.visual-game-card:hover .card-bg-image {
    transform: scale(1.06);
}

.card-gradient-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(180deg, rgba(7,9,14,0) 30%, rgba(7,9,14,0.92) 90%);
}

.card-content-badge {
    position: absolute;
    top: 10px; right: 10px;
    background: rgba(0, 118, 255, 0.85);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: 10px;
    font-weight: 900;
    padding: 3px 7px;
    border-radius: 6px;
}
.card-content-badge.hot {
    background: rgba(255, 51, 75, 0.85);
}

.card-footer-info {
    position: absolute;
    bottom: 12px; left: 12px; right: 12px;
}
.card-footer-info h3 {
    font-size: 15px;
    font-weight: 900;
    color: #fff;
    margin-bottom: 2px;
}
.card-footer-info span {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
}

/* Игровые карточки */
.game-card {
    background-color: var(--bg-card);
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.04);
}

.game-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.back-lobby-btn {
    background: var(--bg-input);
    border: none;
    color: var(--text-muted);
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}
.game-card h2 { font-size: 15px; font-weight: 800; }
.live-badge {
    background: rgba(0, 118, 255, 0.15);
    color: var(--1win-blue);
    font-size: 9px;
    padding: 2px 5px;
    border-radius: 5px;
    font-weight: 800;
}

.input-group { margin-bottom: 12px; }
.input-group label { display: block; font-size: 11px; color: var(--text-muted); margin-bottom: 4px; font-weight: 600; }

input, select {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid rgba(255,255,255,0.08);
    padding: 12px;
    border-radius: 12px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    outline: none;
}
.input-with-btns { display: flex; gap: 6px; }
.quick-btn {
    background: var(--bg-input);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-muted);
    padding: 0 10px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    font-size: 11px;
}

/* Нвути интерфейс */
.nvuti-display {
    text-align: center;
    background: var(--bg-input);
    padding: 16px;
    border-radius: 14px;
    margin-bottom: 14px;
}
.chance-indicator { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.roll-result { font-size: 36px; font-weight: 900; letter-spacing: 1px; }
.win-payout-preview { font-size: 11px; color: var(--accent-yellow); margin-top: 4px; font-weight: 700; }
.nvuti-buttons { display: flex; gap: 8px; }

.action-btn {
    flex: 1;
    padding: 13px;
    border: none;
    border-radius: 12px;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    color: white;
    transition: 0.2s;
}
.btn-less { background: linear-gradient(135deg, #ff9500, #e65c00); }
.btn-more { background: linear-gradient(135deg, #00e701, #00ab01); }
.btn-play-glow { background: linear-gradient(135deg, #00e701, #00ab01); width: 100%; box-shadow: 0 4px 15px var(--green-glow); }
.btn-cashout { background: linear-gradient(135deg, #ffd000, #ff9500); color: #000; width: 100%; margin-top: 10px; }
.action-btn:active { transform: scale(0.96); }

/* Мины сетка */
.hidden { display: none !important; }
.mines-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    margin-bottom: 12px;
}
.mine-cell {
    aspect-ratio: 1;
    background: linear-gradient(135deg, #1b2432, #151c27);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mines-info-panel {
    display: flex;
    justify-content: space-between;
    background: var(--bg-input);
    padding: 8px 12px;
    border-radius: 10px;
    margin-bottom: 10px;
    font-size: 12px;
}
.glow-text { color: var(--accent-yellow); text-shadow: 0 0 8px rgba(255, 208, 0, 0.4); }

/* Нижний Док-бар (системные вкладки) */
.bottom-dock {
    position: fixed;
    bottom: 0; left: 0; width: 100%;
    background-color: var(--bg-card);
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    z-index: 100;
}
.dock-item {
    background: transparent;
    border: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    flex: 1;
    transition: 0.2s;
}
.dock-item i { font-size: 17px; }
.dock-item.active { color: var(--1win-blue); }

/* Модалка */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}
.modal-content {
    background: var(--bg-card);
    padding: 22px;
    border-radius: 18px;
    width: 86%;
    max-width: 300px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.08);
}
.modal-icon-top { font-size: 28px; color: var(--accent-yellow); margin-bottom: 8px; }
.modal-content h3 { font-size: 16px; font-weight: 800; margin-bottom: 2px; }
.modal-content p { color: var(--text-muted); font-size: 12px; margin-bottom: 12px; line-height: 1.4; }
.wallet-balance-box {
    background: var(--bg-input);
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 14px;
    font-size: 14px;
}
.close-modal { background: transparent; border: none; color: var(--text-muted); font-size: 12px; cursor: pointer; width: 100%; padding: 6px; }

/* АДАПТИВНЫЙ СТЕК УВЕДОМЛЕНИЙ (Тосты) */
#toast-container {
    position: fixed;
    top: 65px;
    right: 12px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 280px;
    max-width: calc(100vw - 24px);
    pointer-events: none;
}
.toast {
    background: rgba(17, 22, 32, 0.96);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 10px 14px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastSlideIn 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    pointer-events: auto;
    opacity: 0;
    transform: translateX(30px);
}
.toast.success { border-color: rgba(0,231,1,0.4); box-shadow: 0 4px 20px rgba(0,231,1,0.15); }
.toast.error { border-color: rgba(255,51,75,0.4); box-shadow: 0 4px 20px rgba(255,51,75,0.15); }
.toast-icon { font-size: 16px; flex-shrink: 0; }
.toast.success .toast-icon { color: var(--green); }
.toast.error .toast-icon { color: var(--red); }
.toast-text { font-size: 12px; font-weight: 700; color: #fff; line-height: 1.3; }

@keyframes toastSlideIn {
    to { opacity: 1; transform: translateX(0); }
}
@keyframes toastSlideOut {
    to { opacity: 0; transform: translateX(40px); max-height: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 0; }
}

/* Стили для графического логотипа Fun & Sun */
/* Адаптивные стили для графического логотипа Fun & Sun (854x436) */
.logo-img-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    height: 46px; /* Фиксированная высота шапки */
    max-width: 140px; /* Ограничиваем максимальную ширину, чтобы не ломать вертку */
}

.header-logo {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Сохраняет пропорции без искажений */
    display: block;
}