* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #667eea;
    --primary-dark: #764ba2;
    --secondary: #f093fb;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1f2937;
    --light: #f9fafb;
    --gray: #6b7280;
    --white: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Ensure all text elements have explicit colors - but NOT on gradient backgrounds */
body:not(.ucp-body) p, 
body:not(.ucp-body) span, 
body:not(.ucp-body) div:not(.auth-card):not(.ucp-card):not(.ucp-content):not(.game-card):not(.stat-card),
body:not(.ucp-body) h1, 
body:not(.ucp-body) h2, 
body:not(.ucp-body) h3, 
body:not(.ucp-body) h4, 
body:not(.ucp-body) h5, 
body:not(.ucp-body) h6 {
    color: var(--white);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Fix text on gradient backgrounds */
.dashboard-header h1,
.page-header h1,
.page-header p,
body:not(.ucp-body) .container > h1,
body:not(.ucp-body) .container > h2,
body:not(.ucp-body) .container > h3,
body:not(.ucp-body) .container > p,
body:not(.ucp-body) .container > span,
body:not(.ucp-body) .container > div:not(.auth-card):not(.ucp-card):not(.game-card):not(.stat-card) {
    color: var(--white) !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand a {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: var(--dark);
    text-decoration: none;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: var(--primary);
}

/* Auth Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card {
    background: var(--white);
    border-radius: 15px;
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 500px;
}

/* Ensure text inside auth-card is dark (not white) */
.auth-card * {
    color: var(--dark) !important;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    color: var(--primary) !important;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--gray) !important;
}

.auth-form {
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--dark) !important;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Checkbox Label */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
    cursor: pointer;
}

.checkbox-label span {
    color: var(--dark);
    font-size: 0.9rem;
}

.checkbox-label input[type="checkbox"]:checked + span {
    color: var(--primary);
    font-weight: 500;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-block {
    width: 100%;
}

.auth-footer {
    text-align: center;
    color: var(--gray) !important;
}

.auth-footer a {
    color: var(--primary) !important;
    text-decoration: none;
}

/* OAuth Buttons */
.auth-divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 45%;
    height: 1px;
    background: #e5e7eb;
}

.auth-divider::before {
    left: 0;
}

.auth-divider::after {
    right: 0;
}

.auth-divider span {
    background: var(--white);
    padding: 0 1rem;
    color: var(--gray);
    position: relative;
    z-index: 1;
}

.btn-google {
    background: var(--white);
    color: #4285f4;
    border: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-google:hover {
    background: #f9fafb;
    border-color: #4285f4;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-google i {
    font-size: 1.2rem;
}

/* Dashboard */
.dashboard-container {
    padding: 2rem 0;
}

.dashboard-header h1 {
    color: var(--white) !important;
    margin-bottom: 2rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.user-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--white);
    border-radius: 15px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
}

.stat-icon {
    font-size: 2.5rem;
    color: var(--primary);
}

.stat-label {
    color: var(--gray);
    font-size: 0.9rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--dark);
}

.dashboard-content {
    background: var(--white);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.games-section {
    margin-bottom: 3rem;
}

.games-section h2 {
    margin-bottom: 1.5rem;
    color: var(--dark);
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.game-card {
    background: var(--light);
    border-radius: 12px;
    padding: 1.5rem;
    border: 2px solid #e5e7eb;
    transition: all 0.3s;
}

.game-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.game-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.game-info h3 {
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.game-info p {
    color: var(--gray);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.game-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--gray);
}

.game-bet {
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--primary);
}

/* Tables */
.sessions-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.sessions-table th,
.sessions-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.sessions-table th {
    background: var(--light);
    font-weight: 600;
    color: var(--dark);
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 200px);
}

/* Games Page */
.games-page {
    padding: 2rem 0;
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
    color: var(--white) !important;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--white) !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.page-header p {
    font-size: 1.2rem;
    opacity: 0.95;
    color: var(--white) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.game-card-large {
    background: var(--white);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s, box-shadow 0.3s;
}

.game-card-large:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.game-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #e5e7eb;
}

.game-icon-large {
    font-size: 4rem;
    color: var(--primary);
}

.game-title-section h2 {
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.game-type-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--primary);
    color: var(--white);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.game-body {
    margin-bottom: 1.5rem;
}

.game-description {
    color: var(--gray);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.game-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--light);
    border-radius: 8px;
}

.stat-item i {
    font-size: 1.5rem;
    color: var(--primary);
}

.stat-item .stat-label {
    font-size: 0.85rem;
    color: var(--gray);
}

.stat-item .stat-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark);
}

.game-footer {
    text-align: center;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Game Play Page */
.game-play-page {
    padding: 2rem 0;
}

.game-header-bar {
    background: var(--white);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.game-info h1 {
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.game-info p {
    color: var(--gray);
}

.game-stats-bar {
    display: flex;
    gap: 1.5rem;
}

.stat-box {
    text-align: center;
    padding: 1rem 1.5rem;
    background: var(--light);
    border-radius: 10px;
    min-width: 120px;
}

.stat-box .stat-label {
    font-size: 0.85rem;
    color: var(--gray);
    margin-bottom: 0.5rem;
}

.stat-box .stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
}

.game-container {
    background: var(--white);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.game-controls {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #e5e7eb;
}

.bet-control {
    margin-bottom: 1.5rem;
}

.bet-control label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark);
}

.bet-control input[type="number"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.bet-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-bet {
    padding: 0.5rem 1rem;
    background: var(--light);
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.btn-bet:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.game-area {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light);
    border-radius: 10px;
    margin-bottom: 2rem;
}

.game-waiting {
    text-align: center;
    color: var(--gray);
}

.game-waiting i {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.game-instructions {
    text-align: center;
    padding: 2rem;
}

.game-instructions h2 {
    color: var(--dark);
    margin-bottom: 1rem;
}

.game-instructions p {
    color: var(--gray);
    margin-bottom: 0.5rem;
}

.countdown {
    font-size: 4rem;
    font-weight: bold;
    color: var(--primary);
    margin-top: 2rem;
}

.reaction-target {
    text-align: center;
    cursor: pointer;
    padding: 2rem;
}

.target-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    box-shadow: var(--shadow-lg);
    transition: transform 0.2s;
}

.target-circle:hover {
    transform: scale(1.1);
}

.target-circle i {
    font-size: 4rem;
    color: var(--white);
}

.reaction-feedback {
    text-align: center;
    padding: 2rem;
}

.reaction-feedback h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.game-processing {
    text-align: center;
    padding: 2rem;
    color: var(--gray);
}

.game-processing i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.game-complete {
    text-align: center;
    padding: 2rem;
    color: var(--success);
}

.game-complete i {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.game-results {
    background: var(--light);
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
}

.result-content {
    max-width: 500px;
    margin: 0 auto;
}

.result-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
}

.result-content h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
}

.result-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    background: var(--white);
    border-radius: 8px;
    font-weight: 600;
}

.detail-item span:first-child {
    color: var(--gray);
}

.detail-item span:last-child {
    color: var(--dark);
}

/* Responsive */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .games-grid {
        grid-template-columns: 1fr;
    }
    
    .user-stats {
        grid-template-columns: 1fr;
    }
    
    .nav-menu {
        flex-direction: column;
        gap: 1rem;
    }

    .game-header-bar {
        flex-direction: column;
        text-align: center;
    }

    .game-stats-bar {
        width: 100%;
        justify-content: center;
    }

    .target-circle {
        width: 150px;
        height: 150px;
    }
}

