* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
}

.container {
    max-width: 1200px;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 768px) {
    .container {
        grid-template-columns: 2fr 1fr;
    }
}

.game-header {
    text-align: center;
    margin-bottom: 20px;
    grid-column: 1 / -1;
    position: relative;
}

.header-nav {
    position: absolute;
    top: 0;
    right: 0;
}

.back-home-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    padding: 10px 15px;
    background: rgba(147, 51, 234, 0.1);
    border: 1px solid rgba(147, 51, 234, 0.3);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.back-home-link:hover {
    background: rgba(147, 51, 234, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(147, 51, 234, 0.3);
}

.header-logo {
    width: 35px;
    height: 35px;
    object-fit: cover;
    border-radius: 8px;
}

.header-brand {
    font-size: 1.1rem;
    font-weight: bold;
    background: linear-gradient(90deg, #9333ea, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.game-title {
    font-size: 3rem;
    background: linear-gradient(90deg, #ffd89b 0%, #19547b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.game-subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
}

.game-panel {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-box {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.stat-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
}

.aether-dust-box {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.3), rgba(79, 70, 229, 0.3));
}

.highest-gem-box {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(37, 99, 235, 0.3));
}

.grid-size-box {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.3), rgba(5, 150, 105, 0.3));
}

.game-board {
    display: grid;
    gap: 8px;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
}

.game-cell {
    aspect-ratio: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.gem-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.gem-sprite {
    width: 60%;
    height: 60%;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

.game-cell:hover .gem-sprite {
    transform: scale(1.1);
}

.gem-level-display {
    font-size: 0.75rem;
    font-weight: bold;
    margin-top: 5px;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(0, 0, 0, 0.5);
    padding: 2px 6px;
    border-radius: 4px;
}

.game-cell:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.3);
}

.game-cell.selected {
    border-color: #ffd700;
    border-width: 3px;
    border-style: solid;
    position: relative;
    z-index: 10;
    overflow: visible;
}

.game-cell.selected::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(45deg, 
        transparent 30%, 
        rgba(255, 215, 0, 0.5) 50%, 
        transparent 70%);
    background-size: 200% 200%;
    animation: shimmer 2s linear infinite;
    border-radius: 12px;
    pointer-events: none;
    z-index: -1;
}

@keyframes shimmer {
    0% {
        background-position: 200% 200%;
    }
    100% {
        background-position: -200% -200%;
    }
}

.game-cell.selected .gem-container {
    animation: gemLift 0.3s ease-out forwards;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.5));
}

@keyframes gemLift {
    0% {
        transform: translateY(0) translateX(0) scale(1);
    }
    100% {
        transform: translateY(-8px) translateX(-4px) scale(1.15);
    }
}

.game-cell.can-merge {
    border-color: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.game-cell.can-move {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.1) !important;
    box-shadow: inset 0 0 10px rgba(99, 102, 241, 0.2);
    cursor: pointer;
}


.gem-spawn {
    animation: spawnGem 0.5s ease-out;
}

@keyframes spawnGem {
    0% {
        transform: scale(0) rotate(180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(90deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: flex-start; /* Changed from center to allow scrolling */
    justify-content: center;
    z-index: 9999;
    overflow-y: auto; /* Enable vertical scrolling */
    overflow-x: hidden; /* Prevent horizontal scroll */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    padding: 20px 0; /* Add padding for mobile */
    touch-action: pan-y; /* Allow only vertical touch scrolling */
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

.modal-content {
    background: linear-gradient(135deg, rgba(20, 20, 40, 0.98), rgba(40, 20, 60, 0.98));
    border: 2px solid rgba(147, 51, 234, 0.5);
    border-radius: 20px;
    padding: 40px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(147, 51, 234, 0.3);
}

.modal-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 20px;
    background: linear-gradient(90deg, #9333ea, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.terms-content {
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.terms-content h3 {
    color: #fbbf24;
    margin: 20px 0 10px;
    flex-shrink: 0;
}

.terms-content h4 {
    color: #9333ea;
    margin: 15px 0 10px;
}

.terms-summary {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    scroll-behavior: smooth;
    position: relative;
    border: 2px solid rgba(147, 51, 234, 0.5);
    /* Add gradient at bottom to show more content */
    background: linear-gradient(
        rgba(0, 0, 0, 0.3) 0%,
        rgba(0, 0, 0, 0.3) 85%,
        rgba(147, 51, 234, 0.1) 100%
    );
}

/* Scroll indicator for terms */
.terms-summary::-webkit-scrollbar {
    width: 8px;
}

.terms-summary::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.terms-summary::-webkit-scrollbar-thumb {
    background: rgba(147, 51, 234, 0.5);
    border-radius: 10px;
}

.terms-summary::-webkit-scrollbar-thumb:hover {
    background: rgba(147, 51, 234, 0.7);
}

.terms-summary ul {
    list-style: none;
    padding-left: 20px;
}

.terms-summary li {
    margin: 8px 0;
    padding-left: 20px;
    position: relative;
}

.terms-summary li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #3b82f6;
}

.terms-checkbox {
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.terms-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.terms-checkbox label {
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
}

.terms-checkbox a {
    color: #3b82f6;
    text-decoration: underline;
}

.modal-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
}

.btn-accept {
    background: linear-gradient(135deg, #10b981, #059669);
    padding: 15px 40px;
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-accept:disabled {
    background: rgba(255, 255, 255, 0.1);
    cursor: not-allowed;
    opacity: 0.5;
}

.btn-accept:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.4);
}

.btn-decline {
    background: rgba(239, 68, 68, 0.2);
    border: 2px solid #ef4444;
    padding: 15px 40px;
    border-radius: 10px;
    color: #ef4444;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-decline:hover {
    background: #ef4444;
    color: white;
}

/* Auth Modal Styles */
.auth-modal {
    max-width: 400px;
}

.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.auth-tab {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    padding: 10px 20px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.auth-tab.active {
    color: #fbbf24;
    border-bottom-color: #fbbf24;
}

.auth-tab:hover {
    color: #9333ea;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.auth-input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 15px;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.auth-input:focus {
    outline: none;
    border-color: #9333ea;
    box-shadow: 0 0 10px rgba(147, 51, 234, 0.3);
}

.auth-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.auth-note {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    margin-top: 10px;
}

.guest-warning {
    color: #fbbf24;
    font-weight: bold;
    margin-bottom: 15px;
}

.guest-info {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
}

.guest-info li {
    padding: 8px 0;
    padding-left: 20px;
    position: relative;
    color: rgba(255, 255, 255, 0.8);
}

.guest-info li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #ef4444;
}

/* User Bar Styles */
.user-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    border-bottom: 1px solid rgba(147, 51, 234, 0.3);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.user-name {
    color: #fbbf24;
    font-weight: bold;
    font-size: 1.1rem;
}

.user-actions {
    display: flex;
    gap: 10px;
}

.btn-small {
    background: rgba(147, 51, 234, 0.2);
    border: 1px solid rgba(147, 51, 234, 0.5);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-small:hover {
    background: rgba(147, 51, 234, 0.4);
    transform: translateY(-1px);
}

/* Adjust game container when user bar is visible */
body.user-logged-in {
    padding-top: 50px;
}

/* Mobile App Specific Styles */
@media (display-mode: standalone) {
    /* Remove browser UI space when installed as app */
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
    
    .user-bar {
        top: env(safe-area-inset-top);
    }
    
    /* Hide back to home link in app mode */
    .header-nav {
        display: none;
    }
}

/* Prevent text selection and touch callouts in app */
.game-board, .btn, .game-cell {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Drag and Drop Styles */
.game-cell[draggable="true"] {
    cursor: move;
}

.game-cell.drag-over-valid {
    background: rgba(16, 185, 129, 0.3) !important;
    border-color: #10b981 !important;
    box-shadow: inset 0 0 20px rgba(16, 185, 129, 0.5);
}

.game-cell.drag-over-merge {
    background: rgba(251, 191, 36, 0.3) !important;
    border-color: #fbbf24 !important;
    box-shadow: inset 0 0 20px rgba(251, 191, 36, 0.5);
    animation: pulse 0.5s infinite;
}

/* Dragging state */
.game-cell[draggable="true"]:active {
    cursor: grabbing;
}

/* Improve touch targets for mobile */
.game-cell {
    min-height: 44px;
    min-width: 44px;
}

.btn {
    min-height: 44px;
    touch-action: manipulation;
}

.gem-merge {
    animation: mergeGem 0.5s ease-out;
}

@keyframes mergeGem {
    0% { transform: scale(1); }
    50% { transform: scale(1.3) rotate(180deg); }
    100% { transform: scale(1) rotate(360deg); }
}

.controls-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.btn {
    padding: 15px 25px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-reset {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.btn-reset:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(239, 68, 68, 0.4);
}

.btn-withdraw {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.btn-withdraw:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4);
}

.info-panel {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.info-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #ffd700;
}

.info-list {
    list-style: none;
    padding: 0;
}

.info-list li {
    padding: 10px 0;
    padding-left: 25px;
    position: relative;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
}

.info-list li:before {
    content: "✨";
    position: absolute;
    left: 0;
}

.gem-values {
    margin-top: 30px;
}

.gem-values h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #ffd700;
}

.gem-values-list {
    display: grid;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 215, 0, 0.3) rgba(255, 255, 255, 0.1);
}

.gem-values-list::-webkit-scrollbar {
    width: 8px;
}

.gem-values-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.gem-values-list::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.3);
    border-radius: 4px;
}

.gem-values-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 215, 0, 0.5);
}

.gem-value-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.gem-value-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(5px);
}

.gem-value-item.achieved {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
}

.gem-icon-sprite {
    width: 40px;
    height: 40px;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.gem-info {
    flex: 1;
}

.gem-level {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.gem-dust-value {
    font-weight: bold;
    color: #ffd700;
}

.merge-info {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.5);
    padding: 20px 40px;
    border-radius: 15px;
    font-size: 1.5rem;
    font-weight: bold;
    color: #ffd700;
    z-index: 1000;
    animation: fadeInOut 1.5s ease-out;
    pointer-events: none;
    user-select: none;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

.hidden {
    display: none;
}

@media (max-width: 768px) {
    .game-title {
        font-size: 2rem;
    }
    
    .gem-emoji {
        font-size: 1.8rem;
    }
    
    .gem-level-display {
        font-size: 0.65rem;
    }
    
    .controls-container {
        grid-template-columns: 1fr;
    }
    
    /* Fix terms modal on mobile */
    .modal-overlay {
        padding: 10px;
        align-items: flex-start; /* Start from top on mobile */
    }
    
    .modal-content {
        width: 95%;
        max-width: 95%;
        margin: 10px auto;
        max-height: 85vh; /* Leave space for viewport */
        overflow-y: auto;
        padding: 20px; /* Reduce padding on mobile */
        position: relative;
        transform: none; /* Remove any transform that might cause issues */
    }
    
    .terms-summary {
        max-height: 35vh; /* Slightly smaller to leave room for buttons */
        font-size: 14px;
        padding: 15px;
        overflow-y: scroll !important; /* Force scrolling */
        -webkit-overflow-scrolling: touch !important; /* Force iOS smooth scroll */
        /* Add visual scroll indicator */
        box-shadow: inset 0 -10px 10px -10px rgba(255, 255, 255, 0.1);
        position: relative;
        /* Make sure it's scrollable */
        touch-action: pan-y;
    }
    
    /* Force scrollbar to be visible on mobile */
    .terms-summary::-webkit-scrollbar {
        width: 6px !important;
        display: block !important;
    }
    
    .terms-checkbox {
        font-size: 14px;
        padding: 10px;
    }
    
    .terms-checkbox label {
        display: flex;
        align-items: flex-start;
        line-height: 1.4;
    }
    
    .terms-checkbox input[type="checkbox"] {
        min-width: 20px;
        min-height: 20px;
        margin-right: 10px;
        margin-top: 2px;
    }
}

/* Enhanced Profile UI Styles */
.profile-section {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.profile-wrapper {
    position: relative;
}

.profile-avatar-container {
    cursor: pointer;
    position: relative;
    transition: transform 0.2s ease;
}

.profile-avatar-container:hover {
    transform: scale(1.05);
}

.profile-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    color: white;
    border: 3px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.profile-status-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 14px;
    height: 14px;
    background: #10b981;
    border: 2px solid white;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.profile-dropdown {
    position: absolute;
    top: 55px;
    right: 0;
    width: 320px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.profile-header {
    padding: 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    display: flex;
    gap: 15px;
    align-items: center;
}

.profile-avatar-large {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.profile-info h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.profile-email {
    margin: 4px 0;
    font-size: 13px;
    opacity: 0.9;
}

.profile-level {
    margin: 4px 0;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
}

.profile-stats {
    padding: 15px 20px;
    background: #f9fafb;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-icon {
    font-size: 20px;
}

.stat-details {
    display: flex;
    flex-direction: column;
}

.stat-details .stat-label {
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    font-weight: 500;
}

.stat-details .stat-value {
    font-size: 16px;
    color: #111827;
    font-weight: 600;
}

.profile-menu {
    padding: 10px;
}

.profile-menu-item {
    width: 100%;
    padding: 12px 15px;
    background: none;
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    transition: background 0.2s ease;
    text-align: left;
}

.profile-menu-item:hover {
    background: #f3f4f6;
}

.profile-menu-item.logout {
    color: #ef4444;
}

.profile-menu-item.logout:hover {
    background: #fee2e2;
}

.menu-icon {
    font-size: 18px;
}

.profile-divider {
    margin: 10px 0;
    border: none;
    border-top: 1px solid #e5e7eb;
}

/* Dark mode styles */
body.dark-mode {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
}

body.dark-mode .profile-dropdown {
    background: #1f2937;
    color: white;
}

body.dark-mode .profile-stats {
    background: #111827;
}

body.dark-mode .stat-details .stat-label {
    color: #9ca3af;
}

body.dark-mode .stat-details .stat-value {
    color: white;
}

body.dark-mode .profile-menu-item {
    color: #d1d5db;
}

body.dark-mode .profile-menu-item:hover {
    background: #374151;
}

body.dark-mode .profile-divider {
    border-color: #374151;
}
