:root {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --accent-color: #38bdf8;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --ball-size: 60px;
    --ball-font-size: 1.5rem;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Outfit', 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
}

/* TV Layout */
.tv-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    height: 100vh;
    padding: 20px;
    gap: 20px;
    overflow: hidden;
    box-sizing: border-box;
}

.main-board {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: var(--card-bg);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    padding: 30px;
}

.ball-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 15px;
}

/* Pool Ball Style */
.ball {
    width: var(--ball-size);
    height: var(--ball-size);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 800;
    font-size: var(--ball-font-size);
    background: radial-gradient(circle at 30% 30%, #ffffff 0%, #d1d5db 10%, #4b5563 50%, #1f2937 100%);
    color: #1f2937;
    box-shadow: 
        inset -5px -5px 15px rgba(0,0,0,0.4),
        5px 10px 20px rgba(0,0,0,0.3);
    position: relative;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ball::after {
    content: '';
    position: absolute;
    top: 15%;
    left: 15%;
    width: 30%;
    height: 30%;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}


/* Sidebar Info */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 20px;
    text-align: center;
}

.timer-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 8px solid var(--accent-color);
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    font-size: 3rem;
    font-weight: 900;
    color: var(--accent-color);
    text-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}

/* Cashier UI */
.cashier-container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 24px;
}

.number-selector {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 10px;
    margin-bottom: 30px;
}

.num-btn {
    padding: 15px;
    border: 1px solid #334155;
    background: transparent;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
}

.num-btn.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--bg-color);
    font-weight: bold;
}

/* Animations */
@keyframes dropIn {
    0% { transform: translateY(-500px) scale(0.5); opacity: 0; }
    60% { transform: translateY(20px) scale(1.1); }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes pulseGlow {
    0% { transform: scale(1); box-shadow: 0 0 10px rgba(245, 158, 11, 0.4); }
    50% { transform: scale(1.6); box-shadow: 0 0 60px rgba(245, 158, 11, 1); }
    100% { transform: scale(1.5); box-shadow: 0 0 40px rgba(245, 158, 11, 0.8); }
}

@keyframes spinIn {
    0% { transform: rotate(-720deg) scale(0); opacity: 0; }
    80% { transform: rotate(0) scale(1.6); opacity: 1; }
    100% { transform: rotate(0) scale(1.5); opacity: 1; }
}

.animate-drop {
    animation: dropIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.animate-pulse {
    animation: pulseGlow 1s ease-out forwards;
}

.animate-spin {
    animation: spinIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.ball.selected {
    transform: scale(1.5);
    background: radial-gradient(circle at 30% 30%, #fbbf24 0%, #f59e0b 20%, #b45309 80%, #78350f 100%);
    color: #fff;
    font-size: 2rem; /* Larger font for selected balls */
    z-index: 10; /* Ensure selected ball is on top */
    box-shadow: 
        0 0 40px rgba(245, 158, 11, 0.6),
        inset -5px -5px 15px rgba(0,0,0,0.3);
}

/* Player Portal Utilities */
.glass {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.text-gradient {
    background: linear-gradient(to bottom right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

@media (max-width: 768px) {
    .tv-container {
        grid-template-columns: 1fr;
        height: auto;
        padding: 10px;
    }
    
    .ball-grid {
        gap: 8px;
    }
    
    :root {
        --ball-size: 45px;
        --ball-font-size: 1rem;
    }

    .cashier-container {
        margin: 10px;
        padding: 15px;
    }

    .number-selector {
        grid-template-columns: repeat(8, 1fr);
    }
}
