:root {
    --bg-color: #090a0f;
    --panel-bg: rgba(15, 12, 41, 0.7);
    --panel-border: rgba(168, 85, 247, 0.3);
    --accent-primary: #a855f7; /* Electric Violet */
    --accent-secondary: #6366f1; /* Indigo */
    --accent-cyan: #6366f1; /* Mapping old cyan to Indigo for compatibility */
    --text-primary: #ffffff;
    --text-secondary: #e2e8f0;
    --correct-bg: rgba(168, 85, 247, 0.8);
    --accent-teal: #2dd4bf; /* Teal 400 */
    --accent-cyan: #22d3ee; /* Cyan 400 */
    --font-main: 'Outfit', sans-serif;
}

.badge-soon {
    display: inline-block;
    padding: 4px 8px;
    background: rgba(168, 85, 247, 0.2);
    border: 1px solid var(--accent-primary);
    border-radius: 4px;
    color: var(--accent-primary);
    font-size: 0.6rem;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

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

html, body {
    overflow-x: hidden;
    width: 100%;
}

body {
    background-color: var(--bg-color);
    font-family: var(--font-main);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    /* Premium Indigo/Violet Gradient */
    background: radial-gradient(circle at top right, #1e1b4b, #090a0f);
}

/* Specific class for Admin/Login pages to allow scrolling */
body.scrollable {
    height: auto !important;
    overflow: auto !important;
    align-items: flex-start !important;
    overflow-x: hidden;
}

/* Ensure 9:16 aspect ratio constraint */
.vertical-container {
    width: 100%;
    max-width: 450px;
    height: 100%;
    max-height: 800px;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 0 30px rgba(0,0,0,0.8);
    border: 1px solid rgba(255,255,255,0.1);
    overflow: hidden;
}

/* Glass panel utility */
.glass-panel {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* --- Control Panel (Header) --- */
.control-panel {
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.6);
    border-bottom: 1px solid var(--panel-border);
    z-index: 100;
}

.header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 10px;
}

.header-inputs {
    display: flex;
    gap: 8px;
    flex: 1;
    justify-content: flex-end;
}

.header-inputs input[type="text"] {
    max-width: 120px;
    padding: 6px 10px;
    font-size: 0.85rem;
}

/* Removed game-mode-select styles */


.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #ff3b3b;
    box-shadow: 0 0 5px rgba(255, 59, 59, 0.5);
}

.status-dot.online {
    background-color: #00ff00;
    box-shadow: 0 0 10px #00ff00;
}

/* --- Brand Header --- */
.brand-header {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: transform 0.2s;
}

.brand-header:hover {
    transform: scale(1.02);
}

.header-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
    filter: drop-shadow(0 0 5px var(--accent-cyan));
}

.brand-text {
    font-size: 1.1rem;
    font-weight: 800;
    color: white;
    letter-spacing: -0.5px;
}

.brand-text span {
    color: var(--accent-cyan);
    font-weight: 400;
}

.controls {
    display: flex;
    gap: 8px;
}

input[type="text"] {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--panel-border);
    background: rgba(255,255,255,0.05);
    color: white;
    font-family: inherit;
    outline: none;
    transition: border 0.3s;
}

input[type="text"]:focus {
    border-color: var(--accent-cyan);
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: var(--accent-teal);
    color: var(--bg-color);
    font-family: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-transform: uppercase;
    letter-spacing: 1px;
}

button:hover {
    background: var(--accent-cyan);
    transform: scale(1.05);
}

#start-game-btn {
    background: var(--accent-primary);
    color: white;
    font-size: 1.1em;
}
#start-game-btn:hover {
    background: #6200ea;
    box-shadow: 0 0 15px var(--accent-primary);
}

.btn-connect-header {
    background: var(--accent-primary) !important;
    color: white !important;
    font-size: 0.8rem !important;
    padding: 8px 16px !important;
    border-radius: 20px !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.4);
}

.btn-connect-header:hover {
    background: var(--accent-secondary) !important;
    transform: scale(1.05);
}


/* --- Floating Side Controls --- */
.sidebar-controls {
    position: absolute;
    left: 12px;
    top: 60px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1000;
}

.sidebar-controls button {
    width: 38px;
    height: 38px;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    color: white;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.sidebar-controls button:hover {
    transform: scale(1.15) translateX(5px);
    background: var(--accent-teal);
    border-color: var(--accent-cyan);
    color: var(--bg-color);
}

.sidebar-controls button.active {
    background: #ff007f;
    border-color: #ff4da6;
    box-shadow: 0 0 15px #ff007f;
}

.hidden {
    display: none !important;
}

/* --- Main Game Area --- */
.game-area {
    flex: none;
    padding: 0 5px 5px 5px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    position: relative;
    /* Removed overflow-y: auto to prevent internal scrollbar */
}

/* Removed question-container and options-grid styles */


/* Timer styles removed */
.solved-banner {
    font-size: 1.5rem;
    font-weight: 800;
    color: #4CAF50;
    margin-bottom: 10px;
    animation: fadeIn 0.5s ease-in;
}

.ws-btn-next {
    background: #4CAF50 !important;
    padding: 12px 30px !important;
    font-size: 1.1rem !important;
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.4);
}

.ws-btn-next:hover {
    background: #45a049 !important;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.6);
}

/* --- Leaderboard --- */
.leaderboard-section {
    flex: 1;
    min-height: 120px;
    background: linear-gradient(to top, #0b0c10, rgba(11,12,16,0));
    padding: 10px 20px 5px 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.game-footer-brand {
    text-align: center;
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 4px;
}

.game-footer-brand span {
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.game-footer-brand strong {
    color: var(--accent-cyan);
}

.leaderboard-section h3 {
    margin: 0;
    color: var(--accent-cyan);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 1.1rem;
}

.lb-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.btn-mini-action {
    background: rgba(168, 85, 247, 0.2);
    border: 1px solid var(--accent-primary);
    color: var(--accent-teal);
    font-size: 0.65rem;
    padding: 4px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    font-weight: 800;
}


.leaderboard-list {
    flex: 1;
    overflow: visible; /* Allow glow and scale to bleed outside without clipping */
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 5px; /* Side padding to contain the scale */
    transition: all 0.3s ease;
}

/* First place highlight */
.lb-item.first-place {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.2), rgba(139, 92, 246, 0.15)) !important;
    border: 1px solid rgba(255, 215, 0, 0.45);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
    margin-bottom: 8px;
    transform: scale(1.05); /* Slightly bigger scale */
    transform-origin: center;
    z-index: 2; /* Keep it on top of other glows */
}

.lb-item.first-place .lb-pic {
    border: 2px solid #FFD700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.lb-item.first-place .lb-name {
    font-weight: 800;
    color: #FFD700;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
}

.lb-item.first-place .lb-rank {
    font-size: 1.3rem;
    filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.6));
}


/* Scaling Tier: Mid/Compact (REVERTED TO SINGLE COLUMN AS PER USER REQUEST) */
.leaderboard-list.mid-scale, 
.leaderboard-list.compact-scale {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.leaderboard-list.mid-scale .lb-item,
.leaderboard-list.compact-scale .lb-item {
    padding: 3px 10px 3px 3px;
    border-radius: 50px; /* Back to pill shape */
}

.leaderboard-list.mid-scale .lb-pic,
.leaderboard-list.compact-scale .lb-pic {
    width: 32px;
    height: 32px;
    margin-right: 12px;
}

.leaderboard-list.mid-scale .lb-name,
.leaderboard-list.compact-scale .lb-name {
    font-size: 0.9rem;
}

.leaderboard-list.mid-scale .lb-score,
.leaderboard-list.compact-scale .lb-score {
    font-size: 1rem;
}


.leaderboard-list.mid-scale .lb-item,
.leaderboard-list.compact-scale .lb-item {
    padding: 3px 10px 3px 3px;
    border-radius: 6px;
}

.leaderboard-list.mid-scale .lb-pic,
.leaderboard-list.compact-scale .lb-pic {
    width: 28px;
    height: 28px;
}

.leaderboard-list.mid-scale .lb-name,
.leaderboard-list.compact-scale .lb-name {
    font-size: 0.8rem;
}

.leaderboard-list.mid-scale .lb-score,
.leaderboard-list.compact-scale .lb-score {
    font-size: 0.9rem;
}

.lb-item {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50px;
    padding: 3px 12px 3px 3px; /* More compact by default */
    animation: fadeIn 0.3s ease-out;
    transition: all 0.2s ease;
    flex-shrink: 0;
    min-width: 0;
    width: 96%; /* Leave room for scale/glow */
    margin: 0 auto;
}

.lb-item:not(.first-place) {
    opacity: 0.85;
    transform: scale(0.92); /* Smaller contrast */
}

.lb-item:not(.first-place) .lb-pic {
    width: 28px;
    height: 28px;
}

.lb-item:not(.first-place) .lb-name {
    font-size: 0.8rem;
}

.lb-item:not(.first-place) .lb-score {
    font-size: 0.85rem;
}

.lb-rank {
    font-weight: 800;
    color: var(--text-secondary);
    width: 25px;
    text-align: center;
}
.lb-pic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-teal);
    margin-right: 12px;
}
.lb-name {
    flex: 1;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lb-score {
    font-weight: 800;
    color: var(--accent-cyan);
    font-size: 1.1rem;
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    opacity: 0.7;
    margin-top: 20px;
}

/* Animations */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (min-width: 451px) {
    .vertical-container {
        border-radius: 20px;
    }
}

/* --- Chat Feed Styles --- */
.chat-feed {
    width: 100%;
    margin-top: 10px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 10px;
    height: 120px;
    display: flex;
    flex-direction: column;
}

.chat-title {
    font-size: 0.8rem;
    color: var(--accent-teal);
    text-transform: uppercase;
    margin-bottom: 5px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 5px;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}
.chat-messages::-webkit-scrollbar-thumb {
    background-color: var(--accent-teal);
    border-radius: 10px;
}
.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 5px;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-teal) transparent;
}

.chat-msg {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: rgba(255,255,255,0.05);
    padding: 5px;
    border-radius: 8px;
    font-size: 0.9rem;
    animation: slideUp 0.3s ease-out;
}

.chat-pic {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    object-fit: cover;
}

.chat-user {
    font-weight: bold;
    color: var(--accent-cyan);
}

.chat-text {
    flex: 1;
    word-break: break-all;
}

/* --- WordCraftLive Styles --- */

/* Removed legacy game-mode-select background styles */


#wordcraftlive-container {
    width: 100%;
    padding: 20px 10px;
    text-align: center;
    animation: slideUp 0.5s ease-out;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.letters-wheel {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 20px auto 40px auto;
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(168, 85, 247, 0.05);
    box-shadow: inset 0 0 30px rgba(168, 85, 247, 0.1);
}

.letters-wheel.shuffling {
    animation: wheelShuffle 0.6s cubic-bezier(0.45, 0.05, 0.55, 0.95);
}

.wheel-letter {
    position: absolute;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), inset 0 0 10px rgba(255, 255, 255, 0.2);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    user-select: none;
}

@keyframes wheelShuffle {
    0% { transform: rotate(0deg) scale(1); }
    40% { transform: rotate(180deg) scale(0.8); opacity: 0.7; }
    100% { transform: rotate(360deg) scale(1); opacity: 1; }
}

.words-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    width: 100%;
}

.words-grid.two-columns {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 6px 4px;
    justify-items: center;
    align-items: start;
}

.ws-word-row {
    display: flex;
    gap: 5px;
    justify-content: center;
    align-items: center;
}

.ws-letter-tile {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.3); /* Brighter for visibility */
    border: 2px solid rgba(255, 255, 255, 0.7); /* Sharp white border */
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 800;
    color: transparent; /* hidden until guessed */
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.ws-letter-tile.revealed {
    background: var(--correct-bg);
    border-color: #4CAF50;
    color: white;
    transform: scale(1.1) rotateY(360deg);
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.6);
}

.ws-solver-pic {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-left: 6px;
    border: 1px solid var(--accent-cyan);
    animation: fadeIn 0.5s ease-out;
}

/* --- Floating Notifications --- */
.floating-score-container {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1000;
    pointer-events: none;
    transform: translate(-50%, -50%);
    animation: floatingNotif 2.5s ease-out forwards;
    filter: drop-shadow(0 0 10px rgba(0,0,0,0.8));
}

.floating-pic {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 5px solid #00ff88;
    box-shadow: 0 0 25px #00ff88;
    object-fit: cover;
}

.floating-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.floating-username {
    color: white;
    font-weight: 800;
    font-size: 1.8rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
    margin-bottom: -8px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.floating-points {
    color: #00ff88;
    font-weight: 900;
    font-size: 4rem;
    text-shadow: 0 0 15px rgba(0, 255, 136, 0.5);
}

@keyframes floatingNotif {
    0% { transform: translate(-50%, -50%) translateY(0) scale(0.5); opacity: 0; }
    15% { transform: translate(-50%, -50%) translateY(-100px) scale(1.3); opacity: 1; }
    85% { transform: translate(-50%, -50%) translateY(-400px) scale(1.1); opacity: 1; }
    100% { transform: translate(-50%, -50%) translateY(-500px) scale(0.9); opacity: 0; }
}


/* --- Admin Dashboard Styles --- */
.admin-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 20px;
    animation: fadeIn 0.5s ease-out;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.puzzle-form {
    display: grid;
    gap: 20px;
    margin-bottom: 50px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.4);
    position: relative;
    z-index: 10;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    visibility: visible !important;
    opacity: 1 !important;
}

.form-group label {
    font-size: 0.95rem;
    color: var(--accent-teal);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-group input {
    padding: 14px;
    border-radius: 10px;
    border: 1px solid var(--panel-border);
    background: rgba(0, 0, 0, 0.2);
    color: white;
    font-size: 1rem;
    transition: all 0.3s;
}

.form-group input:focus {
    border-color: var(--accent-cyan);
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
    outline: none;
}

.puzzles-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.puzzle-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.puzzle-item:hover {
    transform: translateX(8px);
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-cyan);
    box-shadow: 0 5px 20px rgba(0, 243, 255, 0.15);
}

.puzzle-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.puzzle-base-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.puzzle-base-tiles {
    display: flex;
    gap: 4px;
}

.puzzle-tile-mini {
    width: 28px;
    height: 28px;
    background: var(--accent-cyan);
    color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 4px;
    font-weight: 800;
    font-size: 0.9rem;
    text-shadow: none;
}

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-global {
    background: rgba(0, 243, 255, 0.15);
    color: var(--accent-cyan);
    border: 1px solid var(--accent-cyan);
}

.badge-pending {
    background: rgba(255, 159, 67, 0.2);
    color: #ff9f43;
    border: 1px solid #ff9f43;
}

.puzzle-words {
    font-size: 1.1rem;
    color: #ffffff;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-top: 5px;
}

.btn-delete {
    background: rgba(255, 77, 77, 0.15);
    color: #ff4d4d;
    border: 1px solid #ff4d4d;
    padding: 10px 18px;
    font-size: 0.85rem;
    border-radius: 8px;
    transition: all 0.3s;
    width: auto;
}

.btn-delete:hover {
    background: #ff4d4d;
    color: white;
    box-shadow: 0 0 20px rgba(255, 77, 77, 0.4);
}

.btn-connect-header {
    background: var(--accent-teal);
    color: var(--bg-color);
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 800;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 0 15px rgba(69, 162, 158, 0.3);
}

.btn-connect-header:hover {
    background: var(--accent-cyan);
    box-shadow: 0 0 20px var(--accent-cyan);
    transform: translateY(-2px);
}

/* Global Leaderboard Components */
.leaderboard-toggle-container {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 30px;
    animation: fadeIn 1s ease-out;
}

.lb-toggle-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 10px 24px;
    border-radius: 50px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lb-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.lb-toggle-btn.active {
    background: linear-gradient(45deg, #4facfe, #00f2fe);
    color: #0b0c10;
    border-color: transparent;
    box-shadow: 0 10px 25px rgba(79, 172, 254, 0.4);
}

.level-badge-inline {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 900;
    border: 1px solid rgba(168, 85, 247, 0.3);
    margin-left: 8px;
}

.global-leaderboard-container {
    max-width: 800px;
    margin: 40px auto;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.global-player-row {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.global-player-row:last-child {
    border-bottom: none;
}

.global-player-row:hover {
    background: rgba(255, 255, 255, 0.03);
    transform: translateX(5px);
}

.player-rank {
    font-size: 1.2rem;
    font-weight: 800;
    width: 40px;
    color: var(--accent-color);
}

.player-pfp {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin: 0 16px;
    border: 2px solid var(--accent-color);
}

.player-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.player-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.player-handle {
    font-size: 0.85rem;
    opacity: 0.5;
}

.player-score {
    font-weight: 800;
    color: #ffd700;
    font-size: 1.1rem;
}

/* Admin Season Toggle & Super Admin */
.season-toggle {
    display: flex;
    background: rgba(0,0,0,0.2);
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.toggle-btn {
    flex: 1;
    padding: 8px;
    border: none;
    background: none;
    color: white;
    cursor: pointer;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s;
}

.toggle-btn.active {
    background: var(--primary-gradient);
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

.super-admin-card {
    background: rgba(255, 50, 50, 0.05);
    border: 1px solid rgba(255, 50, 50, 0.2);
    border-radius: 16px;
    padding: 20px;
    margin-top: 30px;
}

.user-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.user-table th, .user-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.status-badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: bold;
}

.status-verified { background: rgba(0, 255, 0, 0.1); color: #00ff00; }
.status-pending { background: rgba(255, 165, 0, 0.1); color: #ffa500; }

/* --- Landing Page Specific Styles --- */

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

.landing-body {
    background: radial-gradient(circle at top right, #1a1a2e, #0b0c10);
    display: block !important; /* Force block to stop global flexbox */
    height: auto !important;
    min-height: 0 !important;
    align-items: stretch !important;
    overflow-x: hidden;
}

.landing-nav {
    position: sticky;
    top: 0;
    width: 100%;
    padding: 15px 0; /* padding handled by container inside */
    background: rgba(11, 12, 16, 0.85);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--panel-border);
    z-index: 1000;
}

.landing-nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent-cyan);
    text-decoration: none;
    letter-spacing: -1px;
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.mobile-menu-btn span {
    width: 100%;
    height: 3px;
    background-color: var(--accent-cyan);
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
    font-size: 0.95rem;
}

.nav-links a:hover {
    color: var(--accent-cyan);
}

.hero-section {
    padding: 120px 0 80px 0;
    text-align: center;
    position: relative;
    width: 100%;
}

.hero-content {
    max-width: 900px;
    margin: 0 auto;
    animation: fadeIn 1s ease-out;
}

.hero-content h1 {
    font-size: clamp(2.5rem, 8vw, 4.5rem); /* Responsive fluid typography */
    font-weight: 800;
    margin-bottom: 24px;
    line-height: 1.05;
    background: linear-gradient(45deg, #00f2fe, #4facfe, #00f2fe);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientFlow 3s linear infinite;
}

@keyframes gradientFlow {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

.hero-content p {
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    color: var(--text-secondary);
    margin-bottom: 48px;
    line-height: 1.6;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-cta {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-image-wrapper {
    margin-top: 80px;
    position: relative;
    width: 100%;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}

.hero-image-wrapper img {
    width: 100%;
    height: auto;
    border-radius: 24px;
    box-shadow: 0 40px 100px rgba(0,0,0,0.7), 0 0 40px rgba(168, 85, 247, 0.2);
    border: 1px solid rgba(255,255,255,0.1);
    animation: heroFloat 6s ease-in-out infinite;
}

@keyframes heroFloat {
    0%, 100% { transform: translateY(0) rotateX(0); }
    50% { transform: translateY(-15px) rotateX(2deg); }
}

.btn-primary {
    padding: 18px 36px;
    font-size: 1.1rem;
    background: linear-gradient(45deg, #4facfe, #00f2fe);
    color: #0b0c10 !important;
    border-radius: 100px;
    text-decoration: none;
    font-weight: 800;
    box-shadow: 0 15px 35px rgba(79, 172, 254, 0.4);
    transition: transform 0.3s, box-shadow 0.3s;
    white-space: nowrap;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 45px rgba(79, 172, 254, 0.5);
}

.btn-secondary {
    padding: 18px 36px;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.05);
    color: white !important;
    border: 1px solid var(--panel-border);
    border-radius: 100px;
    text-decoration: none;
    font-weight: 800;
    transition: background 0.3s;
    white-space: nowrap;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-portal {
    background: var(--accent-teal) !important;
    color: var(--bg-color) !important;
    border-radius: 100px;
}

.features-section {
    padding: 100px 0;
    width: 100%;
}

.section-title {
    text-align: center;
    margin-bottom: 80px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.section-title h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 16px;
    color: var(--text-primary);
    line-height: 1.2;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 32px;
}

.feature-card {
    padding: 48px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 32px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: left;
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-12px);
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-cyan);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 24px;
    display: block;
}

.feature-card h3 {
    font-size: 1.6rem;
    margin-bottom: 16px;
    color: var(--accent-cyan);
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 1.05rem;
}

.engagement-block {
    display: flex;
    align-items: center;
    gap: 60px;
    padding: 80px;
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.08), rgba(0, 242, 254, 0.08));
    border-radius: 40px;
    border: 1px solid rgba(255,255,255,0.05);
}

.engagement-content {
    flex: 1;
}

.engagement-image {
    flex: 1;
}

.engagement-image img {
    width: 100%;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}

.pricing-section {
    padding: 100px 0;
    width: 100%;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 32px;
    max-width: 1100px;
    margin: 0 auto;
}

.pricing-card {
    padding: 60px 48px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.pricing-card.popular {
    border-color: var(--accent-cyan);
    background: rgba(102, 252, 241, 0.04);
    transform: scale(1.05);
    z-index: 10;
}

.popular-badge {
    position: absolute;
    top: 25px;
    right: -45px;
    background: var(--accent-cyan);
    color: #0b0c10;
    padding: 6px 0;
    width: 170px;
    transform: rotate(45deg);
    font-size: 0.7rem;
    font-weight: 900;
    text-align: center;
    box-shadow: 0 5px 10px rgba(0,0,0,0.3);
}

.price {
    font-size: clamp(3rem, 5vw, 4rem);
    font-weight: 800;
    margin: 24px 0;
    color: white;
}

.price span {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.pricing-features {
    list-style: none;
    margin: 32px 0;
    text-align: left;
    flex-grow: 1;
}

.pricing-features li {
    margin-bottom: 16px;
    color: var(--text-secondary);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 1rem;
}

.pricing-features li::before {
    content: "✓";
    color: var(--accent-cyan);
    font-weight: 900;
}

.landing-footer {
    padding: 80px 0;
    background: rgba(0, 0, 0, 0.4);
    border-top: 1px solid var(--panel-border);
    margin-top: 120px;
    text-align: center;
    width: 100%;
}

.footer-links {
    margin-top: 32px;
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: white;
}

/* Scroll Animation classes */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 1024px) {
    .engagement-block {
        flex-direction: column;
        padding: 40px;
        text-align: center;
    }
    .pricing-card.popular {
        transform: scale(1);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }
    .features-grid {
        grid-template-columns: 1fr;
    }
    .mobile-menu-btn {
        display: flex;
    }
    .nav-links {
        position: fixed;
        right: -100%;
        top: 70px;
        flex-direction: column;
        background: rgba(11, 12, 16, 0.98);
        width: 100%;
        height: calc(100vh - 70px);
        text-align: center;
        transition: 0.3s;
        justify-content: center;
        gap: 40px;
        z-index: 1000;
        -webkit-backdrop-filter: blur(20px);
        backdrop-filter: blur(20px);
        border-top: 1px solid var(--panel-border);
        visibility: hidden;
        opacity: 0;
    }
    .nav-links.nav-active {
        right: 0;
        visibility: visible;
        opacity: 1;
    }
    .hero-cta {
        flex-direction: column;
        align-items: stretch;
        max-width: 300px;
        margin-left: auto;
        margin-right: auto;
    }
    .feature-card {
        padding: 32px;
    }
    .engagement-block {
        padding: 20px;
        text-align: center;
    }
    .pricing-card {
        padding: 40px 32px;
    }
}

/* --- Extracted Classes for Refactoring --- */

.admin-subtitle {
    font-size: 0.9rem;
    opacity: 0.7;
}

.admin-header-actions {
    display: flex;
    gap: 10px;
}

.btn-admin-nav {
    text-decoration: none;
    color: white;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 0.9rem;
}

.btn-logout {
    background: rgba(255, 77, 77, 0.2);
    border: 1px solid #ff4d4d;
    color: #ff4d4d;
    padding: 10px 15px;
    width: auto;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 8px;
}

.btn-logout:hover {
    background: #ff4d4d;
    color: white;
}

.admin-section-title {
    margin-bottom: 20px;
}

.form-check-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.form-check-input {
    width: auto !important;
}

.btn-add-puzzle {
    margin-top: 15px;
}

.admin-loading-state {
    padding: 20px;
    text-align: center;
}

/* Landing Page Specifics */
.btn-nav-cta {
    padding: 10px 25px !important;
    font-size: 0.9rem !important;
}

.engagement-title {
    font-size: 2.5rem;
    margin-bottom: 24px;
    line-height: 1.2;
}

.engagement-text {
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-size: 1.1rem;
    line-height: 1.6;
}

.engagement-list {
    margin: 0 !important;
}

.pricing-card-title {
    color: var(--accent-teal);
    font-size: 1.4rem;
}

.pricing-card-title-pro {
    color: var(--accent-cyan);
    font-size: 1.4rem;
}

.pricing-card-btn {
    margin-top: auto !important;
}

.footer-desc {
    margin-top: 16px;
    color: var(--text-secondary);
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.footer-copy {
    margin-top: 64px;
    font-size: 0.85rem;
    opacity: 0.4;
}




/* --- Streak Rewards & Milestones --- */
.streak-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    pointer-events: none;
    text-align: center;
    width: 100%;
}

.streak-banner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.streak-pic {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 8px solid #ff007f;
    box-shadow: 0 0 40px #ff007f, 0 0 80px rgba(255, 0, 127, 0.5);
    object-fit: cover;
    animation: streakPulse 2.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.streak-text-container {
    animation: streakTextIn 2.5s ease-out forwards;
}

.streak-title {
    font-size: 3.5rem;
    font-weight: 900;
    color: #ff007f;
    text-transform: uppercase;
    letter-spacing: 4px;
    text-shadow: 0 0 20px #ff007f, 0 4px 15px rgba(0,0,0,1);
    margin-bottom: -10px;
}

.streak-subtitle {
    font-size: 2.2rem;
    color: white;
    font-weight: 800;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.fire-emoji {
    font-size: 4rem;
    display: inline-block;
}

@keyframes streakPulse {
    0% { transform: scale(0.5); opacity: 0; filter: blur(10px); }
    20% { transform: scale(1.1); opacity: 1; filter: blur(0); }
    80% { transform: scale(1.0); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; filter: blur(20px); }
}

@keyframes streakTextIn {
    0% { transform: translateY(50px); opacity: 0; scale: 0.8; }
    20% { transform: translateY(0); opacity: 1; scale: 1; }
    80% { transform: translateY(0); opacity: 1; scale: 1; }
    100% { transform: translateY(-50px); opacity: 0; scale: 1.2; }
}

/* --- Full Leaderboard Overlay --- */
.lb-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(9, 10, 15, 0.9);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
    animation: fadeIn 0.3s ease-out;
}

.lb-overlay-content {
    width: 100%;
    height: 90%;
    display: flex;
    flex-direction: column;
    padding: 24px;
    border: 1px solid var(--accent-primary);
}

.lb-overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 12px;
}

.lb-overlay-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent-cyan);
}

.close-x {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2.5rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s;
}

.close-x:hover {
    color: #ff4d4d;
}

.full-lb-scroll-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 10px 5px 10px 0;
}

.lb-overlay-footer {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.lb-overlay-footer .btn {
    padding: 12px 40px;
    border-radius: 50px;
}

/* Custom Scrollbar for the list */
.full-lb-scroll-list::-webkit-scrollbar {
    width: 6px;
}
.full-lb-scroll-list::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 10px;
}

/* --- Status Indicator Utilities --- */
.header-status-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.status-flex {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-text-sm {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.sync-status-label {
    font-size: 0.6rem;
    color: var(--text-dim);
    margin-top: 2px;
}

/* --- Utility Classes --- */
.mt-12 { margin-top: 12px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
