:root {
    --bg-main: #0f1115;
    --bg-card: #161920;
    --accent: #2ec4b6;
    --text-white: #fafafa;
    --text-muted: #526077;
}

body {
    margin: 0;
    padding: 0;
    background: radial-gradient(circle at 50% 0%, #1a1f2c 0%, var(--bg-main) 100%);
    color: var(--text-white);
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    user-select: none;
    overflow-x: hidden;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--bg-card);
    border-bottom: 1px solid #1f2430;
}

.brand {
    display: flex;
    flex-direction: column;
}

.logo {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--accent);
}

.balance-pill {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.balance-val {
    color: var(--text-white);
    font-weight: bold;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.deposit-plus-btn {
    background: #1f2430;
    border: 1px solid #2b3346;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 22px;
    font-weight: bold;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.deposit-plus-btn:hover {
    background: #2b3346;
    box-shadow: 0 0 10px rgba(46, 196, 182, 0.3);
}

.wallet-btn {
    background: #1f2430;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
    box-sizing: border-box;
}

.wallet-btn.connected {
    background: var(--accent);
    color: #000;
}

main {
    padding: 20px;
    padding-bottom: 95px; 
}

.app-screen {
    display: none;
}

.app-screen.active {
    display: block;
}

.game-card {
    background: var(--bg-card);
    border: 1px solid #1f2430;
    padding: 20px;
    border-radius: 16px;
    cursor: pointer;
}

.game-title {
    font-size: 18px;
    font-weight: bold;
}

.game-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 5px;
}

.display-area {
    background: #12141a;
    border-radius: 20px;
    padding: 35px 20px;
    text-align: center;
    margin-bottom: 25px;
    border: 1px dashed #2b3346;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    min-height: 180px;
    box-sizing: border-box;
}

.dice-visual {
    font-size: 72px;
    line-height: 1;
    display: inline-block;
    color: var(--text-white);
    will-change: transform;
}

.dice-idle {
    animation: floatAndPulse 2.5s ease-in-out infinite;
}

.dice-rolling {
    animation: 3dCrazyRoll 0.4s linear infinite;
}

@keyframes floatAndPulse {
    0% { transform: translateY(0px) rotate(0deg) scale(1); filter: drop-shadow(0 0 0px rgba(46,196,182,0)); }
    50% { transform: translateY(-8px) rotate(6deg) scale(1.06); filter: drop-shadow(0 0 20px rgba(46, 196, 182, 0.5)); }
    100% { transform: translateY(0px) rotate(0deg) scale(1); filter: drop-shadow(0 0 0px rgba(46,196,182,0)); }
}

@keyframes 3dCrazyRoll {
    0% { transform: rotateX(0deg) rotateY(0deg) scale(0.9); }
    50% { transform: rotateX(180deg) rotateY(180deg) scale(1.15); filter: drop-shadow(0 0 25px rgba(255,255,255,0.4)); }
    100% { transform: rotateX(360deg) rotateY(360deg) scale(0.9); }
}

.dice-status {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.dice-status.win {
    color: var(--accent);
    font-weight: bold;
    font-size: 16px;
    text-shadow: 0 0 10px rgba(46, 196, 182, 0.3);
}

.dice-status.lose {
    color: #ff3366;
    font-weight: bold;
    font-size: 16px;
    text-shadow: 0 0 10px rgba(255, 51, 102, 0.3);
}

.input-group {
    margin-bottom: 20px;
}

.input-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.input-field {
    width: 100%;
    background: #12141a;
    border: 1px solid #2b3346;
    padding: 14px;
    border-radius: 12px;
    color: #fff;
    font-size: 16px;
    box-sizing: border-box;
}

.bet-modifiers {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    width: 100%;
}

.btn-mod {
    flex: 1;
    background: #1f2430;
    border: 1px solid #2b3346;
    color: var(--text-white);
    padding: 11px 0;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: all 0.15s ease;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

.btn-mod:active {
    background: #2b3346;
    border-color: var(--accent);
    color: var(--accent);
    transform: scale(0.96);
}

.btn-primary {
    width: 100%;
    background: var(--accent);
    color: #0f1115;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

.btn-back {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    margin-bottom: 15px;
}

.history-section {
    margin-top: 30px;
}

.history-title {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(5px);
    z-index: 10005; 
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid #2b3346;
    padding: 24px;
    border-radius: 20px;
    width: 85%;
    max-width: 340px;
    text-align: center;
}

.modal-title {
    font-size: 18px;
    font-weight: bold;
    color: var(--accent);
    margin-bottom: 10px;
}

.modal-text {
    font-size: 14px;
    color: #94a3b8;
    margin-bottom: 20px;
}

.btn-modal-close {
    background: #1f2430;
    border: 1px solid #2b3346;
    color: #fff;
    padding: 10px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    margin-top: 10px;
}

/* АНИМАЦИЯ COIN FLIP */
.coin-flipping {
    animation: flipCrazy 0.6s linear infinite;
}

@keyframes flipCrazy {
    0% { transform: rotateY(0deg) scale(1); }
    50% { transform: rotateY(180deg) scale(1.2); filter: drop-shadow(0 0 20px rgba(224, 169, 109, 0.6)); }
    100% { transform: rotateY(360deg) scale(1); }
}

.cf-room-card {
    display: flex; justify-content: space-between; align-items: center;
    background: #0f1115; padding: 10px 15px; border-radius: 10px; border: 1px solid #1f2430;
}
.cf-room-info { display: flex; flex-direction: column; gap: 4px; text-align: left; }
.cf-room-player { font-size: 11px; color: #526077; }
.cf-room-bet { font-size: 14px; font-weight: bold; color: #fafafa; }

/* ================= СТИЛИ ДЛЯ BOTTOM NAVIGATION ================= */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: 68px;
    background: rgba(22, 25, 32, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid #1f2430;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 90;
    box-sizing: border-box;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.nav-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.nav-tab.active {
    color: var(--accent);
}

.nav-icon {
    font-size: 22px;
    margin-bottom: 2px;
}

.nav-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* ================= СТИЛИ ДЛЯ ПРЕМИУМ ПРОФИЛЯ ================= */
.profile-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 360px;
    margin: 0 auto;
}

.profile-card {
    background: var(--bg-card);
    border: 1px solid #1f2430;
    border-radius: 24px;
    padding: 35px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.profile-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 30%, rgba(46, 196, 182, 0.08) 0%, transparent 65%);
    pointer-events: none;
}

.avatar-container {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    margin: 0 auto 16px;
    border: 3px solid var(--accent);
    box-shadow: 0 0 20px rgba(46, 196, 182, 0.25);
    overflow: hidden;
    background: #12141a;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.profile-name {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-white);
    margin-bottom: 3px;
}

.profile-username {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 18px;
}

.profile-id-box {
    display: inline-flex;
    align-items: center;
    background: #12141a;
    border: 1px solid #2b3346;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 13px;
    color: var(--text-white);
    cursor: pointer;
    transition: all 0.15s ease;
}

.profile-id-box:active {
    transform: scale(0.96);
    border-color: var(--accent);
    background: #171b24;
}

.profile-stats {
    display: flex;
    width: 100%;
}

.stat-item {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid #1f2430;
    border-radius: 18px;
    padding: 18px;
    text-align: center;
}

.stat-val {
    font-size: 20px;
    font-weight: bold;
    color: var(--accent);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 500;
}

/* [ДОБАВЛЕНО] Стили для лайв ленты */
.live-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #ff3366;
    border-radius: 50%;
    box-shadow: 0 0 8px #ff3366;
    animation: pulseRed 1.5s infinite;
}

@keyframes pulseRed {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.5; }
    100% { transform: scale(1); opacity: 1; }
}

.live-feed-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #1f2430;
    font-size: 13px;
    animation: slideInFade 0.3s ease-out;
}
.live-feed-row:last-child {
    border-bottom: none;
}
.live-feed-user { color: #fafafa; font-weight: 500; }
.live-feed-game { font-size: 11px; color: #526077; background: #12141a; padding: 2px 6px; border-radius: 6px; }
.live-feed-win { color: #2ec4b6; font-weight: bold; }
.live-feed-lose { color: #ff3366; font-weight: bold; }

@keyframes slideInFade {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
/* [/ДОБАВЛЕНО] */
/* --- НОВОЕ: ТОСТЫ (УВЕДОМЛЕНИЯ) --- */
#toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    width: 90%;
    max-width: 350px;
}
.toast {
    background: var(--bg-card);
    color: var(--text-white);
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    border-left: 4px solid var(--accent);
    opacity: 0;
    transform: translateY(-20px);
    animation: toastIn 0.3s forwards, toastOut 0.3s forwards 2.7s;
}
.toast.error { border-left-color: #ff3366; }
.toast.success { border-left-color: #00cc66; }
@keyframes toastIn { to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-20px); } }

/* --- НОВОЕ: АНИМАЦИЯ ВИНСТРИКА --- */
.winstreak-particle {
    position: fixed;
    pointer-events: none;
    width: 8px;
    height: 8px;
    background-color: #ffd700;
    border-radius: 50%;
    z-index: 9998;
    animation: streakFly 1s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}
@keyframes streakFly {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; }
}
