:root {
    --bg: #0e0e0e;
    --panel: #181818;
    --panel-hover: #202020;
    --text: #eaeaea;
    --muted: #b0b0b0;
    --accent: #7cbcff;
    --border: #2a2a2a;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background: var(--bg);
    color: var(--text);
}

h1 {
    text-align: center;
    margin-bottom: 24px;
    font-weight: 600;
}

input, select {
    flex: 1;
    background: var(--panel);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 16px;
}

input::placeholder {
    color: var(--muted);
}

input:focus, select:focus {
    outline: none;
    border-color: var(--accent);
}

#stats {
    margin-bottom: 12px;
    font-size: 13px;
    letter-spacing: 0.3px;
    color: var(--muted);
    position: sticky;
    top: 64px;
    background: rgba(14, 14, 14, 0.9);
    z-index: 5;
    padding: 6px 0;
}

#modelList {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.controls-wrapper {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(14, 14, 14, 0.9);
    backdrop-filter: blur(6px);
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.controls {
    display: flex;
    gap: 12px;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
}

.model {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.model-body {
    flex-grow: 1;
}

.model-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 13px;
}

.model-footer .seperator {
    color: var(--muted);
    line-height: 1;
}

.model:hover {
    background: var(--panel-hover);
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.model .thumb-container {
    position: relative;
    width: 100%;
    height: 140px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    background: #111;
    border-radius: 6px;
}

.model .thumb-container::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.0), rgba(255, 255, 255, 0.05));
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
    border-radius: 6px;
}

.model .thumb-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.25s ease, filter 0.25s ease;
}

.model:hover .thumb-container img {
    transform: scale(1.06);
    filter: brightness(1.05);
}

.model:hover .thumb-container::after {
    opacity: 1;
}

.model strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
    line-height: 1.2;
}

.model em {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 0;
    line-height: 1.2;
}

.model a {
    color: var(--accent);
    text-decoration: none;
    font-size: 13px;
    line-height: 1.2;
    padding: 4px 2px;
}

.model a:hover {
    text-decoration: underline;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: var(--muted);
    font-size: 14px;
}

.game-header {
    grid-column: 1 / -1;
    margin: 24px 0 12px;
    font-size: 18px;
    font-weight: 600;
    color: var(--accent);
    border-bottom: 1px solid var(--border);
    padding-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    user-select: none;
    scroll-margin: 120px;
    padding: 8px 0;
}

.game-header::before {
    content: "▾";
    font-size: 14px;
    transition: transform 0.2s ease;
}

.game-header:active {
    opacity: 0.7;
}

.game-header.collapsed::before {
    transform: rotate(-90deg);
}

.game-header.collapsed {
    opacity: 0.8;
}

.game-header span.count {
    background: var(--accent);
    color: var(--bg);
    font-size: 18px;
    padding: 3px 6px;
    border-radius: 6px;
    margin-left: 8px;
    position: relative;
    top: -1px;
}

/* MOBILE */
@media (max-width: 600px) {
    body {
        font-size: 17px;
    }

    h1 {
        font-size: 22px;
        margin-bottom: 16px;
    }

    .container {
        padding: 0 14px;
    }

    .controls {
        flex-direction: column;
        gap: 14px;
    }

    input, select {
        font-size: 16px;
        padding: 16px 18px;
        border-radius: 12px;
    }

    #stats {
        font-size: 14px;
        top: 96px;
        padding: 8px 0;
    }

    #modelList {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .model {
        padding: 18px;
        border-radius: 16px;
    }

    .model .thumb-container {
        height: 200px;
        margin-bottom: 14px;
    }

    .model strong {
        font-size: 18px;
        line-height: 1.3;
    }

    .model em {
        font-size: 15px;
    }

    .model-footer {
        margin-top: 14px;
    }

    .model-footer a {
        font-size: 15px;
        padding: 8px 6px;
    }

    .game-header {
        font-size: 22px;
        padding: 16px 0;
        scroll-margin-top: 160px;
    }

    .game-header span.count {
        font-size: 15px;
        padding: 5px 10px;
    }

    .model:hover {
        transform: none;
        box-shadow: none;
    }
}