:root {
    --bg-color: #0b0c10;
    --card-bg: rgba(31, 33, 40, 0.6);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --accent: #5e35b1;
    --accent-light: #7e57c2;
    --highlight: #b388ff;
    --rating-bg: rgba(94, 53, 177, 0.3);
    --rating-color: #d1c4e9;
    --glass-blur: 12px;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Background gradient animation */
.background-animation {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(94, 53, 177, 0.15) 0%, rgba(11, 12, 16, 0) 50%);
    animation: pulse 15s infinite alternate ease-in-out;
    z-index: -1;
    pointer-events: none;
}

@keyframes pulse {
    0% { transform: translate(10%, 10%) scale(1); }
    100% { transform: translate(-10%, -10%) scale(1.1); }
}

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

header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-bottom: 3rem;
    gap: 1.5rem;
}

.logo h1 {
    font-size: 2.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #b388ff, #7e57c2);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.logo p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 500;
}

.search-bar {
    width: 100%;
    max-width: 500px;
}

.search-bar input {
    width: 100%;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    background: rgba(31, 33, 40, 0.8);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    backdrop-filter: blur(var(--glass-blur));
}

.search-bar input:focus {
    outline: none;
    border-color: var(--accent-light);
    box-shadow: 0 0 0 4px rgba(126, 87, 194, 0.2);
}

.filter-container {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
    width: 100%;
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
    background: rgba(31, 33, 40, 0.4);
    padding: 0.4rem;
    border-radius: 50px;
    border: 1px solid var(--card-border);
    backdrop-filter: blur(var(--glass-blur));
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: 50px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
}

.filter-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.filter-btn.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 12px rgba(94, 53, 177, 0.4);
}

/* Announcement Section */
.announcement-section {
    background: rgba(31, 33, 40, 0.6);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    animation: fadeIn 0.8s ease-out;
}

.announcement-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--card-border);
}

.announcement-icon {
    font-size: 1.2rem;
}

.announcement-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.announcement-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-height: 150px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.announcement-list::-webkit-scrollbar {
    width: 6px;
}

.announcement-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.announcement-item {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    font-size: 0.9rem;
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.announcement-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.announcement-date {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    min-width: 85px;
}

.announcement-msg, .announcement-link {
    line-height: 1.4;
    text-decoration: none;
    transition: all 0.2s ease;
}

.announcement-link:hover {
    text-decoration: underline;
    opacity: 0.8;
}

.announcement-item.add .announcement-msg, .announcement-item.add .announcement-link {
    color: #4ade80; /* Light green */
}

.announcement-item.remove .announcement-msg, .announcement-item.remove .announcement-link {
    color: #f87171; /* Light red */
}

.announcement-more-btn {
    display: block;
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding: 0.8rem 0 0.4rem;
    cursor: pointer;
    transition: color 0.2s ease;
    text-align: center;
    font-weight: 500;
}

.announcement-more-btn:hover {
    color: var(--highlight);
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background: var(--card-bg);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    backdrop-filter: blur(var(--glass-blur));
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sort-options label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.sort-options select {
    padding: 0.5rem 1rem;
    background: rgba(20, 21, 26, 0.8);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    border-radius: 8px;
    font-family: inherit;
    cursor: pointer;
    outline: none;
}

.sort-options select:focus {
    border-color: var(--accent-light);
}

.stats {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    backdrop-filter: blur(var(--glass-blur));
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px -10px rgba(94, 53, 177, 0.4);
    border-color: rgba(179, 136, 255, 0.3);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.game-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.badge {
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.difficulty-badge {
    background: rgba(255, 255, 255, 0.1);
    color: #e5e7eb;
}

.card-metrics {
    display: flex;
    gap: 1rem;
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--card-border);
}

.metric {
    display: flex;
    flex-direction: column;
}

.metric-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--highlight);
}

.metric-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

footer {
    text-align: center;
    margin-top: 4rem;
    padding: 2rem 0;
    border-top: 1px solid var(--card-border);
}

footer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

footer a {
    color: var(--accent-light);
    text-decoration: none;
    transition: color 0.2s ease;
}

footer a:hover {
    color: var(--highlight);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 3rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--card-border);
    backdrop-filter: blur(var(--glass-blur));
}

.page-btn {
    padding: 0.6rem 1.2rem;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.page-btn:hover:not(:disabled) {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(94, 53, 177, 0.3);
}

.page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.page-num {
    padding: 0.6rem 1rem;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 40px;
    text-align: center;
}

.page-num:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-light);
}

.page-num.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.page-num.dots {
    cursor: default;
    background: transparent;
    border: none;
}

.page-jump {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 1px solid var(--card-border);
}

.page-jump input {
    width: 60px;
    padding: 0.6rem;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    background: rgba(20, 21, 26, 0.8);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    text-align: center;
}

.page-jump input:focus {
    outline: none;
    border-color: var(--accent-light);
}

/* Hide arrow on number input */
.page-jump input::-webkit-outer-spin-button,
.page-jump input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .controls {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .logo h1 {
        font-size: 2.2rem;
}
}

/* Back to top button */
#backToTopBtn {
    display: none; /* Hidden by default */
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99;
    border: none;
    outline: none;
    background-color: var(--accent);
    color: white;
    cursor: pointer;
    padding: 12px 18px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(94, 53, 177, 0.4);
    transition: all 0.3s ease;
}

#backToTopBtn:hover {
    background-color: var(--highlight);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(179, 136, 255, 0.5);
}

/* My List Styles */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.btn-group {
    display: flex;
    gap: 0.5rem;
}

.bookmark-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 2px 5px;
    border-radius: 4px;
    line-height: 1;
}

.bookmark-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--highlight);
    transform: scale(1.1);
}

.bookmark-btn.active {
    color: #ffca28; /* Gold Star */
}

.mylist-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--card-border);
    margin-bottom: 2rem;
    backdrop-filter: blur(var(--glass-blur));
}

.list-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
}

.list-selector select {
    padding: 0.5rem 1rem;
    background: rgba(20, 21, 26, 0.8);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    border-radius: 8px;
    font-family: inherit;
    cursor: pointer;
    min-width: 200px;
}

.list-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.control-btn {
    padding: 0.8rem 1.5rem;
    background: var(--accent);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-btn.mini {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.control-btn.danger {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.5);
}

.control-btn:hover {
    background: var(--highlight);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(94, 53, 177, 0.3);
}

.control-btn.danger:hover {
    background: #ef4444;
    color: white;
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeInModal 0.3s ease;
}

@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: rgba(20, 21, 26, 0.9);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: slideInModal 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInModal {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to right, rgba(94, 53, 177, 0.1), transparent);
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--highlight);
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-btn:hover {
    color: white;
}

.modal-body {
    padding: 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-body label {
    display: block;
    margin-bottom: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.modal-body input[type="text"] {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.modal-body input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-light);
}

.list-selection-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
    border-radius: 10px;
    transition: background 0.2s ease;
    cursor: pointer;
    margin-bottom: 0.5rem;
}

.list-selection-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.list-selection-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--accent-light);
    cursor: pointer;
}

.list-selection-item span {
    font-weight: 500;
    flex-grow: 1;
}

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