/* =================================
    CSS VARIABLES (Light & Dark Mode)
    ================================= */
:root {
    /* Light Mode */
    --body-background: #f8f8f8;
    --main-text-color: #555;
    --heading-color: #333;
    --card-background: #fff;
    --card-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    --card-border: #e0e0e0;
    --game-card-bg: #f8f8f8;
    --game-card-hover-bg: #fff;
    --game-card-hover-border: orange;
    --game-label-color: #333;
    --game-value-color: #555;
    --separator-color: #ccc;
    --sidebar-border-color: #ccc;
    --sidebar-link-color: #555;
    --sidebar-link-hover-bg: #f0f0f0;
    --sidebar-link-hover-color: #333;
    --sidebar-active-bg: #e6f3ff;
    --sidebar-active-color: #004c87;
    --sidebar-active-border: #0066cc;
    --filter-header-bg: #f7f7f7;
    --filter-header-hover-bg: #eee;
    --filter-link-color: #0066cc;
    --filter-link-hover-color: #005fa3;
    --filter-link-hover-bg: #f0f8ff;
    --filter-link-selected-bg: #e6f3ff;
    --filter-link-selected-color: #004c87;
    --responsive-border-bottom: #ccc;

    /* Region Colors */
    --region-jp-color: crimson;
    --region-eu-color: steelblue;
    --region-us-color: forestgreen;
}

/* Dark Mode - Activated by System Preference or Manual Toggle */
@media (prefers-color-scheme: dark) {
    :root {
        --body-background: #1a1a1a;
        --main-text-color: #ccc;
        --heading-color: #e0e0e0;
        --card-background: #2a2a2a;
        --card-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
        --card-border: #333;
        --game-card-bg: #222;
        --game-card-hover-bg: #111;
        --game-card-hover-border: orange;
        --game-label-color: #e0e0e0;
        --game-value-color: #ccc;
        --separator-color: #555;
        --sidebar-border-color: #444;
        --sidebar-link-color: #aaa;
        --sidebar-link-hover-bg: #2a2a2a;
        --sidebar-link-hover-color: #e0e0e0;
        --sidebar-active-bg: #293846;
        --sidebar-active-color: #92b0d3;
        --sidebar-active-border: #79a1d1;
        --filter-header-bg: #282828;
        --filter-header-hover-bg: #333;
        --filter-link-color: #79a1d1;
        --filter-link-hover-color: #5580a8;
        --filter-link-hover-bg: #2a3a4a;
        --filter-link-selected-bg: #293846;
        --filter-link-selected-color: #92b0d3;
        --responsive-border-bottom: #444;

        /* Region Colors (Better contrast for dark mode) */
        --region-jp-color: #e0778a;
        --region-eu-color: #91b3d5;
        --region-us-color: #8cc474;
    }
}

body[data-theme='dark'] {
    /* Manual Dark Mode Override */
    --body-background: #1a1a1a;
    --main-text-color: #ccc;
    --heading-color: #e0e0e0;
    --card-background: #2a2a2a;
    --card-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    --card-border: #333;
    --game-card-bg: #222;
    --game-card-hover-bg: #111;
    --game-card-hover-border: orange;
    --game-label-color: #e0e0e0;
    --game-value-color: #ccc;
    --separator-color: #555;
    --sidebar-border-color: #444;
    --sidebar-link-color: #aaa;
    --sidebar-link-hover-bg: #2a2a2a;
    --sidebar-link-hover-color: #e0e0e0;
    --sidebar-active-bg: #293846;
    --sidebar-active-color: #92b0d3;
    --sidebar-active-border: #79a1d1;
    --filter-header-bg: #282828;
    --filter-header-hover-bg: #333;
    --filter-link-color: #79a1d1;
    --filter-link-hover-color: #5580a8;
    --filter-link-hover-bg: #2a3a4a;
    --filter-link-selected-bg: #293846;
    --filter-link-selected-color: #92b0d3;
    --responsive-border-bottom: #444;

    /* Region Colors (Better contrast for dark mode) */
    --region-jp-color: #e0778a;
    --region-eu-color: #91b3d5;
    --region-us-color: #8cc474;
}

/* ---------- Base Styles & Typography ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
.game-card-actions {
    position: absolute;
    top: 15px;    /* Matches the padding of .game-card-item */
    right: 15px;  /* Matches the padding of .game-card-item */
    display: flex;
    gap: 10px;    /* Adds space between the two buttons */
    z-index: 5;   /* Ensures they stay above other content */
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--body-background);
    color: var(--main-text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ---------- MAIN CONTENT LAYOUT ---------- */
.game-page {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    min-height: 100vh;
    margin-top: 160px; /* Changed from 0 to 80px to clear the header */
    padding: 20px;
    transition: margin-right 0.3s ease-in-out;
}

/* ---------- FILTER SIDEBAR ---------- */
#filter-slideout {
    width: 300px;
    flex-shrink: 0;
    position: sticky;
    /* CHANGE: This should be equal to the margin-top of .game-page (160px) 
       plus a little extra padding (e.g., 20px) for breathing room */
    top: 180px; 
    
    /* CHANGE: Subtract the top value from the viewport height 
       to ensure the scrollbar works correctly */
    height: calc(100vh - 180px); 
    
    overflow-y: auto;
    background-color: var(--card-background);
    border-right: 2px dotted var(--sidebar-border-color);
    padding: 20px;
    box-sizing: border-box;
    z-index: 10;
}

.filter-section {
    margin-bottom: 20px;
    border-bottom: 1px solid var(--separator-color);
    padding-bottom: 15px;
}

.filter-section:last-of-type {
    border-bottom: none;
}

.filter-header {
    font-weight: 600;
    font-size: 14px;
    color: var(--heading-color);
    padding: 8px 0;
    margin-bottom: 8px;
    background-color: var(--filter-header-bg);
    border-radius: 4px;
    padding-left: 10px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.filter-header:hover {
    background-color: var(--filter-header-hover-bg);
}

.filter-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    color: var(--main-text-color);
    font-size: 13px;
}

.filter-checkbox-item:hover {
    background-color: var(--filter-link-hover-bg);
}

.filter-checkbox-item input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.filter-checkbox-item input[type="checkbox"]:checked {
    accent-color: var(--filter-link-color);
}

/* ---------- MAIN CONTENT AREA ---------- */
.main-content-area {
    flex-grow: 1;
    padding: 20px;
    min-width: 0;
}

/* ---------- PLATFORM CARDS ---------- */
.platform-cards {
    display: flex;
    flex-direction: column;
    gap: 30px;
    overflow: hidden;
}

.platform-card {
    background-color: var(--card-background);
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.platform-card-header {
    border-bottom: 1px solid var(--card-border);
    margin-bottom: 15px;
    padding-bottom: 10px;
    transition: border-color 0.3s ease;
}

.platform-card-header h3 {
    font-size: 24px;
    margin: 0;
    color: var(--heading-color);
    transition: color 0.3s ease;
}

/* ---------- GAME CARD LAYOUT ---------- */
.game-card-item {
    background: var(--game-card-bg);
    padding: 15px;
	position: relative;
    border-radius: 8px;
    margin-bottom: 15px;
    transition: background 0.2s ease, border 0.2s ease;
    border: 1px solid transparent;
}

.game-card-item:hover {
    background: var(--game-card-hover-bg);
    border: 1px solid var(--game-card-hover-border);
}

.game-card-compact {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Title and Edition Header */
.game-card-header {
    border-bottom: 1px solid var(--separator-color);
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.game-title {
    font-size: 16px;
    font-weight: bold;
    color: var(--heading-color);
    margin: 0 0 4px 0;
    transition: color 0.3s ease;
}

.game-edition {
    font-size: 14px;
    color: var(--game-value-color);
    margin: 0;
    font-style: italic;
    transition: color 0.3s ease;
}

/* 1. THE CONTAINER - Keeps everything in a row */
.info-blocks {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 30px;           /* Sets a fixed, clean gap between columns */
    margin-bottom: 12px;
    align-items: flex-start;
    width: 100%;
}

/* 2. THE COLUMNS - Set to grow/shrink based on text content */
.info-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 0 1 auto;      /* Prevents forced stretching; hugs the content instead */
    min-width: 120px;    /* Prevents columns from becoming too narrow */
}

/* 3. THE ITEMS - Crucial for fixing wrapping and gaps */
.info-block-item {
    display: flex;
    justify-content: flex-start;
    align-items: baseline;
    padding: 2px 0;
    font-size: 14px;
    gap: 8px;
    /* Changed these to allow the column to expand with the links */
    white-space: normal; 
    overflow: visible;
    flex-wrap: wrap; 
}

.info-block-label {
    font-weight: 600;
    color: var(--game-label-color);
    transition: color 0.3s ease;
    flex-shrink: 0;
}

.info-block-value {
    color: var(--game-value-color);
    transition: color 0.3s ease;
    text-align: left;
}

/* ---------- MEDIA GRID ---------- */
.horizontal-media-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 12px;
    margin: 8px 0;       /* Reduced from 15px */
    padding: 8px 0;      /* Reduced from 10px/15px */
    border-top: 1px solid var(--separator-color);
    border-bottom: 1px solid var(--separator-color);
}

.media-grid-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80px;
}

.media-unit-label {
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    color: var(--game-label-color);
    margin-bottom: 4px;
}

.media-unit-box {
    width: 80px;
    height: 80px;
    background: var(--game-card-bg);
    border: 1px solid var(--card-border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.media-unit-box img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.media-unit-box img:hover {
    transform: scale(1.05);
}

.media-unit-upload {
    background: none;
    border: none;
    color: var(--sidebar-active-color);
    margin-top: 5px;
    cursor: pointer;
    font-size: 12px;
    opacity: 0.6;
}

.media-unit-upload:hover {
    opacity: 1;
}

.media-na {
    font-size: 9px;
    color: #999;
}
/* Update or add this to titledata_plus.css */
.pdf-canvas {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain; /* Prevents stretching */
    display: block;
    margin: auto;
    transition: transform 0.2s ease;
}

.pdf-canvas:hover {
    transform: scale(1.05); /* Matches the image hover effect */
}
/* ---------- CHECKSUM LINKS ---------- */
.link-checksum {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--sidebar-active-color);
    font-weight: bold;
}

.checksum-text {
    font-family: 'Courier New', monospace; 
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.link-checksum i {
    font-size: 0.8em;
    flex-shrink: 0; 
}

/* ---------- MODAL STYLES ---------- */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.7);
}

.modal-content {
    background-color: var(--card-background);
    margin: 10% auto;
    padding: 30px;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.modal-content-large {
    background-color: var(--card-background);
    margin: 5% auto;
    padding: 20px;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    text-align: center;
}

.modal-content-large img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 8px;
}

.close {
    color: var(--main-text-color);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.close:hover,
.close:focus {
    color: #f00;
}

.modal-content h2 {
    color: var(--heading-color);
    margin-top: 0;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--game-label-color);
}

.form-group input[type="file"],
.form-group input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 2px solid var(--card-border);
    border-radius: 4px;
    background-color: var(--body-background);
    color: var(--main-text-color);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--game-value-color);
    font-size: 12px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.btn-primary, .btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s ease;
}

.btn-primary {
    background: #0066cc;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #0052a3;
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--separator-color);
    color: var(--main-text-color);
}

.btn-secondary:hover {
    background: #999;
}

#upload-status {
    margin: 15px 0;
    min-height: 25px;
}

#upload-status p {
    margin: 0;
    padding: 10px;
    border-radius: 4px;
    background: var(--game-card-bg);
}
/* ---------- SECTION DIVIDERS (Horizontal Lines) ---------- */
.language-section, 
.additional-info, 
.hardware-addon-section,
.title-tags-section {
    padding-top: 8px;    /* Reduced from 12px */
    margin-top: 8px;     /* Reduced from 12px */
    border-top: 1px solid var(--separator-color);
    display: flex;
    flex-direction: column;
    gap: 4px;            /* Tighter internal spacing */
}

/* ---------- HARDWARE & ADD-ONS STYLING ---------- */
.hardware-item,
.language-item,
.additional-info-item {
    display: flex;
    gap: 8px;
    font-size: 14px;
}

.hardware-label,
.language-label,
.additional-info-label,
.tags-label {
    font-weight: 600;
    color: var(--game-label-color);
    flex-shrink: 0;
}

.hardware-value,
.language-value,
.additional-info-value {
    color: var(--game-value-color);
}

.peripheral-link {
    color: var(--sidebar-active-color);
    text-decoration: none;
}

.peripheral-link:hover {
    text-decoration: underline;
}

/* ---------- TAG PILLS ---------- */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.tag-label {
    background-color: var(--sidebar-active-bg);
    color: var(--sidebar-active-color);
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--sidebar-active-border);
}

/* ---------- RESPONSIVE DESIGN ---------- */
@media (max-width: 900px) {
    .game-page {
        flex-direction: column;
    }
    
    #filter-slideout {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 2px dotted var(--sidebar-border-color);
    }

    .info-blocks {
        flex-wrap: wrap;
    }

    .info-block {
        width: 100% !important;
    }
}

/* Dark mode adjustments for buttons */
@media (prefers-color-scheme: dark) {
    .btn-primary {
        background: #79a1d1;
    }
    
    .btn-primary:hover:not(:disabled) {
        background: #5580a8;
    }
}

body[data-theme='dark'] .btn-primary {
    background: #79a1d1;
}

body[data-theme='dark'] .btn-primary:hover:not(:disabled) {
    background: #5580a8;
}
/* =================================
   HELP ICON SYSTEM FOR GAME CARDS
   ================================= */
/* Help icon styling - matches horizontalmenu.php tooltip style */
.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    margin-left: 4px;
    background-color: #007bff;
    color: white;
    border-radius: 50%;
    font-size: 10px;
    font-weight: bold;
    cursor: help;
    position: relative;
    vertical-align: middle;
    transition: all 0.2s ease;
    font-family: 'Segoe UI', Tahoma, sans-serif;
}

.help-icon:hover {
    background-color: #0056b3;
    transform: scale(1.1);
}

/* Make labels with help icons have pointer cursor on the label text too */
.info-block-label:has(.help-icon),
.hardware-label:has(.help-icon),
.language-label:has(.help-icon),
.additional-info-label:has(.help-icon),
.tags-label:has(.help-icon),
.media-unit-label:has(.help-icon),
.game-title:has(.help-icon) {
    cursor: help;
}

/* Ensure help icons align properly in different contexts */
.info-block-item .help-icon,
.hardware-item .help-icon,
.language-item .help-icon,
.additional-info-item .help-icon {
    flex-shrink: 0;
}

/* Help icon in section headers */
.game-card-header .help-icon {
    font-size: 9px;
    width: 13px;
    height: 13px;
}

/* Help icon in media labels */
.media-unit-label .help-icon {
    font-size: 8px;
    width: 12px;
    height: 12px;
    margin-left: 3px;
}

/* Dark mode adjustments for help icons */
@media (prefers-color-scheme: dark) {
    .help-icon {
        background-color: #79a1d1;
    }
    
    .help-icon:hover {
        background-color: #5580a8;
    }
}

body[data-theme='dark'] .help-icon {
    background-color: #79a1d1;
}

body[data-theme='dark'] .help-icon:hover {
    background-color: #5580a8;
}

/* Ensure help icons don't break layout in compact spaces */
.info-block-item {
    align-items: baseline;
}

/* Adjust spacing when help icon is present */
.info-block-label:has(.help-icon) {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.hardware-label:has(.help-icon),
.language-label:has(.help-icon),
.additional-info-label:has(.help-icon),
.tags-label:has(.help-icon) {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

/* Make the entire label clickable for better UX */
.label-with-help {
    display: inline-flex;
    align-items: center;
    cursor: help;
    gap: 2px;
}

/* Prevent help icon from interfering with text selection */
.help-icon {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}
/* Hide the entire info-block-item if the programmer-links span is empty */
.info-block-item:has(.programmer-links:empty) {
    display: none;
}
/* Responsive adjustments */
@media (max-width: 900px) {
    .help-icon {
        width: 16px;
        height: 16px;
        font-size: 11px;
    }
    
    .media-unit-label .help-icon {
        width: 13px;
        height: 13px;
        font-size: 9px;
    }
}

/* Animation for help icon on first view */
@keyframes helpPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
}

/* Optional: Add subtle pulse animation on page load to draw attention */
.help-icon.new {
    animation: helpPulse 2s ease-in-out 3;
}

/* =================================
    BUTTON STYLES FOR HELP ICONS TOGGLE
    ================================= */
.button-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.button-row {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
}

/* Style for text buttons */
.view-options-btn {
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    border: none;
    background-color: var(--card-background);
    color: var(--main-text-color);
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: background-color 0.3s ease, color 0.3s ease;
    border: 1px solid var(--card-border);
}

/* Hover effect */
.view-options-btn:hover {
    background-color: var(--filter-header-hover-bg);
}

/* Text button style */
.text-btn {
    font-weight: 500;
}

/* Help Icons status indicator */
#help-icons-status {
    font-weight: bold;
    transition: color 0.3s ease;
}

/* ON state - Green */
#help-icons-status.status-on {
    color: #28a745;
}

/* OFF state - Red */
#help-icons-status.status-off {
    color: #dc3545;
}

/* Dark mode button adjustments */
body[data-theme='dark'] .view-options-btn {
    background-color: var(--card-background);
    color: var(--main-text-color);
    border-color: var(--card-border);
}

body[data-theme='dark'] .view-options-btn:hover {
    background-color: var(--filter-header-hover-bg);
}/* =================================
   RIGHT SLIDEOUT PANEL FIX
   ================================= */

/* Fix for right slideout panel positioning below horizontal navigation */

/* If the right panel uses a class like .right-slideout, .help-panel, or similar */
.right-slideout,
.help-slideout,
.help-panel,
.info-slideout,
[class*="right-panel"],
[class*="help-info"] {
    position: fixed;
    right: 0;
    /* Position it below the header and navigation bars
       Adjust this value based on your header height */
    top: 160px !important; /* Match the margin-top of .game-page */
    
    /* Calculate height to fit remaining viewport */
    height: calc(100vh - 160px) !important;
    
    width: 300px;
    background-color: var(--card-background);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    z-index: 1000;
    padding: 20px;
    border-left: 2px solid var(--sidebar-border-color);
}

/* Alternative selectors if the panel has an ID */
#right-slideout,
#help-slideout,
#help-panel,
#info-panel {
    position: fixed;
    right: 0;
    top: 150px !important;
    height: calc(100vh - 160px) !important;
    width: 300px;
    background-color: var(--card-background);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    z-index: 1000;
    padding: 20px;
    border-left: 2px solid var(--sidebar-border-color);
}
.recommendations {
    margin-top: 10px;
    border-top: 1px solid var(--separator-color);
    padding-top: 8px;
}

.rec-title {
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 6px;
    color: var(--game-label-color);
}

.rec-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.rec-item {
    font-size: 12px;
    padding: 4px 6px;
    background: var(--game-card-bg);
    border-radius: 4px;
    text-decoration: none;
    color: var(--main-text-color);
    transition: 0.2s;
}

.rec-item:hover {
    background: var(--game-card-hover-bg);
}
/* =================================
   RECOMMENDATION TOOLTIP STYLES
   ================================= */

.rec-item {
    position: relative;
    cursor: pointer;
}

.rec-tooltip {
    position: fixed;
    z-index: 10000;
    background-color: var(--card-background);
    border: 1px solid var(--game-card-hover-border); /* Uses your orange accent */
    border-radius: 6px;
    padding: 12px 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    pointer-events: none;
    font-size: 13px;
    
    /* --- VERTICAL STACKING FIX --- */
    display: flex;             /* Enable flexbox */
    flex-direction: column;    /* Stack children vertically */
    gap: 4px;                  /* Consistent spacing between lines */
    white-space: pre-line;     /* Respects the <br> tags from JS */
    line-height: 1.5;          /* Better readability for lists */
    min-width: 180px;          /* Prevents a skinny appearance */
}

.rec-tooltip-line {
    color: var(--main-text-color);
    padding: 2px 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Checkmark styling */
.rec-tooltip-line:before {
    content: '';
    display: inline-block;
}

/* Add visual indicator for high-value matches */
.rec-item[data-score]:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Fade in animation */
@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* Dark mode tooltip adjustments */
@media (prefers-color-scheme: dark) {
    .rec-tooltip {
        background-color: #2a2a2a;
        border-color: #444;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    }
}

body[data-theme='dark'] .rec-tooltip {
    background-color: #2a2a2a;
    border-color: #444;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .rec-tooltip {
        font-size: 11px;
        padding: 6px 10px;
        max-width: 250px;
    }
}
/* Responsive behavior for smaller screens */
@media (max-width: 1200px) {
    .right-slideout,
    .help-slideout,
    .help-panel,
    .info-slideout,
    #right-slideout,
    #help-slideout,
    #help-panel,
    #info-panel {
        width: 250px;
    }
}

@media (max-width: 900px) {
    .right-slideout,
    .help-slideout,
    .help-panel,
    .info-slideout,
    #right-slideout,
    #help-slideout,
    #help-panel,
    #info-panel {
        position: relative;
        top: auto !important;
        height: auto !important;
        width: 100%;
        border-left: none;
        border-top: 2px solid var(--sidebar-border-color);
        margin-top: 20px;
    }
}

/* Adjust main content when right slideout is visible */
.game-page.has-right-slideout {
    margin-right: 320px; /* 300px panel width + 20px gap */
}

@media (max-width: 1200px) {
    .game-page.has-right-slideout {
        margin-right: 270px;
    }
}

@media (max-width: 900px) {
    .game-page.has-right-slideout {
        margin-right: 0;
    }
}
/* BASE STYLE */
.best-version-btn,
.notes-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #444;
    border: 2px solid #666;
    color: #ccc;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* ---------------------------- */
/* GLOBAL VOTED (State 1 + 2)   */
/* ---------------------------- */
.best-version-btn.global-voted {
    background: #28a745;
    border-color: #1e7e34;
    color: #fff;
}

/* ---------------------------- */
/* USER VOTED (State 3 override)*/
/* ---------------------------- */
.best-version-btn.active {
    background: #007bff;
    border-color: #0056b3;
    color: #fff;
}

/* ---------------------------- */
/* LOGGED OUT                  */
/* ---------------------------- */
.best-version-btn.logged-out,
.notes-btn.logged-out {
    cursor: default;
}

/* ---------------------------- */
/* NOTES BLUE STATE            */
/* ---------------------------- */
.notes-btn.has-notes {
    background: #007bff;
    border-color: #0056b3;
    color: #fff;
}

/* ---------------------------- */
/* HOVER                      */
/* ---------------------------- */
.notes-btn:hover,
.best-version-btn:not(.logged-out):hover {
    background: #555;
    border-color: #888;
}
.playlist-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #444;
    border: 2px solid #666;
    color: #ccc;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.playlist-btn:hover {
    background: #ffc107; /* Warning/Gold color */
    color: #000;
    border-color: #e0a800;
}
/* =================================
   RECOMMENDATION HEADER & SELECTOR
   ================================= */
.rec-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.rec-title {
    font-size: 12px;
    font-weight: bold;
    color: var(--game-label-color);
    margin-bottom: 0; /* Removed bottom margin since flexbox handles spacing */
}

.rec-algo-select {
    font-size: 11px;
    padding: 2px 4px;
    border-radius: 4px;
    border: 1px solid var(--separator-color);
    background-color: var(--card-background);
    color: var(--main-text-color);
    cursor: pointer;
    transition: border-color 0.2s ease, outline 0.2s ease;
}

.rec-algo-select:focus {
    outline: none;
    border-color: var(--sidebar-active-color);
}

.rec-settings-link {
    margin-top: 8px;
    font-size: 11px;
}

.rec-settings-link a {
    color: var(--sidebar-active-color);
    text-decoration: none;
    transition: opacity 0.2s;
}

.rec-settings-link a:hover {
    opacity: 0.8;
    text-decoration: underline;
}
/* ==================================== */
/* RECOMMENDATION MODEL BLOCK FORMATS   */
/* ==================================== */
.rec-title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rec-title {
    font-weight: bold;
    font-size: 1rem;
    color: var(--heading-color);
}

/* Priority parameters highlight bar */
.rec-priority {
    font-size: 0.75rem;
    color: orange;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 2px;
}

/* Subdued layout presentation box for sentences */
.rec-description {
    font-size: 0.85rem;
    line-height: 1.45;
    color: var(--main-text-color);
    margin: 8px 0 14px 0;
    padding-left: 8px;
    border-left: 3px solid var(--separator-color);
    max-width: 850px;
}