        :root {
            --green: #538d4e;
            --yellow: #b59f3b;
            --orange: #ce7d2b;
            --bg: #0b0b0b;
            --dark: #212121;
            --text: #ffffff;
            --glow: rgba(83, 141, 78, 0.6);
            --card-bg: #1a1a1a;
        }

        body {
            background-color: var(--bg);
            color: var(--text);
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 0;
            margin: 0;
            min-height: 100vh;
            overflow-x: hidden;
        }

        /* --- NAVIGATION --- */
        nav {
            width: 100%;
            background: #111;
            border-bottom: 1px solid #333;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 10px 0;
            position: sticky;
            top: 0;
            z-index: 2000;
        }

        .home-link {
            text-decoration: none;
            cursor: pointer;
        }

        .title-container {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            margin-bottom: 8px;
        }

        .title-logo {
            width: 40px;
            height: 40px;
            border-radius: 8px;
            border: 2px solid var(--green);
            object-fit: cover;
        }

        .header-main {
            font-size: 1.8rem;
            font-weight: 900;
            color: var(--green);
            text-shadow: 0 0 10px var(--glow);
            letter-spacing: 2px;
            margin: 0;
        }

        .nav-buttons {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 5px;
            width: 100%;
            padding: 0 5px;
            box-sizing: border-box;
        }

        .nav-btn {
            background: none;
            border: none;
            color: #888;
            font-weight: bold;
            cursor: pointer;
            padding: 10px 12px;
            transition: 0.3s;
            font-size: 0.8rem;
            text-transform: uppercase;
        }

        .nav-btn.active {
            color: var(--green);
            border-bottom: 2px solid var(--green);
        }

        .kofi-btn {
            background: var(--green);
            color: white;
            border-radius: 20px;
            padding: 8px 12px;
            text-decoration: none;
            font-size: 0.75rem;
            font-weight: 800;
            display: flex;
            align-items: center;
            gap: 4px;
        }

        /* --- SEARCH BOX --- */
        .search-box {
            width: 100%;
            position: relative;
            margin-bottom: 15px;
        }

        input {
            width: 100%;
            padding: 16px;
            border-radius: 12px;
            border: 2px solid #333;
            background: #111;
            color: white;
            box-sizing: border-box;
            font-size: 1.1rem;
            text-align: center;
            outline: none;
            appearance: none;
        }

        #dropdown {
            position: absolute;
            width: 100%;
            background: #1a1a1a;
            z-index: 3000;
            border-radius: 12px;
            max-height: 400px;
            overflow-y: auto;
            display: none;
            border: 2px solid #444;
            margin-top: 8px;
            box-shadow: 0 15px 30px rgba(0, 0, 0, 0.7);
        }

        .item {
            padding: 10px 20px;
            cursor: pointer;
            border-bottom: 1px solid #222;
            text-align: left;
            transition: background 0.2s;
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .item:hover {
            background: #252525;
        }

        .dropdown-thumb {
            width: 40px;
            height: 40px;
            border-radius: 8px;
            object-fit: cover;
            flex-shrink: 0;
        }

        /* --- GAME CARDS --- */
        .char-card {
            background: var(--card-bg);
            border-radius: 15px;
            padding: 12px;
            border: 1px solid #333;
            margin-bottom: 12px;
            width: 100%;
            box-sizing: border-box;
            animation: slideDown 0.4s ease-out;
        }

        .char-header {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 10px;
        }

        /* --- GENRE TAGS (replaces the old Genre grid box) --- */
        .genre-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            margin-bottom: 10px;
        }

        .genre-tag {
            background: #262626;
            color: #ccc;
            border: 1px solid #3a3a3a;
            font-size: 0.6rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            padding: 5px 12px;
            border-radius: 20px;
        }

        .genre-tag.green {
            background: var(--green);
            border-color: var(--green);
            color: #fff;
        }

        .genre-tag.yellow {
            background: var(--yellow);
            border-color: var(--yellow);
            color: #000;
        }

        .genre-tag.plain {
            background: #4a4a4a;
            border-color: #4a4a4a;
            color: #ddd;
        }

        .char-image {
            width: 50px;
            height: 70px;
            border-radius: 6px;
            object-fit: cover;
            background: #222;
            border: 1px solid #444;
        }

        .attr-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 6px;
        }

        .attr-box {
            background: #262626;
            padding: 6px 2px;
            border-radius: 6px;
            text-align: center;
            font-size: 0.65rem;
            min-height: 45px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            color: #ffffff !important;
            animation: flipInNormal 0.6s ease-out forwards;
        }

        .attr-label {
            font-size: 0.5rem;
            color: #e0e0e0;
            text-transform: uppercase;
            margin-bottom: 2px;
            font-weight: 600;
        }

        /* Series box takes the space Genre used to occupy in the 4x2
           grid, so it spans 2 columns instead of 1 to keep a clean
           8-cell grid (2 for Series + 6 single boxes = 8). */
        .attr-box-wide {
            grid-column: span 2;
        }

        .attr-box-wide .attr-label {
            font-size: 0.6rem;
        }

        .attr-box-wide span:last-child b {
            font-size: 0.85rem;
        }

        /* --- LINKS --- */
        .char-link {
            color: inherit;
            text-decoration: none;
            border-bottom: 1px dashed transparent;
            transition: 0.2s;
        }

        .char-link:hover {
            color: var(--green);
            border-bottom: 1px dashed var(--green);
        }

        /* --- LAYOUT SECTIONS --- */
        .view-section {
            display: none;
            width: 92%;
            max-width: 600px;
            padding: 15px 0;
        }

        .view-section.active {
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .archive-table {
            width: 100%;
            border-collapse: collapse;
            background: var(--card-bg);
            border-radius: 12px;
            overflow: hidden;
            border: 1px solid #333;
        }

        .archive-table th {
            background: #222;
            color: var(--green);
            padding: 10px;
            text-align: left;
            font-size: 0.75rem;
        }

        .archive-table td {
            padding: 10px;
            border-bottom: 1px solid #333;
            font-size: 0.85rem;
        }

        .archive-table tr.hidden {
            display: none;
        }

        .menu-btn {
            width: 100%;
            padding: 16px;
            margin: 8px 0;
            border: none;
            border-radius: 12px;
            font-weight: 800;
            cursor: pointer;
            font-size: 1rem;
            transition: 0.2s;
        }

        /* --- DAILY REFRESH METRICS MODULE --- */
        .daily-meta-container {
            width: 100%;
            background: var(--card-bg);
            border: 1px solid #333;
            border-radius: 20px;
            padding: 20px 15px;
            margin-top: 25px;
            box-sizing: border-box;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 15px;
        }

        .daily-meta-split {
            display: grid;
            grid-template-columns: 1fr;
            width: 100%;
            gap: 15px;
        }

        @media (min-width: 480px) {
            .daily-meta-split {
                grid-template-columns: 1fr 1fr;
            }
        }

        .meta-sub-block {
            background: #111;
            border: 1px solid #222;
            border-radius: 12px;
            padding: 15px 10px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
        }

        .meta-caption {
            font-size: 0.65rem;
            color: #888;
            text-transform: uppercase;
            font-weight: bold;
            letter-spacing: 1px;
            margin-bottom: 8px;
        }

        .meta-countdown-timer {
            font-size: 1.6rem;
            font-weight: 900;
            color: var(--orange);
            font-variant-numeric: tabular-nums;
        }

        .yesterday-avatar {
            width: 55px;
            height: 75px;
            border-radius: 6px;
            object-fit: cover;
            border: 1px solid #333;
            margin-bottom: 6px;
            background: #222;
        }

        /* --- ANIMATIONS --- */
        @keyframes flipInGreen {
            0% { transform: rotateX(90deg); opacity: 0; }
            100% { transform: rotateX(0deg); opacity: 1; background: var(--green); }
        }

        @keyframes flipInYellow {
            0% { transform: rotateX(90deg); opacity: 0; }
            100% { transform: rotateX(0deg); opacity: 1; background: var(--yellow); }
        }

        @keyframes flipInOrange {
            0% { transform: rotateX(90deg); opacity: 0; }
            100% { transform: rotateX(0deg); opacity: 1; background: var(--orange); }
        }

        @keyframes flipInNormal {
            0% { transform: rotateX(90deg); opacity: 0; }
            100% { transform: rotateX(0deg); opacity: 1; }
        }

        .attr-box.green {
            animation: flipInGreen 0.6s ease-out forwards !important;
        }

        .attr-box.yellow {
            animation: flipInYellow 0.6s ease-out forwards !important;
        }

        .attr-box.orange {
            animation: flipInOrange 0.6s ease-out forwards !important;
        }

        /* FIX #7: distinct visual state for missing/unknown data,
           so it reads differently from a genuine "wrong" (black) guess */
        .attr-box.unknown {
            background: #2f2f2f;
            border: 1px dashed #666;
        }

        @keyframes slideDown {
            from { opacity: 0; transform: translateY(-15px); }
            to { opacity: 1; transform: translateY(0); }
        }

        @media (max-width: 480px) {
            .attr-grid {
                grid-template-columns: repeat(2, 1fr);
            }
        }
