@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;700;800&display=swap');
@import 'toast.css';

:root {
    /* 
       Theme V2: "Deep Space Neon" 
       Darker backgrounds, higher contrast neons, floating elements.
    */

    /* Backgrounds */
    --bg-core: #050510;
    /* Almost black */
    --bg-deep: #0a0a1f;
    /* Deep blue/purpleish */

    /* Brand Colors */
    --primary-hue: 260;
    /* Purple */
    --accent-hue: 320;
    /* Pink/Magenta */

    --primary: hsl(var(--primary-hue), 80%, 65%);
    --primary-dark: hsl(var(--primary-hue), 80%, 45%);
    --accent: hsl(var(--accent-hue), 90%, 60%);

    /* Gradients */
    --grad-main: linear-gradient(135deg, var(--primary), var(--accent));
    --grad-hover: linear-gradient(135deg, hsl(var(--primary-hue), 90%, 75%), hsl(var(--accent-hue), 90%, 70%));

    /* Text */
    --text-white: #ffffff;
    --text-gray: #94a3b8;

    /* Glass Components */
    --glass-nav: rgba(10, 10, 31, 0.75);
    --glass-panel: rgba(20, 20, 45, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);

    /* Status */
    --success: #00f0b4;
    --danger: #ff2a6d;
    --warning: #ffcc00;

    /* Spacing */
    --nav-height: 80px;
}

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

body {
    background-color: var(--bg-core);
    /* No body gradient here to let particles shine, or very subtle one */
    background-image: radial-gradient(circle at 50% 0%, #1a1a40 0%, var(--bg-core) 60%);
    color: var(--text-white);
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    position: relative;
}

/* 
   PARTICLES 
   Positioned strictly behind content but visible against the dark background.
*/
#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    /* Base level */
    pointer-events: none;
    opacity: 0.6;
    /* Slight transparency to blend */
}

/* Main Wrapper to ensure content sits above particles */
.main-content-wrapper {
    position: relative;
    z-index: 10;
    /* Above particles */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* 
   ----------------
   FLOATING HEADER 
   ----------------
*/
.floating-nav {
    position: sticky;
    top: 20px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--glass-nav);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 12px 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: var(--grad-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-icon {
    font-size: 1.8rem;
    filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.4));
    -webkit-text-fill-color: initial;
    /* Don't clip emoji */
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Balance Pill */
.balance-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 16px;
    border-radius: 50px;
    font-weight: 600;
}

.currency {
    font-size: 1.2rem;
}

.amount {
    color: #fff;
    font-variant-numeric: tabular-nums;
}

/* User Menu */
.user-menu-group {
    display: flex;
    gap: 8px;
    padding-left: 20px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-gray);
    transition: 0.3s;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateY(-2px);
}

.user-link {
    width: auto;
    padding: 0 16px;
    gap: 8px;
}

.logout-btn:hover {
    background: rgba(255, 42, 109, 0.2);
    color: var(--danger);
}

.admin-link {
    color: var(--accent);
    background: rgba(236, 72, 153, 0.1);
}

/* 
   ----------------
   HERO / MAIN
   ----------------
*/
h1 {
    font-weight: 800;
    letter-spacing: -1px;
    color: #fff;
}

.text-gradient {
    background: var(--grad-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Glass Panels */
.glass-panel {
    background: var(--glass-panel);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    border-radius: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    padding: 40px;
}

/* 
   ----------------
   GAME CARDS
   ----------------
*/
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    padding: 40px 0;
}

.game-card {
    position: relative;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: 0.3s cubic-bezier(0.3, 0, 0.2, 1);
    overflow: hidden;
    cursor: pointer;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: radial-gradient(circle at 50% 0%, rgba(139, 92, 246, 0.15), transparent 70%);
    opacity: 0;
    transition: 0.3s;
}

.game-card:hover {
    transform: translateY(-8px);
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.4);
}

.game-card:hover::before {
    opacity: 1;
}

.game-icon {
    font-size: 3.5rem;
    margin-bottom: 20px;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s;
}

.game-card:hover .game-icon {
    transform: scale(1.1) rotate(5deg);
}

.game-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.game-desc {
    font-size: 0.9rem;
    color: var(--text-gray);
    margin-bottom: 24px;
    line-height: 1.5;
}

/* Buttons */
.play-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--grad-main);
    color: white;
    font-weight: 600;
    padding: 12px 28px;
    border-radius: 14px;
    transition: 0.3s;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
    border: none;
    font-size: 1rem;
    cursor: pointer;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.play-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.5);
    filter: brightness(1.1);
}

/* 
   ----------------
   FORMS & INPUTS 
   ----------------
*/
input,
select,
textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 14px 18px;
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    transition: 0.2s;
    outline: none;
}

input:focus {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
}

/* 
   ----------------
   ADMIN SPECIFIC 
   ----------------
*/
.admin-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.admin-nav .nav-item {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    font-size: 0.95rem;
}

.admin-nav .nav-item.active {
    background: var(--grad-main);
    color: #fff;
}

/* 
   ----------------
   FOOTER 
   ----------------
*/
footer {
    margin-top: auto;
    border-top: 1px solid var(--glass-border);
    padding: 30px 0;
    text-align: center;
    color: var(--text-gray);
    font-size: 0.85rem;
}

/* 
   ----------------
   TOAST OVERRIDES (if needed)
   ----------------
*/
.toast {
    background: rgba(10, 10, 31, 0.95) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6) !important;
}