/* BetGoat - Mobile Casino - Optimized for Mobile */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0f0f1e;
    --bg-secondary: #1a1a2e;
    --bg-card: #16213e;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-green: #00ff88;
    --accent-blue: #00d4ff;
    --border-color: #2a2a4a;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
    max-width: 100vw;
}

/* Navbar - Mobile Optimized */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
}

.logo img {
    height: 28px;
    width: auto;
}

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

/* 用户信息显示 */
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid var(--accent-green);
    border-radius: 8px;
}

.user-id {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}

.user-balance {
    font-size: 14px;
    font-weight: 700;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    animation: balancePulse 2s ease-in-out infinite;
}

@keyframes balancePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.auth-buttons {
    display: flex;
    gap: 6px;
}

.btn-signin {
    background: transparent;
    border: 1px solid var(--accent-green);
    color: var(--accent-green);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.btn-signup {
    background: var(--accent-green);
    border: none;
    color: var(--bg-primary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
}

/* Main Container */
.main-container {
    padding: 12px;
    padding-bottom: 60px;
    max-width: 100%;
}

/* Hero Banner - Mobile Optimized */
.hero-banner {
    position: relative;
    background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1e 100%);
    border-radius: 12px;
    padding: 20px 16px;
    margin-bottom: 16px;
    text-align: center;
    border: 1px solid var(--border-color);
    overflow: hidden;
    background-image: url('../assets/banner-bg.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.85) 0%, rgba(15, 15, 30, 0.85) 100%);
    z-index: 0;
}

.hero-banner > * {
    position: relative;
    z-index: 1;
}

.banner-content h1 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--accent-green);
    line-height: 1.3;
}

.banner-content p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.btn-activate {
    background: var(--accent-green);
    border: none;
    color: var(--bg-primary);
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

/* Countdown Timer */
.countdown-timer {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.1) 0%, rgba(0, 204, 106, 0.05) 100%);
    border: 2px solid var(--accent-green);
    border-radius: 16px;
    padding: 20px 16px;
    text-align: center;
    animation: countdownPulse 2s ease-in-out infinite;
}

@keyframes countdownPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(0, 255, 136, 0.3); }
    50% { box-shadow: 0 0 30px rgba(0, 255, 136, 0.5); }
}

.countdown-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    background: var(--accent-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    animation: timerRotate 3s linear infinite;
}

.countdown-icon::before {
    content: '⏱';
}

@keyframes timerRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.countdown-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.countdown-time {
    font-size: 48px;
    font-weight: 700;
    color: var(--accent-green);
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
    margin-bottom: 8px;
    line-height: 1;
}

.countdown-sublabel {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.btn-claim-reward {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
    color: #0f0f1e;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: rewardPulse 1.5s ease-in-out infinite;
}

@keyframes rewardPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 20px rgba(255, 215, 0, 0.5); }
    50% { transform: scale(1.02); box-shadow: 0 0 30px rgba(255, 215, 0, 0.8); }
}

.btn-claim-reward:hover {
    background: linear-gradient(135deg, #ffaa00 0%, #ff8800 100%);
}

/* Promo Section - Mobile Optimized */
.promo-section {
    margin-bottom: 16px;
}

.promo-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 2px;
}

.promo-scroll::-webkit-scrollbar {
    display: none;
}

.promo-card {
    flex: 0 0 calc(100vw - 40px);
    max-width: 300px;
    scroll-snap-align: start;
    border-radius: 12px;
    overflow: hidden;
}

.promo-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 260 / 140;
    object-fit: cover;
    display: block;
}

/* Game Section - Mobile Optimized */
.game-section {
    margin-bottom: 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 0 2px;
}

.section-header h2 {
    font-size: 16px;
    font-weight: 600;
}

.game-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 2px;
}

.game-scroll::-webkit-scrollbar {
    display: none;
}

.game-card {
    flex: 0 0 100px;
    scroll-snap-align: start;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
}

.game-card img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    display: block;
}

.auto-earn-badge {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: var(--accent-green);
    color: var(--bg-primary);
    font-size: 9px;
    font-weight: 600;
    padding: 3px 6px;
    border-radius: 4px;
    cursor: pointer;
}

/* Yield Engine - Mobile Optimized */
.yield-engine {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.yield-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.tab-btn {
    flex: 1;
    padding: 10px 8px;
    border: none;
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.tab-btn.active {
    background: var(--accent-green);
    color: var(--bg-primary);
}

.yield-content {
    min-height: 180px;
}

.tab-content {
    display: none;
}

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

.yield-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 10px 6px;
    text-align: center;
}

.stat-label {
    font-size: 10px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    line-height: 1.2;
}

.stat-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-green);
}

.yield-rate {
    color: var(--accent-blue);
}

.dividends {
    color: #ffd700;
}

.yield-update-note {
    font-size: 10px;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 8px;
    opacity: 0.7;
}

/* Bets Table - Mobile Optimized */
.bets-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.bets-table th {
    background: var(--bg-card);
    padding: 8px 6px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 11px;
}

.bets-table td {
    padding: 8px 6px;
    border-bottom: 1px solid var(--border-color);
    font-size: 11px;
}

.bets-table .win,
.bets-table .earned {
    color: var(--accent-green);
    font-weight: 600;
}

.status-active {
    background: var(--accent-green);
    color: var(--bg-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

/* Conversion Overlay - Mobile Optimized */
.conversion-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.conversion-overlay.active {
    display: flex;
}

.conversion-content {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 24px 20px;
    text-align: center;
    max-width: 320px;
    width: 100%;
    border: 2px solid var(--accent-green);
}

.conversion-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.conversion-content h2 {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--accent-green);
}

.conversion-content p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.conversion-content .highlight {
    color: var(--accent-green);
    font-weight: 600;
}

.btn-lockin {
    background: var(--accent-green);
    border: none;
    color: var(--bg-primary);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin-bottom: 10px;
}

.btn-close {
    background: transparent;
    border: 1px solid var(--text-secondary);
    color: var(--text-secondary);
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    width: 100%;
}

/* 邮箱输入框 */
.input-email {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--text-secondary);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 8px;
    outline: none;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.input-email:focus {
    border-color: var(--accent-green);
}

.input-email::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.input-email.error {
    border-color: #ff4444;
}

/* 输入框错误提示 */
.input-error {
    display: none;
    color: #ff4444;
    font-size: 12px;
    margin-bottom: 16px;
    text-align: left;
}

.input-error.active {
    display: block;
}

/* 用户信息显示 */
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid var(--accent-green);
    border-radius: 8px;
}

.user-id {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}

.user-balance {
    font-size: 14px;
    font-weight: 700;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    animation: balancePulse 2s ease-in-out infinite;
}

@keyframes balancePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.auth-buttons {
    display: flex;
    gap: 6px;
}

/* Toast 通知 */
.toast-notification {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--bg-secondary);
    border: 1px solid var(--accent-green);
    border-radius: 10px;
    padding: 12px 20px;
    font-size: 13px;
    color: var(--accent-green);
    z-index: 1001;
    opacity: 0;
    transition: all 0.4s ease;
    box-shadow: 0 4px 20px rgba(0, 255, 136, 0.3);
    max-width: 90%;
    text-align: center;
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 加载条 */
.loading-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-primary);
    border-radius: 4px;
    overflow: hidden;
    margin: 20px 0;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-green), #00cc6a);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
    box-shadow: 0 0 10px var(--accent-green);
}

/* 收益引擎呼吸光效 */
.yield-engine {
    transition: all 0.5s ease;
}

.yield-engine.engine-active {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.05) 0%, rgba(15, 15, 30, 0.95) 100%);
    border-color: var(--accent-green);
    animation: breathingGlow 3s ease-in-out infinite;
}

@keyframes breathingGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 255, 136, 0.2);
    }
    50% {
        box-shadow: 0 0 40px rgba(0, 255, 136, 0.4);
    }
}

/* 收益更新动画 */
.earned.updating {
    animation: gainFlash 0.5s ease;
}

@keyframes gainFlash {
    0%, 100% { color: var(--accent-green); }
    50% { color: #ffd700; text-shadow: 0 0 10px rgba(255, 215, 0, 0.5); }
}

/* Small Mobile Devices (max-width: 360px) */
@media (max-width: 360px) {
    .nav-container {
        padding: 8px 10px;
    }
    
    .logo img {
        height: 24px;
    }
    
    .btn-signin,
    .btn-signup {
        padding: 5px 10px;
        font-size: 11px;
    }
    
    .main-container {
        padding: 10px;
    }
    
    .hero-banner {
        padding: 16px 12px;
    }
    
    .banner-content h1 {
        font-size: 16px;
    }
    
    .banner-content p {
        font-size: 12px;
    }
    
    .game-card {
        flex: 0 0 90px;
    }
    
    .game-card img {
        height: 120px;
    }
    
    .auto-earn-badge {
        font-size: 8px;
        padding: 2px 5px;
    }
    
    .yield-stats {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .stat-card {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 12px;
    }
    
    .stat-label {
        margin-bottom: 0;
    }
    
    .bets-table {
        font-size: 11px;
    }
    
    .bets-table th,
    .bets-table td {
        padding: 6px 4px;
    }
}

/* Extra Small Mobile Devices (max-width: 320px) */
@media (max-width: 320px) {
    .game-card {
        flex: 0 0 80px;
    }
    
    .game-card img {
        height: 110px;
    }
    
    .promo-card {
        flex: 0 0 calc(100vw - 30px);
    }
    
    .tab-btn {
        font-size: 11px;
        padding: 8px 6px;
    }
}

/* Larger Mobile Devices (min-width: 400px) */
@media (min-width: 400px) {
    .game-card {
        flex: 0 0 110px;
    }
    
    .game-card img {
        height: 145px;
    }
    
    .promo-card {
        flex: 0 0 320px;
    }
}

/* Tablet and above (min-width: 768px) */
@media (min-width: 768px) {
    .main-container {
        max-width: 720px;
        margin: 0 auto;
    }
    
    .game-card {
        flex: 0 0 130px;
    }
    
    .game-card img {
        height: 170px;
    }
    
    .promo-card {
        flex: 0 0 350px;
    }
    
    .banner-content h1 {
        font-size: 24px;
    }
}
