.library-panel { padding: 22px; }

.library-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 520px);
    gap: 18px;
    align-items: end;
}

.tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 170px;
    gap: 10px;
}

.search-box span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.search-box input, .tools select {
    width: 100%;
    min-height: 46px;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(5, 8, 22, 0.72);
    padding: 0 13px;
    outline: none;
}

.search-box input:focus, .tools select:focus { border-color: rgba(56, 189, 248, 0.72); }

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
    margin-top: 22px;
}

.game-card {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-height: 330px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel-strong);
    transition: transform 0.18s ease, border-color 0.18s ease;
}

.game-card:hover {
    transform: translateY(-3px);
    border-color: rgba(139, 92, 246, 0.55);
}

.game-art {
    position: relative;
    aspect-ratio: 4 / 3;
    margin: 0;
    background: #111827;
}

.game-art img, .missing-art {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.missing-art {
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 2rem;
    font-weight: 900;
}

.fav-button {
    position: absolute;
    top: 10px;
    right: 10px;
    min-height: 34px;
    padding: 0 10px;
    background: rgba(5, 8, 22, 0.72);
    border-color: var(--border);
    font-size: 0.76rem;
}

.fav-button.is-favorite, .secondary-action.is-favorite {
    color: #101827;
    background: var(--accent-3);
}

.game-info { padding: 14px 14px 8px; }
.system-badge { color: var(--accent-2); font-size: 0.72rem; font-weight: 900; }
.game-info h3 { margin: 7px 0 8px; font-size: 1rem; line-height: 1.35; }
.game-info p { margin: 0; color: var(--muted); font-size: 0.82rem; }
.play-button { margin: 0 14px 14px; }

.empty-state {
    margin-top: 20px;
    padding: 28px;
    text-align: center;
    border: 1px dashed var(--border);
    border-radius: 16px;
    color: var(--muted);
}
