:root {
    --bg-color: #050505;
    --card-bg: #141414;
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --accent-color: #d4af37;
    /* Luxe Gold */
    --accent-hover: #b8960f;
    --border-color: #21262d;
    --success-color: #d4af37;
    --danger-color: #ff3b3b;
    --brand-crimson: #dc143c;
    /* Crimson Red */
    --secondary-color: #58a6ff;
    /* High contrast Electric Blue */
    /* Updated for visibility */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-family);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

ul {
    list-style: none;
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.btn-primary {
    background-color: var(--accent-color);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: #fff;
}

.btn-secondary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-danger {
    background-color: var(--danger-color);
    color: #fff;
}

.btn-danger:hover {
    opacity: 0.9;
}

.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

/* --- OPTION 2: ESPORTS HUD --- */
.card-esports {
    background: #000 !important;
    border: 2px solid var(--accent-color) !important;
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.2) !important;
}

.card-esports .team-logo {
    height: 140px;
    width: 140px;
    /* Force square ratio */
    padding: 15px;
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
    background: rgba(212, 175, 55, 0.05);
}

.card-esports .stat-value {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.1rem;
    color: var(--accent-color);
    text-shadow: 0 0 5px rgba(212, 175, 55, 0.5);
}

/* --- OPTION 3: THE ROYAL HORIZON (ASHWIN SPECIAL) --- */
.card-horizon {
    padding: 0 !important;
    border: 2px solid #fff !important;
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.5) !important;
    background: #050505 !important;
}

.horizon-top {
    height: 120px;
    background: linear-gradient(135deg, #d4af37, #f7e08a, #d4af37);
    display: flex;
    align-items: center;
    justify-content: center;
}

.horizon-top .team-logo {
    height: 90px;
    margin: 0;
    border: 2px solid #000;
    background: #000;
}

.horizon-bottom {
    padding: 40px 20px 20px 20px;
    position: relative;
    text-align: center;
}

.horizon-captain-wrap {
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
}

.horizon-captain-wrap .captain-img-small {
    width: 70px;
    height: 70px;
    border: 4px solid #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.card-horizon .defending-label {
    text-align: center;
    width: 100%;
    margin-top: 5px;
}


/* Header/Nav */
header {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    margin-bottom: 2rem;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.logo-brand {
    color: var(--brand-crimson);
}

.logo img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
}

/* Hero Section */
.hero {
    padding: 3rem 0;
    margin-bottom: 2rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 40px;
    align-items: center;
}

.hero-content {
    display: flex;
    align-items: center;
    gap: 30px;
}

.hero h1 {
    font-weight: 800;
    margin-bottom: 1rem;
    font-size: clamp(2rem, 4vw, 3.2rem);
    white-space: nowrap;
    background: linear-gradient(135deg, var(--accent-color), #fff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    color: var(--text-secondary);
    font-size: 1.2rem;
    max-width: 600px;
}

/* Marquee Podium & Cards */
.top-buys-podium {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 320px;
}

.marquee-card {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(0, 0, 0, 0.9));
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease;
    cursor: default;
}

.marquee-card:first-child {
    border: 2px solid var(--accent-color);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
    animation: pulse-glow 3s infinite;
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
    }

    50% {
        box-shadow: 0 0 25px rgba(212, 175, 55, 0.4);
    }

    100% {
        box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
    }
}

.marquee-rank {
    position: absolute;
    top: 5px;
    left: 5px;
    background: var(--accent-color);
    color: #000;
    font-size: 0.65rem;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 2;
}

.marquee-img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid var(--accent-color);
    object-fit: cover;
    flex-shrink: 0;
}

.marquee-info {
    flex: 1;
    text-align: left;
}

.marquee-info h2 {
    font-size: 1.1rem;
    margin: 0;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.marquee-info .team-name {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.marquee-price {
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    font-weight: 800;
    color: var(--success-color);
    white-space: nowrap;
}

.live-price {
    font-size: clamp(1.2rem, 5vw, 2.2rem);
    font-weight: 800;
    color: var(--success-color);
    display: block;
}

.big-price {
    font-size: clamp(1rem, 4vw, 1.8rem);
    font-weight: 800;
    color: var(--accent-color);
    margin: 10px 0;
}

.stat-value {
    font-size: clamp(0.85rem, 2.5vw, 1.1rem);
    font-weight: 800;
    color: var(--text-primary);
}

.leader-price {
    font-size: clamp(1rem, 3vw, 1.4rem);
    font-weight: 800;
    color: var(--success-color);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px;
    background-color: #0d1117;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
}

/* Grids */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* Player/Team specific styles */
.team-logo {
    display: block;
    height: 80px;
    width: 80px;
    /* Force square ratio */
    object-fit: contain;
    margin: 0 auto 1.5rem auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    border: 3px solid var(--accent-color);
    padding: 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
}

.player-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 1rem;
    background-color: #21262d;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    background-color: rgba(88, 166, 255, 0.15);
    color: var(--accent-color);
}

.stats-row {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.stat-value {
    color: var(--text-primary);
    font-weight: 600;
}

/* Auth Modal */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.hero-logo {
    width: 140px;
    height: auto;
    filter: drop-shadow(0 0 40px rgba(212, 175, 55, 0.15));
    animation: floating 3s ease-in-out infinite;
}

@keyframes floating {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

@media (max-width: 768px) {
    .hero-content {
        flex-direction: column;
        text-align: center;
        gap: 30px;
    }

    .hero-logo {
        width: 90px;
    }

    .hero h1 {
        font-size: 2.5rem;
    }
}

.auth-box {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    text-align: center;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.auth-box h2 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.auth-box input {
    width: 100%;
    padding: 12px;
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: white;
    font-size: 1rem;
}

.auth-box button {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
}

.auth-box button:hover {
    filter: brightness(1.1);
}

.captain-badge {
    position: absolute;
    bottom: -15px;
    left: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--card-bg);
    padding: 6px 14px 6px 8px;
    border-radius: 25px;
    border: 1px solid var(--accent-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 10;
}

.captain-img-small {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-color);
    background: var(--bg-color);
}

.captain-info {
    display: flex;
    flex-direction: column;
}

.captain-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--accent-color);
    font-weight: 800;
    line-height: 1;
}

.captain-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.defending-label {
    background: linear-gradient(135deg, var(--accent-color), #fff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 0.65rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2px;
    display: block;
}

.team-card-header {
    position: relative;
    margin-bottom: 2rem;
}

.live-flash {
    color: #ff4d4d;
    font-weight: 800;
    animation: live-blink 1s infinite;
    margin-left: 5px;
}

/* --- MOBILE OPTIMIZATION OVERRIDES --- */
@media (max-width: 768px) {
    header {
        padding: 0.5rem 0;
    }

    .nav-container {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .logo {
        font-size: 1.2rem;
    }

    .nav-links {
        width: 100%;
        justify-content: center;
        gap: 10px;
        overflow-x: auto;
        padding-bottom: 5px;
        -webkit-overflow-scrolling: touch;
    }

    .nav-links a {
        font-size: 0.85rem;
        white-space: nowrap;
        padding: 5px 10px;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 4px;
    }

    .hero {
        padding: 2rem 1rem;
    }

    .hero h1 {
        font-size: 2.2rem !important;
    }

    .hero p {
        font-size: 1rem;
    }

    .grid {
        grid-template-columns: 1fr;
        /* Single column on mobile */
    }

    /* Live Feed Responsive */
    #live-feed .card {
        flex-direction: column;
        text-align: center !important;
        gap: 15px;
        padding: 1.5rem;
    }

    #live-feed .card img {
        width: 120px !important;
        height: 120px !important;
    }

    #live-feed .card div:last-child {
        text-align: center !important;
        margin-top: 10px;
        border-top: 1px solid var(--border-color);
        padding-top: 10px;
        width: 100%;
    }

    /* Bidding/Admin Section Stacking */
    section[style*="display: flex"] {
        flex-direction: column !important;
    }

    #import-controls {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    #import-controls .btn {
        width: 100%;
        margin-bottom: 5px;
    }

    /* Dealer Room Layout */
    .bidding-container {
        flex-direction: column !important;
    }

    .player-list-side {
        width: 100% !important;
        max-height: 300px;
        margin-bottom: 2rem;
    }

    .bidding-main {
        width: 100% !important;
    }

    /* Form spacing for mobile */
    .form-row {
        flex-direction: column !important;
        gap: 0 !important;
    }

    .form-group {
        width: 100% !important;
    }
}

/* Specific small mobile adjustments */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.8rem !important;
    }

    .hero-logo {
        width: 80px;
    }

    .logo-brand {
        display: block;
        /* Stack Royal East on logo */
    }
}

/* Bid Amount Buttons */
.bid-btn-250 {
    background: #2196F3 !important;
    /* Blue */
    color: white !important;
}

.bid-btn-250:hover {
    background: #1976D2 !important;
}

.bid-btn-500 {
    background: #9C27B0 !important;
    /* Purple */
    color: white !important;
}

.bid-btn-500:hover {
    background: #7B1FA2 !important;
}

.bid-btn-1m {
    background: #4CAF50 !important;
    /* Green */
    color: white !important;
}

.bid-btn-1m:hover {
    background: #388E3C !important;
}

.bid-btn-group {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.btn-bid-sm {
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 800;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    text-transform: uppercase;
}

/* Header QR Codes */
.nav-qr-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 20px;
    padding-left: 20px;
    border-left: 1px solid var(--border-color);
}

.nav-qr-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.nav-qr-img {
    width: 35px;
    height: 35px;
    border-radius: 4px;
    background: #fff;
    padding: 2px;
    transition: transform 0.2s ease;
}

.nav-qr-img:hover {
    transform: scale(2.5);
    z-index: 100;
}

.nav-qr-label {
    font-size: 0.6rem;
    font-weight: 800;
    color: var(--accent-color);
    text-transform: uppercase;
}

.disclaimer-footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.8rem;
    opacity: 0.7;
    line-height: 1.5;
}

.disclaimer-footer strong {
    color: var(--accent-color);
}

/* --- COIN TOSS ANIMATION --- */
.coin {
    width: 150px;
    height: 150px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 1s ease-in-out;
    margin: 0 auto;
}

.coin .side {
    width: 100%;
    height: 100%;
    position: absolute;
    backface-visibility: hidden;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #d4af37, #f1c40f);
    border: 4px solid #b8860b;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.coin .heads {
    background-color: transparent;
    /* ensured non-empty ruleset */
}

.coin .tails {
    transform: rotateY(180deg);
}

.coin.flipping {
    animation: flip-3d 3s infinite linear;
}

.coin.show-heads {
    transform: rotateY(0deg);
}

.coin.show-tails {
    transform: rotateY(180deg);
}

@keyframes flip-3d {
    0% {
        transform: rotateY(0);
    }

    100% {
        transform: rotateY(1800deg);
    }
}

/* --- 10 RUPEES FUTURISTIC COIN --- */
.coin-10 {
    width: 120px;
    height: 120px;
}

.coin-10 .side {
    background-size: cover;
    background-position: center;
    border: none;
    border-radius: 50%;
}

/* Use relative paths for local project assets */
.coin-10 .heads {
    /* Emblem Side */
    background-image: url('coin-heads-final.png');
    z-index: 2;
    /* Ensure heads is on top in 3D stack */
}

.coin-10 .tails {
    /* 10 Rupee Side */
    background-image: url('coin-tails-final.png');
    transform: rotateY(180deg);
}

.coin-10 .heads::after,
.coin-10 .tails::after {
    display: none;
}

/* --- FUTURISTIC BLUE BUTTON --- */
.btn-futuristic-blue {
    padding: 5px 12px;
    font-size: 0.85rem;
    border: 1px solid #58a6ff;
    background: rgba(88, 166, 255, 0.1);
    color: #58a6ff;
    box-shadow: 0 0 10px rgba(88, 166, 255, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
    border-radius: 4px;
    font-weight: 600;
    text-transform: none;
    line-height: 1.5;
}

.btn-futuristic-blue:hover {
    background: rgba(88, 166, 255, 0.2);
    box-shadow: 0 0 20px rgba(88, 166, 255, 0.5);
    transform: translateY(-1px);
    color: #fff;
    border-color: #fff;
}

.btn-futuristic-blue:active {
    transform: translateY(0);
}