/**
 * Ludo King - Premium Full-Stack Responsive UI System
 * Built on Bootstrap 5.3+ for Desktop, Tablet, and Mobile
 */

:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    --primary-gradient: linear-gradient(135deg, #4f46e5, #3730a3);
    
    --success-color: #10b981;
    --success-hover: #059669;
    --success-light: #ecfdf5;
    --success-gradient: linear-gradient(135deg, #10b981, #059669);

    --accent-color: #06b6d4;
    --accent-gradient: linear-gradient(135deg, #06b6d4, #0284c7);

    --warning-color: #f59e0b;
    --warning-light: #fffbeb;
    --warning-gradient: linear-gradient(135deg, #f59e0b, #d97706);

    --danger-color: #ef4444;
    --danger-light: #fef2f2;
    --danger-gradient: linear-gradient(135deg, #ef4444, #dc2626);

    --body-bg: #f1f5f9;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;

    --shadow-subtle: 0 1px 3px 0 rgb(0 0 0 / 0.07), 0 1px 2px -1px rgb(0 0 0 / 0.07);
    --shadow-card: 0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.08);
    --shadow-card-hover: 0 10px 25px -3px rgb(0 0 0 / 0.12), 0 4px 6px -4px rgb(0 0 0 / 0.08);
    --shadow-glow-primary: 0 8px 20px rgba(79, 70, 229, 0.25);
    --shadow-glow-success: 0 8px 20px rgba(16, 185, 129, 0.25);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

/* Base & Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--body-bg);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Master App Container */
.app-main-wrapper {
    flex: 1;
    width: 100%;
    padding: 24px 0 90px; /* Bottom space on mobile */
}

@media (min-width: 768px) {
    .app-main-wrapper {
        padding: 32px 0 48px;
    }
}

/* Desktop Navbar */
.desktop-navbar {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-subtle);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.nav-brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.brand-icon-box {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    color: #ffffff;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

.brand-name {
    font-size: 19px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.5px;
    margin: 0;
}

.desktop-nav-links .nav-link {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.desktop-nav-links .nav-link:hover {
    color: var(--primary-color);
    background: var(--primary-light);
}

.desktop-nav-links .nav-link.active {
    color: var(--primary-color);
    background: var(--primary-light);
}

/* Mobile Header */
.mobile-header {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-subtle);
    padding: 10px 16px;
    position: sticky;
    top: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Universal Wallet Pill */
.wallet-badge-pill {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 50px;
    padding: 4px 6px 4px 14px;
    text-decoration: none;
    box-shadow: var(--shadow-subtle);
    transition: all 0.2s ease;
    gap: 8px;
}

.wallet-badge-pill:hover {
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-card);
}

.wallet-badge-amount {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
}

.wallet-add-action {
    width: 28px;
    height: 28px;
    background: var(--success-gradient);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35);
}

/* Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0 10px;
    z-index: 1040;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    transition: all 0.2s ease;
    padding: 4px 12px;
}

.bottom-nav-item i {
    font-size: 20px;
    margin-bottom: 2px;
    transition: transform 0.2s;
}

.bottom-nav-item.active {
    color: var(--primary-color);
}

.bottom-nav-item.active i {
    transform: translateY(-2px);
}

/* Cards & UI Elements */
.app-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.app-card:hover {
    box-shadow: var(--shadow-card-hover);
}

/* Hero Balance Card */
.wallet-hero-card {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-radius: var(--radius-xl);
    color: #ffffff;
    padding: 28px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.35);
    position: relative;
    overflow: hidden;
}

.wallet-hero-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.3) 0%, transparent 70%);
    pointer-events: none;
}

/* 1v1 Battle Arena Tile */
.battle-tile {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 18px;
    box-shadow: var(--shadow-card);
    transition: all 0.2s ease;
    margin-bottom: 14px;
}

.battle-tile:hover {
    box-shadow: var(--shadow-card-hover);
    border-color: #cbd5e1;
}

.battle-tile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--border-color);
    margin-bottom: 14px;
}

.player-avatar-circle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 2.5px solid var(--primary-light);
    box-shadow: var(--shadow-subtle);
}

.vs-badge-circle {
    background: var(--danger-gradient);
    color: #ffffff;
    font-weight: 800;
    font-size: 11px;
    padding: 6px 12px;
    border-radius: 50px;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.35);
    letter-spacing: 1px;
}

/* Quick Preset Chips */
.preset-chip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
}

.preset-chip {
    background: #ffffff;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 8px;
    text-align: center;
    font-weight: 700;
    font-size: 15px;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.preset-chip:hover,
.preset-chip.active {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-primary);
}

/* Room Code Card */
.room-code-panel {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #ffffff;
    border-radius: var(--radius-lg);
    padding: 28px 20px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

.room-code-display {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: 5px;
    color: #38bdf8;
    font-family: monospace;
    margin: 12px 0;
}

/* Pulse Live Badge */
.pulse-live-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 50px;
}

.pulse-dot-anim {
    width: 8px;
    height: 8px;
    background-color: #ef4444;
    border-radius: 50%;
    animation: pulse-ring 1.5s infinite;
}

@keyframes pulse-ring {
    0% { transform: scale(0.9); opacity: 0.8; box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1.1); opacity: 1; box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.9); opacity: 0.8; box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Marquee Announcement */
.app-marquee-bar {
    background: var(--warning-light);
    border: 1px solid #fde68a;
    border-radius: var(--radius-md);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-subtle);
    margin-bottom: 20px;
}

