/* Final Version with All Text Color Fixes */
:root {
    /* Theme Colors */
    --primary-rgb: 88, 101, 242;
    --secondary-rgb: 139, 92, 246;
    --accent-rgb: 235, 69, 158;
    
    /* Background Colors */
    --bg-rgb: 14, 15, 26;
    --card-bg-rgb: 29, 30, 48;

    /* Text Color Palette */
    --color-headings-rgb: 255, 255, 255;
    --color-text-primary-rgb: 240, 240, 255;
    --color-text-secondary-rgb: 160, 160, 180;
     --popup-text-color-rgb: 0, 0, 0; /* Black */
    
    --border-rgb: 50, 52, 79;
    --gradient: linear-gradient(135deg, rgb(var(--accent-rgb)), rgb(var(--secondary-rgb)), rgb(var(--primary-rgb)));
}

body {
    font-family: 'Poppins', sans-serif; 
    background-color: rgb(var(--bg-rgb)); 
    color: rgb(var(--color-text-primary-rgb));
    padding-top: 80px; 
    padding-bottom: 90px;
}

/* --- UPDATED: More Specific Text Color Rules --- */
h1, h2, h3, h4, h5, h6, .section-title, .fw-bold, .stat-value, .display-4, .display-5 {
    color: rgb(var(--color-headings-rgb)) !important;
}


.swal-sitemessage.swal2-popup {
    background-color: #1D1E30 !important;
}

.swal-sitemessage .swal2-title {
    color: #FFFFFF !important;
}

.swal-sitemessage .swal2-html-container {
    color: #FFFFFF !important;
}

.swal-sitemessage .swal2-icon.swal2-info {
    color: #5865f2 !important;
    border-color: #5865f2 !important;
}



/* Custom styling for the 'Task Verified' pop-up */
.swal-verified.swal2-popup {
    background-color: rgb(var(--card-bg-rgb)) !important; /* The background of the pop-up */
}

.swal-verified .swal2-title {
  color: #FFFFFF !important; /* The color of the title text */
}

.swal-verified .swal2-html-container {
    color: rgb(var(--color-text-primary-rgb)) !important; /* The color of the body text */
}







p, small, .text-muted, .form-text, .stat-label, label, .list-group-item span {
    color: rgb(var(--color-text-secondary-rgb)) !important;
}

.user-balance, .list-group-item strong {
    color: rgb(var(--color-text-primary-rgb)) !important;
}

.header-nav .user-balance {
    color: rgb(var(--accent-rgb)) !important;
}

.form-control::placeholder {
    color: rgb(var(--text-secondary-rgb));
    opacity: 0.7;
}

/* This fixes the dark text in the read-only referral link input */
.form-control[readonly] {
    background-color: rgb(var(--bg-rgb));
    color: rgb(var(--color-text-secondary-rgb));
}
/* --- End of Fix --- */


main>section { display: none; animation: fadeIn 0.5s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.header-nav, .footer-nav {
    background-color: rgba(var(--card-bg-rgb), 0.8); 
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-color: rgb(var(--border-rgb)); 
    position: fixed; left: 0; right: 0; z-index: 1030;
}
.header-nav { top: 0; padding: 0.75rem 1rem; border-bottom: 1px solid;}
.footer-nav {
    bottom: 0; border-top-left-radius: 28px; border-top-right-radius: 28px;
    border-top: 1px solid; padding: 0.5rem 0;
}
.footer-nav .nav-item { color: rgb(var(--color-text-secondary-rgb)); transition: all 0.3s ease; flex: 1; }
.footer-nav .nav-item i { font-size: 1.6rem; }
.footer-nav .nav-item small { font-size: 0.7rem; }
.footer-nav .nav-item.active { color: rgb(var(--color-headings-rgb)); transform: translateY(-4px); }

.card {
    background-color: rgb(var(--card-bg-rgb)); 
    border: 1px solid rgb(var(--border-rgb));
    border-radius: 20px; 
    box-shadow: 0 8px 32px rgba(0,0,0, 0.2);
}
.form-control, .form-select {
    background-color: rgb(var(--bg-rgb));
    border-color: rgb(var(--border-rgb));
    color: rgb(var(--color-text-primary-rgb));
}
.form-control:focus, .form-select:focus {
    background-color: rgb(var(--bg-rgb));
    border-color: rgb(var(--primary-rgb));
    box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.25);
    color: rgb(var(--color-text-primary-rgb));
}
.btn { border-radius: 50rem; font-weight: 500; }
.btn-primary { background: var(--gradient); border: none; font-weight: 600; color: white; }
.btn-info { background-color: #17a2b8; border-color: #17a2b8; }
.btn-danger { background-color: #dc3545; border-color: #dc3545; }

.refer-stat-card .stat-value { font-size: 2rem; font-weight: 700; background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.status-badge { font-size: 0.8em; }
.status-pending { background-color: #ffc107; color: #333; }
.status-approved { background-color: #28a745; color: #fff; }
.status-rejected { background-color: #dc3545; color: #fff; }
.loader{position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(var(--bg-rgb), 0.9);backdrop-filter:blur(5px);display:flex;justify-content:center;align-items:center;z-index:9999;transition:opacity .3s ease}.loader-hidden{opacity:0;pointer-events:none}.coin{width:50px;height:50px;border-radius:50%;background:var(--gradient);display:flex;justify-content:center;align-items:center;font-size:24px;font-weight:bold;color:rgb(var(--text-dark-rgb));animation:flip 1.5s ease-in-out infinite, spin 2s linear infinite;box-shadow:0 0 20px rgba(var(--primary-rgb),0.5)}@keyframes flip{0%,100%{transform:perspective(400px) rotateY(0)}50%{transform:perspective(400px) rotateY(180deg)}}@keyframes spin{to{transform:rotate(360deg)}}
#profile .profile-pic {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border: 4px solid rgb(var(--card-bg-rgb));
}
#theme-toggler {
    font-size: 1.5rem;
    cursor: pointer;
    color: rgb(var(--text-muted-rgb));
}
.text-danger {
    color: red !important;
}

.text-success {
    color: green !important;
}


/* Custom SweetAlert2 styling for dark theme */
.swal2-dark .swal2-title {
    color: rgb(var(--popup-text-color-rgb)) !important;
}






/* Custom Pop-up Styling */
#custom-popup-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(var(--bg-rgb), 0.9);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#custom-popup-container.show {
    opacity: 1;
    visibility: visible;
}

.custom-popup-content {
    max-width: 90%;
    text-align: center;
    padding: 1.5rem;
    border-radius: 20px;
    animation: bounceIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.custom-popup-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: rgb(var(--color-headings-rgb));
}

.custom-popup-message {
    font-size: 1rem;
    color: rgb(var(--color-text-secondary-rgb));
}

@keyframes bounceIn {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Custom Toast Pop-up Styling */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.custom-toast {
    background-color: rgba(var(--card-bg-rgb), 0.9);
    backdrop-filter: blur(8px);
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.4s ease-out;
    min-width: 250px;
    max-width: 350px;
    position: relative;
    overflow: hidden;
}

.custom-toast.success .toast-icon {
    color: #28a745; /* green */
}

.custom-toast.danger .toast-icon {
    color: #dc3545; /* red */
}

.toast-content {
    display: flex;
    align-items: center;
}

.toast-icon {
    font-size: 1.5rem;
    margin-right: 10px;
}

.toast-message {
    font-size: 1rem;
    font-weight: 500;
    color: rgb(var(--color-headings-rgb));
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}















/*tic-tac-toe.php*/

/* ... (all your existing CSS code) ... */

/* *** POPUP FIX ***
  These styles make the popup an overlay. 
*/
.custom-popup-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(var(--bg-rgb), 0.9);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.custom-popup-container.show {
    opacity: 1;
    visibility: visible;
}
/* End of Popup Fix */


/* --- Tic Tac Toe FIX for Collapsing Boxes --- */
.tic-tac-toe-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    
    /* Fixed Size Logic */
    width: min(90vw, 400px); /* Be 90% of viewport width, but no more than 400px */
    height: min(90vw, 400px); /* Same for height to ensure it's a square */
}

.tic-tac-toe-board .cell {
    background-color: rgb(var(--card-bg-rgb));
    border: 2px solid rgb(var(--border-rgb));
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12vw;
    font-weight: 800;
    cursor: pointer;
    transition: background-color 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}


/* --- Tic Tac Toe Start Screen & Popup Styles --- */
#ttt-start-screen {
    max-width: 350px;
    width: 100%;
    padding: 1rem;
}

.game-icon-large {
    font-size: 4rem;
    width: 100px;
    height: 100px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background-color: rgba(var(--primary-rgb), 0.1);
    color: rgb(var(--primary-rgb));
    margin: 0 auto;
}

#ttt-popup-container .custom-popup-content {
    max-width: 350px;
}

/* --- New Betting UI Styles --- */
.bet-input-group {
    position: relative;
}
.bet-input-group .currency-symbol {
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    font-size: 1.5rem;
    font-weight: 600;
    color: rgb(var(--color-text-secondary-rgb));
}
.bet-input-group .form-control {
    padding-left: 50px;
    font-size: 1.8rem;
    font-weight: 700;
}
/* Hide number input arrows */
.bet-input-group input::-webkit-outer-spin-button,
.bet-input-group input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.bet-input-group input[type=number] {
    -moz-appearance: textfield;
}

.quick-pick-btn {
    font-weight: 600;
    border-radius: 50rem;
    padding: 0.5rem 1.25rem;
}

/* ... (keep all your other CSS, including the popup styles) ... */

/* --- Center Content INSIDE the Game Screen (REVISED) --- */
#ttt-game-screen {
    display: flex;          /* Use flexbox */
    flex-direction: column; /* Stack items vertically */
    align-items: center;    /* Center items horizontally */
    justify-content: center; /* Center items vertically */
    width: 100%;            /* Take full width */
    /* Ensure it takes up vertical space if needed (adjust if necessary) */
    flex-grow: 1; 
}

/* Ensure the status text is centered */
#tic-tac-toe-status {
    text-align: center;
    width: 100%; 
    margin-bottom: 1.5rem; /* Keep spacing */
}

/* Board uses auto margins for horizontal centering within the flex item */
.tic-tac-toe-board {
    margin-left: auto;
    margin-right: auto;
    /* Removed top/bottom margins as parent flex handles vertical centering */
}

/* --- Keep the existing styles for Start Screen & Popups --- */
#ttt-start-screen {
    max-width: 350px;
    width: 100%;
    padding: 1rem;
    /* Ensure it's centered by the parent flex container */
    margin: auto; 
}

.game-icon-large {
    font-size: 4rem;
    width: 100px;
    height: 100px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background-color: rgba(var(--primary-rgb), 0.1);
    color: rgb(var(--primary-rgb));
    margin: 0 auto;
}

#ttt-popup-container .custom-popup-content {
    max-width: 350px;
    animation: bounceIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bounceIn {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* --- Keep the existing Betting UI Styles --- */
/* ... (bet-input-group, currency-symbol, form-control, quick-pick-btn styles remain the same) ... */










/* --- Stone Paper Scissors Styles (Complete & Combined) --- */

/* --- Keyframe Animations --- */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px) rotate(-3deg); }
    75% { transform: translateX(6px) rotate(3deg); }
}
@keyframes bounceIn {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* --- Animation Utility Classes --- */
.animate-shake {
    animation: shake 0.5s ease-in-out;
}

/* --- Result Colors --- */
.result-text-win { color: #10b981; }   /* Tailwind success-green */
.result-text-lose { color: #ef4444; }  /* Tailwind danger-red */
.result-text-draw { color: #f59e0b; }  /* Tailwind warning-yellow */

/* --- Game Screen Elements --- */
/* Center content inside the game screen */
#sps-game-screen {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1; /* Helps vertical centering within parent flex */
}

/* Choice Display (Player vs Comp Icons) */
.sps-choice-display {
    width: 6rem; height: 6rem;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; /* Round */
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    transition: transform 0.3s ease;
    background-color: rgb(75 85 99); /* bg-gray-600 default */
}
.sps-choice-display i { /* Icon size */
    font-size: 2.25rem; /* text-3xl */
}


/* Choice Buttons (Rock, Paper, Scissors) */
.sps-choice-button {
    color: white; font-weight: 600;
    padding-top: 0.75rem; padding-bottom: 0.75rem;
    border-radius: 0.5rem; /* rounded-lg */
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); /* shadow-lg */
    transform: scale(1);
    transition: transform 150ms, background-color 150ms;
    display: flex; flex-direction: column; align-items: center;
    border: none; cursor: pointer; width: 100%;
    /* Colors applied via Tailwind classes in PHP */
}
.sps-choice-button:hover { transform: scale(1.05); }
.sps-choice-button:active { transform: scale(0.95); }
.sps-choice-button:disabled {
    opacity: 0.5; cursor: not-allowed; transform: scale(1);
}
.sps-choice-button i {
     font-size: 1.5rem; /* text-2xl */
     margin-bottom: 0.25rem; /* mb-1 */
}

/* --- Start Screen & Shared Icon Styles --- */
#sps-start-screen {
    max-width: 350px; width: 100%;
    padding: 1.5rem; margin: auto;
    display: flex; flex-direction: column; align-items: center;
}

/* Large Icon Style (Used on Start Screen & Modal) */
.sps-icon-large, .game-icon-large {
    font-size: 4rem; width: 100px; height: 100px;
    display: grid; place-items: center;
    border-radius: 50%;
    margin: 0 auto 1.5rem auto; /* Adjusted margin */
    /* Default - Overridden for SPS start */
    background-color: rgba(var(--primary-rgb), 0.1);
    color: rgb(var(--primary-rgb));
}
/* Specific color for SPS start icon */
#sps-start-screen .sps-icon-large {
     background-color: rgba(245, 158, 11, 0.1); /* warning-yellow transparent */
     color: #f59e0b; /* warning-yellow */
     margin-bottom: 1rem;
}
/* Start screen Title */
#sps-start-screen h2 {
    font-size: 1.75rem; font-weight: 700;
    margin-bottom: 1.5rem;
    color: rgb(var(--color-headings-rgb)); /* Ensure heading color */
}


/* --- Betting UI Styles --- */
.bet-input-group {
    position: relative; width: 100%; margin-bottom: 1rem;
}
.bet-input-group .currency-symbol {
    position: absolute; top: 50%; left: 1.25rem;
    transform: translateY(-50%);
    font-size: 1.5rem; font-weight: 600;
    color: rgb(var(--color-text-secondary-rgb));
    pointer-events: none;
}
.bet-input-group .form-control {
    padding-left: 4rem !important; padding-right: 1.25rem !important;
    font-size: 2rem !important; font-weight: 700;
    background-color: rgb(var(--bg-rgb)) !important;
    border: 2px solid rgb(var(--border-rgb)) !important;
    color: rgb(var(--color-text-primary-rgb)) !important;
    border-radius: 0.75rem !important; height: auto; line-height: 1.5;
    text-align: right;
}
.bet-input-group .form-control:focus {
     border-color: rgb(var(--primary-rgb)) !important;
     box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.25) !important;
}
.bet-input-group input::-webkit-outer-spin-button,
.bet-input-group input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bet-input-group input[type=number] { -moz-appearance: textfield; }

/* Quick Pick Buttons Container */
.quick-pick-buttons-container { /* Ensure buttons are wrapped in this div in HTML */
    display: flex; justify-content: center; gap: 0.75rem;
    width: 100%; margin-bottom: 1.5rem;
}
.quick-pick-btn {
    font-weight: 600; border-radius: 50rem; padding: 0.6rem 1.4rem;
    background-color: rgba(var(--border-rgb), 0.5); border: 1px solid transparent;
    color: rgb(var(--color-text-secondary-rgb));
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    flex-grow: 1; max-width: 80px;
}
.quick-pick-btn:hover {
     background-color: rgba(var(--primary-rgb), 0.2);
     color: rgb(var(--color-text-primary-rgb));
     border-color: rgba(var(--primary-rgb), 0.5);
}

/* Start Game Button */
#sps-play-button {
    font-size: 1.125rem; padding-top: 0.8rem; padding-bottom: 0.8rem;
    background-image: linear-gradient(to right, #9333ea, #3b82f6);
    border: none; color: white; width: 100%; margin-top: 1rem; /* Added width/margin */
    border-radius: 0.5rem; /* Add rounding if not using .btn base class */
}
#sps-play-button:hover {
     background-image: linear-gradient(to right, #7e22ce, #2563eb);
}
#sps-play-button:disabled { /* Style for disabled state */
    opacity: 0.6;
    cursor: not-allowed;
    background-image: linear-gradient(to right, #585858, #4a4a4a); /* Grey gradient */
}


/* --- Modal/Popup Styles --- */
.modal-overlay { /* Applied to #sps-popup-container */
    background-color: rgba(14, 15, 26, 0.85); /* Dark overlay */
    backdrop-filter: blur(4px);
    z-index: 10000;
}
.hidden-modal { /* Applied to #sps-popup-container initially */
    display: none !important;
}
#sps-popup-container {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; justify-content: center; align-items: center;
    opacity: 0; visibility: hidden;
    /* Animate opacity, delay hiding visibility */
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
    background-color: inherit; backdrop-filter: inherit; z-index: inherit;
}
#sps-popup-container.show {
    opacity: 1; visibility: visible;
    transition: opacity 0.3s ease, visibility 0s linear 0s; /* Show immediately */
}
/* Inner modal content */
#sps-popup-container #modalContent {
    max-width: 350px; width: 90%;
    background-color: white; color: #333; /* Light theme for modal content */
    border-radius: 1rem; padding: 2rem; text-align: center;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    transform: scale(0.95); opacity: 0; /* Start smaller and invisible */
    /* Bounce + fade transition */
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.2s ease-out;
}
#sps-popup-container.show #modalContent {
    transform: scale(1); opacity: 1; /* Animate in */
}
/* Modal text styles */
#sps-popup-container #sps-popup-title {
    font-size: 2.25rem; font-weight: 800; margin-bottom: 1rem;
}
#sps-popup-container #sps-popup-message {
     font-size: 1.125rem; margin-bottom: 1.5rem; color: #4b5563; /* text-gray-700 */
}
#sps-popup-container #coinChangeText {
    font-size: 1.5rem; font-weight: 700; margin-bottom: 1.5rem;
}
/* Modal icon */
#sps-popup-container .game-icon-large {
    margin-bottom: 1rem; background-color: transparent !important;
    /* Color set dynamically */
}
/* Modal button */
#sps-popup-button {
    width: 100%; padding-top: 0.75rem; padding-bottom: 0.75rem;
    background-color: #3b82f6; /* primary-blue */ color: white;
    font-weight: 700; border-radius: 0.5rem;
    transition: background-color 0.2s ease; border: none; cursor: pointer;
}
#sps-popup-button:hover { background-color: #2563eb; } /* darker blue */












