@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Poppins:wght@400;600;700;900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: #0a0a0a;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    color: white;
}

/* --- Animated Background --- */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(125deg, #0a0a0a 0%, #1a0033 25%, #000428 50%, #004e92 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    z-index: -2;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    animation: twinkle 3s infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

/* --- SPA View Management --- */
.view {
    display: none;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.view.active {
    display: flex;
}

/* --- Auth & Wallet Page Containers --- */
.auth-container, .wallet-page-container {
    width: 100%;
    max-width: 500px;
    padding: 20px;
    text-align: center;
    z-index: 10;
}

.wallet-page-container {
    max-width: 900px;
}

.auth-card {
    padding: 40px;
}

.auth-subtitle {
    color: #94a3b8;
    margin: 15px 0;
}

.auth-card .bet-input-group {
    margin-bottom: 20px;
}

.auth-card .game-btn {
    width: 100%;
}

#recaptcha-container {
    margin: 20px auto;
}

.error-message {
    color: #ff4466;
    margin-top: 15px;
    height: 20px;
    font-weight: 600;
}

.success-message {
    color: #00ff88;
    margin-top: 15px;
    height: 20px;
}


/* --- Game Wrapper & Layout --- */
.game-wrapper {
    width: 100%;
    max-width: 1400px;
    padding: 20px;
    display: flex;
    gap: 20px;
    height: 100vh;
    position: relative;
}

.left-panel {
    width: 280px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* --- Reusable Panel Card --- */
.panel-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.panel-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00ffff, transparent);
    animation: scan 3s linear infinite;
}

@keyframes scan {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* --- Header & Balance --- */
.header {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
    position: relative;
}

.logo {
    font-family: 'Bebas Neue', cursive;
    font-size: 4em;
    letter-spacing: 3px;
    background: linear-gradient(45deg, #00ffff, #ff00ff, #ffff00, #00ffff);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: rainbowText 3s ease infinite;
    margin-bottom: 10px;
}

@keyframes rainbowText {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.balance-container {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 25px;
    border-radius: 50px;
    border: 2px solid rgba(0, 255, 136, 0.3);
}

.balance-label {
    color: #94a3b8;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.balance-amount {
    font-size: 1.8em;
    font-weight: 700;
    color: #00ff88;
    text-shadow: 0 0 15px rgba(0, 255, 136, 0.6);
}

/* --- Stats & Live Feed --- */
.stats-grid { display: grid; gap: 15px; }
.stat-item {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}
.stat-item:hover {
    transform: translateX(5px);
    border-color: rgba(0, 255, 255, 0.3);
}
.stat-label { color: #64748b; font-size: 0.75em; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 5px; }
.stat-value { color: #fff; font-size: 1.5em; font-weight: 700; text-shadow: 0 0 20px rgba(0, 255, 255, 0.5); }
.stat-value.positive { color: #00ff88; }
.stat-value.negative { color: #ff4466; }

.live-feed { flex: 1; overflow-y: auto; max-height: 400px; }
.feed-header { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.live-indicator { width: 10px; height: 10px; background: #ff4466; border-radius: 50%; animation: livePulse 1.5s ease infinite; }
@keyframes livePulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(1.2); } }
.feed-title { color: #fff; font-weight: 600; font-size: 0.9em; text-transform: uppercase; letter-spacing: 1px; }
.feed-item { background: rgba(0, 0, 0, 0.3); border-radius: 10px; padding: 12px; margin-bottom: 10px; border: 1px solid rgba(255, 255, 255, 0.05); animation: slideIn 0.5s ease; transition: all 0.3s ease; }
.feed-item:hover { transform: translateX(5px); border-color: rgba(255, 255, 255, 0.1); }
@keyframes slideIn { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: translateX(0); } }
.feed-item.win { border-left: 3px solid #00ff88; }
.feed-item.loss { border-left: 3px solid #ff4466; }
.feed-item.mega-win { background: linear-gradient(135deg, rgba(0, 255, 136, 0.1), rgba(0, 212, 255, 0.1)); border: 1px solid rgba(0, 255, 136, 0.3); animation: megaWinGlow 2s ease infinite; }
@keyframes megaWinGlow { 0%, 100% { box-shadow: 0 0 10px rgba(0, 255, 136, 0.5); } 50% { box-shadow: 0 0 20px rgba(0, 255, 136, 0.8); } }
.feed-player { color: #00d4ff; font-weight: 600; }
.feed-amount { color: #00ff88; font-weight: 700; }
.feed-multiplier { color: #ff00ff; font-weight: 600; }

/* --- Game Arena & Scene --- */
.game-arena {
    flex: 1;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.sky-gradient {
    position: absolute; width: 100%; height: 100%;
    background: linear-gradient(180deg, rgba(15, 52, 96, 0.8) 0%, rgba(52, 31, 151, 0.6) 30%, rgba(233, 69, 96, 0.4) 60%, rgba(255, 184, 0, 0.3) 100%);
    opacity: 0.6;
}

.multiplier-display { position: absolute; top: 30px; left: 50%; transform: translateX(-50%); z-index: 100; }
.multiplier-box {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.7));
    border: 2px solid transparent;
    background-image: linear-gradient(135deg, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.7)), linear-gradient(135deg, #00ffff, #ff00ff);
    background-origin: border-box; background-clip: padding-box, border-box; padding: 20px 40px; border-radius: 20px;
    animation: float 3s ease-in-out infinite;
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.multiplier-label { color: #64748b; font-size: 0.8em; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 5px; }
.multiplier-value { font-family: 'Bebas Neue', cursive; font-size: 3.5em; font-weight: 900; background: linear-gradient(45deg, #00ff88, #00ffff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; text-shadow: 0 0 30px rgba(0, 255, 136, 0.8); letter-spacing: 2px; }
.multiplier-value.danger { background: linear-gradient(45deg, #ff4466, #ff00ff); -webkit-background-clip: text; animation: pulse 0.5s ease infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }

.risk-meter { position: absolute; top: 30px; right: 30px; background: rgba(0, 0, 0, 0.8); padding: 15px; border-radius: 15px; border: 1px solid rgba(255, 255, 255, 0.1); min-width: 150px; }
.risk-header { color: #94a3b8; font-size: 0.75em; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; }
.risk-bar-container { width: 100%; height: 8px; background: rgba(255, 255, 255, 0.1); border-radius: 10px; overflow: hidden; margin-bottom: 10px; }
.risk-bar { height: 100%; background: linear-gradient(90deg, #00ff88, #ffff00, #ff4466); width: 0%; transition: width 0.5s ease; box-shadow: 0 0 10px currentColor; }
.risk-percentage { font-size: 2em; font-weight: 700; text-align: center; transition: all 0.3s ease; }

.game-scene { position: absolute; bottom: 100px; width: 100%; height: 200px; }
.platform { position: absolute; width: 180px; height: 80px; bottom: 0; background: linear-gradient(135deg, #2d1b69, #462b9c); border-radius: 15px 15px 0 0; box-shadow: 0 -5px 20px rgba(70, 43, 156, 0.5), inset 0 2px 10px rgba(255, 255, 255, 0.1); border: 2px solid rgba(255, 255, 255, 0.1); }
.platform-left { left: 30px; }
.platform-right { right: 30px; }
.rope { position: absolute; bottom: 80px; left: 210px; right: 210px; height: 4px; background: linear-gradient(90deg, #8b7355 0%, #d4af37 25%, #ffd700 50%, #d4af37 75%, #8b7355 100%); transform-origin: center; transition: all 0.3s ease; box-shadow: 0 4px 15px rgba(212, 175, 55, 0.5); }
.rope.swaying { animation: enhancedSway 2s ease-in-out infinite; }
.rope.breaking { animation: snapBreak 0.8s ease-out forwards; }
@keyframes enhancedSway { 0%, 100% { transform: rotate(0deg) translateY(0); } 25% { transform: rotate(-2deg) translateY(-2px); } 75% { transform: rotate(2deg) translateY(-2px); } }
@keyframes snapBreak { 0% { transform: rotate(0deg); opacity: 1; } 20% { transform: rotate(-5deg) translateY(5px); } 40% { transform: rotate(-20deg) translateY(30px); opacity: 0.8; } 100% { transform: rotate(-45deg) translateY(300px); opacity: 0; } }

.character { position: absolute; bottom: 84px; left: 180px; width: 40px; height: 60px; transition: left 0.8s cubic-bezier(0.4, 0, 0.2, 1); z-index: 50; }
.character.walking { animation: walk 0.8s ease-in-out; }
.character.falling { animation: epicFall 1.5s ease-in forwards; }
@keyframes walk { 0%, 100% { transform: translateY(0) rotate(0deg); } 25% { transform: translateY(-8px) rotate(-5deg); } 50% { transform: translateY(-5px) rotate(0deg); } 75% { transform: translateY(-8px) rotate(5deg); } }
@keyframes epicFall { 0% { transform: rotate(0deg) translateY(0); } 30% { transform: rotate(-30deg) translateY(20px); } 100% { transform: rotate(-180deg) translateY(400px); opacity: 0; } }
.character-sprite { width: 100%; height: 100%; filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.8)); }
.character-body { stroke: #fff; stroke-width: 3; fill: none; stroke-linecap: round; filter: drop-shadow(0 0 5px rgba(0, 255, 255, 0.8)); }

/* --- Controls & Buttons --- */
.controls-panel { background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%); backdrop-filter: blur(10px); border-radius: 20px; padding: 25px; border: 1px solid rgba(255,255,255,0.1); display: flex; gap: 20px; align-items: center; }
.bet-section { flex: 1; }
.bet-label { color: #94a3b8; font-size: 0.85em; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; }
.bet-input-group { position: relative; display: flex; align-items: center; }
.bet-input { width: 100%; padding: 15px 20px; font-size: 1.3em; font-weight: 600; border: 2px solid rgba(255, 255, 255, 0.1); border-radius: 15px; background: rgba(0, 0, 0, 0.5); color: #fff; transition: all 0.3s ease; }
.bet-input:focus { outline: none; border-color: rgba(0, 255, 255, 0.5); box-shadow: 0 0 20px rgba(0, 255, 255, 0.3); }

.button-group { display: flex; gap: 15px; flex: 2; }
.game-btn { flex: 1; padding: 20px 30px; font-size: 1.1em; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; border: none; border-radius: 15px; cursor: pointer; position: relative; overflow: hidden; transition: all 0.3s ease; }
.game-btn::before { content: ''; position: absolute; top: 50%; left: 50%; width: 0; height: 0; border-radius: 50%; transform: translate(-50%, -50%); transition: width 0.6s, height 0.6s; }
.game-btn:hover::before { width: 400px; height: 400px; }
.btn-start { background: linear-gradient(135deg, #667eea, #764ba2); color: white; box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4); }
.btn-start::before { background: rgba(255, 255, 255, 0.1); }
.btn-start:hover { transform: translateY(-3px); box-shadow: 0 15px 40px rgba(102, 126, 234, 0.6); }
.btn-start:disabled, .btn-cashout:disabled { opacity: 0.3; cursor: not-allowed; transform: none; box-shadow: none; animation: none; }
.btn-cashout { background: linear-gradient(135deg, #00ff88, #00d4ff); color: #000; box-shadow: 0 10px 30px rgba(0, 255, 136, 0.4); animation: cashoutPulse 1.5s ease infinite; }
@keyframes cashoutPulse { 0%, 100% { box-shadow: 0 10px 30px rgba(0, 255, 136, 0.4); } 50% { box-shadow: 0 10px 40px rgba(0, 255, 136, 0.8); } }
.btn-cashout::before { background: rgba(255, 255, 255, 0.3); }
.btn-cashout:hover { transform: translateY(-3px) scale(1.05); animation: none; box-shadow: 0 15px 50px rgba(0, 255, 136, 0.6); }

/* --- Special Effects --- */
.celebration { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 5em; color: #00ff88; font-weight: 900; text-shadow: 0 0 50px rgba(0, 255, 136, 0.8); opacity: 0; pointer-events: none; z-index: 1000; }
.celebration.active { animation: celebrate 1.5s ease; }
@keyframes celebrate { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0); } 50% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1); } }

/* --- Wallet Page Specific Styles --- */
.wallet-content { display: grid; grid-template-columns: 1fr; gap: 20px; margin-top: 20px; }
@media (min-width: 768px) { .wallet-content { grid-template-columns: 1fr 1fr; } }
.wallet-subtitle { color: #94a3b8; font-size: 0.9em; margin-bottom: 20px; text-align: left;}
.deposit-info { display: flex; flex-direction: column; align-items: center; gap: 20px; }
#qr-code { background: white; padding: 15px; border-radius: 15px; }
.address-box { display: flex; width: 100%; }
.address-box input { width: 100%; background: rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.2); color: white; padding: 10px; border-radius: 10px 0 0 10px; font-family: monospace; }
.address-box button { padding: 10px 15px; border: none; background: #667eea; color: white; cursor: pointer; border-radius: 0 10px 10px 0; }
.wallet-content .bet-input-group { margin-bottom: 15px; }
.wallet-content .game-btn { width: 100%; }
.wallet-link { color: #00d4ff; text-decoration: none; font-weight: 600; }

/* --- Responsive Design --- */
@media (max-width: 1200px) {
    .game-wrapper { flex-direction: column; height: auto; }
    .left-panel { width: 100%; flex-direction: row; }
    .live-feed { max-height: 200px; }
    .logo { font-size: 3em; }
}

@media (max-width: 768px) {
    body { overflow-y: auto; }
    .game-wrapper { padding: 10px; }
    .left-panel { flex-direction: column; }
    .logo { font-size: 2.5em; }
    .controls-panel { flex-direction: column; }
    .button-group { width: 100%; }
    .rope { left: 100px; right: 100px; }
    .platform { width: 100px; }
    .platform-left { left: 0px; }
    .platform-right { right: 0px; }
}