/* --- VARIABLES & THEME (V4 LUXURY) --- */
:root {
    --bg-deep: #02040a;
    --bg-card: rgba(255, 255, 255, 0.03);
    --gold: #d4af37; /* Champagne Gold */
    --gold-glow: rgba(212, 175, 55, 0.4);
    --text-main: #ffffff;
    --text-mute: #94a3b8;
    --border: rgba(255, 255, 255, 0.08);
    --nav-glass: rgba(5, 5, 10, 0.85);
    --ease-lux: cubic-bezier(0.25, 1, 0.5, 1);
    --nav-mobile-height: 80px;
    --nav-width: 280px;
}

/* --- RESET & BASE --- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; outline: none; }

/* Custom Scrollbar (Elegant/Hidden) */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

body {
    margin: 0;
    background-color: var(--bg-deep);
    /* Subtle ambient light top center */
    background-image: radial-gradient(circle at 50% 0%, #151b2e 0%, var(--bg-deep) 60%);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    letter-spacing: 0.02em;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

h1,h2,h3,h4 { 
    font-family: 'Cinzel', serif; 
    margin: 0; 
    font-weight: 500; 
    color: var(--gold); 
    letter-spacing: 0.05em; 
}

button { cursor: pointer; user-select: none; font-family: 'Inter', sans-serif; }

/* --- TYPOGRAPHY UTILS --- */
.gold { color: var(--gold); }
.text-mute { color: var(--text-mute); font-weight: 300; font-size: 0.9rem; }
.hero-text { font-size: 3rem; text-transform: uppercase; background: linear-gradient(to bottom, #fff, #999); background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* --- LUXURY BUTTONS --- */
.btn-mega {
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 18px 32px;
    border-radius: 4px; /* Sharper corners */
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    transition: all 0.4s var(--ease-lux);
    position: relative;
    overflow: hidden;
    width: 100%;
    margin: 15px 0;
    display: flex; align-items: center; justify-content: center; gap: 15px;
}
.btn-mega::before {
    content: ''; position: absolute; top:0; left:0; width:100%; height:100%;
    background: var(--gold); opacity: 0; transition: opacity 0.4s; z-index: -1;
}
.btn-mega:hover { color: #000; box-shadow: 0 0 30px var(--gold-glow); }
.btn-mega:hover::before { opacity: 1; }
.btn-mega .material-icons-round { font-size: 1.2rem; }

.btn-gold-outline {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: 0.3s;
}
.btn-gold-outline:hover { border-color: var(--gold); color: var(--gold); }

/* --- LAYOUT --- */
#app {
    width: 100%;
    min-height: 100vh;
    padding-bottom: calc(var(--nav-mobile-height) + 20px);
    transition: 0.5s var(--ease-lux);
}

.view {
    display: none;
    padding: 30px 20px;
    max-width: 1200px;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s var(--ease-lux), transform 0.6s var(--ease-lux);
}
.view.active { display: block; opacity: 1; transform: translateY(0); }

/* --- HEADER (MOBILE) --- */
.app-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px;
    position: sticky; top: 0; z-index: 50;
    background: rgba(2, 4, 10, 0.8);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border);
}
.brand-logo { font-family: 'Cinzel'; font-size: 1.2rem; color: var(--gold); letter-spacing: 0.1em; }
.user-chip { 
    display: flex; align-items: center; gap: 10px; 
    border: 1px solid var(--border); padding: 5px 15px; border-radius: 50px; 
}
.user-chip img { height: 28px; width: 28px; border-radius: 50%; }

/* --- BOTTOM NAV (FLOATING GLASS) --- */
.bottom-nav {
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
    width: 90%; max-width: 400px;
    height: 70px;
    background: rgba(20, 20, 25, 0.6);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 35px;
    display: flex; justify-content: space-evenly; align-items: center;
    z-index: 100;
    box-shadow: 0 10px 40px -10px rgba(0,0,0,0.8);
}
.nav-item {
    background: none; border: none; color: var(--text-mute);
    display: flex; flex-direction: column; align-items: center;
    gap: 5px; transition: 0.3s; opacity: 0.6;
}
.nav-item.active { opacity: 1; color: var(--gold); }
.nav-item.active .material-icons-round { text-shadow: 0 0 15px var(--gold-glow); transform: translateY(-2px); }
.nav-item span { font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase; }

/* Desktop Elements Hidden */
.nav-logo, .nav-desktop-text { display: none; }

/* --- SECTIONS --- */

/* Landing (Elegant Layout) */
#view-landing.active { 
    display: flex; flex-direction: column; justify-content: center; align-items: center; 
    background: #02040a;
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: 2000;
    padding: 0; margin: 0;
}
/* --- PROFESSIONAL HEADER --- */
.landing-header {
    position: fixed; top: 0; left: 0; width: 100%;
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 5%;
    background: rgba(2, 4, 10, 0.6); 
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    z-index: 100;
}

.header-brand { display: flex; align-items: center; gap: 12px; }
.header-logo {
    height: 32px; width: 32px;
    border-radius: 50%; /* Perfect Circle */
    background: #fff; padding: 2px; /* White ring to separate logo */
    object-fit: contain;
}
.header-title {
    font-family: 'Cinzel', serif; font-weight: 700; color: #fff; font-size: 1.1rem; letter-spacing: 0.1em;
}

.landing-nav { display: flex; gap: 20px; align-items: center; }
.nav-link {
    background: none; border: none; color: #94a3b8; font-size: 0.9rem; font-weight: 500; cursor: pointer; transition: 0.2s;
    font-family: 'Inter', sans-serif;
}
.nav-link:hover { color: #fff; }

.btn-primary-sm {
    background: #fff; color: #000; border: none;
    padding: 8px 16px; border-radius: 6px; font-size: 0.85rem; font-weight: 600; cursor: pointer;
    transition: 0.2s; font-family: 'Inter', sans-serif;
}
.btn-primary-sm:hover { background: #e2e8f0; }

/* --- HERO SECTION --- */
.landing-content {
    max-width: 1200px; width: 100%; z-index: 1;
    display: flex; flex-direction: column; align-items: center;
    margin-top: 120px;
    padding: 0 20px 100px;
}

.hero { 
    text-align: center; max-width: 900px; 
    display: flex; flex-direction: column; align-items: center; gap: 24px;
}

.hero-badge {
    background: rgba(255, 255, 255, 0.05); color: var(--gold); border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 14px; border-radius: 20px; font-size: 0.75rem; letter-spacing: 0.05em; font-weight: 600;
}

.hero-title { 
    font-size: clamp(3rem, 6vw, 5rem); 
    line-height: 1.05; letter-spacing: -0.02em;
    font-weight: 700; color: #fff; margin: 0;
    font-family: 'Inter', sans-serif; /* Modern Base */
}
.gold-gradient {
    background: linear-gradient(135deg, #fceabb 0%, #f8b500 50%, #fceabb 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    font-family: 'Cinzel', serif; /* Luxury Accent */
}

.hero-desc {
    font-size: 1.15rem; color: #94a3b8; line-height: 1.6; max-width: 580px; font-weight: 400;
}

/* Actions */
.hero-actions { display: flex; gap: 12px; margin-top: 10px; }
.btn-primary {
    background: #fff; color: #000; border: none; padding: 14px 32px;
    border-radius: 6px; font-weight: 600; font-size: 1rem; cursor: pointer;
    transition: 0.2s;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 20px -5px rgba(255,255,255,0.2); }

.btn-secondary {
    background: rgba(0,0,0,0.3); color: #fff; border: 1px solid rgba(255,255,255,0.15);
    padding: 14px 32px; border-radius: 6px; font-weight: 600; font-size: 1rem; cursor: pointer;
    transition: 0.2s;
}
.btn-secondary:hover { border-color: #fff; background: rgba(255,255,255,0.05); }

/* Landing Background - Royal Depth */
#view-landing.active {
    background: radial-gradient(circle at 50% 30%, #1a1e2e 0%, #000000 100%);
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    overflow-y: auto; text-align: center;
}
/* Ambient Light Orb */
#view-landing.active::before {
    content: ''; position: fixed; top: -50%; left: 50%; transform: translateX(-50%);
    width: 80%; height: 80%; background: radial-gradient(circle, rgba(60, 100, 255, 0.15), transparent 70%);
    z-index: 0; pointer-events: none;
}

/* WIDE ANALYTICS DASHBOARD - HIGH CONTRAST */
.hero-mockup-wide {
    margin-top: 50px;
    perspective: 1200px;
    width: 100%; max-width: 900px;
    animation: floatGentle 8s ease-in-out infinite;
    z-index: 5; position: relative;
    padding-bottom: 50px;
}
@keyframes floatGentle { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-15px); } }

.glass-dashboard {
    /* Frosted Glass + Gold Tint */
    background: linear-gradient(145deg, rgba(255,255,255,0.1), rgba(255,255,255,0.02));
    border: 1px solid rgba(255,255,255,0.2);
    border-top: 1px solid rgba(255,255,255,0.5); /* Catch light */
    border-radius: 16px;
    backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px);
    box-shadow: 
        0 30px 60px -10px rgba(0,0,0,0.8), /* Deep Drop Shadow */
        inset 0 0 50px rgba(255,255,255,0.02); /* Inner Glow */
    overflow: hidden;
    position: relative;
    transform: rotateX(5deg);
}

/* Dashboard Internals - Brighter */
.gd-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 25px; border-bottom: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.03);
}
.gd-dots { display: flex; gap: 8px; }
.gd-dots span { width: 12px; height: 12px; border-radius: 50%; background: rgba(255,255,255,0.2); box-shadow: 0 0 10px rgba(255,255,255,0.1); }
.gd-title { font-size: 0.8rem; color: #cbd5e1; letter-spacing: 0.15em; text-transform: uppercase; font-weight: 700; }

.gd-content { display: flex; height: 350px; }
.gd-sidebar {
    width: 70px; border-right: 1px solid rgba(255,255,255,0.1);
    display: flex; flex-direction: column; gap: 20px; padding: 25px 0; align-items: center;
    background: rgba(0,0,0,0.2);
}
.gd-line { width: 30px; height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; }
.gd-line.short { width: 15px; }

.gd-main { flex: 1; padding: 25px; display: flex; flex-direction: column; justify-content: space-between; }

/* Dashboard List Mockup */
.gd-list-container { flex: 1; display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.gd-list-item { 
    display: flex; align-items: center; gap: 12px; 
    padding: 10px; border-radius: 8px; background: rgba(255,255,255,0.03); 
    border: 1px solid rgba(255,255,255,0.05);
}
.gd-l-avatar { width: 32px; height: 32px; border-radius: 50%; background: #334155; }
.gd-l-info { flex: 1; text-align: left; }
.gd-l-name { font-size: 0.8rem; color: #fff; font-weight: 600; }
.gd-l-sub { font-size: 0.65rem; color: #64748b; }
.gd-l-score { font-size: 0.9rem; color: #4ade80; font-weight: 700; }
.gd-l-score.text-mute { color: #94a3b8; }

.gd-stats-row { display: flex; gap: 50px; }
.gd-stat label { display: block; font-size: 0.75rem; color: #94a3b8; font-weight: 700; margin-bottom: 8px; letter-spacing: 0.05em; }
.gd-stat .val { font-size: 1.8rem; color: #fff; font-weight: 600; font-variant-numeric: tabular-nums; text-shadow: 0 0 20px rgba(255,255,255,0.3); }
.gd-stat .val.text-green { color: #4ade80; text-shadow: 0 0 20px rgba(74, 222, 128, 0.4); }

/* Mockup */
.hero-mockup {
    margin-top: 50px;
    perspective: 1200px;
    animation: floatSlow 6s ease-in-out infinite;
}
@keyframes floatSlow { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-15px); } }

.mockup-card {
    width: 320px; background: rgba(10, 10, 12, 0.6);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 24px; padding: 24px;
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.8), inset 0 0 0 1px rgba(255,255,255,0.05);
    transform: rotateX(10deg);
}
.mock-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.mock-avatar { width: 44px; height: 44px; border-radius: 50%; background: #222; border: 1px solid #333; }
.mock-user { flex: 1; }
.mock-name { color: #fff; font-weight: 600; font-size: 0.95rem; }
.mock-rank { color: var(--gold); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em; margin-top: 2px; }

.mock-stats { display: flex; justify-content: space-between; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.08); }
.m-stat { text-align: center; }
.m-stat span { display: block; font-size: 0.7rem; color: #64748b; font-weight: 600; margin-bottom: 4px; }
.m-stat strong { display: block; font-size: 1.1rem; color: #f8fafc; font-weight: 600; }

/* Features */
.landing-features {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; width: 100%; margin-top: 60px;
}
@media (max-width: 768px) {
    .landing-features { grid-template-columns: 1fr; }
    .hero-title { font-size: 2.8rem; }
}
.feature-item {
    padding: 24px; border: 1px solid rgba(255,255,255,0.05); border-radius: 12px; background: rgba(255,255,255,0.01);
    transition: 0.3s;
}
.feature-item:hover { border-color: rgba(255,255,255,0.1); background: rgba(255,255,255,0.02); }
.feature-item h3 { font-size: 0.95rem; color: #fff; margin: 0 0 8px; font-weight: 600; }
.feature-item p { color: #94a3b8; font-size: 0.9rem; line-height: 1.5; margin: 0; }
.dashboard-grid { display: grid; grid-template-columns: 1fr; gap: 20px; margin-top: 30px; }
.dash-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 30px;
    border-radius: 8px; /* Subtle rounding */
    position: relative; overflow: hidden;
    transition: 0.4s var(--ease-lux);
}
.dash-card::after {
    content: ''; position: absolute; top:0; left:0; right:0; height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0.3;
}
.dash-card:hover { border-color: rgba(212, 175, 55, 0.3); transform: translateY(-5px); box-shadow: 0 20px 40px -10px rgba(0,0,0,0.5); }

.stat-item .val { font-size: 2.5rem; font-weight: 300; color: #fff; margin-top: 5px; }
.stat-item label { color: var(--gold); font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase; }

/* Game Table - Restored Glass Style */
.game-header h2 { font-size: 1.5rem; margin-bottom: 20px; border-bottom: 1px solid var(--border); display: inline-block; padding-bottom: 10px; }
.game-board { 
    background: rgba(30, 35, 45, 0.6); /* Restored Dark Glass */
    backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255,255,255,0.1); 
    border-radius: 16px; overflow: hidden; 
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    margin-top: 10px;
}
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th { 
    background: rgba(255,255,255,0.03); 
    color: #94a3b8; font-size: 0.75rem; padding: 15px; 
    text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; 
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
td { padding: 12px; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.05); color: #fff; font-variant-numeric: tabular-nums; }
.round-inp {
    background: rgba(0,0,0,0.3); /* Visible Input Box */
    border: 1px solid rgba(255,255,255,0.1); border-radius: 4px;
    color: #fff; text-align: center; font-size: 1.1rem; padding: 8px; width: 60px;
    font-family: 'Inter'; font-weight: 500; transition: 0.2s;
}
.round-inp:focus { 
    border-color: var(--gold); background: rgba(0,0,0,0.5); 
    box-shadow: 0 0 10px rgba(212,175,55,0.2);
    outline: none;
}

/* FAB */
.fab-btn {
    position: fixed; bottom: 100px; right: 20px;
    width: 60px; height: 60px;
    border-radius: 50%;
    background: #000; border: 1px solid var(--gold);
    color: var(--gold); display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 20px var(--gold-glow); z-index: 90;
}

/* History */
.history-item { margin-bottom: 15px; border: 1px solid var(--border); background: rgba(255,255,255,0.01); transition: 0.3s; }
.history-item:hover { border-color: var(--gold); background: rgba(212, 175, 55, 0.05); }

/* Profile */
.avatar-xl { border: 2px solid var(--border); padding: 5px; }

/* --- GAME SETUP VIEW --- */
#gameSetup {
    background: rgba(30,35,45,0.6); backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255,255,255,0.1); border-radius: 16px;
    padding: 40px; width: 100%; max-width: 500px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.6);
    display: flex; flex-direction: column; gap: 20px;
}
#gameSetup h3 { 
    color: #fff; font-family: 'Cinzel', serif; font-size: 1.5rem; text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 20px; margin: 0;
}

.setup-form { display: flex; flex-direction: column; gap: 20px; }
.setup-form input {
    background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.15);
    color: #fff; padding: 15px; border-radius: 8px; font-size: 1rem; outline: none; transition: 0.3s;
    font-family: 'Inter', sans-serif;
}
.setup-form input:focus { border-color: var(--gold); background: rgba(0,0,0,0.5); box-shadow: 0 0 15px rgba(212,175,55,0.2); }

.player-adder { display: flex; gap: 10px; }
.player-adder input { flex: 1; }
.player-adder button {
    background: var(--gold); color: #000; border: none; width: 50px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.2s;
}
.player-adder button:hover { transform: scale(1.05); box-shadow: 0 0 15px var(--gold-glow); }

.chips-container { display: flex; flex-wrap: wrap; gap: 10px; min-height: 50px; }
.chip { 
    background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.1); 
    padding: 8px 12px; border-radius: 20px; font-size: 0.85rem; color: #fff; display: flex; align-items: center; gap: 8px;
}
.chip span { cursor: pointer; color: #ff4757; font-weight: bold; }

#startGameBtn {
    background: linear-gradient(135deg, var(--gold), #b8860b);
    color: #000; font-weight: 700; padding: 15px; border-radius: 8px; border: none;
    font-size: 1.1rem; letter-spacing: 0.1em; cursor: pointer; margin-top: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: 0.3s;
}
#startGameBtn:hover { transform: translateY(-2px); box-shadow: 0 15px 40px rgba(212, 175, 55, 0.4); }

/* --- ACTIVE GAME UI --- */
.status-strip {
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(0,0,0,0.4); border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 15px 25px; margin-bottom: 20px; border-radius: 12px;
}
.status-strip .info { display: flex; flex-direction: column; }
.status-strip small { color: #94a3b8; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.1em; }
.status-strip span.gold { color: var(--gold); font-size: 1.4rem; font-weight: 700; line-height: 1; }

.timer { 
    font-family: 'Cinzel', monospace; font-size: 2rem; color: #fff; 
    text-shadow: 0 0 20px rgba(255,255,255,0.3); font-variant-numeric: tabular-nums; 
}
/* Clean/Immersive Game Header */
.game-controls-minimal {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 0; margin-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.btn-text-danger {
    background: rgba(255, 71, 87, 0.1); border: 1px solid rgba(255, 71, 87, 0.2); 
    color: #ff4757; padding: 8px 16px; border-radius: 6px;
    font-size: 0.8rem; font-weight: 600; letter-spacing: 0.05em; cursor: pointer;
    display: flex; align-items: center; gap: 8px; transition: 0.2s;
}
.btn-text-danger::before { content: '←'; font-size: 1.1em; }
.btn-text-danger:hover { background: rgba(255, 71, 87, 0.2); transform: translateX(-2px); }

.target-display { 
    background: rgba(212, 175, 55, 0.1); border: 1px solid rgba(212, 175, 55, 0.2);
    padding: 8px 16px; border-radius: 6px;
    font-size: 0.85rem; color: var(--gold); font-weight: 700; letter-spacing: 0.1em; 
}

/* Ensure Game View has space when nav is hidden */
#view-game { padding-bottom: 40px; }
