:root {
    --bg-color: #f8f8f8;
    --text-main: #333;
    --text-subtle: #6e6e73;
    --accent: #62707d;
    --card-bg: #ffffff;
    --border: #eee;
    --table-header: #f5f5f5;
    --row-hover: rgba(98, 112, 125, 0.08);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a1a;
        --text-main: #e0e0e0;
        --text-subtle: #999;
        --accent: #79a1d1;
        --card-bg: #2a2a2a;
        --border: #444;
        --table-header: #333;
        --row-hover: rgba(121, 161, 209, 0.15);
    }
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 0;
}

/* CRITICAL CHANGE: 
   Removed max-width and margin: 0 auto 
*/
.container {
    width: 100vw;
    max-width: 100%;
    margin: 0;
    /* Changed from 20px to 160px at the top */
    padding: 160px 20px 20px 20px; 
    box-sizing: border-box;
}

.page-header { 
    margin-bottom: 20px; 
    padding-left: 10px;
}

/* Table Wrapper */
.achievements-table {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow-x: auto;
    width: 100%;        /* Forces the wrapper to be full width */
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

table {
    width: 100%;        /* Forces the table to fill the wrapper */
    border-collapse: collapse;
    font-size: 0.9rem;
    table-layout: auto; /* Allows columns to adjust to content while filling width */
}

th {
    background: var(--table-header);
    text-align: left;
    padding: 15px;
    color: var(--text-subtle);
    text-transform: uppercase;
    font-size: 0.75rem;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
}

/* Interactivity and Hover */
tbody tr {
    cursor: pointer;
    transition: background-color 0.1s ease;
}

tbody tr:hover { 
    background-color: var(--row-hover);
}

/* Column Specifics */
.title-cell { 
    font-weight: 600; 
    color: var(--accent);
    width: 35%; /* Gives the title room to breathe in a wide view */
}

.hash-cell code {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    background: var(--table-header);
    padding: 3px 6px;
    border-radius: 4px;
    color: var(--text-subtle);
}

.btn-edit {
    display: inline-block;
    padding: 5px 15px;
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.8rem;
    transition: 0.2s;
}

.btn-edit:hover {
    background: var(--accent);
    color: #fff;
}
/* Keep the full-width force rules */
#roms-fullwidth-page.container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    /* Ensure the !important rule also reflects the 160px offset */
    padding: 160px 20px 20px 20px !important;
    box-sizing: border-box;
    display: block !important;
}

table {
    width: 100% !important;
    border-collapse: collapse;
    table-layout: auto; 
}

/* Specific Column Tweak */
.title-cell {
    width: 20%;
    font-weight: 600;
    color: var(--accent);
}

.rom-name-cell {
    width: 25%;
    color: var(--text-main);
    font-style: italic;
    font-size: 0.85rem;
}

/* Ensure secondary data doesn't wrap awkwardly */
td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px; /* Prevents one giant cell from ruining the full-width look */
}

/* Allow the titles to wrap if needed */
.title-cell, .rom-name-cell {
    white-space: normal;
}

.center-text {
    text-align: center;
}

.user-cell {
    color: #3498db;
    font-weight: 600;
}
.filter-section {
        display: flex; 
        gap: 40px; 
        margin-bottom: 25px; 
        flex-wrap: wrap; 
        background: var(--card-background, #fff); 
        padding: 20px; 
        border-radius: 8px; 
        border: 1px solid var(--border-color, #e0e0e0);
    }
    .filter-group label {
        font-weight: 600; 
        display: block; 
        margin-bottom: 10px;
        color: var(--heading-color, #303d4e);
    }
    .radio-options {
        display: flex; 
        gap: 15px; 
        flex-wrap: wrap;
        align-items: center;
    }
    .radio-options label {
        font-weight: normal;
        margin-bottom: 0;
        cursor: pointer;
        font-size: 0.95em;
    }
    #titleSearch {
        padding: 8px 12px; 
        border-radius: 6px; 
        border: 1px solid var(--border-color, #ddd);
        background: var(--input-background, #fff);
        color: var(--text-color, #333);
    }