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

        html, body {
            width: 100%;
            height: 100%;
            max-width: 100%;
            -webkit-text-size-adjust: 100%;
            -ms-text-size-adjust: 100%;
            margin: 0;
            padding: 0;
            overflow: hidden;
        }

        html {
            width: 100%;
            height: 100%;
        }

        body {
            width: 100%;
            height: 100%;
            min-width: 100%;
            min-height: 100%;
        }

        /* Prevent auto-zoom on input focus (mobile) */
        input, textarea, select {
            font-size: 16px !important;
        }

        body {
            background-color: #0a0a0a;
            color: white;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
            min-height: 100vh;
            max-height: none;
            overflow: auto;
            display: flex;
            flex-direction: column;
            -webkit-touch-callout: none;
            -webkit-overflow-scrolling: touch;
            touch-action: manipulation;
            transition: background-color 0.8s ease, color 0.8s ease;
            box-sizing: border-box;
        }

        /* Mobile / small-screen fixes to avoid 100vh scrolling glitches and inline fixed widths */
        @media (max-width: 768px) {
            body {
                /* Use safe-area inset on phones with notches */
                padding-bottom: env(safe-area-inset-bottom);
                overscroll-behavior: contain;
            }

            /* Stack upload buttons vertically on small screens */
            .upload-buttons {
                flex-direction: column;
                gap: 8px;
                align-items: stretch;
            }

            /* Make primary upload button full-width and easier to tap */
            #uploadBtn {
                width: 100% !important;
                box-sizing: border-box;
            }

            /* Reduce fixed-width small buttons and allow auto sizing */
            #sellBtn, #mediaBtn, #boostBtn {
                width: auto !important;
                min-width: 64px !important;
                padding: 10px 12px !important;
                font-size: 14px !important;
            }

            /* Ensure modals can scroll within viewport on mobile */
            .view-modal-content, .admin-modal-content, .modal-content {
                max-height: 85vh;
                overflow-y: auto;
                -webkit-overflow-scrolling: touch;
            }

            /* Improve purchase hint layout */
            #boostHint, #sellHint {
                word-break: break-word;
            }
        }

        /* Light mode styles */
        /* Light mode - comprehensive color inversion */
        body.light-mode {
            background-color: #b3b3b3 !important;
            color: #222 !important;
        }

        body.light-mode .header {
            background-color: #b3b3b3 !important;
            border-bottom-color: #999 !important;
        }

        body.light-mode .grid-box {
            background-color: #ffffff !important;
            border-color: #ddd !important;
            color: #222 !important;
            box-shadow: 0 0 15px rgba(0, 0, 0, 0.08) !important;
        }

        body.light-mode .grid-box:hover {
            background-color: #f9f9f9 !important;
            border-color: #ccc !important;
        }

        body.light-mode .grid-box-title {
            color: #222 !important;
        }

        body.light-mode .grid-box-details {
            color: #666 !important;
        }

        body.light-mode .modal-content {
            background-color: #ffffff !important;
            border-color: #ddd !important;
            color: #222 !important;
        }

        body.light-mode .modal-header h2 {
            color: #222 !important;
        }

        body.light-mode input[type="text"],
        body.light-mode #postLink {
            background-color: #f9f9f9 !important;
            color: #222 !important;
            border-color: #ddd !important;
        }

        body.light-mode #postText {
            background: linear-gradient(#f9f9f9, #f9f9f9) padding-box,
                        linear-gradient(135deg, #667eea, #764ba2) border-box !important;
            color: #222 !important;
        }

        body.light-mode #postText::placeholder {
            color: #999 !important;
        }

        body.light-mode .upload-area {
            background-color: #ffffff !important;
            border-color: #ddd !important;
        }

        body.light-mode .upload-text {
            color: #666 !important;
        }

        body.light-mode button,
        body.light-mode .upload-button {
            background-color: #4ade80 !important;
            color: #000 !important;
            border-color: #4ade80 !important;
        }

        body.light-mode .vote-badge {
            background: rgba(255, 255, 255, 0.95) !important;
        }

        body.light-mode .vote-button {
            background-color: #222 !important;
            color: #fff !important;
            border-color: #222 !important;
        }

        body.light-mode .vote-button:hover {
            background-color: #444 !important;
            border-color: #444 !important;
        }

        body.light-mode .poi-info {
            color: #666 !important;
        }

        body.light-mode .poi-name {
            color: #222 !important;
        }

        body.light-mode #zoneInfo {
            color: #4ade80 !important;
        }

        body.light-mode #zoneDropdown {
            background-color: #ffffff !important;
            border-color: #ddd !important;
            color: #222 !important;
        }

        body.light-mode #zoneDropdown div {
            color: #666 !important;
            border-color: #ddd !important;
        }

        body.light-mode #onlineUserCount {
            color: #666 !important;
        }

        body.light-mode .status-dot.connected {
            background-color: #4ade80 !important;
        }

        body.light-mode #themToggle:hover {
            background-color: #e8e8e8 !important;
        }

        body.light-mode .badge {
            background-color: #f0f0f0 !important;
            color: #222 !important;
        }

        body.light-mode textarea::placeholder {
            color: #999 !important;
        }

        body.light-mode input::placeholder {
            color: #999 !important;
        }

        body.light-mode #uploadBtn {
            background-color: #4ade80 !important;
        }

        /* Light mode - post content backgrounds */
        body.light-mode .grid-box div[style*="background-color: #1a1a1a"] {
            background-color: #ffffff !important;
            color: #222 !important;
        }

        /* Light mode - add content to grid button */
        body.light-mode #box-0 {
            background: linear-gradient(135deg, #f5f5f5 0%, #f0f0f0 100%) !important;
            border-color: #fff !important;
        }

        body.light-mode #uploadBtn:hover {
            background-color: #fff !important;
        }

        body.light-mode .upload-panel {
            background-color: #f5f5f5 !important;
        }

        body.light-mode .modal-votes {
            background-color: #f9f9f9 !important;
        }

        body.light-mode .like-dislike-container {
            background-color: #ffffff !important;
        }

        body.light-mode .comment-item {
            background-color: #f9f9f9 !important;
            border-color: #ddd !important;
            color: #222 !important;
        }

        body.light-mode .charCountDisplay {
            color: #666 !important;
        }

        body.light-mode #charError {
            color: #ff6b6b !important;
        }

        body.light-mode .grid::-webkit-scrollbar-thumb {
            background: #ccc !important;
        }

        body.light-mode .grid::-webkit-scrollbar-thumb:hover {
            background: #bbb !important;
        }

        body.light-mode #commentsList::-webkit-scrollbar-thumb {
            background: #ccc !important;
        }

        body.light-mode #commentsList::-webkit-scrollbar-thumb:hover {
            background: #bbb !important;
        }

        /* Light mode - modal and admin overlays */
        body.light-mode .modal {
            background-color: rgba(0, 0, 0, 0.5) !important;
        }

        body.light-mode .view-modal {
            background-color: rgba(0, 0, 0, 0.5) !important;
        }

        body.light-mode .admin-modal {
            background-color: rgba(0, 0, 0, 0.5) !important;
        }

        body.light-mode .admin-modal-content {
            background-color: #ffffff !important;
            border-color: #ddd !important;
            color: #222 !important;
        }

        body.light-mode .admin-modal-content h2 {
            color: #222 !important;
        }

        body.light-mode .view-modal-content {
            background-color: #ffffff !important;
            border-color: #ddd !important;
            color: #222 !important;
        }

        body.light-mode .view-modal-content h2 {
            color: #222 !important;
        }

        body.light-mode .view-content-text {
            color: #222 !important;
        }

        body.light-mode .admin-page {
            background-color: #ffffff !important;
        }

        body.light-mode .admin-header {
            background-color: #ffffff !important;
            border-bottom-color: #ddd !important;
            color: #222 !important;
        }

        body.light-mode .admin-header h1 {
            color: #222 !important;
        }

        body.light-mode .admin-header button {
            color: #222 !important;
        }

        /* Light mode - badge glow styles */
        body.light-mode .grid-box.badge-new {
            border-top: 4px solid #0ea5e9 !important;
            box-shadow: 0 0 15px rgba(14, 165, 233, 0.4) !important;
        }

        body.light-mode .grid-box.badge-new::before {
            color: #0ea5e9 !important;
            text-shadow: 0 0 4px rgba(14, 165, 233, 0.3) !important;
        }

        body.light-mode .grid-box.badge-hot {
            border-top: 4px solid #dc2626 !important;
            box-shadow: 0 0 15px rgba(220, 38, 38, 0.4) !important;
        }

        body.light-mode .grid-box.badge-hot::before {
            color: #dc2626 !important;
            text-shadow: 0 0 4px rgba(220, 38, 38, 0.3) !important;
        }

        body.light-mode .grid-box.badge-rising {
            border-top: 4px solid #ea580c !important;
            box-shadow: 0 0 15px rgba(234, 88, 12, 0.4) !important;
        }

        body.light-mode .grid-box.badge-rising::before {
            color: #ea580c !important;
            text-shadow: 0 0 4px rgba(234, 88, 12, 0.3) !important;
        }

        body.light-mode .grid-box.badge-trending {
            border-top: 4px solid #d97706 !important;
            box-shadow: 0 0 15px rgba(217, 119, 6, 0.4) !important;
        }

        body.light-mode .grid-box.badge-trending::before {
            color: #d97706 !important;
            text-shadow: 0 0 4px rgba(217, 119, 6, 0.3) !important;
        }

        body.light-mode .grid-box.badge-controversial {
            border-top: 4px solid #c026d3 !important;
            box-shadow: 0 0 15px rgba(192, 38, 211, 0.4) !important;
        }

        body.light-mode .grid-box.badge-controversial::before {
            color: #c026d3 !important;
            text-shadow: 0 0 4px rgba(192, 38, 211, 0.3) !important;
        }

        body.light-mode .grid-box.badge-verified {
            border-top: 4px solid #fff !important;
            box-shadow: 0 0 15px rgba(255, 255, 255, 0.4) !important;
        }

        body.light-mode .grid-box.badge-verified::before {
            color: #fff !important;
            text-shadow: 0 0 4px rgba(255, 255, 255, 0.3) !important;
        }

        body.light-mode .grid-box.badge-liked {
            border-top: 4px solid #0891b2 !important;
            box-shadow: 0 0 15px rgba(8, 145, 178, 0.4) !important;
        }

        body.light-mode .grid-box.badge-liked::before {
            color: #0891b2 !important;
            text-shadow: 0 0 4px rgba(8, 145, 178, 0.3) !important;
        }

        body.light-mode .grid-box.badge-nearby {
            border-right: 4px solid #fff !important;
            box-shadow: 0 0 12px rgba(34, 197, 94, 0.3) !important;
        }

        body.light-mode .grid-box.badge-nearby::after {
            color: #fff !important;
            background: rgba(255, 255, 255, 0.7) !important;
            text-shadow: 0 0 3px rgba(34, 197, 94, 0.4) !important;
        }

        body.light-mode .grid-box.badge-featured {
            border-right: 4px solid #f59e0b !important;
            box-shadow: 0 0 12px rgba(245, 158, 11, 0.3) !important;
        }

        body.light-mode .grid-box.badge-featured::after {
            color: #f59e0b !important;
            background: rgba(255, 255, 255, 0.7) !important;
            text-shadow: 0 0 3px rgba(245, 158, 11, 0.4) !important;
        }

        body.light-mode .grid-box.badge-community {
            border-right: 4px solid #a855f7 !important;
            box-shadow: 0 0 12px rgba(168, 85, 247, 0.3) !important;
        }

        body.light-mode .grid-box.badge-community::after {
            color: #a855f7 !important;
            background: rgba(255, 255, 255, 0.7) !important;
            text-shadow: 0 0 3px rgba(168, 85, 247, 0.4) !important;
        }

        body.light-mode .grid-box.badge-podium {
            border-top: 4px solid #d97706 !important;
            box-shadow: 0 0 12px rgba(217, 119, 6, 0.5) !important;
        }

        body.light-mode .grid-box.badge-podium::before {
            color: #d97706 !important;
            text-shadow: 0 0 4px rgba(217, 119, 6, 0.4) !important;
        }

        body.light-mode .grid-box.badge-disliked {
            border-left: 3px solid #6b7280 !important;
            box-shadow: 0 0 8px rgba(107, 114, 128, 0.2) !important;
            opacity: 0.85 !important;
        }

        body.light-mode .grid-box.badge-disliked::before {
            color: #6b7280 !important;
            text-shadow: 0 0 2px rgba(107, 114, 128, 0.3) !important;
        }

        body.light-mode .grid-box.badge-crowned {
            border-top: 4px solid #d97706 !important;
            box-shadow: inset 0 0 10px rgba(217, 119, 6, 0.2), 0 0 15px rgba(217, 119, 6, 0.4) !important;
        }

        body.light-mode .grid-box.badge-crowned::before {
            color: #d97706 !important;
            text-shadow: 0 0 4px rgba(217, 119, 6, 0.4) !important;
        }

        body.light-mode .grid-box.badge-runner-up {
            border-top: 4px solid #a855f7 !important;
            box-shadow: inset 0 0 10px rgba(168, 85, 247, 0.2), 0 0 15px rgba(168, 85, 247, 0.4) !important;
        }

        body.light-mode .grid-box.badge-runner-up::before {
            color: #a855f7 !important;
            text-shadow: 0 0 4px rgba(168, 85, 247, 0.4) !important;
        }

        body.light-mode .grid-box.badge-self-post {
            border: 2px solid #059669 !important;
            box-shadow: 0 0 15px rgba(5, 150, 105, 0.5) !important;
        }

        body.light-mode .grid-box.badge-self-post::before {
            color: #059669 !important;
            text-shadow: 0 0 4px rgba(5, 150, 105, 0.5) !important;
        }

        body.light-mode .admin-content {
            background-color: #ffffff !important;
            color: #222 !important;
        }

        body.light-mode .admin-content h3 {
            color: #222 !important;
        }

        body.light-mode .admin-content h2 {
            color: #222 !important;
        }

        body.light-mode #passwordInput {
            background-color: #f9f9f9 !important;
            color: #222 !important;
            border-color: #ddd !important;
        }

        /* Light mode - modal report buttons */
        body.light-mode button[onclick*="submitReport"] {
            background-color: #f5f5f5 !important;
            color: #222 !important;
            border-color: #ddd !important;
        }

        body.light-mode button[onclick*="submitReport"]:hover {
            background-color: #e8e8e8 !important;
            border-color: #ccc !important;
        }

        /* Light mode - admin buttons */
        body.light-mode button[onclick*="banSelectedPosts"] {
            color: #fff !important;
        }

        body.light-mode button {
            color: inherit !important;
        }

        body.light-mode button:not([onclick*="banSelectedPosts"]):not([onclick*="uploadPost"]):not([onclick*="submitReport"]):not([style*="background-color: #4ade80"]) {
            background-color: #f0f0f0 !important;
            color: #222 !important;
            border-color: #ddd !important;
        }

        body.light-mode button:not([onclick*="banSelectedPosts"]):not([onclick*="uploadPost"]):not([onclick*="submitReport"]):not([style*="background-color: #4ade80"]):hover {
            background-color: #e0e0e0 !important;
            border-color: #ccc !important;
        }

        body.light-mode .upload-area {
            border-color: #ccc !important;
            background-color: #f9f9f9 !important;
        }

        body.light-mode .upload-area:hover {
            border-color: #999 !important;
            background-color: #f5f5f5 !important;
        }

        body.light-mode input[type="password"],
        body.light-mode input[type="text"],
        body.light-mode textarea {
            background-color: #f9f9f9 !important;
            color: #222 !important;
            border-color: #ddd !important;
        }

        body.light-mode input:focus,
        body.light-mode textarea:focus {
            border-color: #4ade80 !important;
            background-color: #ffffff !important;
        }

        /* Light mode - report modal */
        body.light-mode .report-modal-content {
            background-color: #ffffff !important;
            border-color: #ddd !important;
            color: #222 !important;
        }

        body.light-mode .report-modal-content h2 {
            color: #222 !important;
        }

        body.light-mode .report-modal-content h3 {
            color: #222 !important;
        }

        /* Light mode - all inline text colors */
        body.light-mode div[style*="color: #888"] {
            color: #666 !important;
        }

        body.light-mode div[style*="color: #999"] {
            color: #666 !important;
        }

        body.light-mode div[style*="color: white"] {
            color: #222 !important;
        }

        body.light-mode div[style*="color: #fff"] {
            color: #222 !important;
        }

        body.light-mode p[style*="color: #888"] {
            color: #666 !important;
        }

        body.light-mode span[style*="color: #888"] {
            color: #666 !important;
        }

        /* Light mode - divs with dark backgrounds */
        body.light-mode div[style*="background-color: #333"] {
            background-color: #f0f0f0 !important;
            color: #222 !important;
        }

        body.light-mode div[style*="background-color: #3a3a3a"] {
            background-color: #f5f5f5 !important;
            color: #222 !important;
        }

        body.light-mode div[style*="background-color: #1a1a1a"] {
            background-color: #ffffff !important;
            color: #222 !important;
        }

        body.light-mode div[style*="background-color: #555"] {
            background-color: #ddd !important;
            color: #222 !important;
        }

        /* Light mode - borders */
        body.light-mode div[style*="border: 1px solid #333"] {
            border-color: #ddd !important;
        }

        body.light-mode div[style*="border: 2px dashed #555"] {
            border-color: #999 !important;
        }

        body.light-mode div[style*="border-bottom: 1px solid #333"] {
            border-bottom-color: #ddd !important;
        }

        body.light-mode div[style*="border-top: 1px solid #333"] {
            border-top-color: #ddd !important;
        }

        /* Light mode - vote badge background */
        body.light-mode div[style*="background: rgba(0,0,0,0.9)"] {
            background: rgba(255, 255, 255, 0.95) !important;
        }

        /* Light mode - share and report buttons */
        body.light-mode #shareBtn {
            background: linear-gradient(135deg, #5caee8, #3a8fd6) !important;
            color: #fff !important;
        }

        body.light-mode #shareBtn:hover {
            background: linear-gradient(135deg, #7ac3f0, #5db3e0) !important;
        }

        body.light-mode #reportBtn {
            background: linear-gradient(135deg, #f97316, #ea580c) !important;
            color: #fff !important;
        }

        body.light-mode #reportBtn:hover {
            background: linear-gradient(135deg, #fb923c, #f97316) !important;
        }

        /* Light mode - modal control buttons */
        body.light-mode button[onclick="openLink()"],
        body.light-mode button[onclick="sharePost()"],
        body.light-mode button[onclick="reportPost()"] {
            color: #fff !important;
        }

        /* Light mode - video/photo overlay backgrounds */
        body.light-mode div[style*="background-color: rgba(0, 0, 0,"] {
            background-color: rgba(0, 0, 0, 0.4) !important;
        }

        body.light-mode div[style*="background: rgba(0, 0, 0,"] {
            background: rgba(0, 0, 0, 0.4) !important;
        }

        /* Light mode - ensure vote buttons are readable */
        body.light-mode button[onclick*="voteOnPost"] {
            color: #000 !important;
        }

        /* Light mode - photo/video container backgrounds */
        body.light-mode div[style*="background-color: #1a1a1a; border-radius: 6px; overflow: hidden"] {
            background-color: #ffffff !important;
        }

        .header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 20px 30px;
            border-bottom: 1px solid #222;
            background-color: #0a0a0a;
            width: 100%;
            margin: 0 auto;
            position: relative; /* anchor for centered logo */
            transition: background-color 0.8s ease, border-color 0.8s ease, color 0.8s ease;
        }

        /* 🌍 wificontent.com brand logo — Canvas 3D rotating globe */
        /* ============================================================================ */
        /* 🛡️ PROTECTED CSS ANIMATIONS — BRAND PULSE & GLOW — DO NOT MODIFY */
        /* ============================================================================ */
        /* */
        /* These animations are synchronized with the Canvas 3D globe engine. */
        /* Changes to timing, scale, or colors will break the visual effect. */
        /* DO NOT ALTER without exhaustive testing. */
        /* */
        /* ============================================================================ */
        
        #brandGlobeCanvas {
            cursor: default;
            user-select: none;
            pointer-events: none;
            filter: drop-shadow(0 2px 12px rgba(74, 222, 128, 0.5));
        }
        #brandGlobeCanvas.online {
            animation: brandGlow 1.2s ease-in-out infinite, brandPulse 1.2s ease-in-out infinite;
        }
        @keyframes brandPulse {
            0%, 100% { transform: scale(1);    }
            50%      { transform: scale(1.25); }
        }
        @keyframes brandGlow {
            0%, 100% { filter: drop-shadow(0 2px 12px rgba(74, 222, 128, 0.5)); }
            50%      { filter: drop-shadow(0 2px 18px rgba(74, 222, 128, 0.85)); }
        }

        /* Mobile header optimization */
        @media (max-width: 599px) {
            .header {
                padding: 8px 12px;
                width: 100%;
            }
            .logo {
                font-size: 18px;
            }
            .brand-logo {
                font-size: 32px;
            }
        }

        .logo {
            font-size: 28.8px;
            font-weight: 700;
            letter-spacing: -0.5px;
            -webkit-text-stroke: 1px white;
        }

        .poi-info {
            display: none;
            text-align: center;
            font-size: 14px;
            color: #888;
        }

        .poi-info.connected {
            display: block;
        }

        .poi-name {
            font-size: 16px;
            color: #fff;
            margin-top: 4px;
        }

        .container {
            display: flex;
            height: calc(100vh - 80px);
            gap: 0px;
            padding: 0px;
            padding-bottom: -100px;
            width: 100%;
            margin: 0 auto;
            overflow: hidden;
            position: relative;
            min-height: calc(100vh - 80px);
            max-height: calc(100vh - 80px);
            flex-shrink: 0;
            flex-grow: 0;
        }

        /* Mobile container padding */
        @media (max-width: 599px) {
            .container {
                padding: 8px;
                height: calc(100vh - 60px);
            }
        }

        .grid-wrapper {
            flex: 1;
            display: flex;
            flex-direction: column;
            max-width: 100%;
            width: 100%;
            height: 100%;
            max-height: 100%;
            padding: 0 8px;
            min-height: 0;
            overflow: hidden;
        }

        .grid {
            display: grid;
            grid-template-columns: repeat(1, 1fr);
            gap: 20px 0px;
            flex: 1;
            overflow-y: scroll;
            overflow-x: hidden;
            padding-right: 0px;
            padding-top: 24px;
            padding-bottom: 0px;
            -webkit-overflow-scrolling: touch;
            opacity: 1;
            transition: opacity 0.3s ease;
            min-height: 0;
            flex-shrink: 1;
            /* REMOVED: height lock to show more grids - let grid expand naturally */
            /* height: calc(100vh - 80px - 0px); */
            /* max-height: calc(100vh - 80px - 0px); */
        }

        .grid.loading {
            opacity: 0.5;
        }

        /* Small screens (375px - phones) */
        @media (min-width: 320px) and (max-width: 599px) {
            .grid {
                grid-template-columns: repeat(2, 1fr) !important;
                gap: 4px 4px !important;
                padding-right: 2px !important;
                padding-left: 2px !important;
                display: grid !important;
            }
            .grid-wrapper {
                max-width: 100% !important;
                padding: 0 !important;
            }
            .grid-box {
                min-height: 80px !important;
                padding: 2px !important;
                margin-bottom: 0px !important;
                aspect-ratio: 1 !important;
            }
        }

        /* Tablet size optimization (600px+) - 2 columns */
        @media (min-width: 600px) {
            .grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 35px 12px;
            }
            .grid-wrapper {
                max-width: 90vw;
                padding: 0 18px;
                margin: 0 auto;
            }
        }

        /* Desktop size optimization (1200px+) - 4 columns - COMPACT */
        @media (min-width: 1200px) {
            .grid {
                grid-template-columns: repeat(4, 1fr);
                gap: 55px 22px;
            }
            .grid-wrapper {
                max-width: 100%;
                padding: 0 28px;
                margin: 0;
            }
        }

        .grid-box {
            aspect-ratio: 1;
            background-color: #1a1a1a;
            border: 1px solid #333;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            color: #fff;
            flex-direction: column;
            padding: 8px;
            overflow: hidden;
            position: relative;
            min-height: 245px;
            box-shadow: 0 0 15px rgba(255, 255, 255, 0.1), 0 0 30px rgba(102, 126, 234, 0.3);
        }

        .grid-box:hover {
            background-color: #222;
            border-color: #444;
        }

        /* Grid item wrapper - maintains grid aspect ratio */
        .grid-item-wrapper {
            display: flex;
            flex-direction: column;
            aspect-ratio: 1;
        }

        /* Vote badge responsive styling */
        .vote-badge {
            position: absolute;
            bottom: 0;
            left: 8px;
            right: 8px;
            background: rgba(0, 0, 0, 0.9);
            border-radius: 6px;
            padding: 8px;
            display: flex;
            justify-content: space-around;
            gap: 8px;
            font-size: 12px;
        }

        .vote-button {
            flex: 1;
            padding: 6px 8px;
            background-color: #333;
            color: #000;
            border: none;
            border-radius: 4px;
            font-size: 11px;
            font-weight: 600;
            cursor: pointer;
        }

        .vote-button:active {
            background-color: #555;
        }

        /* Mobile optimizations - REDUCED VOTE BADGE HEIGHT */
        @media (max-width: 599px) {
            .vote-badge {
                padding: 4px;
                gap: 4px;
                font-size: 10px;
                bottom: 16px !important;
                height: 24px;
            }

            .vote-button {
                padding: 4px 5px;
                font-size: 9px;
                height: 24px;
                line-height: 1;
            }
        }

        .grid-box.filled {
            background-color: #1a1a1a;
            border-color: #555;
        }

        /* Badge border styles */
        .grid-box.badge-new {
            border-top: 4px solid #60a5fa;
            position: relative;
            box-shadow: 0 0 15px rgba(96, 165, 250, 0.4);
        }
        .grid-box.badge-sell {
            box-shadow: 0 16px 48px rgba(34,193,195,0.14) inset, 0 8px 26px rgba(34,193,195,0.08);
            border: 2px solid rgba(34,193,195,0.35);
            transform: translateZ(0);
            transition: transform 180ms ease, box-shadow 180ms ease;
        }
        /* Stronger visual for sell posts */
        .grid-box.badge-sell {
            background: linear-gradient(180deg, rgba(18,74,72,0.12), rgba(6,16,17,0.06));
            border: 2px solid rgba(34,193,195,0.45);
            box-shadow: 0 22px 60px rgba(34,193,195,0.16), inset 0 6px 20px rgba(34,193,195,0.06);
        }
        .grid-box.badge-sell::before {
            content: "sell";
            position: absolute;
            top: 8px;
            left: 8px;
            background: linear-gradient(90deg, #16a085, #22c1c3);
            color: white;
            font-weight: 900;
            padding: 8px 12px;
            border-radius: 8px;
            font-size: 15px; /* ~1.25× larger than previous 12px */
            letter-spacing: 0.6px;
            box-shadow: 0 6px 18px rgba(16,150,140,0.18);
            z-index: 12;
            text-shadow: 0 1px 0 rgba(0,0,0,0.25);
            transform-origin: left top;
        }

        /* Selected state for composer badge buttons */
        #sellBtn.badge-selected {
            background: linear-gradient(135deg,#06292a 0%, #0f5e5d 100%);
            color: #a7fff6 !important;
            border-color: #5fe6de !important;
            box-shadow: 0 8px 28px rgba(34,193,195,0.28);
            transform: translateY(-1px);
        }
        /* Boost visual flair */
        .grid-box.badge-boost {
            box-shadow: 0 22px 68px rgba(102,126,234,0.18), inset 0 4px 16px rgba(102,126,234,0.08);
            transform: translateZ(0);
            transition: transform 160ms ease, box-shadow 160ms ease;
        }
        .grid-box.badge-boost::after {
            content: '';
            position: absolute;
            top: -8px;
            right: -8px;
            width: 48px;
            height: 48px;
            background: radial-gradient(circle at 30% 30%, rgba(102,158,255,0.95), rgba(102,126,234,0.28) 40%, transparent 60%);
            border-radius: 50%;
            filter: blur(8px);
            pointer-events: none;
            z-index: 11;
        }
        /* Add explicit 'boost' label (bigger badge) */
        .grid-box.badge-boost::before {
            content: 'boost';
            position: absolute;
            top: 8px;
            right: 8px;
            background: linear-gradient(90deg,#6b46c1,#667eea);
            color: white;
            font-weight: 900;
            padding: 8px 12px;
            border-radius: 10px;
            font-size: 18px; /* ~1.5× larger visual */
            letter-spacing: 0.6px;
            box-shadow: 0 6px 20px rgba(102,126,234,0.22);
            z-index: 13;
            text-shadow: 0 1px 0 rgba(0,0,0,0.25);
            transform-origin: right top;
        }
        /* Sell + Boost: half badge indicator */
        .grid-box.badge-sell.badge-boost::before {
            content: "sell • boost";
            background: linear-gradient(90deg,#22c1c3,#8b9aff);
            padding: 6px 12px;
            font-size: 15px;
        }

        .grid-box.badge-new::before {
            content: '✨';
            position: absolute;
            top: 4px;
            left: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #60a5fa;
            letter-spacing: 1px;
            text-shadow: 0 0 4px rgba(96, 165, 250, 0.5);
            z-index: 10;
        }

        .grid-box.badge-hot {
            border-top: 4px solid #ef4444;
            box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
        }

        .grid-box.badge-hot::before {
            content: '🔥 HOT';
            position: absolute;
            top: 4px;
            left: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #ef4444;
            letter-spacing: 0.5px;
            text-shadow: 0 0 4px rgba(239, 68, 68, 0.5);
            z-index: 10;
        }

        .grid-box.badge-rising {
            border-top: 4px solid #f97316;
            box-shadow: 0 0 15px rgba(249, 115, 22, 0.4);
        }

        .grid-box.badge-rising::before {
            content: '↑';
            position: absolute;
            top: 4px;
            left: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #f97316;
            letter-spacing: 0.5px;
            text-shadow: 0 0 4px rgba(249, 115, 22, 0.5);
            z-index: 10;
        }

        .grid-box.badge-trending {
            border-top: 4px solid #fbbf24;
            box-shadow: 0 0 15px rgba(251, 191, 36, 0.4);
        }

        .grid-box.badge-trending::before {
            content: '📈';
            position: absolute;
            top: 4px;
            left: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #fbbf24;
            letter-spacing: 0.5px;
            text-shadow: 0 0 4px rgba(251, 191, 36, 0.5);
            z-index: 10;
        }

        .grid-box.badge-controversial {
            border-top: 4px solid #d946ef;
            box-shadow: 0 0 15px rgba(217, 70, 239, 0.4);
        }

        .grid-box.badge-controversial::before {
            content: '⚡';
            position: absolute;
            top: 4px;
            left: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #d946ef;
            letter-spacing: 0.5px;
            text-shadow: 0 0 4px rgba(217, 70, 239, 0.5);
            z-index: 10;
        }

        .grid-box.badge-verified {
            border-top: 4px solid #4ade80;
            box-shadow: 0 0 15px rgba(74, 222, 128, 0.4);
        }

        .grid-box.badge-verified::before {
            content: '✓';
            position: absolute;
            top: 4px;
            left: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #4ade80;
            letter-spacing: 0.5px;
            text-shadow: 0 0 4px rgba(74, 222, 128, 0.5);
            z-index: 10;
        }

        .grid-box.badge-liked {
            border-top: 4px solid #06b6d4;
            box-shadow: 0 0 15px rgba(6, 182, 212, 0.4);
        }

        .grid-box.badge-liked::before {
            content: '👍';
            position: absolute;
            top: 4px;
            left: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #06b6d4;
            letter-spacing: 0.5px;
            text-shadow: 0 0 4px rgba(6, 182, 212, 0.5);
            z-index: 10;
        }

        /* ========= PROXIMITY BADGE STYLES ========= */
        /* NEARBY - Local content (within grid) */
        .grid-box.badge-nearby {
            border-right: 4px solid #4ade80;
            box-shadow: 0 0 12px rgba(74, 222, 128, 0.3);
        }

        .grid-box.badge-nearby::after {
            content: '📍';
            position: absolute;
            bottom: 8px;
            right: 8px;
            font-size: 9px;
            font-weight: 700;
            color: #4ade80;
            background: rgba(0, 0, 0, 0.7);
            padding: 2px 6px;
            border-radius: 3px;
            text-shadow: 0 0 3px rgba(74, 222, 128, 0.6);
            z-index: 10;
        }

        /* FEATURED - Regional content (backfilled) */
        .grid-box.badge-featured {
            border-right: 4px solid #f59e0b;
            box-shadow: 0 0 12px rgba(245, 158, 11, 0.3);
        }

        .grid-box.badge-featured::after {
            content: '⭐';
            position: absolute;
            bottom: 8px;
            right: 8px;
            font-size: 9px;
            font-weight: 700;
            color: #f59e0b;
            background: rgba(0, 0, 0, 0.7);
            padding: 2px 6px;
            border-radius: 3px;
            text-shadow: 0 0 3px rgba(245, 158, 11, 0.6);
            z-index: 10;
        }

        /* COMMUNITY - Distant content (rare feature) */
        .grid-box.badge-community {
            border-right: 4px solid #a78bfa;
            box-shadow: 0 0 12px rgba(167, 139, 250, 0.3);
        }

        .grid-box.badge-community::after {
            content: '🌍';
            position: absolute;
            bottom: 8px;
            right: 8px;
            font-size: 9px;
            font-weight: 700;
            color: #a78bfa;
            background: rgba(0, 0, 0, 0.7);
            padding: 2px 6px;
            border-radius: 3px;
            text-shadow: 0 0 3px rgba(167, 139, 250, 0.6);
            z-index: 10;
        }

        /* ========= ENGAGEMENT TIER BADGES (HOT, PODIUM, etc.) ========= */
        /* HOT - Trending/Popular content (backfilled) */
        .grid-box.badge-hot {
            border-top: 3px solid #ef4444;
            box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
        }

        .grid-box.badge-hot::before {
            content: '🔥 HOT';
            position: absolute;
            top: 4px;
            left: 8px;
            font-size: 9px;
            font-weight: 700;
            color: #ef4444;
            text-shadow: 0 0 3px rgba(239, 68, 68, 0.6);
        }

        /* PODIUM - Top engagement (50+ likes) */
        .grid-box.badge-podium {
            border-top: 4px solid #fbbf24;
            box-shadow: 0 0 12px rgba(251, 191, 36, 0.5);
            background-clip: padding-box;
        }

        .grid-box.badge-podium::before {
            content: '🥇';
            position: absolute;
            top: 4px;
            left: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #fbbf24;
            text-shadow: 0 0 4px rgba(251, 191, 36, 0.7);
            letter-spacing: 0.5px;
            z-index: 10;
        }

        /* DISLIKED - Lower priority (more dislikes) - shown in sparse areas only */
        .grid-box.badge-disliked {
            border-left: 3px solid #9ca3af;
            box-shadow: 0 0 8px rgba(156, 163, 175, 0.2);
            opacity: 0.85;
        }

        .grid-box.badge-disliked::before {
            content: '👎';
            position: absolute;
            top: 4px;
            left: 8px;
            font-size: 9px;
            font-weight: 600;
            color: #9ca3af;
            text-shadow: 0 0 2px rgba(156, 163, 175, 0.4);
            z-index: 10;
        }

        /* NEW - Boosted visibility for user growth (fresh posts get prominent display) */
        .grid-box.badge-new {
            border: 2px solid #60a5fa;
            box-shadow: 0 0 15px rgba(96, 165, 250, 0.6), inset 0 0 8px rgba(96, 165, 250, 0.2);
            animation: newPostPulse 2s ease-in-out infinite;
        }

        @keyframes newPostPulse {
            0%, 100% {
                box-shadow: 0 0 15px rgba(96, 165, 250, 0.6), inset 0 0 8px rgba(96, 165, 250, 0.2);
            }
            50% {
                box-shadow: 0 0 25px rgba(96, 165, 250, 0.9), inset 0 0 12px rgba(96, 165, 250, 0.4);
            }
        }

        .grid-box.badge-new::before {
            content: '✨';
            position: absolute;
            top: 4px;
            left: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #60a5fa;
            text-shadow: 0 0 4px rgba(96, 165, 250, 0.8);
            letter-spacing: 0.5px;
        }

        /* 📝 Text-only post content: bigger on laptops/desktops, modest on phones.
           Boxes scroll so we can use a larger comfortable font without truncating. */
        .post-text-content {
            font-size: 28px;
            font-weight: 500;
            color: #f5f5f5;
            word-break: break-word;
            white-space: pre-wrap;
        }
        /* Tablets */
        @media (min-width: 768px) {
            .post-text-content { font-size: 42px; line-height: 1.35; }
        }
        /* Laptops */
        @media (min-width: 1024px) {
            .post-text-content { font-size: 120px; line-height: 1.25; }
        }
        /* Large desktops */
        @media (min-width: 1440px) {
            .post-text-content { font-size: 140px; line-height: 1.2; }
        }

        .grid-box.badge-crowned {
            border-top: 4px solid #fbbf24;
            box-shadow: inset 0 0 10px rgba(251, 191, 36, 0.3), 0 0 15px rgba(251, 191, 36, 0.5);
        }

        .grid-box.badge-crowned::before {
            content: '🥇';
            position: absolute;
            top: 4px;
            left: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #fbbf24;
            letter-spacing: 0.5px;
            text-shadow: 0 0 4px rgba(251, 191, 36, 0.6);
            animation: glow 2s ease-in-out infinite;
            z-index: 10;
        }

        .grid-box.badge-runner-up {
            border-top: 4px solid #a78bfa;
            box-shadow: inset 0 0 10px rgba(167, 139, 250, 0.3), 0 0 15px rgba(167, 139, 250, 0.5);
        }

        .grid-box.badge-runner-up::before {
            content: '🥈 2ND';
            position: absolute;
            top: 4px;
            left: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #a78bfa;
            letter-spacing: 0.5px;
            text-shadow: 0 0 4px rgba(167, 139, 250, 0.6);
            animation: glow 2s ease-in-out infinite;
            z-index: 10;
        }

        .grid-box.badge-podium {
            border-top: 4px solid #f97316;
            box-shadow: inset 0 0 10px rgba(249, 115, 22, 0.3), 0 0 15px rgba(249, 115, 22, 0.5);
        }

        .grid-box.badge-podium::before {
            content: '🥉 3RD';
            position: absolute;
            top: 4px;
            left: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #f97316;
            letter-spacing: 0.5px;
            text-shadow: 0 0 4px rgba(249, 115, 22, 0.6);
            animation: glow 2s ease-in-out infinite;
        }

        /* CROWNED + TRENDING split badge - most liked post shows both with glow */
        .grid-box.badge-crowned.badge-trending {
            border-top: 4px solid transparent;
            border-image: linear-gradient(to right, #fbbf24 0%, #fbbf24 50%, #fbbf24 50%, #fbbf24 100%) 1;
            box-shadow: inset 0 0 10px rgba(251, 191, 36, 0.3), 0 0 15px rgba(251, 191, 36, 0.5);
        }

        .grid-box.badge-crowned.badge-trending::before {
            content: '🥇';
            position: absolute;
            top: 4px;
            left: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #fbbf24;
            letter-spacing: 0.5px;
            text-shadow: 0 0 4px rgba(251, 191, 36, 0.6);
            animation: glow 2s ease-in-out infinite;
        }

        .grid-box.badge-crowned.badge-trending::after {
            content: '📈 TRENDING';
            position: absolute;
            top: 4px;
            right: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #fbbf24;
            letter-spacing: 0.5px;
            text-shadow: 0 0 4px rgba(251, 191, 36, 0.6);
            animation: glow 2s ease-in-out infinite;
        }

        @keyframes glow {
            0%, 100% { text-shadow: 0 0 4px rgba(251, 191, 36, 0.6); }
            50% { text-shadow: 0 0 8px rgba(251, 191, 36, 0.9); }
        }

        .grid-box.badge-disliked {
            border-top: 4px solid #8b5cf6;
            box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
        }

        .grid-box.badge-disliked::before {
            content: '👎';
            position: absolute;
            top: 4px;
            left: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #8b5cf6;
            letter-spacing: 0.5px;
            text-shadow: 0 0 4px rgba(139, 92, 246, 0.5);
        }

        .grid-box.badge-balanced {
            border: 2px solid #ec4899;
            box-shadow: 0 0 15px rgba(236, 72, 153, 0.4), 0 0 30px rgba(236, 72, 153, 0.2);
        }

        .grid-box.badge-balanced::before {
            content: '⚖️';
            position: absolute;
            top: 4px;
            left: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #ec4899;
            letter-spacing: 0.5px;
            text-shadow: 0 0 4px rgba(236, 72, 153, 0.5);
            z-index: 10;
        }

        /* ⚪ UNTOUCHED badge: zero likes AND zero dislikes (no votes yet) — neutral gray */
        .grid-box.badge-untouched {
            border: 2px solid #6b7280;
            box-shadow: 0 0 12px rgba(107, 114, 128, 0.35), 0 0 24px rgba(107, 114, 128, 0.15);
        }

        .grid-box.badge-untouched::before {
            content: '⚪ UNTOUCHED';
            position: absolute;
            top: 4px;
            left: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #9ca3af;
            letter-spacing: 0.5px;
            text-shadow: 0 0 4px rgba(107, 114, 128, 0.5);
            z-index: 10;
        }

        /* 👤 SELF-POST badge: User's own posts (positions 1-20) with special badge */
        .grid-box.badge-self-post {
            border: 2px solid #10b981;
            box-shadow: 0 0 15px rgba(16, 185, 129, 0.5), 0 0 30px rgba(16, 185, 129, 0.2);
            background-clip: padding-box;
        }

        .grid-box.badge-self-post::before {
            /* No textual label for self-posts — placement conveys ownership. */
            content: '';
            position: absolute;
            top: 4px;
            left: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #10b981;
            letter-spacing: 0.5px;
            text-shadow: 0 0 4px rgba(16, 185, 129, 0.7);
            animation: selfPostGlow 2s ease-in-out infinite;
            z-index: 10;
        }

        @keyframes selfPostGlow {
            0%, 100% { text-shadow: 0 0 4px rgba(16, 185, 129, 0.7); }
            50% { text-shadow: 0 0 8px rgba(16, 185, 129, 1); }
        }

        /* REDEMPTION badge: disliked posts that got likes */
        .grid-box.badge-redemption {
            border-top: 4px solid #f59e0b;
            box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
        }

        .grid-box.badge-redemption::before {
            content: '🔄';
            position: absolute;
            top: 4px;
            left: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #f59e0b;
            letter-spacing: 0.5px;
            text-shadow: 0 0 4px rgba(245, 158, 11, 0.5);
        }

        .grid-box.badge-media-content {
            border-top: 4px solid transparent;
            border-image: linear-gradient(to right, transparent 50%, #06b6d4 50%, #06b6d4 100%) 1;
            position: relative;
            box-shadow: 0 0 15px rgba(6, 182, 212, 0.4);
        }

        .grid-box.badge-media-content::before {
            content: '📝';
            position: absolute;
            top: 4px;
            right: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #06b6d4;
            letter-spacing: 0.5px;
            text-shadow: 0 0 4px rgba(6, 182, 212, 0.5);
        }

        /* Left half badge when MIXED is present */
        .grid-box.badge-media-content.badge-hot {
            border-image: linear-gradient(to right, #ef4444 0%, #ef4444 50%, #06b6d4 50%, #06b6d4 100%) 1;
        }

        .grid-box.badge-media-content.badge-hot::before {
            content: '🔥 HOT';
            position: absolute;
            top: 4px;
            left: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #ef4444;
            letter-spacing: 0.5px;
            text-shadow: 0 0 4px rgba(239, 68, 68, 0.5);
        }

        .grid-box.badge-media-content.badge-hot::after {
            content: '';
            position: absolute;
            top: 4px;
            right: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #06b6d4;
            letter-spacing: 0.5px;
            text-shadow: 0 0 4px rgba(6, 182, 212, 0.5);
        }

        .grid-box.badge-media-content.badge-rising {
            border-image: linear-gradient(to right, #f97316 0%, #f97316 50%, #06b6d4 50%, #06b6d4 100%) 1;
        }

        .grid-box.badge-media-content.badge-rising::before {
            content: '↑';
            position: absolute;
            top: 4px;
            left: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #f97316;
            letter-spacing: 0.5px;
            text-shadow: 0 0 4px rgba(249, 115, 22, 0.5);
        }

        .grid-box.badge-media-content.badge-rising::after {
            content: '';
            position: absolute;
            top: 4px;
            right: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #06b6d4;
            letter-spacing: 0.5px;
            text-shadow: 0 0 4px rgba(6, 182, 212, 0.5);
        }

        .grid-box.badge-media-content.badge-new {
            border-image: linear-gradient(to right, #60a5fa 0%, #60a5fa 50%, #06b6d4 50%, #06b6d4 100%) 1;
        }

        .grid-box.badge-media-content.badge-new::before {
            content: '✨';
            position: absolute;
            top: 4px;
            left: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #60a5fa;
            letter-spacing: 1px;
            text-shadow: 0 0 4px rgba(96, 165, 250, 0.5);
        }

        .grid-box.badge-media-content.badge-new::after {
            content: '';
            position: absolute;
            top: 4px;
            right: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #06b6d4;
            letter-spacing: 0.5px;
            text-shadow: 0 0 4px rgba(6, 182, 212, 0.5);
        }

        /* Split badge combinations - any two badges */
        .grid-box.badge-hot.badge-rising {
            border-image: linear-gradient(to right, #ef4444 0%, #ef4444 50%, #f97316 50%, #f97316 100%) 1;
        }

        .grid-box.badge-hot.badge-rising::before {
            content: '🔥 HOT';
            position: absolute;
            top: 4px;
            left: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #ef4444;
            letter-spacing: 0.5px;
            text-shadow: 0 0 4px rgba(239, 68, 68, 0.5);
        }

        .grid-box.badge-hot.badge-rising::after {
            content: '↑ RISING';
            position: absolute;
            top: 4px;
            right: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #f97316;
            letter-spacing: 0.5px;
            text-shadow: 0 0 4px rgba(249, 115, 22, 0.5);
        }

        .grid-box.badge-new.badge-hot {
            border-image: linear-gradient(to right, #60a5fa 0%, #60a5fa 50%, #ef4444 50%, #ef4444 100%) 1;
        }

        .grid-box.badge-new.badge-hot::before {
            content: 'NEW';
            position: absolute;
            top: 4px;
            left: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #60a5fa;
            letter-spacing: 1px;
            text-shadow: 0 0 4px rgba(96, 165, 250, 0.5);
        }

        .grid-box.badge-new.badge-hot::after {
            content: '🔥 HOT';
            position: absolute;
            top: 4px;
            right: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #ef4444;
            letter-spacing: 0.5px;
            text-shadow: 0 0 4px rgba(239, 68, 68, 0.5);
        }

        .grid-box.badge-new.badge-rising {
            border-image: linear-gradient(to right, #60a5fa 0%, #60a5fa 50%, #f97316 50%, #f97316 100%) 1;
        }

        .grid-box.badge-new.badge-rising::before {
            content: 'NEW';
            position: absolute;
            top: 4px;
            left: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #60a5fa;
            letter-spacing: 1px;
            text-shadow: 0 0 4px rgba(96, 165, 250, 0.5);
        }

        .grid-box.badge-new.badge-rising::after {
            content: '';
            position: absolute;
            top: 4px;
            right: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #f97316;
            letter-spacing: 0.5px;
            text-shadow: 0 0 4px rgba(249, 115, 22, 0.5);
        }

        .grid-box.badge-hot.badge-trending {
            border-image: linear-gradient(to right, #ef4444 0%, #ef4444 50%, #fbbf24 50%, #fbbf24 100%) 1;
        }

        .grid-box.badge-hot.badge-trending::before {
            content: '🔥 HOT';
            position: absolute;
            top: 4px;
            left: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #ef4444;
            letter-spacing: 0.5px;
            text-shadow: 0 0 4px rgba(239, 68, 68, 0.5);
        }

        .grid-box.badge-hot.badge-trending::after {
            content: '📈 TRENDING';
            position: absolute;
            top: 4px;
            right: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #fbbf24;
            letter-spacing: 0.5px;
            text-shadow: 0 0 4px rgba(251, 191, 36, 0.5);
        }

        .grid-box.badge-controversial.badge-disliked {
            border-image: linear-gradient(to right, #d946ef 0%, #d946ef 50%, #8b5cf6 50%, #8b5cf6 100%) 1;
        }

        .grid-box.badge-controversial.badge-disliked::before {
            content: '⚡';
            position: absolute;
            top: 4px;
            left: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #d946ef;
            letter-spacing: 0.5px;
            text-shadow: 0 0 4px rgba(217, 70, 239, 0.5);
        }

        .grid-box.badge-controversial.badge-disliked::after {
            content: '👎';
            position: absolute;
            top: 4px;
            right: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #8b5cf6;
            letter-spacing: 0.5px;
            text-shadow: 0 0 4px rgba(139, 92, 246, 0.5);
        }

        /* LIKED + NEW: cyan/blue split */
        .grid-box.badge-liked.badge-new {
            border-image: linear-gradient(to right, #06b6d4 0%, #06b6d4 50%, #60a5fa 50%, #60a5fa 100%) 1;
        }

        .grid-box.badge-liked.badge-new::before {
            content: '👍 LIKED';
            position: absolute;
            top: 4px;
            left: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #06b6d4;
            letter-spacing: 0.5px;
            text-shadow: 0 0 4px rgba(6, 182, 212, 0.5);
        }

        .grid-box.badge-liked.badge-new::after {
            content: 'NEW';
            position: absolute;
            top: 4px;
            right: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #60a5fa;
            letter-spacing: 1px;
            text-shadow: 0 0 4px rgba(96, 165, 250, 0.5);
        }

        /* LIKED + MIXED: both cyan, showing both meanings */
        .grid-box.badge-liked.badge-media-content {
            border-image: linear-gradient(to right, #06b6d4 0%, #06b6d4 50%, #06b6d4 50%, #06b6d4 100%) 1;
        }

        .grid-box.badge-liked.badge-media-content::before {
            content: '👍 LIKED';
            position: absolute;
            top: 4px;
            left: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #06b6d4;
            letter-spacing: 0.5px;
            text-shadow: 0 0 4px rgba(6, 182, 212, 0.5);
        }

        .grid-box.badge-liked.badge-media-content::after {
            content: '';
            position: absolute;
            top: 4px;
            right: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #06b6d4;
            letter-spacing: 0.5px;
            text-shadow: 0 0 4px rgba(6, 182, 212, 0.5);
        }

        /* BALANCED + NEW: split badge */
        .grid-box.badge-balanced.badge-new {
            border-image: linear-gradient(to right, #ec4899 0%, #ec4899 50%, #60a5fa 50%, #60a5fa 100%) 1;
        }

        .grid-box.badge-balanced.badge-new::before {
            content: '⚖️ BALANCED';
            position: absolute;
            top: 4px;
            left: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #ec4899;
            letter-spacing: 0.5px;
            text-shadow: 0 0 4px rgba(236, 72, 153, 0.5);
        }

        .grid-box.badge-balanced.badge-new::after {
            content: 'NEW';
            position: absolute;
            top: 4px;
            right: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #60a5fa;
            letter-spacing: 1px;
            text-shadow: 0 0 4px rgba(96, 165, 250, 0.5);
        }

        /* BALANCED + MIXED: split badge */
        .grid-box.badge-balanced.badge-media-content {
            border-image: linear-gradient(to right, #ec4899 0%, #ec4899 50%, #06b6d4 50%, #06b6d4 100%) 1;
        }

        .grid-box.badge-balanced.badge-media-content::before {
            content: '⚖️ BALANCED';
            position: absolute;
            top: 4px;
            left: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #ec4899;
            letter-spacing: 0.5px;
            text-shadow: 0 0 4px rgba(236, 72, 153, 0.5);
        }

        .grid-box.badge-balanced.badge-media-content::after {
            content: '';
            position: absolute;
            top: 4px;
            right: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #06b6d4;
            letter-spacing: 0.5px;
            text-shadow: 0 0 4px rgba(6, 182, 212, 0.5);
        }

        /* SPOTLIGHT badge - half badge on right side for rotating unpopular posts */
        .grid-box.badge-spotlight {
            border-top: 2px solid #ec4899;
            position: relative;
            box-shadow: 0 0 15px rgba(236, 72, 153, 0.4);
        }

        .grid-box.badge-spotlight::before {
            content: '💥';
            position: absolute;
            top: 4px;
            right: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #ec4899;
            letter-spacing: 0.5px;
            text-shadow: 0 0 4px rgba(236, 72, 153, 0.5);
        }

        /* Combinations with SPOTLIGHT badge on right half */
        .grid-box.badge-hot.badge-spotlight {
            border-top: 2px solid transparent;
            border-image: linear-gradient(to right, #ef4444 0%, #ef4444 50%, #ec4899 50%, #ec4899 100%) 1;
        }

        .grid-box.badge-hot.badge-spotlight::before {
            content: '🔥 HOT';
            position: absolute;
            top: 4px;
            left: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #ef4444;
            letter-spacing: 0.5px;
            text-shadow: 0 0 4px rgba(239, 68, 68, 0.5);
        }

        .grid-box.badge-hot.badge-spotlight::after {
            content: '';
            position: absolute;
            top: 4px;
            right: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #ec4899;
            letter-spacing: 0.5px;
            text-shadow: 0 0 4px rgba(236, 72, 153, 0.5);
        }

        .grid-box.badge-new.badge-spotlight {
            border-top: 2px solid transparent;
            border-image: linear-gradient(to right, #60a5fa 0%, #60a5fa 50%, #ec4899 50%, #ec4899 100%) 1;
        }

        .grid-box.badge-new.badge-spotlight::before {
            content: 'NEW';
            position: absolute;
            top: 4px;
            left: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #60a5fa;
            letter-spacing: 1px;
            text-shadow: 0 0 4px rgba(96, 165, 250, 0.5);
        }

        .grid-box.badge-new.badge-spotlight::after {
            content: '';
            position: absolute;
            top: 4px;
            right: 8px;
            font-size: 10px;
            font-weight: 700;
            color: #ec4899;
            letter-spacing: 0.5px;
            text-shadow: 0 0 4px rgba(236, 72, 153, 0.5);
        }

        .upload-panel {
            width: 280px;
            background-color: #1a1a1a;
            border: 1px solid #333;
            border-radius: 8px;
            padding: 24px;
            display: flex;
            flex-direction: column;
            gap: 16px;
            transition: background-color 0.8s ease, border-color 0.8s ease, color 0.8s ease;
            flex-shrink: 0;
            flex-grow: 0;
            max-height: calc(100vh - 200px);
            overflow-y: auto;
        }

        .upload-panel h3 {
            font-size: 16px;
            font-weight: 600;
        }

        .upload-area {
            border: 2px solid #667eea;
            border-radius: 8px;
            padding: 24px;
            text-align: center;
            cursor: pointer;
            transition: all 0.2s ease;
            min-height: 120px;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-direction: column;
            gap: 8px;
            background-color: #1a1a1a;
            box-shadow: 0 0 15px rgba(102, 126, 234, 0.2);
        }

        .upload-area:hover {
            border-color: #8b9aff;
            background-color: #252525;
            box-shadow: 0 0 20px rgba(102, 126, 234, 0.4);
        }

        .upload-area.dragover {
            border-color: #888;
            background-color: #333333;
        }

        .upload-icon {
            font-size: 28px;
        }

        .upload-text {
            font-size: 12px;
            color: #888;
            font-family: 'Segoe UI', 'Helvetica Neue', sans-serif;
            font-weight: 600;
            letter-spacing: 0.2px;
        }

        @keyframes slideIn {
            from {
                opacity: 0;
                transform: translateX(-50%) translateY(-10px);
            }
            to {
                opacity: 1;
                transform: translateX(-50%) translateY(0);
            }
        }

        @keyframes slideOut {
            from {
                opacity: 1;
                transform: translateX(-50%) translateY(0);
            }
            to {
                opacity: 0;
                transform: translateX(-50%) translateY(-10px);
            }
        }

        @keyframes pulse {
            0%, 100% {
                opacity: 1;
                box-shadow: 0 0 0 0 currentColor;
            }
            50% {
                opacity: 0.7;
                box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.3);
            }
        }

        @keyframes pulseGreen {
            0%, 100% {
                opacity: 1;
                box-shadow: 0 0 0 0 currentColor;
            }
            50% {
                opacity: 0.7;
                box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.3);
            }
        }

        input[type="file"] {
            display: none;
        }

        .status-dot {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            transition: background-color 0.3s ease;
            cursor: pointer;
            user-select: none;
        }

        .status-dot.connected {
            background-color: #fff;
            animation: pulseGreen 2s infinite;
        }

        .status-dot.disconnected {
            background-color: #ff6b6b;
            animation: pulse 2s infinite;
        }

        .upload-buttons {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        button {
            padding: 12px 16px;
            background-color: #555;
            color: #fff;
            border: none;
            border-radius: 6px;
            font-weight: 600;
            font-size: 14px;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        button:hover {
            background-color: #666;
            transform: translateY(-2px);
        }

        .secondary-btn {
            background-color: #3a3a3a;
            color: #999;
            border: 2px solid #555;
        }

        .secondary-btn:hover {
            background-color: #424242;
            border-color: #666;
            color: #fff;
        }

        .poi-connect-btn {
            background-color: #555;
            color: #fff;
            width: 100%;
        }

        .poi-connect-btn:hover {
            background-color: #666;
        }

        @media (max-width: 1024px) {
            .container {
                flex-direction: column;
                padding: 20px;
                gap: 20px;
            }

            .upload-panel {
                width: 100%;
                order: -1;
            }
        }

        /* Mobile phone styles - reduce all sizes */
        @media (max-width: 599px) {
            body {
                font-size: 12px;
            }

            .container {
                padding: 4px;
                gap: 4px;
            }

            .upload-panel {
                padding: 8px;
                gap: 4px;
            }

            .upload-icons {
                font-size: 28px !important;
                gap: 8px !important;
            }

            .upload-text {
                font-size: 11px !important;
            }

            #postText {
                font-size: 13px !important;
                padding: 8px !important;
                min-height: 80px !important;
            }

            #postLink {
                font-size: 13px !important;
                padding: 8px 12px !important;
                margin-top: 24px !important;
                margin-bottom: 12px !important;
            }

            #postLink::placeholder {
                color: #666 !important;
            }

            #charCountDisplay {
                font-size: 12px !important;
                bottom: 4px !important;
                right: 4px !important;
            }

            #charError {
                font-size: 10px !important;
            }

            .upload-button, 
            #uploadBtn {
                padding: 6px 12px !important;
                font-size: 11px !important;
            }

            .grid {
                gap: 6px;
            }

            .grid-box {
                padding: 6px;
                border-radius: 4px;
            }

            .grid-box-title {
                font-size: 11px;
                line-height: 1.3;
            }

            .grid-box-details {
                font-size: 9px;
                gap: 3px;
                margin-top: 3px;
            }

            .modal-content {
                padding: 12px !important;
                width: 90vw !important;
                max-width: 85vw !important;
                border-radius: 6px;
                max-height: 85vh;
                margin: auto;
            }

            .modal-header {
                margin-bottom: 12px;
            }

            .modal-header h2 {
                font-size: 16px !important;
            }

            .modal-close {
                font-size: 20px !important;
                width: 24px !important;
                height: 24px !important;
            }

            .vote-badge {
                padding: 4px !important;
                gap: 4px !important;
                font-size: 10px !important;
            }

            .vote-button {
                padding: 3px 4px !important;
                font-size: 8px !important;
            }

            .badge {
                padding: 2px 4px;
                font-size: 8px;
            }

            button {
                font-size: 11px;
                padding: 6px 10px;
            }

            input[type="text"],
            input[type="email"],
            textarea {
                font-size: 13px !important;
            }

            .comments-section {
                max-height: 120px;
            }

            .comment-item {
                padding: 6px;
                font-size: 11px;
            }

            .post-controls {
                gap: 3px;
            }

            .view-modal-content {
                padding: 12px !important;
                width: 90vw !important;
                max-width: 85vw !important;
                border-radius: 6px;
                max-height: 80vh;
                margin: auto;
            }

            .view-modal-content h2 {
                font-size: 14px !important;
                margin-bottom: 8px !important;
            }

            .view-modal-content p {
                font-size: 12px !important;
                line-height: 1.4;
                margin-bottom: 8px !important;
            }

            .view-modal-close {
                font-size: 18px !important;
            }
        }

        .grid::-webkit-scrollbar {
            width: 6px;
        }

        .grid::-webkit-scrollbar-track {
            background: transparent;
        }

        .grid::-webkit-scrollbar-thumb {
            background: #444;
            border-radius: 3px;
        }

        .grid::-webkit-scrollbar-thumb:hover {
            background: #555;
        }

        #commentsList::-webkit-scrollbar {
            width: 6px;
        }

        #commentsList::-webkit-scrollbar-track {
            background: transparent;
        }

        #commentsList::-webkit-scrollbar-thumb {
            background: #444;
            border-radius: 3px;
        }

        #commentsList::-webkit-scrollbar-thumb:hover {
            background: #555;
        }

        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: rgba(0, 0, 0, 0.7);
            z-index: 1000;
            align-items: center;
            justify-content: center;
            width: 100%;
            height: 100%;
            max-width: 100%;
        }

        .modal.active {
            display: flex;
        }

        .modal-content {
            background-color: #2a2a2a;
            border: 1px solid #4ade80;
            border-radius: 12px;
            padding: 32px;
            width: 90%;
            max-width: 400px;
            max-height: 80vh;
            overflow-y: auto;
            max-width: min(90vw, 400px);
            transition: background-color 0.8s ease, border-color 0.8s ease, color 0.8s ease;
        }

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

        .modal-header h2 {
            font-size: 18px;
            color: #fff;
        }

        .modal-close {
            background: none;
            border: none;
            color: #999;
            font-size: 24px;
            cursor: pointer;
            padding: 0;
            width: 30px;
            height: 30px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .modal-close:hover {
            color: #fff;
        }

        .modal .upload-area {
            margin-bottom: 8px;
        }

        .modal textarea {
            margin-bottom: 8px;
        }

        .modal .upload-buttons {
            margin-bottom: 0;
        }

        .view-modal {
            /* Keep modal in DOM to avoid layout thrash; toggle visibility with opacity/pointer-events */
            display: flex;
            position: fixed;
            inset: 0;
            background-color: rgba(0, 0, 0, 0.85);
            z-index: 1001;
            align-items: center;
            justify-content: center;
            padding: 20px;
            opacity: 0;
            pointer-events: none;
            transition: opacity 200ms ease;
        }

        .view-modal.active {
            opacity: 1;
            pointer-events: auto;
        }

        .view-modal-content {
            background-color: #1a1a1a;
            border: 1px solid #333;
            border-radius: 12px;
            padding: 24px;
            width: 95%;
            max-width: 700px;
            max-height: 85vh;
            overflow-y: auto;
            /* Use transform/opacity for smooth, GPU-accelerated entrance */
            transform: translateY(12px) scale(0.995);
            opacity: 0;
            transition: transform 220ms cubic-bezier(.2,.9,.2,1), opacity 220ms ease, box-shadow 220ms ease;
            will-change: transform, opacity;
        }

        .view-modal.active .view-modal-content {
            transform: translateY(0) scale(1);
            opacity: 1;
        }

        /* Vote button visual classes with transitions to avoid inline style thrash */
        .vote-button {
            transition: background-color 160ms ease, color 160ms ease, transform 120ms ease;
        }
        .vote-button.voted-like {
            background-color: #fff !important;
            color: #111827 !important;
            transform: translateY(-1px);
        }
        .vote-button.voted-dislike {
            background-color: #f44336 !important;
            color: #fff !important;
            transform: translateY(-1px);
        }

        /* Modal glow effects matching post badges */
        .view-modal-content.glow-liked {
            border: 1px solid #06b6d4;
            box-shadow: 0 0 20px rgba(6, 182, 212, 0.4);
        }

        .view-modal-content.glow-crowned {
            border: 1px solid #fbbf24;
            box-shadow: 0 0 20px rgba(251, 191, 36, 0.5);
        }

        .view-modal-content.glow-runner-up {
            border: 1px solid #a78bfa;
            box-shadow: 0 0 20px rgba(167, 139, 250, 0.5);
        }

        .view-modal-content.glow-podium {
            border: 1px solid #60a5fa;
            box-shadow: 0 0 20px rgba(96, 165, 250, 0.5);
        }

        .view-modal-content.glow-balanced {
            border: 1px solid #ec4899;
            box-shadow: 0 0 20px rgba(236, 72, 153, 0.4);
        }

        .view-modal-content.glow-untouched {
            border: 1px solid #6b7280;
            box-shadow: 0 0 18px rgba(107, 114, 128, 0.35);
        }

        .view-modal-content.glow-disliked {
            border: 1px solid #8b5cf6;
            box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
        }

        .view-modal-content.glow-hot {
            border: 1px solid #f87171;
            box-shadow: 0 0 20px rgba(248, 113, 113, 0.4);
        }

        .view-modal-content.glow-rising {
            border: 1px solid #fb923c;
            box-shadow: 0 0 20px rgba(251, 146, 60, 0.4);
        }

        .view-modal-close {
            background: none;
            border: none;
            color: #888;
            font-size: 24px;
            cursor: pointer;
            padding: 0;
            width: 30px;
            height: 30px;
            display: none;
            align-items: center;
            justify-content: center;
            margin-left: auto;
            margin-bottom: 24px;
        }

        .view-modal-close:hover {
            color: #fff;
        }

        .admin-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.8);
            z-index: 9999;
            align-items: center;
            justify-content: center;
        }

        .admin-modal.active {
            display: flex;
        }

        .admin-modal-content {
            background-color: #1a1a1a;
            border: 1px solid #333;
            border-radius: 12px;
            padding: 30px;
            max-width: 400px;
            width: 90%;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
        }

        .admin-page {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: #0a0a0a;
            z-index: 9998;
            flex-direction: column;
        }

        .admin-page.active {
            display: flex;
        }

        .admin-header {
            padding: 20px 30px;
            border-bottom: 1px solid #222;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .admin-content {
            flex: 1;
            padding: 30px;
            overflow-y: auto;
        }

        .view-content-icon {
            font-size: 80px;
            margin-bottom: 32px;
        }


        /* 🌍 EMOJI MINIMALISM — the brand logo is the ONLY emoji on screen.
           Badges still get their colored border-right + box-shadow glow (defined per class),
           but the corner emoji pill (::before / ::after content) is hidden so the logo
           reads as the page's single visual emoji anchor. */
        .grid-box[class*="badge-"]::before,
        .grid-box[class*="badge-"]::after {
            content: none !important;
        }

        /* 🚀 BOOST badge — emoji-free, just a glowing amber edge so the brand earth stays the lone emoji.
           Three permanent end-state variants stamp the buyer's RESULT (peak rank achieved):
           - boost-crowned  : peaked at #1 — gold edge + stronger glow (kept forever)
           - boost-podium   : peaked top-3 — amber edge
           - boost-spotlight: never reached top-3 but the buyer paid — warm edge, still recognised
           These propagate into areaBadges so §7b keeps surfacing the post organically. */
        .grid-box.badge-boost {
            border-right: 5px solid #fbbf24 !important;
            box-shadow: 0 0 16px rgba(251, 191, 36, 0.55), inset 0 0 0 1px rgba(251,191,36,0.35) !important;
        }
        body.light-mode .grid-box.badge-boost {
            border-right: 5px solid #d97706 !important;
            box-shadow: 0 0 14px rgba(217, 119, 6, 0.45) !important;
        }
        .grid-box.badge-boost-crowned {
            border-right: 6px solid #ffd700 !important;
            box-shadow: 0 0 22px rgba(255, 215, 0, 0.7), inset 0 0 0 1px rgba(255,215,0,0.45) !important;
        }
        .grid-box.badge-boost-podium {
            border-right: 5px solid #fbbf24 !important;
            box-shadow: 0 0 18px rgba(251, 191, 36, 0.6), inset 0 0 0 1px rgba(251,191,36,0.4) !important;
        }
        .grid-box.badge-boost-spotlight {
            border-right: 4px solid #f59e0b !important;
            box-shadow: 0 0 12px rgba(245, 158, 11, 0.45) !important;
        }
#autocompleteDropdown::-webkit-scrollbar {
                        width: 8px;
                    }
                    
                    #autocompleteDropdown::-webkit-scrollbar-track {
                        background-color: #1a1a1a;
                        border-radius: 4px;
                    }
                    
                    #autocompleteDropdown::-webkit-scrollbar-thumb {
                        background-color: #667eea;
                        border-radius: 4px;
                        border: 2px solid #1a1a1a;
                    }
                    
                    #autocompleteDropdown::-webkit-scrollbar-thumb:hover {
                        background-color: #8b9aff;
                    }
@keyframes pulse {
                0%, 100% { opacity: 1; transform: scale(1); }
                50% { opacity: 0.7; transform: scale(1.1); }
            }