body {
    background: #F8FAFC;
    color: #606c76;
    font-family: "Roboto Flex", sans-serif;
    font-optical-sizing: auto;
    font-weight: 300;
    font-style: normal;
    font-variation-settings:
        "slnt" 0,
        "wdth" 100,
        "GRAD" 0,
        "XOPQ" 96,
        "XTRA" 468,
        "YOPQ" 79,
        "YTAS" 750,
        "YTDE" -203,
        "YTFI" 738,
        "YTLC" 514,
        "YTUC" 712;
    font-size: 13px;
    letter-spacing: .01em;
    line-height: 1.2;
}

a {
    color: #b71c1c;
}

h2 {
    margin: 0;
    margin-bottom: 5px;
    padding: 0;
    font-size: 9px;
    text-transform: uppercase;
}

details summary {
    cursor: pointer;
}

details summary::-webkit-details-marker {
    display: none;
}

details>summary:first-of-type {
    list-style-type: none;
}

body {
    margin: 0;
    padding: 0;
    position: relative;
}

.search {
    background: #F1F5F8;
    display: flex;
    align-items: center;
    padding: 1em;
}

.wrapper {
    padding: 1em;
    position: relative;
}

.material-symbols-rounded {
    font-size: 24px;
}

.material-symbols-rounded.icon-medium {
    font-size: 18px;
}

.material-symbols-rounded.icon-small {
    font-size: 16px;
}

.facets {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    padding-bottom: 1em;
    position: relative;
    z-index: 10;
    flex-wrap: nowrap;
    background-color: #F8FAFC;
    gap: 1em;
}

.filter-dropdown {
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #fff;
    position: relative;
    padding: 0;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Active filter indicator - red bottom border */
.filter-dropdown.filter-active {
    border-bottom: 3px solid #b71c1c;
}

.filter-dropdown>summary {
    padding: 5px 10px;
    list-style: none;
    border: none;
    margin: 0;
    height: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    gap: 5px;
}

.filter-dropdown[open]>.filter-dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 50;
    background-color: #fff;
    border: 1px solid #ccc;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    padding: 5px 0;
}

.filter-dropdown-content {
    display: flex;
    flex-direction: column;
}

.clear-all {
    border-radius: 5px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex-grow: 1;
    cursor: pointer;
}

.clear-button {
    background: #b71c1c;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    box-sizing: border-box;
    height: 100%;
    width: 100%;
}

.logo {
    margin-right: 1em;
}

.search-box {
    max-width: 300px;
    margin-right: 1em;
    flex-grow: 1;
}

#search-input {
    width: 100%;
    padding: 0.5em;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    box-sizing: border-box;
}

.sort-by {
    max-width: 150px;
    margin-right: 1em;
    margin-left: 0.3em;
    flex-grow: 1;
}

#sort-select {
    padding: 0.5em;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
    font-size: 1em;
    box-sizing: border-box;
    height: calc(1em + 1em + 2px);
}


.stats {
    display: inline-block;
    margin-right: 1em;
    text-align: right;
    flex-grow: 1;
}

@media screen and (max-width: 530px) {
    .stats {
        display: none;
    }
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0;
    margin: 0 auto;
    padding: 0;
}

.game-card {
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* border: 1px solid rgba(0, 0, 0, 0.2); */
    border-width: 0 1px 1px 0;
}

.game-summary {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 130px;
    margin: 0;
    padding: 10px 15px;
    position: relative;
    list-style: none;
}

.game-image {
    display: block;
    margin: 0;
    max-width: 100%;
    max-height: 100%;
    border: 1px solid rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    box-shadow: 3px 3px 15px rgba(0, 0, 0, 0.3);
    image-rendering: smooth;
}

.game-image:hover {
    transform: scale(1.05);
    transition: all 0.2s ease-in-out;
    border: 1px solid rgba(0, 0, 0, 0.5);
}

.game-details {
    box-shadow: 1px 1px 15px rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    left: 8px;
    position: absolute;
    top: 8px;
    width: 400px;
    z-index: 100;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    font-size: 11px
}

.card-header {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #e0e0e0;
    position: relative;
}

.cover-image {
    height: 60px;
    margin-right: 15px;
    flex-shrink: 0;
}

.cover-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.title-section {
    flex: 1;
    min-width: 0;
}

.game-title {
    margin: 0 0 5px 0;
    font-size: 20px;
    line-height: 1.2;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
    line-height: 1.2;
}

.title-section .tag-chip {
    background: rgba(0, 0, 0, 0.2);
    color: #fff;
}

.stats-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 15px 10px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #555;
}

.complexity-gauge {
    transform: rotate(-90deg);
}

.complexity-gauge .gauge-bg {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 2.5;
}

.complexity-gauge .gauge-fg {
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.3s ease-out;
}

.complexity-gauge .gauge-text {
    font-size: 8px;
    text-anchor: middle;
    transform: rotate(90deg);
    transform-origin: 12px 12px;
    fill: #333;
}

.description-section {
    padding: 10px 15px;
    line-height: 1.5;
    border-bottom: 1px solid #e0e0e0;
}

.tags-section {
    padding: 10px 15px;
    border-bottom: 1px solid #e0e0e0;
}

.expansions-section {
    padding: 10px 15px;
}

.expansion-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.expansion-chip {
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 0.8em;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(0, 0, 0, 0.05);
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
}

.expansion-chip:hover {
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.2);
    color: #000;
}

.expansions-section div a {
    color: #b71c1c;
    text-decoration: none;
}

.expansions-section div a:hover {
    text-decoration: underline;
}

.close-button {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.3);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    padding: 0;
    transition: background-color 0.2s ease;
}

.close-button:hover {
    background: rgba(0, 0, 0, 0.6);
}

.teaser-text {
    line-height: 1.4;
}

.more-button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: inherit;
    padding: 0;
    margin: 0;
    display: inline;
}

.more-button:hover {
    text-decoration: underline;
}

.tag-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    font-size: 9px;
    margin-left: -5px
}

.tag-chip {
    padding: 4px 6px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.05);
}

.tag-chip.mechanics {
    background: #f5f5f5;
    color: #555;
    border-color: #ccc;
}

.tag-chip.categories {
    background: #f8f8f8;
    border-color: #ddd;
}

.bottom-info {
    padding: 10px 15px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: auto;
    flex-shrink: 0;
}

.loading {
    text-align: center;
    padding: 2em;
    font-size: 1.2em;
    color: #888;
}

.error {
    text-align: center;
    padding: 2em;
    color: #d32f2f;
    background: #ffeaea;
    border: 1px solid #ffcdd2;
    border-radius: 5px;
    margin: 1em;
}

.error pre {
    text-align: left;
    white-space: pre-wrap;
    font-family: inherit;
    margin: 1em 0;
    padding: 1em;
    background: #fff;
    border-radius: 3px;
    border: 1px solid #ffcdd2;
}

.no-results {
    text-align: center;
    padding: 2em;
    color: #888;
    font-style: italic;
}

.filter-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4em 0.8em;
    cursor: pointer;
    font-size: 0.9em;
    white-space: nowrap;
}

.filter-item-main {
    display: flex;
    align-items: center;
    gap: 0.5em;
    flex-shrink: 1;
    min-width: 0;
}

.filter-item-main span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.facet-count {
    color: #888;
    font-size: 0.9em;
    margin-left: 1em;
    flex-shrink: 0;
    background: #eee;
    padding: 2px 5px;
    border-radius: 5px;
}

.filter-item input {
    margin-right: 0.5em;
    vertical-align: middle;
}

.filter-item span {
    vertical-align: middle;
}

.filter-item:hover {
    background: rgba(183, 28, 28, 0.05);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5em;
    margin: 2em 0;
    flex-wrap: wrap;
}

.pagination button {
    padding: 0.5em 0.8em;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 5px;
}

.pagination button:hover {
    background: #f5f5f5;
}

.pagination button.current {
    background: #b71c1c;
    color: white;
    border-color: #b71c1c;
}

.pagination span {
    padding: 0.5em;
    color: #888;
}

.highlight {
    background: yellow;
    color: #333;
}
