 /* ===========================================
    Audible Credit Optimizer — Steam Dark Theme
    Inspired by store.steampowered.com
    =========================================== */
 
 /* --- CSS Variables --- */
 :root {
     --bg-primary: #1b2838;
     --bg-secondary: #171a21;
     --bg-card: #2a475e;
     --bg-card-hover: #3a6b87;
     --bg-input: #2a3f4e;
     --bg-table-row: #1e3040;
     --bg-table-row-alt: #1a2c3a;
     --bg-table-hover: #2a475e;
     --bg-hero: linear-gradient(135deg, #171a21 0%, #1b2838 40%, #2a475e 100%);
 
     --text-primary: #c6d4df;
     --text-secondary: #8f98a0;
     --text-muted: #626366;
     --text-accent: #66c0f4;
     --text-link: #66c0f4;
     --text-heading: #ffffff;
 
     --accent-primary: #66c0f4;
     --accent-secondary: #4b6b7e;
     --accent-green: #a4d007;
     --accent-red: #c44534;
     --accent-orange: #d97828;
     --accent-yellow: #c4b007;
     --accent-purple: #8b5cf6;
 
     --border-color: #4b6b7e;
     --border-light: #3a4f5e;
 
     --radius-sm: 3px;
     --radius-md: 5px;
     --radius-lg: 8px;
 
     --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
     --header-height: 64px;
 }
 
 /* --- Reset & Base --- */
 *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
 
 html { font-size: 15px; scroll-behavior: smooth; }
 
 body {
     font-family: var(--font-family);
     background: var(--bg-primary);
     color: var(--text-primary);
     line-height: 1.6;
     min-height: 100vh;
     -webkit-font-smoothing: antialiased;
 }
 
 a { color: var(--text-link); text-decoration: none; transition: color 0.15s; }
 a:hover { color: #ffffff; }
 
 img { max-width: 100%; height: auto; vertical-align: middle; }
 
 /* --- Typography --- */
 h1, h2, h3, h4 { color: var(--text-heading); font-weight: 600; line-height: 1.3; }
 
 .text-accent { color: var(--accent-primary); }
 
 /* --- Buttons --- */
 .btn {
     display: inline-flex;
     align-items: center;
     gap: 0.4em;
     font-family: var(--font-family);
     font-weight: 500;
     font-size: 0.9rem;
     padding: 0.55em 1.1em;
     border-radius: var(--radius-sm);
     border: none;
     cursor: pointer;
     transition: all 0.15s ease;
     text-decoration: none;
     white-space: nowrap;
 }
 
 .btn-primary {
     background: var(--accent-primary);
     color: #fff;
 }
 .btn-primary:hover { background: #88d0f7; color: #fff; }
 
 .btn-accent {
     background: linear-gradient(135deg, #54a0d3, #66c0f4);
     color: #fff;
     font-weight: 600;
     padding: 0.6em 1.3em;
 }
 .btn-accent:hover { background: linear-gradient(135deg, #66c0f4, #88d0f7); color: #fff; }
 
 .btn-hero {
     background: linear-gradient(135deg, #54a0d3, #66c0f4);
     color: #fff;
     font-size: 1.05rem;
     font-weight: 600;
     padding: 0.8em 1.8em;
     border-radius: var(--radius-md);
     box-shadow: 0 4px 15px rgba(102, 192, 244, 0.3);
 }
 .btn-hero:hover {
     background: linear-gradient(135deg, #66c0f4, #88d0f7);
     box-shadow: 0 6px 20px rgba(102, 192, 244, 0.4);
     color: #fff;
 }
 
 .btn-large { font-size: 1.1rem; padding: 1em 2.2em; }
 
 .btn-sm { font-size: 0.82rem; padding: 0.4em 0.8em; }
 
 .btn-table {
     background: var(--accent-primary);
     color: #fff;
     font-size: 0.8rem;
     padding: 0.35em 0.75em;
     border-radius: var(--radius-sm);
 }
 .btn-table:hover { background: #88d0f7; color: #fff; }
 
 /* --- Header --- */
 .site-header {
     position: sticky;
     top: 0;
     z-index: 100;
     background: var(--bg-secondary);
     border-bottom: 1px solid rgba(75, 107, 126, 0.3);
     box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
 }
 
 .header-inner {
     max-width: 1360px;
     margin: 0 auto;
     padding: 0 20px;
     height: var(--header-height);
     display: flex;
     align-items: center;
     gap: 24px;
 }
 
 .logo {
     display: flex;
     align-items: center;
     gap: 8px;
     color: var(--text-heading);
     font-weight: 700;
     font-size: 1.1rem;
     flex-shrink: 0;
 }
 .logo:hover { color: var(--text-heading); }
 .logo-icon { width: 26px; height: 26px; color: var(--accent-primary); }
 .logo-accent { color: var(--accent-primary); }
 
 .main-nav {
     display: flex;
     gap: 4px;
     flex-wrap: wrap;
     flex: 1;
 }
 .nav-link {
     color: var(--text-secondary);
     font-size: 0.82rem;
     padding: 6px 12px;
     border-radius: var(--radius-sm);
     transition: all 0.15s;
 }
 .nav-link:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.05); }
 .nav-link.active { color: var(--text-heading); background: rgba(102, 192, 244, 0.1); }
 
 .header-cta { flex-shrink: 0; }
 
 /* --- Hero Banner --- */
 .hero-banner {
     position: relative;
     background: var(--bg-hero);
     padding: 60px 20px 40px;
     text-align: center;
     overflow: hidden;
 }
 .hero-bg {
     position: absolute;
     top: -50%;
     left: -50%;
     width: 200%;
     height: 200%;
     background: radial-gradient(ellipse at 30% 50%, rgba(102, 192, 244, 0.08) 0%, transparent 60%),
                 radial-gradient(ellipse at 70% 50%, rgba(164, 208, 7, 0.05) 0%, transparent 50%);
     pointer-events: none;
 }
 
 .hero-content {
     position: relative;
     max-width: 800px;
     margin: 0 auto;
 }
 .hero-title {
     font-size: 2.2rem;
     font-weight: 700;
     margin-bottom: 12px;
 }
 .hero-subtitle {
     color: var(--text-secondary);
     font-size: 1.05rem;
     max-width: 600px;
     margin: 0 auto 24px;
     line-height: 1.5;
 }
 .hero-actions { margin-bottom: 32px; }
 
 .hero-stats {
     display: flex;
     justify-content: center;
     gap: 40px;
 }
 .stat { text-align: center; }
 .stat-value {
     display: block;
     font-size: 1.6rem;
     font-weight: 700;
     color: var(--accent-primary);
 }
 .stat-label {
     font-size: 0.8rem;
     color: var(--text-muted);
     text-transform: uppercase;
     letter-spacing: 0.05em;
 }
 
 /* --- Category Hero --- */
 .category-hero {
     background: var(--bg-hero);
     padding: 40px 20px;
     text-align: center;
 }
 
 /* --- Section Headers --- */
 .section-header {
     max-width: 1360px;
     margin: 0 auto 20px;
     padding: 0 20px;
 }
 .section-title {
     font-size: 1.4rem;
     font-weight: 600;
     display: inline;
     margin-right: 12px;
 }
 .section-subtitle {
     color: var(--text-secondary);
     font-size: 0.88rem;
 }
 
 /* --- Featured Picks (Steam Store Carousel) --- */
 .featured-section {
     padding: 32px 0;
     background: var(--bg-secondary);
     border-bottom: 1px solid rgba(75, 107, 126, 0.2);
 }
 
 .featured-carousel {
     max-width: 1360px;
     margin: 0 auto;
     padding: 0 20px;
     overflow-x: auto;
     -webkit-overflow-scrolling: touch;
     scrollbar-width: thin;
     scrollbar-color: var(--accent-secondary) transparent;
 }
 .featured-carousel::-webkit-scrollbar { height: 6px; }
 .featured-carousel::-webkit-scrollbar-track { background: transparent; }
 .featured-carousel::-webkit-scrollbar-thumb { background: var(--accent-secondary); border-radius: 3px; }
 
 .carousel-track {
     display: flex;
     gap: 16px;
     padding-bottom: 8px;
 }
 
 .featured-card {
     flex: 0 0 220px;
     background: var(--bg-card);
     border-radius: var(--radius-md);
     border: 1px solid rgba(75, 107, 126, 0.3);
     overflow: hidden;
     transition: all 0.2s;
     position: relative;
     display: flex;
     flex-direction: column;
 }
 .featured-card:hover {
     background: var(--bg-card-hover);
     border-color: var(--accent-primary);
     transform: translateY(-2px);
     box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
 }
 
 .card-badge {
     position: absolute;
     top: 8px;
     left: 8px;
     z-index: 2;
     font-size: 0.7rem;
     font-weight: 700;
     padding: 3px 8px;
     border-radius: var(--radius-sm);
     text-transform: uppercase;
     letter-spacing: 0.05em;
 }
 .badge-legendary { background: var(--accent-purple); color: #fff; }
 .badge-excellent { background: var(--accent-green); color: #1b2838; }
 .badge-great { background: var(--accent-primary); color: #1b2838; }
 .badge-good { background: var(--accent-secondary); color: #fff; }
 .badge-decent { background: var(--text-muted); color: #fff; }
 
 .card-rating {
     position: absolute;
     top: 8px;
     right: 8px;
     z-index: 2;
     font-size: 0.75rem;
     color: var(--accent-yellow);
 }
 
 .card-price-badge {
     position: absolute;
     bottom: 80px;
     right: 8px;
     z-index: 2;
     background: rgba(23, 26, 33, 0.9);
     border-radius: var(--radius-sm);
     padding: 4px 8px;
     text-align: right;
     font-size: 0.7rem;
 }
 .price-label { display: block; color: var(--text-muted); font-size: 0.65rem; }
 .price-value { display: block; color: var(--accent-green); font-weight: 600; font-size: 0.9rem; }
 .credit-value { display: block; color: var(--accent-primary); font-size: 0.65rem; }
 
 .card-cover {
     width: 100%;
     aspect-ratio: 3/4;
     object-fit: cover;
     background: var(--bg-input);
 }
 .card-cover-placeholder {
     display: flex;
     flex-direction: column;
     align-items: center;
     justify-content: center;
     gap: 8px;
     color: var(--text-muted);
     font-size: 0.75rem;
     text-align: center;
     padding: 20px;
 }
 .card-cover-placeholder svg { width: 36px; height: 36px; opacity: 0.5; }
 
 .card-info {
     padding: 10px 12px;
     flex: 1;
     display: flex;
     flex-direction: column;
     gap: 2px;
 }
 .card-title {
     font-size: 0.85rem;
     font-weight: 600;
     color: var(--text-heading);
     line-height: 1.3;
     display: -webkit-box;
     -webkit-line-clamp: 2;
     -webkit-box-orient: vertical;
     overflow: hidden;
 }
 .card-author {
     font-size: 0.75rem;
     color: var(--text-secondary);
 }
 .card-category {
     font-size: 0.68rem;
     color: var(--accent-primary);
     margin-top: auto;
 }
 
 .card-actions {
     padding: 8px 12px;
     border-top: 1px solid rgba(75, 107, 126, 0.2);
 }
 .card-actions .btn { width: 100%; justify-content: center; }
 
 /* --- Table Section --- */
 .table-section {
     max-width: 1360px;
     margin: 0 auto;
     padding: 32px 20px;
 }
 
 /* --- Table Controls --- */
 .table-controls {
     display: flex;
     gap: 12px;
     margin-bottom: 20px;
     flex-wrap: wrap;
     align-items: center;
 }
 
 .search-box {
     position: relative;
     flex: 1;
     min-width: 250px;
 }
 .search-icon {
     position: absolute;
     left: 12px;
     top: 50%;
     transform: translateY(-50%);
     width: 16px;
     height: 16px;
     color: var(--text-muted);
     pointer-events: none;
 }
 .search-input {
     width: 100%;
     padding: 10px 12px 10px 36px;
     background: var(--bg-input);
     border: 1px solid var(--border-light);
     border-radius: var(--radius-sm);
     color: var(--text-primary);
     font-family: var(--font-family);
     font-size: 0.88rem;
     transition: border-color 0.15s;
 }
 .search-input::placeholder { color: var(--text-muted); }
 .search-input:focus { outline: none; border-color: var(--accent-primary); }
 
 .filter-group {
     display: flex;
     gap: 8px;
     flex-wrap: wrap;
 }
 .filter-select {
     background: var(--bg-input);
     border: 1px solid var(--border-light);
     border-radius: var(--radius-sm);
     color: var(--text-primary);
     font-family: var(--font-family);
     font-size: 0.82rem;
     padding: 10px 28px 10px 12px;
     cursor: pointer;
     appearance: none;
     background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238f98a0' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
     background-repeat: no-repeat;
     background-position: right 10px center;
 }
 .filter-select:focus { outline: none; border-color: var(--accent-primary); }
 
 /* --- Data Table --- */
 .table-wrapper {
     overflow-x: auto;
     border: 1px solid rgba(75, 107, 126, 0.2);
     border-radius: var(--radius-md);
     background: var(--bg-secondary);
 }
 
 .data-table {
     width: 100%;
     border-collapse: collapse;
     font-size: 0.85rem;
 }
 
 .data-table thead {
     background: var(--bg-secondary);
     border-bottom: 2px solid var(--border-color);
 }
 
 .data-table th {
     padding: 12px 10px;
     text-align: left;
     color: var(--text-secondary);
     font-weight: 600;
     font-size: 0.78rem;
     text-transform: uppercase;
     letter-spacing: 0.04em;
     white-space: nowrap;
     user-select: none;
 }
 
 .data-table th.sortable {
     cursor: pointer;
     transition: color 0.15s;
 }
 .data-table th.sortable:hover { color: var(--text-heading); }
 .data-table th.sortable::after {
     content: " ↕";
     font-size: 0.7rem;
     color: var(--text-muted);
     opacity: 0.5;
 }
 .data-table th.sort-asc::after { content: " ↑"; opacity: 1; color: var(--accent-primary); }
 .data-table th.sort-desc::after { content: " ↓"; opacity: 1; color: var(--accent-primary); }
 
 .data-table tbody tr {
     border-bottom: 1px solid rgba(75, 107, 126, 0.1);
     transition: background 0.12s;
 }
 .data-table tbody tr:nth-child(even) { background: var(--bg-table-row-alt); }
 .data-table tbody tr:nth-child(odd) { background: var(--bg-table-row); }
 .data-table tbody tr:hover { background: var(--bg-table-hover); }
 .data-table tbody tr.row-hidden { display: none; }
 
 .data-table td {
     padding: 10px;
     vertical-align: middle;
 }
 
 .col-cover { width: 50px; }
 .col-title { min-width: 200px; }
 .col-author { min-width: 140px; }
 .col-category { width: 100px; }
 .col-rating { width: 100px; }
 .col-runtime { width: 80px; }
 .col-price { width: 80px; }
 .col-value { width: 70px; }
 .col-action { width: 100px; }
 
 .cover-thumb {
     width: 40px;
     height: 54px;
     object-fit: cover;
     border-radius: 2px;
     background: var(--bg-input);
     display: block;
 }
 .cover-thumb-placeholder {
     display: flex;
     align-items: center;
     justify-content: center;
     background: var(--bg-input);
     color: var(--text-muted);
 }
 .cover-thumb-placeholder svg { width: 20px; height: 20px; }
 
 .category-tag {
     display: inline-block;
     background: rgba(102, 192, 244, 0.1);
     color: var(--accent-primary);
     font-size: 0.72rem;
     padding: 2px 8px;
     border-radius: 10px;
 }
 
 .stars { color: var(--accent-yellow); font-size: 0.8rem; }
 .rating-num { color: var(--text-secondary); font-size: 0.75rem; margin-left: 4px; }
 
 .value-badge {
     display: inline-block;
     font-weight: 700;
     font-size: 0.8rem;
     padding: 2px 8px;
     border-radius: var(--radius-sm);
     min-width: 30px;
     text-align: center;
 }
 
 .table-note {
     margin-top: 12px;
     color: var(--text-muted);
     font-size: 0.78rem;
 }
 
 /* --- Bottom CTA --- */
 .bottom-cta {
     background: var(--bg-hero);
     text-align: center;
     padding: 60px 20px;
     border-top: 1px solid rgba(75, 107, 126, 0.2);
 }
 .cta-content {
     max-width: 600px;
     margin: 0 auto;
 }
 .cta-content h2 { font-size: 1.6rem; margin-bottom: 10px; }
 .cta-content p { color: var(--text-secondary); margin-bottom: 24px; font-size: 1rem; }
 
 /* --- Footer --- */
 .site-footer {
     background: var(--bg-secondary);
     border-top: 1px solid rgba(75, 107, 126, 0.2);
     padding: 24px 20px;
 }
 .footer-inner {
     max-width: 1360px;
     margin: 0 auto;
     display: flex;
     flex-direction: column;
     gap: 10px;
 }
 .footer-links {
     display: flex;
     gap: 20px;
     flex-wrap: wrap;
 }
 .footer-links a {
     color: var(--text-muted);
     font-size: 0.82rem;
 }
 .footer-links a:hover { color: var(--accent-primary); }
 .footer-disclaimer {
     color: var(--text-muted);
     font-size: 0.72rem;
     line-height: 1.5;
 }
 
 /* --- Responsive --- */
 @media (max-width: 900px) {
     .header-inner { gap: 12px; }
     .main-nav { display: none; }
     .hero-title { font-size: 1.6rem; }
     .hero-stats { gap: 20px; }
     .stat-value { font-size: 1.2rem; }
     .table-controls { flex-direction: column; }
     .search-box { min-width: 100%; }
     .filter-group { width: 100%; }
     .filter-select { flex: 1; }
     .featured-card { flex: 0 0 170px; }
     .col-author, .col-runtime { display: none; }
     .col-title { min-width: 140px; }
     .card-price-badge { display: none; }
 }
 
 @media (max-width: 600px) {
     .hero-title { font-size: 1.3rem; }
     .hero-subtitle { font-size: 0.9rem; }
     .btn-hero { font-size: 0.9rem; padding: 0.7em 1.4em; }
     .col-cover { width: 36px; }
     .cover-thumb { width: 30px; height: 40px; }
     .col-category { display: none; }
     .col-value { display: none; }
     .data-table { font-size: 0.78rem; }
     .data-table td { padding: 8px 6px; }
     .data-table th { padding: 8px 6px; }
     .btn-table { font-size: 0.7rem; padding: 0.3em 0.5em; }
     .footer-links { flex-direction: column; gap: 8px; }
 }
 
 @media (max-width: 400px) {
     .col-rating { display: none; }
 }


/* --- Result Count --- */
.result-count {
    color: var(--text-secondary);
    font-size: 0.82rem;
    white-space: nowrap;
    padding: 10px 0;
}
.result-count strong {
    color: var(--text-primary);
}

/* --- Hamburger Menu --- */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-left: auto;
}
.hamburger-line {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: all 0.2s;
}
.hamburger.active .hamburger-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}
.hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
}
.hamburger.active .hamburger-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.mobile-nav-open { overflow: hidden; }
.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(23, 26, 33, 0.97);
    z-index: 99;
    flex-direction: column;
    padding: 20px;
    gap: 4px;
    overflow-y: auto;
}
.mobile-nav-overlay.open { display: flex; }
.mobile-nav-overlay .nav-link {
    font-size: 1rem;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
}
.mobile-nav-overlay .nav-link:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
}
.mobile-nav-overlay .nav-link.active {
    color: var(--text-heading);
    background: rgba(102, 192, 244, 0.1);
}
.mobile-nav-overlay .nav-cta {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(75, 107, 126, 0.3);
}
.mobile-nav-overlay .nav-cta .btn {
    width: 100%;
    justify-content: center;
    font-size: 0.95rem;
}

/* --- Scroll to Top --- */
.scroll-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 50;
    width: 44px;
    height: 44px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}
.scroll-top:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}
.scroll-top svg {
    width: 20px;
    height: 20px;
}

@media (max-width: 900px) {
    .hamburger { display: flex; }
}
@media (max-width: 600px) {
    .scroll-top {
        bottom: 16px;
        right: 16px;
        width: 38px;
        height: 38px;
    }
}
