:root {
    --primary: #f03e3e; /* Ludo Red */
    --primary-glow: rgba(240, 62, 62, 0.5);
    --secondary: #1c7ed6; /* Ludo Blue */
    --success: #37b24d; /* Ludo Green */
    --warning: #f59f00; /* Ludo Yellow */
    --bg-dark: #0f172a;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
}

/* Typography & Utils */
.highlight { color: var(--primary); font-weight: 700; }
.text-success { color: var(--success); }
.text-danger { color: var(--primary); }
.text-muted { color: var(--text-muted); }
.w-100 { width: 100%; }

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}
.btn-primary {
    background: linear-gradient(45deg, var(--primary), #d6336c);
    color: white;
    box-shadow: 0 4px 15px var(--primary-glow);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
}
.btn-secondary {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: white;
}
.btn-play {
    background: linear-gradient(45deg, var(--success), #2b8a3e);
    color: white;
    padding: 10px 20px;
    box-shadow: 0 4px 15px rgba(55, 178, 77, 0.4);
}
.btn-play-huge {
    font-size: 2rem;
    padding: 20px 40px;
    border-radius: 50px;
    background: linear-gradient(45deg, var(--primary), var(--warning));
    color: white;
    box-shadow: 0 0 30px var(--primary-glow);
}

/* Glassmorphism */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
}
.glass-nav {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--glass-border);
}

/* Landing Page */
.landing-body {
    background: radial-gradient(circle at top left, #1e1e2f, var(--bg-dark));
}
.header {
    display: flex;
    justify-content: space-between;
    padding: 20px 5%;
    align-items: center;
}
.logo {
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 2px;
}
.hero {
    display: flex;
    justify-content: space-around;
    align-items: center;
    min-height: 80vh;
    padding: 0 5%;
    flex-wrap: wrap;
}
.hero-content h1 {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 20px;
}
.hero-content p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 30px;
    max-width: 400px;
}

/* Features Section */
.features-section {
    padding: 60px 5%;
    text-align: center;
}
.section-title {
    font-size: 2.5rem;
    margin-bottom: 40px;
}
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 30px;
}
.feature-card {
    padding: 30px 20px;
    border-radius: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
}
.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border-color: var(--primary-glow);
}
.feature-icon {
    font-size: 40px;
    margin-bottom: 20px;
}
.feature-card h3 {
    margin-bottom: 15px;
    font-size: 1.5rem;
}
.feature-card p {
    color: var(--text-muted);
    line-height: 1.6;
}

/* Ambient Glow */
.ambient-glow {
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.5;
}
.glow-1 {
    top: -100px;
    left: -100px;
    background: var(--primary);
}
.glow-2 {
    top: 20%;
    right: -100px;
    background: var(--secondary);
}

/* Stats Section */
.stats-section {
    display: flex;
    justify-content: space-around;
    padding: 40px 5%;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: -50px;
    position: relative;
    z-index: 10;
}
.stat-box {
    flex: 1;
    min-width: 200px;
    padding: 30px 20px;
    text-align: center;
    border-radius: 20px;
    transition: transform 0.3s ease;
    background: linear-gradient(145deg, rgba(255,255,255,0.05), rgba(0,0,0,0.2));
    border: 1px solid var(--glass-border);
}
.stat-box:hover {
    transform: translateY(-5px);
    border-color: var(--primary-glow);
}
.stat-number {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--text-main);
    margin-bottom: 10px;
    background: linear-gradient(45deg, var(--primary), var(--warning));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* How It Works Section */
.how-it-works-section {
    padding: 60px 5%;
    text-align: center;
}
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-top: 40px;
}
.step-card {
    position: relative;
    padding: 40px 20px;
    background: rgba(255,255,255,0.02);
    border-radius: 20px;
    border: 1px dashed var(--glass-border);
    transition: all 0.3s ease;
}
.step-card:hover {
    background: rgba(255,255,255,0.05);
    border-style: solid;
    border-color: var(--secondary);
}
.step-number {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background: linear-gradient(45deg, var(--secondary), var(--primary));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}
.step-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    border-radius: 50%;
    color: white;
}

/* Footer Section */
.footer-section {
    background: rgba(0,0,0,0.3);
    border-top: 1px solid var(--glass-border);
    padding: 60px 5% 20px;
    margin-top: 60px;
}
.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}
.footer-brand p {
    color: var(--text-muted);
    margin: 15px 0;
    max-width: 300px;
}
.social-links {
    display: flex;
    gap: 15px;
}
.social-links a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: 0.3s;
}
.social-links a:hover {
    background: var(--primary);
    transform: translateY(-3px);
}
.footer-links h3 {
    margin-bottom: 20px;
    color: white;
}
.footer-links ul {
    list-style: none;
}
.footer-links li {
    margin-bottom: 10px;
}
.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: 0.3s;
}
.footer-links a:hover {
    color: var(--primary);
    padding-left: 5px;
}
.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
    color: var(--text-muted);
}

/* Scroll Reveal Animations */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease-out;
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Floating Action Button */
.fab-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    text-decoration: none;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    z-index: 1000;
    transition: 0.3s;
}
.fab-btn:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 5px 30px var(--primary-glow);
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
    }
}

/* Ludo Animation */
.ludo-animation {
    width: 300px;
    height: 300px;
    background: conic-gradient(
        var(--primary) 0deg 90deg, 
        var(--secondary) 90deg 180deg, 
        var(--success) 180deg 270deg, 
        var(--warning) 270deg 360deg
    );
    border-radius: 20px;
    position: relative;
    animation: rotate 10s linear infinite;
    box-shadow: 0 0 50px rgba(255,255,255,0.1);
}
@keyframes rotate { 100% { transform: rotate(360deg); } }

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
}
.modal-content {
    margin: 10% auto;
    padding: 30px;
    width: 90%;
    max-width: 400px;
    position: relative;
    animation: slideUp 0.3s ease;
}

.info-modal-content {
    margin: 5% auto;
    padding: 40px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
}
.info-modal-content h2 {
    color: var(--primary);
    margin-bottom: 20px;
    font-size: 2rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 10px;
}
.info-modal-content h3 {
    color: var(--secondary);
    margin-top: 20px;
    margin-bottom: 10px;
}
.info-modal-content p, .info-modal-content li {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 15px;
}
.info-modal-content ul {
    margin-left: 20px;
    margin-bottom: 15px;
}
/* Custom Scrollbar for Info Modals */
.info-modal-content::-webkit-scrollbar {
    width: 8px;
}
.info-modal-content::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
}
.info-modal-content::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}
@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-muted);
}

/* Forms */
.input-group { margin-bottom: 20px; }
.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-muted);
}
.input-group input {
    width: 100%;
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: rgba(255,255,255,0.05);
    color: white;
    font-size: 16px;
    outline: none;
}
.input-group input:focus {
    border-color: var(--primary);
}
.form-footer {
    margin-top: 15px;
    text-align: center;
    font-size: 14px;
}
.form-footer a {
    color: var(--secondary);
    text-decoration: none;
}

/* App Dashboard */
.app-body { padding-bottom: 80px; }
.app-header {
    display: flex;
    justify-content: space-between;
    padding: 15px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.user-info { display: flex; align-items: center; gap: 10px; }
.avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--warning));
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
}
.details { display: flex; flex-direction: column; }
.details span { font-weight: bold; }
.details small { color: var(--text-muted); }

.wallet-info {
    display: flex; align-items: center; gap: 10px;
    background: rgba(55, 178, 77, 0.2);
    padding: 8px 15px;
    border-radius: 20px;
    border: 1px solid rgba(55, 178, 77, 0.5);
    font-weight: bold;
}
.btn-add {
    background: var(--success); border: none; color: white;
    width: 24px; height: 24px; border-radius: 50%;
    cursor: pointer;
}

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; width: 100%;
    display: flex; justify-content: space-around;
    padding: 15px 0;
    border-top: 1px solid var(--glass-border);
    z-index: 100;
}
.nav-item {
    color: var(--text-muted);
    text-decoration: none;
    display: flex; flex-direction: column; align-items: center; gap: 5px;
    font-size: 12px;
    transition: 0.3s;
}
.nav-item i { font-size: 20px; }
.nav-item.active { color: var(--primary); }
.nav-item.active i { transform: translateY(-3px); }

/* Pages */
.content-area { padding: 20px; }
.page-title { margin-bottom: 20px; font-size: 24px; }

/* Templates List */
.premium-match-card {
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, rgba(255,255,255,0.05), rgba(0,0,0,0.3));
    border: 1px solid rgba(255,215,0,0.1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
.premium-match-card .card-glow {
    position: absolute; top: -30px; right: -30px; width: 120px; height: 120px; background: var(--warning); filter: blur(50px); opacity: 0.2; border-radius: 50%; pointer-events: none;
}
.premium-match-card .match-stats {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; position: relative; z-index: 1;
}
.premium-match-card .stat-box { text-align: center; width: 40%; min-width: 0; padding: 15px 5px; }
.premium-match-card .stat-box small { text-transform: uppercase; letter-spacing: 1px; font-size: 11px; color: var(--text-muted); display: block; margin-bottom: 5px; font-weight: 600; }
.premium-match-card .stat-box .amount { font-size: 28px; font-weight: 900; line-height: 1; }
.premium-match-card .vs-badge {
    width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, rgba(255,193,7,0.1), rgba(255,193,7,0.2)); display: flex; align-items: center; justify-content: center; font-weight: 900; font-style: italic; color: var(--warning); font-size: 14px; box-shadow: 0 0 15px rgba(255, 193, 7, 0.3); border: 1px solid rgba(255, 193, 7, 0.4);
}
.premium-match-card .play-btn {
    width: 100%; border-radius: 30px; padding: 16px; font-size: 18px; font-weight: 800; letter-spacing: 1px; position: relative; z-index: 1; text-transform: uppercase; box-shadow: 0 5px 20px var(--primary-glow);
}

/* Radar Matchmaking */
.center-content { text-align: center; }
.radar-spinner {
    width: 100px; height: 100px;
    border: 5px solid var(--glass-border);
    border-top: 5px solid var(--secondary);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* Game UI */
.ludo-bg {
    background: radial-gradient(circle at center, #2c3e50, #0a0f18);
    box-shadow: inset 0 0 100px rgba(0,0,0,0.9);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 2000;
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
}
.game-top-bar { padding: 20px 20px 0; }
.win-amount { margin-bottom: 20px; text-shadow: 0 0 10px rgba(0,0,0,0.5); }
.player-info-container { display: flex; justify-content: space-between; align-items: flex-end; }
.player-box { width: 60px; height: 60px; border: 3px solid white; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 30px; box-shadow: inset 0 0 10px rgba(0,0,0,0.5), 0 0 10px rgba(0,0,0,0.5); }
.green-box { background: #2e7d32; }
.blue-box { background: #1565c0; }

.ludo-board-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}
.ludo-board {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1;
    background: white;
    border: 8px solid #3e2723;
    border-radius: 5px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8), 0 0 0 2px #5d4037;
}
.board-corner {
    position: absolute;
    width: 40%;
    height: 40%;
    border: 2px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
}
.red-corner { top: 0; left: 0; background: #c62828; }
.green-corner { top: 0; right: 0; background: #2e7d32; }
.blue-corner { bottom: 0; left: 0; background: #1565c0; }
.yellow-corner { bottom: 0; right: 0; background: #f9a825; }
.board-center {
    position: absolute;
    top: 40%; left: 40%;
    width: 20%; height: 20%;
    background: conic-gradient(
        #2e7d32 0deg 90deg, 
        #f9a825 90deg 180deg, 
        #1565c0 180deg 270deg, 
        #c62828 270deg 360deg
    );
    border: 2px solid #333;
}
.score-display {
    background: white;
    width: 70%;
    height: 70%;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #333;
    font-weight: bold;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.3);
}
.score-display span { font-size: 14px; text-transform: uppercase; color: #555; }
.score-display h2 { font-size: 32px; margin: 0; color: #000; }

.game-bottom-bar { padding: 20px; padding-bottom: 40px; }
.my-player-container { display: flex; align-items: flex-end; gap: 15px; }
.dice-btn {
    width: 80px; height: 80px;
    background: linear-gradient(135deg, #ffffff, #e0e0e0);
    border: none;
    border-radius: 15px;
    font-size: 45px;
    color: #d32f2f;
    position: relative;
    cursor: pointer;
    box-shadow: inset -5px -5px 15px rgba(0,0,0,0.1), inset 5px 5px 15px rgba(255,255,255,1), 0 10px 20px rgba(0,0,0,0.4);
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: transform 0.1s, box-shadow 0.1s;
}
.dice-btn:active { 
    transform: translateY(4px); 
    box-shadow: inset -2px -2px 10px rgba(0,0,0,0.1), inset 2px 2px 10px rgba(255,255,255,0.8), 0 5px 10px rgba(0,0,0,0.4);
}
.pulse { animation: pulse 1s infinite; }
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); box-shadow: 0 0 30px rgba(255,255,255,0.5); }
    100% { transform: scale(1); }
}
.dice-spin { animation: spinDice 0.5s ease-in-out; pointer-events: none; }
@keyframes spinDice {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); box-shadow: 0 0 30px rgba(255,255,255,0.8); }
    100% { transform: rotate(360deg) scale(1); }
}
.hand-pointer {
    position: absolute;
    right: -25px;
    bottom: -25px;
    width: 50px;
    animation: tapAnim 0.5s infinite alternate;
}
@keyframes tapAnim {
    from { transform: translateY(0) scale(1); }
    to { transform: translateY(-10px) scale(0.9); }
}

/* Ludo Tokens */
.ludo-token {
    position: absolute;
    width: 4.5%;
    height: 4.5%;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.9);
    box-shadow: 0 4px 6px rgba(0,0,0,0.6), inset 0 -4px 6px rgba(0,0,0,0.5), inset 0 4px 6px rgba(255,255,255,0.7);
    transition: left 0.2s ease-in-out, top 0.2s ease-in-out;
    cursor: pointer;
    z-index: 10;
}
.ludo-token::after {
    content: '';
    position: absolute;
    top: 25%; left: 25%; right: 25%; bottom: 25%;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.6);
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.8);
    background: inherit;
    filter: brightness(1.2);
}
.token-blue { background: radial-gradient(circle at 30% 30%, #64b5f6, #1565c0); }
.token-green { background: radial-gradient(circle at 30% 30%, #81c784, #2e7d32); }

/* History / Team / Profile Lists */
.list-item {
    padding: 15px; border-bottom: 1px solid var(--glass-border);
    display: flex; justify-content: space-between; align-items: center;
}
.list-item:last-child { border-bottom: none; }
.profile-card { padding: 30px; text-align: center; margin-bottom: 20px; }
.profile-card h2 { margin: 15px 0 5px; }

@media (max-width: 768px) {
    .hero-content h1 { font-size: 2.5rem; }
    .ludo-animation { width: 200px; height: 200px; }
    
    /* Mobile enhancements for Game Cards */
    .premium-match-card {
        padding: 15px;
        margin-bottom: 15px;
        border-radius: 15px;
    }
    .premium-match-card .match-stats {
        margin-bottom: 15px;
    }
    .premium-match-card .stat-box .amount {
        font-size: 22px;
    }
    .premium-match-card .stat-box small {
        font-size: 10px;
    }
    .premium-match-card .vs-badge {
        width: 32px; height: 32px; font-size: 12px;
    }
    .premium-match-card .play-btn {
        padding: 12px;
        font-size: 16px;
    }
}

/* Matchmaking Radar Animation */
.avatar-radar-container {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 30px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}
.radar-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), var(--warning));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: white;
    z-index: 2;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    border: 3px solid white;
}
.radar-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    opacity: 0;
    z-index: 1;
    animation: radarPulse 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}
.radar-ring:nth-child(2) {
    animation-delay: 0.6s;
}
.radar-ring:nth-child(3) {
    animation-delay: 1.2s;
}
@keyframes radarPulse {
    0% { width: 80px; height: 80px; opacity: 1; border-color: var(--primary); }
    100% { width: 250px; height: 250px; opacity: 0; border-color: var(--warning); }
}
