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

:root {
    --bg-primary: #1c1c1c;
    --bg-secondary: #252525;
    --bg-hover: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent: #00ff88;
    --accent-dim: #00ff8830;
    --border: #4a4a4a;
    --success: #00ff88;
    --error: #ff4444;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

#feedback {
    font-size: 14px;
    font-style: italic;
    margin-top: 10px;
}
#feedback a {
    text-decoration: underline;
    color: var(--text-primary);
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
}

h1 {
    font-size: 3rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    color: #ffffff;
}

header h2 {
    font-size: 1.2rem;
    font-weight: 400;
}

@media (max-width: 768px) {
    body {
        line-height: unset;
    }

    h1 {
        line-height: 1.2;
        font-size: 2.2rem;
    }

    header h2 {
        font-size: 1.0rem;
        font-weight: 400;
    }

    .container {
        padding: 5px;
    }

    table thead {
        top: 0 !important;
    }
}

header {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}



.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.controls {
    position: sticky;
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 1rem;
    margin-bottom: 2rem;
    align-items: center;
    top: 0;
    padding: 15px;
    border: 2px solid var(--border);
    border-radius: 20px;
    background: var(--bg-secondary);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.search-container {
    position: relative;
}

input[type="text"] {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

select {
    padding: 1rem 2rem 1rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a0a0a0' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
}

select:hover {
    border-color: var(--accent);
}

button {
    padding: 1rem 2rem;
    background: var(--accent);
    border: none;
    border-radius: 12px;
    color: var(--bg-primary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

button:disabled:hover {
    transform: unset;
    box-shadow: unset;
    color: #515151;
    outline: unset;
}

button:disabled {
    color: #515151;
    background-color: #a0a0a0;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 255, 136, 0.3);
}

.table-container {
    background: var(--bg-secondary);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    position: sticky;
    top: 85px;
    background: var(--bg-primary);
    z-index: 100;
}

.game-title {
    position: sticky;
    left: 0;
    z-index: 1;
    background: rgba(37, 37, 37, 0.8);
}

th {
    background: var(--bg-primary);
    padding: 1.25rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    position: sticky;
    top: 0;
    z-index: 10;
}

#mainHeader th {
    color: var(--text-primary);
}
#subHeader th {
    padding-top: 0;
}

td {
    padding: 1.25rem;
    border-top: 1px solid var(--border);
}
#dateAddedHeader {
    width: 130px;
}
.suggestChangeHeader {
    padding-left: 0;
    padding-right: 0;
}

tr {
    transition: background 0.1s ease, transform 0.1s ease;
}
tr td:nth-child(2), td:nth-child(3), td:nth-child(4), td:nth-child(5), td:nth-child(6), td:nth-child(8) {
    text-align: center;
}

tr td:nth-child(8) button {
    width: 35px;
    height: 35px;
    padding: unset;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}
tr td:nth-child(8) button:hover {
    border-color: var(--accent);
    color: var(--accent);
}

tr:hover {
    background: var(--bg-hover);
}

.game-title {
    font-weight: 500;
    color: var(--text-primary);
}

.performance-badge {
    display: inline-block;
    padding: 0.35rem 0.0rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 500;
}

.res-badge {
    width: 150px;
}
.fps-badge {
    width: 70px;
}

.fps-high, .res-improved {
    background: rgba(0, 255, 136, 0.2);
    color: var(--accent);
    border: 2px solid var(--accent);
}

.fps-medium {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.res-ok {
    background: rgb(46, 46, 46);
}

.fps-low {
    background: rgba(255, 68, 68, 0.2);
    color: #ff4444;
}

.upgrade-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 500;
}

.upgrade-free {
    background: rgba(0, 255, 136, 0.2);
    color: var(--accent);
    border: 2px solid var(--accent);
}

.upgrade-paid {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.upgrade-none {
    background: rgba(255, 68, 68, 0.2);
    color: #ff4444;
}

.notes {
    color: var(--text-secondary);
    font-size: 0.9rem;
    max-width: 300px;
}

.stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.stat-card {
    background: var(--bg-secondary);
    padding: 1.5rem 2rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.stat-number {
    font-size: 2rem;
    font-weight: 300;
    color: var(--accent);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    opacity: 1;
}

.modal-content {
    position: absolute;
    left: 50%;
    top: 5%;
    transform: translate(-50%, 0) scale(0.9);
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    transition: transform 0.3s ease;
    max-height: 90%;
    overflow-y: auto;
}

.modal.show .modal-content {
    transform: translate(-50%, 0) scale(1.0);
}

.modal h2 {
    color: var(--accent);
}
.modal h3 {
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

.btn-cancel {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.btn-cancel:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 500;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 2000;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: var(--success);
    color: var(--bg-primary);
}

.notification.error {
    background: var(--error);
    color: var(--text-primary);
}

.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ALTCHA widget styling to match the theme */
altcha-widget {
    --altcha-color-base: var(--text-secondary);
    --altcha-color-text: var(--text-primary);
    --altcha-color-border: var(--border);
    --altcha-color-background: var(--bg-primary);
    --altcha-color-checkbox: var(--accent);
    --altcha-color-checkbox-check: var(--bg-primary);
}

.altcha[data-floating] {
    position: unset !important;
}

.altcha {
    position: unset !important;
    background-color: #454545 !important;
}

.hidden {
    display: none;
}

@media (max-width: 768px) {
    .controls {
        grid-template-columns: 1fr;
        position: unset;
    }

    .stats {
        flex-direction: column;
        gap: 1rem;
    }

    .table-container {
        overflow-x: auto;
        overflow-y: hidden;
    }

    table {
        min-width: 800px;
    }
}


.modal2 {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translate(-50%, 0);
    background: var(--bg-secondary);
    z-index: 9999;
    max-height: 100%;
    overflow-y: auto;
}
#modal2Wrap {
    position: absolute;
    backdrop-filter: blur(10px);
    width: 100%;
    height: 100%;
    top: 0;
    z-index: 9999;
}

#footer {
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-secondary);
}
#footer a {
    display: block;
    text-decoration: underline;
    color: var(--text-secondary);
}

#messageModalText {
    margin-bottom: 20px;
}
